vendor: 4,588 bytes, lines 1-91
1var __create = Object.create; 2var __defProp = Object.defineProperty; 3var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 4var __getOwnPropNames = Object.getOwnPropertyNames; 5var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty; 6var __require = /* @__PURE__ */ ((x2) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(x2, { 7 get: (a2, b2) => (typeof require < "u" ? require : a2)[b2] 8}) : x2)(function(x2) { 9 if (typeof require < "u") return require.apply(this, arguments); 10 throw Error('Dynamic require of "' + x2 + '" is not supported'); 11}); 12var __esm = (fn, res, err) => function() { 13 if (err) throw err[0]; 14 try { 15 return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; 16 } catch (e2) { 17 throw err = [e2], e2; 18 } 19}; 20var __commonJS = (cb, mod) => function() { 21 try { 22 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 23 } catch (e2) { 24 throw mod = 0, e2; 25 } 26}; 27var __export = (target, all) => { 28 for (var name in all) 29 __defProp(target, name, { get: all[name], enumerable: !0 }); 30}, __copyProps = (to, from, except, desc) => { 31 if (from && typeof from == "object" || typeof from == "function") 32 for (let key of __getOwnPropNames(from)) 33 !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 34 return to; 35}; 36var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 37 // If the importer is in node compatibility mode or this is not an ESM 38 // file that has been converted to a CommonJS file using a Babel- 39 // compatible transform (i.e. "__esModule" has not been set), then set 40 // "default" to the CommonJS "module.exports" for node compatibility. 41 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, 42 mod 43)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); 44 45// global-externals:react 46var react_exports = {}; 47__export(react_exports, { 48 Children: () => Children, 49 Component: () => Component, 50 Fragment: () => Fragment, 51 Profiler: () => Profiler, 52 PureComponent: () => PureComponent, 53 StrictMode: () => StrictMode, 54 Suspense: () => Suspense, 55 __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: () => __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, 56 act: () => act, 57 cloneElement: () => cloneElement, 58 createContext: () => createContext, 59 createElement: () => createElement, 60 createFactory: () => createFactory, 61 createRef: () => createRef, 62 default: () => react_default, 63 forwardRef: () => forwardRef, 64 isValidElement: () => isValidElement, 65 lazy: () => lazy, 66 memo: () => memo, 67 startTransition: () => startTransition, 68 unstable_act: () => unstable_act, 69 useCallback: () => useCallback, 70 useContext: () => useContext, 71 useDebugValue: () => useDebugValue, 72 useDeferredValue: () => useDeferredValue, 73 useEffect: () => useEffect, 74 useId: () => useId, 75 useImperativeHandle: () => useImperativeHandle, 76 useInsertionEffect: () => useInsertionEffect, 77 useLayoutEffect: () => useLayoutEffect, 78 useMemo: () => useMemo, 79 useReducer: () => useReducer, 80 useRef: () => useRef, 81 useState: () => useState, 82 useSyncExternalStore: () => useSyncExternalStore, 83 useTransition: () => useTransition, 84 version: () => version 85}); 86var react_default, Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, act, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, startTransition, unstable_act, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, version, init_react = __esm({ 87 "global-externals:react"() { 88 react_default = __REACT__, { Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, act, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, startTransition, unstable_act, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, version } = __REACT__; 89 } 90}); 91
vendor: 339 bytes, lines 92-100
92// ../../node_modules/prop-types/lib/ReactPropTypesSecret.js 93var require_ReactPropTypesSecret = __commonJS({ 94 "../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) { 95 "use strict"; 96 var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; 97 module.exports = ReactPropTypesSecret; 98 } 99}); 100
vendor: 1,639 bytes, lines 101-151
101// ../../node_modules/prop-types/factoryWithThrowingShims.js 102var require_factoryWithThrowingShims = __commonJS({ 103 "../../node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) { 104 "use strict"; 105 var ReactPropTypesSecret = require_ReactPropTypesSecret(); 106 function emptyFunction() { 107 } 108 function emptyFunctionWithReset() { 109 } 110 emptyFunctionWithReset.resetWarningCache = emptyFunction; 111 module.exports = function() { 112 function shim(props, propName, componentName2, location2, propFullName, secret) { 113 if (secret !== ReactPropTypesSecret) { 114 var err = new Error( 115 "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" 116 ); 117 throw err.name = "Invariant Violation", err; 118 } 119 } 120 shim.isRequired = shim; 121 function getShim() { 122 return shim; 123 } 124 var ReactPropTypes = { 125 array: shim, 126 bigint: shim, 127 bool: shim, 128 func: shim, 129 number: shim, 130 object: shim, 131 string: shim, 132 symbol: shim, 133 any: shim, 134 arrayOf: getShim, 135 element: shim, 136 elementType: shim, 137 instanceOf: getShim, 138 node: shim, 139 objectOf: getShim, 140 oneOf: getShim, 141 oneOfType: getShim, 142 shape: getShim, 143 exact: getShim, 144 checkPropTypes: emptyFunctionWithReset, 145 resetWarningCache: emptyFunction 146 }; 147 return ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes; 148 }; 149 } 150}); 151
vendor: 248 bytes, lines 152-159
152// ../../node_modules/prop-types/index.js 153var require_prop_types = __commonJS({ 154 "../../node_modules/prop-types/index.js"(exports, module) { 155 module.exports = require_factoryWithThrowingShims()(); 156 var ReactIs, throwOnDirectAccess; 157 } 158}); 159
vendor: 2,998 bytes, lines 160-221
160// ../../node_modules/react-fast-compare/index.js 161var require_react_fast_compare = __commonJS({ 162 "../../node_modules/react-fast-compare/index.js"(exports, module) { 163 var hasElementType = typeof Element < "u", hasMap = typeof Map == "function", hasSet = typeof Set == "function", hasArrayBuffer = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView; 164 function equal3(a2, b2) { 165 if (a2 === b2) return !0; 166 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { 167 if (a2.constructor !== b2.constructor) return !1; 168 var length, i2, keys; 169 if (Array.isArray(a2)) { 170 if (length = a2.length, length != b2.length) return !1; 171 for (i2 = length; i2-- !== 0; ) 172 if (!equal3(a2[i2], b2[i2])) return !1; 173 return !0; 174 } 175 var it; 176 if (hasMap && a2 instanceof Map && b2 instanceof Map) { 177 if (a2.size !== b2.size) return !1; 178 for (it = a2.entries(); !(i2 = it.next()).done; ) 179 if (!b2.has(i2.value[0])) return !1; 180 for (it = a2.entries(); !(i2 = it.next()).done; ) 181 if (!equal3(i2.value[1], b2.get(i2.value[0]))) return !1; 182 return !0; 183 } 184 if (hasSet && a2 instanceof Set && b2 instanceof Set) { 185 if (a2.size !== b2.size) return !1; 186 for (it = a2.entries(); !(i2 = it.next()).done; ) 187 if (!b2.has(i2.value[0])) return !1; 188 return !0; 189 } 190 if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { 191 if (length = a2.length, length != b2.length) return !1; 192 for (i2 = length; i2-- !== 0; ) 193 if (a2[i2] !== b2[i2]) return !1; 194 return !0; 195 } 196 if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; 197 if (a2.valueOf !== Object.prototype.valueOf && typeof a2.valueOf == "function" && typeof b2.valueOf == "function") return a2.valueOf() === b2.valueOf(); 198 if (a2.toString !== Object.prototype.toString && typeof a2.toString == "function" && typeof b2.toString == "function") return a2.toString() === b2.toString(); 199 if (keys = Object.keys(a2), length = keys.length, length !== Object.keys(b2).length) return !1; 200 for (i2 = length; i2-- !== 0; ) 201 if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return !1; 202 if (hasElementType && a2 instanceof Element) return !1; 203 for (i2 = length; i2-- !== 0; ) 204 if (!((keys[i2] === "_owner" || keys[i2] === "__v" || keys[i2] === "__o") && a2.$$typeof) && !equal3(a2[keys[i2]], b2[keys[i2]])) 205 return !1; 206 return !0; 207 } 208 return a2 !== a2 && b2 !== b2; 209 } 210 module.exports = function(a2, b2) { 211 try { 212 return equal3(a2, b2); 213 } catch (error) { 214 if ((error.message || "").match(/stack|recursion/i)) 215 return console.warn("react-fast-compare cannot handle circular refs"), !1; 216 throw error; 217 } 218 }; 219 } 220}); 221
vendor: 854 bytes, lines 222-247
222// ../../node_modules/invariant/browser.js 223var require_browser = __commonJS({ 224 "../../node_modules/invariant/browser.js"(exports, module) { 225 "use strict"; 226 var invariant = function(condition, format, a2, b2, c2, d2, e2, f2) { 227 if (!condition) { 228 var error; 229 if (format === void 0) 230 error = new Error( 231 "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings." 232 ); 233 else { 234 var args = [a2, b2, c2, d2, e2, f2], argIndex = 0; 235 error = new Error( 236 format.replace(/%s/g, function() { 237 return args[argIndex++]; 238 }) 239 ), error.name = "Invariant Violation"; 240 } 241 throw error.framesToPop = 1, error; 242 } 243 }; 244 module.exports = invariant; 245 } 246}); 247
vendor: 1,063 bytes, lines 248-274
248// ../../node_modules/shallowequal/index.js 249var require_shallowequal = __commonJS({ 250 "../../node_modules/shallowequal/index.js"(exports, module) { 251 module.exports = function(objA, objB, compare, compareContext) { 252 var ret = compare ? compare.call(compareContext, objA, objB) : void 0; 253 if (ret !== void 0) 254 return !!ret; 255 if (objA === objB) 256 return !0; 257 if (typeof objA != "object" || !objA || typeof objB != "object" || !objB) 258 return !1; 259 var keysA = Object.keys(objA), keysB = Object.keys(objB); 260 if (keysA.length !== keysB.length) 261 return !1; 262 for (var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB), idx = 0; idx < keysA.length; idx++) { 263 var key = keysA[idx]; 264 if (!bHasOwnProperty(key)) 265 return !1; 266 var valueA = objA[key], valueB = objB[key]; 267 if (ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0, ret === !1 || ret === void 0 && valueA !== valueB) 268 return !1; 269 } 270 return !0; 271 }; 272 } 273}); 274
vendor: 2,034 bytes, lines 275-317
275// ../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js 276var require_use_sync_external_store_shim_production = __commonJS({ 277 "../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) { 278 "use strict"; 279 var React = (init_react(), __toCommonJS(react_exports)); 280 function is4(x2, y2) { 281 return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; 282 } 283 var objectIs = typeof Object.is == "function" ? Object.is : is4, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect2 = React.useLayoutEffect, useDebugValue2 = React.useDebugValue; 284 function useSyncExternalStore$2(subscribe, getSnapshot) { 285 var value = getSnapshot(), _useState = useState2({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1]; 286 return useLayoutEffect2( 287 function() { 288 inst.value = value, inst.getSnapshot = getSnapshot, checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 289 }, 290 [subscribe, value, getSnapshot] 291 ), useEffect2( 292 function() { 293 return checkIfSnapshotChanged(inst) && forceUpdate({ inst }), subscribe(function() { 294 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 295 }); 296 }, 297 [subscribe] 298 ), useDebugValue2(value), value; 299 } 300 function checkIfSnapshotChanged(inst) { 301 var latestGetSnapshot = inst.getSnapshot; 302 inst = inst.value; 303 try { 304 var nextValue = latestGetSnapshot(); 305 return !objectIs(inst, nextValue); 306 } catch { 307 return !0; 308 } 309 } 310 function useSyncExternalStore$1(subscribe, getSnapshot) { 311 return getSnapshot(); 312 } 313 var shim = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? useSyncExternalStore$1 : useSyncExternalStore$2; 314 exports.useSyncExternalStore = React.useSyncExternalStore !== void 0 ? React.useSyncExternalStore : shim; 315 } 316}); 317
vendor: 271 bytes, lines 318-325
318// ../../node_modules/use-sync-external-store/shim/index.js 319var require_shim = __commonJS({ 320 "../../node_modules/use-sync-external-store/shim/index.js"(exports, module) { 321 "use strict"; 322 module.exports = require_use_sync_external_store_shim_production(); 323 } 324}); 325
vendor: 6,832 bytes, lines 326-453
326// ../../node_modules/memoizerific/memoizerific.js 327var require_memoizerific = __commonJS({ 328 "../../node_modules/memoizerific/memoizerific.js"(exports, module) { 329 (function(f2) { 330 if (typeof exports == "object" && typeof module < "u") 331 module.exports = f2(); 332 else if (typeof define == "function" && define.amd) 333 define([], f2); 334 else { 335 var g2; 336 typeof window < "u" ? g2 = window : typeof global < "u" ? g2 = global : typeof self < "u" ? g2 = self : g2 = this, g2.memoizerific = f2(); 337 } 338 })(function() { 339 var define2, module2, exports2; 340 return (function e2(t2, n3, r4) { 341 function s2(o4, u2) { 342 if (!n3[o4]) { 343 if (!t2[o4]) { 344 var a2 = typeof __require == "function" && __require; 345 if (!u2 && a2) return a2(o4, !0); 346 if (i2) return i2(o4, !0); 347 var f2 = new Error("Cannot find module '" + o4 + "'"); 348 throw f2.code = "MODULE_NOT_FOUND", f2; 349 } 350 var l3 = n3[o4] = { exports: {} }; 351 t2[o4][0].call(l3.exports, function(e3) { 352 var n4 = t2[o4][1][e3]; 353 return s2(n4 || e3); 354 }, l3, l3.exports, e2, t2, n3, r4); 355 } 356 return n3[o4].exports; 357 } 358 for (var i2 = typeof __require == "function" && __require, o3 = 0; o3 < r4.length; o3++) s2(r4[o3]); 359 return s2; 360 })({ 1: [function(_dereq_, module3, exports3) { 361 module3.exports = function(forceSimilar) { 362 if (typeof Map != "function" || forceSimilar) { 363 var Similar = _dereq_("./similar"); 364 return new Similar(); 365 } else 366 return /* @__PURE__ */ new Map(); 367 }; 368 }, { "./similar": 2 }], 2: [function(_dereq_, module3, exports3) { 369 function Similar() { 370 return this.list = [], this.lastItem = void 0, this.size = 0, this; 371 } 372 Similar.prototype.get = function(key) { 373 var index; 374 if (this.lastItem && this.isEqual(this.lastItem.key, key)) 375 return this.lastItem.val; 376 if (index = this.indexOf(key), index >= 0) 377 return this.lastItem = this.list[index], this.list[index].val; 378 }, Similar.prototype.set = function(key, val) { 379 var index; 380 return this.lastItem && this.isEqual(this.lastItem.key, key) ? (this.lastItem.val = val, this) : (index = this.indexOf(key), index >= 0 ? (this.lastItem = this.list[index], this.list[index].val = val, this) : (this.lastItem = { key, val }, this.list.push(this.lastItem), this.size++, this)); 381 }, Similar.prototype.delete = function(key) { 382 var index; 383 if (this.lastItem && this.isEqual(this.lastItem.key, key) && (this.lastItem = void 0), index = this.indexOf(key), index >= 0) 384 return this.size--, this.list.splice(index, 1)[0]; 385 }, Similar.prototype.has = function(key) { 386 var index; 387 return this.lastItem && this.isEqual(this.lastItem.key, key) ? !0 : (index = this.indexOf(key), index >= 0 ? (this.lastItem = this.list[index], !0) : !1); 388 }, Similar.prototype.forEach = function(callback, thisArg) { 389 var i2; 390 for (i2 = 0; i2 < this.size; i2++) 391 callback.call(thisArg || this, this.list[i2].val, this.list[i2].key, this); 392 }, Similar.prototype.indexOf = function(key) { 393 var i2; 394 for (i2 = 0; i2 < this.size; i2++) 395 if (this.isEqual(this.list[i2].key, key)) 396 return i2; 397 return -1; 398 }, Similar.prototype.isEqual = function(val1, val2) { 399 return val1 === val2 || val1 !== val1 && val2 !== val2; 400 }, module3.exports = Similar; 401 }, {}], 3: [function(_dereq_, module3, exports3) { 402 var MapOrSimilar = _dereq_("map-or-similar"); 403 module3.exports = function(limit) { 404 var cache = new MapOrSimilar(!1), lru = []; 405 return function(fn) { 406 var memoizerific3 = function() { 407 var currentCache = cache, newMap, fnResult, argsLengthMinusOne = arguments.length - 1, lruPath = Array(argsLengthMinusOne + 1), isMemoized = !0, i2; 408 if ((memoizerific3.numArgs || memoizerific3.numArgs === 0) && memoizerific3.numArgs !== argsLengthMinusOne + 1) 409 throw new Error("Memoizerific functions should always be called with the same number of arguments"); 410 for (i2 = 0; i2 < argsLengthMinusOne; i2++) { 411 if (lruPath[i2] = { 412 cacheItem: currentCache, 413 arg: arguments[i2] 414 }, currentCache.has(arguments[i2])) { 415 currentCache = currentCache.get(arguments[i2]); 416 continue; 417 } 418 isMemoized = !1, newMap = new MapOrSimilar(!1), currentCache.set(arguments[i2], newMap), currentCache = newMap; 419 } 420 return isMemoized && (currentCache.has(arguments[argsLengthMinusOne]) ? fnResult = currentCache.get(arguments[argsLengthMinusOne]) : isMemoized = !1), isMemoized || (fnResult = fn.apply(null, arguments), currentCache.set(arguments[argsLengthMinusOne], fnResult)), limit > 0 && (lruPath[argsLengthMinusOne] = { 421 cacheItem: currentCache, 422 arg: arguments[argsLengthMinusOne] 423 }, isMemoized ? moveToMostRecentLru(lru, lruPath) : lru.push(lruPath), lru.length > limit && removeCachedResult(lru.shift())), memoizerific3.wasMemoized = isMemoized, memoizerific3.numArgs = argsLengthMinusOne + 1, fnResult; 424 }; 425 return memoizerific3.limit = limit, memoizerific3.wasMemoized = !1, memoizerific3.cache = cache, memoizerific3.lru = lru, memoizerific3; 426 }; 427 }; 428 function moveToMostRecentLru(lru, lruPath) { 429 var lruLen = lru.length, lruPathLen = lruPath.length, isMatch, i2, ii; 430 for (i2 = 0; i2 < lruLen; i2++) { 431 for (isMatch = !0, ii = 0; ii < lruPathLen; ii++) 432 if (!isEqual2(lru[i2][ii].arg, lruPath[ii].arg)) { 433 isMatch = !1; 434 break; 435 } 436 if (isMatch) 437 break; 438 } 439 lru.push(lru.splice(i2, 1)[0]); 440 } 441 function removeCachedResult(removedLru) { 442 var removedLruLen = removedLru.length, currentLru = removedLru[removedLruLen - 1], tmp, i2; 443 for (currentLru.cacheItem.delete(currentLru.arg), i2 = removedLruLen - 2; i2 >= 0 && (currentLru = removedLru[i2], tmp = currentLru.cacheItem.get(currentLru.arg), !tmp || !tmp.size); i2--) 444 currentLru.cacheItem.delete(currentLru.arg); 445 } 446 function isEqual2(val1, val2) { 447 return val1 === val2 || val1 !== val1 && val2 !== val2; 448 } 449 }, { "map-or-similar": 1 }] }, {}, [3])(3); 450 }); 451 } 452}); 453
vendor: 937 bytes, lines 454-464
454// ../../node_modules/picocolors/picocolors.browser.js 455var require_picocolors_browser = __commonJS({ 456 "../../node_modules/picocolors/picocolors.browser.js"(exports, module) { 457 var x2 = String, create4 = function() { 458 return { isColorSupported: !1, reset: x2, bold: x2, dim: x2, italic: x2, underline: x2, inverse: x2, hidden: x2, strikethrough: x2, black: x2, red: x2, green: x2, yellow: x2, blue: x2, magenta: x2, cyan: x2, white: x2, gray: x2, bgBlack: x2, bgRed: x2, bgGreen: x2, bgYellow: x2, bgBlue: x2, bgMagenta: x2, bgCyan: x2, bgWhite: x2, blackBright: x2, redBright: x2, greenBright: x2, yellowBright: x2, blueBright: x2, magentaBright: x2, cyanBright: x2, whiteBright: x2, bgBlackBright: x2, bgRedBright: x2, bgGreenBright: x2, bgYellowBright: x2, bgBlueBright: x2, bgMagentaBright: x2, bgCyanBright: x2, bgWhiteBright: x2 }; 459 }; 460 module.exports = create4(); 461 module.exports.createColors = create4; 462 } 463}); 464
vendor: 1,374 bytes, lines 465-497
465// ../../node_modules/scroll/index.js 466var require_scroll = __commonJS({ 467 "../../node_modules/scroll/index.js"(exports, module) { 468 var E_NOSCROLL = new Error("Element already at target scroll position"), E_CANCELLED = new Error("Scroll cancelled"), min = Math.min, ms = Date.now; 469 module.exports = { 470 left: make("scrollLeft"), 471 top: make("scrollTop") 472 }; 473 function make(prop) { 474 return function(el, to, opts, cb) { 475 opts = opts || {}, typeof opts == "function" && (cb = opts, opts = {}), typeof cb != "function" && (cb = noop5); 476 var start = ms(), from = el[prop], ease = opts.ease || inOutSine, duration = isNaN(opts.duration) ? 350 : +opts.duration, cancelled = !1; 477 return from === to ? cb(E_NOSCROLL, el[prop]) : requestAnimationFrame(animate), cancel; 478 function cancel() { 479 cancelled = !0; 480 } 481 function animate(timestamp) { 482 if (cancelled) return cb(E_CANCELLED, el[prop]); 483 var now = ms(), time = min(1, (now - start) / duration), eased = ease(time); 484 el[prop] = eased * (to - from) + from, time < 1 ? requestAnimationFrame(animate) : requestAnimationFrame(function() { 485 cb(null, el[prop]); 486 }); 487 } 488 }; 489 } 490 function inOutSine(n3) { 491 return 0.5 * (1 - Math.cos(Math.PI * n3)); 492 } 493 function noop5() { 494 } 495 } 496}); 497
vendor: 1,045 bytes, lines 498-522
498// ../../node_modules/scrollparent/scrollparent.js 499var require_scrollparent = __commonJS({ 500 "../../node_modules/scrollparent/scrollparent.js"(exports, module) { 501 (function(root2, factory) { 502 typeof define == "function" && define.amd ? define([], factory) : typeof module == "object" && module.exports ? module.exports = factory() : root2.Scrollparent = factory(); 503 })(exports, function() { 504 function isScrolling(node) { 505 var overflow = getComputedStyle(node, null).getPropertyValue("overflow"); 506 return overflow.indexOf("scroll") > -1 || overflow.indexOf("auto") > -1; 507 } 508 function scrollParent2(node) { 509 if (node instanceof HTMLElement || node instanceof SVGElement) { 510 for (var current = node.parentNode; current.parentNode; ) { 511 if (isScrolling(current)) 512 return current; 513 current = current.parentNode; 514 } 515 return document.scrollingElement || document.documentElement; 516 } 517 } 518 return scrollParent2; 519 }); 520 } 521}); 522
vendor: 840 bytes, lines 523-538
523// ../../node_modules/react-innertext/index.js 524var require_react_innertext = __commonJS({ 525 "../../node_modules/react-innertext/index.js"(exports, module) { 526 "use strict"; 527 var hasProps = function(jsx2) { 528 return Object.prototype.hasOwnProperty.call(jsx2, "props"); 529 }, reduceJsxToString = function(previous, current) { 530 return previous + innerText2(current); 531 }, innerText2 = function(jsx2) { 532 return jsx2 === null || typeof jsx2 == "boolean" || typeof jsx2 > "u" ? "" : typeof jsx2 == "number" ? jsx2.toString() : typeof jsx2 == "string" ? jsx2 : Array.isArray(jsx2) ? jsx2.reduce(reduceJsxToString, "") : hasProps(jsx2) && Object.prototype.hasOwnProperty.call(jsx2.props, "children") ? innerText2(jsx2.props.children) : ""; 533 }; 534 innerText2.default = innerText2; 535 module.exports = innerText2; 536 } 537}); 538
vendor: 3,847 bytes, lines 539-616
539// ../../node_modules/deepmerge/dist/cjs.js 540var require_cjs = __commonJS({ 541 "../../node_modules/deepmerge/dist/cjs.js"(exports, module) { 542 "use strict"; 543 var isMergeableObject = function(value) { 544 return isNonNullObject(value) && !isSpecial(value); 545 }; 546 function isNonNullObject(value) { 547 return !!value && typeof value == "object"; 548 } 549 function isSpecial(value) { 550 var stringValue = Object.prototype.toString.call(value); 551 return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); 552 } 553 var canUseSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; 554 function isReactElement(value) { 555 return value.$$typeof === REACT_ELEMENT_TYPE; 556 } 557 function emptyTarget(val) { 558 return Array.isArray(val) ? [] : {}; 559 } 560 function cloneUnlessOtherwiseSpecified(value, options2) { 561 return options2.clone !== !1 && options2.isMergeableObject(value) ? deepmerge4(emptyTarget(value), value, options2) : value; 562 } 563 function defaultArrayMerge(target, source, options2) { 564 return target.concat(source).map(function(element) { 565 return cloneUnlessOtherwiseSpecified(element, options2); 566 }); 567 } 568 function getMergeFunction(key, options2) { 569 if (!options2.customMerge) 570 return deepmerge4; 571 var customMerge = options2.customMerge(key); 572 return typeof customMerge == "function" ? customMerge : deepmerge4; 573 } 574 function getEnumerableOwnPropertySymbols(target) { 575 return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { 576 return Object.propertyIsEnumerable.call(target, symbol); 577 }) : []; 578 } 579 function getKeys(target) { 580 return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); 581 } 582 function propertyIsOnObject(object, property) { 583 try { 584 return property in object; 585 } catch { 586 return !1; 587 } 588 } 589 function propertyIsUnsafe(target, key) { 590 return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); 591 } 592 function mergeObject(target, source, options2) { 593 var destination = {}; 594 return options2.isMergeableObject(target) && getKeys(target).forEach(function(key) { 595 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options2); 596 }), getKeys(source).forEach(function(key) { 597 propertyIsUnsafe(target, key) || (propertyIsOnObject(target, key) && options2.isMergeableObject(source[key]) ? destination[key] = getMergeFunction(key, options2)(target[key], source[key], options2) : destination[key] = cloneUnlessOtherwiseSpecified(source[key], options2)); 598 }), destination; 599 } 600 function deepmerge4(target, source, options2) { 601 options2 = options2 || {}, options2.arrayMerge = options2.arrayMerge || defaultArrayMerge, options2.isMergeableObject = options2.isMergeableObject || isMergeableObject, options2.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; 602 var sourceIsArray = Array.isArray(source), targetIsArray = Array.isArray(target), sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; 603 return sourceAndTargetTypesMatch ? sourceIsArray ? options2.arrayMerge(target, source, options2) : mergeObject(target, source, options2) : cloneUnlessOtherwiseSpecified(source, options2); 604 } 605 deepmerge4.all = function(array, options2) { 606 if (!Array.isArray(array)) 607 throw new Error("first argument should be an array"); 608 return array.reduce(function(prev, next) { 609 return deepmerge4(prev, next, options2); 610 }, {}); 611 }; 612 var deepmerge_1 = deepmerge4; 613 module.exports = deepmerge_1; 614 } 615}); 616
vendor: 3,652 bytes, lines 617-713
617// ../../node_modules/downshift/node_modules/react-is/cjs/react-is.production.min.js 618var require_react_is_production_min = __commonJS({ 619 "../../node_modules/downshift/node_modules/react-is/cjs/react-is.production.min.js"(exports) { 620 "use strict"; 621 var b2 = /* @__PURE__ */ Symbol.for("react.element"), c2 = /* @__PURE__ */ Symbol.for("react.portal"), d2 = /* @__PURE__ */ Symbol.for("react.fragment"), e2 = /* @__PURE__ */ Symbol.for("react.strict_mode"), f2 = /* @__PURE__ */ Symbol.for("react.profiler"), g2 = /* @__PURE__ */ Symbol.for("react.provider"), h2 = /* @__PURE__ */ Symbol.for("react.context"), k2 = /* @__PURE__ */ Symbol.for("react.server_context"), l3 = /* @__PURE__ */ Symbol.for("react.forward_ref"), m2 = /* @__PURE__ */ Symbol.for("react.suspense"), n3 = /* @__PURE__ */ Symbol.for("react.suspense_list"), p2 = /* @__PURE__ */ Symbol.for("react.memo"), q2 = /* @__PURE__ */ Symbol.for("react.lazy"), t2 = /* @__PURE__ */ Symbol.for("react.offscreen"), u2; 622 u2 = /* @__PURE__ */ Symbol.for("react.module.reference"); 623 function v2(a2) { 624 if (typeof a2 == "object" && a2 !== null) { 625 var r4 = a2.$$typeof; 626 switch (r4) { 627 case b2: 628 switch (a2 = a2.type, a2) { 629 case d2: 630 case f2: 631 case e2: 632 case m2: 633 case n3: 634 return a2; 635 default: 636 switch (a2 = a2 && a2.$$typeof, a2) { 637 case k2: 638 case h2: 639 case l3: 640 case q2: 641 case p2: 642 case g2: 643 return a2; 644 default: 645 return r4; 646 } 647 } 648 case c2: 649 return r4; 650 } 651 } 652 } 653 exports.ContextConsumer = h2; 654 exports.ContextProvider = g2; 655 exports.Element = b2; 656 exports.ForwardRef = l3; 657 exports.Fragment = d2; 658 exports.Lazy = q2; 659 exports.Memo = p2; 660 exports.Portal = c2; 661 exports.Profiler = f2; 662 exports.StrictMode = e2; 663 exports.Suspense = m2; 664 exports.SuspenseList = n3; 665 exports.isAsyncMode = function() { 666 return !1; 667 }; 668 exports.isConcurrentMode = function() { 669 return !1; 670 }; 671 exports.isContextConsumer = function(a2) { 672 return v2(a2) === h2; 673 }; 674 exports.isContextProvider = function(a2) { 675 return v2(a2) === g2; 676 }; 677 exports.isElement = function(a2) { 678 return typeof a2 == "object" && a2 !== null && a2.$$typeof === b2; 679 }; 680 exports.isForwardRef = function(a2) { 681 return v2(a2) === l3; 682 }; 683 exports.isFragment = function(a2) { 684 return v2(a2) === d2; 685 }; 686 exports.isLazy = function(a2) { 687 return v2(a2) === q2; 688 }; 689 exports.isMemo = function(a2) { 690 return v2(a2) === p2; 691 }; 692 exports.isPortal = function(a2) { 693 return v2(a2) === c2; 694 }; 695 exports.isProfiler = function(a2) { 696 return v2(a2) === f2; 697 }; 698 exports.isStrictMode = function(a2) { 699 return v2(a2) === e2; 700 }; 701 exports.isSuspense = function(a2) { 702 return v2(a2) === m2; 703 }; 704 exports.isSuspenseList = function(a2) { 705 return v2(a2) === n3; 706 }; 707 exports.isValidElementType = function(a2) { 708 return typeof a2 == "string" || typeof a2 == "function" || a2 === d2 || a2 === f2 || a2 === e2 || a2 === m2 || a2 === n3 || a2 === t2 || typeof a2 == "object" && a2 !== null && (a2.$$typeof === q2 || a2.$$typeof === p2 || a2.$$typeof === g2 || a2.$$typeof === h2 || a2.$$typeof === l3 || a2.$$typeof === u2 || a2.getModuleId !== void 0); 709 }; 710 exports.typeOf = v2; 711 } 712}); 713
vendor: 265 bytes, lines 714-721
714// ../../node_modules/downshift/node_modules/react-is/index.js 715var require_react_is = __commonJS({ 716 "../../node_modules/downshift/node_modules/react-is/index.js"(exports, module) { 717 "use strict"; 718 module.exports = require_react_is_production_min(); 719 } 720}); 721
vendor: 19,821 bytes, lines 722-1036
722// ../../node_modules/fuse.js/dist/fuse.js 723var require_fuse = __commonJS({ 724 "../../node_modules/fuse.js/dist/fuse.js"(exports, module) { 725 (function(e2, t2) { 726 typeof exports == "object" && typeof module == "object" ? module.exports = t2() : typeof define == "function" && define.amd ? define("Fuse", [], t2) : typeof exports == "object" ? exports.Fuse = t2() : e2.Fuse = t2(); 727 })(exports, function() { 728 return (function(e2) { 729 var t2 = {}; 730 function r4(n3) { 731 if (t2[n3]) return t2[n3].exports; 732 var o3 = t2[n3] = { i: n3, l: !1, exports: {} }; 733 return e2[n3].call(o3.exports, o3, o3.exports, r4), o3.l = !0, o3.exports; 734 } 735 return r4.m = e2, r4.c = t2, r4.d = function(e3, t3, n3) { 736 r4.o(e3, t3) || Object.defineProperty(e3, t3, { enumerable: !0, get: n3 }); 737 }, r4.r = function(e3) { 738 typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e3, "__esModule", { value: !0 }); 739 }, r4.t = function(e3, t3) { 740 if (1 & t3 && (e3 = r4(e3)), 8 & t3 || 4 & t3 && typeof e3 == "object" && e3 && e3.__esModule) return e3; 741 var n3 = /* @__PURE__ */ Object.create(null); 742 if (r4.r(n3), Object.defineProperty(n3, "default", { enumerable: !0, value: e3 }), 2 & t3 && typeof e3 != "string") for (var o3 in e3) r4.d(n3, o3, function(t4) { 743 return e3[t4]; 744 }.bind(null, o3)); 745 return n3; 746 }, r4.n = function(e3) { 747 var t3 = e3 && e3.__esModule ? function() { 748 return e3.default; 749 } : function() { 750 return e3; 751 }; 752 return r4.d(t3, "a", t3), t3; 753 }, r4.o = function(e3, t3) { 754 return Object.prototype.hasOwnProperty.call(e3, t3); 755 }, r4.p = "", r4(r4.s = 0); 756 })([function(e2, t2, r4) { 757 function n3(e3) { 758 return (n3 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) { 759 return typeof e4; 760 } : function(e4) { 761 return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4; 762 })(e3); 763 } 764 function o3(e3, t3) { 765 for (var r5 = 0; r5 < t3.length; r5++) { 766 var n4 = t3[r5]; 767 n4.enumerable = n4.enumerable || !1, n4.configurable = !0, "value" in n4 && (n4.writable = !0), Object.defineProperty(e3, n4.key, n4); 768 } 769 } 770 var i2 = r4(1), a2 = r4(7), s2 = a2.get, c2 = (a2.deepValue, a2.isArray), h2 = (function() { 771 function e3(t4, r6) { 772 var n4 = r6.location, o4 = n4 === void 0 ? 0 : n4, i3 = r6.distance, a4 = i3 === void 0 ? 100 : i3, c3 = r6.threshold, h3 = c3 === void 0 ? 0.6 : c3, l3 = r6.maxPatternLength, u2 = l3 === void 0 ? 32 : l3, f2 = r6.caseSensitive, v2 = f2 !== void 0 && f2, p2 = r6.tokenSeparator, d2 = p2 === void 0 ? / +/g : p2, g2 = r6.findAllMatches, y2 = g2 !== void 0 && g2, m2 = r6.minMatchCharLength, k2 = m2 === void 0 ? 1 : m2, b2 = r6.id, S2 = b2 === void 0 ? null : b2, x2 = r6.keys, M2 = x2 === void 0 ? [] : x2, _2 = r6.shouldSort, w2 = _2 === void 0 || _2, L3 = r6.getFn, A3 = L3 === void 0 ? s2 : L3, O2 = r6.sortFn, C2 = O2 === void 0 ? function(e4, t5) { 773 return e4.score - t5.score; 774 } : O2, j2 = r6.tokenize, P3 = j2 !== void 0 && j2, I2 = r6.matchAllTokens, F2 = I2 !== void 0 && I2, T3 = r6.includeMatches, N2 = T3 !== void 0 && T3, z2 = r6.includeScore, E2 = z2 !== void 0 && z2, W2 = r6.verbose, K2 = W2 !== void 0 && W2; 775 (function(e4, t5) { 776 if (!(e4 instanceof t5)) throw new TypeError("Cannot call a class as a function"); 777 })(this, e3), this.options = { location: o4, distance: a4, threshold: h3, maxPatternLength: u2, isCaseSensitive: v2, tokenSeparator: d2, findAllMatches: y2, minMatchCharLength: k2, id: S2, keys: M2, includeMatches: N2, includeScore: E2, shouldSort: w2, getFn: A3, sortFn: C2, verbose: K2, tokenize: P3, matchAllTokens: F2 }, this.setCollection(t4), this._processKeys(M2); 778 } 779 var t3, r5, a3; 780 return t3 = e3, (r5 = [{ key: "setCollection", value: function(e4) { 781 return this.list = e4, e4; 782 } }, { key: "_processKeys", value: function(e4) { 783 if (this._keyWeights = {}, this._keyNames = [], e4.length && typeof e4[0] == "string") for (var t4 = 0, r6 = e4.length; t4 < r6; t4 += 1) { 784 var n4 = e4[t4]; 785 this._keyWeights[n4] = 1, this._keyNames.push(n4); 786 } 787 else { 788 for (var o4 = null, i3 = null, a4 = 0, s3 = 0, c3 = e4.length; s3 < c3; s3 += 1) { 789 var h3 = e4[s3]; 790 if (!h3.hasOwnProperty("name")) throw new Error('Missing "name" property in key object'); 791 var l3 = h3.name; 792 if (this._keyNames.push(l3), !h3.hasOwnProperty("weight")) throw new Error('Missing "weight" property in key object'); 793 var u2 = h3.weight; 794 if (u2 < 0 || u2 > 1) throw new Error('"weight" property in key must bein the range of [0, 1)'); 795 i3 = i3 == null ? u2 : Math.max(i3, u2), o4 = o4 == null ? u2 : Math.min(o4, u2), this._keyWeights[l3] = u2, a4 += u2; 796 } 797 if (a4 > 1) throw new Error("Total of weights cannot exceed 1"); 798 } 799 } }, { key: "search", value: function(e4) { 800 var t4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { limit: !1 }; 801 this._log(`--------- 802Search pattern: "`.concat(e4, '"')); 803 var r6 = this._prepareSearchers(e4), n4 = r6.tokenSearchers, o4 = r6.fullSearcher, i3 = this._search(n4, o4); 804 return this._computeScore(i3), this.options.shouldSort && this._sort(i3), t4.limit && typeof t4.limit == "number" && (i3 = i3.slice(0, t4.limit)), this._format(i3); 805 } }, { key: "_prepareSearchers", value: function() { 806 var e4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", t4 = []; 807 if (this.options.tokenize) for (var r6 = e4.split(this.options.tokenSeparator), n4 = 0, o4 = r6.length; n4 < o4; n4 += 1) t4.push(new i2(r6[n4], this.options)); 808 return { tokenSearchers: t4, fullSearcher: new i2(e4, this.options) }; 809 } }, { key: "_search", value: function() { 810 var e4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t4 = arguments.length > 1 ? arguments[1] : void 0, r6 = this.list, n4 = {}, o4 = []; 811 if (typeof r6[0] == "string") { 812 for (var i3 = 0, a4 = r6.length; i3 < a4; i3 += 1) this._analyze({ key: "", value: r6[i3], record: i3, index: i3 }, { resultMap: n4, results: o4, tokenSearchers: e4, fullSearcher: t4 }); 813 return o4; 814 } 815 for (var s3 = 0, c3 = r6.length; s3 < c3; s3 += 1) for (var h3 = r6[s3], l3 = 0, u2 = this._keyNames.length; l3 < u2; l3 += 1) { 816 var f2 = this._keyNames[l3]; 817 this._analyze({ key: f2, value: this.options.getFn(h3, f2), record: h3, index: s3 }, { resultMap: n4, results: o4, tokenSearchers: e4, fullSearcher: t4 }); 818 } 819 return o4; 820 } }, { key: "_analyze", value: function(e4, t4) { 821 var r6 = this, n4 = e4.key, o4 = e4.arrayIndex, i3 = o4 === void 0 ? -1 : o4, a4 = e4.value, s3 = e4.record, h3 = e4.index, l3 = t4.tokenSearchers, u2 = l3 === void 0 ? [] : l3, f2 = t4.fullSearcher, v2 = t4.resultMap, p2 = v2 === void 0 ? {} : v2, d2 = t4.results, g2 = d2 === void 0 ? [] : d2; 822 (function e5(t5, o5, i4, a5) { 823 if (o5 != null) { 824 if (typeof o5 == "string") { 825 var s4 = !1, h4 = -1, l4 = 0; 826 r6._log(` 827Key: `.concat(n4 === "" ? "--" : n4)); 828 var v3 = f2.search(o5); 829 if (r6._log('Full text: "'.concat(o5, '", score: ').concat(v3.score)), r6.options.tokenize) { 830 for (var d3 = o5.split(r6.options.tokenSeparator), y2 = d3.length, m2 = [], k2 = 0, b2 = u2.length; k2 < b2; k2 += 1) { 831 var S2 = u2[k2]; 832 r6._log(` 833Pattern: "`.concat(S2.pattern, '"')); 834 for (var x2 = !1, M2 = 0; M2 < y2; M2 += 1) { 835 var _2 = d3[M2], w2 = S2.search(_2), L3 = {}; 836 w2.isMatch ? (L3[_2] = w2.score, s4 = !0, x2 = !0, m2.push(w2.score)) : (L3[_2] = 1, r6.options.matchAllTokens || m2.push(1)), r6._log('Token: "'.concat(_2, '", score: ').concat(L3[_2])); 837 } 838 x2 && (l4 += 1); 839 } 840 h4 = m2[0]; 841 for (var A3 = m2.length, O2 = 1; O2 < A3; O2 += 1) h4 += m2[O2]; 842 h4 /= A3, r6._log("Token score average:", h4); 843 } 844 var C2 = v3.score; 845 h4 > -1 && (C2 = (C2 + h4) / 2), r6._log("Score average:", C2); 846 var j2 = !r6.options.tokenize || !r6.options.matchAllTokens || l4 >= u2.length; 847 if (r6._log(` 848Check Matches: `.concat(j2)), (s4 || v3.isMatch) && j2) { 849 var P3 = { key: n4, arrayIndex: t5, value: o5, score: C2 }; 850 r6.options.includeMatches && (P3.matchedIndices = v3.matchedIndices); 851 var I2 = p2[a5]; 852 I2 ? I2.output.push(P3) : (p2[a5] = { item: i4, output: [P3] }, g2.push(p2[a5])); 853 } 854 } else if (c2(o5)) for (var F2 = 0, T3 = o5.length; F2 < T3; F2 += 1) e5(F2, o5[F2], i4, a5); 855 } 856 })(i3, a4, s3, h3); 857 } }, { key: "_computeScore", value: function(e4) { 858 this._log(` 859 860Computing score: 861`); 862 for (var t4 = this._keyWeights, r6 = !!Object.keys(t4).length, n4 = 0, o4 = e4.length; n4 < o4; n4 += 1) { 863 for (var i3 = e4[n4], a4 = i3.output, s3 = a4.length, c3 = 1, h3 = 0; h3 < s3; h3 += 1) { 864 var l3 = a4[h3], u2 = l3.key, f2 = r6 ? t4[u2] : 1, v2 = l3.score === 0 && t4 && t4[u2] > 0 ? Number.EPSILON : l3.score; 865 c3 *= Math.pow(v2, f2); 866 } 867 i3.score = c3, this._log(i3); 868 } 869 } }, { key: "_sort", value: function(e4) { 870 this._log(` 871 872Sorting....`), e4.sort(this.options.sortFn); 873 } }, { key: "_format", value: function(e4) { 874 var t4 = []; 875 if (this.options.verbose) { 876 var r6 = []; 877 this._log(` 878 879Output: 880 881`, JSON.stringify(e4, function(e5, t5) { 882 if (n3(t5) === "object" && t5 !== null) { 883 if (r6.indexOf(t5) !== -1) return; 884 r6.push(t5); 885 } 886 return t5; 887 }, 2)), r6 = null; 888 } 889 var o4 = []; 890 this.options.includeMatches && o4.push(function(e5, t5) { 891 var r7 = e5.output; 892 t5.matches = []; 893 for (var n4 = 0, o5 = r7.length; n4 < o5; n4 += 1) { 894 var i4 = r7[n4]; 895 if (i4.matchedIndices.length !== 0) { 896 var a5 = { indices: i4.matchedIndices, value: i4.value }; 897 i4.key && (a5.key = i4.key), i4.hasOwnProperty("arrayIndex") && i4.arrayIndex > -1 && (a5.arrayIndex = i4.arrayIndex), t5.matches.push(a5); 898 } 899 } 900 }), this.options.includeScore && o4.push(function(e5, t5) { 901 t5.score = e5.score; 902 }); 903 for (var i3 = 0, a4 = e4.length; i3 < a4; i3 += 1) { 904 var s3 = e4[i3]; 905 if (this.options.id && (s3.item = this.options.getFn(s3.item, this.options.id)[0]), o4.length) { 906 for (var c3 = { item: s3.item }, h3 = 0, l3 = o4.length; h3 < l3; h3 += 1) o4[h3](s3, c3); 907 t4.push(c3); 908 } else t4.push(s3.item); 909 } 910 return t4; 911 } }, { key: "_log", value: function() { 912 var e4; 913 this.options.verbose && (e4 = console).log.apply(e4, arguments); 914 } }]) && o3(t3.prototype, r5), a3 && o3(t3, a3), e3; 915 })(); 916 e2.exports = h2; 917 }, function(e2, t2, r4) { 918 function n3(e3, t3) { 919 for (var r5 = 0; r5 < t3.length; r5++) { 920 var n4 = t3[r5]; 921 n4.enumerable = n4.enumerable || !1, n4.configurable = !0, "value" in n4 && (n4.writable = !0), Object.defineProperty(e3, n4.key, n4); 922 } 923 } 924 var o3 = r4(2), i2 = r4(3), a2 = r4(6), s2 = (function() { 925 function e3(t4, r6) { 926 var n4 = r6.location, o4 = n4 === void 0 ? 0 : n4, i3 = r6.distance, s4 = i3 === void 0 ? 100 : i3, c2 = r6.threshold, h2 = c2 === void 0 ? 0.6 : c2, l3 = r6.maxPatternLength, u2 = l3 === void 0 ? 32 : l3, f2 = r6.isCaseSensitive, v2 = f2 !== void 0 && f2, p2 = r6.tokenSeparator, d2 = p2 === void 0 ? / +/g : p2, g2 = r6.findAllMatches, y2 = g2 !== void 0 && g2, m2 = r6.minMatchCharLength, k2 = m2 === void 0 ? 1 : m2, b2 = r6.includeMatches, S2 = b2 !== void 0 && b2; 927 (function(e4, t5) { 928 if (!(e4 instanceof t5)) throw new TypeError("Cannot call a class as a function"); 929 })(this, e3), this.options = { location: o4, distance: s4, threshold: h2, maxPatternLength: u2, isCaseSensitive: v2, tokenSeparator: d2, findAllMatches: y2, includeMatches: S2, minMatchCharLength: k2 }, this.pattern = v2 ? t4 : t4.toLowerCase(), this.pattern.length <= u2 && (this.patternAlphabet = a2(this.pattern)); 930 } 931 var t3, r5, s3; 932 return t3 = e3, (r5 = [{ key: "search", value: function(e4) { 933 var t4 = this.options, r6 = t4.isCaseSensitive, n4 = t4.includeMatches; 934 if (r6 || (e4 = e4.toLowerCase()), this.pattern === e4) { 935 var a3 = { isMatch: !0, score: 0 }; 936 return n4 && (a3.matchedIndices = [[0, e4.length - 1]]), a3; 937 } 938 var s4 = this.options, c2 = s4.maxPatternLength, h2 = s4.tokenSeparator; 939 if (this.pattern.length > c2) return o3(e4, this.pattern, h2); 940 var l3 = this.options, u2 = l3.location, f2 = l3.distance, v2 = l3.threshold, p2 = l3.findAllMatches, d2 = l3.minMatchCharLength; 941 return i2(e4, this.pattern, this.patternAlphabet, { location: u2, distance: f2, threshold: v2, findAllMatches: p2, minMatchCharLength: d2, includeMatches: n4 }); 942 } }]) && n3(t3.prototype, r5), s3 && n3(t3, s3), e3; 943 })(); 944 e2.exports = s2; 945 }, function(e2, t2) { 946 var r4 = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g; 947 e2.exports = function(e3, t3) { 948 var n3 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : / +/g, o3 = new RegExp(t3.replace(r4, "\\$&").replace(n3, "|")), i2 = e3.match(o3), a2 = !!i2, s2 = []; 949 if (a2) for (var c2 = 0, h2 = i2.length; c2 < h2; c2 += 1) { 950 var l3 = i2[c2]; 951 s2.push([e3.indexOf(l3), l3.length - 1]); 952 } 953 return { score: a2 ? 0.5 : 1, isMatch: a2, matchedIndices: s2 }; 954 }; 955 }, function(e2, t2, r4) { 956 var n3 = r4(4), o3 = r4(5); 957 e2.exports = function(e3, t3, r5, i2) { 958 for (var a2 = i2.location, s2 = a2 === void 0 ? 0 : a2, c2 = i2.distance, h2 = c2 === void 0 ? 100 : c2, l3 = i2.threshold, u2 = l3 === void 0 ? 0.6 : l3, f2 = i2.findAllMatches, v2 = f2 !== void 0 && f2, p2 = i2.minMatchCharLength, d2 = p2 === void 0 ? 1 : p2, g2 = i2.includeMatches, y2 = g2 !== void 0 && g2, m2 = s2, k2 = e3.length, b2 = u2, S2 = e3.indexOf(t3, m2), x2 = t3.length, M2 = [], _2 = 0; _2 < k2; _2 += 1) M2[_2] = 0; 959 if (S2 !== -1) { 960 var w2 = n3(t3, { errors: 0, currentLocation: S2, expectedLocation: m2, distance: h2 }); 961 if (b2 = Math.min(w2, b2), (S2 = e3.lastIndexOf(t3, m2 + x2)) !== -1) { 962 var L3 = n3(t3, { errors: 0, currentLocation: S2, expectedLocation: m2, distance: h2 }); 963 b2 = Math.min(L3, b2); 964 } 965 } 966 S2 = -1; 967 for (var A3 = [], O2 = 1, C2 = x2 + k2, j2 = 1 << (x2 <= 31 ? x2 - 1 : 30), P3 = 0; P3 < x2; P3 += 1) { 968 for (var I2 = 0, F2 = C2; I2 < F2; ) 969 n3(t3, { errors: P3, currentLocation: m2 + F2, expectedLocation: m2, distance: h2 }) <= b2 ? I2 = F2 : C2 = F2, F2 = Math.floor((C2 - I2) / 2 + I2); 970 C2 = F2; 971 var T3 = Math.max(1, m2 - F2 + 1), N2 = v2 ? k2 : Math.min(m2 + F2, k2) + x2, z2 = Array(N2 + 2); 972 z2[N2 + 1] = (1 << P3) - 1; 973 for (var E2 = N2; E2 >= T3; E2 -= 1) { 974 var W2 = E2 - 1, K2 = r5[e3.charAt(W2)]; 975 if (K2 && (M2[W2] = 1), z2[E2] = (z2[E2 + 1] << 1 | 1) & K2, P3 !== 0 && (z2[E2] |= (A3[E2 + 1] | A3[E2]) << 1 | 1 | A3[E2 + 1]), z2[E2] & j2 && (O2 = n3(t3, { errors: P3, currentLocation: W2, expectedLocation: m2, distance: h2 })) <= b2) { 976 if (b2 = O2, (S2 = W2) <= m2) break; 977 T3 = Math.max(1, 2 * m2 - S2); 978 } 979 } 980 if (n3(t3, { errors: P3 + 1, currentLocation: m2, expectedLocation: m2, distance: h2 }) > b2) break; 981 A3 = z2; 982 } 983 var $ = { isMatch: S2 >= 0, score: O2 === 0 ? 1e-3 : O2 }; 984 return y2 && ($.matchedIndices = o3(M2, d2)), $; 985 }; 986 }, function(e2, t2) { 987 e2.exports = function(e3, t3) { 988 var r4 = t3.errors, n3 = r4 === void 0 ? 0 : r4, o3 = t3.currentLocation, i2 = o3 === void 0 ? 0 : o3, a2 = t3.expectedLocation, s2 = a2 === void 0 ? 0 : a2, c2 = t3.distance, h2 = c2 === void 0 ? 100 : c2, l3 = n3 / e3.length, u2 = Math.abs(s2 - i2); 989 return h2 ? l3 + u2 / h2 : u2 ? 1 : l3; 990 }; 991 }, function(e2, t2) { 992 e2.exports = function() { 993 for (var e3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, r4 = [], n3 = -1, o3 = -1, i2 = 0, a2 = e3.length; i2 < a2; i2 += 1) { 994 var s2 = e3[i2]; 995 s2 && n3 === -1 ? n3 = i2 : s2 || n3 === -1 || ((o3 = i2 - 1) - n3 + 1 >= t3 && r4.push([n3, o3]), n3 = -1); 996 } 997 return e3[i2 - 1] && i2 - n3 >= t3 && r4.push([n3, i2 - 1]), r4; 998 }; 999 }, function(e2, t2) { 1000 e2.exports = function(e3) { 1001 for (var t3 = {}, r4 = e3.length, n3 = 0; n3 < r4; n3 += 1) t3[e3.charAt(n3)] = 0; 1002 for (var o3 = 0; o3 < r4; o3 += 1) t3[e3.charAt(o3)] |= 1 << r4 - o3 - 1; 1003 return t3; 1004 }; 1005 }, function(e2, t2) { 1006 var r4 = function(e3) { 1007 return Array.isArray ? Array.isArray(e3) : Object.prototype.toString.call(e3) === "[object Array]"; 1008 }, n3 = function(e3) { 1009 return e3 == null ? "" : (function(e4) { 1010 if (typeof e4 == "string") return e4; 1011 var t3 = e4 + ""; 1012 return t3 == "0" && 1 / e4 == -1 / 0 ? "-0" : t3; 1013 })(e3); 1014 }, o3 = function(e3) { 1015 return typeof e3 == "string"; 1016 }, i2 = function(e3) { 1017 return typeof e3 == "number"; 1018 }; 1019 e2.exports = { get: function(e3, t3) { 1020 var a2 = []; 1021 return (function e4(t4, s2) { 1022 if (s2) { 1023 var c2 = s2.indexOf("."), h2 = s2, l3 = null; 1024 c2 !== -1 && (h2 = s2.slice(0, c2), l3 = s2.slice(c2 + 1)); 1025 var u2 = t4[h2]; 1026 if (u2 != null) if (l3 || !o3(u2) && !i2(u2)) if (r4(u2)) for (var f2 = 0, v2 = u2.length; f2 < v2; f2 += 1) e4(u2[f2], l3); 1027 else l3 && e4(u2, l3); 1028 else a2.push(n3(u2)); 1029 } else a2.push(t4); 1030 })(e3, t3), a2; 1031 }, isArray: r4, isString: o3, isNum: i2, toString: n3 }; 1032 }]); 1033 }); 1034 } 1035}); 1036
vendor: 8,913 bytes, lines 1037-1256
1037// ../../node_modules/store2/dist/store2.js 1038var require_store2 = __commonJS({ 1039 "../../node_modules/store2/dist/store2.js"(exports, module) { 1040 (function(window2, define2) { 1041 var _2 = { 1042 version: "2.14.4", 1043 areas: {}, 1044 apis: {}, 1045 nsdelim: ".", 1046 // utilities 1047 inherit: function(api, o3) { 1048 for (var p2 in api) 1049 o3.hasOwnProperty(p2) || Object.defineProperty(o3, p2, Object.getOwnPropertyDescriptor(api, p2)); 1050 return o3; 1051 }, 1052 stringify: function(d2, fn) { 1053 return d2 === void 0 || typeof d2 == "function" ? d2 + "" : JSON.stringify(d2, fn || _2.replace); 1054 }, 1055 parse: function(s2, fn) { 1056 try { 1057 return JSON.parse(s2, fn || _2.revive); 1058 } catch { 1059 return s2; 1060 } 1061 }, 1062 // extension hooks 1063 fn: function(name, fn) { 1064 _2.storeAPI[name] = fn; 1065 for (var api in _2.apis) 1066 _2.apis[api][name] = fn; 1067 }, 1068 get: function(area, key) { 1069 return area.getItem(key); 1070 }, 1071 set: function(area, key, string) { 1072 area.setItem(key, string); 1073 }, 1074 remove: function(area, key) { 1075 area.removeItem(key); 1076 }, 1077 key: function(area, i2) { 1078 return area.key(i2); 1079 }, 1080 length: function(area) { 1081 return area.length; 1082 }, 1083 clear: function(area) { 1084 area.clear(); 1085 }, 1086 // core functions 1087 Store: function(id, area, namespace) { 1088 var store3 = _2.inherit(_2.storeAPI, function(key, data, overwrite) { 1089 return arguments.length === 0 ? store3.getAll() : typeof data == "function" ? store3.transact(key, data, overwrite) : data !== void 0 ? store3.set(key, data, overwrite) : typeof key == "string" || typeof key == "number" ? store3.get(key) : typeof key == "function" ? store3.each(key) : key ? store3.setAll(key, data) : store3.clear(); 1090 }); 1091 store3._id = id; 1092 try { 1093 var testKey = "__store2_test"; 1094 area.setItem(testKey, "ok"), store3._area = area, area.removeItem(testKey); 1095 } catch { 1096 store3._area = _2.storage("fake"); 1097 } 1098 return store3._ns = namespace || "", _2.areas[id] || (_2.areas[id] = store3._area), _2.apis[store3._ns + store3._id] || (_2.apis[store3._ns + store3._id] = store3), store3; 1099 }, 1100 storeAPI: { 1101 // admin functions 1102 area: function(id, area) { 1103 var store3 = this[id]; 1104 return (!store3 || !store3.area) && (store3 = _2.Store(id, area, this._ns), this[id] || (this[id] = store3)), store3; 1105 }, 1106 namespace: function(namespace, singleArea, delim) { 1107 if (delim = delim || this._delim || _2.nsdelim, !namespace) 1108 return this._ns ? this._ns.substring(0, this._ns.length - delim.length) : ""; 1109 var ns = namespace, store3 = this[ns]; 1110 if ((!store3 || !store3.namespace) && (store3 = _2.Store(this._id, this._area, this._ns + ns + delim), store3._delim = delim, this[ns] || (this[ns] = store3), !singleArea)) 1111 for (var name in _2.areas) 1112 store3.area(name, _2.areas[name]); 1113 return store3; 1114 }, 1115 isFake: function(force) { 1116 return force ? (this._real = this._area, this._area = _2.storage("fake")) : force === !1 && (this._area = this._real || this._area), this._area.name === "fake"; 1117 }, 1118 toString: function() { 1119 return "store" + (this._ns ? "." + this.namespace() : "") + "[" + this._id + "]"; 1120 }, 1121 // storage functions 1122 has: function(key) { 1123 return this._area.has ? this._area.has(this._in(key)) : this._in(key) in this._area; 1124 }, 1125 size: function() { 1126 return this.keys().length; 1127 }, 1128 each: function(fn, fill) { 1129 for (var i2 = 0, m2 = _2.length(this._area); i2 < m2; i2++) { 1130 var key = this._out(_2.key(this._area, i2)); 1131 if (key !== void 0 && fn.call(this, key, this.get(key), fill) === !1) 1132 break; 1133 m2 > _2.length(this._area) && (m2--, i2--); 1134 } 1135 return fill || this; 1136 }, 1137 keys: function(fillList) { 1138 return this.each(function(k2, v2, list) { 1139 list.push(k2); 1140 }, fillList || []); 1141 }, 1142 get: function(key, alt) { 1143 var s2 = _2.get(this._area, this._in(key)), fn; 1144 return typeof alt == "function" && (fn = alt, alt = null), s2 !== null ? _2.parse(s2, fn) : alt ?? s2; 1145 }, 1146 getAll: function(fillObj) { 1147 return this.each(function(k2, v2, all) { 1148 all[k2] = v2; 1149 }, fillObj || {}); 1150 }, 1151 transact: function(key, fn, alt) { 1152 var val = this.get(key, alt), ret = fn(val); 1153 return this.set(key, ret === void 0 ? val : ret), this; 1154 }, 1155 set: function(key, data, overwrite) { 1156 var d2 = this.get(key), replacer; 1157 return d2 != null && overwrite === !1 ? data : (typeof overwrite == "function" && (replacer = overwrite, overwrite = void 0), _2.set(this._area, this._in(key), _2.stringify(data, replacer), overwrite) || d2); 1158 }, 1159 setAll: function(data, overwrite) { 1160 var changed, val; 1161 for (var key in data) 1162 val = data[key], this.set(key, val, overwrite) !== val && (changed = !0); 1163 return changed; 1164 }, 1165 add: function(key, data, replacer) { 1166 var d2 = this.get(key); 1167 if (d2 instanceof Array) 1168 data = d2.concat(data); 1169 else if (d2 !== null) { 1170 var type = typeof d2; 1171 if (type === typeof data && type === "object") { 1172 for (var k2 in data) 1173 d2[k2] = data[k2]; 1174 data = d2; 1175 } else 1176 data = d2 + data; 1177 } 1178 return _2.set(this._area, this._in(key), _2.stringify(data, replacer)), data; 1179 }, 1180 remove: function(key, alt) { 1181 var d2 = this.get(key, alt); 1182 return _2.remove(this._area, this._in(key)), d2; 1183 }, 1184 clear: function() { 1185 return this._ns ? this.each(function(k2) { 1186 _2.remove(this._area, this._in(k2)); 1187 }, 1) : _2.clear(this._area), this; 1188 }, 1189 clearAll: function() { 1190 var area = this._area; 1191 for (var id in _2.areas) 1192 _2.areas.hasOwnProperty(id) && (this._area = _2.areas[id], this.clear()); 1193 return this._area = area, this; 1194 }, 1195 // internal use functions 1196 _in: function(k2) { 1197 return typeof k2 != "string" && (k2 = _2.stringify(k2)), this._ns ? this._ns + k2 : k2; 1198 }, 1199 _out: function(k2) { 1200 return this._ns ? k2 && k2.indexOf(this._ns) === 0 ? k2.substring(this._ns.length) : void 0 : ( 1201 // so each() knows to skip it 1202 k2 1203 ); 1204 } 1205 }, 1206 // end _.storeAPI 1207 storage: function(name) { 1208 return _2.inherit(_2.storageAPI, { items: {}, name }); 1209 }, 1210 storageAPI: { 1211 length: 0, 1212 has: function(k2) { 1213 return this.items.hasOwnProperty(k2); 1214 }, 1215 key: function(i2) { 1216 var c2 = 0; 1217 for (var k2 in this.items) 1218 if (this.has(k2) && i2 === c2++) 1219 return k2; 1220 }, 1221 setItem: function(k2, v2) { 1222 this.has(k2) || this.length++, this.items[k2] = v2; 1223 }, 1224 removeItem: function(k2) { 1225 this.has(k2) && (delete this.items[k2], this.length--); 1226 }, 1227 getItem: function(k2) { 1228 return this.has(k2) ? this.items[k2] : null; 1229 }, 1230 clear: function() { 1231 for (var k2 in this.items) 1232 this.removeItem(k2); 1233 } 1234 } 1235 // end _.storageAPI 1236 }, store2 = ( 1237 // safely set this up (throws error in IE10/32bit mode for local files) 1238 _2.Store("local", (function() { 1239 try { 1240 return localStorage; 1241 } catch { 1242 } 1243 })()) 1244 ); 1245 store2.local = store2, store2._ = _2, store2.area("session", (function() { 1246 try { 1247 return sessionStorage; 1248 } catch { 1249 } 1250 })()), store2.area("page", _2.storage("page")), typeof define2 == "function" && define2.amd !== void 0 ? define2("store2", [], function() { 1251 return store2; 1252 }) : typeof module < "u" && module.exports ? module.exports = store2 : (window2.store && (_2.conflict = window2.store), window2.store = store2); 1253 })(exports, exports && exports.define); 1254 } 1255}); 1256
1257// src/manager/runtime.tsx 1258init_react(); 1259 1260// global-externals:storybook/internal/channels 1261var channels_default = __STORYBOOK_CHANNELS__, { Channel, HEARTBEAT_INTERVAL, HEARTBEAT_MAX_LATENCY, PostMessageTransport, WebsocketTransport, clearChannel, createBrowserChannel, ensureChannel, getChannel, installNoopChannel, requireChannel, setChannel } = __STORYBOOK_CHANNELS__; 1262 1263// global-externals:storybook/internal/core-events 1264var core_events_default = __STORYBOOK_CORE_EVENTS__, { AI_PROMPT_NUDGE, AI_SETUP_ANALYTICS_REQUEST, AI_SETUP_ANALYTICS_RESPONSE, ARGTYPES_INFO_REQUEST, ARGTYPES_INFO_RESPONSE, CHANNEL_CREATED, CHANNEL_WS_DISCONNECT, CONFIG_ERROR, CREATE_NEW_STORYFILE_REQUEST, CREATE_NEW_STORYFILE_RESPONSE, CURRENT_STORY_WAS_SET, DOCS_PREPARED, DOCS_RENDERED, FILE_COMPONENT_SEARCH_REQUEST, FILE_COMPONENT_SEARCH_RESPONSE, FORCE_REMOUNT, FORCE_RE_RENDER, GHOST_STORIES_REQUEST, GHOST_STORIES_RESPONSE, GLOBALS_UPDATED, MANAGER_INERT_ATTRIBUTE_CHANGED, NAVIGATE_URL, OPEN_IN_EDITOR_REQUEST, OPEN_IN_EDITOR_RESPONSE, PLAY_FUNCTION_THREW_EXCEPTION, PRELOAD_ENTRIES, PREVIEW_BUILDER_PROGRESS, PREVIEW_INITIALIZED, PREVIEW_KEYDOWN, REGISTER_SUBSCRIPTION, REQUEST_WHATS_NEW_DATA, RESET_STORY_ARGS, RESULT_WHATS_NEW_DATA, SAVE_STORY_REQUEST, SAVE_STORY_RESPONSE, SELECT_STORY, SET_CONFIG, SET_CURRENT_STORY, SET_FILTER, SET_GLOBALS, SET_INDEX, SET_STORIES, SET_WHATS_NEW_CACHE, SHARED_STATE_CHANGED, SHARED_STATE_SET, SHARE_ISOLATE_MODE, SIDEBAR_FILTER_CHANGED, STORIES_COLLAPSE_ALL, STORIES_EXPAND_ALL, STORY_ARGS_UPDATED, STORY_CHANGED, STORY_ERRORED, STORY_FINISHED, STORY_HOT_UPDATED, STORY_INDEX_INVALIDATED, STORY_MISSING, STORY_PREPARED, STORY_RENDERED, STORY_RENDER_PHASE_CHANGED, STORY_SPECIFIED, STORY_THREW_EXCEPTION, STORY_UNCHANGED, TELEMETRY_ERROR, TOGGLE_WHATS_NEW_NOTIFICATIONS, UNHANDLED_ERRORS_WHILE_PLAYING, UPDATE_GLOBALS, UPDATE_QUERY_PARAMS, UPDATE_STORY_ARGS } = __STORYBOOK_CORE_EVENTS__; 1265
vendor: 14,472 bytes, lines 1266-1540
1266// ../../node_modules/@storybook/global/dist/index.mjs 1267var scope = (() => { 1268 let win; 1269 return typeof window < "u" ? win = window : typeof globalThis < "u" ? win = globalThis : typeof global < "u" ? win = global : typeof self < "u" ? win = self : win = {}, win; 1270})(); 1271 1272// global-externals:@storybook/icons 1273var icons_exports = {}; 1274__export(icons_exports, { 1275 AccessibilityAltIcon: () => AccessibilityAltIcon, 1276 AccessibilityIcon: () => AccessibilityIcon, 1277 AccessibilityIgnoredIcon: () => AccessibilityIgnoredIcon, 1278 AddIcon: () => AddIcon, 1279 AdminIcon: () => AdminIcon, 1280 AlertAltIcon: () => AlertAltIcon, 1281 AlertIcon: () => AlertIcon, 1282 AlignLeftIcon: () => AlignLeftIcon, 1283 AlignRightIcon: () => AlignRightIcon, 1284 AppleIcon: () => AppleIcon, 1285 ArrowBottomLeftIcon: () => ArrowBottomLeftIcon, 1286 ArrowBottomRightIcon: () => ArrowBottomRightIcon, 1287 ArrowDownIcon: () => ArrowDownIcon, 1288 ArrowLeftIcon: () => ArrowLeftIcon, 1289 ArrowRightIcon: () => ArrowRightIcon, 1290 ArrowSolidDownIcon: () => ArrowSolidDownIcon, 1291 ArrowSolidLeftIcon: () => ArrowSolidLeftIcon, 1292 ArrowSolidRightIcon: () => ArrowSolidRightIcon, 1293 ArrowSolidUpIcon: () => ArrowSolidUpIcon, 1294 ArrowTopLeftIcon: () => ArrowTopLeftIcon, 1295 ArrowTopRightIcon: () => ArrowTopRightIcon, 1296 ArrowUpIcon: () => ArrowUpIcon, 1297 AzureDevOpsIcon: () => AzureDevOpsIcon, 1298 BackIcon: () => BackIcon, 1299 BasketIcon: () => BasketIcon, 1300 BatchAcceptIcon: () => BatchAcceptIcon, 1301 BatchDenyIcon: () => BatchDenyIcon, 1302 BeakerIcon: () => BeakerIcon, 1303 BellIcon: () => BellIcon, 1304 BitbucketIcon: () => BitbucketIcon, 1305 BoldIcon: () => BoldIcon, 1306 BookIcon: () => BookIcon, 1307 BookmarkHollowIcon: () => BookmarkHollowIcon, 1308 BookmarkIcon: () => BookmarkIcon, 1309 BottomBarIcon: () => BottomBarIcon, 1310 BottomBarToggleIcon: () => BottomBarToggleIcon, 1311 BoxIcon: () => BoxIcon, 1312 BranchIcon: () => BranchIcon, 1313 BrowserIcon: () => BrowserIcon, 1314 BugIcon: () => BugIcon, 1315 ButtonIcon: () => ButtonIcon, 1316 CPUIcon: () => CPUIcon, 1317 CalendarIcon: () => CalendarIcon, 1318 CameraIcon: () => CameraIcon, 1319 CameraStabilizeIcon: () => CameraStabilizeIcon, 1320 CategoryIcon: () => CategoryIcon, 1321 CertificateIcon: () => CertificateIcon, 1322 ChangedIcon: () => ChangedIcon, 1323 ChatIcon: () => ChatIcon, 1324 CheckIcon: () => CheckIcon, 1325 ChecklistIcon: () => ChecklistIcon, 1326 ChevronDownIcon: () => ChevronDownIcon, 1327 ChevronLeftIcon: () => ChevronLeftIcon, 1328 ChevronRightIcon: () => ChevronRightIcon, 1329 ChevronSmallDownIcon: () => ChevronSmallDownIcon, 1330 ChevronSmallLeftIcon: () => ChevronSmallLeftIcon, 1331 ChevronSmallRightIcon: () => ChevronSmallRightIcon, 1332 ChevronSmallUpIcon: () => ChevronSmallUpIcon, 1333 ChevronUpIcon: () => ChevronUpIcon, 1334 ChromaticIcon: () => ChromaticIcon, 1335 ChromeIcon: () => ChromeIcon, 1336 CircleHollowIcon: () => CircleHollowIcon, 1337 CircleIcon: () => CircleIcon, 1338 ClearIcon: () => ClearIcon, 1339 CloseAltIcon: () => CloseAltIcon, 1340 CloseIcon: () => CloseIcon, 1341 CloudHollowIcon: () => CloudHollowIcon, 1342 CloudIcon: () => CloudIcon, 1343 CogIcon: () => CogIcon, 1344 CollapseIcon: () => CollapseIcon, 1345 CommandIcon: () => CommandIcon, 1346 CommentAddIcon: () => CommentAddIcon, 1347 CommentIcon: () => CommentIcon, 1348 CommentsIcon: () => CommentsIcon, 1349 CommitIcon: () => CommitIcon, 1350 CompassIcon: () => CompassIcon, 1351 ComponentDrivenIcon: () => ComponentDrivenIcon, 1352 ComponentIcon: () => ComponentIcon, 1353 ContrastIcon: () => ContrastIcon, 1354 ContrastIgnoredIcon: () => ContrastIgnoredIcon, 1355 ControlsIcon: () => ControlsIcon, 1356 CopyIcon: () => CopyIcon, 1357 CreditIcon: () => CreditIcon, 1358 CrossIcon: () => CrossIcon, 1359 DashboardIcon: () => DashboardIcon, 1360 DatabaseIcon: () => DatabaseIcon, 1361 DeleteIcon: () => DeleteIcon, 1362 DiamondIcon: () => DiamondIcon, 1363 DirectionIcon: () => DirectionIcon, 1364 DiscordIcon: () => DiscordIcon, 1365 DocChartIcon: () => DocChartIcon, 1366 DocListIcon: () => DocListIcon, 1367 DocumentIcon: () => DocumentIcon, 1368 DownloadIcon: () => DownloadIcon, 1369 DragIcon: () => DragIcon, 1370 EditIcon: () => EditIcon, 1371 EditorIcon: () => EditorIcon, 1372 EllipsisIcon: () => EllipsisIcon, 1373 EmailIcon: () => EmailIcon, 1374 ExpandAltIcon: () => ExpandAltIcon, 1375 ExpandIcon: () => ExpandIcon, 1376 EyeCloseIcon: () => EyeCloseIcon, 1377 EyeIcon: () => EyeIcon, 1378 FaceHappyIcon: () => FaceHappyIcon, 1379 FaceNeutralIcon: () => FaceNeutralIcon, 1380 FaceSadIcon: () => FaceSadIcon, 1381 FacebookIcon: () => FacebookIcon, 1382 FailedIcon: () => FailedIcon, 1383 FastForwardIcon: () => FastForwardIcon, 1384 FigmaIcon: () => FigmaIcon, 1385 FilesIcon: () => FilesIcon, 1386 FilterIcon: () => FilterIcon, 1387 FlagIcon: () => FlagIcon, 1388 FolderIcon: () => FolderIcon, 1389 FormIcon: () => FormIcon, 1390 GDriveIcon: () => GDriveIcon, 1391 GiftIcon: () => GiftIcon, 1392 GithubIcon: () => GithubIcon, 1393 GitlabIcon: () => GitlabIcon, 1394 GlobeIcon: () => GlobeIcon, 1395 GoogleIcon: () => GoogleIcon, 1396 GraphBarIcon: () => GraphBarIcon, 1397 GraphLineIcon: () => GraphLineIcon, 1398 GraphqlIcon: () => GraphqlIcon, 1399 GridAltIcon: () => GridAltIcon, 1400 GridIcon: () => GridIcon, 1401 GrowIcon: () => GrowIcon, 1402 HeartHollowIcon: () => HeartHollowIcon, 1403 HeartIcon: () => HeartIcon, 1404 HomeIcon: () => HomeIcon, 1405 HourglassIcon: () => HourglassIcon, 1406 InfoIcon: () => InfoIcon, 1407 ItalicIcon: () => ItalicIcon, 1408 JumpToIcon: () => JumpToIcon, 1409 KeyIcon: () => KeyIcon, 1410 LightningIcon: () => LightningIcon, 1411 LightningOffIcon: () => LightningOffIcon, 1412 LinkBrokenIcon: () => LinkBrokenIcon, 1413 LinkIcon: () => LinkIcon, 1414 LinkedinIcon: () => LinkedinIcon, 1415 LinuxIcon: () => LinuxIcon, 1416 ListOrderedIcon: () => ListOrderedIcon, 1417 ListUnorderedIcon: () => ListUnorderedIcon, 1418 LocationIcon: () => LocationIcon, 1419 LockIcon: () => LockIcon, 1420 MarkdownIcon: () => MarkdownIcon, 1421 MarkupIcon: () => MarkupIcon, 1422 MediumIcon: () => MediumIcon, 1423 MemoryIcon: () => MemoryIcon, 1424 MenuIcon: () => MenuIcon, 1425 MergeIcon: () => MergeIcon, 1426 MirrorIcon: () => MirrorIcon, 1427 MobileIcon: () => MobileIcon, 1428 MoonIcon: () => MoonIcon, 1429 NutIcon: () => NutIcon, 1430 OutboxIcon: () => OutboxIcon, 1431 OutlineIcon: () => OutlineIcon, 1432 PaintBrushAltIcon: () => PaintBrushAltIcon, 1433 PaintBrushIcon: () => PaintBrushIcon, 1434 PaperClipIcon: () => PaperClipIcon, 1435 ParagraphIcon: () => ParagraphIcon, 1436 PassedIcon: () => PassedIcon, 1437 PhoneIcon: () => PhoneIcon, 1438 PhotoDragIcon: () => PhotoDragIcon, 1439 PhotoIcon: () => PhotoIcon, 1440 PhotoStabilizeIcon: () => PhotoStabilizeIcon, 1441 PinAltIcon: () => PinAltIcon, 1442 PinIcon: () => PinIcon, 1443 PlayAllHollowIcon: () => PlayAllHollowIcon, 1444 PlayBackIcon: () => PlayBackIcon, 1445 PlayHollowIcon: () => PlayHollowIcon, 1446 PlayIcon: () => PlayIcon, 1447 PlayNextIcon: () => PlayNextIcon, 1448 PlusIcon: () => PlusIcon, 1449 PointerDefaultIcon: () => PointerDefaultIcon, 1450 PointerHandIcon: () => PointerHandIcon, 1451 PopOutIcon: () => PopOutIcon, 1452 PowerIcon: () => PowerIcon, 1453 PrintIcon: () => PrintIcon, 1454 ProceedIcon: () => ProceedIcon, 1455 ProfileIcon: () => ProfileIcon, 1456 PullRequestIcon: () => PullRequestIcon, 1457 QuestionIcon: () => QuestionIcon, 1458 RSSIcon: () => RSSIcon, 1459 RedirectIcon: () => RedirectIcon, 1460 ReduxIcon: () => ReduxIcon, 1461 RefreshIcon: () => RefreshIcon, 1462 ReplyIcon: () => ReplyIcon, 1463 RepoIcon: () => RepoIcon, 1464 RequestChangeIcon: () => RequestChangeIcon, 1465 RewindIcon: () => RewindIcon, 1466 RulerIcon: () => RulerIcon, 1467 SaveIcon: () => SaveIcon, 1468 SearchIcon: () => SearchIcon, 1469 ShareAltIcon: () => ShareAltIcon, 1470 ShareIcon: () => ShareIcon, 1471 ShieldIcon: () => ShieldIcon, 1472 SideBySideIcon: () => SideBySideIcon, 1473 SidebarAltIcon: () => SidebarAltIcon, 1474 SidebarAltToggleIcon: () => SidebarAltToggleIcon, 1475 SidebarIcon: () => SidebarIcon, 1476 SidebarToggleIcon: () => SidebarToggleIcon, 1477 SortDownIcon: () => SortDownIcon, 1478 SortUpIcon: () => SortUpIcon, 1479 SpeakerIcon: () => SpeakerIcon, 1480 StackedIcon: () => StackedIcon, 1481 StarHollowIcon: () => StarHollowIcon, 1482 StarIcon: () => StarIcon, 1483 StatusFailIcon: () => StatusFailIcon, 1484 StatusIcon: () => StatusIcon, 1485 StatusNewIcon: () => StatusNewIcon, 1486 StatusPassIcon: () => StatusPassIcon, 1487 StatusWarnIcon: () => StatusWarnIcon, 1488 StickerIcon: () => StickerIcon, 1489 StopAltHollowIcon: () => StopAltHollowIcon, 1490 StopAltIcon: () => StopAltIcon, 1491 StopIcon: () => StopIcon, 1492 StorybookIcon: () => StorybookIcon, 1493 StructureIcon: () => StructureIcon, 1494 SubtractIcon: () => SubtractIcon, 1495 SunIcon: () => SunIcon, 1496 SupportIcon: () => SupportIcon, 1497 SweepIcon: () => SweepIcon, 1498 SwitchAltIcon: () => SwitchAltIcon, 1499 SyncIcon: () => SyncIcon, 1500 TabletIcon: () => TabletIcon, 1501 ThumbsUpIcon: () => ThumbsUpIcon, 1502 TimeIcon: () => TimeIcon, 1503 TimerIcon: () => TimerIcon, 1504 TransferIcon: () => TransferIcon, 1505 TrashIcon: () => TrashIcon, 1506 TwitterIcon: () => TwitterIcon, 1507 TypeIcon: () => TypeIcon, 1508 UbuntuIcon: () => UbuntuIcon, 1509 UndoIcon: () => UndoIcon, 1510 UnfoldIcon: () => UnfoldIcon, 1511 UnlockIcon: () => UnlockIcon, 1512 UnpinIcon: () => UnpinIcon, 1513 UploadIcon: () => UploadIcon, 1514 UserAddIcon: () => UserAddIcon, 1515 UserAltIcon: () => UserAltIcon, 1516 UserIcon: () => UserIcon, 1517 UsersIcon: () => UsersIcon, 1518 VSCodeIcon: () => VSCodeIcon, 1519 VerifiedIcon: () => VerifiedIcon, 1520 VideoIcon: () => VideoIcon, 1521 WandIcon: () => WandIcon, 1522 WatchIcon: () => WatchIcon, 1523 WindowsIcon: () => WindowsIcon, 1524 WrenchIcon: () => WrenchIcon, 1525 XIcon: () => XIcon, 1526 YoutubeIcon: () => YoutubeIcon, 1527 ZoomIcon: () => ZoomIcon, 1528 ZoomOutIcon: () => ZoomOutIcon, 1529 ZoomResetIcon: () => ZoomResetIcon, 1530 default: () => icons_default, 1531 iconList: () => iconList 1532}); 1533var icons_default = __STORYBOOK_ICONS__, { AccessibilityAltIcon, AccessibilityIcon, AccessibilityIgnoredIcon, AddIcon, AdminIcon, AlertAltIcon, AlertIcon, AlignLeftIcon, AlignRightIcon, AppleIcon, ArrowBottomLeftIcon, ArrowBottomRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowSolidDownIcon, ArrowSolidLeftIcon, ArrowSolidRightIcon, ArrowSolidUpIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowUpIcon, AzureDevOpsIcon, BackIcon, BasketIcon, BatchAcceptIcon, BatchDenyIcon, BeakerIcon, BellIcon, BitbucketIcon, BoldIcon, BookIcon, BookmarkHollowIcon, BookmarkIcon, BottomBarIcon, BottomBarToggleIcon, BoxIcon, BranchIcon, BrowserIcon, BugIcon, ButtonIcon, CPUIcon, CalendarIcon, CameraIcon, CameraStabilizeIcon, CategoryIcon, CertificateIcon, ChangedIcon, ChatIcon, CheckIcon, ChecklistIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronSmallDownIcon, ChevronSmallLeftIcon, ChevronSmallRightIcon, ChevronSmallUpIcon, ChevronUpIcon, ChromaticIcon, ChromeIcon, CircleHollowIcon, CircleIcon, ClearIcon, CloseAltIcon, CloseIcon, CloudHollowIcon, CloudIcon, CogIcon, CollapseIcon, CommandIcon, CommentAddIcon, CommentIcon, CommentsIcon, CommitIcon, CompassIcon, ComponentDrivenIcon, ComponentIcon, ContrastIcon, ContrastIgnoredIcon, ControlsIcon, CopyIcon, CreditIcon, CrossIcon, DashboardIcon, DatabaseIcon, DeleteIcon, DiamondIcon, DirectionIcon, DiscordIcon, DocChartIcon, DocListIcon, DocumentIcon, DownloadIcon, DragIcon, EditIcon, EditorIcon, EllipsisIcon, EmailIcon, ExpandAltIcon, ExpandIcon, EyeCloseIcon, EyeIcon, FaceHappyIcon, FaceNeutralIcon, FaceSadIcon, FacebookIcon, FailedIcon, FastForwardIcon, FigmaIcon, FilesIcon, FilterIcon, FlagIcon, FolderIcon, FormIcon, GDriveIcon, GiftIcon, GithubIcon, GitlabIcon, GlobeIcon, GoogleIcon, GraphBarIcon, GraphLineIcon, GraphqlIcon, GridAltIcon, GridIcon, GrowIcon, HeartHollowIcon, HeartIcon, HomeIcon, HourglassIcon, InfoIcon, ItalicIcon, JumpToIcon, KeyIcon, LightningIcon, LightningOffIcon, LinkBrokenIcon, LinkIcon, LinkedinIcon, LinuxIcon, ListOrderedIcon, ListUnorderedIcon, LocationIcon, LockIcon, MarkdownIcon, MarkupIcon, MediumIcon, MemoryIcon, MenuIcon, MergeIcon, MirrorIcon, MobileIcon, MoonIcon, NutIcon, OutboxIcon, OutlineIcon, PaintBrushAltIcon, PaintBrushIcon, PaperClipIcon, ParagraphIcon, PassedIcon, PhoneIcon, PhotoDragIcon, PhotoIcon, PhotoStabilizeIcon, PinAltIcon, PinIcon, PlayAllHollowIcon, PlayBackIcon, PlayHollowIcon, PlayIcon, PlayNextIcon, PlusIcon, PointerDefaultIcon, PointerHandIcon, PopOutIcon, PowerIcon, PrintIcon, ProceedIcon, ProfileIcon, PullRequestIcon, QuestionIcon, RSSIcon, RedirectIcon, ReduxIcon, RefreshIcon, ReplyIcon, RepoIcon, RequestChangeIcon, RewindIcon, RulerIcon, SaveIcon, SearchIcon, ShareAltIcon, ShareIcon, ShieldIcon, SideBySideIcon, SidebarAltIcon, SidebarAltToggleIcon, SidebarIcon, SidebarToggleIcon, SortDownIcon, SortUpIcon, SpeakerIcon, StackedIcon, StarHollowIcon, StarIcon, StatusFailIcon, StatusIcon, StatusNewIcon, StatusPassIcon, StatusWarnIcon, StickerIcon, StopAltHollowIcon, StopAltIcon, StopIcon, StorybookIcon, StructureIcon, SubtractIcon, SunIcon, SupportIcon, SweepIcon, SwitchAltIcon, SyncIcon, TabletIcon, ThumbsUpIcon, TimeIcon, TimerIcon, TransferIcon, TrashIcon, TwitterIcon, TypeIcon, UbuntuIcon, UndoIcon, UnfoldIcon, UnlockIcon, UnpinIcon, UploadIcon, UserAddIcon, UserAltIcon, UserIcon, UsersIcon, VSCodeIcon, VerifiedIcon, VideoIcon, WandIcon, WatchIcon, WindowsIcon, WrenchIcon, XIcon, YoutubeIcon, ZoomIcon, ZoomOutIcon, ZoomResetIcon, iconList } = __STORYBOOK_ICONS__; 1534 1535// global-externals:storybook/manager-api 1536var manager_api_default = __STORYBOOK_API__, { ActiveTabs, Consumer, ManagerContext, Provider, RequestResponseError, Tag, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, experimental_MockUniversalStore, experimental_UniversalStore, experimental_getStatusStore, experimental_getTestProviderStore, experimental_requestResponse, experimental_useStatusStore, experimental_useTestProviderStore, experimental_useUniversalStore, getService, internal_checklistStore, internal_fullStatusStore, internal_fullTestProviderStore, internal_universalChecklistStore, internal_universalStatusStore, internal_universalTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, merge, mockChannel, optionOrAltSymbol, registerService, shortcutMatchesShortcut, shortcutToAriaKeyshortcuts, shortcutToHumanString, types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useServiceCommand, useServiceQuery, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState } = __STORYBOOK_API__; 1537 1538// global-externals:storybook/theming 1539var theming_default = __STORYBOOK_THEMING__, { CacheProvider, ClassNames, Global, ThemeProvider, background, color, convert, create, createCache, createGlobal, createReset, css, darken, ensure, getPreferredColorScheme, ignoreSsrWarning, isPropValid, jsx, keyframes, lighten, srOnlyStyles, srOnlyUnsetStyles, styled, themes, tokens, typography, useTheme, withTheme } = __STORYBOOK_THEMING__; 1540
vendor: 3,910 bytes, lines 1541-1622
1541// src/toolbar/components/ToolbarManager.tsx 1542init_react(); 1543 1544// global-externals:storybook/internal/components 1545var components_default = __STORYBOOK_COMPONENTS__, { A, AbstractToolbar, ActionBar, ActionList, AddonPanel, Badge, Bar, Blockquote, Button, Card, ClipboardCode, Code, Collapsible, DL, Div, DocumentWrapper, EmptyTabContent, ErrorFormatter, FlexBar, Form, H1, H2, H3, H4, H5, H6, HR, IconButton, Img, LI, Link, ListItem, Loader, Modal, ModalDecorator, OL, P, Placeholder, Popover, PopoverProvider, Pre, ProgressSpinner, ResetWrapper, ScrollArea, Select, Separator, Spaced, Span, StatelessTab, StatelessTabList, StatelessTabPanel, StatelessTabsView, StorybookIcon: StorybookIcon2, StorybookLogo, SyntaxHighlighter, TT, TabBar, TabButton, TabList, TabPanel, TabWrapper, Table, Tabs, TabsState, TabsView, ToggleButton, Toolbar, Tooltip, TooltipLinkList, TooltipMessage, TooltipNote, TooltipProvider, UL, WithTooltip, WithTooltipPure, Zoom, codeCommon, components, convertToReactAriaPlacement, createCopyToClipboardFunction, getStoryHref, interleaveSeparators, nameSpaceClassNames, resetComponents, useCopyButton, useTabsState, withReset } = __STORYBOOK_COMPONENTS__; 1546 1547// src/toolbar/utils/normalize-toolbar-arg-type.ts 1548var defaultItemValues = { 1549 type: "item", 1550 value: "" 1551}, normalizeArgType = (key, argType) => { 1552 let toolbar = argType.toolbar; 1553 return toolbar ? { 1554 ...argType, 1555 name: argType.name || key, 1556 description: argType.description || key, 1557 toolbar: { 1558 ...argType.toolbar, 1559 items: toolbar.items.map((_item) => { 1560 let item = typeof _item == "string" ? { value: _item, title: _item } : _item; 1561 return item.type === "reset" && toolbar.icon && (item.icon = toolbar.icon, item.hideIcon = !0, item.value = void 0), { ...defaultItemValues, ...item }; 1562 }) 1563 } 1564 } : null; 1565}; 1566 1567// src/toolbar/components/ToolbarMenuSelect.tsx 1568init_react(); 1569 1570// src/components/components/icon/icon.tsx 1571init_react(); 1572 1573// global-externals:storybook/internal/client-logger 1574var client_logger_default = __STORYBOOK_CLIENT_LOGGER__, { deprecate, logger, once, pretty } = __STORYBOOK_CLIENT_LOGGER__; 1575 1576// src/components/components/icon/icon.tsx 1577var NEW_ICON_MAP = icons_exports, Svg = styled.svg` 1578 display: inline-block; 1579 shape-rendering: inherit; 1580 vertical-align: middle; 1581 fill: currentColor; 1582 path { 1583 fill: currentColor; 1584 } 1585`, Icons = ({ 1586 icon, 1587 useSymbol, 1588 __suppressDeprecationWarning = !1, 1589 ...props 1590}) => { 1591 __suppressDeprecationWarning || deprecate( 1592 `Use of the deprecated Icons ${`(${icon})` || ""} component detected. Please use the @storybook/icons component directly. For more informations, see the migration notes at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#icons-is-deprecated` 1593 ); 1594 let findIcon = icons[icon] || null; 1595 if (!findIcon) 1596 return logger.warn( 1597 `Use of an unknown prop ${`(${icon})` || ""} in the Icons component. The Icons component is deprecated. Please use the @storybook/icons component directly. For more informations, see the migration notes at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#icons-is-deprecated` 1598 ), null; 1599 let Icon = NEW_ICON_MAP[findIcon]; 1600 return react_default.createElement(Icon, { ...props }); 1601}, Symbols = memo(function({ icons: keys = Object.keys(icons) }) { 1602 return react_default.createElement( 1603 Svg, 1604 { 1605 viewBox: "0 0 14 14", 1606 style: { position: "absolute", width: 0, height: 0 }, 1607 "data-chromatic": "ignore" 1608 }, 1609 keys.map((key) => react_default.createElement("symbol", { id: `icon--${key}`, key }, icons[key])) 1610 ); 1611}), icons = { 1612 user: "UserIcon", 1613 useralt: "UserAltIcon", 1614 useradd: "UserAddIcon", 1615 users: "UsersIcon", 1616 profile: "ProfileIcon", 1617 facehappy: "FaceHappyIcon", 1618 faceneutral: "FaceNeutralIcon", 1619 facesad: "FaceSadIcon", 1620 accessibility: "AccessibilityIcon", 1621 accessibilityalt: "AccessibilityAltIcon", 1622 a
vendor: 5,069 bytes, lines 1622-1818
1622rrowup: "ChevronUpIcon", 1623 arrowdown: "ChevronDownIcon", 1624 arrowleft: "ChevronLeftIcon", 1625 arrowright: "ChevronRightIcon", 1626 arrowupalt: "ArrowUpIcon", 1627 arrowdownalt: "ArrowDownIcon", 1628 arrowleftalt: "ArrowLeftIcon", 1629 arrowrightalt: "ArrowRightIcon", 1630 expandalt: "ExpandAltIcon", 1631 collapse: "CollapseIcon", 1632 expand: "ExpandIcon", 1633 unfold: "UnfoldIcon", 1634 transfer: "TransferIcon", 1635 redirect: "RedirectIcon", 1636 undo: "UndoIcon", 1637 reply: "ReplyIcon", 1638 sync: "SyncIcon", 1639 upload: "UploadIcon", 1640 download: "DownloadIcon", 1641 back: "BackIcon", 1642 proceed: "ProceedIcon", 1643 refresh: "RefreshIcon", 1644 globe: "GlobeIcon", 1645 compass: "CompassIcon", 1646 location: "LocationIcon", 1647 pin: "PinIcon", 1648 time: "TimeIcon", 1649 dashboard: "DashboardIcon", 1650 timer: "TimerIcon", 1651 home: "HomeIcon", 1652 admin: "AdminIcon", 1653 info: "InfoIcon", 1654 question: "QuestionIcon", 1655 support: "SupportIcon", 1656 alert: "AlertIcon", 1657 email: "EmailIcon", 1658 phone: "PhoneIcon", 1659 link: "LinkIcon", 1660 unlink: "LinkBrokenIcon", 1661 bell: "BellIcon", 1662 rss: "RSSIcon", 1663 sharealt: "ShareAltIcon", 1664 share: "ShareIcon", 1665 circle: "CircleIcon", 1666 circlehollow: "CircleHollowIcon", 1667 bookmarkhollow: "BookmarkHollowIcon", 1668 bookmark: "BookmarkIcon", 1669 hearthollow: "HeartHollowIcon", 1670 heart: "HeartIcon", 1671 starhollow: "StarHollowIcon", 1672 star: "StarIcon", 1673 certificate: "CertificateIcon", 1674 verified: "VerifiedIcon", 1675 thumbsup: "ThumbsUpIcon", 1676 shield: "ShieldIcon", 1677 basket: "BasketIcon", 1678 beaker: "BeakerIcon", 1679 hourglass: "HourglassIcon", 1680 flag: "FlagIcon", 1681 cloudhollow: "CloudHollowIcon", 1682 edit: "EditIcon", 1683 cog: "CogIcon", 1684 nut: "NutIcon", 1685 wrench: "WrenchIcon", 1686 ellipsis: "EllipsisIcon", 1687 check: "CheckIcon", 1688 form: "FormIcon", 1689 batchdeny: "BatchDenyIcon", 1690 batchaccept: "BatchAcceptIcon", 1691 controls: "ControlsIcon", 1692 plus: "PlusIcon", 1693 closeAlt: "CloseAltIcon", 1694 cross: "CrossIcon", 1695 trash: "TrashIcon", 1696 pinalt: "PinAltIcon", 1697 unpin: "UnpinIcon", 1698 add: "AddIcon", 1699 subtract: "SubtractIcon", 1700 close: "CloseIcon", 1701 delete: "DeleteIcon", 1702 passed: "PassedIcon", 1703 changed: "ChangedIcon", 1704 failed: "FailedIcon", 1705 clear: "ClearIcon", 1706 comment: "CommentIcon", 1707 commentadd: "CommentAddIcon", 1708 requestchange: "RequestChangeIcon", 1709 comments: "CommentsIcon", 1710 lock: "LockIcon", 1711 unlock: "UnlockIcon", 1712 key: "KeyIcon", 1713 outbox: "OutboxIcon", 1714 credit: "CreditIcon", 1715 button: "ButtonIcon", 1716 type: "TypeIcon", 1717 pointerdefault: "PointerDefaultIcon", 1718 pointerhand: "PointerHandIcon", 1719 browser: "BrowserIcon", 1720 tablet: "TabletIcon", 1721 mobile: "MobileIcon", 1722 watch: "WatchIcon", 1723 sidebar: "SidebarIcon", 1724 sidebaralt: "SidebarAltIcon", 1725 sidebaralttoggle: "SidebarAltToggleIcon", 1726 sidebartoggle: "SidebarToggleIcon", 1727 bottombar: "BottomBarIcon", 1728 bottombartoggle: "BottomBarToggleIcon", 1729 cpu: "CPUIcon", 1730 database: "DatabaseIcon", 1731 memory: "MemoryIcon", 1732 structure: "StructureIcon", 1733 box: "BoxIcon", 1734 power: "PowerIcon", 1735 photo: "PhotoIcon", 1736 component: "ComponentIcon", 1737 grid: "GridIcon", 1738 outline: "OutlineIcon", 1739 photodrag: "PhotoDragIcon", 1740 search: "SearchIcon", 1741 zoom: "ZoomIcon", 1742 zoomout: "ZoomOutIcon", 1743 zoomreset: "ZoomResetIcon", 1744 eye: "EyeIcon", 1745 eyeclose: "EyeCloseIcon", 1746 lightning: "LightningIcon", 1747 lightningoff: "LightningOffIcon", 1748 contrast: "ContrastIcon", 1749 switchalt: "SwitchAltIcon", 1750 mirror: "MirrorIcon", 1751 grow: "GrowIcon", 1752 paintbrush: "PaintBrushIcon", 1753 ruler: "RulerIcon", 1754 stop: "StopIcon", 1755 camera: "CameraIcon", 1756 video: "VideoIcon", 1757 speaker: "SpeakerIcon", 1758 play: "PlayIcon", 1759 playback: "PlayBackIcon", 1760 playnext: "PlayNextIcon", 1761 rewind: "RewindIcon", 1762 fastforward: "FastForwardIcon", 1763 stopalt: "StopAltIcon", 1764 sidebyside: "SideBySideIcon", 1765 stacked: "StackedIcon", 1766 sun: "SunIcon", 1767 moon: "MoonIcon", 1768 book: "BookIcon", 1769 document: "DocumentIcon", 1770 copy: "CopyIcon", 1771 category: "CategoryIcon", 1772 folder: "FolderIcon", 1773 print: "PrintIcon", 1774 graphline: "GraphLineIcon", 1775 calendar: "CalendarIcon", 1776 graphbar: "GraphBarIcon", 1777 menu: "MenuIcon", 1778 menualt: "MenuIcon", 1779 filter: "FilterIcon", 1780 docchart: "DocChartIcon", 1781 doclist: "DocListIcon", 1782 markup: "MarkupIcon", 1783 bold: "BoldIcon", 1784 paperclip: "PaperClipIcon", 1785 listordered: "ListOrderedIcon", 1786 listunordered: "ListUnorderedIcon", 1787 paragraph: "ParagraphIcon", 1788 markdown: "MarkdownIcon", 1789 repository: "RepoIcon", 1790 commit: "CommitIcon", 1791 branch: "BranchIcon", 1792 pullrequest: "PullRequestIcon", 1793 merge: "MergeIcon", 1794 apple: "AppleIcon", 1795 linux: "LinuxIcon", 1796 ubuntu: "UbuntuIcon", 1797 windows: "WindowsIcon", 1798 storybook: "StorybookIcon", 1799 azuredevops: "AzureDevOpsIcon", 1800 bitbucket: "BitbucketIcon", 1801 chrome: "ChromeIcon", 1802 chromatic: "ChromaticIcon", 1803 componentdriven: "ComponentDrivenIcon", 1804 discord: "DiscordIcon", 1805 facebook: "FacebookIcon", 1806 figma: "FigmaIcon", 1807 gdrive: "GDriveIcon", 1808 github: "GithubIcon", 1809 gitlab: "GitlabIcon", 1810 google: "GoogleIcon", 1811 graphql: "GraphqlIcon", 1812 medium: "MediumIcon", 1813 redux: "ReduxIcon", 1814 twitter: "TwitterIcon", 1815 youtube: "YoutubeIcon", 1816 vscode: "VSCodeIcon" 1817}; 1818
vendor: 5,530 bytes, lines 1819-1949
1819// src/toolbar/utils/get-selected.ts 1820var getSelectedItem = ({ currentValue, items }) => items.find((item) => item.value === currentValue && item.type !== "reset"); 1821 1822// src/toolbar/constants.ts 1823var TOOLBAR_ID = "toolbar"; 1824 1825// src/toolbar/utils/register-shortcuts.ts 1826var registerShortcuts = async (api, id, shortcuts) => { 1827 shortcuts.next && await api.setAddonShortcut(TOOLBAR_ID, { 1828 label: shortcuts.next.label, 1829 defaultShortcut: shortcuts.next.keys, 1830 actionName: `${id}:next`, 1831 action: shortcuts.next.action 1832 }), shortcuts.previous && await api.setAddonShortcut(TOOLBAR_ID, { 1833 label: shortcuts.previous.label, 1834 defaultShortcut: shortcuts.previous.keys, 1835 actionName: `${id}:previous`, 1836 action: shortcuts.previous.action 1837 }), shortcuts.reset && await api.setAddonShortcut(TOOLBAR_ID, { 1838 label: shortcuts.reset.label, 1839 defaultShortcut: shortcuts.reset.keys, 1840 actionName: `${id}:reset`, 1841 action: shortcuts.reset.action 1842 }); 1843}; 1844 1845// src/toolbar/components/ToolbarMenuSelect.tsx 1846var ToolbarMenuItemContainer = styled("div")({ 1847 width: "100%", 1848 display: "flex", 1849 alignItems: "center", 1850 gap: 8 1851}), ToolbarMenuItemMiddle = styled("div")({ 1852 flex: 1 1853}), ToolbarMenuSelect = ({ 1854 id, 1855 name, 1856 description, 1857 toolbar: { 1858 icon: _icon, 1859 items, 1860 title: _title, 1861 preventDynamicIcon, 1862 dynamicTitle = !0, 1863 shortcuts 1864 } 1865}) => { 1866 let api = useStorybookApi(), [globals, updateGlobals, storyGlobals] = useGlobals(), currentValue = globals[id], isOverridden = id in storyGlobals, icon = _icon, title2 = _title; 1867 preventDynamicIcon || (icon = getSelectedItem({ currentValue, items })?.icon || icon), dynamicTitle && (title2 = getSelectedItem({ currentValue, items })?.title || title2), !title2 && !icon && console.warn(`Toolbar '${name}' has no title or icon`); 1868 let resetItem = items.find((item) => item.type === "reset"), resetLabel = resetItem?.title, options2 = react_default.useMemo( 1869 () => items.filter((item) => item.type === "item").map((item) => { 1870 let itemTitle = item.title ?? item.value ?? "Untitled", iconComponent = !item.hideIcon && item.icon ? react_default.createElement(Icons, { icon: item.icon, __suppressDeprecationWarning: !0 }) : void 0; 1871 return item.right ? { 1872 title: itemTitle, 1873 value: item.value, 1874 children: react_default.createElement(ToolbarMenuItemContainer, null, iconComponent, react_default.createElement(ToolbarMenuItemMiddle, null, item.title ?? item.value), item.right) 1875 } : { 1876 title: itemTitle, 1877 value: item.value, 1878 icon: iconComponent 1879 }; 1880 }), 1881 [items] 1882 ); 1883 react_default.useEffect(() => { 1884 if (shortcuts) { 1885 let length = options2.length; 1886 registerShortcuts(api, id, { 1887 next: { 1888 ...shortcuts.next, 1889 action: () => { 1890 let idx = options2.findIndex((i2) => i2.value === globals[id]), nextIdx = idx < 0 ? 0 : (idx + 1) % length; 1891 updateGlobals({ [id]: options2[nextIdx].value }); 1892 } 1893 }, 1894 previous: { 1895 ...shortcuts.previous, 1896 action: () => { 1897 let idx = options2.findIndex((i2) => i2.value === globals[id]), previousIdx = idx < 0 ? length - 1 : (idx + length - 1) % length; 1898 updateGlobals({ [id]: options2[previousIdx].value }); 1899 } 1900 }, 1901 reset: { 1902 ...shortcuts.reset, 1903 action: () => { 1904 updateGlobals({ [id]: void 0 }); 1905 } 1906 } 1907 }); 1908 } 1909 }, [api, id, shortcuts, globals, options2, updateGlobals]); 1910 let ariaLabel = description || title2 || name || id; 1911 return react_default.createElement( 1912 Select, 1913 { 1914 defaultOptions: [currentValue], 1915 options: options2, 1916 disabled: isOverridden, 1917 ariaLabel, 1918 tooltip: ariaLabel, 1919 resetLabel, 1920 onReset: resetItem ? () => updateGlobals({ [id]: resetItem?.value }) : void 0, 1921 onSelect: (selected) => updateGlobals({ [id]: selected }), 1922 icon: icon && react_default.createElement(Icons, { icon, __suppressDeprecationWarning: !0 }), 1923 showSelectedOptionTitle: dynamicTitle 1924 }, 1925 title2 1926 ); 1927}; 1928 1929// src/toolbar/components/ToolbarManager.tsx 1930var ToolbarManager = () => { 1931 let globalTypes = useGlobalTypes(); 1932 return Object.keys(globalTypes).some((id) => !!globalTypes[id].toolbar) ? react_default.createElement(react_default.Fragment, null, react_default.createElement(Separator, null), Object.keys(globalTypes).map((id) => { 1933 let normalizedArgType = normalizeArgType(id, globalTypes[id]); 1934 return normalizedArgType && react_default.createElement(ToolbarMenuSelect, { key: id, id, ...normalizedArgType }); 1935 })) : null; 1936}; 1937 1938// src/manager/index.tsx 1939init_react(); 1940 1941// global-externals:react-dom/client 1942var client_default = __REACT_DOM_CLIENT__, { createRoot, hydrateRoot } = __REACT_DOM_CLIENT__; 1943 1944// global-externals:storybook/internal/manager-errors 1945var manager_errors_default = __STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__, { Category, OpenServiceStaticSnapshotInvalidError, OpenServiceStaticSnapshotLoadError, ProviderDoesNotExtendBaseProviderError, StatusTypeIdMismatchError, UncaughtManagerError, UniversalStoreFollowerTimeoutError } = __STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__; 1946 1947// global-externals:storybook/internal/router 1948var router_default = __STORYBOOK_ROUTER__, { BaseLocationProvider, DEEPLY_EQUAL, Link: Link2, Location, LocationProvider, Match, MemoryRouter, Route, buildArgsParam, deepDiff, getMatch, parsePath, queryFromLocation, stringifyQuery, useNavigate } = __STORYBOOK_ROUTER__; 1949
vendor: 20,097 bytes, lines 1950-2294
1950// ../../node_modules/react-helmet-async/lib/index.module.js 1951init_react(); 1952var import_prop_types = __toESM(require_prop_types()), import_react_fast_compare = __toESM(require_react_fast_compare()), import_invariant = __toESM(require_browser()), import_shallowequal = __toESM(require_shallowequal()); 1953function a() { 1954 return a = Object.assign || function(t2) { 1955 for (var e2 = 1; e2 < arguments.length; e2++) { 1956 var r4 = arguments[e2]; 1957 for (var n3 in r4) Object.prototype.hasOwnProperty.call(r4, n3) && (t2[n3] = r4[n3]); 1958 } 1959 return t2; 1960 }, a.apply(this, arguments); 1961} 1962function s(t2, e2) { 1963 t2.prototype = Object.create(e2.prototype), t2.prototype.constructor = t2, c(t2, e2); 1964} 1965function c(t2, e2) { 1966 return c = Object.setPrototypeOf || function(t3, e3) { 1967 return t3.__proto__ = e3, t3; 1968 }, c(t2, e2); 1969} 1970function u(t2, e2) { 1971 if (t2 == null) return {}; 1972 var r4, n3, i2 = {}, o3 = Object.keys(t2); 1973 for (n3 = 0; n3 < o3.length; n3++) e2.indexOf(r4 = o3[n3]) >= 0 || (i2[r4] = t2[r4]); 1974 return i2; 1975} 1976var l = { BASE: "base", BODY: "body", HEAD: "head", HTML: "html", LINK: "link", META: "meta", NOSCRIPT: "noscript", SCRIPT: "script", STYLE: "style", TITLE: "title", FRAGMENT: "Symbol(react.fragment)" }, p = { rel: ["amphtml", "canonical", "alternate"] }, f = { type: ["application/ld+json"] }, d = { charset: "", name: ["robots", "description"], property: ["og:type", "og:title", "og:url", "og:image", "og:image:alt", "og:description", "twitter:url", "twitter:title", "twitter:description", "twitter:image", "twitter:image:alt", "twitter:card", "twitter:site"] }, h = Object.keys(l).map(function(t2) { 1977 return l[t2]; 1978}), m = { accesskey: "accessKey", charset: "charSet", class: "className", contenteditable: "contentEditable", contextmenu: "contextMenu", "http-equiv": "httpEquiv", itemprop: "itemProp", tabindex: "tabIndex" }, y = Object.keys(m).reduce(function(t2, e2) { 1979 return t2[m[e2]] = e2, t2; 1980}, {}), T = function(t2, e2) { 1981 for (var r4 = t2.length - 1; r4 >= 0; r4 -= 1) { 1982 var n3 = t2[r4]; 1983 if (Object.prototype.hasOwnProperty.call(n3, e2)) return n3[e2]; 1984 } 1985 return null; 1986}, g = function(t2) { 1987 var e2 = T(t2, l.TITLE), r4 = T(t2, "titleTemplate"); 1988 if (Array.isArray(e2) && (e2 = e2.join("")), r4 && e2) return r4.replace(/%s/g, function() { 1989 return e2; 1990 }); 1991 var n3 = T(t2, "defaultTitle"); 1992 return e2 || n3 || void 0; 1993}, b = function(t2) { 1994 return T(t2, "onChangeClientState") || function() { 1995 }; 1996}, v = function(t2, e2) { 1997 return e2.filter(function(e3) { 1998 return e3[t2] !== void 0; 1999 }).map(function(e3) { 2000 return e3[t2]; 2001 }).reduce(function(t3, e3) { 2002 return a({}, t3, e3); 2003 }, {}); 2004}, A2 = function(t2, e2) { 2005 return e2.filter(function(t3) { 2006 return t3[l.BASE] !== void 0; 2007 }).map(function(t3) { 2008 return t3[l.BASE]; 2009 }).reverse().reduce(function(e3, r4) { 2010 if (!e3.length) for (var n3 = Object.keys(r4), i2 = 0; i2 < n3.length; i2 += 1) { 2011 var o3 = n3[i2].toLowerCase(); 2012 if (t2.indexOf(o3) !== -1 && r4[o3]) return e3.concat(r4); 2013 } 2014 return e3; 2015 }, []); 2016}, C = function(t2, e2, r4) { 2017 var n3 = {}; 2018 return r4.filter(function(e3) { 2019 return !!Array.isArray(e3[t2]) || (e3[t2] !== void 0 && console && typeof console.warn == "function" && console.warn("Helmet: " + t2 + ' should be of type "Array". Instead found type "' + typeof e3[t2] + '"'), !1); 2020 }).map(function(e3) { 2021 return e3[t2]; 2022 }).reverse().reduce(function(t3, r5) { 2023 var i2 = {}; 2024 r5.filter(function(t4) { 2025 for (var r6, o4 = Object.keys(t4), a2 = 0; a2 < o4.length; a2 += 1) { 2026 var s3 = o4[a2], c3 = s3.toLowerCase(); 2027 e2.indexOf(c3) === -1 || r6 === "rel" && t4[r6].toLowerCase() === "canonical" || c3 === "rel" && t4[c3].toLowerCase() === "stylesheet" || (r6 = c3), e2.indexOf(s3) === -1 || s3 !== "innerHTML" && s3 !== "cssText" && s3 !== "itemprop" || (r6 = s3); 2028 } 2029 if (!r6 || !t4[r6]) return !1; 2030 var u3 = t4[r6].toLowerCase(); 2031 return n3[r6] || (n3[r6] = {}), i2[r6] || (i2[r6] = {}), !n3[r6][u3] && (i2[r6][u3] = !0, !0); 2032 }).reverse().forEach(function(e3) { 2033 return t3.push(e3); 2034 }); 2035 for (var o3 = Object.keys(i2), s2 = 0; s2 < o3.length; s2 += 1) { 2036 var c2 = o3[s2], u2 = a({}, n3[c2], i2[c2]); 2037 n3[c2] = u2; 2038 } 2039 return t3; 2040 }, []).reverse(); 2041}, O = function(t2, e2) { 2042 if (Array.isArray(t2) && t2.length) { 2043 for (var r4 = 0; r4 < t2.length; r4 += 1) if (t2[r4][e2]) return !0; 2044 } 2045 return !1; 2046}, S = function(t2) { 2047 return Array.isArray(t2) ? t2.join("") : t2; 2048}, E = function(t2, e2) { 2049 return Array.isArray(t2) ? t2.reduce(function(t3, r4) { 2050 return (function(t4, e3) { 2051 for (var r5 = Object.keys(t4), n3 = 0; n3 < r5.length; n3 += 1) if (e3[r5[n3]] && e3[r5[n3]].includes(t4[r5[n3]])) return !0; 2052 return !1; 2053 })(r4, e2) ? t3.priority.push(r4) : t3.default.push(r4), t3; 2054 }, { priority: [], default: [] }) : { default: t2 }; 2055}, I = function(t2, e2) { 2056 var r4; 2057 return a({}, t2, ((r4 = {})[e2] = void 0, r4)); 2058}, P2 = [l.NOSCRIPT, l.SCRIPT, l.STYLE], w = function(t2, e2) { 2059 return e2 === void 0 && (e2 = !0), e2 === !1 ? String(t2) : String(t2).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); 2060}, x = function(t2) { 2061 return Object.keys(t2).reduce(function(e2, r4) { 2062 var n3 = t2[r4] !== void 0 ? r4 + '="' + t2[r4] + '"' : "" + r4; 2063 return e2 ? e2 + " " + n3 : n3; 2064 }, ""); 2065}, L = function(t2, e2) { 2066 return e2 === void 0 && (e2 = {}), Object.keys(t2).reduce(function(e3, r4) { 2067 return e3[m[r4] || r4] = t2[r4], e3; 2068 }, e2); 2069}, j = function(e2, r4) { 2070 return r4.map(function(r5, n3) { 2071 var i2, o3 = ((i2 = { key: n3 })["data-rh"] = !0, i2); 2072 return Object.keys(r5).forEach(function(t2) { 2073 var e3 = m[t2] || t2; 2074 e3 === "innerHTML" || e3 === "cssText" ? o3.dangerouslySetInnerHTML = { __html: r5.innerHTML || r5.cssText } : o3[e3] = r5[t2]; 2075 }), react_default.createElement(e2, o3); 2076 }); 2077}, M = function(e2, r4, n3) { 2078 switch (e2) { 2079 case l.TITLE: 2080 return { toComponent: function() { 2081 return n4 = r4.titleAttributes, (i2 = { key: e3 = r4.title })["data-rh"] = !0, o3 = L(n4, i2), [react_default.createElement(l.TITLE, o3, e3)]; 2082 var e3, n4, i2, o3; 2083 }, toString: function() { 2084 return (function(t2, e3, r5, n4) { 2085 var i2 = x(r5), o3 = S(e3); 2086 return i2 ? "<" + t2 + ' data-rh="true" ' + i2 + ">" + w(o3, n4) + "</" + t2 + ">" : "<" + t2 + ' data-rh="true">' + w(o3, n4) + "</" + t2 + ">"; 2087 })(e2, r4.title, r4.titleAttributes, n3); 2088 } }; 2089 case "bodyAttributes": 2090 case "htmlAttributes": 2091 return { toComponent: function() { 2092 return L(r4); 2093 }, toString: function() { 2094 return x(r4); 2095 } }; 2096 default: 2097 return { toComponent: function() { 2098 return j(e2, r4); 2099 }, toString: function() { 2100 return (function(t2, e3, r5) { 2101 return e3.reduce(function(e4, n4) { 2102 var i2 = Object.keys(n4).filter(function(t3) { 2103 return !(t3 === "innerHTML" || t3 === "cssText"); 2104 }).reduce(function(t3, e5) { 2105 var i3 = n4[e5] === void 0 ? e5 : e5 + '="' + w(n4[e5], r5) + '"'; 2106 return t3 ? t3 + " " + i3 : i3; 2107 }, ""), o3 = n4.innerHTML || n4.cssText || "", a2 = P2.indexOf(t2) === -1; 2108 return e4 + "<" + t2 + ' data-rh="true" ' + i2 + (a2 ? "/>" : ">" + o3 + "</" + t2 + ">"); 2109 }, ""); 2110 })(e2, r4, n3); 2111 } }; 2112 } 2113}, k = function(t2) { 2114 var e2 = t2.baseTag, r4 = t2.bodyAttributes, n3 = t2.encode, i2 = t2.htmlAttributes, o3 = t2.noscriptTags, a2 = t2.styleTags, s2 = t2.title, c2 = s2 === void 0 ? "" : s2, u2 = t2.titleAttributes, h2 = t2.linkTags, m2 = t2.metaTags, y2 = t2.scriptTags, T3 = { toComponent: function() { 2115 }, toString: function() { 2116 return ""; 2117 } }; 2118 if (t2.prioritizeSeoTags) { 2119 var g2 = (function(t3) { 2120 var e3 = t3.linkTags, r5 = t3.scriptTags, n4 = t3.encode, i3 = E(t3.metaTags, d), o4 = E(e3, p), a3 = E(r5, f); 2121 return { priorityMethods: { toComponent: function() { 2122 return [].concat(j(l.META, i3.priority), j(l.LINK, o4.priority), j(l.SCRIPT, a3.priority)); 2123 }, toString: function() { 2124 return M(l.META, i3.priority, n4) + " " + M(l.LINK, o4.priority, n4) + " " + M(l.SCRIPT, a3.priority, n4); 2125 } }, metaTags: i3.default, linkTags: o4.default, scriptTags: a3.default }; 2126 })(t2); 2127 T3 = g2.priorityMethods, h2 = g2.linkTags, m2 = g2.metaTags, y2 = g2.scriptTags; 2128 } 2129 return { priority: T3, base: M(l.BASE, e2, n3), bodyAttributes: M("bodyAttributes", r4, n3), htmlAttributes: M("htmlAttributes", i2, n3), link: M(l.LINK, h2, n3), meta: M(l.META, m2, n3), noscript: M(l.NOSCRIPT, o3, n3), script: M(l.SCRIPT, y2, n3), style: M(l.STYLE, a2, n3), title: M(l.TITLE, { title: c2, titleAttributes: u2 }, n3) }; 2130}, H = [], N = function(t2, e2) { 2131 var r4 = this; 2132 e2 === void 0 && (e2 = typeof document < "u"), this.instances = [], this.value = { setHelmet: function(t3) { 2133 r4.context.helmet = t3; 2134 }, helmetInstances: { get: function() { 2135 return r4.canUseDOM ? H : r4.instances; 2136 }, add: function(t3) { 2137 (r4.canUseDOM ? H : r4.instances).push(t3); 2138 }, remove: function(t3) { 2139 var e3 = (r4.canUseDOM ? H : r4.instances).indexOf(t3); 2140 (r4.canUseDOM ? H : r4.instances).splice(e3, 1); 2141 } } }, this.context = t2, this.canUseDOM = e2, e2 || (t2.helmet = k({ baseTag: [], bodyAttributes: {}, encodeSpecialCharacters: !0, htmlAttributes: {}, linkTags: [], metaTags: [], noscriptTags: [], scriptTags: [], styleTags: [], title: "", titleAttributes: {} })); 2142}, R = react_default.createContext({}), D = import_prop_types.default.shape({ setHelmet: import_prop_types.default.func, helmetInstances: import_prop_types.default.shape({ get: import_prop_types.default.func, add: import_prop_types.default.func, remove: import_prop_types.default.func }) }), U = typeof document < "u", q = (function(e2) { 2143 function r4(t2) { 2144 var n3; 2145 return (n3 = e2.call(this, t2) || this).helmetData = new N(n3.props.context, r4.canUseDOM), n3; 2146 } 2147 return s(r4, e2), r4.prototype.render = function() { 2148 return react_default.createElement(R.Provider, { value: this.helmetData.value }, this.props.children); 2149 }, r4; 2150})(Component); 2151q.canUseDOM = U, q.propTypes = { context: import_prop_types.default.shape({ helmet: import_prop_types.default.shape() }), children: import_prop_types.default.node.isRequired }, q.defaultProps = { context: {} }, q.displayName = "HelmetProvider"; 2152var Y = function(t2, e2) { 2153 var r4, n3 = document.head || document.querySelector(l.HEAD), i2 = n3.querySelectorAll(t2 + "[data-rh]"), o3 = [].slice.call(i2), a2 = []; 2154 return e2 && e2.length && e2.forEach(function(e3) { 2155 var n4 = document.createElement(t2); 2156 for (var i3 in e3) Object.prototype.hasOwnProperty.call(e3, i3) && (i3 === "innerHTML" ? n4.innerHTML = e3.innerHTML : i3 === "cssText" ? n4.styleSheet ? n4.styleSheet.cssText = e3.cssText : n4.appendChild(document.createTextNode(e3.cssText)) : n4.setAttribute(i3, e3[i3] === void 0 ? "" : e3[i3])); 2157 n4.setAttribute("data-rh", "true"), o3.some(function(t3, e4) { 2158 return r4 = e4, n4.isEqualNode(t3); 2159 }) ? o3.splice(r4, 1) : a2.push(n4); 2160 }), o3.forEach(function(t3) { 2161 return t3.parentNode.removeChild(t3); 2162 }), a2.forEach(function(t3) { 2163 return n3.appendChild(t3); 2164 }), { oldTags: o3, newTags: a2 }; 2165}, B = function(t2, e2) { 2166 var r4 = document.getElementsByTagName(t2)[0]; 2167 if (r4) { 2168 for (var n3 = r4.getAttribute("data-rh"), i2 = n3 ? n3.split(",") : [], o3 = [].concat(i2), a2 = Object.keys(e2), s2 = 0; s2 < a2.length; s2 += 1) { 2169 var c2 = a2[s2], u2 = e2[c2] || ""; 2170 r4.getAttribute(c2) !== u2 && r4.setAttribute(c2, u2), i2.indexOf(c2) === -1 && i2.push(c2); 2171 var l3 = o3.indexOf(c2); 2172 l3 !== -1 && o3.splice(l3, 1); 2173 } 2174 for (var p2 = o3.length - 1; p2 >= 0; p2 -= 1) r4.removeAttribute(o3[p2]); 2175 i2.length === o3.length ? r4.removeAttribute("data-rh") : r4.getAttribute("data-rh") !== a2.join(",") && r4.setAttribute("data-rh", a2.join(",")); 2176 } 2177}, K = function(t2, e2) { 2178 var r4 = t2.baseTag, n3 = t2.htmlAttributes, i2 = t2.linkTags, o3 = t2.metaTags, a2 = t2.noscriptTags, s2 = t2.onChangeClientState, c2 = t2.scriptTags, u2 = t2.styleTags, p2 = t2.title, f2 = t2.titleAttributes; 2179 B(l.BODY, t2.bodyAttributes), B(l.HTML, n3), (function(t3, e3) { 2180 t3 !== void 0 && document.title !== t3 && (document.title = S(t3)), B(l.TITLE, e3); 2181 })(p2, f2); 2182 var d2 = { baseTag: Y(l.BASE, r4), linkTags: Y(l.LINK, i2), metaTags: Y(l.META, o3), noscriptTags: Y(l.NOSCRIPT, a2), scriptTags: Y(l.SCRIPT, c2), styleTags: Y(l.STYLE, u2) }, h2 = {}, m2 = {}; 2183 Object.keys(d2).forEach(function(t3) { 2184 var e3 = d2[t3], r5 = e3.newTags, n4 = e3.oldTags; 2185 r5.length && (h2[t3] = r5), n4.length && (m2[t3] = d2[t3].oldTags); 2186 }), e2 && e2(), s2(t2, h2, m2); 2187}, _ = null, z = (function(t2) { 2188 function e2() { 2189 for (var e3, r5 = arguments.length, n3 = new Array(r5), i2 = 0; i2 < r5; i2++) n3[i2] = arguments[i2]; 2190 return (e3 = t2.call.apply(t2, [this].concat(n3)) || this).rendered = !1, e3; 2191 } 2192 s(e2, t2); 2193 var r4 = e2.prototype; 2194 return r4.shouldComponentUpdate = function(t3) { 2195 return !(0, import_shallowequal.default)(t3, this.props); 2196 }, r4.componentDidUpdate = function() { 2197 this.emitChange(); 2198 }, r4.componentWillUnmount = function() { 2199 this.props.context.helmetInstances.remove(this), this.emitChange(); 2200 }, r4.emitChange = function() { 2201 var t3, e3, r5 = this.props.context, n3 = r5.setHelmet, i2 = null, o3 = (t3 = r5.helmetInstances.get().map(function(t4) { 2202 var e4 = a({}, t4.props); 2203 return delete e4.context, e4; 2204 }), { baseTag: A2(["href"], t3), bodyAttributes: v("bodyAttributes", t3), defer: T(t3, "defer"), encode: T(t3, "encodeSpecialCharacters"), htmlAttributes: v("htmlAttributes", t3), linkTags: C(l.LINK, ["rel", "href"], t3), metaTags: C(l.META, ["name", "charset", "http-equiv", "property", "itemprop"], t3), noscriptTags: C(l.NOSCRIPT, ["innerHTML"], t3), onChangeClientState: b(t3), scriptTags: C(l.SCRIPT, ["src", "innerHTML"], t3), styleTags: C(l.STYLE, ["cssText"], t3), title: g(t3), titleAttributes: v("titleAttributes", t3), prioritizeSeoTags: O(t3, "prioritizeSeoTags") }); 2205 q.canUseDOM ? (e3 = o3, _ && cancelAnimationFrame(_), e3.defer ? _ = requestAnimationFrame(function() { 2206 K(e3, function() { 2207 _ = null; 2208 }); 2209 }) : (K(e3), _ = null)) : k && (i2 = k(o3)), n3(i2); 2210 }, r4.init = function() { 2211 this.rendered || (this.rendered = !0, this.props.context.helmetInstances.add(this), this.emitChange()); 2212 }, r4.render = function() { 2213 return this.init(), null; 2214 }, e2; 2215})(Component); 2216z.propTypes = { context: D.isRequired }, z.displayName = "HelmetDispatcher"; 2217var F = ["children"], G = ["children"], W = (function(e2) { 2218 function r4() { 2219 return e2.apply(this, arguments) || this; 2220 } 2221 s(r4, e2); 2222 var o3 = r4.prototype; 2223 return o3.shouldComponentUpdate = function(t2) { 2224 return !(0, import_react_fast_compare.default)(I(this.props, "helmetData"), I(t2, "helmetData")); 2225 }, o3.mapNestedChildrenToProps = function(t2, e3) { 2226 if (!e3) return null; 2227 switch (t2.type) { 2228 case l.SCRIPT: 2229 case l.NOSCRIPT: 2230 return { innerHTML: e3 }; 2231 case l.STYLE: 2232 return { cssText: e3 }; 2233 default: 2234 throw new Error("<" + t2.type + " /> elements are self-closing and can not contain children. Refer to our API for more information."); 2235 } 2236 }, o3.flattenArrayTypeChildren = function(t2) { 2237 var e3, r5 = t2.child, n3 = t2.arrayTypeChildren; 2238 return a({}, n3, ((e3 = {})[r5.type] = [].concat(n3[r5.type] || [], [a({}, t2.newChildProps, this.mapNestedChildrenToProps(r5, t2.nestedChildren))]), e3)); 2239 }, o3.mapObjectTypeChildren = function(t2) { 2240 var e3, r5, n3 = t2.child, i2 = t2.newProps, o4 = t2.newChildProps, s2 = t2.nestedChildren; 2241 switch (n3.type) { 2242 case l.TITLE: 2243 return a({}, i2, ((e3 = {})[n3.type] = s2, e3.titleAttributes = a({}, o4), e3)); 2244 case l.BODY: 2245 return a({}, i2, { bodyAttributes: a({}, o4) }); 2246 case l.HTML: 2247 return a({}, i2, { htmlAttributes: a({}, o4) }); 2248 default: 2249 return a({}, i2, ((r5 = {})[n3.type] = a({}, o4), r5)); 2250 } 2251 }, o3.mapArrayTypeChildrenToProps = function(t2, e3) { 2252 var r5 = a({}, e3); 2253 return Object.keys(t2).forEach(function(e4) { 2254 var n3; 2255 r5 = a({}, r5, ((n3 = {})[e4] = t2[e4], n3)); 2256 }), r5; 2257 }, o3.warnOnInvalidChildren = function(t2, e3) { 2258 return (0, import_invariant.default)(h.some(function(e4) { 2259 return t2.type === e4; 2260 }), typeof t2.type == "function" ? "You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information." : "Only elements types " + h.join(", ") + " are allowed. Helmet does not support rendering <" + t2.type + "> elements. Refer to our API for more information."), (0, import_invariant.default)(!e3 || typeof e3 == "string" || Array.isArray(e3) && !e3.some(function(t3) { 2261 return typeof t3 != "string"; 2262 }), "Helmet expects a string as a child of <" + t2.type + ">. Did you forget to wrap your children in braces? ( <" + t2.type + ">{``}</" + t2.type + "> ) Refer to our API for more information."), !0; 2263 }, o3.mapChildrenToProps = function(e3, r5) { 2264 var n3 = this, i2 = {}; 2265 return react_default.Children.forEach(e3, function(t2) { 2266 if (t2 && t2.props) { 2267 var e4 = t2.props, o4 = e4.children, a2 = u(e4, F), s2 = Object.keys(a2).reduce(function(t3, e5) { 2268 return t3[y[e5] || e5] = a2[e5], t3; 2269 }, {}), c2 = t2.type; 2270 switch (typeof c2 == "symbol" ? c2 = c2.toString() : n3.warnOnInvalidChildren(t2, o4), c2) { 2271 case l.FRAGMENT: 2272 r5 = n3.mapChildrenToProps(o4, r5); 2273 break; 2274 case l.LINK: 2275 case l.META: 2276 case l.NOSCRIPT: 2277 case l.SCRIPT: 2278 case l.STYLE: 2279 i2 = n3.flattenArrayTypeChildren({ child: t2, arrayTypeChildren: i2, newChildProps: s2, nestedChildren: o4 }); 2280 break; 2281 default: 2282 r5 = n3.mapObjectTypeChildren({ child: t2, newProps: r5, newChildProps: s2, nestedChildren: o4 }); 2283 } 2284 } 2285 }), this.mapArrayTypeChildrenToProps(i2, r5); 2286 }, o3.render = function() { 2287 var e3 = this.props, r5 = e3.children, n3 = u(e3, G), i2 = a({}, n3), o4 = n3.helmetData; 2288 return r5 && (i2 = this.mapChildrenToProps(r5, i2)), !o4 || o4 instanceof N || (o4 = new N(o4.context, o4.instances)), o4 ? react_default.createElement(z, a({}, i2, { context: o4.value, helmetData: void 0 })) : react_default.createElement(R.Consumer, null, function(e4) { 2289 return react_default.createElement(z, a({}, i2, { context: e4 })); 2290 }); 2291 }, r4; 2292})(Component); 2293W.propTypes = { base: import_prop_types.default.object, bodyAttributes: import_prop_types.default.object, children: import_prop_types.default.oneOfType([import_prop_types.default.arrayOf(import_prop_types.default.node), import_prop_types.default.node]), defaultTitle: import_prop_types.default.string, defer: import_prop_types.default.bool, encodeSpecialCharacters: import_prop_types.default.bool, htmlAttributes: import_prop_types.default.object, link: import_prop_types.default.arrayOf(import_prop_types.default.object), meta: import_prop_types.default.arrayOf(import_prop_types.default.object), noscript: import_prop_types.default.arrayOf(import_prop_types.default.object), onChangeClientState: import_prop_types.default.func, script: import_prop_types.default.arrayOf(import_prop_types.default.object), style: import_prop_types.default.arrayOf(import_prop_types.default.object), title: import_prop_types.default.string, titleAttributes: import_prop_types.default.object, titleTemplate: import_prop_types.default.string, prioritizeSeoTags: import_prop_types.default.bool, helmetData: import_prop_types.default.object }, W.defaultProps = { defer: !0, encodeSpecialCharacters: !0, prioritizeSeoTags: !1 }, W.displayName = "Helmet"; 2294
vendor: 38 bytes, lines 2295-2297
2295// src/manager/App.tsx 2296init_react(); 2297
vendor: 145 bytes, lines 2298-2300
2298// src/shared/review/features.ts 2299var isReviewFeatureEnabled = (features) => features?.experimentalReview !== !1 && !!features?.changeDetection; 2300
vendor: 81 bytes, lines 2301-2303
2301// src/manager/components/error-boundary/ManagerErrorBoundary.tsx 2302init_react(); 2303
vendor: 380 bytes, lines 2304-2314
2304// ../../node_modules/@babel/runtime/helpers/esm/extends.js 2305function _extends() { 2306 return _extends = Object.assign ? Object.assign.bind() : function(n3) { 2307 for (var e2 = 1; e2 < arguments.length; e2++) { 2308 var t2 = arguments[e2]; 2309 for (var r4 in t2) ({}).hasOwnProperty.call(t2, r4) && (n3[r4] = t2[r4]); 2310 } 2311 return n3; 2312 }, _extends.apply(null, arguments); 2313} 2314
vendor: 236 bytes, lines 2315-2320
2315// ../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js 2316function _assertThisInitialized(e2) { 2317 if (e2 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 2318 return e2; 2319} 2320
vendor: 270 bytes, lines 2321-2327
2321// ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js 2322function _setPrototypeOf(t2, e2) { 2323 return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) { 2324 return t3.__proto__ = e3, t3; 2325 }, _setPrototypeOf(t2, e2); 2326} 2327
vendor: 205 bytes, lines 2328-2332
2328// ../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js 2329function _inheritsLoose(t2, o3) { 2330 t2.prototype = Object.create(o3.prototype), t2.prototype.constructor = t2, _setPrototypeOf(t2, o3); 2331} 2332
vendor: 278 bytes, lines 2333-2339
2333// ../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js 2334function _getPrototypeOf(t2) { 2335 return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) { 2336 return t3.__proto__ || Object.getPrototypeOf(t3); 2337 }, _getPrototypeOf(t2); 2338} 2339
vendor: 236 bytes, lines 2340-2348
2340// ../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js 2341function _isNativeFunction(t2) { 2342 try { 2343 return Function.toString.call(t2).indexOf("[native code]") !== -1; 2344 } catch { 2345 return typeof t2 == "function"; 2346 } 2347} 2348
vendor: 317 bytes, lines 2349-2360
2349// ../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js 2350function _isNativeReflectConstruct() { 2351 try { 2352 var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { 2353 })); 2354 } catch { 2355 } 2356 return (_isNativeReflectConstruct = function() { 2357 return !!t2; 2358 })(); 2359} 2360
vendor: 323 bytes, lines 2361-2369
2361// ../../node_modules/@babel/runtime/helpers/esm/construct.js 2362function _construct(t2, e2, r4) { 2363 if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); 2364 var o3 = [null]; 2365 o3.push.apply(o3, e2); 2366 var p2 = new (t2.bind.apply(t2, o3))(); 2367 return r4 && _setPrototypeOf(p2, r4.prototype), p2; 2368} 2369
vendor: 846 bytes, lines 2370-2393
2370// ../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js 2371function _wrapNativeSuper(t2) { 2372 var r4 = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0; 2373 return _wrapNativeSuper = function(t3) { 2374 if (t3 === null || !_isNativeFunction(t3)) return t3; 2375 if (typeof t3 != "function") throw new TypeError("Super expression must either be null or a function"); 2376 if (r4 !== void 0) { 2377 if (r4.has(t3)) return r4.get(t3); 2378 r4.set(t3, Wrapper8); 2379 } 2380 function Wrapper8() { 2381 return _construct(t3, arguments, _getPrototypeOf(this).constructor); 2382 } 2383 return Wrapper8.prototype = Object.create(t3.prototype, { 2384 constructor: { 2385 value: Wrapper8, 2386 enumerable: !1, 2387 writable: !0, 2388 configurable: !0 2389 } 2390 }), _setPrototypeOf(Wrapper8, t3); 2391 }, _wrapNativeSuper(t2); 2392} 2393
vendor: 20,617 bytes, lines 2394-2899
2394// ../../node_modules/polished/dist/polished.esm.js 2395var PolishedError = (function(_Error) { 2396 _inheritsLoose(PolishedError2, _Error); 2397 function PolishedError2(code) { 2398 var _this; 2399 if (1) 2400 _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this; 2401 else 2402 for (var _len2, args, _key2; _key2 < _len2; _key2++) 2403 ; 2404 return _assertThisInitialized(_this); 2405 } 2406 return PolishedError2; 2407})(_wrapNativeSuper(Error)); 2408function endsWith(string, suffix) { 2409 return string.substr(-suffix.length) === suffix; 2410} 2411var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/; 2412function stripUnit(value) { 2413 if (typeof value != "string") return value; 2414 var matchedValue = value.match(cssRegex$1); 2415 return matchedValue ? parseFloat(value) : value; 2416} 2417var pxtoFactory = function(to) { 2418 return function(pxval, base) { 2419 base === void 0 && (base = "16px"); 2420 var newPxval = pxval, newBase = base; 2421 if (typeof pxval == "string") { 2422 if (!endsWith(pxval, "px")) 2423 throw new PolishedError(69, to, pxval); 2424 newPxval = stripUnit(pxval); 2425 } 2426 if (typeof base == "string") { 2427 if (!endsWith(base, "px")) 2428 throw new PolishedError(70, to, base); 2429 newBase = stripUnit(base); 2430 } 2431 if (typeof newPxval == "string") 2432 throw new PolishedError(71, pxval, to); 2433 if (typeof newBase == "string") 2434 throw new PolishedError(72, base, to); 2435 return "" + newPxval / newBase + to; 2436 }; 2437}, pixelsto = pxtoFactory, em = pixelsto("em"); 2438var rem = pixelsto("rem"); 2439function colorToInt(color2) { 2440 return Math.round(color2 * 255); 2441} 2442function convertToInt(red, green, blue) { 2443 return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue); 2444} 2445function hslToRgb(hue, saturation, lightness, convert2) { 2446 if (convert2 === void 0 && (convert2 = convertToInt), saturation === 0) 2447 return convert2(lightness, lightness, lightness); 2448 var huePrime = (hue % 360 + 360) % 360 / 60, chroma = (1 - Math.abs(2 * lightness - 1)) * saturation, secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)), red = 0, green = 0, blue = 0; 2449 huePrime >= 0 && huePrime < 1 ? (red = chroma, green = secondComponent) : huePrime >= 1 && huePrime < 2 ? (red = secondComponent, green = chroma) : huePrime >= 2 && huePrime < 3 ? (green = chroma, blue = secondComponent) : huePrime >= 3 && huePrime < 4 ? (green = secondComponent, blue = chroma) : huePrime >= 4 && huePrime < 5 ? (red = secondComponent, blue = chroma) : huePrime >= 5 && huePrime < 6 && (red = chroma, blue = secondComponent); 2450 var lightnessModification = lightness - chroma / 2, finalRed = red + lightnessModification, finalGreen = green + lightnessModification, finalBlue = blue + lightnessModification; 2451 return convert2(finalRed, finalGreen, finalBlue); 2452} 2453var namedColorMap = { 2454 aliceblue: "f0f8ff", 2455 antiquewhite: "faebd7", 2456 aqua: "00ffff", 2457 aquamarine: "7fffd4", 2458 azure: "f0ffff", 2459 beige: "f5f5dc", 2460 bisque: "ffe4c4", 2461 black: "000", 2462 blanchedalmond: "ffebcd", 2463 blue: "0000ff", 2464 blueviolet: "8a2be2", 2465 brown: "a52a2a", 2466 burlywood: "deb887", 2467 cadetblue: "5f9ea0", 2468 chartreuse: "7fff00", 2469 chocolate: "d2691e", 2470 coral: "ff7f50", 2471 cornflowerblue: "6495ed", 2472 cornsilk: "fff8dc", 2473 crimson: "dc143c", 2474 cyan: "00ffff", 2475 darkblue: "00008b", 2476 darkcyan: "008b8b", 2477 darkgoldenrod: "b8860b", 2478 darkgray: "a9a9a9", 2479 darkgreen: "006400", 2480 darkgrey: "a9a9a9", 2481 darkkhaki: "bdb76b", 2482 darkmagenta: "8b008b", 2483 darkolivegreen: "556b2f", 2484 darkorange: "ff8c00", 2485 darkorchid: "9932cc", 2486 darkred: "8b0000", 2487 darksalmon: "e9967a", 2488 darkseagreen: "8fbc8f", 2489 darkslateblue: "483d8b", 2490 darkslategray: "2f4f4f", 2491 darkslategrey: "2f4f4f", 2492 darkturquoise: "00ced1", 2493 darkviolet: "9400d3", 2494 deeppink: "ff1493", 2495 deepskyblue: "00bfff", 2496 dimgray: "696969", 2497 dimgrey: "696969", 2498 dodgerblue: "1e90ff", 2499 firebrick: "b22222", 2500 floralwhite: "fffaf0", 2501 forestgreen: "228b22", 2502 fuchsia: "ff00ff", 2503 gainsboro: "dcdcdc", 2504 ghostwhite: "f8f8ff", 2505 gold: "ffd700", 2506 goldenrod: "daa520", 2507 gray: "808080", 2508 green: "008000", 2509 greenyellow: "adff2f", 2510 grey: "808080", 2511 honeydew: "f0fff0", 2512 hotpink: "ff69b4", 2513 indianred: "cd5c5c", 2514 indigo: "4b0082", 2515 ivory: "fffff0", 2516 khaki: "f0e68c", 2517 lavender: "e6e6fa", 2518 lavenderblush: "fff0f5", 2519 lawngreen: "7cfc00", 2520 lemonchiffon: "fffacd", 2521 lightblue: "add8e6", 2522 lightcoral: "f08080", 2523 lightcyan: "e0ffff", 2524 lightgoldenrodyellow: "fafad2", 2525 lightgray: "d3d3d3", 2526 lightgreen: "90ee90", 2527 lightgrey: "d3d3d3", 2528 lightpink: "ffb6c1", 2529 lightsalmon: "ffa07a", 2530 lightseagreen: "20b2aa", 2531 lightskyblue: "87cefa", 2532 lightslategray: "789", 2533 lightslategrey: "789", 2534 lightsteelblue: "b0c4de", 2535 lightyellow: "ffffe0", 2536 lime: "0f0", 2537 limegreen: "32cd32", 2538 linen: "faf0e6", 2539 magenta: "f0f", 2540 maroon: "800000", 2541 mediumaquamarine: "66cdaa", 2542 mediumblue: "0000cd", 2543 mediumorchid: "ba55d3", 2544 mediumpurple: "9370db", 2545 mediumseagreen: "3cb371", 2546 mediumslateblue: "7b68ee", 2547 mediumspringgreen: "00fa9a", 2548 mediumturquoise: "48d1cc", 2549 mediumvioletred: "c71585", 2550 midnightblue: "191970", 2551 mintcream: "f5fffa", 2552 mistyrose: "ffe4e1", 2553 moccasin: "ffe4b5", 2554 navajowhite: "ffdead", 2555 navy: "000080", 2556 oldlace: "fdf5e6", 2557 olive: "808000", 2558 olivedrab: "6b8e23", 2559 orange: "ffa500", 2560 orangered: "ff4500", 2561 orchid: "da70d6", 2562 palegoldenrod: "eee8aa", 2563 palegreen: "98fb98", 2564 paleturquoise: "afeeee", 2565 palevioletred: "db7093", 2566 papayawhip: "ffefd5", 2567 peachpuff: "ffdab9", 2568 peru: "cd853f", 2569 pink: "ffc0cb", 2570 plum: "dda0dd", 2571 powderblue: "b0e0e6", 2572 purple: "800080", 2573 rebeccapurple: "639", 2574 red: "f00", 2575 rosybrown: "bc8f8f", 2576 royalblue: "4169e1", 2577 saddlebrown: "8b4513", 2578 salmon: "fa8072", 2579 sandybrown: "f4a460", 2580 seagreen: "2e8b57", 2581 seashell: "fff5ee", 2582 sienna: "a0522d", 2583 silver: "c0c0c0", 2584 skyblue: "87ceeb", 2585 slateblue: "6a5acd", 2586 slategray: "708090", 2587 slategrey: "708090", 2588 snow: "fffafa", 2589 springgreen: "00ff7f", 2590 steelblue: "4682b4", 2591 tan: "d2b48c", 2592 teal: "008080", 2593 thistle: "d8bfd8", 2594 tomato: "ff6347", 2595 turquoise: "40e0d0", 2596 violet: "ee82ee", 2597 wheat: "f5deb3", 2598 white: "fff", 2599 whitesmoke: "f5f5f5", 2600 yellow: "ff0", 2601 yellowgreen: "9acd32" 2602}; 2603function nameToHex(color2) { 2604 if (typeof color2 != "string") return color2; 2605 var normalizedColorName = color2.toLowerCase(); 2606 return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color2; 2607} 2608var hexRegex = /^#[a-fA-F0-9]{6}$/, hexRgbaRegex = /^#[a-fA-F0-9]{8}$/, reducedHexRegex = /^#[a-fA-F0-9]{3}$/, reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/, rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i, rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i, hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i; 2609function parseToRgb(color2) { 2610 if (typeof color2 != "string") 2611 throw new PolishedError(3); 2612 var normalizedColor = nameToHex(color2); 2613 if (normalizedColor.match(hexRegex)) 2614 return { 2615 red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16), 2616 green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16), 2617 blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16) 2618 }; 2619 if (normalizedColor.match(hexRgbaRegex)) { 2620 var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2)); 2621 return { 2622 red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16), 2623 green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16), 2624 blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16), 2625 alpha 2626 }; 2627 } 2628 if (normalizedColor.match(reducedHexRegex)) 2629 return { 2630 red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16), 2631 green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16), 2632 blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16) 2633 }; 2634 if (normalizedColor.match(reducedRgbaHexRegex)) { 2635 var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2)); 2636 return { 2637 red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16), 2638 green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16), 2639 blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16), 2640 alpha: _alpha 2641 }; 2642 } 2643 var rgbMatched = rgbRegex.exec(normalizedColor); 2644 if (rgbMatched) 2645 return { 2646 red: parseInt("" + rgbMatched[1], 10), 2647 green: parseInt("" + rgbMatched[2], 10), 2648 blue: parseInt("" + rgbMatched[3], 10) 2649 }; 2650 var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50)); 2651 if (rgbaMatched) 2652 return { 2653 red: parseInt("" + rgbaMatched[1], 10), 2654 green: parseInt("" + rgbaMatched[2], 10), 2655 blue: parseInt("" + rgbaMatched[3], 10), 2656 alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4]) 2657 }; 2658 var hslMatched = hslRegex.exec(normalizedColor); 2659 if (hslMatched) { 2660 var hue = parseInt("" + hslMatched[1], 10), saturation = parseInt("" + hslMatched[2], 10) / 100, lightness = parseInt("" + hslMatched[3], 10) / 100, rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")", hslRgbMatched = rgbRegex.exec(rgbColorString); 2661 if (!hslRgbMatched) 2662 throw new PolishedError(4, normalizedColor, rgbColorString); 2663 return { 2664 red: parseInt("" + hslRgbMatched[1], 10), 2665 green: parseInt("" + hslRgbMatched[2], 10), 2666 blue: parseInt("" + hslRgbMatched[3], 10) 2667 }; 2668 } 2669 var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50)); 2670 if (hslaMatched) { 2671 var _hue = parseInt("" + hslaMatched[1], 10), _saturation = parseInt("" + hslaMatched[2], 10) / 100, _lightness = parseInt("" + hslaMatched[3], 10) / 100, _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")", _hslRgbMatched = rgbRegex.exec(_rgbColorString); 2672 if (!_hslRgbMatched) 2673 throw new PolishedError(4, normalizedColor, _rgbColorString); 2674 return { 2675 red: parseInt("" + _hslRgbMatched[1], 10), 2676 green: parseInt("" + _hslRgbMatched[2], 10), 2677 blue: parseInt("" + _hslRgbMatched[3], 10), 2678 alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4]) 2679 }; 2680 } 2681 throw new PolishedError(5); 2682} 2683function rgbToHsl(color2) { 2684 var red = color2.red / 255, green = color2.green / 255, blue = color2.blue / 255, max = Math.max(red, green, blue), min = Math.min(red, green, blue), lightness = (max + min) / 2; 2685 if (max === min) 2686 return color2.alpha !== void 0 ? { 2687 hue: 0, 2688 saturation: 0, 2689 lightness, 2690 alpha: color2.alpha 2691 } : { 2692 hue: 0, 2693 saturation: 0, 2694 lightness 2695 }; 2696 var hue, delta = max - min, saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min); 2697 switch (max) { 2698 case red: 2699 hue = (green - blue) / delta + (green < blue ? 6 : 0); 2700 break; 2701 case green: 2702 hue = (blue - red) / delta + 2; 2703 break; 2704 default: 2705 hue = (red - green) / delta + 4; 2706 break; 2707 } 2708 return hue *= 60, color2.alpha !== void 0 ? { 2709 hue, 2710 saturation, 2711 lightness, 2712 alpha: color2.alpha 2713 } : { 2714 hue, 2715 saturation, 2716 lightness 2717 }; 2718} 2719function parseToHsl(color2) { 2720 return rgbToHsl(parseToRgb(color2)); 2721} 2722var reduceHexValue = function(value) { 2723 return value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6] ? "#" + value[1] + value[3] + value[5] : value; 2724}, reduceHexValue$1 = reduceHexValue; 2725function numberToHex(value) { 2726 var hex = value.toString(16); 2727 return hex.length === 1 ? "0" + hex : hex; 2728} 2729function colorToHex(color2) { 2730 return numberToHex(Math.round(color2 * 255)); 2731} 2732function convertToHex(red, green, blue) { 2733 return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue)); 2734} 2735function hslToHex(hue, saturation, lightness) { 2736 return hslToRgb(hue, saturation, lightness, convertToHex); 2737} 2738function hsl(value, saturation, lightness) { 2739 if (typeof value == "number" && typeof saturation == "number" && typeof lightness == "number") 2740 return hslToHex(value, saturation, lightness); 2741 if (typeof value == "object" && saturation === void 0 && lightness === void 0) 2742 return hslToHex(value.hue, value.saturation, value.lightness); 2743 throw new PolishedError(1); 2744} 2745function hsla(value, saturation, lightness, alpha) { 2746 if (typeof value == "number" && typeof saturation == "number" && typeof lightness == "number" && typeof alpha == "number") 2747 return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")"; 2748 if (typeof value == "object" && saturation === void 0 && lightness === void 0 && alpha === void 0) 2749 return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")"; 2750 throw new PolishedError(2); 2751} 2752function rgb(value, green, blue) { 2753 if (typeof value == "number" && typeof green == "number" && typeof blue == "number") 2754 return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue)); 2755 if (typeof value == "object" && green === void 0 && blue === void 0) 2756 return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue)); 2757 throw new PolishedError(6); 2758} 2759function rgba(firstValue, secondValue, thirdValue, fourthValue) { 2760 if (typeof firstValue == "string" && typeof secondValue == "number") { 2761 var rgbValue = parseToRgb(firstValue); 2762 return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")"; 2763 } else { 2764 if (typeof firstValue == "number" && typeof secondValue == "number" && typeof thirdValue == "number" && typeof fourthValue == "number") 2765 return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")"; 2766 if (typeof firstValue == "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0) 2767 return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")"; 2768 } 2769 throw new PolishedError(7); 2770} 2771var isRgb = function(color2) { 2772 return typeof color2.red == "number" && typeof color2.green == "number" && typeof color2.blue == "number" && (typeof color2.alpha != "number" || typeof color2.alpha > "u"); 2773}, isRgba = function(color2) { 2774 return typeof color2.red == "number" && typeof color2.green == "number" && typeof color2.blue == "number" && typeof color2.alpha == "number"; 2775}, isHsl = function(color2) { 2776 return typeof color2.hue == "number" && typeof color2.saturation == "number" && typeof color2.lightness == "number" && (typeof color2.alpha != "number" || typeof color2.alpha > "u"); 2777}, isHsla = function(color2) { 2778 return typeof color2.hue == "number" && typeof color2.saturation == "number" && typeof color2.lightness == "number" && typeof color2.alpha == "number"; 2779}; 2780function toColorString(color2) { 2781 if (typeof color2 != "object") throw new PolishedError(8); 2782 if (isRgba(color2)) return rgba(color2); 2783 if (isRgb(color2)) return rgb(color2); 2784 if (isHsla(color2)) return hsla(color2); 2785 if (isHsl(color2)) return hsl(color2); 2786 throw new PolishedError(8); 2787} 2788function curried(f2, length, acc) { 2789 return function() { 2790 var combined = acc.concat(Array.prototype.slice.call(arguments)); 2791 return combined.length >= length ? f2.apply(this, combined) : curried(f2, length, combined); 2792 }; 2793} 2794function curry(f2) { 2795 return curried(f2, f2.length, []); 2796} 2797function adjustHue(degree, color2) { 2798 if (color2 === "transparent") return color2; 2799 var hslColor = parseToHsl(color2); 2800 return toColorString(_extends({}, hslColor, { 2801 hue: hslColor.hue + parseFloat(degree) 2802 })); 2803} 2804var curriedAdjustHue = curry(adjustHue); 2805function guard(lowerBoundary, upperBoundary, value) { 2806 return Math.max(lowerBoundary, Math.min(upperBoundary, value)); 2807} 2808function darken2(amount, color2) { 2809 if (color2 === "transparent") return color2; 2810 var hslColor = parseToHsl(color2); 2811 return toColorString(_extends({}, hslColor, { 2812 lightness: guard(0, 1, hslColor.lightness - parseFloat(amount)) 2813 })); 2814} 2815var curriedDarken = curry(darken2), curriedDarken$1 = curriedDarken; 2816function desaturate(amount, color2) { 2817 if (color2 === "transparent") return color2; 2818 var hslColor = parseToHsl(color2); 2819 return toColorString(_extends({}, hslColor, { 2820 saturation: guard(0, 1, hslColor.saturation - parseFloat(amount)) 2821 })); 2822} 2823var curriedDesaturate = curry(desaturate); 2824function lighten2(amount, color2) { 2825 if (color2 === "transparent") return color2; 2826 var hslColor = parseToHsl(color2); 2827 return toColorString(_extends({}, hslColor, { 2828 lightness: guard(0, 1, hslColor.lightness + parseFloat(amount)) 2829 })); 2830} 2831var curriedLighten = curry(lighten2), curriedLighten$1 = curriedLighten; 2832function mix(weight, color2, otherColor) { 2833 if (color2 === "transparent") return otherColor; 2834 if (otherColor === "transparent") return color2; 2835 if (weight === 0) return otherColor; 2836 var parsedColor1 = parseToRgb(color2), color1 = _extends({}, parsedColor1, { 2837 alpha: typeof parsedColor1.alpha == "number" ? parsedColor1.alpha : 1 2838 }), parsedColor2 = parseToRgb(otherColor), color22 = _extends({}, parsedColor2, { 2839 alpha: typeof parsedColor2.alpha == "number" ? parsedColor2.alpha : 1 2840 }), alphaDelta = color1.alpha - color22.alpha, x2 = parseFloat(weight) * 2 - 1, y2 = x2 * alphaDelta === -1 ? x2 : x2 + alphaDelta, z2 = 1 + x2 * alphaDelta, weight1 = (y2 / z2 + 1) / 2, weight2 = 1 - weight1, mixedColor = { 2841 red: Math.floor(color1.red * weight1 + color22.red * weight2), 2842 green: Math.floor(color1.green * weight1 + color22.green * weight2), 2843 blue: Math.floor(color1.blue * weight1 + color22.blue * weight2), 2844 alpha: color1.alpha * parseFloat(weight) + color22.alpha * (1 - parseFloat(weight)) 2845 }; 2846 return rgba(mixedColor); 2847} 2848var curriedMix = curry(mix), mix$1 = curriedMix; 2849function opacify(amount, color2) { 2850 if (color2 === "transparent") return color2; 2851 var parsedColor = parseToRgb(color2), alpha = typeof parsedColor.alpha == "number" ? parsedColor.alpha : 1, colorWithAlpha = _extends({}, parsedColor, { 2852 alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100) 2853 }); 2854 return rgba(colorWithAlpha); 2855} 2856var curriedOpacify = curry(opacify); 2857function saturate(amount, color2) { 2858 if (color2 === "transparent") return color2; 2859 var hslColor = parseToHsl(color2); 2860 return toColorString(_extends({}, hslColor, { 2861 saturation: guard(0, 1, hslColor.saturation + parseFloat(amount)) 2862 })); 2863} 2864var curriedSaturate = curry(saturate); 2865function setHue(hue, color2) { 2866 return color2 === "transparent" ? color2 : toColorString(_extends({}, parseToHsl(color2), { 2867 hue: parseFloat(hue) 2868 })); 2869} 2870var curriedSetHue = curry(setHue); 2871function setLightness(lightness, color2) { 2872 return color2 === "transparent" ? color2 : toColorString(_extends({}, parseToHsl(color2), { 2873 lightness: parseFloat(lightness) 2874 })); 2875} 2876var curriedSetLightness = curry(setLightness); 2877function setSaturation(saturation, color2) { 2878 return color2 === "transparent" ? color2 : toColorString(_extends({}, parseToHsl(color2), { 2879 saturation: parseFloat(saturation) 2880 })); 2881} 2882var curriedSetSaturation = curry(setSaturation); 2883function shade(percentage, color2) { 2884 return color2 === "transparent" ? color2 : mix$1(parseFloat(percentage), "rgb(0, 0, 0)", color2); 2885} 2886var curriedShade = curry(shade); 2887function tint(percentage, color2) { 2888 return color2 === "transparent" ? color2 : mix$1(parseFloat(percentage), "rgb(255, 255, 255)", color2); 2889} 2890var curriedTint = curry(tint); 2891function transparentize(amount, color2) { 2892 if (color2 === "transparent") return color2; 2893 var parsedColor = parseToRgb(color2), alpha = typeof parsedColor.alpha == "number" ? parsedColor.alpha : 1, colorWithAlpha = _extends({}, parsedColor, { 2894 alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100) 2895 }); 2896 return rgba(colorWithAlpha); 2897} 2898var curriedTransparentize = curry(transparentize), curriedTransparentize$1 = curriedTransparentize; 2899
vendor: 5,068 bytes, lines 2900-3020
2900// src/manager/components/error-boundary/ManagerErrorBoundary.tsx 2901var Container = styled.div(({ theme }) => ({ 2902 display: "flex", 2903 justifyContent: "center", 2904 alignItems: "center", 2905 width: "100vw", 2906 height: "100vh", 2907 backgroundColor: theme.background.app, 2908 color: theme.color.defaultText, 2909 fontFamily: theme.typography.fonts.base 2910})), Content = styled.div(({ theme }) => ({ 2911 display: "flex", 2912 flexDirection: "column", 2913 justifyContent: "space-between", 2914 width: "80%", 2915 height: "80%", 2916 padding: 20, 2917 gap: 20, 2918 backgroundColor: theme.background.content, 2919 borderRadius: theme.appBorderRadius, 2920 border: `1px solid ${theme.color.negative}`, 2921 boxShadow: "0 0 64px rgba(0, 0, 0, 0.1)", 2922 overflow: "auto" 2923})), Info = styled.div(({ theme }) => ({ 2924 display: "flex", 2925 flexDirection: "column", 2926 alignItems: "start", 2927 gap: 15 2928})), Heading = styled.h1(({ theme }) => ({ 2929 display: "flex", 2930 alignItems: "center", 2931 margin: 0, 2932 gap: 10, 2933 fontSize: theme.typography.size.s2, 2934 fontWeight: theme.typography.weight.bold, 2935 color: theme.color.defaultText 2936})), SubHeading = styled.p(({ theme }) => ({ 2937 fontSize: theme.typography.size.s2, 2938 color: theme.textMutedColor, 2939 margin: 0, 2940 lineHeight: 1.4, 2941 textWrap: "balance" 2942})), ErrorWrapper = styled.div(({ theme }) => ({ 2943 display: "flex", 2944 flexDirection: "column-reverse", 2945 width: "100%", 2946 flex: "0 0 auto", 2947 border: `1px solid ${theme.appBorderColor}`, 2948 borderRadius: theme.appBorderRadius, 2949 pre: { 2950 borderRadius: 0 2951 } 2952})), CollapseToggle = styled.div(({ theme }) => ({ 2953 flex: "0 0 auto", 2954 display: "flex", 2955 alignItems: "center", 2956 gap: 10, 2957 height: 40, 2958 width: "100%", 2959 padding: "0 10px", 2960 cursor: "pointer", 2961 fontSize: theme.typography.size.s2, 2962 fontWeight: theme.typography.weight.bold, 2963 color: theme.color.defaultText, 2964 userSelect: "none", 2965 "&:hover": { 2966 backgroundColor: theme.base === "light" ? "rgba(0, 0, 0, 0.02)" : "rgba(255, 255, 255, 0.03)" 2967 }, 2968 svg: { 2969 color: theme.textMutedColor 2970 } 2971})), ErrorMessage = styled.pre(({ theme }) => ({ 2972 order: 1, 2973 padding: "11px 15px", 2974 margin: 0, 2975 fontSize: theme.typography.size.s1, 2976 color: theme.color.negativeText, 2977 backgroundColor: curriedTransparentize$1(theme.base === "light" ? 0.95 : 0.9, theme.color.negative), 2978 borderBottom: `1px solid ${theme.appBorderColor}`, 2979 whiteSpace: "pre-wrap", 2980 wordBreak: "break-word", 2981 fontFamily: theme.typography.fonts.mono, 2982 lineHeight: "18px" 2983})), ErrorStack = styled.pre(({ theme }) => ({ 2984 padding: 15, 2985 margin: 0, 2986 fontSize: theme.typography.size.s1, 2987 color: theme.textMutedColor, 2988 borderBottom: `1px solid ${theme.appBorderColor}`, 2989 borderRadius: 0, 2990 whiteSpace: "pre-wrap", 2991 wordBreak: "break-word", 2992 fontFamily: theme.typography.fonts.mono 2993})), ErrorFallback = ({ error, errorInfo }) => react_default.createElement(Container, { "data-testid": "manager-error-boundary" }, react_default.createElement(Content, null, react_default.createElement(Info, null, react_default.createElement(Heading, null, react_default.createElement(Badge, { status: "negative" }, "Error"), react_default.createElement("span", null, "Something went wrong")), react_default.createElement(SubHeading, null, "The Storybook Manager UI encountered an error. This is usually caused by custom addon code or configuration. Please check your browser console for more details. Try clearing browser storage if the issue persists."), react_default.createElement(Button, { asChild: !0, size: "medium" }, react_default.createElement("a", { href: window.location.origin + window.location.pathname.replace("iframe.html", "") }, react_default.createElement(SyncIcon, { size: 14 }), "Reload Storybook"))), react_default.createElement(ErrorWrapper, null, react_default.createElement(ErrorMessage, null, error.message || "Unknown error"), react_default.createElement( 2994 Collapsible, 2995 { 2996 collapsed: !0, 2997 summary: ({ isCollapsed, toggleCollapsed }) => react_default.createElement(CollapseToggle, { onClick: toggleCollapsed }, react_default.createElement(UnfoldIcon, null), isCollapsed ? "Expand error" : "Collapse error") 2998 }, 2999 (error.stack || errorInfo?.componentStack) && react_default.createElement(ErrorStack, null, error.stack, errorInfo?.componentStack && ` 3000 3001Component Stack:${errorInfo.componentStack}`) 3002)))), ManagerErrorBoundary = class extends Component { 3003 constructor(props) { 3004 super(props), this.state = { hasError: !1, error: null, errorInfo: null }; 3005 } 3006 static getDerivedStateFromError(error) { 3007 return { hasError: !0, error }; 3008 } 3009 componentDidCatch(error, errorInfo) { 3010 console.error("Storybook Manager UI Error:", error), console.error("Component Stack:", errorInfo.componentStack), this.setState({ errorInfo }), typeof globalThis.sendTelemetryError == "function" && globalThis.sendTelemetryError(error); 3011 } 3012 render() { 3013 let { hasError, error, errorInfo } = this.state, { children } = this.props; 3014 return hasError && error ? react_default.createElement(ErrorFallback, { error, errorInfo }) : children; 3015 } 3016}; 3017 3018// src/manager/components/layout/Layout.tsx 3019init_react(); 3020
vendor: 371 bytes, lines 3021-3026
3021// ../../node_modules/es-toolkit/dist/string/words.mjs 3022var CASE_SPLIT_PATTERN = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+", "gu"); 3023 3024// global-externals:storybook/theming/create 3025var create_default = __STORYBOOK_THEMING_CREATE__, { create: create2, themes: themes2 } = __STORYBOOK_THEMING_CREATE__; 3026
vendor: 1,815 bytes, lines 3027-3072
3027// src/shared/review/routes.ts 3028var REVIEW_COLLECTION_QUERY_PARAM = "collection", isReviewSummaryPath = (path) => path === "/review/" || path === "/review", isReviewCollectionStoryRoute = (path, customQueryParams) => !!path && path.startsWith("/story/") && customQueryParams?.[REVIEW_COLLECTION_QUERY_PARAM] !== void 0; 3029 3030// src/manager-api/modules/layout.ts 3031var { document: document2 } = scope; 3032var isPagesViewMode = (viewMode) => viewMode !== void 0 && viewMode !== "story" && viewMode !== "docs" && viewMode !== "review"; 3033var focusableUIElements = { 3034 addonPanel: "storybook-panel-region", 3035 storySearchField: "storybook-explorer-searchfield", 3036 storyListMenu: "storybook-explorer-menu", 3037 storyPanelRoot: "storybook-panel-root", 3038 showAddonPanel: "storybook-show-addon-panel", 3039 sidebarRegion: "storybook-sidebar-region", 3040 showSidebar: "storybook-show-sidebar" 3041}; 3042 3043// src/manager/constants.ts 3044var MEDIA_DESKTOP_BREAKPOINT = "@media (min-width: 600px)"; 3045 3046// src/manager/container/Notifications.tsx 3047init_react(); 3048 3049// src/manager/components/notifications/NotificationList.tsx 3050init_react(); 3051 3052// src/manager/components/layout/LayoutProvider.tsx 3053init_react(); 3054 3055// src/manager/hooks/useMedia.tsx 3056init_react(); 3057function useMediaQuery(query) { 3058 let getMatches = (queryMatch) => typeof window < "u" ? window.matchMedia(queryMatch).matches : !1, [matches, setMatches] = useState(getMatches(query)); 3059 function handleChange() { 3060 setMatches(getMatches(query)); 3061 } 3062 return useEffect(() => { 3063 let matchMedia = window.matchMedia(query); 3064 return handleChange(), matchMedia.addEventListener("change", handleChange), () => { 3065 matchMedia.removeEventListener("change", handleChange); 3066 }; 3067 }, [query]), matches; 3068} 3069 3070// src/manager/components/layout/LayoutProvider.tsx 3071var LayoutContext = createContext({ 3072 isMobile
vendor: 952 bytes, lines 3072-3104
3072MenuOpen: !1, 3073 setMobileMenuOpen: () => { 3074 }, 3075 isMobileAboutOpen: !1, 3076 setMobileAboutOpen: () => { 3077 }, 3078 isMobilePanelOpen: !1, 3079 setMobilePanelOpen: () => { 3080 }, 3081 isDesktop: !1, 3082 isMobile: !1 3083}), LayoutProvider = ({ children, forceDesktop }) => { 3084 let [isMobileMenuOpen, setMobileMenuOpen] = useState(!1), [isMobileAboutOpen, setMobileAboutOpen] = useState(!1), [isMobilePanelOpen, setMobilePanelOpen] = useState(!1), isDesktop = forceDesktop ?? useMediaQuery(`(min-width: ${600}px)`), isMobile2 = !isDesktop, contextValue = useMemo( 3085 () => ({ 3086 isMobileMenuOpen, 3087 setMobileMenuOpen, 3088 isMobileAboutOpen, 3089 setMobileAboutOpen, 3090 isMobilePanelOpen, 3091 setMobilePanelOpen, 3092 isDesktop, 3093 isMobile: isMobile2 3094 }), 3095 [ 3096 isMobileMenuOpen, 3097 setMobileMenuOpen, 3098 isMobileAboutOpen, 3099 setMobileAboutOpen, 3100 isMobilePanelOpen, 3101 setMobilePanelOpen, 3102 isDesktop, 3103 isMobile2 3104
vendor: 6,794 bytes, lines 3104-3291
3104] 3105 ); 3106 return react_default.createElement(LayoutContext.Provider, { value: contextValue }, children); 3107}, useLayout = () => useContext(LayoutContext); 3108 3109// src/manager/components/notifications/NotificationItem.tsx 3110init_react(); 3111var slideIn = keyframes({ 3112 "0%": { 3113 opacity: 0, 3114 transform: "translateY(30px)" 3115 }, 3116 "100%": { 3117 opacity: 1, 3118 transform: "translateY(0)" 3119 } 3120}), grow = keyframes({ 3121 "0%": { 3122 width: "0%" 3123 }, 3124 "100%": { 3125 width: "100%" 3126 } 3127}), Notification = styled.div( 3128 ({ theme }) => ({ 3129 position: "relative", 3130 display: "flex", 3131 border: `1px solid ${theme.appBorderColor}`, 3132 padding: "12px 6px 12px 12px", 3133 borderRadius: theme.appBorderRadius + 1, 3134 alignItems: "center", 3135 animation: `${slideIn} 500ms`, 3136 background: theme.base === "light" ? "hsla(203, 50%, 20%, .97)" : "hsla(203, 30%, 95%, .97)", 3137 boxShadow: "0 2px 5px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.1)", 3138 color: theme.color.inverseText, 3139 textDecoration: "none", 3140 overflow: "hidden", 3141 [MEDIA_DESKTOP_BREAKPOINT]: { 3142 boxShadow: `0 1px 2px 0 rgba(0, 0, 0, 0.05), 0px -5px 20px 10px ${theme.background.app}` 3143 } 3144 }), 3145 ({ duration, theme }) => duration && { 3146 "&::after": { 3147 content: '""', 3148 display: "block", 3149 position: "absolute", 3150 bottom: 0, 3151 left: 0, 3152 height: 3, 3153 background: theme.color.secondary, 3154 animation: `${grow} ${duration}ms linear forwards reverse` 3155 } 3156 } 3157), NotificationWithInteractiveStates = styled(Notification)({ 3158 cursor: "pointer", 3159 border: "none", 3160 outline: "none", 3161 textAlign: "left", 3162 transition: "all 150ms ease-out", 3163 transform: "translate3d(0, 0, 0)", 3164 "&:hover": { 3165 transform: "translate3d(0, -3px, 0)", 3166 boxShadow: "0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)" 3167 }, 3168 "&:active": { 3169 transform: "translate3d(0, 0, 0)", 3170 boxShadow: "0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)" 3171 }, 3172 "&:focus": { 3173 boxShadow: "rgba(2,156,253,1) 0 0 0 1px inset, 0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)" 3174 } 3175}), NotificationButton = NotificationWithInteractiveStates.withComponent("div"), NotificationLink = NotificationWithInteractiveStates.withComponent(Link2), NotificationIconWrapper = styled.div({ 3176 display: "flex", 3177 marginRight: 10, 3178 alignItems: "center", 3179 svg: { 3180 width: 16, 3181 height: 16 3182 } 3183}), NotificationTextWrapper = styled.div(({ theme }) => ({ 3184 width: "100%", 3185 display: "flex", 3186 flexDirection: "column", 3187 color: theme.color.inverseText 3188})), Headline = styled.div(({ theme }) => ({ 3189 height: "100%", 3190 alignItems: "center", 3191 whiteSpace: "balance", 3192 overflow: "hidden", 3193 textOverflow: "ellipsis", 3194 fontSize: theme.typography.size.s1, 3195 lineHeight: "16px", 3196 fontWeight: theme.typography.weight.bold 3197})), SubHeadline = styled.div(({ theme }) => ({ 3198 color: curriedTransparentize$1(0.25, theme.color.inverseText), 3199 fontSize: theme.typography.size.s1 - 1, 3200 lineHeight: "14px", 3201 marginTop: 2, 3202 whiteSpace: "balance" 3203})), ItemContent = ({ 3204 icon, 3205 content: { headline, subHeadline } 3206}) => react_default.createElement(react_default.Fragment, null, !icon || react_default.createElement(NotificationIconWrapper, null, icon), react_default.createElement(NotificationTextWrapper, null, react_default.createElement(Headline, { title: headline }, headline), subHeadline && react_default.createElement(SubHeadline, null, subHeadline))), DismissButtonWrapper = styled(Button)(({ theme }) => ({ 3207 width: 28, 3208 alignSelf: "center", 3209 marginTop: 0, 3210 color: theme.base === "light" ? "rgba(255,255,255,0.7)" : " #999999" 3211})), DismissNotificationItem = ({ onDismiss }) => react_default.createElement( 3212 DismissButtonWrapper, 3213 { 3214 padding: "small", 3215 variant: "ghost", 3216 ariaLabel: "Dismiss notification", 3217 onClick: (e2) => { 3218 e2.preventDefault(), e2.stopPropagation(), onDismiss(); 3219 } 3220 }, 3221 react_default.createElement(CloseAltIcon, { size: 12 }) 3222), NotificationItemSpacer = styled.div({ 3223 height: 48 3224}), NotificationItem = ({ 3225 notification: { content, duration, link, onClear, onClick, id, icon }, 3226 onDismissNotification, 3227 zIndex 3228}) => { 3229 let onTimeout = useCallback(() => { 3230 onDismissNotification(id), onClear && onClear({ dismissed: !1, timeout: !0 }); 3231 }, [id, onDismissNotification, onClear]), timer = useRef(null); 3232 useEffect(() => { 3233 if (duration) 3234 return timer.current = setTimeout(onTimeout, duration), () => clearTimeout(timer.current); 3235 }, [duration, onTimeout]); 3236 let onDismiss = useCallback(() => { 3237 clearTimeout(timer.current), onDismissNotification(id), onClear && onClear({ dismissed: !0, timeout: !1 }); 3238 }, [id, onDismissNotification, onClear]); 3239 return link ? react_default.createElement(NotificationLink, { to: link, duration, style: { zIndex } }, react_default.createElement(ItemContent, { icon, content }), react_default.createElement(DismissNotificationItem, { onDismiss })) : onClick ? react_default.createElement( 3240 NotificationButton, 3241 { 3242 duration, 3243 onClick: () => onClick({ onDismiss }), 3244 style: { zIndex } 3245 }, 3246 react_default.createElement(ItemContent, { icon, content }), 3247 react_default.createElement(DismissNotificationItem, { onDismiss }) 3248 ) : react_default.createElement(Notification, { duration, style: { zIndex } }, react_default.createElement(ItemContent, { icon, content }), react_default.createElement(DismissNotificationItem, { onDismiss })); 3249}, NotificationItem_default = NotificationItem; 3250 3251// src/manager/components/notifications/NotificationList.tsx 3252var NotificationList = ({ 3253 notifications, 3254 clearNotification 3255}) => { 3256 let { isMobile: isMobile2 } = useLayout(); 3257 return react_default.createElement(List, { isMobile: isMobile2 }, notifications && notifications.map((notification, index) => react_default.createElement( 3258 NotificationItem_default, 3259 { 3260 key: notification.id, 3261 onDismissNotification: (id) => clearNotification(id), 3262 notification, 3263 zIndex: notifications.length - index 3264 } 3265 ))); 3266}, List = styled.div( 3267 { 3268 zIndex: 200, 3269 "> * + *": { 3270 marginTop: 12 3271 }, 3272 "&:empty": { 3273 display: "none" 3274 } 3275 }, 3276 ({ isMobile: isMobile2 }) => isMobile2 && { 3277 position: "fixed", 3278 bottom: 40, 3279 margin: 20 3280 } 3281); 3282 3283// src/manager/container/Notifications.tsx 3284var mapper = ({ state, api }) => ({ 3285 notifications: state.notifications, 3286 clearNotification: api.clearNotification 3287}), Notifications = (props) => react_default.createElement(Consumer, { filter: mapper }, (fromState) => react_default.createElement(NotificationList, { ...props, ...fromState })); 3288 3289// src/manager/components/mobile/navigation/MobileNavigation.tsx 3290init_react(); 3291
vendor: 195 bytes, lines 3292-3296
3292// ../../node_modules/@react-aria/utils/dist/useLayoutEffect.mjs 3293init_react(); 3294var $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document < "u" ? react_default.useLayoutEffect : () => { 3295}; 3296
vendor: 79 bytes, lines 3297-3299
3297// ../../node_modules/@react-aria/utils/dist/useValueEffect.mjs 3298init_react(); 3299
vendor: 70 bytes, lines 3300-3302
3300// ../../node_modules/@react-aria/utils/dist/useId.mjs 3301init_react(); 3302
vendor: 3,221 bytes, lines 3303-3348
3303// ../../node_modules/@react-aria/ssr/dist/SSRProvider.mjs 3304init_react(); 3305var $b5e257d569688ac6$var$defaultContext = { 3306 prefix: String(Math.round(Math.random() * 1e10)), 3307 current: 0 3308}, $b5e257d569688ac6$var$SSRContext = react_default.createContext($b5e257d569688ac6$var$defaultContext), $b5e257d569688ac6$var$IsSSRContext = react_default.createContext(!1); 3309var $b5e257d569688ac6$var$canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap(); 3310function $b5e257d569688ac6$var$useCounter(isDisabled = !1) { 3311 let ctx = useContext($b5e257d569688ac6$var$SSRContext), ref = useRef(null); 3312 if (ref.current === null && !isDisabled) { 3313 var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; 3314 let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = react_default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 || (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current; 3315 if (currentOwner) { 3316 let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner); 3317 prevComponentValue == null ? $b5e257d569688ac6$var$componentIds.set(currentOwner, { 3318 id: ctx.current, 3319 state: currentOwner.memoizedState 3320 }) : currentOwner.memoizedState !== prevComponentValue.state && (ctx.current = prevComponentValue.id, $b5e257d569688ac6$var$componentIds.delete(currentOwner)); 3321 } 3322 ref.current = ++ctx.current; 3323 } 3324 return ref.current; 3325} 3326function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) { 3327 let ctx = useContext($b5e257d569688ac6$var$SSRContext), counter = $b5e257d569688ac6$var$useCounter(!!defaultId), prefix = `react-aria${ctx.prefix}`; 3328 return defaultId || `${prefix}-${counter}`; 3329} 3330function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) { 3331 let id = react_default.useId(), [didSSR] = useState($b5e257d569688ac6$export$535bd6ca7f90a273()), prefix = didSSR ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`; 3332 return defaultId || `${prefix}-${id}`; 3333} 3334var $b5e257d569688ac6$export$619500959fc48b26 = typeof react_default.useId == "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId; 3335function $b5e257d569688ac6$var$getSnapshot() { 3336 return !1; 3337} 3338function $b5e257d569688ac6$var$getServerSnapshot() { 3339 return !0; 3340} 3341function $b5e257d569688ac6$var$subscribe(onStoreChange) { 3342 return () => { 3343 }; 3344} 3345function $b5e257d569688ac6$export$535bd6ca7f90a273() { 3346 return typeof react_default.useSyncExternalStore == "function" ? react_default.useSyncExternalStore($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot) : useContext($b5e257d569688ac6$var$IsSSRContext); 3347} 3348
vendor: 1,844 bytes, lines 3349-3384
3349// ../../node_modules/@react-aria/utils/dist/useId.mjs 3350var $bdb11010cef70236$var$canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), $bdb11010cef70236$export$d41a04c74483c6ef = /* @__PURE__ */ new Map(), $bdb11010cef70236$var$registry; 3351typeof FinalizationRegistry < "u" && ($bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue) => { 3352 $bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue); 3353})); 3354function $bdb11010cef70236$export$f680877a34711e37(defaultId) { 3355 let [value, setValue] = useState(defaultId), nextId = useRef(null), res = $b5e257d569688ac6$export$619500959fc48b26(value), cleanupRef = useRef(null); 3356 if ($bdb11010cef70236$var$registry && $bdb11010cef70236$var$registry.register(cleanupRef, res), $bdb11010cef70236$var$canUseDOM) { 3357 let cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res); 3358 cacheIdRef && !cacheIdRef.includes(nextId) ? cacheIdRef.push(nextId) : $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [ 3359 nextId 3360 ]); 3361 } 3362 return $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => { 3363 let r4 = res; 3364 return () => { 3365 $bdb11010cef70236$var$registry && $bdb11010cef70236$var$registry.unregister(cleanupRef), $bdb11010cef70236$export$d41a04c74483c6ef.delete(r4); 3366 }; 3367 }, [ 3368 res 3369 ]), useEffect(() => { 3370 let newId = nextId.current; 3371 return newId && setValue(newId), () => { 3372 newId && (nextId.current = null); 3373 }; 3374 }), res; 3375} 3376function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) { 3377 if (idA === idB) return idA; 3378 let setIdsA = $bdb11010cef70236$export$d41a04c74483c6ef.get(idA); 3379 if (setIdsA) 3380 return setIdsA.forEach((ref) => ref.current = idB), idB; 3381 let setIdsB = $bdb11010cef70236$export$d41a04c74483c6ef.get(idB); 3382 return setIdsB ? (setIdsB.forEach((ref) => ref.current = idA), idA) : idB; 3383} 3384
vendor: 242 bytes, lines 3385-3391
3385// ../../node_modules/@react-aria/utils/dist/chain.mjs 3386function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) { 3387 return (...args) => { 3388 for (let callback of callbacks) typeof callback == "function" && callback(...args); 3389 }; 3390} 3391
vendor: 773 bytes, lines 3392-3403
3392// ../../node_modules/@react-aria/utils/dist/domHelpers.mjs 3393var $431fbd86ca7dc216$export$b204af158042fbac = (el) => { 3394 var _el_ownerDocument; 3395 return (_el_ownerDocument = el?.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document; 3396}, $431fbd86ca7dc216$export$f21a1ffae260145a = (el) => el && "window" in el && el.window === el ? el : $431fbd86ca7dc216$export$b204af158042fbac(el).defaultView || window; 3397function $431fbd86ca7dc216$var$isNode(value) { 3398 return value !== null && typeof value == "object" && "nodeType" in value && typeof value.nodeType == "number"; 3399} 3400function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) { 3401 return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in node; 3402} 3403
vendor: 203 bytes, lines 3404-3409
3404// ../../node_modules/@react-stately/flags/dist/import.mjs 3405var $f4e2df6bd15f8569$var$_shadowDOM = !1; 3406function $f4e2df6bd15f8569$export$98658e8c59125e6a() { 3407 return $f4e2df6bd15f8569$var$_shadowDOM; 3408} 3409
vendor: 1,377 bytes, lines 3410-3431
3410// ../../node_modules/@react-aria/utils/dist/DOMFunctions.mjs 3411function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) { 3412 if (!$f4e2df6bd15f8569$export$98658e8c59125e6a()) return otherNode && node ? node.contains(otherNode) : !1; 3413 if (!node || !otherNode) return !1; 3414 let currentNode = otherNode; 3415 for (; currentNode !== null; ) { 3416 if (currentNode === node) return !0; 3417 currentNode.tagName === "SLOT" && currentNode.assignedSlot ? currentNode = currentNode.assignedSlot.parentNode : $431fbd86ca7dc216$export$af51f0f06c0f328a(currentNode) ? currentNode = currentNode.host : currentNode = currentNode.parentNode; 3418 } 3419 return !1; 3420} 3421var $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document) => { 3422 var _activeElement_shadowRoot; 3423 if (!$f4e2df6bd15f8569$export$98658e8c59125e6a()) return doc.activeElement; 3424 let activeElement = doc.activeElement; 3425 for (; activeElement && "shadowRoot" in activeElement && (!((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot === void 0) && _activeElement_shadowRoot.activeElement); ) activeElement = activeElement.shadowRoot.activeElement; 3426 return activeElement; 3427}; 3428function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) { 3429 return $f4e2df6bd15f8569$export$98658e8c59125e6a() && event.target.shadowRoot && event.composedPath ? event.composedPath()[0] : event.target; 3430} 3431
vendor: 608 bytes, lines 3432-3447
3432// ../../node_modules/clsx/dist/clsx.mjs 3433function r2(e2) { 3434 var t2, f2, n3 = ""; 3435 if (typeof e2 == "string" || typeof e2 == "number") n3 += e2; 3436 else if (typeof e2 == "object") if (Array.isArray(e2)) { 3437 var o3 = e2.length; 3438 for (t2 = 0; t2 < o3; t2++) e2[t2] && (f2 = r2(e2[t2])) && (n3 && (n3 += " "), n3 += f2); 3439 } else for (f2 in e2) e2[f2] && (n3 && (n3 += " "), n3 += f2); 3440 return n3; 3441} 3442function clsx() { 3443 for (var e2, t2, f2 = 0, n3 = "", o3 = arguments.length; f2 < o3; f2++) (e2 = arguments[f2]) && (t2 = r2(e2)) && (n3 && (n3 += " "), n3 += t2); 3444 return n3; 3445} 3446var clsx_default = clsx; 3447
vendor: 896 bytes, lines 3448-3465
3448// ../../node_modules/@react-aria/utils/dist/mergeProps.mjs 3449function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) { 3450 let result = { 3451 ...args[0] 3452 }; 3453 for (let i2 = 1; i2 < args.length; i2++) { 3454 let props = args[i2]; 3455 for (let key in props) { 3456 let a2 = result[key], b2 = props[key]; 3457 typeof a2 == "function" && typeof b2 == "function" && // This is a lot faster than a regex. 3458 key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */ 3459 65 && key.charCodeAt(2) <= /* 'Z' */ 3460 90 ? result[key] = $ff5963eb1fccf552$export$e08e3b67e392101e(a2, b2) : (key === "className" || key === "UNSAFE_className") && typeof a2 == "string" && typeof b2 == "string" ? result[key] = clsx_default(a2, b2) : key === "id" && a2 && b2 ? result.id = $bdb11010cef70236$export$cd8c9cb68f842629(a2, b2) : result[key] = b2 !== void 0 ? b2 : a2; 3461 } 3462 } 3463 return result; 3464} 3465
vendor: 735 bytes, lines 3466-3484
3466// ../../node_modules/@react-aria/utils/dist/mergeRefs.mjs 3467function $5dc95899b306f630$export$c9058316764c140e(...refs) { 3468 return refs.length === 1 && refs[0] ? refs[0] : (value) => { 3469 let hasCleanup = !1, cleanups = refs.map((ref) => { 3470 let cleanup = $5dc95899b306f630$var$setRef(ref, value); 3471 return hasCleanup || (hasCleanup = typeof cleanup == "function"), cleanup; 3472 }); 3473 if (hasCleanup) return () => { 3474 cleanups.forEach((cleanup, i2) => { 3475 typeof cleanup == "function" ? cleanup() : $5dc95899b306f630$var$setRef(refs[i2], null); 3476 }); 3477 }; 3478 }; 3479} 3480function $5dc95899b306f630$var$setRef(ref, value) { 3481 if (typeof ref == "function") return ref(value); 3482 ref != null && (ref.current = value); 3483} 3484
vendor: 2,100 bytes, lines 3485-3548
3485// ../../node_modules/@react-aria/utils/dist/filterDOMProps.mjs 3486var $65484d02dcb7eb3e$var$DOMPropNames = /* @__PURE__ */ new Set([ 3487 "id" 3488]), $65484d02dcb7eb3e$var$labelablePropNames = /* @__PURE__ */ new Set([ 3489 "aria-label", 3490 "aria-labelledby", 3491 "aria-describedby", 3492 "aria-details" 3493]), $65484d02dcb7eb3e$var$linkPropNames = /* @__PURE__ */ new Set([ 3494 "href", 3495 "hrefLang", 3496 "target", 3497 "rel", 3498 "download", 3499 "ping", 3500 "referrerPolicy" 3501]), $65484d02dcb7eb3e$var$globalAttrs = /* @__PURE__ */ new Set([ 3502 "dir", 3503 "lang", 3504 "hidden", 3505 "inert", 3506 "translate" 3507]), $65484d02dcb7eb3e$var$globalEvents = /* @__PURE__ */ new Set([ 3508 "onClick", 3509 "onAuxClick", 3510 "onContextMenu", 3511 "onDoubleClick", 3512 "onMouseDown", 3513 "onMouseEnter", 3514 "onMouseLeave", 3515 "onMouseMove", 3516 "onMouseOut", 3517 "onMouseOver", 3518 "onMouseUp", 3519 "onTouchCancel", 3520 "onTouchEnd", 3521 "onTouchMove", 3522 "onTouchStart", 3523 "onPointerDown", 3524 "onPointerMove", 3525 "onPointerUp", 3526 "onPointerCancel", 3527 "onPointerEnter", 3528 "onPointerLeave", 3529 "onPointerOver", 3530 "onPointerOut", 3531 "onGotPointerCapture", 3532 "onLostPointerCapture", 3533 "onScroll", 3534 "onWheel", 3535 "onAnimationStart", 3536 "onAnimationEnd", 3537 "onAnimationIteration", 3538 "onTransitionCancel", 3539 "onTransitionEnd", 3540 "onTransitionRun", 3541 "onTransitionStart" 3542]), $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/; 3543function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) { 3544 let { labelable, isLink, global: global2, events: events2 = global2, propNames } = opts, filteredProps = {}; 3545 for (let prop in props) Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global2 && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events2 && ($65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith("Capture") && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7))) || propNames?.has(prop) || $65484d02dcb7eb3e$var$propRe.test(prop)) && (filteredProps[prop] = props[prop]); 3546 return filteredProps; 3547} 3548
vendor: 1,911 bytes, lines 3549-3592
3549// ../../node_modules/@react-aria/utils/dist/focusWithoutScrolling.mjs 3550function $7215afc6de606d6b$export$de79e2c695e052f3(element) { 3551 if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({ 3552 preventScroll: !0 3553 }); 3554 else { 3555 let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element); 3556 element.focus(), $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements); 3557 } 3558} 3559var $7215afc6de606d6b$var$supportsPreventScrollCached = null; 3560function $7215afc6de606d6b$var$supportsPreventScroll() { 3561 if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) { 3562 $7215afc6de606d6b$var$supportsPreventScrollCached = !1; 3563 try { 3564 document.createElement("div").focus({ 3565 get preventScroll() { 3566 return $7215afc6de606d6b$var$supportsPreventScrollCached = !0, !0; 3567 } 3568 }); 3569 } catch { 3570 } 3571 } 3572 return $7215afc6de606d6b$var$supportsPreventScrollCached; 3573} 3574function $7215afc6de606d6b$var$getScrollableElements(element) { 3575 let parent = element.parentNode, scrollableElements = [], rootScrollingElement = document.scrollingElement || document.documentElement; 3576 for (; parent instanceof HTMLElement && parent !== rootScrollingElement; ) 3577 (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) && scrollableElements.push({ 3578 element: parent, 3579 scrollTop: parent.scrollTop, 3580 scrollLeft: parent.scrollLeft 3581 }), parent = parent.parentNode; 3582 return rootScrollingElement instanceof HTMLElement && scrollableElements.push({ 3583 element: rootScrollingElement, 3584 scrollTop: rootScrollingElement.scrollTop, 3585 scrollLeft: rootScrollingElement.scrollLeft 3586 }), scrollableElements; 3587} 3588function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) { 3589 for (let { element, scrollTop, scrollLeft } of scrollableElements) 3590 element.scrollTop = scrollTop, element.scrollLeft = scrollLeft; 3591} 3592
vendor: 2,648 bytes, lines 3593-3628
3593// ../../node_modules/@react-aria/utils/dist/platform.mjs 3594function $c87311424ea30a05$var$testUserAgent(re2) { 3595 var _window_navigator_userAgentData; 3596 if (typeof window > "u" || window.navigator == null) return !1; 3597 let brands = (_window_navigator_userAgentData = window.navigator.userAgentData) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands; 3598 return Array.isArray(brands) && brands.some((brand) => re2.test(brand.brand)) || re2.test(window.navigator.userAgent); 3599} 3600function $c87311424ea30a05$var$testPlatform(re2) { 3601 var _window_navigator_userAgentData; 3602 return typeof window < "u" && window.navigator != null ? re2.test(((_window_navigator_userAgentData = window.navigator.userAgentData) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : !1; 3603} 3604function $c87311424ea30a05$var$cached(fn) { 3605 let res = null; 3606 return () => (res == null && (res = fn()), res); 3607} 3608var $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() { 3609 return $c87311424ea30a05$var$testPlatform(/^Mac/i); 3610}), $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() { 3611 return $c87311424ea30a05$var$testPlatform(/^iPhone/i); 3612}), $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() { 3613 return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support. 3614 $c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1; 3615}), $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() { 3616 return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224(); 3617}), $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() { 3618 return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1(); 3619}), $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() { 3620 return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e(); 3621}), $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() { 3622 return $c87311424ea30a05$var$testUserAgent(/Chrome/i); 3623}), $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() { 3624 return $c87311424ea30a05$var$testUserAgent(/Android/i); 3625}), $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() { 3626 return $c87311424ea30a05$var$testUserAgent(/Firefox/i); 3627}); 3628
vendor: 2,441 bytes, lines 3629-3668
3629// ../../node_modules/@react-aria/utils/dist/openLink.mjs 3630init_react(); 3631var $ea8dcbcb9ea1b556$var$RouterContext = createContext({ 3632 isNative: !0, 3633 open: $ea8dcbcb9ea1b556$var$openSyntheticLink, 3634 useHref: (href) => href 3635}); 3636function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers2, setOpening = !0) { 3637 var _window_event_type, _window_event; 3638 let { metaKey, ctrlKey, altKey, shiftKey } = modifiers2; 3639 $c87311424ea30a05$export$b7d78993b74f766d() && (!((_window_event = window.event) === null || _window_event === void 0 || (_window_event_type = _window_event.type) === null || _window_event_type === void 0) && _window_event_type.startsWith("key")) && target.target === "_blank" && ($c87311424ea30a05$export$9ac100e40613ea10() ? metaKey = !0 : ctrlKey = !0); 3640 let event = $c87311424ea30a05$export$78551043582a6a98() && $c87311424ea30a05$export$9ac100e40613ea10() && !$c87311424ea30a05$export$7bef049ce92e4224() ? new KeyboardEvent("keydown", { 3641 keyIdentifier: "Enter", 3642 metaKey, 3643 ctrlKey, 3644 altKey, 3645 shiftKey 3646 }) : new MouseEvent("click", { 3647 metaKey, 3648 ctrlKey, 3649 altKey, 3650 shiftKey, 3651 detail: 1, 3652 bubbles: !0, 3653 cancelable: !0 3654 }); 3655 $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening, $7215afc6de606d6b$export$de79e2c695e052f3(target), target.dispatchEvent(event), $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = !1; 3656} 3657$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = !1; 3658function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) { 3659 if (target instanceof HTMLAnchorElement) open(target); 3660 else if (target.hasAttribute("data-href")) { 3661 let link = document.createElement("a"); 3662 link.href = target.getAttribute("data-href"), target.hasAttribute("data-target") && (link.target = target.getAttribute("data-target")), target.hasAttribute("data-rel") && (link.rel = target.getAttribute("data-rel")), target.hasAttribute("data-download") && (link.download = target.getAttribute("data-download")), target.hasAttribute("data-ping") && (link.ping = target.getAttribute("data-ping")), target.hasAttribute("data-referrer-policy") && (link.referrerPolicy = target.getAttribute("data-referrer-policy")), target.appendChild(link), open(link), target.removeChild(link); 3663 } 3664} 3665function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers2) { 3666 $ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link) => $ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers2)); 3667} 3668
vendor: 2,247 bytes, lines 3669-3702
3669// ../../node_modules/@react-aria/utils/dist/runAfterTransition.mjs 3670var $bbed8b41f857bcc0$var$transitionsByElement = /* @__PURE__ */ new Map(), $bbed8b41f857bcc0$var$transitionCallbacks = /* @__PURE__ */ new Set(); 3671function $bbed8b41f857bcc0$var$setupGlobalEvents() { 3672 if (typeof window > "u") return; 3673 function isTransitionEvent(event) { 3674 return "propertyName" in event; 3675 } 3676 let onTransitionStart = (e2) => { 3677 if (!isTransitionEvent(e2) || !e2.target) return; 3678 let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target); 3679 transitions || (transitions = /* @__PURE__ */ new Set(), $bbed8b41f857bcc0$var$transitionsByElement.set(e2.target, transitions), e2.target.addEventListener("transitioncancel", onTransitionEnd, { 3680 once: !0 3681 })), transitions.add(e2.propertyName); 3682 }, onTransitionEnd = (e2) => { 3683 if (!isTransitionEvent(e2) || !e2.target) return; 3684 let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target); 3685 if (properties && (properties.delete(e2.propertyName), properties.size === 0 && (e2.target.removeEventListener("transitioncancel", onTransitionEnd), $bbed8b41f857bcc0$var$transitionsByElement.delete(e2.target)), $bbed8b41f857bcc0$var$transitionsByElement.size === 0)) { 3686 for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks) cb(); 3687 $bbed8b41f857bcc0$var$transitionCallbacks.clear(); 3688 } 3689 }; 3690 document.body.addEventListener("transitionrun", onTransitionStart), document.body.addEventListener("transitionend", onTransitionEnd); 3691} 3692typeof document < "u" && (document.readyState !== "loading" ? $bbed8b41f857bcc0$var$setupGlobalEvents() : document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents)); 3693function $bbed8b41f857bcc0$var$cleanupDetachedElements() { 3694 for (let [eventTarget] of $bbed8b41f857bcc0$var$transitionsByElement) 3695 "isConnected" in eventTarget && !eventTarget.isConnected && $bbed8b41f857bcc0$var$transitionsByElement.delete(eventTarget); 3696} 3697function $bbed8b41f857bcc0$export$24490316f764c430(fn) { 3698 requestAnimationFrame(() => { 3699 $bbed8b41f857bcc0$var$cleanupDetachedElements(), $bbed8b41f857bcc0$var$transitionsByElement.size === 0 ? fn() : $bbed8b41f857bcc0$var$transitionCallbacks.add(fn); 3700 }); 3701} 3702
vendor: 74 bytes, lines 3703-3705
3703// ../../node_modules/@react-aria/utils/dist/useDrag1D.mjs 3704init_react(); 3705
vendor: 1,403 bytes, lines 3706-3738
3706// ../../node_modules/@react-aria/utils/dist/useGlobalListeners.mjs 3707init_react(); 3708function $03deb23ff14920c4$export$4eaf04e54aa8eed6() { 3709 let globalListeners = useRef(/* @__PURE__ */ new Map()), addGlobalListener = useCallback((eventTarget, type, listener, options2) => { 3710 let fn = options2?.once ? (...args) => { 3711 globalListeners.current.delete(listener), listener(...args); 3712 } : listener; 3713 globalListeners.current.set(listener, { 3714 type, 3715 eventTarget, 3716 fn, 3717 options: options2 3718 }), eventTarget.addEventListener(type, fn, options2); 3719 }, []), removeGlobalListener = useCallback((eventTarget, type, listener, options2) => { 3720 var _globalListeners_current_get; 3721 let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener; 3722 eventTarget.removeEventListener(type, fn, options2), globalListeners.current.delete(listener); 3723 }, []), removeAllGlobalListeners = useCallback(() => { 3724 globalListeners.current.forEach((value, key) => { 3725 removeGlobalListener(value.eventTarget, value.type, key, value.options); 3726 }); 3727 }, [ 3728 removeGlobalListener 3729 ]); 3730 return useEffect(() => removeAllGlobalListeners, [ 3731 removeAllGlobalListeners 3732 ]), { 3733 addGlobalListener, 3734 removeGlobalListener, 3735 removeAllGlobalListeners 3736 }; 3737} 3738
vendor: 869 bytes, lines 3739-3766
3739// ../../node_modules/@react-aria/utils/dist/useObjectRef.mjs 3740init_react(); 3741function $df56164dff5785e2$export$4338b53315abf666(ref) { 3742 let objRef = useRef(null), cleanupRef = useRef(void 0), refEffect = useCallback((instance) => { 3743 if (typeof ref == "function") { 3744 let refCallback = ref, refCleanup = refCallback(instance); 3745 return () => { 3746 typeof refCleanup == "function" ? refCleanup() : refCallback(null); 3747 }; 3748 } else if (ref) 3749 return ref.current = instance, () => { 3750 ref.current = null; 3751 }; 3752 }, [ 3753 ref 3754 ]); 3755 return useMemo(() => ({ 3756 get current() { 3757 return objRef.current; 3758 }, 3759 set current(value) { 3760 objRef.current = value, cleanupRef.current && (cleanupRef.current(), cleanupRef.current = void 0), value != null && (cleanupRef.current = refEffect(value)); 3761 } 3762 }), [ 3763 refEffect 3764 ]); 3765} 3766
vendor: 692 bytes, lines 3767-3781
3767// ../../node_modules/@react-aria/utils/dist/useEffectEvent.mjs 3768init_react(); 3769var $8ae05eaa5c114e9c$var$_React_useInsertionEffect, $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = react_default.useInsertionEffect) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c; 3770function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) { 3771 let ref = useRef(null); 3772 return $8ae05eaa5c114e9c$var$useEarlyEffect(() => { 3773 ref.current = fn; 3774 }, [ 3775 fn 3776 ]), useCallback((...args) => { 3777 let f2 = ref.current; 3778 return f2?.(...args); 3779 }, []); 3780} 3781
vendor: 80 bytes, lines 3782-3784
3782// ../../node_modules/@react-aria/utils/dist/useUpdateEffect.mjs 3783init_react(); 3784
vendor: 86 bytes, lines 3785-3787
3785// ../../node_modules/@react-aria/utils/dist/useUpdateLayoutEffect.mjs 3786init_react(); 3787
vendor: 980 bytes, lines 3788-3816
3788// ../../node_modules/@react-aria/utils/dist/useResizeObserver.mjs 3789init_react(); 3790function $9daab02d461809db$var$hasResizeObserver() { 3791 return typeof window.ResizeObserver < "u"; 3792} 3793function $9daab02d461809db$export$683480f191c0e3ea(options2) { 3794 let { ref, box, onResize } = options2, onResizeEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(onResize); 3795 useEffect(() => { 3796 let element = ref?.current; 3797 if (element) 3798 if ($9daab02d461809db$var$hasResizeObserver()) { 3799 let resizeObserverInstance = new window.ResizeObserver((entries) => { 3800 entries.length && onResizeEvent(); 3801 }); 3802 return resizeObserverInstance.observe(element, { 3803 box 3804 }), () => { 3805 element && resizeObserverInstance.unobserve(element); 3806 }; 3807 } else 3808 return window.addEventListener("resize", onResizeEvent, !1), () => { 3809 window.removeEventListener("resize", onResizeEvent, !1); 3810 }; 3811 }, [ 3812 ref, 3813 box 3814 ]); 3815} 3816
vendor: 345 bytes, lines 3817-3826
3817// ../../node_modules/@react-aria/utils/dist/useSyncRef.mjs 3818function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) { 3819 $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => { 3820 if (context && context.ref && ref) 3821 return context.ref.current = ref.current, () => { 3822 context.ref && (context.ref.current = null); 3823 }; 3824 }); 3825} 3826
vendor: 171 bytes, lines 3827-3830
3827// ../../node_modules/@react-aria/utils/dist/useViewportSize.mjs 3828init_react(); 3829var $5df64b3807dc15ee$var$visualViewport = typeof document < "u" && window.visualViewport; 3830
vendor: 79 bytes, lines 3831-3833
3831// ../../node_modules/@react-aria/utils/dist/useDescription.mjs 3832init_react(); 3833
vendor: 73 bytes, lines 3834-3836
3834// ../../node_modules/@react-aria/utils/dist/useEvent.mjs 3835init_react(); 3836
vendor: 626 bytes, lines 3837-3844
3837// ../../node_modules/@react-aria/utils/dist/isVirtualEvent.mjs 3838function $6a7db85432448f7f$export$60278871457622de(event) { 3839 return event.pointerType === "" && event.isTrusted ? !0 : $c87311424ea30a05$export$a11b0059900ceec8() && event.pointerType ? event.type === "click" && event.buttons === 1 : event.detail === 0 && !event.pointerType; 3840} 3841function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) { 3842 return !$c87311424ea30a05$export$a11b0059900ceec8() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse"; 3843} 3844
vendor: 76 bytes, lines 3845-3847
3845// ../../node_modules/@react-aria/utils/dist/useDeepMemo.mjs 3846init_react(); 3847
vendor: 77 bytes, lines 3848-3850
3848// ../../node_modules/@react-aria/utils/dist/useFormReset.mjs 3849init_react(); 3850
vendor: 76 bytes, lines 3851-3853
3851// ../../node_modules/@react-aria/utils/dist/useLoadMore.mjs 3852init_react(); 3853
vendor: 84 bytes, lines 3854-3856
3854// ../../node_modules/@react-aria/utils/dist/useLoadMoreSentinel.mjs 3855init_react(); 3856
vendor: 482 bytes, lines 3857-3862
3857// ../../node_modules/@react-aria/utils/dist/inertValue.mjs 3858init_react(); 3859 3860// global-externals:react-dom 3861var react_dom_default = __REACT_DOM__, { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED2, createPortal, createRoot: createRoot2, findDOMNode, flushSync, hydrate, hydrateRoot: hydrateRoot2, render, unmountComponentAtNode, unstable_batchedUpdates, unstable_renderSubtreeIntoContainer, version: version2 } = __REACT_DOM__; 3862
vendor: 1,858 bytes, lines 3863-3919
3863// ../../node_modules/@react-aria/utils/dist/animation.mjs 3864init_react(); 3865function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = !0) { 3866 let [isEntering, setEntering] = useState(!0), isAnimationReady = isEntering && isReady; 3867 return $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => { 3868 if (isAnimationReady && ref.current && "getAnimations" in ref.current) 3869 for (let animation of ref.current.getAnimations()) animation instanceof CSSTransition && animation.cancel(); 3870 }, [ 3871 ref, 3872 isAnimationReady 3873 ]), $d3f049242431219c$var$useAnimation(ref, isAnimationReady, useCallback(() => setEntering(!1), [])), isAnimationReady; 3874} 3875function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) { 3876 let [exitState, setExitState] = useState(isOpen ? "open" : "closed"); 3877 switch (exitState) { 3878 case "open": 3879 isOpen || setExitState("exiting"); 3880 break; 3881 case "closed": 3882 case "exiting": 3883 isOpen && setExitState("open"); 3884 break; 3885 } 3886 let isExiting = exitState === "exiting"; 3887 return $d3f049242431219c$var$useAnimation(ref, isExiting, useCallback(() => { 3888 setExitState((state) => state === "exiting" ? "closed" : state); 3889 }, [])), isExiting; 3890} 3891function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) { 3892 $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => { 3893 if (isActive && ref.current) { 3894 if (!("getAnimations" in ref.current)) { 3895 onEnd(); 3896 return; 3897 } 3898 let animations = ref.current.getAnimations(); 3899 if (animations.length === 0) { 3900 onEnd(); 3901 return; 3902 } 3903 let canceled = !1; 3904 return Promise.all(animations.map((a2) => a2.finished)).then(() => { 3905 canceled || flushSync(() => { 3906 onEnd(); 3907 }); 3908 }).catch(() => { 3909 }), () => { 3910 canceled = !0; 3911 }; 3912 } 3913 }, [ 3914 ref, 3915 isActive, 3916 onEnd 3917 ]); 3918} 3919
vendor: 1,751 bytes, lines 3920-3941
3920// ../../node_modules/@react-aria/utils/dist/isElementVisible.mjs 3921var $7d2416ea0959daaa$var$supportsCheckVisibility = typeof Element < "u" && "checkVisibility" in Element.prototype; 3922function $7d2416ea0959daaa$var$isStyleVisible(element) { 3923 let windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element); 3924 if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return !1; 3925 let { display, visibility } = element.style, isVisible = display !== "none" && visibility !== "hidden" && visibility !== "collapse"; 3926 if (isVisible) { 3927 let { getComputedStyle: getComputedStyle2 } = element.ownerDocument.defaultView, { display: computedDisplay, visibility: computedVisibility } = getComputedStyle2(element); 3928 isVisible = computedDisplay !== "none" && computedVisibility !== "hidden" && computedVisibility !== "collapse"; 3929 } 3930 return isVisible; 3931} 3932function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) { 3933 return !element.hasAttribute("hidden") && // Ignore HiddenSelect when tree walking. 3934 !element.hasAttribute("data-react-aria-prevent-focus") && (element.nodeName === "DETAILS" && childElement && childElement.nodeName !== "SUMMARY" ? element.hasAttribute("open") : !0); 3935} 3936function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) { 3937 return $7d2416ea0959daaa$var$supportsCheckVisibility ? element.checkVisibility({ 3938 visibilityProperty: !0 3939 }) && !element.closest("[data-react-aria-prevent-focus]") : element.nodeName !== "#comment" && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element)); 3940} 3941
vendor: 1,312 bytes, lines 3942-3972
3942// ../../node_modules/@react-aria/utils/dist/isFocusable.mjs 3943var $b4b717babfbb907b$var$focusableElements = [ 3944 "input:not([disabled]):not([type=hidden])", 3945 "select:not([disabled])", 3946 "textarea:not([disabled])", 3947 "button:not([disabled])", 3948 "a[href]", 3949 "area[href]", 3950 "summary", 3951 "iframe", 3952 "object", 3953 "embed", 3954 "audio[controls]", 3955 "video[controls]", 3956 '[contenteditable]:not([contenteditable^="false"])', 3957 "permission" 3958], $b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])"; 3959$b4b717babfbb907b$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])'); 3960var $b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),'); 3961function $b4b717babfbb907b$export$4c063cf1350e6fed(element) { 3962 return element.matches($b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR) && $7d2416ea0959daaa$export$e989c0fffaa6b27a(element) && !$b4b717babfbb907b$var$isInert(element); 3963} 3964function $b4b717babfbb907b$var$isInert(element) { 3965 let node = element; 3966 for (; node != null; ) { 3967 if (node instanceof node.ownerDocument.defaultView.HTMLElement && node.inert) return !0; 3968 node = node.parentElement; 3969 } 3970 return !1; 3971} 3972
vendor: 1,407 bytes, lines 3973-4000
3973// ../../node_modules/@react-stately/utils/dist/useControlledState.mjs 3974init_react(); 3975var $458b0a5536c1a7cf$var$_React_useInsertionEffect, $458b0a5536c1a7cf$var$useEarlyEffect = typeof document < "u" ? ($458b0a5536c1a7cf$var$_React_useInsertionEffect = react_default.useInsertionEffect) !== null && $458b0a5536c1a7cf$var$_React_useInsertionEffect !== void 0 ? $458b0a5536c1a7cf$var$_React_useInsertionEffect : react_default.useLayoutEffect : () => { 3976}; 3977function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) { 3978 let [stateValue, setStateValue] = useState(value || defaultValue), valueRef = useRef(stateValue), isControlledRef = useRef(value !== void 0), isControlled = value !== void 0; 3979 useEffect(() => { 3980 let wasControlled = isControlledRef.current; 3981 isControlledRef.current = isControlled; 3982 }, [ 3983 isControlled 3984 ]); 3985 let currentValue = isControlled ? value : stateValue; 3986 $458b0a5536c1a7cf$var$useEarlyEffect(() => { 3987 valueRef.current = currentValue; 3988 }); 3989 let [, forceUpdate] = useReducer(() => ({}), {}), setValue = useCallback((value2, ...args) => { 3990 let newValue = typeof value2 == "function" ? value2(valueRef.current) : value2; 3991 Object.is(valueRef.current, newValue) || (valueRef.current = newValue, setStateValue(newValue), forceUpdate(), onChange?.(newValue, ...args)); 3992 }, [ 3993 onChange 3994 ]); 3995 return [ 3996 currentValue, 3997 setValue 3998 ]; 3999} 4000
vendor: 195 bytes, lines 4001-4005
4001// ../../node_modules/@react-stately/utils/dist/number.mjs 4002function $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, min = -1 / 0, max = 1 / 0) { 4003 return Math.min(Math.max(value, min), max); 4004} 4005
vendor: 11,458 bytes, lines 4006-4265
4006// ../../node_modules/@react-aria/landmark/dist/useLandmark.mjs 4007init_react(); 4008var import_shim = __toESM(require_shim(), 1), $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION = 1, $a86207c5d7f7e1fb$var$landmarkSymbol = /* @__PURE__ */ Symbol.for("react-aria-landmark-manager"); 4009function $a86207c5d7f7e1fb$var$subscribe(fn) { 4010 return document.addEventListener("react-aria-landmark-manager-change", fn), () => document.removeEventListener("react-aria-landmark-manager-change", fn); 4011} 4012function $a86207c5d7f7e1fb$var$getLandmarkManager() { 4013 if (typeof document > "u") return null; 4014 let instance = document[$a86207c5d7f7e1fb$var$landmarkSymbol]; 4015 return instance && instance.version >= $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION ? instance : (document[$a86207c5d7f7e1fb$var$landmarkSymbol] = new $a86207c5d7f7e1fb$var$LandmarkManager(), document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change")), document[$a86207c5d7f7e1fb$var$landmarkSymbol]); 4016} 4017function $a86207c5d7f7e1fb$var$useLandmarkManager() { 4018 return (0, import_shim.useSyncExternalStore)($a86207c5d7f7e1fb$var$subscribe, $a86207c5d7f7e1fb$var$getLandmarkManager, $a86207c5d7f7e1fb$var$getLandmarkManager); 4019} 4020var $a86207c5d7f7e1fb$var$LandmarkManager = class { 4021 setupIfNeeded() { 4022 this.isListening || (document.addEventListener("keydown", this.f6Handler, { 4023 capture: !0 4024 }), document.addEventListener("focusin", this.focusinHandler, { 4025 capture: !0 4026 }), document.addEventListener("focusout", this.focusoutHandler, { 4027 capture: !0 4028 }), this.isListening = !0); 4029 } 4030 teardownIfNeeded() { 4031 !this.isListening || this.landmarks.length > 0 || this.refCount > 0 || (document.removeEventListener("keydown", this.f6Handler, { 4032 capture: !0 4033 }), document.removeEventListener("focusin", this.focusinHandler, { 4034 capture: !0 4035 }), document.removeEventListener("focusout", this.focusoutHandler, { 4036 capture: !0 4037 }), this.isListening = !1); 4038 } 4039 focusLandmark(landmark, direction) { 4040 var _this_landmarks_find_focus, _this_landmarks_find; 4041 (_this_landmarks_find = this.landmarks.find((l3) => l3.ref.current === landmark)) === null || _this_landmarks_find === void 0 || (_this_landmarks_find_focus = _this_landmarks_find.focus) === null || _this_landmarks_find_focus === void 0 || _this_landmarks_find_focus.call(_this_landmarks_find, direction); 4042 } 4043 /** 4044 * Return set of landmarks with a specific role. 4045 */ 4046 getLandmarksByRole(role) { 4047 return new Set(this.landmarks.filter((l3) => l3.role === role)); 4048 } 4049 /** 4050 * Return first landmark with a specific role. 4051 */ 4052 getLandmarkByRole(role) { 4053 return this.landmarks.find((l3) => l3.role === role); 4054 } 4055 addLandmark(newLandmark) { 4056 if (this.setupIfNeeded(), this.landmarks.find((landmark) => landmark.ref === newLandmark.ref) || !newLandmark.ref.current) return; 4057 if (this.landmarks.filter((landmark) => landmark.role === "main").length > 1, this.landmarks.length === 0) { 4058 this.landmarks = [ 4059 newLandmark 4060 ], this.checkLabels(newLandmark.role); 4061 return; 4062 } 4063 let start = 0, end = this.landmarks.length - 1; 4064 for (; start <= end; ) { 4065 let mid = Math.floor((start + end) / 2), comparedPosition = newLandmark.ref.current.compareDocumentPosition(this.landmarks[mid].ref.current); 4066 !!(comparedPosition & Node.DOCUMENT_POSITION_PRECEDING || comparedPosition & Node.DOCUMENT_POSITION_CONTAINS) ? start = mid + 1 : end = mid - 1; 4067 } 4068 this.landmarks.splice(start, 0, newLandmark), this.checkLabels(newLandmark.role); 4069 } 4070 updateLandmark(landmark) { 4071 let index = this.landmarks.findIndex((l3) => l3.ref === landmark.ref); 4072 index >= 0 && (this.landmarks[index] = { 4073 ...this.landmarks[index], 4074 ...landmark 4075 }, this.checkLabels(this.landmarks[index].role)); 4076 } 4077 removeLandmark(ref) { 4078 this.landmarks = this.landmarks.filter((landmark) => landmark.ref !== ref), this.teardownIfNeeded(); 4079 } 4080 /** 4081 * Warn if there are 2+ landmarks with the same role but no label. 4082 * Labels for landmarks with the same role must also be unique. 4083 * 4084 * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/. 4085 */ 4086 checkLabels(role) { 4087 let landmarksWithRole = this.getLandmarksByRole(role); 4088 landmarksWithRole.size > 1 && [ 4089 ...landmarksWithRole 4090 ].filter((landmark) => !landmark.label).length > 0; 4091 } 4092 /** 4093 * Get the landmark that is the closest parent in the DOM. 4094 * Returns undefined if no parent is a landmark. 4095 */ 4096 closestLandmark(element) { 4097 let landmarkMap = new Map(this.landmarks.map((l3) => [ 4098 l3.ref.current, 4099 l3 4100 ])), currentElement = element; 4101 for (; currentElement && !landmarkMap.has(currentElement) && currentElement !== document.body && currentElement.parentElement; ) currentElement = currentElement.parentElement; 4102 return landmarkMap.get(currentElement); 4103 } 4104 /** 4105 * Gets the next landmark, in DOM focus order, or previous if backwards is specified. 4106 * If last landmark, next should be the first landmark. 4107 * If not inside a landmark, will return first landmark. 4108 * Returns undefined if there are no landmarks. 4109 */ 4110 getNextLandmark(element, { backward }) { 4111 var _this_landmarks_nextLandmarkIndex_ref_current; 4112 let currentLandmark = this.closestLandmark(element), nextLandmarkIndex = backward ? this.landmarks.length - 1 : 0; 4113 currentLandmark && (nextLandmarkIndex = this.landmarks.indexOf(currentLandmark) + (backward ? -1 : 1)); 4114 let wrapIfNeeded = () => { 4115 if (nextLandmarkIndex < 0) { 4116 if (!element.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", { 4117 detail: { 4118 direction: "backward" 4119 }, 4120 bubbles: !0, 4121 cancelable: !0 4122 }))) return !0; 4123 nextLandmarkIndex = this.landmarks.length - 1; 4124 } else if (nextLandmarkIndex >= this.landmarks.length) { 4125 if (!element.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", { 4126 detail: { 4127 direction: "forward" 4128 }, 4129 bubbles: !0, 4130 cancelable: !0 4131 }))) return !0; 4132 nextLandmarkIndex = 0; 4133 } 4134 return nextLandmarkIndex < 0 || nextLandmarkIndex >= this.landmarks.length; 4135 }; 4136 if (wrapIfNeeded()) return; 4137 let i2 = nextLandmarkIndex; 4138 for (; !((_this_landmarks_nextLandmarkIndex_ref_current = this.landmarks[nextLandmarkIndex].ref.current) === null || _this_landmarks_nextLandmarkIndex_ref_current === void 0) && _this_landmarks_nextLandmarkIndex_ref_current.closest("[aria-hidden=true]"); ) { 4139 if (nextLandmarkIndex += backward ? -1 : 1, wrapIfNeeded()) return; 4140 if (nextLandmarkIndex === i2) break; 4141 } 4142 return this.landmarks[nextLandmarkIndex]; 4143 } 4144 /** 4145 * Look at next landmark. If an element was previously focused inside, restore focus there. 4146 * If not, focus the landmark itself. 4147 * If no landmarks at all, or none with focusable elements, don't move focus. 4148 */ 4149 f6Handler(e2) { 4150 e2.key === "F6" && (e2.altKey ? this.focusMain() : this.navigate(e2.target, e2.shiftKey)) && (e2.preventDefault(), e2.stopPropagation()); 4151 } 4152 focusMain() { 4153 let main = this.getLandmarkByRole("main"); 4154 return main && main.ref.current && document.contains(main.ref.current) ? (this.focusLandmark(main.ref.current, "forward"), !0) : !1; 4155 } 4156 navigate(from, backward) { 4157 let nextLandmark = this.getNextLandmark(from, { 4158 backward 4159 }); 4160 if (!nextLandmark) return !1; 4161 if (nextLandmark.lastFocused) { 4162 let lastFocused = nextLandmark.lastFocused; 4163 if (document.body.contains(lastFocused)) 4164 return lastFocused.focus(), !0; 4165 } 4166 return nextLandmark.ref.current && document.contains(nextLandmark.ref.current) ? (this.focusLandmark(nextLandmark.ref.current, backward ? "backward" : "forward"), !0) : !1; 4167 } 4168 /** 4169 * Sets lastFocused for a landmark, if focus is moved within that landmark. 4170 * Lets the last focused landmark know it was blurred if something else is focused. 4171 */ 4172 focusinHandler(e2) { 4173 let currentLandmark = this.closestLandmark(e2.target); 4174 currentLandmark && currentLandmark.ref.current !== e2.target && this.updateLandmark({ 4175 ref: currentLandmark.ref, 4176 lastFocused: e2.target 4177 }); 4178 let previousFocusedElement = e2.relatedTarget; 4179 if (previousFocusedElement) { 4180 let closestPreviousLandmark = this.closestLandmark(previousFocusedElement); 4181 closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement && closestPreviousLandmark.blur(); 4182 } 4183 } 4184 /** 4185 * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus. 4186 */ 4187 focusoutHandler(e2) { 4188 let previousFocusedElement = e2.target, nextFocusedElement = e2.relatedTarget; 4189 if (!nextFocusedElement || nextFocusedElement === document) { 4190 let closestPreviousLandmark = this.closestLandmark(previousFocusedElement); 4191 closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement && closestPreviousLandmark.blur(); 4192 } 4193 } 4194 createLandmarkController() { 4195 let instance = this; 4196 return instance.refCount++, instance.setupIfNeeded(), { 4197 navigate(direction, opts) { 4198 let element = opts?.from || document.activeElement; 4199 return instance.navigate(element, direction === "backward"); 4200 }, 4201 focusNext(opts) { 4202 let element = opts?.from || document.activeElement; 4203 return instance.navigate(element, !1); 4204 }, 4205 focusPrevious(opts) { 4206 let element = opts?.from || document.activeElement; 4207 return instance.navigate(element, !0); 4208 }, 4209 focusMain() { 4210 return instance.focusMain(); 4211 }, 4212 dispose() { 4213 instance && (instance.refCount--, instance.teardownIfNeeded(), instance = null); 4214 } 4215 }; 4216 } 4217 registerLandmark(landmark) { 4218 return this.landmarks.find((l3) => l3.ref === landmark.ref) ? this.updateLandmark(landmark) : this.addLandmark(landmark), () => this.removeLandmark(landmark.ref); 4219 } 4220 constructor() { 4221 this.landmarks = [], this.isListening = !1, this.refCount = 0, this.version = $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION, this.f6Handler = this.f6Handler.bind(this), this.focusinHandler = this.focusinHandler.bind(this), this.focusoutHandler = this.focusoutHandler.bind(this); 4222 } 4223}; 4224function $a86207c5d7f7e1fb$export$4cc632584fd87fae(props, ref) { 4225 let { role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, focus } = props, manager = $a86207c5d7f7e1fb$var$useLandmarkManager(), label = ariaLabel || ariaLabelledby, [isLandmarkFocused, setIsLandmarkFocused] = useState(!1), defaultFocus = useCallback(() => { 4226 setIsLandmarkFocused(!0); 4227 }, [ 4228 setIsLandmarkFocused 4229 ]), blur = useCallback(() => { 4230 setIsLandmarkFocused(!1); 4231 }, [ 4232 setIsLandmarkFocused 4233 ]); 4234 return $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => { 4235 if (manager) return manager.registerLandmark({ 4236 ref, 4237 label, 4238 role, 4239 focus: focus || defaultFocus, 4240 blur 4241 }); 4242 }, [ 4243 manager, 4244 label, 4245 ref, 4246 role, 4247 focus, 4248 defaultFocus, 4249 blur 4250 ]), useEffect(() => { 4251 var _ref_current; 4252 isLandmarkFocused && ((_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus()); 4253 }, [ 4254 isLandmarkFocused, 4255 ref 4256 ]), { 4257 landmarkProps: { 4258 role, 4259 tabIndex: isLandmarkFocused ? -1 : void 0, 4260 "aria-label": ariaLabel, 4261 "aria-labelledby": ariaLabelledby 4262 } 4263 }; 4264} 4265
vendor: 773 bytes, lines 4266-4303
4266// src/manager/hooks/useLandmark.ts 4267function useLandmark(props, ref) { 4268 let { landmarkProps } = $a86207c5d7f7e1fb$export$4cc632584fd87fae(props, ref); 4269 return { 4270 landmarkProps: { 4271 ...landmarkProps, 4272 "data-sb-landmark": !0 4273 } 4274 }; 4275} 4276 4277// src/manager/components/mobile/navigation/MobileAddonsDrawer.tsx 4278init_react(); 4279var MobileAddonsDrawer = ({ 4280 children, 4281 id, 4282 isOpen, 4283 onOpenChange 4284}) => react_default.createElement( 4285 Modal, 4286 { 4287 ariaLabel: "Addon panel", 4288 transitionDuration: 300, 4289 variant: "bottom-drawer", 4290 height: "42vh", 4291 id, 4292 open: isOpen, 4293 onOpenChange 4294 }, 4295 children 4296); 4297 4298// src/manager/components/mobile/navigation/MobileMenuDrawer.tsx 4299init_react(); 4300 4301// src/manager/components/mobile/about/MobileAbout.tsx 4302init_react(); 4303
vendor: 98 bytes, lines 4304-4306
4304// ../../node_modules/react-transition-state/dist/esm/hooks/useTransitionState.mjs 4305init_react(); 4306
vendor: 781 bytes, lines 4307-4326
4307// ../../node_modules/react-transition-state/dist/esm/hooks/utils.mjs 4308var STATUS = ["preEnter", "entering", "entered", "preExit", "exiting", "exited", "unmounted"], getState = (status) => ({ 4309 _s: status, 4310 status: STATUS[status], 4311 isEnter: status < 3, 4312 isMounted: status !== 6, 4313 isResolved: status === 2 || status > 4 4314}), startOrEnd = (unmounted) => unmounted ? 6 : 5, getEndStatus = (status, unmountOnExit) => { 4315 switch (status) { 4316 case 1: 4317 case 0: 4318 return 2; 4319 case 4: 4320 case 3: 4321 return startOrEnd(unmountOnExit); 4322 } 4323}, getTimeout = (timeout) => typeof timeout == "object" ? [timeout.enter, timeout.exit] : [timeout, timeout], nextTick = (transitState, status) => setTimeout(() => { 4324 isNaN(document.body.offsetTop) || transitState(status + 1); 4325}, 0); 4326
vendor: 1,863 bytes, lines 4327-4367
4327// ../../node_modules/react-transition-state/dist/esm/hooks/useTransitionState.mjs 4328var updateState = (status, setState, latestState, timeoutId, onChange) => { 4329 clearTimeout(timeoutId.current); 4330 let state = getState(status); 4331 setState(state), latestState.current = state, onChange && onChange({ 4332 current: state 4333 }); 4334}, useTransitionState = ({ 4335 enter = !0, 4336 exit = !0, 4337 preEnter, 4338 preExit, 4339 timeout, 4340 initialEntered, 4341 mountOnEnter, 4342 unmountOnExit, 4343 onStateChange: onChange 4344} = {}) => { 4345 let [state, setState] = useState(() => getState(initialEntered ? 2 : startOrEnd(mountOnEnter))), latestState = useRef(state), timeoutId = useRef(), [enterTimeout, exitTimeout] = getTimeout(timeout), endTransition = useCallback(() => { 4346 let status = getEndStatus(latestState.current._s, unmountOnExit); 4347 status && updateState(status, setState, latestState, timeoutId, onChange); 4348 }, [onChange, unmountOnExit]), toggle = useCallback((toEnter) => { 4349 let transitState = (status) => { 4350 switch (updateState(status, setState, latestState, timeoutId, onChange), status) { 4351 case 1: 4352 enterTimeout >= 0 && (timeoutId.current = setTimeout(endTransition, enterTimeout)); 4353 break; 4354 case 4: 4355 exitTimeout >= 0 && (timeoutId.current = setTimeout(endTransition, exitTimeout)); 4356 break; 4357 case 0: 4358 case 3: 4359 timeoutId.current = nextTick(transitState, status); 4360 break; 4361 } 4362 }, enterStage = latestState.current.isEnter; 4363 typeof toEnter != "boolean" && (toEnter = !enterStage), toEnter ? !enterStage && transitState(enter ? preEnter ? 0 : 1 : 2) : enterStage && transitState(exit ? preExit ? 3 : 4 : startOrEnd(unmountOnExit)); 4364 }, [endTransition, onChange, enter, exit, preEnter, preExit, enterTimeout, exitTimeout, unmountOnExit]); 4365 return [state, toggle, endTransition]; 4366}; 4367
vendor: 3,209 bytes, lines 4368-4437
4368// ../../node_modules/react-transition-state/dist/esm/hooks/useTransitionMap.mjs 4369init_react(); 4370var updateState2 = (key, status, setStateMap, latestStateMap, timeoutId, onChange) => { 4371 clearTimeout(timeoutId); 4372 let state = getState(status), stateMap = new Map(latestStateMap.current); 4373 stateMap.set(key, state), setStateMap(stateMap), latestStateMap.current = stateMap, onChange && onChange({ 4374 key, 4375 current: state 4376 }); 4377}, useTransitionMap = ({ 4378 allowMultiple, 4379 enter = !0, 4380 exit = !0, 4381 preEnter, 4382 preExit, 4383 timeout, 4384 initialEntered, 4385 mountOnEnter, 4386 unmountOnExit, 4387 onStateChange: onChange 4388} = {}) => { 4389 let [stateMap, setStateMap] = useState(/* @__PURE__ */ new Map()), latestStateMap = useRef(stateMap), configMap = useRef(/* @__PURE__ */ new Map()), [enterTimeout, exitTimeout] = getTimeout(timeout), setItem = useCallback((key, config) => { 4390 let { 4391 initialEntered: _initialEntered = initialEntered 4392 } = config || {}, status = _initialEntered ? 2 : startOrEnd(mountOnEnter); 4393 updateState2(key, status, setStateMap, latestStateMap), configMap.current.set(key, {}); 4394 }, [initialEntered, mountOnEnter]), deleteItem = useCallback((key) => { 4395 let newStateMap = new Map(latestStateMap.current); 4396 return newStateMap.delete(key) ? (setStateMap(newStateMap), latestStateMap.current = newStateMap, configMap.current.delete(key), !0) : !1; 4397 }, []), endTransition = useCallback((key) => { 4398 let stateObj = latestStateMap.current.get(key); 4399 if (!stateObj) 4400 return; 4401 let { 4402 timeoutId 4403 } = configMap.current.get(key), status = getEndStatus(stateObj._s, unmountOnExit); 4404 status && updateState2(key, status, setStateMap, latestStateMap, timeoutId, onChange); 4405 }, [onChange, unmountOnExit]), toggle = useCallback((key, toEnter) => { 4406 let stateObj = latestStateMap.current.get(key); 4407 if (!stateObj) 4408 return; 4409 let config = configMap.current.get(key), transitState = (status) => { 4410 switch (updateState2(key, status, setStateMap, latestStateMap, config.timeoutId, onChange), status) { 4411 case 1: 4412 enterTimeout >= 0 && (config.timeoutId = setTimeout(() => endTransition(key), enterTimeout)); 4413 break; 4414 case 4: 4415 exitTimeout >= 0 && (config.timeoutId = setTimeout(() => endTransition(key), exitTimeout)); 4416 break; 4417 case 0: 4418 case 3: 4419 config.timeoutId = nextTick(transitState, status); 4420 break; 4421 } 4422 }, enterStage = stateObj.isEnter; 4423 typeof toEnter != "boolean" && (toEnter = !enterStage), toEnter ? enterStage || (transitState(enter ? preEnter ? 0 : 1 : 2), !allowMultiple && latestStateMap.current.forEach((_2, _key) => _key !== key && toggle(_key, !1))) : enterStage && transitState(exit ? preExit ? 3 : 4 : startOrEnd(unmountOnExit)); 4424 }, [onChange, endTransition, allowMultiple, enter, exit, preEnter, preExit, enterTimeout, exitTimeout, unmountOnExit]), toggleAll = useCallback((toEnter) => { 4425 if (!(!allowMultiple && toEnter !== !1)) 4426 for (let key of latestStateMap.current.keys()) toggle(key, toEnter); 4427 }, [allowMultiple, toggle]); 4428 return { 4429 stateMap, 4430 toggle, 4431 toggleAll, 4432 endTransition, 4433 setItem, 4434 deleteItem 4435 }; 4436}; 4437
vendor: 6,192 bytes, lines 4438-4601
4438// src/manager/components/upgrade/UpgradeBlock.tsx 4439init_react(); 4440var UpgradeBlock = ({ onNavigateToWhatsNew }) => { 4441 let api = useStorybookApi(), [activeTab, setActiveTab] = useState("npm"); 4442 return react_default.createElement(Container2, null, react_default.createElement("strong", null, "You are on Storybook ", api.getCurrentVersion().version), react_default.createElement("p", null, "Run the following script to check for updates and upgrade to the latest version."), react_default.createElement(Tabs2, null, react_default.createElement(ButtonTab, { active: activeTab === "npm", onClick: () => setActiveTab("npm") }, "npm"), react_default.createElement(ButtonTab, { active: activeTab === "yarn", onClick: () => setActiveTab("yarn") }, "yarn"), react_default.createElement(ButtonTab, { active: activeTab === "pnpm", onClick: () => setActiveTab("pnpm") }, "pnpm")), react_default.createElement(Code2, null, activeTab === "npm" ? "npx storybook@latest upgrade" : `${activeTab} dlx storybook@latest upgrade`), onNavigateToWhatsNew && react_default.createElement(Link, { onClick: onNavigateToWhatsNew }, "See what's new in Storybook")); 4443}, Container2 = styled.div(({ theme }) => ({ 4444 border: "1px solid", 4445 borderRadius: 5, 4446 padding: 20, 4447 marginTop: 0, 4448 borderColor: theme.appBorderColor, 4449 fontSize: theme.typography.size.s2, 4450 width: "100%", 4451 [MEDIA_DESKTOP_BREAKPOINT]: { 4452 maxWidth: 400 4453 } 4454})), Tabs2 = styled.div({ 4455 display: "flex", 4456 gap: 2 4457}), Code2 = styled.pre(({ theme }) => ({ 4458 background: theme.base === "light" ? "rgba(0, 0, 0, 0.05)" : theme.appBorderColor, 4459 fontSize: theme.typography.size.s2 - 1, 4460 margin: "4px 0 16px" 4461})), ButtonTab = styled.button(({ theme, active }) => ({ 4462 all: "unset", 4463 alignItems: "center", 4464 gap: 10, 4465 color: theme.color.defaultText, 4466 fontSize: theme.typography.size.s2 - 1, 4467 borderBottom: "2px solid transparent", 4468 borderBottomColor: active ? theme.color.secondary : "none", 4469 padding: "0 10px 5px", 4470 marginBottom: "5px", 4471 cursor: "pointer" 4472})); 4473 4474// src/manager/components/mobile/about/MobileAbout.tsx 4475var MobileAbout = () => { 4476 let { isMobileAboutOpen, setMobileAboutOpen } = useLayout(), aboutRef = useRef(null), [state, toggle] = useTransitionState({ 4477 timeout: 300, 4478 mountOnEnter: !0, 4479 unmountOnExit: !0 4480 }); 4481 return useEffect(() => { 4482 toggle(isMobileAboutOpen); 4483 }, [isMobileAboutOpen, toggle]), state.isMounted ? react_default.createElement( 4484 Container3, 4485 { 4486 ref: aboutRef, 4487 $status: state.status, 4488 $transitionDuration: 300 4489 }, 4490 react_default.createElement(ScrollArea, { vertical: !0, offset: 3, scrollbarSize: 6 }, react_default.createElement(InnerArea, null, react_default.createElement( 4491 CloseButton, 4492 { 4493 onClick: () => setMobileAboutOpen(!1), 4494 ariaLabel: "Close about section", 4495 tooltip: "Close about section", 4496 variant: "ghost" 4497 }, 4498 react_default.createElement(ArrowLeftIcon, null), 4499 "Back" 4500 ), react_default.createElement(LinkContainer, null, react_default.createElement( 4501 LinkLine, 4502 { 4503 href: "https://github.com/storybookjs/storybook", 4504 target: "_blank", 4505 rel: "noopener noreferrer" 4506 }, 4507 react_default.createElement(LinkLeft, null, react_default.createElement(GithubIcon, null), react_default.createElement("span", null, "Github")), 4508 react_default.createElement(ShareAltIcon, { width: 12 }) 4509 ), react_default.createElement( 4510 LinkLine, 4511 { 4512 href: "https://storybook.js.org/docs/get-started/install?ref=ui", 4513 target: "_blank", 4514 rel: "noopener noreferrer" 4515 }, 4516 react_default.createElement(LinkLeft, null, react_default.createElement(StorybookIcon, null), react_default.createElement("span", null, "Documentation")), 4517 react_default.createElement(ShareAltIcon, { width: 12 }) 4518 )), react_default.createElement(UpgradeBlock, null), react_default.createElement(BottomText, null, "Open source software maintained by", " ", react_default.createElement(Link, { href: "https://chromatic.com", target: "_blank", rel: "noopener noreferrer" }, "Chromatic"), " ", "and the", " ", react_default.createElement( 4519 Link, 4520 { 4521 href: "https://github.com/storybookjs/storybook/graphs/contributors", 4522 rel: "noopener noreferrer" 4523 }, 4524 "Storybook Community" 4525 )))) 4526 ) : null; 4527}, slideFromRight = keyframes({ 4528 from: { 4529 opacity: 0, 4530 transform: "translate(20px, 0)" 4531 }, 4532 to: { 4533 opacity: 1, 4534 transform: "translate(0, 0)" 4535 } 4536}), slideToRight = keyframes({ 4537 from: { 4538 opacity: 1, 4539 transform: "translate(0, 0)" 4540 }, 4541 to: { 4542 opacity: 0, 4543 transform: "translate(20px, 0)" 4544 } 4545}), Container3 = styled.div( 4546 ({ theme, $status, $transitionDuration }) => ({ 4547 position: "absolute", 4548 width: "100%", 4549 height: "100%", 4550 borderRadius: "10px 10px 0 0", 4551 top: 0, 4552 left: 0, 4553 zIndex: 11, 4554 overflow: "auto", 4555 color: theme.color.defaultText, 4556 background: theme.background.content, 4557 animation: $status === "exiting" ? `${slideToRight} ${$transitionDuration}ms` : `${slideFromRight} ${$transitionDuration}ms` 4558 }) 4559), InnerArea = styled.div({ 4560 display: "flex", 4561 flexDirection: "column", 4562 gap: 20, 4563 padding: "25px 12px 20px" 4564}), LinkContainer = styled.div({}), LinkLine = styled.a(({ theme }) => ({ 4565 all: "unset", 4566 display: "flex", 4567 alignItems: "center", 4568 justifyContent: "space-between", 4569 fontSize: theme.typography.size.s2 - 1, 4570 borderBottom: `1px solid ${theme.appBorderColor}`, 4571 cursor: "pointer", 4572 padding: "0 10px", 4573 "&:last-child": { 4574 borderBottom: "none" 4575 } 4576})), LinkLeft = styled.div(({ theme }) => ({ 4577 display: "flex", 4578 alignItems: "center", 4579 fontSize: theme.typography.size.s2 - 1, 4580 height: 40, 4581 gap: 5 4582})), BottomText = styled.div(({ theme }) => ({ 4583 fontSize: theme.typography.size.s2 - 1, 4584 marginTop: 30 4585})), CloseButton = styled(Button)({ 4586 alignSelf: "start" 4587}); 4588 4589// src/manager/components/mobile/navigation/MobileMenuDrawer.tsx 4590var MobileMenuDrawer = ({ 4591 children, 4592 id, 4593 isOpen, 4594 onOpenChange 4595}) => react_default.createElement( 4596 Modal, 4597 { 4598 ariaLabel: "Menu", 4599 transitionDuration: 300, 4600 variant: "bottom-drawer", 4601 height: "80
4601vh", 4602 id, 4603 open: isOpen, 4604 onOpenChange 4605 }, 4606 children, 4607 react_default.createElement(MobileAbout, null) 4608); 4609
vendor: 3,548 bytes, lines 4610-4700
4610// src/manager/components/mobile/navigation/MobileNavigation.tsx 4611function combineIndexes(rootIndex, refs) { 4612 let combinedIndex = { ...rootIndex || {} }; 4613 return Object.values(refs).forEach((ref) => { 4614 ref.index && Object.assign(combinedIndex, ref.index); 4615 }), combinedIndex; 4616} 4617var useFullStoryName = () => { 4618 let { index, refs } = useStorybookState(), api = useStorybookApi(), currentStory = api.getCurrentStoryData(); 4619 if (!currentStory) 4620 return ""; 4621 let combinedIndex = combineIndexes(index, refs || {}), storyLabel = currentStory.renderLabel?.(currentStory, api), fullStoryName = typeof storyLabel == "string" ? storyLabel : currentStory.name, node = combinedIndex[currentStory.id]; 4622 for (; node && "parent" in node && node.parent && combinedIndex[node.parent] && fullStoryName.length < 24; ) { 4623 node = combinedIndex[node.parent]; 4624 let parentLabel = node.renderLabel?.(node, api); 4625 fullStoryName = `${typeof parentLabel == "string" ? parentLabel : node.name}/${fullStoryName}`; 4626 } 4627 return fullStoryName; 4628}, MobileBottomBarContent = ({ 4629 fullStoryName, 4630 isMobileMenuOpen, 4631 setMobileMenuOpen, 4632 isMobilePanelOpen, 4633 setMobilePanelOpen, 4634 showMenu, 4635 showPanel 4636}) => { 4637 let headingId = $bdb11010cef70236$export$f680877a34711e37(), sectionRef = useRef(null), { landmarkProps } = useLandmark( 4638 { "aria-labelledby": headingId, role: "banner" }, 4639 sectionRef 4640 ); 4641 return react_default.createElement(MobileBottomBar, { className: "sb-bar", ...landmarkProps, ref: sectionRef }, react_default.createElement("h2", { id: headingId, className: "sb-sr-only" }, "Navigation controls"), showMenu && react_default.createElement( 4642 BottomBarButton, 4643 { 4644 padding: "small", 4645 variant: "ghost", 4646 onClick: () => setMobileMenuOpen(!isMobileMenuOpen), 4647 ariaLabel: "Open navigation menu", 4648 "aria-expanded": isMobileMenuOpen, 4649 "aria-controls": "storybook-mobile-menu" 4650 }, 4651 react_default.createElement(MenuIcon, null), 4652 react_default.createElement(Text, null, fullStoryName) 4653 ), react_default.createElement("span", { className: "sb-sr-only", "aria-current": "page" }, fullStoryName), showPanel && react_default.createElement( 4654 BottomBarButton, 4655 { 4656 padding: "small", 4657 variant: "ghost", 4658 onClick: () => setMobilePanelOpen(!0), 4659 ariaLabel: "Open addon panel", 4660 "aria-expanded": isMobilePanelOpen, 4661 "aria-controls": "storybook-mobile-addon-panel" 4662 }, 4663 react_default.createElement(BottomBarToggleIcon, null) 4664 )); 4665}, MobileNavigation = ({ 4666 menu, 4667 panel, 4668 showMenu = !0, 4669 showPanel, 4670 ...props 4671}) => { 4672 let { isMobileMenuOpen, isMobilePanelOpen, setMobileMenuOpen, setMobilePanelOpen } = useLayout(), fullStoryName = useFullStoryName(); 4673 return useLayoutEffect(() => { 4674 showMenu || setMobileMenuOpen(!1); 4675 }, [showMenu, setMobileMenuOpen]), react_default.createElement(Container4, { ...props }, showMenu && react_default.createElement( 4676 MobileMenuDrawer, 4677 { 4678 id: "storybook-mobile-menu", 4679 isOpen: isMobileMenuOpen, 4680 onOpenChange: setMobileMenuOpen 4681 }, 4682 menu 4683 ), react_default.createElement( 4684 MobileAddonsDrawer, 4685 { 4686 id: "storybook-mobile-addon-panel", 4687 isOpen: isMobilePanelOpen, 4688 onOpenChange: setMobilePanelOpen 4689 }, 4690 panel 4691 ), !isMobilePanelOpen && (showMenu || showPanel) && react_default.createElement( 4692 MobileBottomBarContent, 4693 { 4694 fullStoryName, 4695 isMobileMenuOpen, 4696 setMobileMenuOpen, 4697 isMobilePanelOpen, 4698 setMobilePanelOpen, 4699 showMenu, 4700 showPanel
vendor: 2,754 bytes, lines 4700-4786
4700 4701 } 4702 )); 4703}, Container4 = styled.section(({ theme }) => ({ 4704 bottom: 0, 4705 left: 0, 4706 width: "100%", 4707 zIndex: 10, 4708 background: theme.barBg, 4709 borderTop: `1px solid ${theme.appBorderColor}` 4710})), MobileBottomBar = styled.header({ 4711 display: "flex", 4712 alignItems: "center", 4713 justifyContent: "space-between", 4714 width: "100%", 4715 height: 40, 4716 padding: "0 6px", 4717 /* Because Popper.js's tooltip is creating extra div layers, we have to 4718 * punch through them to configure the button to ellipsize. */ 4719 "& > *:first-child": { 4720 /* 6px padding * 2 + 28px for the orientation button */ 4721 maxWidth: "calc(100% - 40px)", 4722 "& > button": { 4723 maxWidth: "100%" 4724 }, 4725 "& > button p": { 4726 textOverflow: "ellipsis" 4727 } 4728 } 4729}), BottomBarButton = styled(Button)({ 4730 WebkitLineClamp: 1, 4731 flexShrink: 1, 4732 p: { 4733 textOverflow: "ellipsis" 4734 } 4735}), Text = styled.p({ 4736 display: "-webkit-box", 4737 WebkitLineClamp: 1, 4738 WebkitBoxOrient: "vertical", 4739 overflow: "hidden" 4740}); 4741 4742// src/manager/components/layout/MainAreaContainer.tsx 4743init_react(); 4744var PagesInnerContainer = styled.main(({ theme }) => ({ 4745 display: "flex", 4746 flexDirection: "column", 4747 gridRowStart: "sidebar-start", 4748 gridRowEnd: "-1", 4749 gridColumnStart: "sidebar-end", 4750 gridColumnEnd: "-1", 4751 backgroundColor: theme.appContentBg, 4752 zIndex: 1 4753})), PagesContainer = react_default.memo(function(props) { 4754 let { children } = props, mainRef = useRef(null), { landmarkProps } = useLandmark( 4755 { "aria-labelledby": "main-content-heading", role: "main" }, 4756 mainRef 4757 ); 4758 return react_default.createElement(PagesInnerContainer, { id: "main-content-wrapper", ref: mainRef, ...landmarkProps }, react_default.createElement("h2", { id: "main-content-heading", className: "sb-sr-only" }, "Main content"), children); 4759}), MainInnerContainer = styled.div(({ theme, shown }) => ({ 4760 flex: 1, 4761 position: "relative", 4762 backgroundColor: theme.appContentBg, 4763 display: shown ? "grid" : "none", 4764 // This is needed to make the content container fill the available space 4765 overflow: "auto", 4766 [MEDIA_DESKTOP_BREAKPOINT]: { 4767 flex: "auto", 4768 gridArea: "content" 4769 } 4770})), MainAreaContainer = react_default.memo(function({ 4771 showPages, 4772 slotMain, 4773 slotPages 4774}) { 4775 return react_default.createElement(react_default.Fragment, null, showPages ? react_default.createElement(PagesContainer, null, slotPages) : react_default.createElement(Match, { path: /(^\/story|docs|onboarding\/|^\/$)/, startsWith: !1 }, ({ match }) => react_default.createElement(MainInnerContainer, { shown: !!match }, slotMain))); 4776}); 4777 4778// src/manager/components/layout/PanelContainer.tsx 4779init_react(); 4780 4781// src/manager/components/layout/Drag.tsx 4782init_react(); 4783 4784// src/components/components/tooltip/TooltipNote.tsx 4785init_react(); 4786var
4786Note = styled.div(({ theme }) => ({ 4787 fontFamily: theme.typography.fonts.base, 4788 padding: "2px 6px", 4789 lineHeight: "16px", 4790 fontSize: 10, 4791 fontWeight: theme.typography.weight.bold, 4792 color: theme.color.lightest, 4793 boxShadow: "0 0 5px 0 rgba(0, 0, 0, 0.3)", 4794 borderRadius: 4, 4795 whiteSpace: "nowrap", 4796 pointerEvents: "none", 4797 zIndex: -1, 4798 background: theme.base === "light" ? "rgba(60, 60, 60, 0.9)" : "rgba(0, 0, 0, 0.95)" 4799})), TooltipNote2 = ({ note, ...props }) => react_default.createElement(Note, {
vendor: 93 bytes, lines 4799-4803
4799 ...props }, note); 4800 4801// src/components/components/tooltip/TooltipProvider.tsx 4802init_react(); 4803
vendor: 4,261 bytes, lines 4804-4888
4804// ../../node_modules/@react-aria/interactions/dist/utils.mjs 4805init_react(); 4806function $8a9cb279dc87e130$export$525bc4921d56d4a(nativeEvent) { 4807 let event = nativeEvent; 4808 return event.nativeEvent = nativeEvent, event.isDefaultPrevented = () => event.defaultPrevented, event.isPropagationStopped = () => event.cancelBubble, event.persist = () => { 4809 }, event; 4810} 4811function $8a9cb279dc87e130$export$c2b7abe5d61ec696(event, target) { 4812 Object.defineProperty(event, "target", { 4813 value: target 4814 }), Object.defineProperty(event, "currentTarget", { 4815 value: target 4816 }); 4817} 4818function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) { 4819 let stateRef = useRef({ 4820 isFocused: !1, 4821 observer: null 4822 }); 4823 $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => { 4824 let state = stateRef.current; 4825 return () => { 4826 state.observer && (state.observer.disconnect(), state.observer = null); 4827 }; 4828 }, []); 4829 let dispatchBlur = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => { 4830 onBlur?.(e2); 4831 }); 4832 return useCallback((e2) => { 4833 if (e2.target instanceof HTMLButtonElement || e2.target instanceof HTMLInputElement || e2.target instanceof HTMLTextAreaElement || e2.target instanceof HTMLSelectElement) { 4834 stateRef.current.isFocused = !0; 4835 let target = e2.target, onBlurHandler = (e3) => { 4836 if (stateRef.current.isFocused = !1, target.disabled) { 4837 let event = $8a9cb279dc87e130$export$525bc4921d56d4a(e3); 4838 dispatchBlur(event); 4839 } 4840 stateRef.current.observer && (stateRef.current.observer.disconnect(), stateRef.current.observer = null); 4841 }; 4842 target.addEventListener("focusout", onBlurHandler, { 4843 once: !0 4844 }), stateRef.current.observer = new MutationObserver(() => { 4845 if (stateRef.current.isFocused && target.disabled) { 4846 var _stateRef_current_observer; 4847 (_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 || _stateRef_current_observer.disconnect(); 4848 let relatedTargetEl = target === document.activeElement ? null : document.activeElement; 4849 target.dispatchEvent(new FocusEvent("blur", { 4850 relatedTarget: relatedTargetEl 4851 })), target.dispatchEvent(new FocusEvent("focusout", { 4852 bubbles: !0, 4853 relatedTarget: relatedTargetEl 4854 })); 4855 } 4856 }), stateRef.current.observer.observe(target, { 4857 attributes: !0, 4858 attributeFilter: [ 4859 "disabled" 4860 ] 4861 }); 4862 } 4863 }, [ 4864 dispatchBlur 4865 ]); 4866} 4867var $8a9cb279dc87e130$export$fda7da73ab5d4c48 = !1; 4868function $8a9cb279dc87e130$export$cabe61c495ee3649(target) { 4869 for (; target && !$b4b717babfbb907b$export$4c063cf1350e6fed(target); ) target = target.parentElement; 4870 let window2 = $431fbd86ca7dc216$export$f21a1ffae260145a(target), activeElement = window2.document.activeElement; 4871 if (!activeElement || activeElement === target) return; 4872 $8a9cb279dc87e130$export$fda7da73ab5d4c48 = !0; 4873 let isRefocusing = !1, onBlur = (e2) => { 4874 (e2.target === activeElement || isRefocusing) && e2.stopImmediatePropagation(); 4875 }, onFocusOut = (e2) => { 4876 (e2.target === activeElement || isRefocusing) && (e2.stopImmediatePropagation(), !target && !isRefocusing && (isRefocusing = !0, $7215afc6de606d6b$export$de79e2c695e052f3(activeElement), cleanup())); 4877 }, onFocus = (e2) => { 4878 (e2.target === target || isRefocusing) && e2.stopImmediatePropagation(); 4879 }, onFocusIn = (e2) => { 4880 (e2.target === target || isRefocusing) && (e2.stopImmediatePropagation(), isRefocusing || (isRefocusing = !0, $7215afc6de606d6b$export$de79e2c695e052f3(activeElement), cleanup())); 4881 }; 4882 window2.addEventListener("blur", onBlur, !0), window2.addEventListener("focusout", onFocusOut, !0), window2.addEventListener("focusin", onFocusIn, !0), window2.addEventListener("focus", onFocus, !0); 4883 let cleanup = () => { 4884 cancelAnimationFrame(raf), window2.removeEventListener("blur", onBlur, !0), window2.removeEventListener("focusout", onFocusOut, !0), window2.removeEventListener("focusin", onFocusIn, !0), window2.removeEventListener("focus", onFocus, !0), $8a9cb279dc87e130$export$fda7da73ab5d4c48 = !1, isRefocusing = !1; 4885 }, raf = requestAnimationFrame(cleanup); 4886 return cleanup; 4887} 4888
vendor: 2,247 bytes, lines 4889-4919
4889// ../../node_modules/@react-aria/interactions/dist/textSelection.mjs 4890var $14c0b72509d70225$var$state = "default", $14c0b72509d70225$var$savedUserSelect = "", $14c0b72509d70225$var$modifiedElementMap = /* @__PURE__ */ new WeakMap(); 4891function $14c0b72509d70225$export$16a4697467175487(target) { 4892 if ($c87311424ea30a05$export$fedb369cb70207f1()) { 4893 if ($14c0b72509d70225$var$state === "default") { 4894 let documentObject = $431fbd86ca7dc216$export$b204af158042fbac(target); 4895 $14c0b72509d70225$var$savedUserSelect = documentObject.documentElement.style.webkitUserSelect, documentObject.documentElement.style.webkitUserSelect = "none"; 4896 } 4897 $14c0b72509d70225$var$state = "disabled"; 4898 } else if (target instanceof HTMLElement || target instanceof SVGElement) { 4899 let property = "userSelect" in target.style ? "userSelect" : "webkitUserSelect"; 4900 $14c0b72509d70225$var$modifiedElementMap.set(target, target.style[property]), target.style[property] = "none"; 4901 } 4902} 4903function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) { 4904 if ($c87311424ea30a05$export$fedb369cb70207f1()) { 4905 if ($14c0b72509d70225$var$state !== "disabled") return; 4906 $14c0b72509d70225$var$state = "restoring", setTimeout(() => { 4907 $bbed8b41f857bcc0$export$24490316f764c430(() => { 4908 if ($14c0b72509d70225$var$state === "restoring") { 4909 let documentObject = $431fbd86ca7dc216$export$b204af158042fbac(target); 4910 documentObject.documentElement.style.webkitUserSelect === "none" && (documentObject.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || ""), $14c0b72509d70225$var$savedUserSelect = "", $14c0b72509d70225$var$state = "default"; 4911 } 4912 }); 4913 }, 300); 4914 } else if ((target instanceof HTMLElement || target instanceof SVGElement) && target && $14c0b72509d70225$var$modifiedElementMap.has(target)) { 4915 let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target), property = "userSelect" in target.style ? "userSelect" : "webkitUserSelect"; 4916 target.style[property] === "none" && (target.style[property] = targetOldUserSelect), target.getAttribute("style") === "" && target.removeAttribute("style"), $14c0b72509d70225$var$modifiedElementMap.delete(target); 4917 } 4918} 4919
vendor: 266 bytes, lines 4920-4927
4920// ../../node_modules/@react-aria/interactions/dist/context.mjs 4921init_react(); 4922var $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = react_default.createContext({ 4923 register: () => { 4924 } 4925}); 4926$ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = "PressResponderContext"; 4927
vendor: 210 bytes, lines 4928-4932
4928// ../../node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js 4929function _class_apply_descriptor_get(receiver, descriptor) { 4930 return descriptor.get ? descriptor.get.call(receiver) : descriptor.value; 4931} 4932
vendor: 300 bytes, lines 4933-4938
4933// ../../node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js 4934function _class_extract_field_descriptor(receiver, privateMap, action) { 4935 if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance"); 4936 return privateMap.get(receiver); 4937} 4938
vendor: 269 bytes, lines 4939-4944
4939// ../../node_modules/@swc/helpers/esm/_class_private_field_get.js 4940function _class_private_field_get(receiver, privateMap) { 4941 var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get"); 4942 return _class_apply_descriptor_get(receiver, descriptor); 4943} 4944
vendor: 263 bytes, lines 4945-4950
4945// ../../node_modules/@swc/helpers/esm/_check_private_redeclaration.js 4946function _check_private_redeclaration(obj, privateCollection) { 4947 if (privateCollection.has(obj)) 4948 throw new TypeError("Cannot initialize the same private elements twice on an object"); 4949} 4950
vendor: 209 bytes, lines 4951-4955
4951// ../../node_modules/@swc/helpers/esm/_class_private_field_init.js 4952function _class_private_field_init(obj, privateMap, value) { 4953 _check_private_redeclaration(obj, privateMap), privateMap.set(obj, value); 4954} 4955
vendor: 345 bytes, lines 4956-4965
4956// ../../node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js 4957function _class_apply_descriptor_set(receiver, descriptor, value) { 4958 if (descriptor.set) descriptor.set.call(receiver, value); 4959 else { 4960 if (!descriptor.writable) 4961 throw new TypeError("attempted to set read only private field"); 4962 descriptor.value = value; 4963 } 4964} 4965
vendor: 290 bytes, lines 4966-4971
4966// ../../node_modules/@swc/helpers/esm/_class_private_field_set.js 4967function _class_private_field_set(receiver, privateMap, value) { 4968 var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set"); 4969 return _class_apply_descriptor_set(receiver, descriptor, value), value; 4970} 4971
vendor: 17,543 bytes, lines 4972-5235
4972// ../../node_modules/@react-aria/interactions/dist/usePress.mjs 4973init_react(); 4974function $f6c31cce2adf654f$var$usePressResponderContext(props) { 4975 let context = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5); 4976 if (context) { 4977 let { register, ...contextProps } = context; 4978 props = $3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props), register(); 4979 } 4980 return $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, props.ref), props; 4981} 4982var $f6c31cce2adf654f$var$_shouldStopPropagation = /* @__PURE__ */ new WeakMap(), $f6c31cce2adf654f$var$PressEvent = class { 4983 continuePropagation() { 4984 _class_private_field_set(this, $f6c31cce2adf654f$var$_shouldStopPropagation, !1); 4985 } 4986 get shouldStopPropagation() { 4987 return _class_private_field_get(this, $f6c31cce2adf654f$var$_shouldStopPropagation); 4988 } 4989 constructor(type, pointerType, originalEvent, state) { 4990 _class_private_field_init(this, $f6c31cce2adf654f$var$_shouldStopPropagation, { 4991 writable: !0, 4992 value: void 0 4993 }), _class_private_field_set(this, $f6c31cce2adf654f$var$_shouldStopPropagation, !0); 4994 var _state_target; 4995 let currentTarget = (_state_target = state?.target) !== null && _state_target !== void 0 ? _state_target : originalEvent.currentTarget, rect = currentTarget?.getBoundingClientRect(), x2, y2 = 0, clientX, clientY = null; 4996 originalEvent.clientX != null && originalEvent.clientY != null && (clientX = originalEvent.clientX, clientY = originalEvent.clientY), rect && (clientX != null && clientY != null ? (x2 = clientX - rect.left, y2 = clientY - rect.top) : (x2 = rect.width / 2, y2 = rect.height / 2)), this.type = type, this.pointerType = pointerType, this.target = originalEvent.currentTarget, this.shiftKey = originalEvent.shiftKey, this.metaKey = originalEvent.metaKey, this.ctrlKey = originalEvent.ctrlKey, this.altKey = originalEvent.altKey, this.x = x2, this.y = y2; 4997 } 4998}, $f6c31cce2adf654f$var$LINK_CLICKED = /* @__PURE__ */ Symbol("linkClicked"), $f6c31cce2adf654f$var$STYLE_ID = "react-aria-pressable-style", $f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE = "data-react-aria-pressable"; 4999function $f6c31cce2adf654f$export$45712eceda6fad21(props) { 5000 let { onPress, onPressChange, onPressStart, onPressEnd, onPressUp, onClick, isDisabled, isPressed: isPressedProp, preventFocusOnPress, shouldCancelOnPointerExit, allowTextSelectionOnPress, ref: domRef, ...domProps } = $f6c31cce2adf654f$var$usePressResponderContext(props), [isPressed, setPressed] = useState(!1), ref = useRef({ 5001 isPressed: !1, 5002 ignoreEmulatedMouseEvents: !1, 5003 didFirePressStart: !1, 5004 isTriggeringEvent: !1, 5005 activePointerId: null, 5006 target: null, 5007 isOverTarget: !1, 5008 pointerType: null, 5009 disposables: [] 5010 }), { addGlobalListener, removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6(), triggerPressStart = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType) => { 5011 let state = ref.current; 5012 if (isDisabled || state.didFirePressStart) return !1; 5013 let shouldStopPropagation = !0; 5014 if (state.isTriggeringEvent = !0, onPressStart) { 5015 let event = new $f6c31cce2adf654f$var$PressEvent("pressstart", pointerType, originalEvent); 5016 onPressStart(event), shouldStopPropagation = event.shouldStopPropagation; 5017 } 5018 return onPressChange && onPressChange(!0), state.isTriggeringEvent = !1, state.didFirePressStart = !0, setPressed(!0), shouldStopPropagation; 5019 }), triggerPressEnd = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType, wasPressed = !0) => { 5020 let state = ref.current; 5021 if (!state.didFirePressStart) return !1; 5022 state.didFirePressStart = !1, state.isTriggeringEvent = !0; 5023 let shouldStopPropagation = !0; 5024 if (onPressEnd) { 5025 let event = new $f6c31cce2adf654f$var$PressEvent("pressend", pointerType, originalEvent); 5026 onPressEnd(event), shouldStopPropagation = event.shouldStopPropagation; 5027 } 5028 if (onPressChange && onPressChange(!1), setPressed(!1), onPress && wasPressed && !isDisabled) { 5029 let event = new $f6c31cce2adf654f$var$PressEvent("press", pointerType, originalEvent); 5030 onPress(event), shouldStopPropagation && (shouldStopPropagation = event.shouldStopPropagation); 5031 } 5032 return state.isTriggeringEvent = !1, shouldStopPropagation; 5033 }), triggerPressUp = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType) => { 5034 let state = ref.current; 5035 if (isDisabled) return !1; 5036 if (onPressUp) { 5037 state.isTriggeringEvent = !0; 5038 let event = new $f6c31cce2adf654f$var$PressEvent("pressup", pointerType, originalEvent); 5039 return onPressUp(event), state.isTriggeringEvent = !1, event.shouldStopPropagation; 5040 } 5041 return !0; 5042 }), cancel = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => { 5043 let state = ref.current; 5044 if (state.isPressed && state.target) { 5045 state.didFirePressStart && state.pointerType != null && triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e2), state.pointerType, !1), state.isPressed = !1, state.isOverTarget = !1, state.activePointerId = null, state.pointerType = null, removeAllGlobalListeners(), allowTextSelectionOnPress || $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target); 5046 for (let dispose of state.disposables) dispose(); 5047 state.disposables = []; 5048 } 5049 }), cancelOnPointerExit = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => { 5050 shouldCancelOnPointerExit && cancel(e2); 5051 }), triggerClick = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => { 5052 isDisabled || onClick?.(e2); 5053 }), triggerSyntheticClick = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2, target) => { 5054 if (!isDisabled && onClick) { 5055 let event = new MouseEvent("click", e2); 5056 $8a9cb279dc87e130$export$c2b7abe5d61ec696(event, target), onClick($8a9cb279dc87e130$export$525bc4921d56d4a(event)); 5057 } 5058 }), pressProps = useMemo(() => { 5059 let state = ref.current, pressProps2 = { 5060 onKeyDown(e2) { 5061 if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e2.nativeEvent, e2.currentTarget) && $d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent))) { 5062 var _state_metaKeyEvents; 5063 $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard($d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent), e2.key) && e2.preventDefault(); 5064 let shouldStopPropagation = !0; 5065 if (!state.isPressed && !e2.repeat) { 5066 state.target = e2.currentTarget, state.isPressed = !0, state.pointerType = "keyboard", shouldStopPropagation = triggerPressStart(e2, "keyboard"); 5067 let originalTarget = e2.currentTarget, pressUp = (e3) => { 5068 $f6c31cce2adf654f$var$isValidKeyboardEvent(e3, originalTarget) && !e3.repeat && $d4ee10de306f2510$export$4282f70798064fe0(originalTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e3)) && state.target && triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e3), "keyboard"); 5069 }; 5070 addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(e2.currentTarget), "keyup", $ff5963eb1fccf552$export$e08e3b67e392101e(pressUp, onKeyUp), !0); 5071 } 5072 shouldStopPropagation && e2.stopPropagation(), e2.metaKey && $c87311424ea30a05$export$9ac100e40613ea10() && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 || _state_metaKeyEvents.set(e2.key, e2.nativeEvent)); 5073 } else e2.key === "Meta" && (state.metaKeyEvents = /* @__PURE__ */ new Map()); 5074 }, 5075 onClick(e2) { 5076 if (!(e2 && !$d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent))) && e2 && e2.button === 0 && !state.isTriggeringEvent && !$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening) { 5077 let shouldStopPropagation = !0; 5078 if (isDisabled && e2.preventDefault(), !state.ignoreEmulatedMouseEvents && !state.isPressed && (state.pointerType === "virtual" || $6a7db85432448f7f$export$60278871457622de(e2.nativeEvent))) { 5079 let stopPressStart = triggerPressStart(e2, "virtual"), stopPressUp = triggerPressUp(e2, "virtual"), stopPressEnd = triggerPressEnd(e2, "virtual"); 5080 triggerClick(e2), shouldStopPropagation = stopPressStart && stopPressUp && stopPressEnd; 5081 } else if (state.isPressed && state.pointerType !== "keyboard") { 5082 let pointerType = state.pointerType || e2.nativeEvent.pointerType || "virtual", stopPressUp = triggerPressUp($f6c31cce2adf654f$var$createEvent(e2.currentTarget, e2), pointerType), stopPressEnd = triggerPressEnd($f6c31cce2adf654f$var$createEvent(e2.currentTarget, e2), pointerType, !0); 5083 shouldStopPropagation = stopPressUp && stopPressEnd, state.isOverTarget = !1, triggerClick(e2), cancel(e2); 5084 } 5085 state.ignoreEmulatedMouseEvents = !1, shouldStopPropagation && e2.stopPropagation(); 5086 } 5087 } 5088 }, onKeyUp = (e2) => { 5089 var _state_metaKeyEvents; 5090 if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e2, state.target)) { 5091 var _state_metaKeyEvents1; 5092 $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard($d4ee10de306f2510$export$e58f029f0fbfdb29(e2), e2.key) && e2.preventDefault(); 5093 let target = $d4ee10de306f2510$export$e58f029f0fbfdb29(e2), wasPressed = $d4ee10de306f2510$export$4282f70798064fe0(state.target, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2)); 5094 triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e2), "keyboard", wasPressed), wasPressed && triggerSyntheticClick(e2, state.target), removeAllGlobalListeners(), e2.key !== "Enter" && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && $d4ee10de306f2510$export$4282f70798064fe0(state.target, target) && !e2[$f6c31cce2adf654f$var$LINK_CLICKED] && (e2[$f6c31cce2adf654f$var$LINK_CLICKED] = !0, $ea8dcbcb9ea1b556$export$95185d699e05d4d7(state.target, e2, !1)), state.isPressed = !1, (_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 || _state_metaKeyEvents1.delete(e2.key); 5095 } else if (e2.key === "Meta" && (!((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0) && _state_metaKeyEvents.size)) { 5096 var _state_target; 5097 let events2 = state.metaKeyEvents; 5098 state.metaKeyEvents = void 0; 5099 for (let event of events2.values()) (_state_target = state.target) === null || _state_target === void 0 || _state_target.dispatchEvent(new KeyboardEvent("keyup", event)); 5100 } 5101 }; 5102 if (typeof PointerEvent < "u") { 5103 pressProps2.onPointerDown = (e2) => { 5104 if (e2.button !== 0 || !$d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent))) return; 5105 if ($6a7db85432448f7f$export$29bf1b5f2c56cf63(e2.nativeEvent)) { 5106 state.pointerType = "virtual"; 5107 return; 5108 } 5109 state.pointerType = e2.pointerType; 5110 let shouldStopPropagation = !0; 5111 if (!state.isPressed) { 5112 state.isPressed = !0, state.isOverTarget = !0, state.activePointerId = e2.pointerId, state.target = e2.currentTarget, allowTextSelectionOnPress || $14c0b72509d70225$export$16a4697467175487(state.target), shouldStopPropagation = triggerPressStart(e2, state.pointerType); 5113 let target = $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent); 5114 "releasePointerCapture" in target && target.releasePointerCapture(e2.pointerId), addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(e2.currentTarget), "pointerup", onPointerUp, !1), addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(e2.currentTarget), "pointercancel", onPointerCancel, !1); 5115 } 5116 shouldStopPropagation && e2.stopPropagation(); 5117 }, pressProps2.onMouseDown = (e2) => { 5118 if ($d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent)) && e2.button === 0) { 5119 if (preventFocusOnPress) { 5120 let dispose = $8a9cb279dc87e130$export$cabe61c495ee3649(e2.target); 5121 dispose && state.disposables.push(dispose); 5122 } 5123 e2.stopPropagation(); 5124 } 5125 }, pressProps2.onPointerUp = (e2) => { 5126 !$d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent)) || state.pointerType === "virtual" || e2.button === 0 && !state.isPressed && triggerPressUp(e2, state.pointerType || e2.pointerType); 5127 }, pressProps2.onPointerEnter = (e2) => { 5128 e2.pointerId === state.activePointerId && state.target && !state.isOverTarget && state.pointerType != null && (state.isOverTarget = !0, triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e2), state.pointerType)); 5129 }, pressProps2.onPointerLeave = (e2) => { 5130 e2.pointerId === state.activePointerId && state.target && state.isOverTarget && state.pointerType != null && (state.isOverTarget = !1, triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e2), state.pointerType, !1), cancelOnPointerExit(e2)); 5131 }; 5132 let onPointerUp = (e2) => { 5133 if (e2.pointerId === state.activePointerId && state.isPressed && e2.button === 0 && state.target) { 5134 if ($d4ee10de306f2510$export$4282f70798064fe0(state.target, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2)) && state.pointerType != null) { 5135 let clicked = !1, timeout = setTimeout(() => { 5136 state.isPressed && state.target instanceof HTMLElement && (clicked ? cancel(e2) : ($7215afc6de606d6b$export$de79e2c695e052f3(state.target), state.target.click())); 5137 }, 80); 5138 addGlobalListener(e2.currentTarget, "click", () => clicked = !0, !0), state.disposables.push(() => clearTimeout(timeout)); 5139 } else cancel(e2); 5140 state.isOverTarget = !1; 5141 } 5142 }, onPointerCancel = (e2) => { 5143 cancel(e2); 5144 }; 5145 pressProps2.onDragStart = (e2) => { 5146 $d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent)) && cancel(e2); 5147 }; 5148 } 5149 return pressProps2; 5150 }, [ 5151 addGlobalListener, 5152 isDisabled, 5153 preventFocusOnPress, 5154 removeAllGlobalListeners, 5155 allowTextSelectionOnPress, 5156 cancel, 5157 cancelOnPointerExit, 5158 triggerPressEnd, 5159 triggerPressStart, 5160 triggerPressUp, 5161 triggerClick, 5162 triggerSyntheticClick 5163 ]); 5164 return useEffect(() => { 5165 if (!domRef) return; 5166 let ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(domRef.current); 5167 if (!ownerDocument || !ownerDocument.head || ownerDocument.getElementById($f6c31cce2adf654f$var$STYLE_ID)) return; 5168 let style = ownerDocument.createElement("style"); 5169 style.id = $f6c31cce2adf654f$var$STYLE_ID, style.textContent = ` 5170@layer { 5171 [${$f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE}] { 5172 touch-action: pan-x pan-y pinch-zoom; 5173 } 5174} 5175 `.trim(), ownerDocument.head.prepend(style); 5176 }, [ 5177 domRef 5178 ]), useEffect(() => { 5179 let state = ref.current; 5180 return () => { 5181 var _state_target; 5182 allowTextSelectionOnPress || $14c0b72509d70225$export$b0d6fa1ab32e3295((_state_target = state.target) !== null && _state_target !== void 0 ? _state_target : void 0); 5183 for (let dispose of state.disposables) dispose(); 5184 state.disposables = []; 5185 }; 5186 }, [ 5187 allowTextSelectionOnPress 5188 ]), { 5189 isPressed: isPressedProp || isPressed, 5190 pressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, pressProps, { 5191 [$f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE]: !0 5192 }) 5193 }; 5194} 5195function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) { 5196 return target.tagName === "A" && target.hasAttribute("href"); 5197} 5198function $f6c31cce2adf654f$var$isValidKeyboardEvent(event, currentTarget) { 5199 let { key, code } = event, element = currentTarget, role = element.getAttribute("role"); 5200 return (key === "Enter" || key === " " || key === "Spacebar" || code === "Space") && !(element instanceof $431fbd86ca7dc216$export$f21a1ffae260145a(element).HTMLInputElement && !$f6c31cce2adf654f$var$isValidInputKey(element, key) || element instanceof $431fbd86ca7dc216$export$f21a1ffae260145a(element).HTMLTextAreaElement || element.isContentEditable) && // Links should only trigger with Enter key 5201 !((role === "link" || !role && $f6c31cce2adf654f$var$isHTMLAnchorLink(element)) && key !== "Enter"); 5202} 5203function $f6c31cce2adf654f$var$createEvent(target, e2) { 5204 let clientX = e2.clientX, clientY = e2.clientY; 5205 return { 5206 currentTarget: target, 5207 shiftKey: e2.shiftKey, 5208 ctrlKey: e2.ctrlKey, 5209 metaKey: e2.metaKey, 5210 altKey: e2.altKey, 5211 clientX, 5212 clientY 5213 }; 5214} 5215function $f6c31cce2adf654f$var$shouldPreventDefaultUp(target) { 5216 return target instanceof HTMLInputElement ? !1 : target instanceof HTMLButtonElement ? target.type !== "submit" && target.type !== "reset" : !$f6c31cce2adf654f$var$isHTMLAnchorLink(target); 5217} 5218function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target, key) { 5219 return target instanceof HTMLInputElement ? !$f6c31cce2adf654f$var$isValidInputKey(target, key) : $f6c31cce2adf654f$var$shouldPreventDefaultUp(target); 5220} 5221var $f6c31cce2adf654f$var$nonTextInputTypes = /* @__PURE__ */ new Set([ 5222 "checkbox", 5223 "radio", 5224 "range", 5225 "color", 5226 "file", 5227 "image", 5228 "button", 5229 "submit", 5230 "reset" 5231]); 5232function $f6c31cce2adf654f$var$isValidInputKey(target, key) { 5233 return target.type === "checkbox" || target.type === "radio" ? key === " " : $f6c31cce2adf654f$var$nonTextInputTypes.has(target.type); 5234} 5235
vendor: 5,829 bytes, lines 5236-5290
5236// ../../node_modules/@react-aria/interactions/dist/useFocusVisible.mjs 5237init_react(); 5238var $507fabe10e71c6fb$var$currentModality = null, $507fabe10e71c6fb$var$changeHandlers = /* @__PURE__ */ new Set(), $507fabe10e71c6fb$export$d90243b58daecda7 = /* @__PURE__ */ new Map(), $507fabe10e71c6fb$var$hasEventBeforeFocus = !1, $507fabe10e71c6fb$var$hasBlurredWindowRecently = !1; 5239function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e2) { 5240 for (let handler of $507fabe10e71c6fb$var$changeHandlers) handler(modality, e2); 5241} 5242function $507fabe10e71c6fb$var$isValidKey(e2) { 5243 return !(e2.metaKey || !$c87311424ea30a05$export$9ac100e40613ea10() && e2.altKey || e2.ctrlKey || e2.key === "Control" || e2.key === "Shift" || e2.key === "Meta"); 5244} 5245function $507fabe10e71c6fb$var$handleKeyboardEvent(e2) { 5246 $507fabe10e71c6fb$var$hasEventBeforeFocus = !0, $507fabe10e71c6fb$var$isValidKey(e2) && ($507fabe10e71c6fb$var$currentModality = "keyboard", $507fabe10e71c6fb$var$triggerChangeHandlers("keyboard", e2)); 5247} 5248function $507fabe10e71c6fb$var$handlePointerEvent(e2) { 5249 $507fabe10e71c6fb$var$currentModality = "pointer", (e2.type === "mousedown" || e2.type === "pointerdown") && ($507fabe10e71c6fb$var$hasEventBeforeFocus = !0, $507fabe10e71c6fb$var$triggerChangeHandlers("pointer", e2)); 5250} 5251function $507fabe10e71c6fb$var$handleClickEvent(e2) { 5252 $6a7db85432448f7f$export$60278871457622de(e2) && ($507fabe10e71c6fb$var$hasEventBeforeFocus = !0, $507fabe10e71c6fb$var$currentModality = "virtual"); 5253} 5254function $507fabe10e71c6fb$var$handleFocusEvent(e2) { 5255 e2.target === window || e2.target === document || $8a9cb279dc87e130$export$fda7da73ab5d4c48 || !e2.isTrusted || (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently && ($507fabe10e71c6fb$var$currentModality = "virtual", $507fabe10e71c6fb$var$triggerChangeHandlers("virtual", e2)), $507fabe10e71c6fb$var$hasEventBeforeFocus = !1, $507fabe10e71c6fb$var$hasBlurredWindowRecently = !1); 5256} 5257function $507fabe10e71c6fb$var$handleWindowBlur() { 5258 $8a9cb279dc87e130$export$fda7da73ab5d4c48 || ($507fabe10e71c6fb$var$hasEventBeforeFocus = !1, $507fabe10e71c6fb$var$hasBlurredWindowRecently = !0); 5259} 5260function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) { 5261 if (typeof window > "u" || typeof document > "u" || $507fabe10e71c6fb$export$d90243b58daecda7.get($431fbd86ca7dc216$export$f21a1ffae260145a(element))) return; 5262 let windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element), documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element), focus = windowObject.HTMLElement.prototype.focus; 5263 windowObject.HTMLElement.prototype.focus = function() { 5264 $507fabe10e71c6fb$var$hasEventBeforeFocus = !0, focus.apply(this, arguments); 5265 }, documentObject.addEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, !0), documentObject.addEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, !0), documentObject.addEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, !0), windowObject.addEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, !0), windowObject.addEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, !1), typeof PointerEvent < "u" && (documentObject.addEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, !0), documentObject.addEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, !0), documentObject.addEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, !0)), windowObject.addEventListener("beforeunload", () => { 5266 $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element); 5267 }, { 5268 once: !0 5269 }), $507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, { 5270 focus 5271 }); 5272} 5273var $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener) => { 5274 let windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element), documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element); 5275 loadListener && documentObject.removeEventListener("DOMContentLoaded", loadListener), $507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject) && (windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus, documentObject.removeEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, !0), documentObject.removeEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, !0), documentObject.removeEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, !0), windowObject.removeEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, !0), windowObject.removeEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, !1), typeof PointerEvent < "u" && (documentObject.removeEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, !0), documentObject.removeEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, !0), documentObject.removeEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, !0)), $507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject)); 5276}; 5277function $507fabe10e71c6fb$export$2f1888112f558a7d(element) { 5278 let documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element), loadListener; 5279 return documentObject.readyState !== "loading" ? $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) : (loadListener = () => { 5280 $507fabe10e71c6fb$var$setupGlobalFocusEvents(element); 5281 }, documentObject.addEventListener("DOMContentLoaded", loadListener)), () => $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener); 5282} 5283typeof document < "u" && $507fabe10e71c6fb$export$2f1888112f558a7d(); 5284function $507fabe10e71c6fb$export$b9b3dfddab17db27() { 5285 return $507fabe10e71c6fb$var$currentModality !== "pointer"; 5286} 5287function $507fabe10e71c6fb$export$630ff653c5ada6a9() { 5288 return $507fabe10e71c6fb$var$currentModality; 5289} 5290
vendor: 679 bytes, lines 5291-5301
5291// ../../node_modules/@react-aria/interactions/dist/focusSafely.mjs 5292function $3ad3f6e1647bc98d$export$80f3e147d781571c(element) { 5293 let ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(element), activeElement = $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument); 5294 if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "virtual") { 5295 let lastFocusedElement = activeElement; 5296 $bbed8b41f857bcc0$export$24490316f764c430(() => { 5297 $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument) === lastFocusedElement && element.isConnected && $7215afc6de606d6b$export$de79e2c695e052f3(element); 5298 }); 5299 } else $7215afc6de606d6b$export$de79e2c695e052f3(element); 5300} 5301
vendor: 1,237 bytes, lines 5302-5326
5302// ../../node_modules/@react-aria/interactions/dist/useFocus.mjs 5303init_react(); 5304function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) { 5305 let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props, onBlur = useCallback((e2) => { 5306 if (e2.target === e2.currentTarget) 5307 return onBlurProp && onBlurProp(e2), onFocusChange && onFocusChange(!1), !0; 5308 }, [ 5309 onBlurProp, 5310 onFocusChange 5311 ]), onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur), onFocus = useCallback((e2) => { 5312 let ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(e2.target), activeElement = ownerDocument ? $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument) : $d4ee10de306f2510$export$cd4e5573fbe2b576(); 5313 e2.target === e2.currentTarget && activeElement === $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent) && (onFocusProp && onFocusProp(e2), onFocusChange && onFocusChange(!0), onSyntheticFocus(e2)); 5314 }, [ 5315 onFocusChange, 5316 onFocusProp, 5317 onSyntheticFocus 5318 ]); 5319 return { 5320 focusProps: { 5321 onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0, 5322 onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0 5323 } 5324 }; 5325} 5326
vendor: 691 bytes, lines 5327-5353
5327// ../../node_modules/@react-aria/interactions/dist/createEventHandler.mjs 5328function $93925083ecbb358c$export$48d1ea6320830260(handler) { 5329 if (!handler) return; 5330 let shouldStopPropagation = !0; 5331 return (e2) => { 5332 let event = { 5333 ...e2, 5334 preventDefault() { 5335 e2.preventDefault(); 5336 }, 5337 isDefaultPrevented() { 5338 return e2.isDefaultPrevented(); 5339 }, 5340 stopPropagation() { 5341 shouldStopPropagation = !0; 5342 }, 5343 continuePropagation() { 5344 shouldStopPropagation = !1; 5345 }, 5346 isPropagationStopped() { 5347 return shouldStopPropagation; 5348 } 5349 }; 5350 handler(event), shouldStopPropagation && e2.stopPropagation(); 5351 }; 5352} 5353
vendor: 347 bytes, lines 5354-5363
5354// ../../node_modules/@react-aria/interactions/dist/useKeyboard.mjs 5355function $46d819fcbaf35654$export$8f71654801c2f7cd(props) { 5356 return { 5357 keyboardProps: props.isDisabled ? {} : { 5358 onKeyDown: $93925083ecbb358c$export$48d1ea6320830260(props.onKeyDown), 5359 onKeyUp: $93925083ecbb358c$export$48d1ea6320830260(props.onKeyUp) 5360 } 5361 }; 5362} 5363
vendor: 2,320 bytes, lines 5364-5412
5364// ../../node_modules/@react-aria/interactions/dist/useFocusable.mjs 5365init_react(); 5366var $f645667febf57a63$export$f9762fab77588ecb = react_default.createContext(null); 5367function $f645667febf57a63$var$useFocusableContext(ref) { 5368 let context = useContext($f645667febf57a63$export$f9762fab77588ecb) || {}; 5369 $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref); 5370 let { ref: _2, ...otherProps } = context; 5371 return otherProps; 5372} 5373var $f645667febf57a63$export$13f3202a3e5ddd5 = react_default.forwardRef(function(props, ref) { 5374 let { children, ...otherProps } = props, objRef = $df56164dff5785e2$export$4338b53315abf666(ref), context = { 5375 ...otherProps, 5376 ref: objRef 5377 }; 5378 return react_default.createElement($f645667febf57a63$export$f9762fab77588ecb.Provider, { 5379 value: context 5380 }, children); 5381}); 5382function $f645667febf57a63$export$4c014de7c8940b4c(props, domRef) { 5383 let { focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props), { keyboardProps } = $46d819fcbaf35654$export$8f71654801c2f7cd(props), interactions = $3ef42575df84b30b$export$9d1611c77c2fe928(focusProps, keyboardProps), domProps = $f645667febf57a63$var$useFocusableContext(domRef), interactionProps = props.isDisabled ? {} : domProps, autoFocusRef = useRef(props.autoFocus); 5384 useEffect(() => { 5385 autoFocusRef.current && domRef.current && $3ad3f6e1647bc98d$export$80f3e147d781571c(domRef.current), autoFocusRef.current = !1; 5386 }, [ 5387 domRef 5388 ]); 5389 let tabIndex = props.excludeFromTabOrder ? -1 : 0; 5390 return props.isDisabled && (tabIndex = void 0), { 5391 focusableProps: $3ef42575df84b30b$export$9d1611c77c2fe928({ 5392 ...interactions, 5393 tabIndex 5394 }, interactionProps) 5395 }; 5396} 5397var $f645667febf57a63$export$35a3bebf7ef2d934 = forwardRef(({ children, ...props }, ref) => { 5398 ref = $df56164dff5785e2$export$4338b53315abf666(ref); 5399 let { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref), child = react_default.Children.only(children); 5400 useEffect(() => { 5401 }, [ 5402 ref, 5403 props.isDisabled 5404 ]); 5405 let childRef = parseInt(react_default.version, 10) < 19 ? child.ref : child.props.ref; 5406 return react_default.cloneElement(child, { 5407 ...$3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, child.props), 5408 // @ts-ignore 5409 ref: $5dc95899b306f630$export$c9058316764c140e(childRef, ref) 5410 }); 5411}); 5412
vendor: 845 bytes, lines 5413-5433
5413// ../../node_modules/@react-aria/interactions/dist/Pressable.mjs 5414init_react(); 5415var $3b117e43dc0ca95d$export$27c701ed9e449e99 = react_default.forwardRef(({ children, ...props }, ref) => { 5416 ref = $df56164dff5785e2$export$4338b53315abf666(ref); 5417 let { pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({ 5418 ...props, 5419 ref 5420 }), { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref), child = react_default.Children.only(children); 5421 useEffect(() => { 5422 }, [ 5423 ref, 5424 props.isDisabled 5425 ]); 5426 let childRef = parseInt(react_default.version, 10) < 19 ? child.ref : child.props.ref; 5427 return react_default.cloneElement(child, { 5428 ...$3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, focusableProps, child.props), 5429 // @ts-ignore 5430 ref: $5dc95899b306f630$export$c9058316764c140e(childRef, ref) 5431 }); 5432}); 5433
vendor: 851 bytes, lines 5434-5452
5434// ../../node_modules/@react-aria/interactions/dist/PressResponder.mjs 5435init_react(); 5436var $f1ab8c75478c6f73$export$3351871ee4b288b8 = react_default.forwardRef(({ children, ...props }, ref) => { 5437 let isRegistered = useRef(!1), prevContext = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5); 5438 ref = $df56164dff5785e2$export$4338b53315abf666(ref || prevContext?.ref); 5439 let context = $3ef42575df84b30b$export$9d1611c77c2fe928(prevContext || {}, { 5440 ...props, 5441 ref, 5442 register() { 5443 isRegistered.current = !0, prevContext && prevContext.register(); 5444 } 5445 }); 5446 return $e7801be82b4b2a53$export$4debdb1a3f0fa79e(prevContext, ref), useEffect(() => { 5447 isRegistered.current || (isRegistered.current = !0); 5448 }, []), react_default.createElement($ae1eeba8b9eafd08$export$5165eccb35aaadb5.Provider, { 5449 value: context 5450 }, children); 5451}); 5452
vendor: 86 bytes, lines 5453-5455
5453// ../../node_modules/@react-aria/interactions/dist/useFocusWithin.mjs 5454init_react(); 5455
vendor: 3,554 bytes, lines 5456-5531
5456// ../../node_modules/@react-aria/interactions/dist/useHover.mjs 5457init_react(); 5458var $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = !1, $6179b936705e76d3$var$hoverCount = 0; 5459function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() { 5460 $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = !0, setTimeout(() => { 5461 $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = !1; 5462 }, 50); 5463} 5464function $6179b936705e76d3$var$handleGlobalPointerEvent(e2) { 5465 e2.pointerType === "touch" && $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents(); 5466} 5467function $6179b936705e76d3$var$setupGlobalTouchEvents() { 5468 if (!(typeof document > "u")) 5469 return $6179b936705e76d3$var$hoverCount === 0 && typeof PointerEvent < "u" && document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent), $6179b936705e76d3$var$hoverCount++, () => { 5470 $6179b936705e76d3$var$hoverCount--, !($6179b936705e76d3$var$hoverCount > 0) && typeof PointerEvent < "u" && document.removeEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent); 5471 }; 5472} 5473function $6179b936705e76d3$export$ae780daf29e6d456(props) { 5474 let { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props, [isHovered, setHovered] = useState(!1), state = useRef({ 5475 isHovered: !1, 5476 ignoreEmulatedMouseEvents: !1, 5477 pointerType: "", 5478 target: null 5479 }).current; 5480 useEffect($6179b936705e76d3$var$setupGlobalTouchEvents, []); 5481 let { addGlobalListener, removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6(), { hoverProps, triggerHoverEnd } = useMemo(() => { 5482 let triggerHoverStart = (event, pointerType) => { 5483 if (state.pointerType = pointerType, isDisabled || pointerType === "touch" || state.isHovered || !event.currentTarget.contains(event.target)) return; 5484 state.isHovered = !0; 5485 let target = event.currentTarget; 5486 state.target = target, addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(event.target), "pointerover", (e2) => { 5487 state.isHovered && state.target && !$d4ee10de306f2510$export$4282f70798064fe0(state.target, e2.target) && triggerHoverEnd2(e2, e2.pointerType); 5488 }, { 5489 capture: !0 5490 }), onHoverStart && onHoverStart({ 5491 type: "hoverstart", 5492 target, 5493 pointerType 5494 }), onHoverChange && onHoverChange(!0), setHovered(!0); 5495 }, triggerHoverEnd2 = (event, pointerType) => { 5496 let target = state.target; 5497 state.pointerType = "", state.target = null, !(pointerType === "touch" || !state.isHovered || !target) && (state.isHovered = !1, removeAllGlobalListeners(), onHoverEnd && onHoverEnd({ 5498 type: "hoverend", 5499 target, 5500 pointerType 5501 }), onHoverChange && onHoverChange(!1), setHovered(!1)); 5502 }, hoverProps2 = {}; 5503 return typeof PointerEvent < "u" && (hoverProps2.onPointerEnter = (e2) => { 5504 $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e2.pointerType === "mouse" || triggerHoverStart(e2, e2.pointerType); 5505 }, hoverProps2.onPointerLeave = (e2) => { 5506 !isDisabled && e2.currentTarget.contains(e2.target) && triggerHoverEnd2(e2, e2.pointerType); 5507 }), { 5508 hoverProps: hoverProps2, 5509 triggerHoverEnd: triggerHoverEnd2 5510 }; 5511 }, [ 5512 onHoverStart, 5513 onHoverChange, 5514 onHoverEnd, 5515 isDisabled, 5516 state, 5517 addGlobalListener, 5518 removeAllGlobalListeners 5519 ]); 5520 return useEffect(() => { 5521 isDisabled && triggerHoverEnd({ 5522 currentTarget: state.target 5523 }, state.pointerType); 5524 }, [ 5525 isDisabled 5526 ]), { 5527 hoverProps, 5528 isHovered 5529 }; 5530} 5531
vendor: 90 bytes, lines 5532-5534
5532// ../../node_modules/@react-aria/interactions/dist/useInteractOutside.mjs 5533init_react(); 5534
vendor: 79 bytes, lines 5535-5537
5535// ../../node_modules/@react-aria/interactions/dist/useMove.mjs 5536init_react(); 5537
vendor: 86 bytes, lines 5538-5540
5538// ../../node_modules/@react-aria/interactions/dist/useScrollWheel.mjs 5539init_react(); 5540
vendor: 84 bytes, lines 5541-5543
5541// ../../node_modules/@react-aria/interactions/dist/useLongPress.mjs 5542init_react(); 5543
vendor: 3,284 bytes, lines 5544-5625
5544// ../../node_modules/react-aria-components/dist/utils.mjs 5545init_react(); 5546var $64fa3d84918910a7$export$c62b8e45d58ddad9 = /* @__PURE__ */ Symbol("default"); 5547function $64fa3d84918910a7$export$2881499e37b75b9a({ values, children }) { 5548 for (let [Context2, value] of values) 5549 children = react_default.createElement(Context2.Provider, { 5550 value 5551 }, children); 5552 return children; 5553} 5554function $64fa3d84918910a7$export$4d86445c2cf5e3(props) { 5555 let { className, style, children, defaultClassName, defaultChildren, defaultStyle, values } = props; 5556 return useMemo(() => { 5557 let computedClassName, computedStyle, computedChildren; 5558 return typeof className == "function" ? computedClassName = className({ 5559 ...values, 5560 defaultClassName 5561 }) : computedClassName = className, typeof style == "function" ? computedStyle = style({ 5562 ...values, 5563 defaultStyle: defaultStyle || {} 5564 }) : computedStyle = style, typeof children == "function" ? computedChildren = children({ 5565 ...values, 5566 defaultChildren 5567 }) : children == null ? computedChildren = defaultChildren : computedChildren = children, { 5568 className: computedClassName ?? defaultClassName, 5569 style: computedStyle || defaultStyle ? { 5570 ...defaultStyle, 5571 ...computedStyle 5572 } : void 0, 5573 children: computedChildren ?? defaultChildren, 5574 "data-rac": "" 5575 }; 5576 }, [ 5577 className, 5578 style, 5579 children, 5580 defaultClassName, 5581 defaultChildren, 5582 defaultStyle, 5583 values 5584 ]); 5585} 5586function $64fa3d84918910a7$export$fabf2dc03a41866e(context, slot) { 5587 let ctx = useContext(context); 5588 if (slot === null) 5589 return null; 5590 if (ctx && typeof ctx == "object" && "slots" in ctx && ctx.slots) { 5591 let slotKey = slot || $64fa3d84918910a7$export$c62b8e45d58ddad9; 5592 if (!ctx.slots[slotKey]) { 5593 let availableSlots = new Intl.ListFormat().format(Object.keys(ctx.slots).map((p2) => `"${p2}"`)), errorMessage = slot ? `Invalid slot "${slot}".` : "A slot prop is required."; 5594 throw new Error(`${errorMessage} Valid slot names are ${availableSlots}.`); 5595 } 5596 return ctx.slots[slotKey]; 5597 } 5598 return ctx; 5599} 5600function $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, context) { 5601 let ctx = $64fa3d84918910a7$export$fabf2dc03a41866e(context, props.slot) || {}, { ref: contextRef, ...contextProps } = ctx, mergedRef = $df56164dff5785e2$export$4338b53315abf666(useMemo(() => $5dc95899b306f630$export$c9058316764c140e(ref, contextRef), [ 5602 ref, 5603 contextRef 5604 ])), mergedProps = $3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props); 5605 return "style" in contextProps && contextProps.style && "style" in props && props.style && (typeof contextProps.style == "function" || typeof props.style == "function" ? mergedProps.style = (renderProps) => { 5606 let contextStyle = typeof contextProps.style == "function" ? contextProps.style(renderProps) : contextProps.style, defaultStyle = { 5607 ...renderProps.defaultStyle, 5608 ...contextStyle 5609 }, style = typeof props.style == "function" ? props.style({ 5610 ...renderProps, 5611 defaultStyle 5612 }) : props.style; 5613 return { 5614 ...defaultStyle, 5615 ...style 5616 }; 5617 } : mergedProps.style = { 5618 ...contextProps.style, 5619 ...props.style 5620 }), [ 5621 mergedProps, 5622 mergedRef 5623 ]; 5624} 5625
vendor: 1,165 bytes, lines 5626-5657
5626// ../../node_modules/react-aria-components/dist/OverlayArrow.mjs 5627init_react(); 5628var $44f671af83e7d9e0$export$2de4954e8ae13b9f = createContext({ 5629 placement: "bottom" 5630}), $44f671af83e7d9e0$export$746d02f47f4d381 = forwardRef(function(props, ref) { 5631 [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $44f671af83e7d9e0$export$2de4954e8ae13b9f); 5632 let placement = props.placement, style = { 5633 position: "absolute", 5634 transform: placement === "top" || placement === "bottom" ? "translateX(-50%)" : "translateY(-50%)" 5635 }; 5636 placement != null && (style[placement] = "100%"); 5637 let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({ 5638 ...props, 5639 defaultClassName: "react-aria-OverlayArrow", 5640 values: { 5641 placement 5642 } 5643 }); 5644 renderProps.style && Object.keys(renderProps.style).forEach((key) => renderProps.style[key] === void 0 && delete renderProps.style[key]); 5645 let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props); 5646 return react_default.createElement("div", { 5647 ...DOMProps, 5648 ...renderProps, 5649 style: { 5650 ...style, 5651 ...renderProps.style 5652 }, 5653 ref, 5654 "data-placement": placement 5655 }); 5656}); 5657
vendor: 498 bytes, lines 5658-5672
5658// ../../node_modules/@react-aria/tooltip/dist/useTooltip.mjs 5659function $326e436e94273fe1$export$1c4b08e0eca38426(props, state) { 5660 let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, { 5661 labelable: !0 5662 }), { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({ 5663 onHoverStart: () => state?.open(!0), 5664 onHoverEnd: () => state?.close() 5665 }); 5666 return { 5667 tooltipProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, hoverProps, { 5668 role: "tooltip" 5669 }) 5670 }; 5671} 5672
vendor: 2,032 bytes, lines 5673-5726
5673// ../../node_modules/@react-aria/tooltip/dist/useTooltipTrigger.mjs 5674init_react(); 5675function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) { 5676 let { isDisabled, trigger } = props, tooltipId = $bdb11010cef70236$export$f680877a34711e37(), isHovered = useRef(!1), isFocused = useRef(!1), handleShow = () => { 5677 (isHovered.current || isFocused.current) && state.open(isFocused.current); 5678 }, handleHide = (immediate) => { 5679 !isHovered.current && !isFocused.current && state.close(immediate); 5680 }; 5681 useEffect(() => { 5682 let onKeyDown = (e2) => { 5683 ref && ref.current && e2.key === "Escape" && (e2.stopPropagation(), state.close(!0)); 5684 }; 5685 if (state.isOpen) 5686 return document.addEventListener("keydown", onKeyDown, !0), () => { 5687 document.removeEventListener("keydown", onKeyDown, !0); 5688 }; 5689 }, [ 5690 ref, 5691 state 5692 ]); 5693 let onHoverStart = () => { 5694 trigger !== "focus" && ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "pointer" ? isHovered.current = !0 : isHovered.current = !1, handleShow()); 5695 }, onHoverEnd = () => { 5696 trigger !== "focus" && (isFocused.current = !1, isHovered.current = !1, handleHide()); 5697 }, onPressStart = () => { 5698 isFocused.current = !1, isHovered.current = !1, handleHide(!0); 5699 }, onFocus = () => { 5700 $507fabe10e71c6fb$export$b9b3dfddab17db27() && (isFocused.current = !0, handleShow()); 5701 }, onBlur = () => { 5702 isFocused.current = !1, isHovered.current = !1, handleHide(!0); 5703 }, { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({ 5704 isDisabled, 5705 onHoverStart, 5706 onHoverEnd 5707 }), { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c({ 5708 isDisabled, 5709 onFocus, 5710 onBlur 5711 }, ref); 5712 return { 5713 triggerProps: { 5714 "aria-describedby": state.isOpen ? tooltipId : void 0, 5715 ...$3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, hoverProps, { 5716 onPointerDown: onPressStart, 5717 onKeyDown: onPressStart 5718 }), 5719 tabIndex: void 0 5720 }, 5721 tooltipProps: { 5722 id: tooltipId 5723 } 5724 }; 5725} 5726
vendor: 20,007 bytes, lines 5727-5926
5727// ../../node_modules/@react-aria/overlays/dist/calculatePosition.mjs 5728var $edcf132a9284368a$var$AXIS = { 5729 top: "top", 5730 bottom: "top", 5731 left: "left", 5732 right: "left" 5733}, $edcf132a9284368a$var$FLIPPED_DIRECTION = { 5734 top: "bottom", 5735 bottom: "top", 5736 left: "right", 5737 right: "left" 5738}, $edcf132a9284368a$var$CROSS_AXIS = { 5739 top: "left", 5740 left: "top" 5741}, $edcf132a9284368a$var$AXIS_SIZE = { 5742 top: "height", 5743 left: "width" 5744}, $edcf132a9284368a$var$TOTAL_SIZE = { 5745 width: "totalWidth", 5746 height: "totalHeight" 5747}, $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {}, $edcf132a9284368a$var$visualViewport = typeof document < "u" ? window.visualViewport : null; 5748function $edcf132a9284368a$var$getContainerDimensions(containerNode) { 5749 let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0, scroll2 = {}; 5750 var _visualViewport_scale; 5751 let isPinchZoomedIn = ((_visualViewport_scale = $edcf132a9284368a$var$visualViewport?.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1; 5752 if (containerNode.tagName === "BODY") { 5753 let documentElement = document.documentElement; 5754 totalWidth = documentElement.clientWidth, totalHeight = documentElement.clientHeight; 5755 var _visualViewport_width; 5756 width = (_visualViewport_width = $edcf132a9284368a$var$visualViewport?.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth; 5757 var _visualViewport_height; 5758 height = (_visualViewport_height = $edcf132a9284368a$var$visualViewport?.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight, scroll2.top = documentElement.scrollTop || containerNode.scrollTop, scroll2.left = documentElement.scrollLeft || containerNode.scrollLeft, $edcf132a9284368a$var$visualViewport && (top = $edcf132a9284368a$var$visualViewport.offsetTop, left = $edcf132a9284368a$var$visualViewport.offsetLeft); 5759 } else 5760 ({ width, height, top, left } = $edcf132a9284368a$var$getOffset(containerNode, !1)), scroll2.top = containerNode.scrollTop, scroll2.left = containerNode.scrollLeft, totalWidth = width, totalHeight = height; 5761 if ($c87311424ea30a05$export$78551043582a6a98() && (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") && isPinchZoomedIn) { 5762 scroll2.top = 0, scroll2.left = 0; 5763 var _visualViewport_pageTop; 5764 top = (_visualViewport_pageTop = $edcf132a9284368a$var$visualViewport?.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0; 5765 var _visualViewport_pageLeft; 5766 left = (_visualViewport_pageLeft = $edcf132a9284368a$var$visualViewport?.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0; 5767 } 5768 return { 5769 width, 5770 height, 5771 totalWidth, 5772 totalHeight, 5773 scroll: scroll2, 5774 top, 5775 left 5776 }; 5777} 5778function $edcf132a9284368a$var$getScroll(node) { 5779 return { 5780 top: node.scrollTop, 5781 left: node.scrollLeft, 5782 width: node.scrollWidth, 5783 height: node.scrollHeight 5784 }; 5785} 5786function $edcf132a9284368a$var$getDelta(axis, offset2, size, boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary) { 5787 var _containerDimensions_scroll_axis; 5788 let containerScroll = (_containerDimensions_scroll_axis = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis !== void 0 ? _containerDimensions_scroll_axis : 0, boundarySize = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]], boundaryStartEdge = boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding, boundaryEndEdge = boundarySize + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] - padding, startEdgeOffset = offset2 - containerScroll + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]], endEdgeOffset = offset2 - containerScroll + size + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]]; 5789 return startEdgeOffset < boundaryStartEdge ? boundaryStartEdge - startEdgeOffset : endEdgeOffset > boundaryEndEdge ? Math.max(boundaryEndEdge - endEdgeOffset, boundaryStartEdge - startEdgeOffset) : 0; 5790} 5791function $edcf132a9284368a$var$getMargins(node) { 5792 let style = window.getComputedStyle(node); 5793 return { 5794 top: parseInt(style.marginTop, 10) || 0, 5795 bottom: parseInt(style.marginBottom, 10) || 0, 5796 left: parseInt(style.marginLeft, 10) || 0, 5797 right: parseInt(style.marginRight, 10) || 0 5798 }; 5799} 5800function $edcf132a9284368a$var$parsePlacement(input) { 5801 if ($edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input]) return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input]; 5802 let [placement, crossPlacement] = input.split(" "), axis = $edcf132a9284368a$var$AXIS[placement] || "right", crossAxis = $edcf132a9284368a$var$CROSS_AXIS[axis]; 5803 $edcf132a9284368a$var$AXIS[crossPlacement] || (crossPlacement = "center"); 5804 let size = $edcf132a9284368a$var$AXIS_SIZE[axis], crossSize = $edcf132a9284368a$var$AXIS_SIZE[crossAxis]; 5805 return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input] = { 5806 placement, 5807 crossPlacement, 5808 axis, 5809 crossAxis, 5810 size, 5811 crossSize 5812 }, $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input]; 5813} 5814function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset2, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) { 5815 let { placement, crossPlacement, axis, crossAxis, size, crossSize } = placementInfo, position = {}; 5816 var _childOffset_crossAxis; 5817 position[crossAxis] = (_childOffset_crossAxis = childOffset[crossAxis]) !== null && _childOffset_crossAxis !== void 0 ? _childOffset_crossAxis : 0; 5818 var _childOffset_crossSize, _overlaySize_crossSize, _childOffset_crossSize1, _overlaySize_crossSize1; 5819 crossPlacement === "center" ? position[crossAxis] += (((_childOffset_crossSize = childOffset[crossSize]) !== null && _childOffset_crossSize !== void 0 ? _childOffset_crossSize : 0) - ((_overlaySize_crossSize = overlaySize[crossSize]) !== null && _overlaySize_crossSize !== void 0 ? _overlaySize_crossSize : 0)) / 2 : crossPlacement !== crossAxis && (position[crossAxis] += ((_childOffset_crossSize1 = childOffset[crossSize]) !== null && _childOffset_crossSize1 !== void 0 ? _childOffset_crossSize1 : 0) - ((_overlaySize_crossSize1 = overlaySize[crossSize]) !== null && _overlaySize_crossSize1 !== void 0 ? _overlaySize_crossSize1 : 0)), position[crossAxis] += crossOffset; 5820 let minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset, maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset; 5821 if (position[crossAxis] = $9446cca9a3875146$export$7d15b64cf5a3a4c4(position[crossAxis], minPosition, maxPosition), placement === axis) { 5822 let containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]]; 5823 position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset2); 5824 } else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset2); 5825 return position; 5826} 5827function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) { 5828 let containerHeight = isContainerPositioned ? containerOffsetWithBoundary.height : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE.height]; 5829 var _position_bottom; 5830 let overlayTop = position.top != null ? containerOffsetWithBoundary.top + position.top : containerOffsetWithBoundary.top + (containerHeight - ((_position_bottom = position.bottom) !== null && _position_bottom !== void 0 ? _position_bottom : 0) - overlayHeight); 5831 var _boundaryDimensions_scroll_top, _margins_top, _margins_bottom, _boundaryDimensions_scroll_top1, _margins_top1, _margins_bottom1; 5832 let maxHeight = heightGrowthDirection !== "top" ? ( 5833 // We want the distance between the top of the overlay to the bottom of the boundary 5834 Math.max(0, boundaryDimensions.height + boundaryDimensions.top + ((_boundaryDimensions_scroll_top = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top !== void 0 ? _boundaryDimensions_scroll_top : 0) - overlayTop - (((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0) + padding)) 5835 ) : Math.max(0, overlayTop + overlayHeight - (boundaryDimensions.top + ((_boundaryDimensions_scroll_top1 = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top1 !== void 0 ? _boundaryDimensions_scroll_top1 : 0)) - (((_margins_top1 = margins.top) !== null && _margins_top1 !== void 0 ? _margins_top1 : 0) + ((_margins_bottom1 = margins.bottom) !== null && _margins_bottom1 !== void 0 ? _margins_bottom1 : 0) + padding)); 5836 return Math.min(boundaryDimensions.height - padding * 2, maxHeight); 5837} 5838function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) { 5839 let { placement, axis, size } = placementInfo; 5840 var _boundaryDimensions_scroll_axis, _margins_axis; 5841 if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - ((_boundaryDimensions_scroll_axis = boundaryDimensions.scroll[axis]) !== null && _boundaryDimensions_scroll_axis !== void 0 ? _boundaryDimensions_scroll_axis : 0) + containerOffsetWithBoundary[axis] - ((_margins_axis = margins[axis]) !== null && _margins_axis !== void 0 ? _margins_axis : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding); 5842 var _margins_axis1; 5843 return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - ((_margins_axis1 = margins[axis]) !== null && _margins_axis1 !== void 0 ? _margins_axis1 : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding); 5844} 5845function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip2, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset2, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) { 5846 let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput), { size, crossAxis, crossSize, placement, crossPlacement } = placementInfo, position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset2, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset), normalizedOffset = offset2, space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset2, placementInfo); 5847 if (flip2 && scrollSize[size] > space) { 5848 let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`), flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset2, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset); 5849 $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset2, flippedPlacementInfo) > space && (placementInfo = flippedPlacementInfo, position = flippedPosition, normalizedOffset = offset2); 5850 } 5851 let heightGrowthDirection = "bottom"; 5852 placementInfo.axis === "top" ? placementInfo.placement === "top" ? heightGrowthDirection = "top" : placementInfo.placement === "bottom" && (heightGrowthDirection = "bottom") : placementInfo.crossAxis === "top" && (placementInfo.crossPlacement === "top" ? heightGrowthDirection = "bottom" : placementInfo.crossPlacement === "bottom" && (heightGrowthDirection = "top")); 5853 let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary); 5854 position[crossAxis] += delta; 5855 let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection); 5856 userSetMaxHeight && userSetMaxHeight < maxHeight && (maxHeight = userSetMaxHeight), overlaySize.height = Math.min(overlaySize.height, maxHeight), position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset), delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary), position[crossAxis] += delta; 5857 let arrowPosition = {}, origin = childOffset[crossAxis] - position[crossAxis] - margins[$edcf132a9284368a$var$AXIS[crossAxis]], preferredArrowPosition = origin + 0.5 * childOffset[crossSize], arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset; 5858 var _margins_left, _margins_right, _margins_top, _margins_bottom; 5859 let overlayMargin = $edcf132a9284368a$var$AXIS[crossAxis] === "left" ? ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0) : ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0), arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset, arrowOverlappingChildMinEdge = childOffset[crossAxis] + arrowSize / 2 - (position[crossAxis] + margins[$edcf132a9284368a$var$AXIS[crossAxis]]), arrowOverlappingChildMaxEdge = childOffset[crossAxis] + childOffset[crossSize] - arrowSize / 2 - (position[crossAxis] + margins[$edcf132a9284368a$var$AXIS[crossAxis]]), arrowPositionOverlappingChild = $9446cca9a3875146$export$7d15b64cf5a3a4c4(preferredArrowPosition, arrowOverlappingChildMinEdge, arrowOverlappingChildMaxEdge); 5860 arrowPosition[crossAxis] = $9446cca9a3875146$export$7d15b64cf5a3a4c4(arrowPositionOverlappingChild, arrowMinPosition, arrowMaxPosition), { placement, crossPlacement } = placementInfo, arrowSize ? origin = arrowPosition[crossAxis] : crossPlacement === "right" ? origin += childOffset[crossSize] : crossPlacement === "center" && (origin += childOffset[crossSize] / 2); 5861 let crossOrigin = placement === "left" || placement === "top" ? overlaySize[size] : 0, triggerAnchorPoint = { 5862 x: placement === "top" || placement === "bottom" ? origin : crossOrigin, 5863 y: placement === "left" || placement === "right" ? origin : crossOrigin 5864 }; 5865 return { 5866 position, 5867 maxHeight, 5868 arrowOffsetLeft: arrowPosition.left, 5869 arrowOffsetTop: arrowPosition.top, 5870 placement, 5871 triggerAnchorPoint 5872 }; 5873} 5874function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) { 5875 let { placement, targetNode, overlayNode, scrollNode, padding, shouldFlip, boundaryElement, offset: offset2, crossOffset, maxHeight, arrowSize = 0, arrowBoundaryOffset = 0 } = opts, container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement, isViewportContainer = container === document.documentElement, containerPositionStyle = window.getComputedStyle(container).position, isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static", childOffset = isViewportContainer ? $edcf132a9284368a$var$getOffset(targetNode, !1) : $edcf132a9284368a$var$getPosition(targetNode, container, !1); 5876 if (!isViewportContainer) { 5877 let { marginTop, marginLeft } = window.getComputedStyle(targetNode); 5878 childOffset.top += parseInt(marginTop, 10) || 0, childOffset.left += parseInt(marginLeft, 10) || 0; 5879 } 5880 let overlaySize = $edcf132a9284368a$var$getOffset(overlayNode, !0), margins = $edcf132a9284368a$var$getMargins(overlayNode); 5881 var _margins_left, _margins_right; 5882 overlaySize.width += ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0); 5883 var _margins_top, _margins_bottom; 5884 overlaySize.height += ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0); 5885 let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode), boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement), containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container), containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $edcf132a9284368a$var$getOffset(container, !1) : $edcf132a9284368a$var$getPosition(container, boundaryElement, !1); 5886 return container.tagName === "HTML" && boundaryElement.tagName === "BODY" && (containerDimensions.scroll.top = 0, containerDimensions.scroll.left = 0), $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset2, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset); 5887} 5888function $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale) { 5889 let { top, left, width, height } = node.getBoundingClientRect(); 5890 return ignoreScale && node instanceof node.ownerDocument.defaultView.HTMLElement && (width = node.offsetWidth, height = node.offsetHeight), { 5891 top, 5892 left, 5893 width, 5894 height 5895 }; 5896} 5897function $edcf132a9284368a$var$getOffset(node, ignoreScale) { 5898 let { top, left, width, height } = $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale), { scrollTop, scrollLeft, clientTop, clientLeft } = document.documentElement; 5899 return { 5900 top: top + scrollTop - clientTop, 5901 left: left + scrollLeft - clientLeft, 5902 width, 5903 height 5904 }; 5905} 5906function $edcf132a9284368a$var$getPosition(node, parent, ignoreScale) { 5907 let style = window.getComputedStyle(node), offset2; 5908 if (style.position === "fixed") offset2 = $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale); 5909 else { 5910 offset2 = $edcf132a9284368a$var$getOffset(node, ignoreScale); 5911 let parentOffset = $edcf132a9284368a$var$getOffset(parent, ignoreScale), parentStyle = window.getComputedStyle(parent); 5912 parentOffset.top += (parseInt(parentStyle.borderTopWidth, 10) || 0) - parent.scrollTop, parentOffset.left += (parseInt(parentStyle.borderLeftWidth, 10) || 0) - parent.scrollLeft, offset2.top -= parentOffset.top, offset2.left -= parentOffset.left; 5913 } 5914 return offset2.top -= parseInt(style.marginTop, 10) || 0, offset2.left -= parseInt(style.marginLeft, 10) || 0, offset2; 5915} 5916function $edcf132a9284368a$var$getContainingBlock(node) { 5917 let offsetParent = node.offsetParent; 5918 if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !$edcf132a9284368a$var$isContainingBlock(offsetParent) && (offsetParent = document.documentElement), offsetParent == null) 5919 for (offsetParent = node.parentElement; offsetParent && !$edcf132a9284368a$var$isContainingBlock(offsetParent); ) offsetParent = offsetParent.parentElement; 5920 return offsetParent || document.documentElement; 5921} 5922function $edcf132a9284368a$var$isContainingBlock(node) { 5923 let style = window.getComputedStyle(node); 5924 return style.transform !== "none" || /transform|perspective/.test(style.willChange) || style.filter !== "none" || style.contain === "paint" || "backdropFilter" in style && style.backdropFilter !== "none" || "WebkitBackdropFilter" in style && style.WebkitBackdropFilter !== "none"; 5925} 5926
vendor: 924 bytes, lines 5927-5949
5927// ../../node_modules/@react-aria/overlays/dist/useCloseOnScroll.mjs 5928init_react(); 5929var $dd149f63282afbbf$export$f6211563215e3b37 = /* @__PURE__ */ new WeakMap(); 5930function $dd149f63282afbbf$export$18fc8428861184da(opts) { 5931 let { triggerRef, isOpen, onClose } = opts; 5932 useEffect(() => { 5933 if (!isOpen || onClose === null) return; 5934 let onScroll = (e2) => { 5935 let target = e2.target; 5936 if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current) || e2.target instanceof HTMLInputElement || e2.target instanceof HTMLTextAreaElement) return; 5937 let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current); 5938 onCloseHandler && onCloseHandler(); 5939 }; 5940 return window.addEventListener("scroll", onScroll, !0), () => { 5941 window.removeEventListener("scroll", onScroll, !0); 5942 }; 5943 }, [ 5944 isOpen, 5945 onClose, 5946 triggerRef 5947 ]); 5948} 5949
vendor: 86 bytes, lines 5950-5952
5950// ../../node_modules/@react-aria/overlays/dist/useOverlayPosition.mjs 5951init_react(); 5952
vendor: 925 bytes, lines 5953-5995
5953// ../../node_modules/@react-aria/i18n/dist/utils.mjs 5954var $148a7a147e38ea7f$var$RTL_SCRIPTS = /* @__PURE__ */ new Set([ 5955 "Arab", 5956 "Syrc", 5957 "Samr", 5958 "Mand", 5959 "Thaa", 5960 "Mend", 5961 "Nkoo", 5962 "Adlm", 5963 "Rohg", 5964 "Hebr" 5965]), $148a7a147e38ea7f$var$RTL_LANGS = /* @__PURE__ */ new Set([ 5966 "ae", 5967 "ar", 5968 "arc", 5969 "bcc", 5970 "bqi", 5971 "ckb", 5972 "dv", 5973 "fa", 5974 "glk", 5975 "he", 5976 "ku", 5977 "mzn", 5978 "nqo", 5979 "pnb", 5980 "ps", 5981 "sd", 5982 "ug", 5983 "ur", 5984 "yi" 5985]); 5986function $148a7a147e38ea7f$export$702d680b21cbd764(localeString) { 5987 if (Intl.Locale) { 5988 let locale = new Intl.Locale(localeString).maximize(), textInfo = typeof locale.getTextInfo == "function" ? locale.getTextInfo() : locale.textInfo; 5989 if (textInfo) return textInfo.direction === "rtl"; 5990 if (locale.script) return $148a7a147e38ea7f$var$RTL_SCRIPTS.has(locale.script); 5991 } 5992 let lang = localeString.split("-")[0]; 5993 return $148a7a147e38ea7f$var$RTL_LANGS.has(lang); 5994} 5995
vendor: 1,697 bytes, lines 5996-6027
5996// ../../node_modules/@react-aria/i18n/dist/useDefaultLocale.mjs 5997init_react(); 5998var $1e5a04cdaf7d1af8$var$localeSymbol = /* @__PURE__ */ Symbol.for("react-aria.i18n.locale"); 5999function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() { 6000 let locale = typeof window < "u" && window[$1e5a04cdaf7d1af8$var$localeSymbol] || typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US"; 6001 try { 6002 Intl.DateTimeFormat.supportedLocalesOf([ 6003 locale 6004 ]); 6005 } catch { 6006 locale = "en-US"; 6007 } 6008 return { 6009 locale, 6010 direction: $148a7a147e38ea7f$export$702d680b21cbd764(locale) ? "rtl" : "ltr" 6011 }; 6012} 6013var $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5(), $1e5a04cdaf7d1af8$var$listeners = /* @__PURE__ */ new Set(); 6014function $1e5a04cdaf7d1af8$var$updateLocale() { 6015 $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5(); 6016 for (let listener of $1e5a04cdaf7d1af8$var$listeners) listener($1e5a04cdaf7d1af8$var$currentLocale); 6017} 6018function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() { 6019 let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273(), [defaultLocale2, setDefaultLocale] = useState($1e5a04cdaf7d1af8$var$currentLocale); 6020 return useEffect(() => ($1e5a04cdaf7d1af8$var$listeners.size === 0 && window.addEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale), $1e5a04cdaf7d1af8$var$listeners.add(setDefaultLocale), () => { 6021 $1e5a04cdaf7d1af8$var$listeners.delete(setDefaultLocale), $1e5a04cdaf7d1af8$var$listeners.size === 0 && window.removeEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale); 6022 }), []), isSSR ? { 6023 locale: "en-US", 6024 direction: "ltr" 6025 } : defaultLocale2; 6026} 6027
vendor: 345 bytes, lines 6028-6035
6028// ../../node_modules/@react-aria/i18n/dist/context.mjs 6029init_react(); 6030var $18f2051aff69b9bf$var$I18nContext = react_default.createContext(null); 6031function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() { 6032 let defaultLocale2 = $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a(); 6033 return useContext($18f2051aff69b9bf$var$I18nContext) || defaultLocale2; 6034} 6035
vendor: 1,758 bytes, lines 6036-6075
6036// ../../node_modules/tslib/tslib.es6.mjs 6037var extendStatics = function(d2, b2) { 6038 return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) { 6039 d3.__proto__ = b3; 6040 } || function(d3, b3) { 6041 for (var p2 in b3) Object.prototype.hasOwnProperty.call(b3, p2) && (d3[p2] = b3[p2]); 6042 }, extendStatics(d2, b2); 6043}; 6044function __extends(d2, b2) { 6045 if (typeof b2 != "function" && b2 !== null) 6046 throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null"); 6047 extendStatics(d2, b2); 6048 function __() { 6049 this.constructor = d2; 6050 } 6051 d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __()); 6052} 6053var __assign = function() { 6054 return __assign = Object.assign || function(t2) { 6055 for (var s2, i2 = 1, n3 = arguments.length; i2 < n3; i2++) { 6056 s2 = arguments[i2]; 6057 for (var p2 in s2) Object.prototype.hasOwnProperty.call(s2, p2) && (t2[p2] = s2[p2]); 6058 } 6059 return t2; 6060 }, __assign.apply(this, arguments); 6061}; 6062function __rest(s2, e2) { 6063 var t2 = {}; 6064 for (var p2 in s2) Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0 && (t2[p2] = s2[p2]); 6065 if (s2 != null && typeof Object.getOwnPropertySymbols == "function") 6066 for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) 6067 e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2]) && (t2[p2[i2]] = s2[p2[i2]]); 6068 return t2; 6069} 6070function __spreadArray(to, from, pack) { 6071 if (pack || arguments.length === 2) for (var i2 = 0, l3 = from.length, ar; i2 < l3; i2++) 6072 (ar || !(i2 in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i2)), ar[i2] = from[i2]); 6073 return to.concat(ar || Array.prototype.slice.call(from)); 6074} 6075
vendor: 2,304 bytes, lines 6076-6130
6076// ../../node_modules/@formatjs/fast-memoize/lib/index.js 6077function memoize(fn, options2) { 6078 var cache = options2 && options2.cache ? options2.cache : cacheDefault, serializer = options2 && options2.serializer ? options2.serializer : serializerDefault, strategy = options2 && options2.strategy ? options2.strategy : strategyDefault; 6079 return strategy(fn, { 6080 cache, 6081 serializer 6082 }); 6083} 6084function isPrimitive2(value) { 6085 return value == null || typeof value == "number" || typeof value == "boolean"; 6086} 6087function monadic(fn, cache, serializer, arg) { 6088 var cacheKey = isPrimitive2(arg) ? arg : serializer(arg), computedValue = cache.get(cacheKey); 6089 return typeof computedValue > "u" && (computedValue = fn.call(this, arg), cache.set(cacheKey, computedValue)), computedValue; 6090} 6091function variadic(fn, cache, serializer) { 6092 var args = Array.prototype.slice.call(arguments, 3), cacheKey = serializer(args), computedValue = cache.get(cacheKey); 6093 return typeof computedValue > "u" && (computedValue = fn.apply(this, args), cache.set(cacheKey, computedValue)), computedValue; 6094} 6095function assemble(fn, context, strategy, cache, serialize) { 6096 return strategy.bind(context, fn, cache, serialize); 6097} 6098function strategyDefault(fn, options2) { 6099 var strategy = fn.length === 1 ? monadic : variadic; 6100 return assemble(fn, this, strategy, options2.cache.create(), options2.serializer); 6101} 6102function strategyVariadic(fn, options2) { 6103 return assemble(fn, this, variadic, options2.cache.create(), options2.serializer); 6104} 6105function strategyMonadic(fn, options2) { 6106 return assemble(fn, this, monadic, options2.cache.create(), options2.serializer); 6107} 6108var serializerDefault = function() { 6109 return JSON.stringify(arguments); 6110}, ObjectWithoutPrototypeCache = ( 6111 /** @class */ 6112 (function() { 6113 function ObjectWithoutPrototypeCache2() { 6114 this.cache = /* @__PURE__ */ Object.create(null); 6115 } 6116 return ObjectWithoutPrototypeCache2.prototype.get = function(key) { 6117 return this.cache[key]; 6118 }, ObjectWithoutPrototypeCache2.prototype.set = function(key, value) { 6119 this.cache[key] = value; 6120 }, ObjectWithoutPrototypeCache2; 6121 })() 6122), cacheDefault = { 6123 create: function() { 6124 return new ObjectWithoutPrototypeCache(); 6125 } 6126}, strategies = { 6127 variadic: strategyVariadic, 6128 monadic: strategyMonadic 6129}; 6130
vendor: 2,396 bytes, lines 6131-6136
6131// ../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js 6132var ErrorKind; 6133(function(ErrorKind2) { 6134 ErrorKind2[ErrorKind2.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", ErrorKind2[ErrorKind2.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", ErrorKind2[ErrorKind2.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", ErrorKind2[ErrorKind2.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", ErrorKind2[ErrorKind2.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", ErrorKind2[ErrorKind2.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", ErrorKind2[ErrorKind2.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", ErrorKind2[ErrorKind2.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", ErrorKind2[ErrorKind2.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", ErrorKind2[ErrorKind2.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", ErrorKind2[ErrorKind2.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", ErrorKind2[ErrorKind2.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", ErrorKind2[ErrorKind2.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", ErrorKind2[ErrorKind2.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", ErrorKind2[ErrorKind2.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", ErrorKind2[ErrorKind2.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", ErrorKind2[ErrorKind2.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", ErrorKind2[ErrorKind2.INVALID_TAG = 23] = "INVALID_TAG", ErrorKind2[ErrorKind2.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", ErrorKind2[ErrorKind2.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", ErrorKind2[ErrorKind2.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; 6135})(ErrorKind || (ErrorKind = {})); 6136
vendor: 1,466 bytes, lines 6137-6179
6137// ../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js 6138var TYPE; 6139(function(TYPE2) { 6140 TYPE2[TYPE2.literal = 0] = "literal", TYPE2[TYPE2.argument = 1] = "argument", TYPE2[TYPE2.number = 2] = "number", TYPE2[TYPE2.date = 3] = "date", TYPE2[TYPE2.time = 4] = "time", TYPE2[TYPE2.select = 5] = "select", TYPE2[TYPE2.plural = 6] = "plural", TYPE2[TYPE2.pound = 7] = "pound", TYPE2[TYPE2.tag = 8] = "tag"; 6141})(TYPE || (TYPE = {})); 6142var SKELETON_TYPE; 6143(function(SKELETON_TYPE2) { 6144 SKELETON_TYPE2[SKELETON_TYPE2.number = 0] = "number", SKELETON_TYPE2[SKELETON_TYPE2.dateTime = 1] = "dateTime"; 6145})(SKELETON_TYPE || (SKELETON_TYPE = {})); 6146function isLiteralElement(el) { 6147 return el.type === TYPE.literal; 6148} 6149function isArgumentElement(el) { 6150 return el.type === TYPE.argument; 6151} 6152function isNumberElement(el) { 6153 return el.type === TYPE.number; 6154} 6155function isDateElement(el) { 6156 return el.type === TYPE.date; 6157} 6158function isTimeElement(el) { 6159 return el.type === TYPE.time; 6160} 6161function isSelectElement(el) { 6162 return el.type === TYPE.select; 6163} 6164function isPluralElement(el) { 6165 return el.type === TYPE.plural; 6166} 6167function isPoundElement(el) { 6168 return el.type === TYPE.pound; 6169} 6170function isTagElement(el) { 6171 return el.type === TYPE.tag; 6172} 6173function isNumberSkeleton(el) { 6174 return !!(el && typeof el == "object" && el.type === SKELETON_TYPE.number); 6175} 6176function isDateTimeSkeleton(el) { 6177 return !!(el && typeof el == "object" && el.type === SKELETON_TYPE.dateTime); 6178} 6179
vendor: 157 bytes, lines 6180-6182
6180// ../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js 6181var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; 6182
vendor: 3,704 bytes, lines 6183-6293
6183// ../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js 6184var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; 6185function parseDateTimeSkeleton(skeleton) { 6186 var result = {}; 6187 return skeleton.replace(DATE_TIME_REGEX, function(match) { 6188 var len = match.length; 6189 switch (match[0]) { 6190 // Era 6191 case "G": 6192 result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short"; 6193 break; 6194 // Year 6195 case "y": 6196 result.year = len === 2 ? "2-digit" : "numeric"; 6197 break; 6198 case "Y": 6199 case "u": 6200 case "U": 6201 case "r": 6202 throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead"); 6203 // Quarter 6204 case "q": 6205 case "Q": 6206 throw new RangeError("`q/Q` (quarter) patterns are not supported"); 6207 // Month 6208 case "M": 6209 case "L": 6210 result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1]; 6211 break; 6212 // Week 6213 case "w": 6214 case "W": 6215 throw new RangeError("`w/W` (week) patterns are not supported"); 6216 case "d": 6217 result.day = ["numeric", "2-digit"][len - 1]; 6218 break; 6219 case "D": 6220 case "F": 6221 case "g": 6222 throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); 6223 // Weekday 6224 case "E": 6225 result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short"; 6226 break; 6227 case "e": 6228 if (len < 4) 6229 throw new RangeError("`e..eee` (weekday) patterns are not supported"); 6230 result.weekday = ["short", "long", "narrow", "short"][len - 4]; 6231 break; 6232 case "c": 6233 if (len < 4) 6234 throw new RangeError("`c..ccc` (weekday) patterns are not supported"); 6235 result.weekday = ["short", "long", "narrow", "short"][len - 4]; 6236 break; 6237 // Period 6238 case "a": 6239 result.hour12 = !0; 6240 break; 6241 case "b": 6242 // am, pm, noon, midnight 6243 case "B": 6244 throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); 6245 // Hour 6246 case "h": 6247 result.hourCycle = "h12", result.hour = ["numeric", "2-digit"][len - 1]; 6248 break; 6249 case "H": 6250 result.hourCycle = "h23", result.hour = ["numeric", "2-digit"][len - 1]; 6251 break; 6252 case "K": 6253 result.hourCycle = "h11", result.hour = ["numeric", "2-digit"][len - 1]; 6254 break; 6255 case "k": 6256 result.hourCycle = "h24", result.hour = ["numeric", "2-digit"][len - 1]; 6257 break; 6258 case "j": 6259 case "J": 6260 case "C": 6261 throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); 6262 // Minute 6263 case "m": 6264 result.minute = ["numeric", "2-digit"][len - 1]; 6265 break; 6266 // Second 6267 case "s": 6268 result.second = ["numeric", "2-digit"][len - 1]; 6269 break; 6270 case "S": 6271 case "A": 6272 throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); 6273 // Zone 6274 case "z": 6275 result.timeZoneName = len < 4 ? "short" : "long"; 6276 break; 6277 case "Z": 6278 // 1..3, 4, 5: The ISO8601 varios formats 6279 case "O": 6280 // 1, 4: milliseconds in day short, long 6281 case "v": 6282 // 1, 4: generic non-location format 6283 case "V": 6284 // 1, 2, 3, 4: time zone ID or city 6285 case "X": 6286 // 1, 2, 3, 4: The ISO8601 varios formats 6287 case "x": 6288 throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead"); 6289 } 6290 return ""; 6291 }), result; 6292} 6293
vendor: 141 bytes, lines 6294-6296
6294// ../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js 6295var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; 6296
vendor: 8,706 bytes, lines 6297-6510
6297// ../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js 6298function parseNumberSkeletonFromString(skeleton) { 6299 if (skeleton.length === 0) 6300 throw new Error("Number skeleton cannot be empty"); 6301 for (var stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter(function(x2) { 6302 return x2.length > 0; 6303 }), tokens2 = [], _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) { 6304 var stringToken = stringTokens_1[_i], stemAndOptions = stringToken.split("/"); 6305 if (stemAndOptions.length === 0) 6306 throw new Error("Invalid number skeleton"); 6307 for (var stem = stemAndOptions[0], options2 = stemAndOptions.slice(1), _a2 = 0, options_1 = options2; _a2 < options_1.length; _a2++) { 6308 var option = options_1[_a2]; 6309 if (option.length === 0) 6310 throw new Error("Invalid number skeleton"); 6311 } 6312 tokens2.push({ stem, options: options2 }); 6313 } 6314 return tokens2; 6315} 6316function icuUnitToEcma(unit) { 6317 return unit.replace(/^(.*?)-/, ""); 6318} 6319var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g, INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g, CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; 6320function parseSignificantPrecision(str) { 6321 var result = {}; 6322 return str[str.length - 1] === "r" ? result.roundingPriority = "morePrecision" : str[str.length - 1] === "s" && (result.roundingPriority = "lessPrecision"), str.replace(SIGNIFICANT_PRECISION_REGEX, function(_2, g1, g2) { 6323 return typeof g2 != "string" ? (result.minimumSignificantDigits = g1.length, result.maximumSignificantDigits = g1.length) : g2 === "+" ? result.minimumSignificantDigits = g1.length : g1[0] === "#" ? result.maximumSignificantDigits = g1.length : (result.minimumSignificantDigits = g1.length, result.maximumSignificantDigits = g1.length + (typeof g2 == "string" ? g2.length : 0)), ""; 6324 }), result; 6325} 6326function parseSign(str) { 6327 switch (str) { 6328 case "sign-auto": 6329 return { 6330 signDisplay: "auto" 6331 }; 6332 case "sign-accounting": 6333 case "()": 6334 return { 6335 currencySign: "accounting" 6336 }; 6337 case "sign-always": 6338 case "+!": 6339 return { 6340 signDisplay: "always" 6341 }; 6342 case "sign-accounting-always": 6343 case "()!": 6344 return { 6345 signDisplay: "always", 6346 currencySign: "accounting" 6347 }; 6348 case "sign-except-zero": 6349 case "+?": 6350 return { 6351 signDisplay: "exceptZero" 6352 }; 6353 case "sign-accounting-except-zero": 6354 case "()?": 6355 return { 6356 signDisplay: "exceptZero", 6357 currencySign: "accounting" 6358 }; 6359 case "sign-never": 6360 case "+_": 6361 return { 6362 signDisplay: "never" 6363 }; 6364 } 6365} 6366function parseConciseScientificAndEngineeringStem(stem) { 6367 var result; 6368 if (stem[0] === "E" && stem[1] === "E" ? (result = { 6369 notation: "engineering" 6370 }, stem = stem.slice(2)) : stem[0] === "E" && (result = { 6371 notation: "scientific" 6372 }, stem = stem.slice(1)), result) { 6373 var signDisplay = stem.slice(0, 2); 6374 if (signDisplay === "+!" ? (result.signDisplay = "always", stem = stem.slice(2)) : signDisplay === "+?" && (result.signDisplay = "exceptZero", stem = stem.slice(2)), !CONCISE_INTEGER_WIDTH_REGEX.test(stem)) 6375 throw new Error("Malformed concise eng/scientific notation"); 6376 result.minimumIntegerDigits = stem.length; 6377 } 6378 return result; 6379} 6380function parseNotationOptions(opt) { 6381 var result = {}, signOpts = parseSign(opt); 6382 return signOpts || result; 6383} 6384function parseNumberSkeleton(tokens2) { 6385 for (var result = {}, _i = 0, tokens_1 = tokens2; _i < tokens_1.length; _i++) { 6386 var token = tokens_1[_i]; 6387 switch (token.stem) { 6388 case "percent": 6389 case "%": 6390 result.style = "percent"; 6391 continue; 6392 case "%x100": 6393 result.style = "percent", result.scale = 100; 6394 continue; 6395 case "currency": 6396 result.style = "currency", result.currency = token.options[0]; 6397 continue; 6398 case "group-off": 6399 case ",_": 6400 result.useGrouping = !1; 6401 continue; 6402 case "precision-integer": 6403 case ".": 6404 result.maximumFractionDigits = 0; 6405 continue; 6406 case "measure-unit": 6407 case "unit": 6408 result.style = "unit", result.unit = icuUnitToEcma(token.options[0]); 6409 continue; 6410 case "compact-short": 6411 case "K": 6412 result.notation = "compact", result.compactDisplay = "short"; 6413 continue; 6414 case "compact-long": 6415 case "KK": 6416 result.notation = "compact", result.compactDisplay = "long"; 6417 continue; 6418 case "scientific": 6419 result = __assign(__assign(__assign({}, result), { notation: "scientific" }), token.options.reduce(function(all, opt2) { 6420 return __assign(__assign({}, all), parseNotationOptions(opt2)); 6421 }, {})); 6422 continue; 6423 case "engineering": 6424 result = __assign(__assign(__assign({}, result), { notation: "engineering" }), token.options.reduce(function(all, opt2) { 6425 return __assign(__assign({}, all), parseNotationOptions(opt2)); 6426 }, {})); 6427 continue; 6428 case "notation-simple": 6429 result.notation = "standard"; 6430 continue; 6431 // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h 6432 case "unit-width-narrow": 6433 result.currencyDisplay = "narrowSymbol", result.unitDisplay = "narrow"; 6434 continue; 6435 case "unit-width-short": 6436 result.currencyDisplay = "code", result.unitDisplay = "short"; 6437 continue; 6438 case "unit-width-full-name": 6439 result.currencyDisplay = "name", result.unitDisplay = "long"; 6440 continue; 6441 case "unit-width-iso-code": 6442 result.currencyDisplay = "symbol"; 6443 continue; 6444 case "scale": 6445 result.scale = parseFloat(token.options[0]); 6446 continue; 6447 case "rounding-mode-floor": 6448 result.roundingMode = "floor"; 6449 continue; 6450 case "rounding-mode-ceiling": 6451 result.roundingMode = "ceil"; 6452 continue; 6453 case "rounding-mode-down": 6454 result.roundingMode = "trunc"; 6455 continue; 6456 case "rounding-mode-up": 6457 result.roundingMode = "expand"; 6458 continue; 6459 case "rounding-mode-half-even": 6460 result.roundingMode = "halfEven"; 6461 continue; 6462 case "rounding-mode-half-down": 6463 result.roundingMode = "halfTrunc"; 6464 continue; 6465 case "rounding-mode-half-up": 6466 result.roundingMode = "halfExpand"; 6467 continue; 6468 // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width 6469 case "integer-width": 6470 if (token.options.length > 1) 6471 throw new RangeError("integer-width stems only accept a single optional option"); 6472 token.options[0].replace(INTEGER_WIDTH_REGEX, function(_2, g1, g2, g3, g4, g5) { 6473 if (g1) 6474 result.minimumIntegerDigits = g2.length; 6475 else { 6476 if (g3 && g4) 6477 throw new Error("We currently do not support maximum integer digits"); 6478 if (g5) 6479 throw new Error("We currently do not support exact integer digits"); 6480 } 6481 return ""; 6482 }); 6483 continue; 6484 } 6485 if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) { 6486 result.minimumIntegerDigits = token.stem.length; 6487 continue; 6488 } 6489 if (FRACTION_PRECISION_REGEX.test(token.stem)) { 6490 if (token.options.length > 1) 6491 throw new RangeError("Fraction-precision stems only accept a single optional option"); 6492 token.stem.replace(FRACTION_PRECISION_REGEX, function(_2, g1, g2, g3, g4, g5) { 6493 return g2 === "*" ? result.minimumFractionDigits = g1.length : g3 && g3[0] === "#" ? result.maximumFractionDigits = g3.length : g4 && g5 ? (result.minimumFractionDigits = g4.length, result.maximumFractionDigits = g4.length + g5.length) : (result.minimumFractionDigits = g1.length, result.maximumFractionDigits = g1.length), ""; 6494 }); 6495 var opt = token.options[0]; 6496 opt === "w" ? result = __assign(__assign({}, result), { trailingZeroDisplay: "stripIfInteger" }) : opt && (result = __assign(__assign({}, result), parseSignificantPrecision(opt))); 6497 continue; 6498 } 6499 if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { 6500 result = __assign(__assign({}, result), parseSignificantPrecision(token.stem)); 6501 continue; 6502 } 6503 var signOpts = parseSign(token.stem); 6504 signOpts && (result = __assign(__assign({}, result), signOpts)); 6505 var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); 6506 conciseScientificAndEngineeringOpts && (result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts)); 6507 } 6508 return result; 6509} 6510
vendor: 11,674 bytes, lines 6511-7927
6511// ../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js 6512var timeData = { 6513 "001": [ 6514 "H", 6515 "h" 6516 ], 6517 419: [ 6518 "h", 6519 "H", 6520 "hB", 6521 "hb" 6522 ], 6523 AC: [ 6524 "H", 6525 "h", 6526 "hb", 6527 "hB" 6528 ], 6529 AD: [ 6530 "H", 6531 "hB" 6532 ], 6533 AE: [ 6534 "h", 6535 "hB", 6536 "hb", 6537 "H" 6538 ], 6539 AF: [ 6540 "H", 6541 "hb", 6542 "hB", 6543 "h" 6544 ], 6545 AG: [ 6546 "h", 6547 "hb", 6548 "H", 6549 "hB" 6550 ], 6551 AI: [ 6552 "H", 6553 "h", 6554 "hb", 6555 "hB" 6556 ], 6557 AL: [ 6558 "h", 6559 "H", 6560 "hB" 6561 ], 6562 AM: [ 6563 "H", 6564 "hB" 6565 ], 6566 AO: [ 6567 "H", 6568 "hB" 6569 ], 6570 AR: [ 6571 "h", 6572 "H", 6573 "hB", 6574 "hb" 6575 ], 6576 AS: [ 6577 "h", 6578 "H" 6579 ], 6580 AT: [ 6581 "H", 6582 "hB" 6583 ], 6584 AU: [ 6585 "h", 6586 "hb", 6587 "H", 6588 "hB" 6589 ], 6590 AW: [ 6591 "H", 6592 "hB" 6593 ], 6594 AX: [ 6595 "H" 6596 ], 6597 AZ: [ 6598 "H", 6599 "hB", 6600 "h" 6601 ], 6602 BA: [ 6603 "H", 6604 "hB", 6605 "h" 6606 ], 6607 BB: [ 6608 "h", 6609 "hb", 6610 "H", 6611 "hB" 6612 ], 6613 BD: [ 6614 "h", 6615 "hB", 6616 "H" 6617 ], 6618 BE: [ 6619 "H", 6620 "hB" 6621 ], 6622 BF: [ 6623 "H", 6624 "hB" 6625 ], 6626 BG: [ 6627 "H", 6628 "hB", 6629 "h" 6630 ], 6631 BH: [ 6632 "h", 6633 "hB", 6634 "hb", 6635 "H" 6636 ], 6637 BI: [ 6638 "H", 6639 "h" 6640 ], 6641 BJ: [ 6642 "H", 6643 "hB" 6644 ], 6645 BL: [ 6646 "H", 6647 "hB" 6648 ], 6649 BM: [ 6650 "h", 6651 "hb", 6652 "H", 6653 "hB" 6654 ], 6655 BN: [ 6656 "hb", 6657 "hB", 6658 "h", 6659 "H" 6660 ], 6661 BO: [ 6662 "h", 6663 "H", 6664 "hB", 6665 "hb" 6666 ], 6667 BQ: [ 6668 "H" 6669 ], 6670 BR: [ 6671 "H", 6672 "hB" 6673 ], 6674 BS: [ 6675 "h", 6676 "hb", 6677 "H", 6678 "hB" 6679 ], 6680 BT: [ 6681 "h", 6682 "H" 6683 ], 6684 BW: [ 6685 "H", 6686 "h", 6687 "hb", 6688 "hB" 6689 ], 6690 BY: [ 6691 "H", 6692 "h" 6693 ], 6694 BZ: [ 6695 "H", 6696 "h", 6697 "hb", 6698 "hB" 6699 ], 6700 CA: [ 6701 "h", 6702 "hb", 6703 "H", 6704 "hB" 6705 ], 6706 CC: [ 6707 "H", 6708 "h", 6709 "hb", 6710 "hB" 6711 ], 6712 CD: [ 6713 "hB", 6714 "H" 6715 ], 6716 CF: [ 6717 "H", 6718 "h", 6719 "hB" 6720 ], 6721 CG: [ 6722 "H", 6723 "hB" 6724 ], 6725 CH: [ 6726 "H", 6727 "hB", 6728 "h" 6729 ], 6730 CI: [ 6731 "H", 6732 "hB" 6733 ], 6734 CK: [ 6735 "H", 6736 "h", 6737 "hb", 6738 "hB" 6739 ], 6740 CL: [ 6741 "h", 6742 "H", 6743 "hB", 6744 "hb" 6745 ], 6746 CM: [ 6747 "H", 6748 "h", 6749 "hB" 6750 ], 6751 CN: [ 6752 "H", 6753 "hB", 6754 "hb", 6755 "h" 6756 ], 6757 CO: [ 6758 "h", 6759 "H", 6760 "hB", 6761 "hb" 6762 ], 6763 CP: [ 6764 "H" 6765 ], 6766 CR: [ 6767 "h", 6768 "H", 6769 "hB", 6770 "hb" 6771 ], 6772 CU: [ 6773 "h", 6774 "H", 6775 "hB", 6776 "hb" 6777 ], 6778 CV: [ 6779 "H", 6780 "hB" 6781 ], 6782 CW: [ 6783 "H", 6784 "hB" 6785 ], 6786 CX: [ 6787 "H", 6788 "h", 6789 "hb", 6790 "hB" 6791 ], 6792 CY: [ 6793 "h", 6794 "H", 6795 "hb", 6796 "hB" 6797 ], 6798 CZ: [ 6799 "H" 6800 ], 6801 DE: [ 6802 "H", 6803 "hB" 6804 ], 6805 DG: [ 6806 "H", 6807 "h", 6808 "hb", 6809 "hB" 6810 ], 6811 DJ: [ 6812 "h", 6813 "H" 6814 ], 6815 DK: [ 6816 "H" 6817 ], 6818 DM: [ 6819 "h", 6820 "hb", 6821 "H", 6822 "hB" 6823 ], 6824 DO: [ 6825 "h", 6826 "H", 6827 "hB", 6828 "hb" 6829 ], 6830 DZ: [ 6831 "h", 6832 "hB", 6833 "hb", 6834 "H" 6835 ], 6836 EA: [ 6837 "H", 6838 "h", 6839 "hB", 6840 "hb" 6841 ], 6842 EC: [ 6843 "h", 6844 "H", 6845 "hB", 6846 "hb" 6847 ], 6848 EE: [ 6849 "H", 6850 "hB" 6851 ], 6852 EG: [ 6853 "h", 6854 "hB", 6855 "hb", 6856 "H" 6857 ], 6858 EH: [ 6859 "h", 6860 "hB", 6861 "hb", 6862 "H" 6863 ], 6864 ER: [ 6865 "h", 6866 "H" 6867 ], 6868 ES: [ 6869 "H", 6870 "hB", 6871 "h", 6872 "hb" 6873 ], 6874 ET: [ 6875 "hB", 6876 "hb", 6877 "h", 6878 "H" 6879 ], 6880 FI: [ 6881 "H" 6882 ], 6883 FJ: [ 6884 "h", 6885 "hb", 6886 "H", 6887 "hB" 6888 ], 6889 FK: [ 6890 "H", 6891 "h", 6892 "hb", 6893 "hB" 6894 ], 6895 FM: [ 6896 "h", 6897 "hb", 6898 "H", 6899 "hB" 6900 ], 6901 FO: [ 6902 "H", 6903 "h" 6904 ], 6905 FR: [ 6906 "H", 6907 "hB" 6908 ], 6909 GA: [ 6910 "H", 6911 "hB" 6912 ], 6913 GB: [ 6914 "H", 6915 "h", 6916 "hb", 6917 "hB" 6918 ], 6919 GD: [ 6920 "h", 6921 "hb", 6922 "H", 6923 "hB" 6924 ], 6925 GE: [ 6926 "H", 6927 "hB", 6928 "h" 6929 ], 6930 GF: [ 6931 "H", 6932 "hB" 6933 ], 6934 GG: [ 6935 "H", 6936 "h", 6937 "hb", 6938 "hB" 6939 ], 6940 GH: [ 6941 "h", 6942 "H" 6943 ], 6944 GI: [ 6945 "H", 6946 "h", 6947 "hb", 6948 "hB" 6949 ], 6950 GL: [ 6951 "H", 6952 "h" 6953 ], 6954 GM: [ 6955 "h", 6956 "hb", 6957 "H", 6958 "hB" 6959 ], 6960 GN: [ 6961 "H", 6962 "hB" 6963 ], 6964 GP: [ 6965 "H", 6966 "hB" 6967 ], 6968 GQ: [ 6969 "H", 6970 "hB", 6971 "h", 6972 "hb" 6973 ], 6974 GR: [ 6975 "h", 6976 "H", 6977 "hb", 6978 "hB" 6979 ], 6980 GT: [ 6981 "h", 6982 "H", 6983 "hB", 6984 "hb" 6985 ], 6986 GU: [ 6987 "h", 6988 "hb", 6989 "H", 6990 "hB" 6991 ], 6992 GW: [ 6993 "H", 6994 "hB" 6995 ], 6996 GY: [ 6997 "h", 6998 "hb", 6999 "H", 7000 "hB" 7001 ], 7002 HK: [ 7003 "h", 7004 "hB", 7005 "hb", 7006 "H" 7007 ], 7008 HN: [ 7009 "h", 7010 "H", 7011 "hB", 7012 "hb" 7013 ], 7014 HR: [ 7015 "H", 7016 "hB" 7017 ], 7018 HU: [ 7019 "H", 7020 "h" 7021 ], 7022 IC: [ 7023 "H", 7024 "h", 7025 "hB", 7026 "hb" 7027 ], 7028 ID: [ 7029 "H" 7030 ], 7031 IE: [ 7032 "H", 7033 "h", 7034 "hb", 7035 "hB" 7036 ], 7037 IL: [ 7038 "H", 7039 "hB" 7040 ], 7041 IM: [ 7042 "H", 7043 "h", 7044 "hb", 7045 "hB" 7046 ], 7047 IN: [ 7048 "h", 7049 "H" 7050 ], 7051 IO: [ 7052 "H", 7053 "h", 7054 "hb", 7055 "hB" 7056 ], 7057 IQ: [ 7058 "h", 7059 "hB", 7060 "hb", 7061 "H" 7062 ], 7063 IR: [ 7064 "hB", 7065 "H" 7066 ], 7067 IS: [ 7068 "H" 7069 ], 7070 IT: [ 7071 "H", 7072 "hB" 7073 ], 7074 JE: [ 7075 "H", 7076 "h", 7077 "hb", 7078 "hB" 7079 ], 7080 JM: [ 7081 "h", 7082 "hb", 7083 "H", 7084 "hB" 7085 ], 7086 JO: [ 7087 "h", 7088 "hB", 7089 "hb", 7090 "H" 7091 ], 7092 JP: [ 7093 "H", 7094 "K", 7095 "h" 7096 ], 7097 KE: [ 7098 "hB", 7099 "hb", 7100 "H", 7101 "h" 7102 ], 7103 KG: [ 7104 "H", 7105 "h", 7106 "hB", 7107 "hb" 7108 ], 7109 KH: [ 7110 "hB", 7111 "h", 7112 "H", 7113 "hb" 7114 ], 7115 KI: [ 7116 "h", 7117 "hb", 7118 "H", 7119 "hB" 7120 ], 7121 KM: [ 7122 "H", 7123 "h", 7124 "hB", 7125 "hb" 7126 ], 7127 KN: [ 7128 "h", 7129 "hb", 7130 "H", 7131 "hB" 7132 ], 7133 KP: [ 7134 "h", 7135 "H", 7136 "hB", 7137 "hb" 7138 ], 7139 KR: [ 7140 "h", 7141 "H", 7142 "hB", 7143 "hb" 7144 ], 7145 KW: [ 7146 "h", 7147 "hB", 7148 "hb", 7149 "H" 7150 ], 7151 KY: [ 7152 "h", 7153 "hb", 7154 "H", 7155 "hB" 7156 ], 7157 KZ: [ 7158 "H", 7159 "hB" 7160 ], 7161 LA: [ 7162 "H", 7163 "hb", 7164 "hB", 7165 "h" 7166 ], 7167 LB: [ 7168 "h", 7169 "hB", 7170 "hb", 7171 "H" 7172 ], 7173 LC: [ 7174 "h", 7175 "hb", 7176 "H", 7177 "hB" 7178 ], 7179 LI: [ 7180 "H", 7181 "hB", 7182 "h" 7183 ], 7184 LK: [ 7185 "H", 7186 "h", 7187 "hB", 7188 "hb" 7189 ], 7190 LR: [ 7191 "h", 7192 "hb", 7193 "H", 7194 "hB" 7195 ], 7196 LS: [ 7197 "h", 7198 "H" 7199 ], 7200 LT: [ 7201 "H", 7202 "h", 7203 "hb", 7204 "hB" 7205 ], 7206 LU: [ 7207 "H", 7208 "h", 7209 "hB" 7210 ], 7211 LV: [ 7212 "H", 7213 "hB", 7214 "hb", 7215 "h" 7216 ], 7217 LY: [ 7218 "h", 7219 "hB", 7220 "hb", 7221 "H" 7222 ], 7223 MA: [ 7224 "H", 7225 "h", 7226 "hB", 7227 "hb" 7228 ], 7229 MC: [ 7230 "H", 7231 "hB" 7232 ], 7233 MD: [ 7234 "H", 7235 "hB" 7236 ], 7237 ME: [ 7238 "H", 7239 "hB", 7240 "h" 7241 ], 7242 MF: [ 7243 "H", 7244 "hB" 7245 ], 7246 MG: [ 7247 "H", 7248 "h" 7249 ], 7250 MH: [ 7251 "h", 7252 "hb", 7253 "H", 7254 "hB" 7255 ], 7256 MK: [ 7257 "H", 7258 "h", 7259 "hb", 7260 "hB" 7261 ], 7262 ML: [ 7263 "H" 7264 ], 7265 MM: [ 7266 "hB", 7267 "hb", 7268 "H", 7269 "h" 7270 ], 7271 MN: [ 7272 "H", 7273 "h", 7274 "hb", 7275 "hB" 7276 ], 7277 MO: [ 7278 "h", 7279 "hB", 7280 "hb", 7281 "H" 7282 ], 7283 MP: [ 7284 "h", 7285 "hb", 7286 "H", 7287 "hB" 7288 ], 7289 MQ: [ 7290 "H", 7291 "hB" 7292 ], 7293 MR: [ 7294 "h", 7295 "hB", 7296 "hb", 7297 "H" 7298 ], 7299 MS: [ 7300 "H", 7301 "h", 7302 "hb", 7303 "hB" 7304 ], 7305 MT: [ 7306 "H", 7307 "h" 7308 ], 7309 MU: [ 7310 "H", 7311 "h" 7312 ], 7313 MV: [ 7314 "H", 7315 "h" 7316 ], 7317 MW: [ 7318 "h", 7319 "hb", 7320 "H", 7321 "hB" 7322 ], 7323 MX: [ 7324 "h", 7325 "H", 7326 "hB", 7327 "hb" 7328 ], 7329 MY: [ 7330 "hb", 7331 "hB", 7332 "h", 7333 "H" 7334 ], 7335 MZ: [ 7336 "H", 7337 "hB" 7338 ], 7339 NA: [ 7340 "h", 7341 "H", 7342 "hB", 7343 "hb" 7344 ], 7345 NC: [ 7346 "H", 7347 "hB" 7348 ], 7349 NE: [ 7350 "H" 7351 ], 7352 NF: [ 7353 "H", 7354 "h", 7355 "hb", 7356 "hB" 7357 ], 7358 NG: [ 7359 "H", 7360 "h", 7361 "hb", 7362 "hB" 7363 ], 7364 NI: [ 7365 "h", 7366 "H", 7367 "hB", 7368 "hb" 7369 ], 7370 NL: [ 7371 "H", 7372 "hB" 7373 ], 7374 NO: [ 7375 "H", 7376 "h" 7377 ], 7378 NP: [ 7379 "H", 7380 "h", 7381 "hB" 7382 ], 7383 NR: [ 7384 "H", 7385 "h", 7386 "hb", 7387 "hB" 7388 ], 7389 NU: [ 7390 "H", 7391 "h", 7392 "hb", 7393 "hB" 7394 ], 7395 NZ: [ 7396 "h", 7397 "hb", 7398 "H", 7399 "hB" 7400 ], 7401 OM: [ 7402 "h", 7403 "hB", 7404 "hb", 7405 "H" 7406 ], 7407 PA: [ 7408 "h", 7409 "H", 7410 "hB", 7411 "hb" 7412 ], 7413 PE: [ 7414 "h", 7415 "H", 7416 "hB", 7417 "hb" 7418 ], 7419 PF: [ 7420 "H", 7421 "h", 7422 "hB" 7423 ], 7424 PG: [ 7425 "h", 7426 "H" 7427 ], 7428 PH: [ 7429 "h", 7430 "hB", 7431 "hb", 7432 "H" 7433 ], 7434 PK: [ 7435 "h", 7436 "hB", 7437 "H" 7438 ], 7439 PL: [ 7440 "H", 7441 "h" 7442 ], 7443 PM: [ 7444 "H", 7445 "hB" 7446 ], 7447 PN: [ 7448 "H", 7449 "h", 7450 "hb", 7451 "hB" 7452 ], 7453 PR: [ 7454 "h", 7455 "H", 7456 "hB", 7457 "hb" 7458 ], 7459 PS: [ 7460 "h", 7461 "hB", 7462 "hb", 7463 "H" 7464 ], 7465 PT: [ 7466 "H", 7467 "hB" 7468 ], 7469 PW: [ 7470 "h", 7471 "H" 7472 ], 7473 PY: [ 7474 "h", 7475 "H", 7476 "hB", 7477 "hb" 7478 ], 7479 QA: [ 7480 "h", 7481 "hB", 7482 "hb", 7483 "H" 7484 ], 7485 RE: [ 7486 "H", 7487 "hB" 7488 ], 7489 RO: [ 7490 "H", 7491 "hB" 7492 ], 7493 RS: [ 7494 "H", 7495 "hB", 7496 "h" 7497 ], 7498 RU: [ 7499 "H" 7500 ], 7501 RW: [ 7502 "H", 7503 "h" 7504 ], 7505 SA: [ 7506 "h", 7507 "hB", 7508 "hb", 7509 "H" 7510 ], 7511 SB: [ 7512 "h", 7513 "hb", 7514 "H", 7515 "hB" 7516 ], 7517 SC: [ 7518 "H", 7519 "h", 7520 "hB" 7521 ], 7522 SD: [ 7523 "h", 7524 "hB", 7525 "hb", 7526 "H" 7527 ], 7528 SE: [ 7529 "H" 7530 ], 7531 SG: [ 7532 "h", 7533 "hb", 7534 "H", 7535 "hB" 7536 ], 7537 SH: [ 7538 "H", 7539 "h", 7540 "hb", 7541 "hB" 7542 ], 7543 SI: [ 7544 "H", 7545 "hB" 7546 ], 7547 SJ: [ 7548 "H" 7549 ], 7550 SK: [ 7551 "H" 7552 ], 7553 SL: [ 7554 "h", 7555 "hb", 7556 "H", 7557 "hB" 7558 ], 7559 SM: [ 7560 "H", 7561 "h", 7562 "hB" 7563 ], 7564 SN: [ 7565 "H", 7566 "h", 7567 "hB" 7568 ], 7569 SO: [ 7570 "h", 7571 "H" 7572 ], 7573 SR: [ 7574 "H", 7575 "hB" 7576 ], 7577 SS: [ 7578 "h", 7579 "hb", 7580 "H", 7581 "hB" 7582 ], 7583 ST: [ 7584 "H", 7585 "hB" 7586 ], 7587 SV: [ 7588 "h", 7589 "H", 7590 "hB", 7591 "hb" 7592 ], 7593 SX: [ 7594 "H", 7595 "h", 7596 "hb", 7597 "hB" 7598 ], 7599 SY: [ 7600 "h", 7601 "hB", 7602 "hb", 7603 "H" 7604 ], 7605 SZ: [ 7606 "h", 7607 "hb", 7608 "H", 7609 "hB" 7610 ], 7611 TA: [ 7612 "H", 7613 "h", 7614 "hb", 7615 "hB" 7616 ], 7617 TC: [ 7618 "h", 7619 "hb", 7620 "H", 7621 "hB" 7622 ], 7623 TD: [ 7624 "h", 7625 "H", 7626 "hB" 7627 ], 7628 TF: [ 7629 "H", 7630 "h", 7631 "hB" 7632 ], 7633 TG: [ 7634 "H", 7635 "hB" 7636 ], 7637 TH: [ 7638 "H", 7639 "h" 7640 ], 7641 TJ: [ 7642 "H", 7643 "h" 7644 ], 7645 TL: [ 7646 "H", 7647 "hB", 7648 "hb", 7649 "h" 7650 ], 7651 TM: [ 7652 "H", 7653 "h" 7654 ], 7655 TN: [ 7656 "h", 7657 "hB", 7658 "hb", 7659 "H" 7660 ], 7661 TO: [ 7662 "h", 7663 "H" 7664 ], 7665 TR: [ 7666 "H", 7667 "hB" 7668 ], 7669 TT: [ 7670 "h", 7671 "hb", 7672 "H", 7673 "hB" 7674 ], 7675 TW: [ 7676 "hB", 7677 "hb", 7678 "h", 7679 "H" 7680 ], 7681 TZ: [ 7682 "hB", 7683 "hb", 7684 "H", 7685 "h" 7686 ], 7687 UA: [ 7688 "H", 7689 "hB", 7690 "h" 7691 ], 7692 UG: [ 7693 "hB", 7694 "hb", 7695 "H", 7696 "h" 7697 ], 7698 UM: [ 7699 "h", 7700 "hb", 7701 "H", 7702 "hB" 7703 ], 7704 US: [ 7705 "h", 7706 "hb", 7707 "H", 7708 "hB" 7709 ], 7710 UY: [ 7711 "h", 7712 "H", 7713 "hB", 7714 "hb" 7715 ], 7716 UZ: [ 7717 "H", 7718 "hB", 7719 "h" 7720 ], 7721 VA: [ 7722 "H", 7723 "h", 7724 "hB" 7725 ], 7726 VC: [ 7727 "h", 7728 "hb", 7729 "H", 7730 "hB" 7731 ], 7732 VE: [ 7733 "h", 7734 "H", 7735 "hB", 7736 "hb" 7737 ], 7738 VG: [ 7739 "h", 7740 "hb", 7741 "H", 7742 "hB" 7743 ], 7744 VI: [ 7745 "h", 7746 "hb", 7747 "H", 7748 "hB" 7749 ], 7750 VN: [ 7751 "H", 7752 "h" 7753 ], 7754 VU: [ 7755 "h", 7756 "H" 7757 ], 7758 WF: [ 7759 "H", 7760 "hB" 7761 ], 7762 WS: [ 7763 "h", 7764 "H" 7765 ], 7766 XK: [ 7767 "H", 7768 "hB", 7769 "h" 7770 ], 7771 YE: [ 7772 "h", 7773 "hB", 7774 "hb", 7775 "H" 7776 ], 7777 YT: [ 7778 "H", 7779 "hB" 7780 ], 7781 ZA: [ 7782 "H", 7783 "h", 7784 "hb", 7785 "hB" 7786 ], 7787 ZM: [ 7788 "h", 7789 "hb", 7790 "H", 7791 "hB" 7792 ], 7793 ZW: [ 7794 "H", 7795 "h" 7796 ], 7797 "af-ZA": [ 7798 "H", 7799 "h", 7800 "hB", 7801 "hb" 7802 ], 7803 "ar-001": [ 7804 "h", 7805 "hB", 7806 "hb", 7807 "H" 7808 ], 7809 "ca-ES": [ 7810 "H", 7811 "h", 7812 "hB" 7813 ], 7814 "en-001": [ 7815 "h", 7816 "hb", 7817 "H", 7818 "hB" 7819 ], 7820 "en-HK": [ 7821 "h", 7822 "hb", 7823 "H", 7824 "hB" 7825 ], 7826 "en-IL": [ 7827 "H", 7828 "h", 7829 "hb", 7830 "hB" 7831 ], 7832 "en-MY": [ 7833 "h", 7834 "hb", 7835 "H", 7836 "hB" 7837 ], 7838 "es-BR": [ 7839 "H", 7840 "h", 7841 "hB", 7842 "hb" 7843 ], 7844 "es-ES": [ 7845 "H", 7846 "h", 7847 "hB", 7848 "hb" 7849 ], 7850 "es-GQ": [ 7851 "H", 7852 "h", 7853 "hB", 7854 "hb" 7855 ], 7856 "fr-CA": [ 7857 "H", 7858 "h", 7859 "hB" 7860 ], 7861 "gl-ES": [ 7862 "H", 7863 "h", 7864 "hB" 7865 ], 7866 "gu-IN": [ 7867 "hB", 7868 "hb", 7869 "h", 7870 "H" 7871 ], 7872 "hi-IN": [ 7873 "hB", 7874 "h", 7875 "H" 7876 ], 7877 "it-CH": [ 7878 "H", 7879 "h", 7880 "hB" 7881 ], 7882 "it-IT": [ 7883 "H", 7884 "h", 7885 "hB" 7886 ], 7887 "kn-IN": [ 7888 "hB", 7889 "h", 7890 "H" 7891 ], 7892 "ml-IN": [ 7893 "hB", 7894 "h", 7895 "H" 7896 ], 7897 "mr-IN": [ 7898 "hB", 7899 "hb", 7900 "h", 7901 "H" 7902 ], 7903 "pa-IN": [ 7904 "hB", 7905 "hb", 7906 "h", 7907 "H" 7908 ], 7909 "ta-IN": [ 7910 "hB", 7911 "h", 7912 "hb", 7913 "H" 7914 ], 7915 "te-IN": [ 7916 "hB", 7917 "h", 7918 "H" 7919 ], 7920 "zu-ZA": [ 7921 "H", 7922 "hB", 7923 "hb", 7924 "h" 7925 ] 7926}; 7927
vendor: 1,771 bytes, lines 7928-7966
7928// ../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js 7929function getBestPattern(skeleton, locale) { 7930 for (var skeletonCopy = "", patternPos = 0; patternPos < skeleton.length; patternPos++) { 7931 var patternChar = skeleton.charAt(patternPos); 7932 if (patternChar === "j") { 7933 for (var extraLength = 0; patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar; ) 7934 extraLength++, patternPos++; 7935 var hourLen = 1 + (extraLength & 1), dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1), dayPeriodChar = "a", hourChar = getDefaultHourSymbolFromLocale(locale); 7936 for ((hourChar == "H" || hourChar == "k") && (dayPeriodLen = 0); dayPeriodLen-- > 0; ) 7937 skeletonCopy += dayPeriodChar; 7938 for (; hourLen-- > 0; ) 7939 skeletonCopy = hourChar + skeletonCopy; 7940 } else patternChar === "J" ? skeletonCopy += "H" : skeletonCopy += patternChar; 7941 } 7942 return skeletonCopy; 7943} 7944function getDefaultHourSymbolFromLocale(locale) { 7945 var hourCycle = locale.hourCycle; 7946 if (hourCycle === void 0 && // @ts-ignore hourCycle(s) is not identified yet 7947 locale.hourCycles && // @ts-ignore 7948 locale.hourCycles.length && (hourCycle = locale.hourCycles[0]), hourCycle) 7949 switch (hourCycle) { 7950 case "h24": 7951 return "k"; 7952 case "h23": 7953 return "H"; 7954 case "h12": 7955 return "h"; 7956 case "h11": 7957 return "K"; 7958 default: 7959 throw new Error("Invalid hourCycle"); 7960 } 7961 var languageTag = locale.language, regionTag; 7962 languageTag !== "root" && (regionTag = locale.maximize().region); 7963 var hourCycles = timeData[regionTag || ""] || timeData[languageTag || ""] || timeData["".concat(languageTag, "-001")] || timeData["001"]; 7964 return hourCycles[0]; 7965} 7966
vendor: 31,535 bytes, lines 7967-8538
7967// ../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js 7968var _a, SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")), SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$")); 7969function createLocation(start, end) { 7970 return { start, end }; 7971} 7972var hasNativeStartsWith = !!String.prototype.startsWith && "_a".startsWith("a", 1), hasNativeFromCodePoint = !!String.fromCodePoint, hasNativeFromEntries = !!Object.fromEntries, hasNativeCodePointAt = !!String.prototype.codePointAt, hasTrimStart = !!String.prototype.trimStart, hasTrimEnd = !!String.prototype.trimEnd, hasNativeIsSafeInteger = !!Number.isSafeInteger, isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(n3) { 7973 return typeof n3 == "number" && isFinite(n3) && Math.floor(n3) === n3 && Math.abs(n3) <= 9007199254740991; 7974}, REGEX_SUPPORTS_U_AND_Y = !0; 7975try { 7976 re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"), REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a"; 7977} catch { 7978 REGEX_SUPPORTS_U_AND_Y = !1; 7979} 7980var re, startsWith = hasNativeStartsWith ? ( 7981 // Native 7982 function(s2, search, position) { 7983 return s2.startsWith(search, position); 7984 } 7985) : ( 7986 // For IE11 7987 function(s2, search, position) { 7988 return s2.slice(position, position + search.length) === search; 7989 } 7990), fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : ( 7991 // IE11 7992 function() { 7993 for (var codePoints = [], _i = 0; _i < arguments.length; _i++) 7994 codePoints[_i] = arguments[_i]; 7995 for (var elements = "", length = codePoints.length, i2 = 0, code; length > i2; ) { 7996 if (code = codePoints[i2++], code > 1114111) 7997 throw RangeError(code + " is not a valid code point"); 7998 elements += code < 65536 ? String.fromCharCode(code) : String.fromCharCode(((code -= 65536) >> 10) + 55296, code % 1024 + 56320); 7999 } 8000 return elements; 8001 } 8002), fromEntries = ( 8003 // native 8004 hasNativeFromEntries ? Object.fromEntries : ( 8005 // Ponyfill 8006 function(entries) { 8007 for (var obj = {}, _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { 8008 var _a2 = entries_1[_i], k2 = _a2[0], v2 = _a2[1]; 8009 obj[k2] = v2; 8010 } 8011 return obj; 8012 } 8013 ) 8014), codePointAt = hasNativeCodePointAt ? ( 8015 // Native 8016 function(s2, index) { 8017 return s2.codePointAt(index); 8018 } 8019) : ( 8020 // IE 11 8021 function(s2, index) { 8022 var size = s2.length; 8023 if (!(index < 0 || index >= size)) { 8024 var first = s2.charCodeAt(index), second; 8025 return first < 55296 || first > 56319 || index + 1 === size || (second = s2.charCodeAt(index + 1)) < 56320 || second > 57343 ? first : (first - 55296 << 10) + (second - 56320) + 65536; 8026 } 8027 } 8028), trimStart = hasTrimStart ? ( 8029 // Native 8030 function(s2) { 8031 return s2.trimStart(); 8032 } 8033) : ( 8034 // Ponyfill 8035 function(s2) { 8036 return s2.replace(SPACE_SEPARATOR_START_REGEX, ""); 8037 } 8038), trimEnd = hasTrimEnd ? ( 8039 // Native 8040 function(s2) { 8041 return s2.trimEnd(); 8042 } 8043) : ( 8044 // Ponyfill 8045 function(s2) { 8046 return s2.replace(SPACE_SEPARATOR_END_REGEX, ""); 8047 } 8048); 8049function RE(s2, flag) { 8050 return new RegExp(s2, flag); 8051} 8052var matchIdentifierAtIndex; 8053REGEX_SUPPORTS_U_AND_Y ? (IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"), matchIdentifierAtIndex = function(s2, index) { 8054 var _a2; 8055 IDENTIFIER_PREFIX_RE_1.lastIndex = index; 8056 var match = IDENTIFIER_PREFIX_RE_1.exec(s2); 8057 return (_a2 = match[1]) !== null && _a2 !== void 0 ? _a2 : ""; 8058}) : matchIdentifierAtIndex = function(s2, index) { 8059 for (var match = []; ; ) { 8060 var c2 = codePointAt(s2, index); 8061 if (c2 === void 0 || _isWhiteSpace(c2) || _isPatternSyntax(c2)) 8062 break; 8063 match.push(c2), index += c2 >= 65536 ? 2 : 1; 8064 } 8065 return fromCodePoint.apply(void 0, match); 8066}; 8067var IDENTIFIER_PREFIX_RE_1, Parser = ( 8068 /** @class */ 8069 (function() { 8070 function Parser2(message, options2) { 8071 options2 === void 0 && (options2 = {}), this.message = message, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!options2.ignoreTag, this.locale = options2.locale, this.requiresOtherClause = !!options2.requiresOtherClause, this.shouldParseSkeletons = !!options2.shouldParseSkeletons; 8072 } 8073 return Parser2.prototype.parse = function() { 8074 if (this.offset() !== 0) 8075 throw Error("parser can only be used once"); 8076 return this.parseMessage(0, "", !1); 8077 }, Parser2.prototype.parseMessage = function(nestingLevel, parentArgType, expectingCloseTag) { 8078 for (var elements = []; !this.isEOF(); ) { 8079 var char = this.char(); 8080 if (char === 123) { 8081 var result = this.parseArgument(nestingLevel, expectingCloseTag); 8082 if (result.err) 8083 return result; 8084 elements.push(result.val); 8085 } else { 8086 if (char === 125 && nestingLevel > 0) 8087 break; 8088 if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) { 8089 var position = this.clonePosition(); 8090 this.bump(), elements.push({ 8091 type: TYPE.pound, 8092 location: createLocation(position, this.clonePosition()) 8093 }); 8094 } else if (char === 60 && !this.ignoreTag && this.peek() === 47) { 8095 if (expectingCloseTag) 8096 break; 8097 return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition())); 8098 } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { 8099 var result = this.parseTag(nestingLevel, parentArgType); 8100 if (result.err) 8101 return result; 8102 elements.push(result.val); 8103 } else { 8104 var result = this.parseLiteral(nestingLevel, parentArgType); 8105 if (result.err) 8106 return result; 8107 elements.push(result.val); 8108 } 8109 } 8110 } 8111 return { val: elements, err: null }; 8112 }, Parser2.prototype.parseTag = function(nestingLevel, parentArgType) { 8113 var startPosition = this.clonePosition(); 8114 this.bump(); 8115 var tagName = this.parseTagName(); 8116 if (this.bumpSpace(), this.bumpIf("/>")) 8117 return { 8118 val: { 8119 type: TYPE.literal, 8120 value: "<".concat(tagName, "/>"), 8121 location: createLocation(startPosition, this.clonePosition()) 8122 }, 8123 err: null 8124 }; 8125 if (this.bumpIf(">")) { 8126 var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, !0); 8127 if (childrenResult.err) 8128 return childrenResult; 8129 var children = childrenResult.val, endTagStartPosition = this.clonePosition(); 8130 if (this.bumpIf("</")) { 8131 if (this.isEOF() || !_isAlpha(this.char())) 8132 return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition())); 8133 var closingTagNameStartPosition = this.clonePosition(), closingTagName = this.parseTagName(); 8134 return tagName !== closingTagName ? this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? { 8135 val: { 8136 type: TYPE.tag, 8137 value: tagName, 8138 children, 8139 location: createLocation(startPosition, this.clonePosition()) 8140 }, 8141 err: null 8142 } : this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()))); 8143 } else 8144 return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition())); 8145 } else 8146 return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition())); 8147 }, Parser2.prototype.parseTagName = function() { 8148 var startOffset = this.offset(); 8149 for (this.bump(); !this.isEOF() && _isPotentialElementNameChar(this.char()); ) 8150 this.bump(); 8151 return this.message.slice(startOffset, this.offset()); 8152 }, Parser2.prototype.parseLiteral = function(nestingLevel, parentArgType) { 8153 for (var start = this.clonePosition(), value = ""; ; ) { 8154 var parseQuoteResult = this.tryParseQuote(parentArgType); 8155 if (parseQuoteResult) { 8156 value += parseQuoteResult; 8157 continue; 8158 } 8159 var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType); 8160 if (parseUnquotedResult) { 8161 value += parseUnquotedResult; 8162 continue; 8163 } 8164 var parseLeftAngleResult = this.tryParseLeftAngleBracket(); 8165 if (parseLeftAngleResult) { 8166 value += parseLeftAngleResult; 8167 continue; 8168 } 8169 break; 8170 } 8171 var location2 = createLocation(start, this.clonePosition()); 8172 return { 8173 val: { type: TYPE.literal, value, location: location2 }, 8174 err: null 8175 }; 8176 }, Parser2.prototype.tryParseLeftAngleBracket = function() { 8177 return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail. 8178 !_isAlphaOrSlash(this.peek() || 0)) ? (this.bump(), "<") : null; 8179 }, Parser2.prototype.tryParseQuote = function(parentArgType) { 8180 if (this.isEOF() || this.char() !== 39) 8181 return null; 8182 switch (this.peek()) { 8183 case 39: 8184 return this.bump(), this.bump(), "'"; 8185 // '{', '<', '>', '}' 8186 case 123: 8187 case 60: 8188 case 62: 8189 case 125: 8190 break; 8191 case 35: 8192 if (parentArgType === "plural" || parentArgType === "selectordinal") 8193 break; 8194 return null; 8195 default: 8196 return null; 8197 } 8198 this.bump(); 8199 var codePoints = [this.char()]; 8200 for (this.bump(); !this.isEOF(); ) { 8201 var ch = this.char(); 8202 if (ch === 39) 8203 if (this.peek() === 39) 8204 codePoints.push(39), this.bump(); 8205 else { 8206 this.bump(); 8207 break; 8208 } 8209 else 8210 codePoints.push(ch); 8211 this.bump(); 8212 } 8213 return fromCodePoint.apply(void 0, codePoints); 8214 }, Parser2.prototype.tryParseUnquoted = function(nestingLevel, parentArgType) { 8215 if (this.isEOF()) 8216 return null; 8217 var ch = this.char(); 8218 return ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0 ? null : (this.bump(), fromCodePoint(ch)); 8219 }, Parser2.prototype.parseArgument = function(nestingLevel, expectingCloseTag) { 8220 var openingBracePosition = this.clonePosition(); 8221 if (this.bump(), this.bumpSpace(), this.isEOF()) 8222 return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); 8223 if (this.char() === 125) 8224 return this.bump(), this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); 8225 var value = this.parseIdentifierIfPossible().value; 8226 if (!value) 8227 return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); 8228 if (this.bumpSpace(), this.isEOF()) 8229 return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); 8230 switch (this.char()) { 8231 // Simple argument: `{name}` 8232 case 125: 8233 return this.bump(), { 8234 val: { 8235 type: TYPE.argument, 8236 // value does not include the opening and closing braces. 8237 value, 8238 location: createLocation(openingBracePosition, this.clonePosition()) 8239 }, 8240 err: null 8241 }; 8242 // Argument with options: `{name, format, ...}` 8243 case 44: 8244 return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())) : this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition); 8245 default: 8246 return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); 8247 } 8248 }, Parser2.prototype.parseIdentifierIfPossible = function() { 8249 var startingPosition = this.clonePosition(), startOffset = this.offset(), value = matchIdentifierAtIndex(this.message, startOffset), endOffset = startOffset + value.length; 8250 this.bumpTo(endOffset); 8251 var endPosition = this.clonePosition(), location2 = createLocation(startingPosition, endPosition); 8252 return { value, location: location2 }; 8253 }, Parser2.prototype.parseArgumentOptions = function(nestingLevel, expectingCloseTag, value, openingBracePosition) { 8254 var _a2, typeStartPosition = this.clonePosition(), argType = this.parseIdentifierIfPossible().value, typeEndPosition = this.clonePosition(); 8255 switch (argType) { 8256 case "": 8257 return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition)); 8258 case "number": 8259 case "date": 8260 case "time": { 8261 this.bumpSpace(); 8262 var styleAndLocation = null; 8263 if (this.bumpIf(",")) { 8264 this.bumpSpace(); 8265 var styleStartPosition = this.clonePosition(), result = this.parseSimpleArgStyleIfPossible(); 8266 if (result.err) 8267 return result; 8268 var style = trimEnd(result.val); 8269 if (style.length === 0) 8270 return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition())); 8271 var styleLocation = createLocation(styleStartPosition, this.clonePosition()); 8272 styleAndLocation = { style, styleLocation }; 8273 } 8274 var argCloseResult = this.tryParseArgumentClose(openingBracePosition); 8275 if (argCloseResult.err) 8276 return argCloseResult; 8277 var location_1 = createLocation(openingBracePosition, this.clonePosition()); 8278 if (styleAndLocation && startsWith(styleAndLocation?.style, "::", 0)) { 8279 var skeleton = trimStart(styleAndLocation.style.slice(2)); 8280 if (argType === "number") { 8281 var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation); 8282 return result.err ? result : { 8283 val: { type: TYPE.number, value, location: location_1, style: result.val }, 8284 err: null 8285 }; 8286 } else { 8287 if (skeleton.length === 0) 8288 return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1); 8289 var dateTimePattern = skeleton; 8290 this.locale && (dateTimePattern = getBestPattern(skeleton, this.locale)); 8291 var style = { 8292 type: SKELETON_TYPE.dateTime, 8293 pattern: dateTimePattern, 8294 location: styleAndLocation.styleLocation, 8295 parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {} 8296 }, type = argType === "date" ? TYPE.date : TYPE.time; 8297 return { 8298 val: { type, value, location: location_1, style }, 8299 err: null 8300 }; 8301 } 8302 } 8303 return { 8304 val: { 8305 type: argType === "number" ? TYPE.number : argType === "date" ? TYPE.date : TYPE.time, 8306 value, 8307 location: location_1, 8308 style: (_a2 = styleAndLocation?.style) !== null && _a2 !== void 0 ? _a2 : null 8309 }, 8310 err: null 8311 }; 8312 } 8313 case "plural": 8314 case "selectordinal": 8315 case "select": { 8316 var typeEndPosition_1 = this.clonePosition(); 8317 if (this.bumpSpace(), !this.bumpIf(",")) 8318 return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1))); 8319 this.bumpSpace(); 8320 var identifierAndLocation = this.parseIdentifierIfPossible(), pluralOffset = 0; 8321 if (argType !== "select" && identifierAndLocation.value === "offset") { 8322 if (!this.bumpIf(":")) 8323 return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition())); 8324 this.bumpSpace(); 8325 var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); 8326 if (result.err) 8327 return result; 8328 this.bumpSpace(), identifierAndLocation = this.parseIdentifierIfPossible(), pluralOffset = result.val; 8329 } 8330 var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation); 8331 if (optionsResult.err) 8332 return optionsResult; 8333 var argCloseResult = this.tryParseArgumentClose(openingBracePosition); 8334 if (argCloseResult.err) 8335 return argCloseResult; 8336 var location_2 = createLocation(openingBracePosition, this.clonePosition()); 8337 return argType === "select" ? { 8338 val: { 8339 type: TYPE.select, 8340 value, 8341 options: fromEntries(optionsResult.val), 8342 location: location_2 8343 }, 8344 err: null 8345 } : { 8346 val: { 8347 type: TYPE.plural, 8348 value, 8349 options: fromEntries(optionsResult.val), 8350 offset: pluralOffset, 8351 pluralType: argType === "plural" ? "cardinal" : "ordinal", 8352 location: location_2 8353 }, 8354 err: null 8355 }; 8356 } 8357 default: 8358 return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition)); 8359 } 8360 }, Parser2.prototype.tryParseArgumentClose = function(openingBracePosition) { 8361 return this.isEOF() || this.char() !== 125 ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())) : (this.bump(), { val: !0, err: null }); 8362 }, Parser2.prototype.parseSimpleArgStyleIfPossible = function() { 8363 for (var nestedBraces = 0, startPosition = this.clonePosition(); !this.isEOF(); ) { 8364 var ch = this.char(); 8365 switch (ch) { 8366 case 39: { 8367 this.bump(); 8368 var apostrophePosition = this.clonePosition(); 8369 if (!this.bumpUntil("'")) 8370 return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition())); 8371 this.bump(); 8372 break; 8373 } 8374 case 123: { 8375 nestedBraces += 1, this.bump(); 8376 break; 8377 } 8378 case 125: { 8379 if (nestedBraces > 0) 8380 nestedBraces -= 1; 8381 else 8382 return { 8383 val: this.message.slice(startPosition.offset, this.offset()), 8384 err: null 8385 }; 8386 break; 8387 } 8388 default: 8389 this.bump(); 8390 break; 8391 } 8392 } 8393 return { 8394 val: this.message.slice(startPosition.offset, this.offset()), 8395 err: null 8396 }; 8397 }, Parser2.prototype.parseNumberSkeletonFromString = function(skeleton, location2) { 8398 var tokens2 = []; 8399 try { 8400 tokens2 = parseNumberSkeletonFromString(skeleton); 8401 } catch { 8402 return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location2); 8403 } 8404 return { 8405 val: { 8406 type: SKELETON_TYPE.number, 8407 tokens: tokens2, 8408 location: location2, 8409 parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens2) : {} 8410 }, 8411 err: null 8412 }; 8413 }, Parser2.prototype.tryParsePluralOrSelectOptions = function(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) { 8414 for (var _a2, hasOtherClause = !1, options2 = [], parsedSelectors = /* @__PURE__ */ new Set(), selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location; ; ) { 8415 if (selector.length === 0) { 8416 var startPosition = this.clonePosition(); 8417 if (parentArgType !== "select" && this.bumpIf("=")) { 8418 var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR); 8419 if (result.err) 8420 return result; 8421 selectorLocation = createLocation(startPosition, this.clonePosition()), selector = this.message.slice(startPosition.offset, this.offset()); 8422 } else 8423 break; 8424 } 8425 if (parsedSelectors.has(selector)) 8426 return this.error(parentArgType === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation); 8427 selector === "other" && (hasOtherClause = !0), this.bumpSpace(); 8428 var openingBracePosition = this.clonePosition(); 8429 if (!this.bumpIf("{")) 8430 return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition())); 8431 var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag); 8432 if (fragmentResult.err) 8433 return fragmentResult; 8434 var argCloseResult = this.tryParseArgumentClose(openingBracePosition); 8435 if (argCloseResult.err) 8436 return argCloseResult; 8437 options2.push([ 8438 selector, 8439 { 8440 value: fragmentResult.val, 8441 location: createLocation(openingBracePosition, this.clonePosition()) 8442 } 8443 ]), parsedSelectors.add(selector), this.bumpSpace(), _a2 = this.parseIdentifierIfPossible(), selector = _a2.value, selectorLocation = _a2.location; 8444 } 8445 return options2.length === 0 ? this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !hasOtherClause ? this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition())) : { val: options2, err: null }; 8446 }, Parser2.prototype.tryParseDecimalInteger = function(expectNumberError, invalidNumberError) { 8447 var sign = 1, startingPosition = this.clonePosition(); 8448 this.bumpIf("+") || this.bumpIf("-") && (sign = -1); 8449 for (var hasDigits = !1, decimal = 0; !this.isEOF(); ) { 8450 var ch = this.char(); 8451 if (ch >= 48 && ch <= 57) 8452 hasDigits = !0, decimal = decimal * 10 + (ch - 48), this.bump(); 8453 else 8454 break; 8455 } 8456 var location2 = createLocation(startingPosition, this.clonePosition()); 8457 return hasDigits ? (decimal *= sign, isSafeInteger(decimal) ? { val: decimal, err: null } : this.error(invalidNumberError, location2)) : this.error(expectNumberError, location2); 8458 }, Parser2.prototype.offset = function() { 8459 return this.position.offset; 8460 }, Parser2.prototype.isEOF = function() { 8461 return this.offset() === this.message.length; 8462 }, Parser2.prototype.clonePosition = function() { 8463 return { 8464 offset: this.position.offset, 8465 line: this.position.line, 8466 column: this.position.column 8467 }; 8468 }, Parser2.prototype.char = function() { 8469 var offset2 = this.position.offset; 8470 if (offset2 >= this.message.length) 8471 throw Error("out of bound"); 8472 var code = codePointAt(this.message, offset2); 8473 if (code === void 0) 8474 throw Error("Offset ".concat(offset2, " is at invalid UTF-16 code unit boundary")); 8475 return code; 8476 }, Parser2.prototype.error = function(kind, location2) { 8477 return { 8478 val: null, 8479 err: { 8480 kind, 8481 message: this.message, 8482 location: location2 8483 } 8484 }; 8485 }, Parser2.prototype.bump = function() { 8486 if (!this.isEOF()) { 8487 var code = this.char(); 8488 code === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += code < 65536 ? 1 : 2); 8489 } 8490 }, Parser2.prototype.bumpIf = function(prefix) { 8491 if (startsWith(this.message, prefix, this.offset())) { 8492 for (var i2 = 0; i2 < prefix.length; i2++) 8493 this.bump(); 8494 return !0; 8495 } 8496 return !1; 8497 }, Parser2.prototype.bumpUntil = function(pattern) { 8498 var currentOffset = this.offset(), index = this.message.indexOf(pattern, currentOffset); 8499 return index >= 0 ? (this.bumpTo(index), !0) : (this.bumpTo(this.message.length), !1); 8500 }, Parser2.prototype.bumpTo = function(targetOffset) { 8501 if (this.offset() > targetOffset) 8502 throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset())); 8503 for (targetOffset = Math.min(targetOffset, this.message.length); ; ) { 8504 var offset2 = this.offset(); 8505 if (offset2 === targetOffset) 8506 break; 8507 if (offset2 > targetOffset) 8508 throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary")); 8509 if (this.bump(), this.isEOF()) 8510 break; 8511 } 8512 }, Parser2.prototype.bumpSpace = function() { 8513 for (; !this.isEOF() && _isWhiteSpace(this.char()); ) 8514 this.bump(); 8515 }, Parser2.prototype.peek = function() { 8516 if (this.isEOF()) 8517 return null; 8518 var code = this.char(), offset2 = this.offset(), nextCode = this.message.charCodeAt(offset2 + (code >= 65536 ? 2 : 1)); 8519 return nextCode ?? null; 8520 }, Parser2; 8521 })() 8522); 8523function _isAlpha(codepoint) { 8524 return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90; 8525} 8526function _isAlphaOrSlash(codepoint) { 8527 return _isAlpha(codepoint) || codepoint === 47; 8528} 8529function _isPotentialElementNameChar(c2) { 8530 return c2 === 45 || c2 === 46 || c2 >= 48 && c2 <= 57 || c2 === 95 || c2 >= 97 && c2 <= 122 || c2 >= 65 && c2 <= 90 || c2 == 183 || c2 >= 192 && c2 <= 214 || c2 >= 216 && c2 <= 246 || c2 >= 248 && c2 <= 893 || c2 >= 895 && c2 <= 8191 || c2 >= 8204 && c2 <= 8205 || c2 >= 8255 && c2 <= 8256 || c2 >= 8304 && c2 <= 8591 || c2 >= 11264 && c2 <= 12271 || c2 >= 12289 && c2 <= 55295 || c2 >= 63744 && c2 <= 64975 || c2 >= 65008 && c2 <= 65533 || c2 >= 65536 && c2 <= 983039; 8531} 8532function _isWhiteSpace(c2) { 8533 return c2 >= 9 && c2 <= 13 || c2 === 32 || c2 === 133 || c2 >= 8206 && c2 <= 8207 || c2 === 8232 || c2 === 8233; 8534} 8535function _isPatternSyntax(c2) { 8536 return c2 >= 33 && c2 <= 35 || c2 === 36 || c2 >= 37 && c2 <= 39 || c2 === 40 || c2 === 41 || c2 === 42 || c2 === 43 || c2 === 44 || c2 === 45 || c2 >= 46 && c2 <= 47 || c2 >= 58 && c2 <= 59 || c2 >= 60 && c2 <= 62 || c2 >= 63 && c2 <= 64 || c2 === 91 || c2 === 92 || c2 === 93 || c2 === 94 || c2 === 96 || c2 === 123 || c2 === 124 || c2 === 125 || c2 === 126 || c2 === 161 || c2 >= 162 && c2 <= 165 || c2 === 166 || c2 === 167 || c2 === 169 || c2 === 171 || c2 === 172 || c2 === 174 || c2 === 176 || c2 === 177 || c2 === 182 || c2 === 187 || c2 === 191 || c2 === 215 || c2 === 247 || c2 >= 8208 && c2 <= 8213 || c2 >= 8214 && c2 <= 8215 || c2 === 8216 || c2 === 8217 || c2 === 8218 || c2 >= 8219 && c2 <= 8220 || c2 === 8221 || c2 === 8222 || c2 === 8223 || c2 >= 8224 && c2 <= 8231 || c2 >= 8240 && c2 <= 8248 || c2 === 8249 || c2 === 8250 || c2 >= 8251 && c2 <= 8254 || c2 >= 8257 && c2 <= 8259 || c2 === 8260 || c2 === 8261 || c2 === 8262 || c2 >= 8263 && c2 <= 8273 || c2 === 8274 || c2 === 8275 || c2 >= 8277 && c2 <= 8286 || c2 >= 8592 && c2 <= 8596 || c2 >= 8597 && c2 <= 8601 || c2 >= 8602 && c2 <= 8603 || c2 >= 8604 && c2 <= 8607 || c2 === 8608 || c2 >= 8609 && c2 <= 8610 || c2 === 8611 || c2 >= 8612 && c2 <= 8613 || c2 === 8614 || c2 >= 8615 && c2 <= 8621 || c2 === 8622 || c2 >= 8623 && c2 <= 8653 || c2 >= 8654 && c2 <= 8655 || c2 >= 8656 && c2 <= 8657 || c2 === 8658 || c2 === 8659 || c2 === 8660 || c2 >= 8661 && c2 <= 8691 || c2 >= 8692 && c2 <= 8959 || c2 >= 8960 && c2 <= 8967 || c2 === 8968 || c2 === 8969 || c2 === 8970 || c2 === 8971 || c2 >= 8972 && c2 <= 8991 || c2 >= 8992 && c2 <= 8993 || c2 >= 8994 && c2 <= 9e3 || c2 === 9001 || c2 === 9002 || c2 >= 9003 && c2 <= 9083 || c2 === 9084 || c2 >= 9085 && c2 <= 9114 || c2 >= 9115 && c2 <= 9139 || c2 >= 9140 && c2 <= 9179 || c2 >= 9180 && c2 <= 9185 || c2 >= 9186 && c2 <= 9254 || c2 >= 9255 && c2 <= 9279 || c2 >= 9280 && c2 <= 9290 || c2 >= 9291 && c2 <= 9311 || c2 >= 9472 && c2 <= 9654 || c2 === 9655 || c2 >= 9656 && c2 <= 9664 || c2 === 9665 || c2 >= 9666 && c2 <= 9719 || c2 >= 9720 && c2 <= 9727 || c2 >= 9728 && c2 <= 9838 || c2 === 9839 || c2 >= 9840 && c2 <= 10087 || c2 === 10088 || c2 === 10089 || c2 === 10090 || c2 === 10091 || c2 === 10092 || c2 === 10093 || c2 === 10094 || c2 === 10095 || c2 === 10096 || c2 === 10097 || c2 === 10098 || c2 === 10099 || c2 === 10100 || c2 === 10101 || c2 >= 10132 && c2 <= 10175 || c2 >= 10176 && c2 <= 10180 || c2 === 10181 || c2 === 10182 || c2 >= 10183 && c2 <= 10213 || c2 === 10214 || c2 === 10215 || c2 === 10216 || c2 === 10217 || c2 === 10218 || c2 === 10219 || c2 === 10220 || c2 === 10221 || c2 === 10222 || c2 === 10223 || c2 >= 10224 && c2 <= 10239 || c2 >= 10240 && c2 <= 10495 || c2 >= 10496 && c2 <= 10626 || c2 === 10627 || c2 === 10628 || c2 === 10629 || c2 === 10630 || c2 === 10631 || c2 === 10632 || c2 === 10633 || c2 === 10634 || c2 === 10635 || c2 === 10636 || c2 === 10637 || c2 === 10638 || c2 === 10639 || c2 === 10640 || c2 === 10641 || c2 === 10642 || c2 === 10643 || c2 === 10644 || c2 === 10645 || c2 === 10646 || c2 === 10647 || c2 === 10648 || c2 >= 10649 && c2 <= 10711 || c2 === 10712 || c2 === 10713 || c2 === 10714 || c2 === 10715 || c2 >= 10716 && c2 <= 10747 || c2 === 10748 || c2 === 10749 || c2 >= 10750 && c2 <= 11007 || c2 >= 11008 && c2 <= 11055 || c2 >= 11056 && c2 <= 11076 || c2 >= 11077 && c2 <= 11078 || c2 >= 11079 && c2 <= 11084 || c2 >= 11085 && c2 <= 11123 || c2 >= 11124 && c2 <= 11125 || c2 >= 11126 && c2 <= 11157 || c2 === 11158 || c2 >= 11159 && c2 <= 11263 || c2 >= 11776 && c2 <= 11777 || c2 === 11778 || c2 === 11779 || c2 === 11780 || c2 === 11781 || c2 >= 11782 && c2 <= 11784 || c2 === 11785 || c2 === 11786 || c2 === 11787 || c2 === 11788 || c2 === 11789 || c2 >= 11790 && c2 <= 11798 || c2 === 11799 || c2 >= 11800 && c2 <= 11801 || c2 === 11802 || c2 === 11803 || c2 === 11804 || c2 === 11805 || c2 >= 11806 && c2 <= 11807 || c2 === 11808 || c2 === 11809 || c2 === 11810 || c2 === 11811 || c2 === 11812 || c2 === 11813 || c2 === 11814 || c2 === 11815 || c2 === 11816 || c2 === 11817 || c2 >= 11818 && c2 <= 11822 || c2 === 11823 || c2 >= 11824 && c2 <= 11833 || c2 >= 11834 && c2 <= 11835 || c2 >= 11836 && c2 <= 11839 || c2 === 11840 || c2 === 11841 || c2 === 11842 || c2 >= 11843 && c2 <= 11855 || c2 >= 11856 && c2 <= 11857 || c2 === 11858 || c2 >= 11859 && c2 <= 11903 || c2 >= 12289 && c2 <= 12291 || c2 === 12296 || c2 === 12297 || c2 === 12298 || c2 === 12299 || c2 === 12300 || c2 === 12301 || c2 === 12302 || c2 === 12303 || c2 === 12304 || c2 === 12305 || c2 >= 12306 && c2 <= 12307 || c2 === 12308 || c2 === 12309 || c2 === 12310 || c2 === 12311 || c2 === 12312 || c2 === 12313 || c2 === 12314 || c2 === 12315 || c2 === 12316 || c2 === 12317 || c2 >= 12318 && c2 <= 12319 || c2 === 12320 || c2 === 12336 || c2 === 64830 || c2 === 64831 || c2 >= 65093 && c2 <= 65094; 8537} 8538
vendor: 981 bytes, lines 8539-8557
8539// ../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js 8540function pruneLocation(els) { 8541 els.forEach(function(el) { 8542 if (delete el.location, isSelectElement(el) || isPluralElement(el)) 8543 for (var k2 in el.options) 8544 delete el.options[k2].location, pruneLocation(el.options[k2].value); 8545 else isNumberElement(el) && isNumberSkeleton(el.style) || (isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style) ? delete el.style.location : isTagElement(el) && pruneLocation(el.children); 8546 }); 8547} 8548function parse(message, opts) { 8549 opts === void 0 && (opts = {}), opts = __assign({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, opts); 8550 var result = new Parser(message, opts).parse(); 8551 if (result.err) { 8552 var error = SyntaxError(ErrorKind[result.err.kind]); 8553 throw error.location = result.err.location, error.originalMessage = result.err.message, error; 8554 } 8555 return opts?.captureLocation || pruneLocation(result.val), result.val; 8556} 8557
vendor: 2,018 bytes, lines 8558-8606
8558// ../../node_modules/intl-messageformat/lib/src/error.js 8559var ErrorCode; 8560(function(ErrorCode2) { 8561 ErrorCode2.MISSING_VALUE = "MISSING_VALUE", ErrorCode2.INVALID_VALUE = "INVALID_VALUE", ErrorCode2.MISSING_INTL_API = "MISSING_INTL_API"; 8562})(ErrorCode || (ErrorCode = {})); 8563var FormatError = ( 8564 /** @class */ 8565 (function(_super) { 8566 __extends(FormatError2, _super); 8567 function FormatError2(msg, code, originalMessage) { 8568 var _this = _super.call(this, msg) || this; 8569 return _this.code = code, _this.originalMessage = originalMessage, _this; 8570 } 8571 return FormatError2.prototype.toString = function() { 8572 return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); 8573 }, FormatError2; 8574 })(Error) 8575); 8576var InvalidValueError = ( 8577 /** @class */ 8578 (function(_super) { 8579 __extends(InvalidValueError2, _super); 8580 function InvalidValueError2(variableId, value, options2, originalMessage) { 8581 return _super.call(this, 'Invalid values for "'.concat(variableId, '": "').concat(value, '". Options are "').concat(Object.keys(options2).join('", "'), '"'), ErrorCode.INVALID_VALUE, originalMessage) || this; 8582 } 8583 return InvalidValueError2; 8584 })(FormatError) 8585); 8586var InvalidValueTypeError = ( 8587 /** @class */ 8588 (function(_super) { 8589 __extends(InvalidValueTypeError2, _super); 8590 function InvalidValueTypeError2(value, type, originalMessage) { 8591 return _super.call(this, 'Value for "'.concat(value, '" must be of type ').concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this; 8592 } 8593 return InvalidValueTypeError2; 8594 })(FormatError) 8595); 8596var MissingValueError = ( 8597 /** @class */ 8598 (function(_super) { 8599 __extends(MissingValueError2, _super); 8600 function MissingValueError2(variableId, originalMessage) { 8601 return _super.call(this, 'The intl string context variable "'.concat(variableId, '" was not provided to the string "').concat(originalMessage, '"'), ErrorCode.MISSING_VALUE, originalMessage) || this; 8602 } 8603 return MissingValueError2; 8604 })(FormatError) 8605); 8606
vendor: 4,638 bytes, lines 8607-8719
8607// ../../node_modules/intl-messageformat/lib/src/formatters.js 8608var PART_TYPE; 8609(function(PART_TYPE2) { 8610 PART_TYPE2[PART_TYPE2.literal = 0] = "literal", PART_TYPE2[PART_TYPE2.object = 1] = "object"; 8611})(PART_TYPE || (PART_TYPE = {})); 8612function mergeLiteral(parts) { 8613 return parts.length < 2 ? parts : parts.reduce(function(all, part) { 8614 var lastPart = all[all.length - 1]; 8615 return !lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal ? all.push(part) : lastPart.value += part.value, all; 8616 }, []); 8617} 8618function isFormatXMLElementFn(el) { 8619 return typeof el == "function"; 8620} 8621function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) { 8622 if (els.length === 1 && isLiteralElement(els[0])) 8623 return [ 8624 { 8625 type: PART_TYPE.literal, 8626 value: els[0].value 8627 } 8628 ]; 8629 for (var result = [], _i = 0, els_1 = els; _i < els_1.length; _i++) { 8630 var el = els_1[_i]; 8631 if (isLiteralElement(el)) { 8632 result.push({ 8633 type: PART_TYPE.literal, 8634 value: el.value 8635 }); 8636 continue; 8637 } 8638 if (isPoundElement(el)) { 8639 typeof currentPluralValue == "number" && result.push({ 8640 type: PART_TYPE.literal, 8641 value: formatters.getNumberFormat(locales).format(currentPluralValue) 8642 }); 8643 continue; 8644 } 8645 var varName = el.value; 8646 if (!(values && varName in values)) 8647 throw new MissingValueError(varName, originalMessage); 8648 var value = values[varName]; 8649 if (isArgumentElement(el)) { 8650 (!value || typeof value == "string" || typeof value == "number") && (value = typeof value == "string" || typeof value == "number" ? String(value) : ""), result.push({ 8651 type: typeof value == "string" ? PART_TYPE.literal : PART_TYPE.object, 8652 value 8653 }); 8654 continue; 8655 } 8656 if (isDateElement(el)) { 8657 var style = typeof el.style == "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0; 8658 result.push({ 8659 type: PART_TYPE.literal, 8660 value: formatters.getDateTimeFormat(locales, style).format(value) 8661 }); 8662 continue; 8663 } 8664 if (isTimeElement(el)) { 8665 var style = typeof el.style == "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium; 8666 result.push({ 8667 type: PART_TYPE.literal, 8668 value: formatters.getDateTimeFormat(locales, style).format(value) 8669 }); 8670 continue; 8671 } 8672 if (isNumberElement(el)) { 8673 var style = typeof el.style == "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0; 8674 style && style.scale && (value = value * (style.scale || 1)), result.push({ 8675 type: PART_TYPE.literal, 8676 value: formatters.getNumberFormat(locales, style).format(value) 8677 }); 8678 continue; 8679 } 8680 if (isTagElement(el)) { 8681 var children = el.children, value_1 = el.value, formatFn = values[value_1]; 8682 if (!isFormatXMLElementFn(formatFn)) 8683 throw new InvalidValueTypeError(value_1, "function", originalMessage); 8684 var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue), chunks = formatFn(parts.map(function(p2) { 8685 return p2.value; 8686 })); 8687 Array.isArray(chunks) || (chunks = [chunks]), result.push.apply(result, chunks.map(function(c2) { 8688 return { 8689 type: typeof c2 == "string" ? PART_TYPE.literal : PART_TYPE.object, 8690 value: c2 8691 }; 8692 })); 8693 } 8694 if (isSelectElement(el)) { 8695 var opt = el.options[value] || el.options.other; 8696 if (!opt) 8697 throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); 8698 result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values)); 8699 continue; 8700 } 8701 if (isPluralElement(el)) { 8702 var opt = el.options["=".concat(value)]; 8703 if (!opt) { 8704 if (!Intl.PluralRules) 8705 throw new FormatError(`Intl.PluralRules is not available in this environment. 8706Try polyfilling it using "@formatjs/intl-pluralrules" 8707`, ErrorCode.MISSING_INTL_API, originalMessage); 8708 var rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(value - (el.offset || 0)); 8709 opt = el.options[rule] || el.options.other; 8710 } 8711 if (!opt) 8712 throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); 8713 result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0))); 8714 continue; 8715 } 8716 } 8717 return mergeLiteral(result); 8718} 8719
vendor: 6,159 bytes, lines 8720-8887
8720// ../../node_modules/intl-messageformat/lib/src/core.js 8721function mergeConfig(c1, c2) { 8722 return c2 ? __assign(__assign(__assign({}, c1 || {}), c2 || {}), Object.keys(c1).reduce(function(all, k2) { 8723 return all[k2] = __assign(__assign({}, c1[k2]), c2[k2] || {}), all; 8724 }, {})) : c1; 8725} 8726function mergeConfigs(defaultConfig, configs) { 8727 return configs ? Object.keys(defaultConfig).reduce(function(all, k2) { 8728 return all[k2] = mergeConfig(defaultConfig[k2], configs[k2]), all; 8729 }, __assign({}, defaultConfig)) : defaultConfig; 8730} 8731function createFastMemoizeCache(store2) { 8732 return { 8733 create: function() { 8734 return { 8735 get: function(key) { 8736 return store2[key]; 8737 }, 8738 set: function(key, value) { 8739 store2[key] = value; 8740 } 8741 }; 8742 } 8743 }; 8744} 8745function createDefaultFormatters(cache) { 8746 return cache === void 0 && (cache = { 8747 number: {}, 8748 dateTime: {}, 8749 pluralRules: {} 8750 }), { 8751 getNumberFormat: memoize(function() { 8752 for (var _a2, args = [], _i = 0; _i < arguments.length; _i++) 8753 args[_i] = arguments[_i]; 8754 return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args, !1)))(); 8755 }, { 8756 cache: createFastMemoizeCache(cache.number), 8757 strategy: strategies.variadic 8758 }), 8759 getDateTimeFormat: memoize(function() { 8760 for (var _a2, args = [], _i = 0; _i < arguments.length; _i++) 8761 args[_i] = arguments[_i]; 8762 return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args, !1)))(); 8763 }, { 8764 cache: createFastMemoizeCache(cache.dateTime), 8765 strategy: strategies.variadic 8766 }), 8767 getPluralRules: memoize(function() { 8768 for (var _a2, args = [], _i = 0; _i < arguments.length; _i++) 8769 args[_i] = arguments[_i]; 8770 return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args, !1)))(); 8771 }, { 8772 cache: createFastMemoizeCache(cache.pluralRules), 8773 strategy: strategies.variadic 8774 }) 8775 }; 8776} 8777var IntlMessageFormat = ( 8778 /** @class */ 8779 (function() { 8780 function IntlMessageFormat2(message, locales, overrideFormats, opts) { 8781 locales === void 0 && (locales = IntlMessageFormat2.defaultLocale); 8782 var _this = this; 8783 if (this.formatterCache = { 8784 number: {}, 8785 dateTime: {}, 8786 pluralRules: {} 8787 }, this.format = function(values) { 8788 var parts = _this.formatToParts(values); 8789 if (parts.length === 1) 8790 return parts[0].value; 8791 var result = parts.reduce(function(all, part) { 8792 return !all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] != "string" ? all.push(part.value) : all[all.length - 1] += part.value, all; 8793 }, []); 8794 return result.length <= 1 ? result[0] || "" : result; 8795 }, this.formatToParts = function(values) { 8796 return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, void 0, _this.message); 8797 }, this.resolvedOptions = function() { 8798 var _a3; 8799 return { 8800 locale: ((_a3 = _this.resolvedLocale) === null || _a3 === void 0 ? void 0 : _a3.toString()) || Intl.NumberFormat.supportedLocalesOf(_this.locales)[0] 8801 }; 8802 }, this.getAst = function() { 8803 return _this.ast; 8804 }, this.locales = locales, this.resolvedLocale = IntlMessageFormat2.resolveLocale(locales), typeof message == "string") { 8805 if (this.message = message, !IntlMessageFormat2.__parse) 8806 throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`"); 8807 var _a2 = opts || {}, formatters = _a2.formatters, parseOpts = __rest(_a2, ["formatters"]); 8808 this.ast = IntlMessageFormat2.__parse(message, __assign(__assign({}, parseOpts), { locale: this.resolvedLocale })); 8809 } else 8810 this.ast = message; 8811 if (!Array.isArray(this.ast)) 8812 throw new TypeError("A message must be provided as a String or AST."); 8813 this.formats = mergeConfigs(IntlMessageFormat2.formats, overrideFormats), this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache); 8814 } 8815 return Object.defineProperty(IntlMessageFormat2, "defaultLocale", { 8816 get: function() { 8817 return IntlMessageFormat2.memoizedDefaultLocale || (IntlMessageFormat2.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), IntlMessageFormat2.memoizedDefaultLocale; 8818 }, 8819 enumerable: !1, 8820 configurable: !0 8821 }), IntlMessageFormat2.memoizedDefaultLocale = null, IntlMessageFormat2.resolveLocale = function(locales) { 8822 if (!(typeof Intl.Locale > "u")) { 8823 var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); 8824 return supportedLocales.length > 0 ? new Intl.Locale(supportedLocales[0]) : new Intl.Locale(typeof locales == "string" ? locales : locales[0]); 8825 } 8826 }, IntlMessageFormat2.__parse = parse, IntlMessageFormat2.formats = { 8827 number: { 8828 integer: { 8829 maximumFractionDigits: 0 8830 }, 8831 currency: { 8832 style: "currency" 8833 }, 8834 percent: { 8835 style: "percent" 8836 } 8837 }, 8838 date: { 8839 short: { 8840 month: "numeric", 8841 day: "numeric", 8842 year: "2-digit" 8843 }, 8844 medium: { 8845 month: "short", 8846 day: "numeric", 8847 year: "numeric" 8848 }, 8849 long: { 8850 month: "long", 8851 day: "numeric", 8852 year: "numeric" 8853 }, 8854 full: { 8855 weekday: "long", 8856 month: "long", 8857 day: "numeric", 8858 year: "numeric" 8859 } 8860 }, 8861 time: { 8862 short: { 8863 hour: "numeric", 8864 minute: "numeric" 8865 }, 8866 medium: { 8867 hour: "numeric", 8868 minute: "numeric", 8869 second: "numeric" 8870 }, 8871 long: { 8872 hour: "numeric", 8873 minute: "numeric", 8874 second: "numeric", 8875 timeZoneName: "short" 8876 }, 8877 full: { 8878 hour: "numeric", 8879 minute: "numeric", 8880 second: "numeric", 8881 timeZoneName: "short" 8882 } 8883 } 8884 }, IntlMessageFormat2; 8885 })() 8886); 8887
vendor: 83 bytes, lines 8888-8890
8888// ../../node_modules/@react-aria/i18n/dist/useMessageFormatter.mjs 8889init_react(); 8890
vendor: 91 bytes, lines 8891-8893
8891// ../../node_modules/@react-aria/i18n/dist/useLocalizedStringFormatter.mjs 8892init_react(); 8893
vendor: 80 bytes, lines 8894-8896
8894// ../../node_modules/@react-aria/i18n/dist/useListFormatter.mjs 8895init_react(); 8896
vendor: 309 bytes, lines 8897-8909
8897// ../../node_modules/@internationalized/date/dist/string.mjs 8898var $fae977aafc393c5c$var$requiredDurationTimeGroups = [ 8899 "hours", 8900 "minutes", 8901 "seconds" 8902], $fae977aafc393c5c$var$requiredDurationGroups = [ 8903 "years", 8904 "months", 8905 "weeks", 8906 "days", 8907 ...$fae977aafc393c5c$var$requiredDurationTimeGroups 8908]; 8909
vendor: 449 bytes, lines 8910-8912
8910// ../../node_modules/@internationalized/date/dist/HebrewCalendar.mjs 8911var $7c5f6fbf42389787$var$HOUR_PARTS = 1080, $7c5f6fbf42389787$var$DAY_PARTS = 24 * $7c5f6fbf42389787$var$HOUR_PARTS, $7c5f6fbf42389787$var$MONTH_DAYS = 29, $7c5f6fbf42389787$var$MONTH_FRACT = 12 * $7c5f6fbf42389787$var$HOUR_PARTS + 793, $7c5f6fbf42389787$var$MONTH_PARTS = $7c5f6fbf42389787$var$MONTH_DAYS * $7c5f6fbf42389787$var$DAY_PARTS + $7c5f6fbf42389787$var$MONTH_FRACT; 8912
vendor: 80 bytes, lines 8913-8915
8913// ../../node_modules/@react-aria/i18n/dist/useDateFormatter.mjs 8914init_react(); 8915
vendor: 520 bytes, lines 8916-8932
8916// ../../node_modules/@internationalized/number/dist/NumberFormatter.mjs 8917var $488c6ddbf4ef74c2$var$supportsSignDisplay = !1; 8918try { 8919 $488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", { 8920 signDisplay: "exceptZero" 8921 }).resolvedOptions().signDisplay === "exceptZero"; 8922} catch { 8923} 8924var $488c6ddbf4ef74c2$var$supportsUnit = !1; 8925try { 8926 $488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat("de-DE", { 8927 style: "unit", 8928 unit: "degree" 8929 }).resolvedOptions().style === "unit"; 8930} catch { 8931} 8932
vendor: 149 bytes, lines 8933-8935
8933// ../../node_modules/@internationalized/number/dist/NumberParser.mjs 8934var $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX = new RegExp("^.*\\(.*\\).*$"); 8935
vendor: 82 bytes, lines 8936-8938
8936// ../../node_modules/@react-aria/i18n/dist/useNumberFormatter.mjs 8937init_react(); 8938
vendor: 73 bytes, lines 8939-8941
8939// ../../node_modules/@react-aria/i18n/dist/useFilter.mjs 8940init_react(); 8941
vendor: 6,787 bytes, lines 8942-9081
8942// ../../node_modules/@react-aria/overlays/dist/useOverlayPosition.mjs 8943var $2a41e45df1593e64$var$visualViewport = typeof document < "u" ? window.visualViewport : null; 8944function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) { 8945 let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), { arrowSize, targetRef, overlayRef, arrowRef, scrollRef = overlayRef, placement = "bottom", containerPadding = 12, shouldFlip = !0, boundaryElement = typeof document < "u" ? document.body : null, offset: offset2 = 0, crossOffset = 0, shouldUpdatePosition = !0, isOpen = !0, onClose, maxHeight, arrowBoundaryOffset = 0 } = props, [position, setPosition] = useState(null), deps = [ 8946 shouldUpdatePosition, 8947 placement, 8948 overlayRef.current, 8949 targetRef.current, 8950 arrowRef?.current, 8951 scrollRef.current, 8952 containerPadding, 8953 shouldFlip, 8954 boundaryElement, 8955 offset2, 8956 crossOffset, 8957 isOpen, 8958 direction, 8959 maxHeight, 8960 arrowBoundaryOffset, 8961 arrowSize 8962 ], lastScale = useRef($2a41e45df1593e64$var$visualViewport?.scale); 8963 useEffect(() => { 8964 isOpen && (lastScale.current = $2a41e45df1593e64$var$visualViewport?.scale); 8965 }, [ 8966 isOpen 8967 ]); 8968 let updatePosition = useCallback(() => { 8969 if (shouldUpdatePosition === !1 || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement || $2a41e45df1593e64$var$visualViewport?.scale !== lastScale.current) return; 8970 let anchor = null; 8971 if (scrollRef.current && scrollRef.current.contains(document.activeElement)) { 8972 var _document_activeElement; 8973 let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.getBoundingClientRect(), scrollRect = scrollRef.current.getBoundingClientRect(); 8974 var _anchorRect_top; 8975 if (anchor = { 8976 type: "top", 8977 offset: ((_anchorRect_top = anchorRect?.top) !== null && _anchorRect_top !== void 0 ? _anchorRect_top : 0) - scrollRect.top 8978 }, anchor.offset > scrollRect.height / 2) { 8979 anchor.type = "bottom"; 8980 var _anchorRect_bottom; 8981 anchor.offset = ((_anchorRect_bottom = anchorRect?.bottom) !== null && _anchorRect_bottom !== void 0 ? _anchorRect_bottom : 0) - scrollRect.bottom; 8982 } 8983 } 8984 let overlay = overlayRef.current; 8985 if (!maxHeight && overlayRef.current) { 8986 var _window_visualViewport; 8987 overlay.style.top = "0px", overlay.style.bottom = ""; 8988 var _window_visualViewport_height; 8989 overlay.style.maxHeight = ((_window_visualViewport_height = (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.height) !== null && _window_visualViewport_height !== void 0 ? _window_visualViewport_height : window.innerHeight) + "px"; 8990 } 8991 let position2 = $edcf132a9284368a$export$b3ceb0cbf1056d98({ 8992 placement: $2a41e45df1593e64$var$translateRTL(placement, direction), 8993 overlayNode: overlayRef.current, 8994 targetNode: targetRef.current, 8995 scrollNode: scrollRef.current || overlayRef.current, 8996 padding: containerPadding, 8997 shouldFlip, 8998 boundaryElement, 8999 offset: offset2, 9000 crossOffset, 9001 maxHeight, 9002 arrowSize: arrowSize ?? (arrowRef?.current ? $edcf132a9284368a$export$4b834cebd9e5cebe(arrowRef.current, !0).width : 0), 9003 arrowBoundaryOffset 9004 }); 9005 if (position2.position) { 9006 if (overlay.style.top = "", overlay.style.bottom = "", overlay.style.left = "", overlay.style.right = "", Object.keys(position2.position).forEach((key) => overlay.style[key] = position2.position[key] + "px"), overlay.style.maxHeight = position2.maxHeight != null ? position2.maxHeight + "px" : "", anchor && document.activeElement && scrollRef.current) { 9007 let anchorRect = document.activeElement.getBoundingClientRect(), scrollRect = scrollRef.current.getBoundingClientRect(), newOffset = anchorRect[anchor.type] - scrollRect[anchor.type]; 9008 scrollRef.current.scrollTop += newOffset - anchor.offset; 9009 } 9010 setPosition(position2); 9011 } 9012 }, deps); 9013 $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(updatePosition, deps), $2a41e45df1593e64$var$useResize(updatePosition), $9daab02d461809db$export$683480f191c0e3ea({ 9014 ref: overlayRef, 9015 onResize: updatePosition 9016 }), $9daab02d461809db$export$683480f191c0e3ea({ 9017 ref: targetRef, 9018 onResize: updatePosition 9019 }); 9020 let isResizing = useRef(!1); 9021 $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => { 9022 let timeout, onResize = () => { 9023 isResizing.current = !0, clearTimeout(timeout), timeout = setTimeout(() => { 9024 isResizing.current = !1; 9025 }, 500), updatePosition(); 9026 }, onScroll = () => { 9027 isResizing.current && onResize(); 9028 }; 9029 return $2a41e45df1593e64$var$visualViewport?.addEventListener("resize", onResize), $2a41e45df1593e64$var$visualViewport?.addEventListener("scroll", onScroll), () => { 9030 $2a41e45df1593e64$var$visualViewport?.removeEventListener("resize", onResize), $2a41e45df1593e64$var$visualViewport?.removeEventListener("scroll", onScroll); 9031 }; 9032 }, [ 9033 updatePosition 9034 ]); 9035 let close = useCallback(() => { 9036 isResizing.current || onClose?.(); 9037 }, [ 9038 onClose, 9039 isResizing 9040 ]); 9041 $dd149f63282afbbf$export$18fc8428861184da({ 9042 triggerRef: targetRef, 9043 isOpen, 9044 onClose: onClose && close 9045 }); 9046 var _position_maxHeight, _position_placement, _position_triggerAnchorPoint; 9047 return { 9048 overlayProps: { 9049 style: { 9050 position: position ? "absolute" : "fixed", 9051 top: position ? void 0 : 0, 9052 left: position ? void 0 : 0, 9053 zIndex: 1e5, 9054 ...position?.position, 9055 maxHeight: (_position_maxHeight = position?.maxHeight) !== null && _position_maxHeight !== void 0 ? _position_maxHeight : "100vh" 9056 } 9057 }, 9058 placement: (_position_placement = position?.placement) !== null && _position_placement !== void 0 ? _position_placement : null, 9059 triggerAnchorPoint: (_position_triggerAnchorPoint = position?.triggerAnchorPoint) !== null && _position_triggerAnchorPoint !== void 0 ? _position_triggerAnchorPoint : null, 9060 arrowProps: { 9061 "aria-hidden": "true", 9062 role: "presentation", 9063 style: { 9064 left: position?.arrowOffsetLeft, 9065 top: position?.arrowOffsetTop 9066 } 9067 }, 9068 updatePosition 9069 }; 9070} 9071function $2a41e45df1593e64$var$useResize(onResize) { 9072 $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => (window.addEventListener("resize", onResize, !1), () => { 9073 window.removeEventListener("resize", onResize, !1); 9074 }), [ 9075 onResize 9076 ]); 9077} 9078function $2a41e45df1593e64$var$translateRTL(position, direction) { 9079 return direction === "rtl" ? position.replace("start", "right").replace("end", "left") : position.replace("start", "left").replace("end", "right"); 9080} 9081
vendor: 2,785 bytes, lines 9082-9142
9082// ../../node_modules/@react-aria/focus/dist/FocusScope.mjs 9083init_react(); 9084var $9bf71ea28793e738$var$FocusContext = react_default.createContext(null); 9085function $9bf71ea28793e738$var$isElementInScope(element, scope2) { 9086 return !element || !scope2 ? !1 : scope2.some((node) => node.contains(element)); 9087} 9088var $9bf71ea28793e738$var$Tree = class _$9bf71ea28793e738$var$Tree { 9089 get size() { 9090 return this.fastMap.size; 9091 } 9092 getTreeNode(data) { 9093 return this.fastMap.get(data); 9094 } 9095 addTreeNode(scopeRef, parent, nodeToRestore) { 9096 let parentNode = this.fastMap.get(parent ?? null); 9097 if (!parentNode) return; 9098 let node = new $9bf71ea28793e738$var$TreeNode({ 9099 scopeRef 9100 }); 9101 parentNode.addChild(node), node.parent = parentNode, this.fastMap.set(scopeRef, node), nodeToRestore && (node.nodeToRestore = nodeToRestore); 9102 } 9103 addNode(node) { 9104 this.fastMap.set(node.scopeRef, node); 9105 } 9106 removeTreeNode(scopeRef) { 9107 if (scopeRef === null) return; 9108 let node = this.fastMap.get(scopeRef); 9109 if (!node) return; 9110 let parentNode = node.parent; 9111 for (let current of this.traverse()) current !== node && node.nodeToRestore && current.nodeToRestore && node.scopeRef && node.scopeRef.current && $9bf71ea28793e738$var$isElementInScope(current.nodeToRestore, node.scopeRef.current) && (current.nodeToRestore = node.nodeToRestore); 9112 let children = node.children; 9113 parentNode && (parentNode.removeChild(node), children.size > 0 && children.forEach((child) => parentNode && parentNode.addChild(child))), this.fastMap.delete(node.scopeRef); 9114 } 9115 // Pre Order Depth First 9116 *traverse(node = this.root) { 9117 if (node.scopeRef != null && (yield node), node.children.size > 0) for (let child of node.children) yield* this.traverse(child); 9118 } 9119 clone() { 9120 var _node_parent; 9121 let newTree = new _$9bf71ea28793e738$var$Tree(); 9122 var _node_parent_scopeRef; 9123 for (let node of this.traverse()) newTree.addTreeNode(node.scopeRef, (_node_parent_scopeRef = (_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.scopeRef) !== null && _node_parent_scopeRef !== void 0 ? _node_parent_scopeRef : null, node.nodeToRestore); 9124 return newTree; 9125 } 9126 constructor() { 9127 this.fastMap = /* @__PURE__ */ new Map(), this.root = new $9bf71ea28793e738$var$TreeNode({ 9128 scopeRef: null 9129 }), this.fastMap.set(null, this.root); 9130 } 9131}, $9bf71ea28793e738$var$TreeNode = class { 9132 addChild(node) { 9133 this.children.add(node), node.parent = this; 9134 } 9135 removeChild(node) { 9136 this.children.delete(node), node.parent = void 0; 9137 } 9138 constructor(props) { 9139 this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = props.scopeRef; 9140 } 9141}, $9bf71ea28793e738$export$d06fae2ee68b101e = new $9bf71ea28793e738$var$Tree(); 9142
vendor: 77 bytes, lines 9143-9145
9143// ../../node_modules/@react-aria/focus/dist/useFocusRing.mjs 9144init_react(); 9145
vendor: 74 bytes, lines 9146-9148
9146// ../../node_modules/@react-aria/focus/dist/FocusRing.mjs 9147init_react(); 9148
vendor: 84 bytes, lines 9149-9151
9149// ../../node_modules/@react-aria/focus/dist/useHasTabbableChild.mjs 9150init_react(); 9151
vendor: 78 bytes, lines 9152-9154
9152// ../../node_modules/@react-aria/overlays/dist/useOverlay.mjs 9153init_react(); 9154
vendor: 85 bytes, lines 9155-9157
9155// ../../node_modules/@react-aria/overlays/dist/useOverlayTrigger.mjs 9156init_react(); 9157
vendor: 161 bytes, lines 9158-9160
9158// ../../node_modules/@react-aria/overlays/dist/usePreventScroll.mjs 9159var $49c51c25361d4cd2$var$visualViewport = typeof document < "u" && window.visualViewport; 9160
vendor: 359 bytes, lines 9161-9168
9161// ../../node_modules/@react-aria/overlays/dist/PortalProvider.mjs 9162init_react(); 9163var $96b38030c423d352$export$60d741e20e0aa309 = createContext({}); 9164function $96b38030c423d352$export$9fc1347d4195ccb3() { 9165 var _useContext; 9166 return (_useContext = useContext($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {}; 9167} 9168
vendor: 2,241 bytes, lines 9169-9219
9169// ../../node_modules/@react-aria/overlays/dist/useModal.mjs 9170init_react(); 9171var $f57aed4a881a3485$var$Context = react_default.createContext(null); 9172function $f57aed4a881a3485$export$178405afcd8c5eb(props) { 9173 let { children } = props, parent = useContext($f57aed4a881a3485$var$Context), [modalCount, setModalCount] = useState(0), context = useMemo(() => ({ 9174 parent, 9175 modalCount, 9176 addModal() { 9177 setModalCount((count) => count + 1), parent && parent.addModal(); 9178 }, 9179 removeModal() { 9180 setModalCount((count) => count - 1), parent && parent.removeModal(); 9181 } 9182 }), [ 9183 parent, 9184 modalCount 9185 ]); 9186 return react_default.createElement($f57aed4a881a3485$var$Context.Provider, { 9187 value: context 9188 }, children); 9189} 9190function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() { 9191 let context = useContext($f57aed4a881a3485$var$Context); 9192 return { 9193 modalProviderProps: { 9194 "aria-hidden": context && context.modalCount > 0 ? !0 : void 0 9195 } 9196 }; 9197} 9198function $f57aed4a881a3485$var$OverlayContainerDOM(props) { 9199 let { modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0(); 9200 return react_default.createElement("div", { 9201 "data-overlay-container": !0, 9202 ...props, 9203 ...modalProviderProps 9204 }); 9205} 9206function $f57aed4a881a3485$export$bf688221f59024e5(props) { 9207 return react_default.createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, react_default.createElement($f57aed4a881a3485$var$OverlayContainerDOM, props)); 9208} 9209function $f57aed4a881a3485$export$b47c3594eab58386(props) { 9210 let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273(), { portalContainer = isSSR ? null : document.body, ...rest2 } = props, { getContainer } = $96b38030c423d352$export$9fc1347d4195ccb3(); 9211 if (!props.portalContainer && getContainer && (portalContainer = getContainer()), react_default.useEffect(() => { 9212 if (portalContainer?.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop."); 9213 }, [ 9214 portalContainer 9215 ]), !portalContainer) return null; 9216 let contents = react_default.createElement($f57aed4a881a3485$export$bf688221f59024e5, rest2); 9217 return react_dom_default.createPortal(contents, portalContainer); 9218} 9219
vendor: 172 bytes, lines 9220-9225
9220// ../../node_modules/@react-aria/overlays/dist/ar-AE.mjs 9221var $773d5888b972f1cf$exports = {}; 9222$773d5888b972f1cf$exports = { 9223 dismiss: "\u062A\u062C\u0627\u0647\u0644" 9224}; 9225
vendor: 202 bytes, lines 9226-9231
9226// ../../node_modules/@react-aria/overlays/dist/bg-BG.mjs 9227var $d11f19852b941573$exports = {}; 9228$d11f19852b941573$exports = { 9229 dismiss: "\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435" 9230}; 9231
vendor: 151 bytes, lines 9232-9237
9232// ../../node_modules/@react-aria/overlays/dist/cs-CZ.mjs 9233var $b983974c2ee1efb3$exports = {}; 9234$b983974c2ee1efb3$exports = { 9235 dismiss: "Odstranit" 9236}; 9237
vendor: 145 bytes, lines 9238-9243
9238// ../../node_modules/@react-aria/overlays/dist/da-DK.mjs 9239var $5809cc9d4e92de73$exports = {}; 9240$5809cc9d4e92de73$exports = { 9241 dismiss: "Luk" 9242}; 9243
vendor: 154 bytes, lines 9244-9249
9244// ../../node_modules/@react-aria/overlays/dist/de-DE.mjs 9245var $c68c2e4fc74398d1$exports = {}; 9246$c68c2e4fc74398d1$exports = { 9247 dismiss: "Schlie\xDFen" 9248}; 9249
vendor: 190 bytes, lines 9250-9255
9250// ../../node_modules/@react-aria/overlays/dist/el-GR.mjs 9251var $0898b4c153db2b77$exports = {}; 9252$0898b4c153db2b77$exports = { 9253 dismiss: "\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7" 9254}; 9255
vendor: 149 bytes, lines 9256-9261
9256// ../../node_modules/@react-aria/overlays/dist/en-US.mjs 9257var $6d74810286a15183$exports = {}; 9258$6d74810286a15183$exports = { 9259 dismiss: "Dismiss" 9260}; 9261
vendor: 151 bytes, lines 9262-9267
9262// ../../node_modules/@react-aria/overlays/dist/es-ES.mjs 9263var $309d73dc65f78055$exports = {}; 9264$309d73dc65f78055$exports = { 9265 dismiss: "Descartar" 9266}; 9267
vendor: 151 bytes, lines 9268-9273
9268// ../../node_modules/@react-aria/overlays/dist/et-EE.mjs 9269var $44ad94f7205cf593$exports = {}; 9270$44ad94f7205cf593$exports = { 9271 dismiss: "L\xF5peta" 9272}; 9273
vendor: 154 bytes, lines 9274-9279
9274// ../../node_modules/@react-aria/overlays/dist/fi-FI.mjs 9275var $7c28f5687f0779a9$exports = {}; 9276$7c28f5687f0779a9$exports = { 9277 dismiss: "Hylk\xE4\xE4" 9278}; 9279
vendor: 149 bytes, lines 9280-9285
9280// ../../node_modules/@react-aria/overlays/dist/fr-FR.mjs 9281var $e6d75df4b68bd73a$exports = {}; 9282$e6d75df4b68bd73a$exports = { 9283 dismiss: "Rejeter" 9284}; 9285
vendor: 172 bytes, lines 9286-9291
9286// ../../node_modules/@react-aria/overlays/dist/he-IL.mjs 9287var $87505c9dab186d0f$exports = {}; 9288$87505c9dab186d0f$exports = { 9289 dismiss: "\u05D4\u05EA\u05E2\u05DC\u05DD" 9290}; 9291
vendor: 148 bytes, lines 9292-9297
9292// ../../node_modules/@react-aria/overlays/dist/hr-HR.mjs 9293var $553439c3ffb3e492$exports = {}; 9294$553439c3ffb3e492$exports = { 9295 dismiss: "Odbaci" 9296}; 9297
vendor: 158 bytes, lines 9298-9303
9298// ../../node_modules/@react-aria/overlays/dist/hu-HU.mjs 9299var $74cf411061b983a2$exports = {}; 9300$74cf411061b983a2$exports = { 9301 dismiss: "Elutas\xEDt\xE1s" 9302}; 9303
vendor: 148 bytes, lines 9304-9309
9304// ../../node_modules/@react-aria/overlays/dist/it-IT.mjs 9305var $e933f298574dc435$exports = {}; 9306$e933f298574dc435$exports = { 9307 dismiss: "Ignora" 9308}; 9309
vendor: 160 bytes, lines 9310-9315
9310// ../../node_modules/@react-aria/overlays/dist/ja-JP.mjs 9311var $ac91fc9fe02f71f6$exports = {}; 9312$ac91fc9fe02f71f6$exports = { 9313 dismiss: "\u9589\u3058\u308B" 9314}; 9315
vendor: 154 bytes, lines 9316-9321
9316// ../../node_modules/@react-aria/overlays/dist/ko-KR.mjs 9317var $52b96f86422025af$exports = {}; 9318$52b96f86422025af$exports = { 9319 dismiss: "\uBB34\uC2DC" 9320}; 9321
vendor: 149 bytes, lines 9322-9327
9322// ../../node_modules/@react-aria/overlays/dist/lt-LT.mjs 9323var $c0d724c3e51dafa6$exports = {}; 9324$c0d724c3e51dafa6$exports = { 9325 dismiss: "Atmesti" 9326}; 9327
vendor: 159 bytes, lines 9328-9333
9328// ../../node_modules/@react-aria/overlays/dist/lv-LV.mjs 9329var $c92899672a3fe72e$exports = {}; 9330$c92899672a3fe72e$exports = { 9331 dismiss: "Ner\u0101d\u012Bt" 9332}; 9333
vendor: 146 bytes, lines 9334-9339
9334// ../../node_modules/@react-aria/overlays/dist/nb-NO.mjs 9335var $9f576b39d8e7a9d6$exports = {}; 9336$9f576b39d8e7a9d6$exports = { 9337 dismiss: "Lukk" 9338}; 9339
vendor: 149 bytes, lines 9340-9345
9340// ../../node_modules/@react-aria/overlays/dist/nl-NL.mjs 9341var $9d025808aeec81a7$exports = {}; 9342$9d025808aeec81a7$exports = { 9343 dismiss: "Negeren" 9344}; 9345
vendor: 150 bytes, lines 9346-9351
9346// ../../node_modules/@react-aria/overlays/dist/pl-PL.mjs 9347var $fce709921e2c0fa6$exports = {}; 9348$fce709921e2c0fa6$exports = { 9349 dismiss: "Zignoruj" 9350}; 9351
vendor: 151 bytes, lines 9352-9357
9352// ../../node_modules/@react-aria/overlays/dist/pt-BR.mjs 9353var $2599cf0c4ab37f59$exports = {}; 9354$2599cf0c4ab37f59$exports = { 9355 dismiss: "Descartar" 9356}; 9357
vendor: 151 bytes, lines 9358-9363
9358// ../../node_modules/@react-aria/overlays/dist/pt-PT.mjs 9359var $3c220ae7ef8a35fd$exports = {}; 9360$3c220ae7ef8a35fd$exports = { 9361 dismiss: "Dispensar" 9362}; 9363
vendor: 150 bytes, lines 9364-9369
9364// ../../node_modules/@react-aria/overlays/dist/ro-RO.mjs 9365var $93562b5094072f54$exports = {}; 9366$93562b5094072f54$exports = { 9367 dismiss: "Revocare" 9368}; 9369
vendor: 202 bytes, lines 9370-9375
9370// ../../node_modules/@react-aria/overlays/dist/ru-RU.mjs 9371var $cd9e2abd0d06c7b4$exports = {}; 9372$cd9e2abd0d06c7b4$exports = { 9373 dismiss: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" 9374}; 9375
vendor: 158 bytes, lines 9376-9381
9376// ../../node_modules/@react-aria/overlays/dist/sk-SK.mjs 9377var $45375701f409adf1$exports = {}; 9378$45375701f409adf1$exports = { 9379 dismiss: "Zru\u0161i\u0165" 9380}; 9381
vendor: 148 bytes, lines 9382-9387
9382// ../../node_modules/@react-aria/overlays/dist/sl-SI.mjs 9383var $27fab53a576de9dd$exports = {}; 9384$27fab53a576de9dd$exports = { 9385 dismiss: "Opusti" 9386}; 9387
vendor: 148 bytes, lines 9388-9393
9388// ../../node_modules/@react-aria/overlays/dist/sr-SP.mjs 9389var $4438748d9952e7c7$exports = {}; 9390$4438748d9952e7c7$exports = { 9391 dismiss: "Odbaci" 9392}; 9393
vendor: 148 bytes, lines 9394-9399
9394// ../../node_modules/@react-aria/overlays/dist/sv-SE.mjs 9395var $0936d7347ef4da4c$exports = {}; 9396$0936d7347ef4da4c$exports = { 9397 dismiss: "Avvisa" 9398}; 9399
vendor: 147 bytes, lines 9400-9405
9400// ../../node_modules/@react-aria/overlays/dist/tr-TR.mjs 9401var $29700c92185d38f8$exports = {}; 9402$29700c92185d38f8$exports = { 9403 dismiss: "Kapat" 9404}; 9405
vendor: 196 bytes, lines 9406-9411
9406// ../../node_modules/@react-aria/overlays/dist/uk-UA.mjs 9407var $662ccaf2be4c25b3$exports = {}; 9408$662ccaf2be4c25b3$exports = { 9409 dismiss: "\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438" 9410}; 9411
vendor: 154 bytes, lines 9412-9417
9412// ../../node_modules/@react-aria/overlays/dist/zh-CN.mjs 9413var $d80a27deda7cdb3c$exports = {}; 9414$d80a27deda7cdb3c$exports = { 9415 dismiss: "\u53D6\u6D88" 9416}; 9417
vendor: 154 bytes, lines 9418-9423
9418// ../../node_modules/@react-aria/overlays/dist/zh-TW.mjs 9419var $2b2734393847c884$exports = {}; 9420$2b2734393847c884$exports = { 9421 dismiss: "\u95DC\u9589" 9422}; 9423
vendor: 1,425 bytes, lines 9424-9462
9424// ../../node_modules/@react-aria/overlays/dist/intlStrings.mjs 9425var $a2f21f5f14f60553$exports = {}; 9426$a2f21f5f14f60553$exports = { 9427 "ar-AE": $773d5888b972f1cf$exports, 9428 "bg-BG": $d11f19852b941573$exports, 9429 "cs-CZ": $b983974c2ee1efb3$exports, 9430 "da-DK": $5809cc9d4e92de73$exports, 9431 "de-DE": $c68c2e4fc74398d1$exports, 9432 "el-GR": $0898b4c153db2b77$exports, 9433 "en-US": $6d74810286a15183$exports, 9434 "es-ES": $309d73dc65f78055$exports, 9435 "et-EE": $44ad94f7205cf593$exports, 9436 "fi-FI": $7c28f5687f0779a9$exports, 9437 "fr-FR": $e6d75df4b68bd73a$exports, 9438 "he-IL": $87505c9dab186d0f$exports, 9439 "hr-HR": $553439c3ffb3e492$exports, 9440 "hu-HU": $74cf411061b983a2$exports, 9441 "it-IT": $e933f298574dc435$exports, 9442 "ja-JP": $ac91fc9fe02f71f6$exports, 9443 "ko-KR": $52b96f86422025af$exports, 9444 "lt-LT": $c0d724c3e51dafa6$exports, 9445 "lv-LV": $c92899672a3fe72e$exports, 9446 "nb-NO": $9f576b39d8e7a9d6$exports, 9447 "nl-NL": $9d025808aeec81a7$exports, 9448 "pl-PL": $fce709921e2c0fa6$exports, 9449 "pt-BR": $2599cf0c4ab37f59$exports, 9450 "pt-PT": $3c220ae7ef8a35fd$exports, 9451 "ro-RO": $93562b5094072f54$exports, 9452 "ru-RU": $cd9e2abd0d06c7b4$exports, 9453 "sk-SK": $45375701f409adf1$exports, 9454 "sl-SI": $27fab53a576de9dd$exports, 9455 "sr-SP": $4438748d9952e7c7$exports, 9456 "sv-SE": $0936d7347ef4da4c$exports, 9457 "tr-TR": $29700c92185d38f8$exports, 9458 "uk-UA": $662ccaf2be4c25b3$exports, 9459 "zh-CN": $d80a27deda7cdb3c$exports, 9460 "zh-TW": $2b2734393847c884$exports 9461}; 9462
vendor: 81 bytes, lines 9463-9465
9463// ../../node_modules/@react-aria/overlays/dist/DismissButton.mjs 9464init_react(); 9465
vendor: 89 bytes, lines 9466-9468
9466// ../../node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.mjs 9467init_react(); 9468
vendor: 173 bytes, lines 9469-9471
9469// ../../node_modules/@react-aria/overlays/dist/ariaHideOutside.mjs 9470var $5e3802645cc19319$var$supportsInert = typeof HTMLElement < "u" && "inert" in HTMLElement.prototype; 9471
vendor: 78 bytes, lines 9472-9474
9472// ../../node_modules/@react-aria/overlays/dist/usePopover.mjs 9473init_react(); 9474
vendor: 158 bytes, lines 9475-9478
9475// ../../node_modules/@react-aria/overlays/dist/Overlay.mjs 9476init_react(); 9477var $337b884510726a0d$export$a2200b96afd16271 = react_default.createContext(null); 9478
vendor: 83 bytes, lines 9479-9481
9479// ../../node_modules/@react-aria/overlays/dist/useModalOverlay.mjs 9480init_react(); 9481
vendor: 92 bytes, lines 9482-9484
9482// ../../node_modules/@react-stately/tooltip/dist/useTooltipTriggerState.mjs 9483init_react(); 9484
vendor: 583 bytes, lines 9485-9510
9485// ../../node_modules/@react-stately/overlays/dist/useOverlayTriggerState.mjs 9486init_react(); 9487function $fc909762b330b746$export$61c6a8c84e605fb6(props) { 9488 let [isOpen, setOpen] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(props.isOpen, props.defaultOpen || !1, props.onOpenChange), open = useCallback(() => { 9489 setOpen(!0); 9490 }, [ 9491 setOpen 9492 ]), close = useCallback(() => { 9493 setOpen(!1); 9494 }, [ 9495 setOpen 9496 ]), toggle = useCallback(() => { 9497 setOpen(!isOpen); 9498 }, [ 9499 setOpen, 9500 isOpen 9501 ]); 9502 return { 9503 isOpen, 9504 setOpen, 9505 open, 9506 close, 9507 toggle 9508 }; 9509} 9510
vendor: 3,374 bytes, lines 9511-9547
9511// ../../node_modules/@react-stately/tooltip/dist/useTooltipTriggerState.mjs 9512var $8796f90736e175cb$var$TOOLTIP_DELAY = 1500, $8796f90736e175cb$var$TOOLTIP_COOLDOWN = 500, $8796f90736e175cb$var$tooltips = {}, $8796f90736e175cb$var$tooltipId = 0, $8796f90736e175cb$var$globalWarmedUp = !1, $8796f90736e175cb$var$globalWarmUpTimeout = null, $8796f90736e175cb$var$globalCooldownTimeout = null; 9513function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) { 9514 let { delay: delay2 = $8796f90736e175cb$var$TOOLTIP_DELAY, closeDelay = $8796f90736e175cb$var$TOOLTIP_COOLDOWN } = props, { isOpen, open, close } = $fc909762b330b746$export$61c6a8c84e605fb6(props), id = useMemo(() => `${++$8796f90736e175cb$var$tooltipId}`, []), closeTimeout = useRef(null), closeCallback = useRef(close), ensureTooltipEntry = () => { 9515 $8796f90736e175cb$var$tooltips[id] = hideTooltip; 9516 }, closeOpenTooltips = () => { 9517 for (let hideTooltipId in $8796f90736e175cb$var$tooltips) hideTooltipId !== id && ($8796f90736e175cb$var$tooltips[hideTooltipId](!0), delete $8796f90736e175cb$var$tooltips[hideTooltipId]); 9518 }, showTooltip = () => { 9519 closeTimeout.current && clearTimeout(closeTimeout.current), closeTimeout.current = null, closeOpenTooltips(), ensureTooltipEntry(), $8796f90736e175cb$var$globalWarmedUp = !0, open(), $8796f90736e175cb$var$globalWarmUpTimeout && (clearTimeout($8796f90736e175cb$var$globalWarmUpTimeout), $8796f90736e175cb$var$globalWarmUpTimeout = null), $8796f90736e175cb$var$globalCooldownTimeout && (clearTimeout($8796f90736e175cb$var$globalCooldownTimeout), $8796f90736e175cb$var$globalCooldownTimeout = null); 9520 }, hideTooltip = (immediate) => { 9521 immediate || closeDelay <= 0 ? (closeTimeout.current && clearTimeout(closeTimeout.current), closeTimeout.current = null, closeCallback.current()) : closeTimeout.current || (closeTimeout.current = setTimeout(() => { 9522 closeTimeout.current = null, closeCallback.current(); 9523 }, closeDelay)), $8796f90736e175cb$var$globalWarmUpTimeout && (clearTimeout($8796f90736e175cb$var$globalWarmUpTimeout), $8796f90736e175cb$var$globalWarmUpTimeout = null), $8796f90736e175cb$var$globalWarmedUp && ($8796f90736e175cb$var$globalCooldownTimeout && clearTimeout($8796f90736e175cb$var$globalCooldownTimeout), $8796f90736e175cb$var$globalCooldownTimeout = setTimeout(() => { 9524 delete $8796f90736e175cb$var$tooltips[id], $8796f90736e175cb$var$globalCooldownTimeout = null, $8796f90736e175cb$var$globalWarmedUp = !1; 9525 }, Math.max($8796f90736e175cb$var$TOOLTIP_COOLDOWN, closeDelay))); 9526 }, warmupTooltip = () => { 9527 closeOpenTooltips(), ensureTooltipEntry(), !isOpen && !$8796f90736e175cb$var$globalWarmUpTimeout && !$8796f90736e175cb$var$globalWarmedUp ? $8796f90736e175cb$var$globalWarmUpTimeout = setTimeout(() => { 9528 $8796f90736e175cb$var$globalWarmUpTimeout = null, $8796f90736e175cb$var$globalWarmedUp = !0, showTooltip(); 9529 }, delay2) : isOpen || showTooltip(); 9530 }; 9531 return useEffect(() => { 9532 closeCallback.current = close; 9533 }, [ 9534 close 9535 ]), useEffect(() => () => { 9536 closeTimeout.current && clearTimeout(closeTimeout.current), $8796f90736e175cb$var$tooltips[id] && delete $8796f90736e175cb$var$tooltips[id]; 9537 }, [ 9538 id 9539 ]), { 9540 isOpen, 9541 open: (immediate) => { 9542 !immediate && delay2 > 0 && !closeTimeout.current ? warmupTooltip() : showTooltip(); 9543 }, 9544 close: hideTooltip 9545 }; 9546} 9547
vendor: 3,661 bytes, lines 9548-9629
9548// ../../node_modules/react-aria-components/dist/Tooltip.mjs 9549init_react(); 9550var $4e3b923658d69c60$export$7a7623236eec67fa = createContext(null), $4e3b923658d69c60$export$39ae08fa83328b12 = createContext(null); 9551function $4e3b923658d69c60$export$8c610744efcf8a1d(props) { 9552 let state = $8796f90736e175cb$export$4d40659c25ecb50b(props), ref = useRef(null), { triggerProps, tooltipProps } = $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref); 9553 return react_default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, { 9554 values: [ 9555 [ 9556 $4e3b923658d69c60$export$7a7623236eec67fa, 9557 state 9558 ], 9559 [ 9560 $4e3b923658d69c60$export$39ae08fa83328b12, 9561 { 9562 ...tooltipProps, 9563 triggerRef: ref 9564 } 9565 ] 9566 ] 9567 }, react_default.createElement($f645667febf57a63$export$13f3202a3e5ddd5, { 9568 ...triggerProps, 9569 ref 9570 }, props.children)); 9571} 9572var $4e3b923658d69c60$export$28c660c63b792dea = forwardRef(function({ UNSTABLE_portalContainer, ...props }, ref) { 9573 [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $4e3b923658d69c60$export$39ae08fa83328b12); 9574 let contextState = useContext($4e3b923658d69c60$export$7a7623236eec67fa), localState = $8796f90736e175cb$export$4d40659c25ecb50b(props), state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState, isExiting = $d3f049242431219c$export$45fda7c47f93fd48(ref, state.isOpen) || props.isExiting || !1; 9575 return !state.isOpen && !isExiting ? null : react_default.createElement($f57aed4a881a3485$export$b47c3594eab58386, { 9576 portalContainer: UNSTABLE_portalContainer 9577 }, react_default.createElement($4e3b923658d69c60$var$TooltipInner, { 9578 ...props, 9579 tooltipRef: ref, 9580 isExiting 9581 })); 9582}); 9583function $4e3b923658d69c60$var$TooltipInner(props) { 9584 let state = useContext($4e3b923658d69c60$export$7a7623236eec67fa), arrowRef = useRef(null), { overlayProps, arrowProps, placement, triggerAnchorPoint } = $2a41e45df1593e64$export$d39e1813b3bdd0e1({ 9585 placement: props.placement || "top", 9586 targetRef: props.triggerRef, 9587 overlayRef: props.tooltipRef, 9588 arrowRef, 9589 offset: props.offset, 9590 crossOffset: props.crossOffset, 9591 isOpen: state.isOpen, 9592 arrowBoundaryOffset: props.arrowBoundaryOffset, 9593 shouldFlip: props.shouldFlip, 9594 containerPadding: props.containerPadding, 9595 onClose: () => state.close(!0) 9596 }), isEntering = $d3f049242431219c$export$6d3443f2c48bfc20(props.tooltipRef, !!placement) || props.isEntering || !1, renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({ 9597 ...props, 9598 defaultClassName: "react-aria-Tooltip", 9599 values: { 9600 placement, 9601 isEntering, 9602 isExiting: props.isExiting, 9603 state 9604 } 9605 }); 9606 props = $3ef42575df84b30b$export$9d1611c77c2fe928(props, overlayProps); 9607 let { tooltipProps } = $326e436e94273fe1$export$1c4b08e0eca38426(props, state), DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, { 9608 global: !0 9609 }); 9610 return react_default.createElement("div", { 9611 ...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, tooltipProps), 9612 ref: props.tooltipRef, 9613 style: { 9614 ...overlayProps.style, 9615 "--trigger-anchor-point": triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : void 0, 9616 ...renderProps.style 9617 }, 9618 "data-placement": placement ?? void 0, 9619 "data-entering": isEntering || void 0, 9620 "data-exiting": props.isExiting || void 0 9621 }, react_default.createElement($44f671af83e7d9e0$export$2de4954e8ae13b9f.Provider, { 9622 value: { 9623 ...arrowProps, 9624 placement, 9625 ref: arrowRef 9626 } 9627 }, renderProps.children)); 9628} 9629
vendor: 22,675 bytes, lines 9630-10243
9630// src/components/components/shared/overlayHelpers.tsx 9631init_react(); 9632var import_memoizerific = __toESM(require_memoizerific(), 1); 9633var convertToReactAriaPlacement2 = (0, import_memoizerific.default)(1e3)((p2) => p2 === "left-end" ? "left bottom" : p2 === "right-end" ? "right bottom" : p2 === "left-start" ? "left top" : p2 === "right-start" ? "right top" : p2.replace("-", " ")), Container5 = styled.div({ 9634 width: 500, 9635 height: 500, 9636 paddingTop: 100, 9637 overflowY: "scroll", 9638 background: "#eee", 9639 position: "relative" 9640}), Trigger = forwardRef((props, ref) => react_default.createElement( 9641 "button", 9642 { 9643 ...props, 9644 ref, 9645 style: { 9646 width: 120, 9647 height: 50, 9648 margin: 10 9649 } 9650 } 9651)); 9652Trigger.displayName = "Trigger"; 9653 9654// src/components/components/tooltip/TooltipProvider.tsx 9655var TooltipProvider2 = ({ 9656 triggerOnFocusOnly = !1, 9657 placement: placementProp = "top", 9658 offset: offset2 = 8, 9659 tooltip, 9660 children, 9661 defaultVisible, 9662 startOpen, 9663 delayShow = 400, 9664 delayHide = 200, 9665 visible, 9666 onVisibleChange, 9667 ...props 9668}) => { 9669 let placement = convertToReactAriaPlacement2(placementProp), child = react_default.Children.only(children); 9670 startOpen !== void 0 && deprecate("The `startOpen` prop is deprecated. Please use `defaultVisible` instead."); 9671 let [isOpen, setIsOpen] = useState(defaultVisible ?? startOpen ?? !1), onOpenChange = useCallback( 9672 (isOpen2) => { 9673 setIsOpen(isOpen2), onVisibleChange?.(isOpen2); 9674 }, 9675 [onVisibleChange] 9676 ); 9677 return react_default.createElement( 9678 $4e3b923658d69c60$export$8c610744efcf8a1d, 9679 { 9680 delay: delayShow, 9681 closeDelay: delayHide, 9682 isOpen: visible ?? isOpen, 9683 onOpenChange, 9684 trigger: triggerOnFocusOnly ? "focus" : void 0, 9685 ...props 9686 }, 9687 react_default.createElement($f645667febf57a63$export$35a3bebf7ef2d934, null, react_default.cloneElement(child, { "aria-describedby": null })), 9688 react_default.createElement( 9689 $4e3b923658d69c60$export$28c660c63b792dea, 9690 { 9691 "data-testid": "tooltip", 9692 placement, 9693 offset: offset2, 9694 onOpenChange, 9695 style: { outline: "none" }, 9696 ...props 9697 }, 9698 tooltip 9699 ) 9700 ); 9701}; 9702 9703// src/manager/components/layout/Drag.tsx 9704var oppositePosition = { 9705 left: "right", 9706 right: "left", 9707 top: "bottom", 9708 bottom: "top" 9709}, Drag = forwardRef(function(props, ref) { 9710 let { 9711 overlapping, 9712 position, 9713 "aria-label": ariaLabel, 9714 "aria-valuenow": ariaValueNow, 9715 "aria-valuemax": ariaValueMax, 9716 ...rest2 9717 } = props, orientation = position === "left" || position === "right" ? "vertical" : "horizontal", tooltipNote = orientation === "vertical" ? "\u2190 \u2192 to resize" : "\u2191 \u2193 to resize"; 9718 return react_default.createElement( 9719 TooltipProvider2, 9720 { 9721 triggerOnFocusOnly: !0, 9722 placement: oppositePosition[position], 9723 tooltip: react_default.createElement(TooltipNote2, { note: tooltipNote }) 9724 }, 9725 react_default.createElement( 9726 DragHandle, 9727 { 9728 ref, 9729 $orientation: orientation, 9730 $overlapping: overlapping, 9731 $position: position, 9732 role: "separator", 9733 tabIndex: 0, 9734 "aria-orientation": orientation, 9735 "aria-label": ariaLabel, 9736 "aria-valuenow": ariaValueNow, 9737 "aria-valuemin": 0, 9738 "aria-valuemax": ariaValueMax, 9739 ...rest2 9740 } 9741 ) 9742 ); 9743}), DragHandle = styled.div( 9744 ({ theme }) => ({ 9745 position: "absolute", 9746 opacity: 0, 9747 transition: "opacity 0.2s ease-in-out", 9748 zIndex: 100, 9749 "&:after": { 9750 content: '""', 9751 display: "block", 9752 backgroundColor: theme.color.secondary 9753 }, 9754 "&:hover": { 9755 opacity: 1 9756 } 9757 }), 9758 ({ theme, $orientation = "vertical" }) => ({ 9759 "&:focus-visible": { 9760 opacity: 1, 9761 outline: "2px solid transparent", 9762 ...$orientation === "horizontal" ? { height: 7 } : { width: 7 }, 9763 boxShadow: `inset 0 0 0 4px ${theme.color.secondary}`, 9764 "@media (forced-colors: active)": { 9765 outline: "2px solid Highlight" 9766 } 9767 } 9768 }), 9769 ({ $orientation = "vertical", $overlapping = !0, $position = "left" }) => $orientation === "vertical" ? { 9770 // This is an old code smell, where 10px matches the sidebar and 13px matches the addon panel. 9771 // It should be tidied up at some point. 9772 width: $overlapping ? $position === "left" ? 10 : 13 : 7, 9773 height: "100%", 9774 top: 0, 9775 right: $position === "left" ? -7 : void 0, 9776 left: $position === "right" ? -7 : void 0, 9777 "&:after": { 9778 width: 1, 9779 height: "100%", 9780 marginLeft: $position === "left" ? 3 : 6 9781 }, 9782 "&:hover": { 9783 cursor: "col-resize" 9784 } 9785 } : { 9786 width: "100%", 9787 height: $overlapping ? 13 : 7, 9788 top: $position === "bottom" ? -7 : void 0, 9789 bottom: $position === "top" ? -7 : void 0, 9790 left: 0, 9791 "&:after": { 9792 width: "100%", 9793 height: 1, 9794 marginTop: 6 9795 }, 9796 "&:hover": { 9797 cursor: "row-resize" 9798 } 9799 } 9800); 9801 9802// src/manager/components/layout/PanelContainer.tsx 9803var Container6 = styled.div(({ theme, position }) => ({ 9804 gridArea: "panel", 9805 position: "relative", 9806 backgroundColor: theme.appContentBg, 9807 borderTop: position === "bottom" ? `1px solid ${theme.appBorderColor}` : void 0, 9808 borderLeft: position === "right" ? `1px solid ${theme.appBorderColor}` : void 0 9809})), PanelSlot = styled.div({ 9810 height: "100%" 9811}), PanelContainer = react_default.memo(function(props) { 9812 let { children, bottomPanelHeight, rightPanelWidth, panelMaxSize, panelResizerRef, position } = props, shouldHidePanelContent = position === "bottom" ? bottomPanelHeight === 0 : rightPanelWidth === 0; 9813 return react_default.createElement(Container6, { position }, react_default.createElement( 9814 Drag, 9815 { 9816 ref: panelResizerRef, 9817 position, 9818 overlapping: position === "bottom" ? !!bottomPanelHeight : !!rightPanelWidth, 9819 "aria-label": "Addon panel resize handle", 9820 "aria-valuenow": position === "bottom" ? bottomPanelHeight : rightPanelWidth, 9821 "aria-valuemax": panelMaxSize 9822 } 9823 ), react_default.createElement( 9824 PanelSlot, 9825 { 9826 hidden: shouldHidePanelContent ? !0 : void 0, 9827 "aria-hidden": shouldHidePanelContent ? !0 : void 0 9828 }, 9829 children 9830 )); 9831}); 9832 9833// src/manager/components/layout/SidebarContainer.tsx 9834init_react(); 9835var Container7 = styled.div(({ theme }) => ({ 9836 backgroundColor: theme.appBg, 9837 gridArea: "sidebar", 9838 position: "relative", 9839 borderRight: `1px solid ${theme.appBorderColor}` 9840})), SidebarSlot = styled.div({ 9841 height: "100%" 9842}), SidebarContainer = react_default.memo(function(props) { 9843 let { children, navSize, sidebarMaxWidth, sidebarResizerRef } = props, shouldHideSidebarContent = navSize === 0; 9844 return react_default.createElement(Container7, null, react_default.createElement( 9845 SidebarSlot, 9846 { 9847 hidden: shouldHideSidebarContent ? !0 : void 0, 9848 "aria-hidden": shouldHideSidebarContent ? !0 : void 0 9849 }, 9850 children 9851 ), react_default.createElement( 9852 Drag, 9853 { 9854 ref: sidebarResizerRef, 9855 position: "left", 9856 "aria-label": "Sidebar resize handle", 9857 "aria-valuenow": navSize, 9858 "aria-valuemax": sidebarMaxWidth 9859 } 9860 )); 9861}); 9862 9863// src/manager/components/layout/useDragging.ts 9864init_react(); 9865var SNAP_THRESHOLD_PX = 30, STIFFNESS = 0.9, KEYBOARD_STEP_PX = 10, KEYBOARD_SHIFT_MULTIPLIER = 5, RESIZE_KEYS = ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"]; 9866function clamp(value, min, max) { 9867 return Math.min(Math.max(value, min), max); 9868} 9869function interpolate(relativeValue, min, max) { 9870 return min + (max - min) * relativeValue; 9871} 9872function computeSidebarMaxWidth(panelPosition, rightPanelWidth, showPanel) { 9873 if (typeof window > "u") 9874 return 0; 9875 let panelWidth = showPanel ? panelPosition === "right" ? rightPanelWidth : 360 : 0; 9876 return Math.max(window.innerWidth - 100 - panelWidth, 0); 9877} 9878function computePanelMaxSize(panelPosition, navSize) { 9879 return typeof window > "u" ? 0 : Math.max(panelPosition === "bottom" ? window.innerHeight - 40 : window.innerWidth - 100 - navSize, 0); 9880} 9881function applyResizeKeyboard(state, sizeKey, key, step, minSize, maxSize, increaseKey, decreaseKey) { 9882 let currentSize = state[sizeKey]; 9883 switch (key) { 9884 case increaseKey: 9885 return { ...state, [sizeKey]: clamp(currentSize + step, minSize, maxSize) }; 9886 case decreaseKey: 9887 let effectivelyComputed = clamp(currentSize - step, 0, maxSize); 9888 return { ...state, [sizeKey]: effectivelyComputed < minSize ? 0 : effectivelyComputed }; 9889 case "Home": 9890 return { ...state, [sizeKey]: 0 }; 9891 case "End": 9892 return { ...state, [sizeKey]: maxSize }; 9893 default: 9894 return state; 9895 } 9896} 9897function useDragging({ 9898 setState, 9899 showPanel, 9900 isDesktop, 9901 navSize, 9902 rightPanelWidth, 9903 panelPosition 9904}) { 9905 let panelResizerRef = useRef(null), sidebarResizerRef = useRef(null), sidebarMaxWidth = computeSidebarMaxWidth(panelPosition, rightPanelWidth, showPanel), panelMaxSize = computePanelMaxSize(panelPosition, navSize); 9906 return useEffect(() => { 9907 let panelResizer = panelResizerRef.current, sidebarResizer = sidebarResizerRef.current, draggedElement = null, onDragStart = (e2) => { 9908 e2.preventDefault(), e2.currentTarget === panelResizer ? draggedElement = panelResizer : e2.currentTarget === sidebarResizer && (draggedElement = sidebarResizer), setState((state) => ({ 9909 ...state, 9910 isDragging: !0, 9911 dragCursor: draggedElement === panelResizer && state.panelPosition === "bottom" ? "row-resize" : "col-resize" 9912 })), window.addEventListener("mousemove", onDrag), window.addEventListener("mouseup", onDragEnd); 9913 }, onDragEnd = () => { 9914 setState((state) => { 9915 if (draggedElement === sidebarResizer && state.navSize < 240 && state.navSize > 0) 9916 return { 9917 ...state, 9918 isDragging: !1, 9919 navSize: 240 9920 }; 9921 if (draggedElement === panelResizer) { 9922 if (state.panelPosition === "right" && state.rightPanelWidth < 270 && state.rightPanelWidth > 0) 9923 return { 9924 ...state, 9925 isDragging: !1, 9926 rightPanelWidth: 270 9927 }; 9928 if (state.panelPosition === "bottom" && state.bottomPanelHeight < 40 && state.bottomPanelHeight > 0) 9929 return { 9930 ...state, 9931 isDragging: !1, 9932 bottomPanelHeight: 40 9933 }; 9934 } 9935 return { 9936 ...state, 9937 isDragging: !1 9938 }; 9939 }), window.removeEventListener("mousemove", onDrag), window.removeEventListener("mouseup", onDragEnd), draggedElement = null; 9940 }, onDrag = (e2) => { 9941 if (e2.buttons === 0) { 9942 onDragEnd(); 9943 return; 9944 } 9945 setState((state) => { 9946 if (draggedElement === sidebarResizer) { 9947 let sidebarDragX = e2.clientX; 9948 return sidebarDragX === state.navSize ? state : sidebarDragX <= SNAP_THRESHOLD_PX ? { 9949 ...state, 9950 navSize: 0 9951 } : sidebarDragX <= 240 ? { 9952 ...state, 9953 navSize: interpolate(STIFFNESS, sidebarDragX, 240) 9954 } : { 9955 ...state, 9956 navSize: clamp( 9957 sidebarDragX, 9958 0, 9959 computeSidebarMaxWidth(state.panelPosition, state.rightPanelWidth, showPanel) 9960 ) 9961 }; 9962 } 9963 if (draggedElement === panelResizer) { 9964 let sizeAxisState = state.panelPosition === "bottom" ? "bottomPanelHeight" : "rightPanelWidth", panelDragSize = state.panelPosition === "bottom" ? ( 9965 // @ts-expect-error (non strict) 9966 e2.view.innerHeight - e2.clientY 9967 ) : ( 9968 // @ts-expect-error (non strict) 9969 e2.view.innerWidth - e2.clientX 9970 ), minimumSize = state.panelPosition === "bottom" ? 40 : 270; 9971 return panelDragSize === state[sizeAxisState] ? state : panelDragSize <= SNAP_THRESHOLD_PX ? { 9972 ...state, 9973 [sizeAxisState]: 0 9974 } : panelDragSize <= minimumSize ? { 9975 ...state, 9976 [sizeAxisState]: interpolate(STIFFNESS, panelDragSize, minimumSize) 9977 } : { 9978 ...state, 9979 [sizeAxisState]: clamp( 9980 panelDragSize, 9981 0, 9982 computePanelMaxSize(state.panelPosition, state.navSize) 9983 ) 9984 }; 9985 } 9986 return state; 9987 }); 9988 }, onSidebarKeyDown = (e2) => { 9989 if (!RESIZE_KEYS.includes(e2.key)) 9990 return; 9991 e2.preventDefault(); 9992 let step = e2.shiftKey ? KEYBOARD_STEP_PX * KEYBOARD_SHIFT_MULTIPLIER : KEYBOARD_STEP_PX; 9993 setState( 9994 (state) => applyResizeKeyboard( 9995 state, 9996 "navSize", 9997 e2.key, 9998 step, 9999 240, 10000 computeSidebarMaxWidth(state.panelPosition, state.rightPanelWidth, showPanel), 10001 "ArrowRight", 10002 "ArrowLeft" 10003 ) 10004 ); 10005 }, onPanelKeyDown = (e2) => { 10006 if (!RESIZE_KEYS.includes(e2.key)) 10007 return; 10008 e2.preventDefault(); 10009 let step = e2.shiftKey ? KEYBOARD_STEP_PX * KEYBOARD_SHIFT_MULTIPLIER : KEYBOARD_STEP_PX; 10010 setState( 10011 (state) => applyResizeKeyboard( 10012 state, 10013 state.panelPosition === "bottom" ? "bottomPanelHeight" : "rightPanelWidth", 10014 e2.key, 10015 step, 10016 state.panelPosition === "bottom" ? 40 : 270, 10017 computePanelMaxSize(state.panelPosition, state.navSize), 10018 state.panelPosition === "bottom" ? "ArrowUp" : "ArrowLeft", 10019 state.panelPosition === "bottom" ? "ArrowDown" : "ArrowRight" 10020 ) 10021 ); 10022 }; 10023 return panelResizer?.addEventListener("mousedown", onDragStart), sidebarResizer?.addEventListener("mousedown", onDragStart), panelResizer?.addEventListener("keydown", onPanelKeyDown), sidebarResizer?.addEventListener("keydown", onSidebarKeyDown), () => { 10024 panelResizer?.removeEventListener("mousedown", onDragStart), sidebarResizer?.removeEventListener("mousedown", onDragStart), panelResizer?.removeEventListener("keydown", onPanelKeyDown), sidebarResizer?.removeEventListener("keydown", onSidebarKeyDown); 10025 }; 10026 }, [ 10027 // we need to rerun this effect when the panel is shown/hidden or when changing between mobile/desktop to re-attach the event listeners 10028 showPanel, 10029 isDesktop, 10030 setState 10031 ]), { panelResizerRef, sidebarResizerRef, sidebarMaxWidth, panelMaxSize }; 10032} 10033 10034// src/manager/components/layout/useLandmarkIndicator.ts 10035init_react(); 10036function findActiveLandmarkElement() { 10037 let currentElement = document.activeElement, landmarkElement = null; 10038 for (; currentElement; ) { 10039 if (currentElement instanceof HTMLElement && currentElement.hasAttribute("data-sb-landmark")) { 10040 landmarkElement = currentElement; 10041 break; 10042 } 10043 currentElement = currentElement.parentElement; 10044 } 10045 return landmarkElement; 10046} 10047function useRegionFocusAnimation() { 10048 let theme = useTheme(), reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)"), currentAnimationRef = useRef(null); 10049 return (elementToAnimate) => { 10050 if (elementToAnimate && (currentAnimationRef.current && (currentAnimationRef.current.cancel(), currentAnimationRef.current = null), !reducedMotion)) { 10051 let animation = elementToAnimate.animate( 10052 [{ border: `2px solid ${theme.color.primary}` }, { border: "2px solid transparent" }], 10053 { 10054 duration: 1500, 10055 pseudoElement: "::after" 10056 } 10057 ); 10058 currentAnimationRef.current = animation, animation.onfinish = () => { 10059 currentAnimationRef.current = null; 10060 }; 10061 } 10062 }; 10063} 10064function useLandmarkIndicator() { 10065 let animateLandmark = useRegionFocusAnimation(); 10066 useEffect(() => { 10067 let handleKeyDown = (e2) => { 10068 if (e2.key !== "F6") 10069 return; 10070 let landmarkElement = findActiveLandmarkElement(); 10071 landmarkElement && animateLandmark(landmarkElement); 10072 }; 10073 return document.addEventListener("keydown", handleKeyDown, { capture: !0 }), () => { 10074 document.removeEventListener("keydown", handleKeyDown, { capture: !0 }); 10075 }; 10076 }, [animateLandmark]); 10077} 10078 10079// src/manager/components/layout/Layout.tsx 10080var layoutStateIsEqual = (state, other) => state.navSize === other.navSize && state.bottomPanelHeight === other.bottomPanelHeight && state.rightPanelWidth === other.rightPanelWidth && state.panelPosition === other.panelPosition, useLayoutSyncingState = ({ 10081 api, 10082 managerLayoutState, 10083 setManagerLayoutState, 10084 isDesktop, 10085 hasTab 10086}) => { 10087 let prevManagerLayoutStateRef = react_default.useRef(managerLayoutState), [internalDraggingSizeState, setInternalDraggingSizeState] = useState({ 10088 ...managerLayoutState, 10089 isDragging: !1, 10090 dragCursor: "col-resize" 10091 }); 10092 useEffect(() => { 10093 internalDraggingSizeState.isDragging || // don't interrupt user's drag 10094 layoutStateIsEqual(managerLayoutState, prevManagerLayoutStateRef.current) || (prevManagerLayoutStateRef.current = managerLayoutState, setInternalDraggingSizeState((state) => ({ ...state, ...managerLayoutState }))); 10095 }, [internalDraggingSizeState.isDragging, managerLayoutState, setInternalDraggingSizeState]), useLayoutEffect(() => { 10096 if (internalDraggingSizeState.isDragging || // wait with syncing managerLayoutState until user is done dragging 10097 layoutStateIsEqual(managerLayoutState, internalDraggingSizeState)) 10098 return; 10099 let nextState = { 10100 navSize: internalDraggingSizeState.navSize, 10101 bottomPanelHeight: internalDraggingSizeState.bottomPanelHeight, 10102 rightPanelWidth: internalDraggingSizeState.rightPanelWidth 10103 }; 10104 prevManagerLayoutStateRef.current = { 10105 ...prevManagerLayoutStateRef.current, 10106 ...nextState 10107 }, setManagerLayoutState(nextState); 10108 }, [internalDraggingSizeState, setManagerLayoutState]); 10109 let isPagesShown = isPagesViewMode(managerLayoutState.viewMode), isPanelShown = managerLayoutState.viewMode === "story" && !hasTab, { navSize, rightPanelWidth, bottomPanelHeight } = internalDraggingSizeState.isDragging ? internalDraggingSizeState : managerLayoutState, customisedNavSize = api.getNavSizeWithCustomisations?.(navSize) ?? navSize, customisedShowPanel = api.getShowPanelWithCustomisations?.(isPanelShown) ?? isPanelShown, { panelResizerRef, sidebarResizerRef, sidebarMaxWidth, panelMaxSize } = useDragging({ 10110 setState: setInternalDraggingSizeState, 10111 isDesktop, 10112 navSize: customisedNavSize, 10113 showPanel: customisedShowPanel, 10114 rightPanelWidth, 10115 panelPosition: managerLayoutState.panelPosition 10116 }); 10117 return { 10118 navSize: customisedNavSize, 10119 rightPanelWidth, 10120 bottomPanelHeight, 10121 panelPosition: managerLayoutState.panelPosition, 10122 panelResizerRef, 10123 sidebarResizerRef, 10124 sidebarMaxWidth, 10125 panelMaxSize, 10126 showPages: isPagesShown, 10127 showPanel: customisedShowPanel, 10128 isDragging: internalDraggingSizeState.isDragging, 10129 dragCursor: internalDraggingSizeState.dragCursor 10130 }; 10131}, OrderedMobileNavigation = styled(MobileNavigation)({ 10132 order: 1 10133}), Layout = ({ managerLayoutState, setManagerLayoutState, hasTab, ...slots }) => { 10134 let { isDesktop, isMobile: isMobile2 } = useLayout(), api = useStorybookApi(); 10135 useStorybookState(); 10136 let showSidebar = api.getNavAvailability() === "shown", { 10137 navSize, 10138 rightPanelWidth, 10139 bottomPanelHeight, 10140 panelPosition, 10141 panelResizerRef, 10142 sidebarResizerRef, 10143 sidebarMaxWidth, 10144 panelMaxSize, 10145 showPages, 10146 showPanel, 10147 isDragging, 10148 dragCursor 10149 } = useLayoutSyncingState({ api, managerLayoutState, setManagerLayoutState, isDesktop, hasTab }); 10150 return useLandmarkIndicator(), react_default.createElement( 10151 LayoutContainer, 10152 { 10153 panelPosition: managerLayoutState.panelPosition, 10154 showPanel, 10155 showSidebar, 10156 style: { 10157 "--nav-width": `${navSize}px`, 10158 "--right-panel-width": `${rightPanelWidth}px`, 10159 "--bottom-panel-height": `${bottomPanelHeight}px` 10160 } 10161 }, 10162 react_default.createElement(react_default.Fragment, null, isDesktop && showSidebar && react_default.createElement( 10163 SidebarContainer, 10164 { 10165 navSize, 10166 sidebarMaxWidth, 10167 sidebarResizerRef 10168 }, 10169 slots.slotSidebar 10170 ), isMobile2 && !showPages && react_default.createElement( 10171 OrderedMobileNavigation, 10172 { 10173 menu: slots.slotSidebar, 10174 panel: slots.slotPanel, 10175 showMenu: showSidebar, 10176 showPanel 10177 } 10178 ), react_default.createElement( 10179 MainAreaContainer, 10180 { 10181 showPages, 10182 slotMain: slots.slotMain, 10183 slotPages: slots.slotPages 10184 } 10185 ), slots.slotOverlay && react_default.createElement(ContentOverlayCell, null, slots.slotOverlay), isDesktop && showPanel && react_default.createElement( 10186 PanelContainer, 10187 { 10188 bottomPanelHeight, 10189 rightPanelWidth, 10190 panelMaxSize, 10191 panelResizerRef, 10192 position: panelPosition 10193 }, 10194 slots.slotPanel 10195 ), isMobile2 && !showPages && react_default.createElement(Notifications, null)), 10196 isDragging && react_default.createElement(DragShield, { style: { cursor: dragCursor } }) 10197 ); 10198}, ContentOverlayCell = styled.div({ 10199 position: "absolute", 10200 inset: 0, 10201 pointerEvents: "none", 10202 zIndex: 2, 10203 [MEDIA_DESKTOP_BREAKPOINT]: { 10204 position: "relative", 10205 inset: "auto", 10206 gridArea: "content" 10207 } 10208}), DragShield = styled.div({ 10209 position: "fixed", 10210 inset: 0, 10211 zIndex: 10 10212}), LayoutContainer = styled.div(({ panelPosition, showPanel, showSidebar }) => ({ 10213 position: "relative", 10214 width: "100%", 10215 height: ["100vh", "100dvh"], 10216 overflow: "hidden", 10217 display: "flex", 10218 flexDirection: "column", 10219 colorScheme: "light dark", 10220 [MEDIA_DESKTOP_BREAKPOINT]: { 10221 display: "grid", 10222 gap: 0, 10223 gridTemplateColumns: showSidebar ? `minmax(0, var(--nav-width)) minmax(${100}px, 1fr) minmax(0, var(--right-panel-width))` : `minmax(${100}px, 1fr) minmax(0, var(--right-panel-width))`, 10224 gridTemplateRows: "1fr minmax(0, var(--bottom-panel-height))", 10225 gridTemplateAreas: !showSidebar && !showPanel ? `"content content" 10226 "content content"` : !showSidebar && showPanel ? panelPosition === "right" ? `"content panel" 10227 "content panel"` : `"content content" 10228 "panel panel"` : showPanel ? panelPosition === "right" ? `"sidebar content panel" 10229 "sidebar content panel"` : `"sidebar content content" 10230 "sidebar panel panel"` : `"sidebar content content" 10231 "sidebar content content"` 10232 } 10233})); 10234 10235// src/manager/components/review/components/ReviewPersistentLayer.tsx 10236init_react(); 10237 10238// src/manager/components/review/screens/ReviewSummaryHost.tsx 10239init_react(); 10240 10241// src/shared/review/events.ts 10242var REVIEW_NAMESPACE = "storybook/review", REVIEW_EVENTS = { 10243 //
10243`@storybook/addon-mcp` display-review tool → core-server: the raw agent payload. 10244 PUSH_REVIEW: `${REVIEW_NAMESPACE}/push-review`, 10245 // core-server → tabs: display the (createdAt-stamped) review. 10246 DISPLAY_REVIEW: `${REVIEW_NAMESPACE}/display-review`, 10247 // tab → core-server: replay the cached review on mount. 10248 REQUEST_REVIEW: `${REVIEW_NAMESPACE}/request-review`, 10249 // core-server → tabs: a watched source file changed after the review was cached. 10250 REVIEW_STALE: `${REVIEW_NAMESPACE}/review-stale`, 10251 // tab → core-server: dismiss the cached review. 10252 DISMISS_REVIEW: `${REVIEW_NAMESPACE}/dismiss-review`, 10253 // core-server → tabs: the review was dismissed. 10254 REVIEW_DISMISSED: `${REVIEW_NAMESPACE}/review-dismissed`, 10255 // tab → core-server: a review page (summary or detail) was viewed; forwarded to telemetry. 10256 PAGEVIEW: `${REVIEW_NAMESPACE}/pageview` 10257}; 10258
10259// src/manager/components/review/constants.ts 10260var PAGE_ID = `${REVIEW_NAMESPACE}/page`, REVIEW_CHANGES_URL = "/review/", PRE_REVIEW_RETURN_KEY = `${REVIEW_NAMESPACE}/pre-review-return`, AUTO_ENTERED_SESSION_KEY = `${REVIEW_NAMESPACE}/auto-entered`, VISITED_REVIEW_CREATED_AT_KEY = `${REVIEW_NAMESPACE}/visited-created-at`, NOTIFIED_REVIEW_CREATED_AT_KEY = `${REVIEW_NAMESPACE}/notified-created-at`, REVIEW_AVAILABLE_NOTIFICATION_ID = `${REVIEW_NAMESPACE}/review-available`, reviewAvailableNotificationId = (createdAt) => `${REVIEW_AVAILABLE_NOTIFICATION_ID}/${createdAt}`
vendor: 1,160 bytes, lines 10260-10285
10260; 10261 10262// global-externals:storybook/internal/types 10263var types_default = __STORYBOOK_TYPES__, { Addon_TypesEnum, CHANGE_DETECTION_STATUS_TYPE_ID, CoreWebpackCompiler, Feature, NON_AGGREGATED_STATUS_TYPE_IDS, REVIEW_EVENTS: REVIEW_EVENTS2, REVIEW_NAMESPACE: REVIEW_NAMESPACE2, REVIEW_STATUS_TYPE_ID, SupportedBuilder, SupportedFramework, SupportedLanguage, SupportedRenderer } = __STORYBOOK_TYPES__; 10264 10265// src/manager/components/review/review-status.ts 10266var REVIEWING_STATUS_VALUE = "status-value:reviewing", collectReviewStoryIds = (review) => { 10267 let storyIds = /* @__PURE__ */ new Set(); 10268 for (let collection of review.collections) 10269 for (let storyId of collection.storyIds) 10270 storyIds.add(storyId); 10271 return storyIds; 10272}, createReviewStatus = (storyId) => ({ 10273 storyId, 10274 typeId: REVIEW_STATUS_TYPE_ID, 10275 value: REVIEWING_STATUS_VALUE, 10276 title: "", 10277 description: "", 10278 sidebarContextMenu: !1 10279}), applyReviewStatuses = (statusStore, storyIds) => { 10280 statusStore.unset(), storyIds.size > 0 && statusStore.set([...storyIds].map(createReviewStatus)); 10281}, clearReviewStatuses = (statusStore) => { 10282 statusStore.unset(); 10283}; 10284 10285// src/manager/components/review/review-
10285store.ts 10286init_react(
vendor: 409 bytes, lines 10286-10311
10286); 10287 10288// src/manager/components/review/session-store.ts 10289var sessionStore = { 10290 read(key) { 10291 try { 10292 return sessionStorage.getItem(key); 10293 } catch { 10294 return null; 10295 } 10296 }, 10297 write(key, value) { 10298 try { 10299 sessionStorage.setItem(key, value); 10300 } catch { 10301 } 10302 }, 10303 remove(key) { 10304 try { 10305 sessionStorage.removeItem(key); 10306 } catch { 10307 } 10308 } 10309}; 10310 10311// src/manager/components/review/
10311review-store.ts 10312var REVIEW_MODE_SESSION_KEY = `${REVIEW_NAMESPACE}/review-mode`, emptyCore = { 10313 state: null, 10314 pendingReview: null, 10315 isStale: !1, 10316 isInReviewMode: !1, 10317 isExiting: !1 10318}, emptyDerived = { 10319 storyInfo: {}, 10320 flattenedEntries: [], 10321 newlyAddedStoryIds: /* @__PURE__ */ new Set(), 10322 activeEntry: null, 10323 activeIndex: -1, 10324 isSummaryVisible: !1, 10325 banner: null 10326}, core = { 10327 ...emptyCore, 10328 isInReviewMode: sessionStore.read(REVIEW_MODE_SESSION_KEY) === "1" 10329}, derived = emptyDerived, buildSnapshot = () => ({ 10330 ...derived, 10331 state: core.state, 10332 pendingReview: core.pendingReview, 10333 isStale: core.isStale, 10334 isInReviewMode: core.isInReviewMode, 10335 isExiting: core.isExiting 10336}), snapshot = buildSnapshot(), listeners = /* @__PURE__ */ new Set(), notify = () => { 10337 snapshot = buildSnapshot(), listeners.forEach((listener) => listener()); 10338}, commit = (patch) => { 10339 core = { ...core, ...patch }, notify(); 10340}, reviewStore = { 10341 getState: () => snapshot, 10342 subscribe: (listener) => (listeners.add(listener), () => listeners.delete(listener)), 10343 /** Show a review, replacing any displayed or deferred one. */ 10344 displayReview: (next) => { 10345 commit({ state: next, pendingReview: null, isStale: !!next.stale }); 10346 }, 10347 /** Hold an updated payload until the user accepts it. */ 10348 deferReview: (next) => { 10349 commit({ pendingReview: next }); 10350 }, 10351 setStale: (isStale) => { 10352 commit({ isStale }); 10353 }, 10354 /** Drop all review state (dismissal), including the persisted review-mode flag. */ 10355 clearReview: () => { 10356 sessionStore.remove(REVIEW_MODE_SESSION_KEY), commit({ state: null, pendingReview: null, isStale: !1, isInReviewM
10356ode: !1 }); 10357 }, 10358 /** Toggle review mode, persisted so it survives reloads. */ 10359 setReviewMode: (active) => { 10360 active ? sessionStore.write(REVIEW_MODE_SESSION_KEY, "1") : sessionStore.remove(REVIEW_MODE_SESSION_KEY), commit({ isInReviewMode: active }); 10361 }, 10362 setExiting: (isExiting) => { 10363 commit({ isExiting }); 10364 }, 10365 /** Push values derived by ReviewProvider from index/status/route inputs. */ 10366 setDerived: (next) => { 10367 derived = next, notify(); 10368 }, 10369 reset: () => { 10370 core = { ...emptyCore }, derived = emptyDerived, notify(); 10371 } 10372}, useReview = () => useSyncExternalStore(reviewStore.subscribe, reviewStore.getState, reviewStore.getState); 10373
10374// src/manager/components/review/review-mode.ts 10375var FILTERS_SNAPSHOT_SESSION_KEY = `${REVIEW_NAMESPACE}/filters-snapshot`, stripReviewingStatusFilter = (filters) => ({ 10376 ...filters, 10377 includedStatusFilters: filters.includedStatusFilters.filter( 10378 (value) => value !== REVIEWING_STATUS_VALUE 10379 ), 10380 excludedStatusFilters: filters.excludedStatusFilters.filter( 10381 (value) => value !== REVIEWING_STATUS_VALUE 10382 ) 10383}), isReviewModeActive = () => reviewStore.getState().isInReviewMode, readJson = (key) => { 10384 let raw = sessionStore.read(key); 10385 if (raw === null) 10386 return null; 10387 try { 10388 return JSON.parse(raw); 10389 } catch { 10390 return null; 10391 } 10392}, enterReviewMode = async (api, filters) => { 10393 if (!isReviewModeActive()) { 10394 sessionStore.write( 10395 FILTERS_SNAPSHOT_SESSION_KEY, 10396 JSON.stringify(stripReviewingStatusFilter(filters)) 10397 ), reviewStore.setReviewMode(!0); 10398 try { 10399 await api.setAllTagFilters([], []), await api.setAllStatusFilters([REVIEWING_STATUS_VALUE], []); 10400 } catch (error) { 10401 throw reviewStore.setReviewMode(!1), sessionStore.remove(FILTERS_SNAPSHOT_SESSION_KEY), error; 10402 } 10403 } 10404}, exitReviewMode = async (api) => { 10405 let filters = readJson(FILTERS_SNAPSHOT_SESSION_KEY); 10406 if (filters) { 10407 let restored = stripReviewingStatusFilter(filters); 10408 await api.setAllTagFilters(restored.includedTagFilters, restored.excludedTagFilters), await api.setAllStatusFilters(restored.includedStatusFilters, restored.excludedStatusFilters); 10409 } else 10410 await api.removeStatusFilters([REVIEWING_STATUS_VALUE]); 10411 sessionStore.remove(FILTERS_SNAPSHOT_SESSION_KEY), reviewStore.setReviewMode(!1); 10412}; 10413
10414// src/manager/components/review/review-navigation.ts 10415var prettifyComponentId = (componentId) => componentId.split(/[-/]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" "), buildReviewChangesSummaryHref = () => `?path=${REVIEW_CHANGES_URL}`, STORYBOOK_ROOT_HREF = "/", buildSummaryBackHref = (returnSearch) => returnSearch || STORYBOOK_ROOT_HREF, REVIEW_SUMMARY_BACK_ATTR = "data-review-summary-back", buildReviewStoryTarget = (entry) => `/story/${entry.storyId}&${REVIEW_COLLECTION_QUERY_PARAM}=${entry.collectionIndex}`, buildReviewStoryHref = (entry) => `?path=${buildReviewStoryTarget(entry)}`, parseReviewStoryHref = (href) => { 10416 if (!href.startsWith("?path=/story/")) 10417 return null; 10418 let query = href.startsWith("?") ? href.slice(1) : href, params = new URLSearchParams(query), path = params.get("path"); 10419 if (!path?.startsWith("/story/")) 10420 return null; 10421 let storyId = path.slice(7), collectionIndex = parseCollectionIndex( 10422 params.get(REVIEW_COLLECTION_QUERY_PARAM) ?? void 0 10423 ); 10424 return !storyId || collectionIndex === void 0 ? null : { storyId, collectionIndex }; 10425}, buildFlattenedNavEntries = (state) => { 10426 let entries = []; 10427 return state.collections.forEach((collection, collectionIndex) => { 10428 for (let storyId of collection.storyIds) 10429 entries.push({ storyId, collectionIndex }); 10430 }
vendor: 1,160 bytes, lines 10430-10451
10430), entries; 10431}, isReviewReturnSearch = (search) => { 10432 let normalized = search.startsWith("?") ? search.slice(1) : search, params = new URLSearchParams(normalized), path = params.get("path") ?? ""; 10433 return isReviewSummaryPath(path) || path.startsWith(REVIEW_CHANGES_URL) ? !0 : path.startsWith("/story/") && params.has(REVIEW_COLLECTION_QUERY_PARAM); 10434}, parseStoryIdFromPath = (path) => path.startsWith("/story/") && path.slice(7) || null, parseCollectionIndex = (value) => { 10435 if (value === void 0 || !/^\d+$/.test(value)) 10436 return; 10437 let parsed = Number(value); 10438 return Number.isInteger(parsed) ? parsed : void 0; 10439}, resolveActiveNavEntry = (entries, storyId, collectionIndex) => { 10440 if (entries.length === 0) 10441 return null; 10442 if (collectionIndex !== void 0) { 10443 let exact = entries.find( 10444 (entry) => entry.storyId === storyId && entry.collectionIndex === collectionIndex 10445 ); 10446 if (exact) 10447 return exact; 10448 } 10449 return entries.find((entry) => entry.storyId === storyId) ?? null; 10450}, resolveNavIndex = (entries, active) => entries.findIndex( 10451 (entry) => entry.storyId === active.storyId && entry.collectionIndex === active.collectionIndex
vendor: 3,032 bytes, lines 10452-10485
10452); 10453 10454// src/manager/components/review/review-notification.ts 10455var isUnseen = (createdAt) => createdAt !== void 0 && sessionStore.read(VISITED_REVIEW_CREATED_AT_KEY) !== String(createdAt), readVisitedCreatedAt = () => { 10456 let raw = sessionStore.read(VISITED_REVIEW_CREATED_AT_KEY); 10457 if (raw === null) 10458 return; 10459 let visited = Number(raw); 10460 return Number.isFinite(visited) ? visited : void 0; 10461}, isSupersededByVisit = (createdAt) => { 10462 let visited = readVisitedCreatedAt(); 10463 return createdAt !== void 0 && visited !== void 0 && visited > createdAt; 10464}, readNotifiedCreatedAt = () => { 10465 let raw = sessionStore.read(NOTIFIED_REVIEW_CREATED_AT_KEY); 10466 if (raw === null) 10467 return; 10468 let notified = Number(raw); 10469 return Number.isFinite(notified) ? notified : void 0; 10470}, isOnReviewRoute = (path, collectionIndex) => isReviewSummaryPath(path) || path.startsWith("/story/") && collectionIndex !== void 0, shouldSkipArrivalNotification = (path, collectionIndex, review, displayed, deferred) => isOnReviewRoute(path, collectionIndex) ? deferred?.createdAt !== void 0 && deferred.createdAt === review.createdAt ? !0 : displayed?.createdAt !== void 0 && displayed.createdAt === review.createdAt : !1, pickReviewToNotify = (displayed, deferred) => deferred?.createdAt !== void 0 && isUnseen(deferred.createdAt) ? deferred : displayed?.createdAt !== void 0 && isUnseen(displayed.createdAt) && !isSupersededByVisit(displayed.createdAt) ? displayed : null, shouldAutoAcceptOnRoute = (path, collectionIndex, candidate, displayed, deferred) => { 10471 let createdAt = candidate.createdAt; 10472 return !(createdAt === void 0 || !isUnseen(createdAt) || displayed?.createdAt !== createdAt || !isOnReviewRoute(path, collectionIndex) || deferred?.createdAt !== void 0 && deferred.createdAt !== displayed.createdAt); 10473}, clearReviewNotifications = (api, ...createdAts) => { 10474 for (let createdAt of new Set( 10475 createdAts.filter((value) => value != null) 10476 )) 10477 api.clearNotification(reviewAvailableNotificationId(createdAt)); 10478 api.clearNotification(REVIEW_AVAILABLE_NOTIFICATION_ID); 10479}, acceptReviewNotification = (api, createdAt) => { 10480 createdAt !== void 0 && (clearReviewNotifications(api, createdAt), sessionStore.write(VISITED_REVIEW_CREATED_AT_KEY, String(createdAt)), sessionStore.write(NOTIFIED_REVIEW_CREATED_AT_KEY, String(createdAt))); 10481}, clearReviewNotificationsOnDismiss = (api, displayed, deferred) => { 10482 clearReviewNotifications(api, displayed?.createdAt, deferred?.createdAt, readNotifiedCreatedAt()), sessionStore.remove(VISITED_REVIEW_CREATED_AT_KEY), sessionStore.remove(NOTIFIED_REVIEW_CREATED_AT_KEY); 10483}, claimNotificationSlot = (api, createdAt, ...extraCreatedAts) => !isUnseen(createdAt) || readNotifiedCreatedAt() === createdAt ? !1 : (clearReviewNotifications(api, readNotifiedCreatedAt(), ...extraCreatedAts), sessionStore.write(NOTIFIED_REVIEW_CREATED_AT_KEY, String(createdAt)), !0), readCollectionIndex = (queryParams) => parseCollectionIndex(queryParams?.[REVIEW_COLLECTION_QUERY_PARAM]); 10484 10485// src/manager/components/review/
10485review-actions.ts 10486var navigateToReviewEntry = (api, navigate, entry, filters) => { 10487 enterReviewMode(api, filters), api.setQueryParams({ [REVIEW_COLLECTION_QUERY_PARAM]: String(entry.collectionIndex) }), navigate(buildReviewStoryTarget(entry)); 10488}, navigateToReviewSummary = (api, navigate, filters) => { 10489 enterReviewMode(api, filters), api.setQueryParams({ [REVIEW_COLLECTION_QUERY_PARAM]: null }), navigate(REVIEW_CHANGES_URL); 10490}, navigateOutOfReview = async (api, navigate, returnSearch, { recordVisit = !0 } = {}) => { 10491 let visitCreatedAt = recordVisit ? reviewStore.getState().state?.createdAt : void 0; 10492 api.setQueryParams({ [REVIEW_COLLECTION_QUERY_PARAM]: null }), reviewStore.setExiting(!0); 10493 try { 10494 if (await exitReviewMode(api), visitCreatedAt !== void 0 && acceptReviewNotification(api, visitCreatedAt), returnSearch && !isReviewReturnSearch(returnSearch)) { 10495 navigate(returnSearch.startsWith("?") ? returnSearch : `?${returnSearch}`, { plain: !0 }); 10496 return; 10497 } 10498 api.selectFirstStory(); 10499 } finally { 10500 reviewStore.setExiting(!1); 10501 } 10502}, dismissReview = (api) => { 10503 api.emit(REVIEW_EVENTS.DISMISS_REVIEW, sessionStore.read(PRE_REVIEW_RETURN_KEY)); 10504}, acceptPendingReview = (api, navigate, filters) => { 10505 let accepted = reviewStore.getState().pendingReview; 10506 accepted && (acceptReviewNotification(api, accepted.createdAt), sessionStore.remove(AUTO_ENTERED_SESSION_KEY), reviewStore.displayReview(accepted), enterReviewMode(api, filters), navigate(buildReviewChangesSummaryHref(), { plain: !0 }));
vendor: 826 bytes, lines 10506-10540
10506 10507}; 10508 10509// src/manager/components/review/screens/SummaryScreen.tsx 10510init_react(); 10511 10512// src/manager/components/review/components/AttentionBanner.tsx 10513init_react(); 10514 10515// src/manager/components/review/components/CopyButton.tsx 10516init_react(); 10517function CopyButton({ 10518 children, 10519 childrenOnCopy, 10520 content, 10521 onCopy, 10522 ariaLabel, 10523 ariaLabelOnCopy, 10524 duration, 10525 ...buttonProps 10526}) { 10527 let { children: buttonChildren, buttonProps: copyButtonProps } = useCopyButton({ 10528 children, 10529 childrenOnCopy, 10530 content, 10531 onCopy, 10532 ariaLabel, 10533 ariaLabelOnCopy, 10534 duration 10535 }); 10536 return react_default.createElement(Button, { ...buttonProps, ...copyButtonProps }, buttonChildren); 10537} 10538 10539// src/manager/components/review/components/AttentionBanner.tsx 10540var STALE_REFRESH_PROMPT = "Generate a fresh review including my latest changes using the
10540display-review
vendor: 3,058 bytes, lines 10540-10610
10540 tool.", Region = styled.div({ 10541 flexShrink: 0 10542}), Bar2 = styled.div(({ theme }) => ({ 10543 display: "flex", 10544 alignItems: "center", 10545 justifyContent: "center", 10546 gap: 8, 10547 flexShrink: 0, 10548 padding: "4px 16px", 10549 background: theme.background.hoverable, 10550 color: theme.color.defaultText, 10551 borderBottom: `1px solid ${theme.appBorderColor}`, 10552 fontSize: theme.typography.size.s2, 10553 minHeight: 40 10554})), PopoverContent = styled.div({ 10555 padding: 15, 10556 width: 280, 10557 boxSizing: "border-box" 10558}), Title = styled.div(({ theme }) => ({ 10559 fontWeight: theme.typography.weight.bold 10560})), Message = styled.div(({ theme }) => ({ 10561 color: theme.color.defaultText, 10562 lineHeight: "18px", 10563 display: "flex", 10564 flexDirection: "column", 10565 alignItems: "flex-start", 10566 gap: 8 10567})), Prompt = styled.p(({ theme }) => ({ 10568 margin: 0, 10569 fontFamily: theme.typography.fonts.mono, 10570 fontSize: theme.typography.size.s1 - 1, 10571 padding: "6px 10px", 10572 background: theme.background.app, 10573 boxShadow: `inset 0 0 0 1px ${theme.appBorderColor}`, 10574 borderRadius: theme.appBorderRadius 10575})), AttentionBanner = (props) => { 10576 let { kind } = props, regionRef = useRef(null), { landmarkProps } = useLandmark( 10577 { role: "region", "aria-label": "Review status" }, 10578 regionRef 10579 ); 10580 if (kind === "pending-update") { 10581 let { onAccept } = props; 10582 return react_default.createElement(Region, { ref: regionRef, ...landmarkProps }, react_default.createElement(Bar2, { role: "status", "aria-live": "polite" }, react_default.createElement("span", null, "A new review is available."), react_default.createElement(Button, { variant: "solid", padding: "small", onClick: onAccept }, "Update"))); 10583 } 10584 return react_default.createElement(Region, { ref: regionRef, ...landmarkProps }, react_default.createElement(Bar2, { role: "status", "aria-live": "polite" }, react_default.createElement("span", null, "Code changes detected. This review may be stale.", " ", react_default.createElement( 10585 PopoverProvider, 10586 { 10587 ariaLabel: "Prompt to refresh stale review", 10588 placement: "bottom", 10589 padding: 0, 10590 popover: react_default.createElement(PopoverContent, null, react_default.createElement(Message, null, react_default.createElement(Title, null, "Prompt for your agent to refresh this review:"), react_default.createElement(Prompt, null, STALE_REFRESH_PROMPT), react_default.createElement( 10591 CopyButton, 10592 { 10593 appearance: "agentic", 10594 padding: "small", 10595 ariaLabel: "Copy prompt to refresh this review", 10596 ariaLabelOnCopy: "Prompt copied to clipboard", 10597 content: STALE_REFRESH_PROMPT, 10598 childrenOnCopy: react_default.createElement(react_default.Fragment, null, react_default.createElement(CheckIcon, null), " Copy prompt") 10599 }, 10600 react_default.createElement(CopyIcon, null), 10601 "Copy prompt" 10602 ))) 10603 }, 10604 react_default.createElement(Link, null, react_default.createElement("strong", null, "Ask your agent to refresh it.")) 10605 )))); 10606}; 10607 10608// src/manager/components/review/components/CollectionGrid.tsx 10609init_react(); 10610
vendor: 198 bytes, lines 10611-10613
10611// src/viewport/constants.ts 10612var ADDON_ID = "storybook/viewport", PARAM_KEY = "viewport", PANEL_ID = `${ADDON_ID}/panel`, TOOL_ID = `${ADDON_ID}/tool`, RESPONSIVE_VIEWPORT_VALUE = "100pct-100pct"; 10613
vendor: 20,561 bytes, lines 10614-11136
10614// src/shared/constants/iframe-resize.ts 10615var IFRAME_RESIZE_CONTEXT = "iframe.resize", IFRAME_RESIZE_REQUEST_CONTEXT = "iframe.resize.request", isPositiveFinite = (value) => typeof value == "number" && Number.isFinite(value) && value > 0, parseViewport = (value) => { 10616 if (!value || typeof value != "object") 10617 return; 10618 let viewport = value; 10619 if (typeof viewport.name != "string" || typeof viewport.value != "string") 10620 return; 10621 let parsed = { 10622 name: viewport.name, 10623 value: viewport.value 10624 }; 10625 if (viewport.width !== void 0) { 10626 if (!isPositiveFinite(viewport.width)) 10627 return; 10628 parsed.width = viewport.width; 10629 } 10630 if (viewport.height !== void 0) { 10631 if (!isPositiveFinite(viewport.height)) 10632 return; 10633 parsed.height = viewport.height; 10634 } 10635 return parsed; 10636}, parseIframeResizeMessage = (data) => { 10637 try { 10638 let parsed = typeof data == "string" ? JSON.parse(data) : data; 10639 if (parsed?.context !== IFRAME_RESIZE_CONTEXT || !isPositiveFinite(parsed.width) || !isPositiveFinite(parsed.height)) 10640 return null; 10641 let viewport = parseViewport(parsed.viewport); 10642 return parsed.viewport !== void 0 && viewport === void 0 ? null : { 10643 width: parsed.width, 10644 height: parsed.height, 10645 ...viewport ? { viewport } : {} 10646 }; 10647 } catch { 10648 return null; 10649 } 10650}, hasFixedViewportDimensions = (viewport) => !!viewport && viewport.value !== RESPONSIVE_VIEWPORT_VALUE && typeof viewport.width == "number" && viewport.width > 0 && typeof viewport.height == "number" && viewport.height > 0, iframeResizeViewportsEqual = (left, right) => left === right ? !0 : !left || !right ? !left && !right : left.name === right.name && left.value === right.value && left.width === right.width && left.height === right.height, iframeResizeDimensionsEqual = (left, right) => !left || left.width !== right.width || left.height !== right.height ? !1 : iframeResizeViewportsEqual(left.viewport, right.viewport); 10651 10652// src/manager/components/review/review-types.ts 10653var fallbackStoryInfo = (storyId) => { 10654 let separator = storyId.indexOf("--"); 10655 return separator === -1 ? { title: storyId, name: "Story" } : { 10656 title: storyId.slice(0, separator), 10657 name: storyId.slice(separator + 2) || "Story" 10658 }; 10659}; 10660 10661// src/manager/components/review/components/usePreviewThumbnail.ts 10662init_react(); 10663 10664// src/manager/components/review/components/previewScheduler.ts 10665var activePreviewLoads = 0, previewQueue = []; 10666function startTask(task) { 10667 task.state = "started", activePreviewLoads += 1, task.deadline = setTimeout(() => releaseTask(task), 1500), task.start(); 10668} 10669function startQueuedPreviews() { 10670 for (; activePreviewLoads < 3 && previewQueue.length > 0; ) 10671 startTask(previewQueue.shift()); 10672} 10673function releaseTask(task) { 10674 task.state !== "released" && (task.state === "started" ? (clearTimeout(task.deadline), activePreviewLoads -= 1) : previewQueue.splice(previewQueue.indexOf(task), 1), task.state = "released", startQueuedPreviews()); 10675} 10676function enqueuePreview(start) { 10677 let task = { start, state: "queued" }; 10678 return previewQueue.push(task), startQueuedPreviews(), { 10679 forceStart: () => { 10680 task.state === "queued" && (previewQueue.splice(previewQueue.indexOf(task), 1), startTask(task)); 10681 }, 10682 release: () => releaseTask(task) 10683 }; 10684} 10685 10686// src/manager/components/review/components/previewThumbnailState.ts 10687var initialThumbnailState = { 10688 phase: "idle", 10689 src: void 0, 10690 dimensions: null, 10691 bootId: 0 10692}, isThumbnailLoading = ({ phase }) => phase === "queued" || phase === "booting" || phase === "measured", thumbnailReducer = (state, event) => { 10693 switch (event.type) { 10694 case "enqueued": 10695 return { ...state, phase: "queued", dimensions: null }; 10696 case "started": 10697 return state.phase !== "queued" ? state : { ...state, phase: "booting", src: event.src, bootId: state.bootId + 1 }; 10698 case "resized": { 10699 if (state.phase === "booting" || state.phase === "measured") { 10700 let unchanged = iframeResizeDimensionsEqual(state.dimensions, event.dimensions); 10701 return state.phase === "measured" && unchanged ? state : { 10702 ...state, 10703 phase: "measured", 10704 dimensions: unchanged ? state.dimensions : event.dimensions 10705 }; 10706 } 10707 return state.phase === "settled" ? iframeResizeDimensionsEqual(state.dimensions, event.dimensions) ? state : { ...state, dimensions: event.dimensions } : state; 10708 } 10709 case "settled": 10710 return state.phase === "booting" || state.phase === "measured" ? { ...state, phase: "settled" } : state; 10711 case "evicted": 10712 return state.phase === "idle" ? state : { ...initialThumbnailState, bootId: state.bootId }; 10713 } 10714}; 10715 10716// src/manager/components/review/components/usePreviewThumbnail.ts 10717var PREVIEW_SCALE_SETTLE_FALLBACK_MS = 1500 * 3, PREVIEW_MOUNT_ROOT_MARGIN = "50% 0px", PREVIEW_EVICT_ROOT_MARGIN = "150% 0px", getScrollRoot = (element) => { 10718 let radixViewport = element.closest("[data-radix-scroll-area-viewport]"); 10719 if (radixViewport) 10720 return radixViewport; 10721 let current = element.parentElement; 10722 for (; current; ) { 10723 let { overflowY } = window.getComputedStyle(current); 10724 if (overflowY === "auto" || overflowY === "scroll") 10725 return current; 10726 current = current.parentElement; 10727 } 10728 return null; 10729}, usePreviewThumbnail = ({ 10730 storyId, 10731 getPreviewHref, 10732 summaryHidden = !1 10733}) => { 10734 let cellRef = useRef(null), iframeRef = useRef(null), [isInView, setIsInView] = useState(!1), [state, dispatch] = useReducer(thumbnailReducer, initialThumbnailState), handleRef = useRef(null), settleRafRef = useRef({ raf1: 0, raf2: 0 }), { src, bootId } = state; 10735 useEffect(() => { 10736 let host = cellRef.current; 10737 if (!host || summaryHidden) 10738 return; 10739 let scrollRoot = getScrollRoot(host), root2 = scrollRoot && scrollRoot.clientHeight > 0 ? scrollRoot : null, mountObserver = new IntersectionObserver( 10740 ([entry]) => { 10741 entry.isIntersecting && setIsInView(!0); 10742 }, 10743 { root: root2, rootMargin: PREVIEW_MOUNT_ROOT_MARGIN } 10744 ), evictObserver = new IntersectionObserver( 10745 ([entry]) => { 10746 entry.isIntersecting || setIsInView(!1); 10747 }, 10748 { root: root2, rootMargin: PREVIEW_EVICT_ROOT_MARGIN } 10749 ); 10750 return mountObserver.observe(host), evictObserver.observe(host), () => { 10751 mountObserver.disconnect(), evictObserver.disconnect(); 10752 }; 10753 }, [summaryHidden]), useEffect(() => { 10754 isInView || dispatch({ type: "evicted" }); 10755 }, [isInView]), useEffect(() => { 10756 if (!isInView) 10757 return; 10758 let previewHref = getPreviewHref(storyId); 10759 dispatch({ type: "enqueued" }); 10760 let handle = enqueuePreview(() => { 10761 dispatch({ type: "started", src: previewHref }); 10762 }); 10763 return handleRef.current = handle, () => { 10764 handle.release(), handleRef.current = null; 10765 }; 10766 }, [isInView, storyId, getPreviewHref]), useEffect(() => { 10767 if (!src) 10768 return; 10769 let timer = setTimeout(() => dispatch({ type: "settled" }), PREVIEW_SCALE_SETTLE_FALLBACK_MS); 10770 return () => clearTimeout(timer); 10771 }, [bootId, src]); 10772 let handleResize = useCallback((dimensions) => { 10773 dispatch({ type: "resized", dimensions }), cancelAnimationFrame(settleRafRef.current.raf1), cancelAnimationFrame(settleRafRef.current.raf2), settleRafRef.current.raf1 = requestAnimationFrame(() => { 10774 settleRafRef.current.raf2 = requestAnimationFrame(() => { 10775 dispatch({ type: "settled" }); 10776 }); 10777 }); 10778 }, []); 10779 useEffect(() => { 10780 let rafs = settleRafRef.current; 10781 return () => { 10782 cancelAnimationFrame(rafs.raf1), cancelAnimationFrame(rafs.raf2); 10783 }; 10784 }, []), useLayoutEffect(() => { 10785 if (!src) 10786 return; 10787 let iframe = iframeRef.current; 10788 if (!iframe) 10789 return; 10790 let onMessage = (event) => { 10791 if (event.source === null || event.source !== iframe.contentWindow) 10792 return; 10793 let dimensions = parseIframeResizeMessage(event.data); 10794 dimensions && handleResize(dimensions); 10795 }; 10796 window.addEventListener("message", onMessage); 10797 let requestRemeasure = () => { 10798 try { 10799 iframe.contentWindow?.postMessage( 10800 JSON.stringify({ context: IFRAME_RESIZE_REQUEST_CONTEXT }), 10801 "*" 10802 ); 10803 } catch { 10804 } 10805 }; 10806 return requestRemeasure(), iframe.addEventListener("load", requestRemeasure), () => { 10807 window.removeEventListener("message", onMessage), iframe.removeEventListener("load", requestRemeasure); 10808 }; 10809 }, [src, handleResize]); 10810 let finishCurrent = useCallback(() => { 10811 handleRef.current?.release(); 10812 }, []), forceStartCurrent = useCallback(() => { 10813 handleRef.current?.forceStart(); 10814 }, []); 10815 return { 10816 cellRef, 10817 iframeRef, 10818 src, 10819 isPreviewLoading: isThumbnailLoading(state), 10820 rememberedDimensions: state.dimensions, 10821 forceStartCurrent, 10822 finishCurrent 10823 }; 10824}; 10825 10826// src/manager/components/review/components/CollectionGrid.tsx 10827var band = (cols) => { 10828 let cap = cols * 2; 10829 return { 10830 gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`, 10831 [`&:not([data-show-all]):has(> [data-cell]:nth-child(${cap + 1})) > [data-cell]:nth-child(n + ${cap})`]: { 10832 display: "none" 10833 }, 10834 [`&:not([data-show-all]):has(> [data-cell]:nth-child(${cap + 1})) > [data-review-all]`]: { 10835 display: "flex" 10836 } 10837 }; 10838}, GridContainer = styled.div({ 10839 containerType: "inline-size", 10840 containerName: "review-grid" 10841}), Grid = styled.div({ 10842 display: "grid", 10843 alignItems: "stretch", 10844 gap: 12, 10845 padding: 12, 10846 gridTemplateColumns: "minmax(0, 1fr)", 10847 "@container review-grid (max-width: 629.98px)": band(1), 10848 "@container review-grid (min-width: 630px) and (max-width: 844.98px)": band(2), 10849 "@container review-grid (min-width: 845px) and (max-width: 1259.98px)": band(3), 10850 "@container review-grid (min-width: 1260px)": band(4) 10851}), Cell = styled.div({ 10852 display: "flex", 10853 flexDirection: "column", 10854 minWidth: 0, 10855 overflow: "hidden" 10856}), FrameShell = styled.div({ 10857 width: "100%", 10858 minWidth: 0, 10859 maxWidth: "100%", 10860 aspectRatio: "3 / 2", 10861 position: "relative" 10862}), DEFAULT_CONTENT_WIDTH = 300, THUMBNAIL_BOOTSTRAP_SCALE = 0.5, getPreviewFrameLayout = (dimensions) => dimensions ? hasFixedViewportDimensions(dimensions.viewport) ? { 10863 style: { 10864 "--vp-w": dimensions.viewport.width, 10865 "--vp-h": dimensions.viewport.height 10866 }, 10867 viewportFill: !0 10868} : { style: { "--content-w": dimensions.width }, viewportFill: !1 } : { 10869 style: { "--scale": THUMBNAIL_BOOTSTRAP_SCALE }, 10870 viewportFill: !1 10871}, Frame = styled.a(({ theme }) => ({ 10872 position: "absolute", 10873 inset: 0, 10874 display: "block", 10875 boxSizing: "border-box", 10876 containerType: "inline-size", 10877 containerName: "preview-frame", 10878 "--content-w": DEFAULT_CONTENT_WIDTH, 10879 "--fit-w": "calc(100cqw / (var(--content-w) * 1px))", 10880 "--fit": "min(1, var(--fit-w))", 10881 "--scale": "max(0.5, min(1, round(down, var(--fit), 0.25)))", 10882 "--vp-scale": "calc(100cqw / (var(--vp-w) * 1px))", 10883 borderRadius: 6, 10884 overflow: "hidden", 10885 background: theme.background.app, 10886 border: `1px solid ${theme.appBorderColor}`, 10887 transition: "border-color 120ms ease", 10888 textDecoration: "none", 10889 outline: "none", 10890 "& [data-preview-scale]": { 10891 position: "absolute", 10892 top: 0, 10893 left: 0, 10894 transformOrigin: "top left" 10895 }, 10896 "&[data-viewport-fill] [data-preview-scale]": { 10897 width: "calc(var(--vp-w) * 1px)", 10898 height: "calc(var(--vp-h) * 1px)", 10899 transform: "scale(var(--vp-scale))" 10900 }, 10901 "&:not([data-viewport-fill]) [data-preview-scale]": { 10902 width: "calc(100% / var(--scale))", 10903 height: "calc(100% / var(--scale))", 10904 transform: "scale(var(--scale))" 10905 }, 10906 "&[href]:hover": { 10907 borderColor: theme.color.secondary 10908 }, 10909 "&:focus-visible": { 10910 outline: `${theme.barSelectedColor} solid 2px`, 10911 outlineOffset: -2 10912 } 10913})), Preview = styled.iframe(({ theme }) => ({ 10914 display: "block", 10915 width: "100%", 10916 height: "100%", 10917 background: theme.background.preview, 10918 border: 0, 10919 pointerEvents: "none" 10920})), PreviewLoading = styled.div(({ theme }) => ({ 10921 position: "absolute", 10922 inset: 0, 10923 zIndex: 1, 10924 display: "grid", 10925 placeItems: "center", 10926 background: theme.background.app, 10927 pointerEvents: "none" 10928})), ActionBar2 = styled.div({ 10929 display: "flex", 10930 alignItems: "center", 10931 justifyContent: "space-between", 10932 gap: 8, 10933 minHeight: 36, 10934 marginTop: "auto" 10935}), Label = styled.div({ 10936 display: "flex", 10937 alignItems: "center", 10938 gap: 4, 10939 flex: 1, 10940 minWidth: 0, 10941 marginLeft: 10, 10942 overflow: "hidden" 10943}), LabelComponent = styled.span({ 10944 fontWeight: 700, 10945 whiteSpace: "nowrap", 10946 flexShrink: 0, 10947 maxWidth: "60%", 10948 overflow: "hidden", 10949 textOverflow: "ellipsis" 10950}), LabelSeparator = styled.span(({ theme }) => ({ 10951 color: theme.textMutedColor, 10952 flexShrink: 0 10953})), LabelStory = styled.span({ 10954 whiteSpace: "nowrap", 10955 overflow: "hidden", 10956 textOverflow: "ellipsis", 10957 marginRight: 4 10958}), NewBadge = styled(Badge)({ 10959 flexShrink: 0 10960}), ReviewAllCell = styled(Cell)({ 10961 display: "none" 10962}), ReviewAllShell = styled.div({ 10963 width: "100%", 10964 minWidth: 0, 10965 maxWidth: "100%", 10966 aspectRatio: "3 / 2", 10967 minHeight: 50 10968}), ReviewAllFrame = styled.div(({ theme }) => ({ 10969 display: "grid", 10970 placeItems: "center", 10971 width: "100%", 10972 height: "100%", 10973 boxSizing: "border-box", 10974 borderRadius: 6, 10975 background: theme.background.app, 10976 border: `1px dashed ${theme.appBorderColor}` 10977})), deriveStoryInfo = (info) => ({ 10978 component: info.title.split("/").pop() ?? info.title, 10979 name: info.name 10980}), StoryPreviewCell = ({ storyId, href, info, getPreviewHref, summaryHidden = !1 }) => { 10981 let { 10982 cellRef, 10983 iframeRef, 10984 src, 10985 isPreviewLoading, 10986 rememberedDimensions, 10987 forceStartCurrent, 10988 finishCurrent 10989 } = usePreviewThumbnail({ storyId, getPreviewHref, summaryHidden }), { component, name } = deriveStoryInfo(info), readableTitle = `${component} \u2013 ${name}`, { style: frameStyle, viewportFill } = getPreviewFrameLayout(rememberedDimensions), preview = src ? react_default.createElement("div", { "data-preview-scale": !0 }, react_default.createElement( 10990 Preview, 10991 { 10992 ref: iframeRef, 10993 title: readableTitle, 10994 src, 10995 "data-content-width": rememberedDimensions?.width, 10996 "data-content-height": rememberedDimensions?.height, 10997 tabIndex: -1, 10998 scrolling: "no", 10999 onLoad: finishCurrent, 11000 onError: finishCurrent 11001 } 11002 )) : null; 11003 return react_default.createElement(Cell, { ref: cellRef, role: "listitem", "data-cell": !0, "data-testid": "review-collection-grid-cell" }, react_default.createElement(FrameShell, null, react_default.createElement( 11004 Frame, 11005 { 11006 as: href ? "a" : "div", 11007 ...href ? { href } : {}, 11008 "data-testid": "review-collection-grid-frame", 11009 "data-viewport-fill": viewportFill || void 0, 11010 style: frameStyle, 11011 "aria-label": href ? `Review story ${readableTitle}` : void 0, 11012 onMouseEnter: forceStartCurrent, 11013 onFocus: forceStartCurrent 11014 }, 11015 isPreviewLoading ? react_default.createElement(PreviewLoading, { "data-testid": "review-preview-loading" }, react_default.createElement(Loader, null)) : null, 11016 preview 11017 )), react_default.createElement(ActionBar2, null, react_default.createElement(Label, null, react_default.createElement(LabelComponent, null, component), react_default.createElement(LabelSeparator, null, "/"), react_default.createElement(LabelStory, null, name), info.changeStatus === "new" || info.isNewlyAdded ? react_default.createElement(NewBadge, { status: "positive", compact: !0 }, "New") : null))); 11018}, CollectionGrid = ({ 11019 storyIds, 11020 getStoryHref: getStoryHref2, 11021 getStoryPreviewHref, 11022 showAll = !1, 11023 onShowAll, 11024 storyInfo, 11025 summaryHidden = !1 11026}) => react_default.createElement(GridContainer, null, react_default.createElement(Grid, { role: "list", "data-show-all": showAll || void 0, "data-testid": "review-collection-grid" }, storyIds.map((storyId, storyIndex) => { 11027 let info = storyInfo[storyId] ?? fallbackStoryInfo(storyId); 11028 return react_default.createElement( 11029 StoryPreviewCell, 11030 { 11031 key: storyId, 11032 storyId, 11033 href: getStoryHref2?.(storyId, storyIndex), 11034 info, 11035 getPreviewHref: getStoryPreviewHref, 11036 summaryHidden 11037 } 11038 ); 11039}), react_default.createElement(ReviewAllCell, { role: "presentation", "data-review-all": !0 }, react_default.createElement(ReviewAllShell, null, react_default.createElement(ReviewAllFrame, null, react_default.createElement(Button, { size: "medium", onClick: () => onShowAll?.() }, "Review all ", storyIds.length))), react_default.createElement(ActionBar2, { "aria-hidden": "true" })))); 11040 11041// src/manager/components/review/components/Markdown.tsx 11042init_react(); 11043var createInlinePattern = () => /(\*\*([\s\S]+?)\*\*|\*([\s\S]+?)\*|_([\s\S]+?)_|`([\s\S]+?)`)/g, parseInline = (text) => { 11044 let nodes = [], pattern = createInlinePattern(), lastIndex = 0, key = 0, match; 11045 for (; (match = pattern.exec(text)) !== null; ) { 11046 match.index > lastIndex && nodes.push(text.slice(lastIndex, match.index)); 11047 let [token, , bold, italicStar, italicUnderscore, code] = match; 11048 bold !== void 0 ? nodes.push(react_default.createElement("strong", { key: key++ }, parseInline(bold))) : italicStar !== void 0 ? nodes.push(react_default.createElement("em", { key: key++ }, parseInline(italicStar))) : italicUnderscore !== void 0 ? nodes.push(react_default.createElement("em", { key: key++ }, parseInline(italicUnderscore))) : code !== void 0 && nodes.push(react_default.createElement("code", { key: key++ }, code)), lastIndex = match.index + token.length; 11049 } 11050 return lastIndex < text.length && nodes.push(text.slice(lastIndex)), nodes; 11051}, Markdown = ({ children }) => { 11052 let paragraphs = children.split(/\n{2,}/).filter((paragraph) => paragraph.trim() !== ""); 11053 return react_default.createElement(react_default.Fragment, null, paragraphs.map((paragraph, index) => react_default.createElement("p", { key: index }, parseInline(paragraph)))); 11054}; 11055 11056// src/manager/components/review/components/ReviewHeader.tsx 11057init_react(); 11058var Root = styled.header(({ theme, $variant }) => ({ 11059 containerType: "inline-size", 11060 containerName: "review-header", 11061 display: "flex", 11062 flexDirection: "column", 11063 flexShrink: 0, 11064 width: "100%", 11065 background: $variant === "toolbar" ? theme.barBg : theme.background.content, 11066 color: theme.color.defaultText, 11067 ...$variant === "page" ? { borderBottom: `1px solid ${theme.appBorderColor}` } : {} 11068})), TopRow = styled.div(({ $variant }) => ({ 11069 display: "flex", 11070 flexWrap: "wrap", 11071 flexDirection: "row", 11072 alignItems: "center", 11073 gap: 8, 11074 padding: $variant === "toolbar" ? "16px 16px 8px 16px" : "16px", 11075 minHeight: 40 11076})), Main = styled.div({ 11077 display: "flex", 11078 flexDirection: "row", 11079 alignItems: "center", 11080 gap: 8, 11081 flex: "1 1 auto", 11082 minWidth: 0 11083}), Leading = styled.div({ 11084 display: "flex", 11085 alignItems: "center", 11086 alignSelf: "flex-start", 11087 flexShrink: 0 11088}), TextBlock = styled.div({ 11089 display: "flex", 11090 flexDirection: "column", 11091 flexGrow: 1, 11092 minWidth: 0 11093}), Title2 = styled.h1(({ theme }) => ({ 11094 margin: "2px 0", 11095 minWidth: 0, 11096 overflow: "hidden", 11097 textOverflow: "ellipsis", 11098 whiteSpace: "nowrap", 11099 fontSize: theme.typography.size.m1, 11100 fontWeight: theme.typography.weight.bold, 11101 lineHeight: "24px" 11102})), Subtitle = styled.div(({ theme }) => ({ 11103 display: "flex", 11104 flexWrap: "wrap", 11105 alignItems: "center", 11106 gap: 8, 11107 color: theme.textMutedColor, 11108 fontSize: theme.typography.size.s2, 11109 lineHeight: "20px" 11110})), Actions = styled.div({ 11111 display: "flex", 11112 flexWrap: "wrap", 11113 alignItems: "center", 11114 justifyContent: "flex-end", 11115 gap: 6, 11116 flex: "0 1 auto", 11117 marginLeft: "auto" 11118}), SecondRow = styled.div({ 11119 display: "flex", 11120 alignItems: "center", 11121 gap: 8, 11122 padding: "0 16px 2px 16px", 11123 minHeight: 39 11124}), ReviewHeader = ({ 11125 leading, 11126 title: title2, 11127 subtitle, 11128 actions, 11129 secondRow, 11130 variant = "page" 11131}) => { 11132 let titleId = $bdb11010cef70236$export$f680877a34711e37(), regionRef = useRef(null), { landmarkProps } = useLandmark({ "aria-labelledby": titleId, role: "banner" }, regionRef); 11133 return react_default.createElement(Root, { $variant: variant, ref: regionRef, ...landmarkProps }, react_default.createElement(TopRow, { $variant: variant }, react_default.createElement(Main, null, leading ? react_default.createElement(Leading, null, leading) : null, react_default.createElement(TextBlock, null, react_default.createElement(Title2, { id: titleId }, title2), subtitle ? react_default.createElement(Subtitle, null, subtitle) : null)), actions ? react_default.createElement(Actions, null, actions) : null), secondRow ? react_default.createElement(SecondRow, null, secondRow) : null); 11134}; 11135 11136// src/manager/components/review/
vendor: 6,830 bytes, lines 11136-11332
11136screens/SummaryScreen.tsx 11137var MarkdownWrapper = styled(DocumentWrapper)(({ theme }) => ({ 11138 color: theme.color.defaultText, 11139 p: { 11140 margin: 0 11141 }, 11142 "p + p": { 11143 marginTop: 10 11144 }, 11145 code: { 11146 color: "inherit", 11147 verticalAlign: "text-bottom", 11148 fontSize: "0.85em", 11149 margin: 0, 11150 padding: "0 4px", 11151 background: "transparent", 11152 border: "none", 11153 boxShadow: `inset 0 0 0 1px ${theme.appBorderColor}`, 11154 borderRadius: theme.appBorderRadius 11155 } 11156})), Page = styled.div(({ theme }) => ({ 11157 display: "flex", 11158 flexDirection: "column", 11159 height: "100dvh", 11160 minHeight: 0, 11161 overflow: "hidden", 11162 background: theme.background.app, 11163 color: theme.color.defaultText, 11164 fontFamily: theme.typography.fonts.base, 11165 fontSize: theme.typography.size.s2 11166})), Empty = styled.div(({ theme }) => ({ 11167 display: "flex", 11168 flexDirection: "column", 11169 gap: 16, 11170 alignItems: "center", 11171 justifyContent: "center", 11172 height: "100dvh", 11173 color: theme.color.defaultText, 11174 "& > div": { 11175 display: "flex", 11176 alignItems: "center", 11177 gap: 8 11178 } 11179})), ListScroll = styled.div({ 11180 flex: 1, 11181 minHeight: 0 11182}), Main2 = styled.main({ 11183 display: "flex", 11184 flexDirection: "column", 11185 gap: 12, 11186 padding: 12, 11187 // Cards must keep their intrinsic height so the list scrolls; without this 11188 // the default flex-shrink collapses them to fit the viewport and Card's 11189 // overflow:hidden clips the content at the bottom. 11190 "& > *": { 11191 flexShrink: 0 11192 } 11193}), SummaryCard = styled(Card)({ 11194 display: "flex", 11195 alignItems: "flex-start", 11196 padding: "9px 12px", 11197 gap: 10, 11198 svg: { 11199 flexShrink: 0, 11200 marginTop: 4 11201 } 11202}), SummaryLandmark = ({ children }) => { 11203 let asideRef = useRef(null), { landmarkProps } = useLandmark( 11204 { role: "complementary", "aria-label": "Summary" }, 11205 asideRef 11206 ); 11207 return react_default.createElement("aside", { ref: asideRef, ...landmarkProps }, children); 11208}, SummaryContent = styled(MarkdownWrapper)({ 11209 flex: 1, 11210 minWidth: 0, 11211 // Keep the "Summary:" heading and the first description paragraph on the same 11212 // line, matching the previous inline "**Summary:** …" rendering. 11213 "& > p:first-of-type": { 11214 display: "inline" 11215 } 11216}), SummaryHeading = styled.h2(({ theme }) => ({ 11217 // Double the ampersand to outrank the DocumentWrapper's `.wrapper h2` rule 11218 // (specificity 0,1,1), which would otherwise enlarge this and add a bottom 11219 // border, so the label stays identical to the inline bold it replaces. 11220 "&&": { 11221 display: "inline", 11222 margin: 0, 11223 padding: 0, 11224 fontSize: "inherit", 11225 fontWeight: theme.typography.weight.bold, 11226 lineHeight: "inherit", 11227 color: "inherit", 11228 border: "none" 11229 } 11230})), CardHead = styled.div({ 11231 display: "flex", 11232 alignItems: "center", 11233 justifyContent: "space-between", 11234 gap: 8, 11235 padding: "6px 10px 6px 12px", 11236 minHeight: 40, 11237 cursor: "pointer" 11238}), CardTitle = styled.h2(({ theme }) => ({ 11239 minWidth: 0, 11240 margin: 0, 11241 overflow: "hidden", 11242 textOverflow: "ellipsis", 11243 whiteSpace: "nowrap", 11244 fontSize: "inherit", 11245 fontWeight: theme.typography.weight.bold, 11246 lineHeight: "20px", 11247 color: theme.color.defaultText 11248})), CardControls = styled.div({ 11249 display: "flex", 11250 alignItems: "center", 11251 justifyContent: "flex-end", 11252 gap: 6, 11253 flexShrink: 0 11254}), CardCount = styled.span(({ theme }) => ({ 11255 minWidth: 28, 11256 fontFamily: theme.typography.fonts.mono, 11257 fontSize: theme.typography.size.s2 - 1, 11258 lineHeight: "20px", 11259 textAlign: "center", 11260 color: theme.textMutedColor 11261})), ToggleChevronIcon = styled(ChevronSmallDownIcon)({ 11262 transition: "transform 160ms ease" 11263}), CardRationale = styled(MarkdownWrapper)(({ theme }) => ({ 11264 color: theme.textMutedColor, 11265 margin: "0 12px" 11266})), Footer = styled.div(({ theme }) => ({ 11267 color: theme.textMutedColor, 11268 padding: "10px 10px 30px", 11269 fontSize: theme.typography.size.s2, 11270 textAlign: "center", 11271 textWrap: "balance" 11272})), CollectionLandmark = ({ 11273 titleId, 11274 children 11275}) => { 11276 let regionRef = useRef(null), { landmarkProps } = useLandmark({ role: "region", "aria-labelledby": titleId }, regionRef); 11277 return react_default.createElement("section", { ref: regionRef, ...landmarkProps }, children); 11278}, FooterLandmark = ({ children }) => { 11279 let regionRef = useRef(null), { landmarkProps } = useLandmark( 11280 { role: "region", "aria-label": "About this review" }, 11281 regionRef 11282 ); 11283 return react_default.createElement(Footer, { as: "footer", ref: regionRef, ...landmarkProps }, children); 11284}, pluralize = (count, singular, plural = `${singular}s`) => `${count} ${count === 1 ? singular : plural}`, formatCreatedAgo = (createdAt, nowMs) => { 11285 let elapsedMs = Math.max(0, nowMs - createdAt); 11286 if (elapsedMs < 6e4) 11287 return "just now"; 11288 let elapsedMinutes = Math.floor(elapsedMs / 6e4); 11289 return elapsedMinutes < 60 ? `${elapsedMinutes}m ago` : `${Math.floor(elapsedMinutes / 60)}h ago`; 11290}, SummaryScreen = ({ 11291 state, 11292 storyInfo = {}, 11293 getStoryPreviewHref, 11294 banner = null, 11295 summaryHidden = !1, 11296 onDismiss, 11297 returnSearch = null 11298}) => { 11299 let [expandedCollections, setExpandedCollections] = useState(() => /* @__PURE__ */ new Set()), [showAllCollections, setShowAllCollections] = useState(() => /* @__PURE__ */ new Set()), [showNewOnly, setShowNewOnly] = useState(!1), [nowMs, setNowMs] = useState(() => Date.now()); 11300 useEffect(() => { 11301 let intervalId = window.setInterval(() => { 11302 setNowMs(Date.now()); 11303 }, 1e4); 11304 return () => window.clearInterval(intervalId); 11305 }, []), useLayoutEffect(() => { 11306 if (!state) { 11307 setExpandedCollections(/* @__PURE__ */ new Set()), setShowAllCollections(/* @__PURE__ */ new Set()); 11308 return; 11309 } 11310 setExpandedCollections(new Set(state.collections.map((_2, index) => index))), setShowAllCollections(/* @__PURE__ */ new Set()); 11311 }, [state?.createdAt]); 11312 let newStoryCount = useMemo( 11313 () => new Set( 11314 (state?.collections ?? []).flatMap((c2) => c2.storyIds).filter((id) => storyInfo[id]?.isNewlyAdded) 11315 ).size, 11316 [state, storyInfo] 11317 ), visibleCollections = useMemo( 11318 () => (state?.collections ?? []).map((collection, index) => { 11319 let storyIds = showNewOnly ? collection.storyIds.filter((id) => storyInfo[id]?.isNewlyAdded) : collection.storyIds; 11320 return { collection, index, storyIds }; 11321 }).filter((entry) => entry.storyIds.length > 0), 11322 [state?.collections, showNewOnly, storyInfo] 11323 ); 11324 if (!state) 11325 return react_default.createElement(Empty, null, react_default.createElement("span", null, "Waiting for the agent to display a review\u2026"), react_default.createElement("div", null, react_default.createElement( 11326 CopyButton, 11327 { 11328 appearance: "agentic", 11329 padding: "small", 11330 ariaLabel: "Copy prompt to refresh this review", 11331 ariaLabelOnCopy: "Prompt copied to clipboard", 11332 content: "Generate a Storybook review including my latest changes using the display-review
vendor: 5,560 bytes, lines 11332-11428
11332 tool.", 11333 childrenOnCopy: react_default.createElement(react_default.Fragment, null, react_default.createElement(CheckIcon, null), " Copy prompt") 11334 }, 11335 react_default.createElement(CopyIcon, null), 11336 "Copy prompt" 11337 ), react_default.createElement(Button, { padding: "small", onClick: onDismiss, ariaLabel: "Close review screen" }, react_default.createElement(CloseIcon, null), "Close"))); 11338 let storyCount = new Set(state.collections.flatMap((collection) => collection.storyIds)).size, createdAgo = state.createdAt ? formatCreatedAgo(state.createdAt, nowMs) : null, toggleCollection = (index) => { 11339 setExpandedCollections((previous) => { 11340 let next = new Set(previous); 11341 return next.has(index) ? next.delete(index) : next.add(index), next; 11342 }); 11343 }, markCollectionShowAll = (index) => { 11344 setShowAllCollections( 11345 (previous) => previous.has(index) ? previous : new Set(previous).add(index) 11346 ); 11347 }; 11348 return react_default.createElement(Page, null, banner && react_default.createElement(AttentionBanner, { ...banner }), react_default.createElement( 11349 ReviewHeader, 11350 { 11351 leading: react_default.createElement(Button, { variant: "ghost", size: "small", padding: "small", ariaLabel: "Exit review", asChild: !0 }, react_default.createElement("a", { href: buildSummaryBackHref(returnSearch), [REVIEW_SUMMARY_BACK_ATTR]: "" }, react_default.createElement(ChevronSmallLeftIcon, null), react_default.createElement(StorybookIcon, null))), 11352 title: state.title, 11353 subtitle: react_default.createElement(react_default.Fragment, null, react_default.createElement("span", null, "Showing ", pluralize(storyCount, "story", "stories"), " for quick review"), createdAgo ? react_default.createElement(react_default.Fragment, null, react_default.createElement("span", null, "\u2022"), react_default.createElement("span", null, createdAgo)) : null), 11354 actions: newStoryCount > 0 ? react_default.createElement( 11355 ToggleButton, 11356 { 11357 variant: "ghost", 11358 size: "small", 11359 padding: "small", 11360 ariaLabel: !1, 11361 tooltip: "Toggle filtering of new stories", 11362 pressed: showNewOnly, 11363 onClick: () => setShowNewOnly((v2) => !v2) 11364 }, 11365 newStoryCount, 11366 " new" 11367 ) : null 11368 } 11369 ), react_default.createElement(ListScroll, null, react_default.createElement(ScrollArea, { vertical: !0 }, react_default.createElement(Main2, null, react_default.createElement(SummaryLandmark, null, react_default.createElement(SummaryCard, { color: "agentic" }, react_default.createElement(WandIcon, null), react_default.createElement(SummaryContent, null, react_default.createElement(SummaryHeading, null, "Summary:"), " ", react_default.createElement(Markdown, null, state.description)))), visibleCollections.length === 0 ? react_default.createElement(Footer, null, showNewOnly ? "No new stories found." : "No collections found.") : visibleCollections.map(({ collection, index, storyIds }) => { 11370 let isExpanded = expandedCollections.has(index), titleId = `review-collection-title-${index}`; 11371 return react_default.createElement(CollectionLandmark, { key: `${collection.title}-${index}`, titleId }, react_default.createElement(Card, null, react_default.createElement( 11372 Collapsible, 11373 { 11374 collapsed: !isExpanded, 11375 summary: react_default.createElement(CardHead, { onClick: () => toggleCollection(index) }, react_default.createElement(CardTitle, { id: titleId }, collection.title), react_default.createElement(CardControls, null, react_default.createElement( 11376 CardCount, 11377 { 11378 "aria-label": pluralize(storyIds.length, "story", "stories") 11379 }, 11380 storyIds.length 11381 ), react_default.createElement( 11382 IconButton, 11383 { 11384 variant: "ghost", 11385 size: "small", 11386 padding: "small", 11387 ariaLabel: isExpanded ? `Collapse collection ${collection.title}` : `Expand collection ${collection.title}`, 11388 "aria-expanded": isExpanded, 11389 onClick: (event) => { 11390 event.stopPropagation(), toggleCollection(index); 11391 } 11392 }, 11393 react_default.createElement( 11394 ToggleChevronIcon, 11395 { 11396 style: { transform: `rotate(${isExpanded ? -180 : 0}deg)` } 11397 } 11398 ) 11399 ))) 11400 }, 11401 collection.rationale ? react_default.createElement(CardRationale, null, react_default.createElement(Markdown, null, collection.rationale)) : null, 11402 react_default.createElement( 11403 CollectionGrid, 11404 { 11405 storyIds, 11406 showAll: showAllCollections.has(index), 11407 onShowAll: () => markCollectionShowAll(index), 11408 storyInfo, 11409 getStoryHref: (storyId) => buildReviewStoryHref({ collectionIndex: index, storyId }), 11410 getStoryPreviewHref, 11411 summaryHidden 11412 } 11413 ) 11414 ))); 11415 }), react_default.createElement(FooterLandmark, null, "This review shows the ", pluralize(storyCount, "story", "stories"), " most relevant for you to spot-check right now. Because this is AI-curated, results may be inaccurate or incomplete."))))); 11416}; 11417 11418// src/manager/components/review/screens/ReviewSummaryHost.tsx 11419var SummaryHost = styled.div(({ $visible }) => ({ 11420 position: "absolute", 11421 inset: 0, 11422 display: "flex", 11423 flexDirection: "column", 11424 overflow: "hidden", 11425 visibility: $visible ? "visible" : "hidden", 11426 pointerEvents: $visible ? "auto" : "none" 11427})), ReviewSummaryHost = () => { 11428 let api = useStorybookApi(), {
11428state, storyInfo, banner, isInReviewMode, isSummaryVisible } = useReview(), getStoryPreviewHref = useCallback( 11429 (storyId) => api.getStoryHrefs(storyId, { embed: !0, freeze: !0 }).previewHref, 11430 [api] 11431 ), onDismiss = useCallback(() => dismissReview(api), [api]); 11432 return !isSummaryVisible && !isInReviewMode ? null : react_default.createElement( 11433 SummaryHost, 11434 { 11435 ref: (node) => { 11436 node && (node.inert = !isSummaryVisible); 11437 }, 11438 $visible: isSummaryVisible, 11439 "aria-hidden": isSummaryVisible ? void 0 : !0, 11440 "data-review-summary": isSummaryVisible ? "visible" : "hidden" 11441 }, 11442 react_default.createElement( 11443 SummaryScreen, 11444 { 11445 state, 11446 storyInfo, 11447 getStoryPreviewHref, 11448 banner, 11449 summaryHidden: !isSummaryVisible, 11450 onDismiss, 11451 returnSearch: sessionStore.read(PRE_REVIEW_RETURN_KEY) 11452 } 11453 ) 11454 ); 11455}; 11456
11457// src/manager/components/review/useReviewNavigationInterceptor.ts 11458init_react()
vendor: 667 bytes, lines 11458-11477
11458; 11459 11460// src/manager/components/review/useReviewFiltersRef.ts 11461init_react(); 11462var useReviewFiltersRef = () => { 11463 let { includedStatusFilters, excludedStatusFilters, includedTagFilters, excludedTagFilters } = useStorybookState(), filtersRef = useRef({ 11464 includedStatusFilters: [], 11465 excludedStatusFilters: [], 11466 includedTagFilters: [], 11467 excludedTagFilters: [] 11468 }); 11469 return filtersRef.current = { 11470 includedStatusFilters: includedStatusFilters ?? [], 11471 excludedStatusFilters: excludedStatusFilters ?? [], 11472 includedTagFilters: includedTagFilters ?? [], 11473 excludedTagFilters: excludedTagFilters ?? [] 11474 }, filtersRef; 11475}; 11476 11477// src/manager/components/review/
11477useReviewNavigationInterceptor.ts 11478var isReviewStoryHref = (href) => href.startsWith("?path=/story/") && href.includes(`${REVIEW_COLLECTION_QUERY_PARAM}=`), isReviewSummaryHref = (href) => href === buildReviewChangesSummaryHref(), useReviewNavigationInterceptor = () => { 11479 let navigate = useNavigate(), api = useStorybookApi(), filtersRef = useReviewFiltersRef(); 11480 useEffect(() => { 11481 let onClick = (event) => { 11482 if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) 11483 return; 11484 let { target } = event, anchor = target instanceof Element ? target.closest("a") : null, href = anchor?.getAttribute("href"); 11485 if (!href) 11486 return; 11487 if (anchor?.hasAttribute(REVIEW_SUMMARY_BACK_ATTR)) { 11488 event.preventDefault(), navigateOutOfReview(api, navigate, sessionStore.read(PRE_REVIEW_RETURN_KEY)); 11489 return; 11490 } 11491 if (!isReviewStoryHref(href) && !isReviewSummaryHref(href)) 11492 return; 11493 if (event.preventDefault(), isReviewSummaryHref(href)) { 11494 navigateToReviewSummary(api, navigate, filtersRef.current); 11495 return; 11496 } 11497 let entry = parseReviewStoryHref(href); 11498 entry && navigateToReviewEntry(api, navigate, entry, filtersRef.current); 11499 }; 11500 return document.addEventListener("click", onClick), () => document.removeEventListener("click", onClick); 11501 }, [api, navigate, filtersRef]); 11502}; 11503
11504// src/manager/components/review/components/ReviewNotification.tsx 11505init_react(); 11506var ReviewNotification = () => { 11507 let api = useStorybookApi(), navigate = useNavigate(), { path, customQueryParams } = useStorybookState(), { state: displayed, pendingReview: deferred } = useReview(), filtersRef = useReviewFiltersRef(), collectionIndex = readCollectionIndex(customQueryParams), openReview = useCallback(() => { 11508 navigateToReviewSummary(api, navigate, filtersRef.current); 11509 }, [api, navigate, filtersRef]), handleNotificationClick = useCallback( 11510 (createdAt) => { 11511 let { pendingReview, banner } = reviewStore.getState(); 11512 if (pendingReview?.createdAt === createdAt && banner?.kind === "pending-update") { 11513 banner.onAccept(); 11514 return; 11515 } 11516 acceptReviewNotification(api, createdAt), openReview(); 11517 }, 11518 [api, openReview] 11519 ); 11520 return useLayoutEffect(() => { 11521 let review = pickReviewToNotify(displayed, deferred); 11522 if (!review) 11523 return; 11524 if (shouldAutoAcceptOnRoute(path, collectionIndex, review, displayed, deferred)) { 11525 acceptReviewNotification(api, review.createdAt); 11526 return; 11527 } 11528 if (shouldSkipArrivalNotification(path, collectionIndex, review, displayed, deferred)) 11529 return; 11530 let createdAt = review.createdAt; 11531 createdAt === void 0 || !claimNotificationSlot(api, createdAt, displayed?.createdAt, deferred?.createdAt) || api.addNotification({ 11532 id: reviewAvailableNotificationId(createdAt), 11533 content: { 11534 headline: "New review available", 11535 subHeadline: review.title ?? "Open the curated review to spot-check your changes" 11536 }, 11537 icon: react_default.createElement(WandIcon, null), 11538 onClick: ({ onDismiss }) => { 11539 handleNotificationClick(createdAt), onDismiss(); 11540 } 11541 }); 11542 }, [api, collectionIndex, handleNotificationClick, displayed, deferred, path]), null; 11543}; 11544
11545// src/manager/components/review/components/ReviewProvider.tsx 11546init_react()
vendor: 1,784 bytes, lines 11546-11581
11546; 11547 11548// src/manager/components/review/review-story-info.ts 11549var getStoryChangeStatus = (allStatuses, storyId) => { 11550 let changeValue = Object.values(allStatuses[storyId] ?? {}).find( 11551 (status) => status.typeId === CHANGE_DETECTION_STATUS_TYPE_ID 11552 )?.value; 11553 if (changeValue === "status-value:new") 11554 return "new"; 11555 if (changeValue === "status-value:modified") 11556 return "modified"; 11557}, buildNewlyAddedStoryIds = (state, allStatuses) => { 11558 let ids = /* @__PURE__ */ new Set(), isChangeDetectedNew = (storyId) => Object.values(allStatuses[storyId] ?? {}).some((status) => status.value === "status-value:new"); 11559 for (let collection of state.collections) 11560 for (let storyId of collection.storyIds) 11561 isChangeDetectedNew(storyId) && ids.add(storyId); 11562 return ids; 11563}, resolveStoryTitleAndName = (storyId, internalIndex, index, api) => { 11564 let fromInternal = internalIndex?.entries[storyId]; 11565 if (fromInternal?.type === "story" && fromInternal.title) 11566 return { title: fromInternal.title, name: fromInternal.name }; 11567 let direct = index?.[storyId], entry = direct?.type === "story" ? direct : index ? api.findLeafEntry(index, storyId) : void 0; 11568 return entry?.type === "story" && entry.title ? { title: entry.title, name: entry.name } : fallbackStoryInfo(storyId); 11569}, buildStoryInfo = (state, index, internalIndex, api, allStatuses, newlyAddedStoryIds) => { 11570 let info = {}; 11571 for (let collection of state.collections) 11572 for (let storyId of collection.storyIds) 11573 storyId in info || (info[storyId] = { 11574 ...resolveStoryTitleAndName(storyId, internalIndex, index, api), 11575 isNewlyAdded: newlyAddedStoryIds.has(storyId) || void 0, 11576 changeStatus: getStoryChangeStatus(allStatuses, storyId) 11577 }); 11578 return info; 11579}; 11580 11581// src/manager/components/review/
11581components/ReviewProvider.tsx 11582var reviewStatusStore = experimental_getStatusStore(REVIEW_STATUS_TYPE_ID), isDeferredReviewUpdate = (current, next) => current !== null && current.createdAt !== void 0 && next.createdAt !== void 0 && current.createdAt !== next.createdAt, isSameReviewPayload = (current, next) => current?.createdAt !== void 0 && current.createdAt === next.createdAt, ReviewProvider = ({ children }) => { 11583 let api = useStorybookApi(), navigate = useNavigate(), { index, internal_index, path, viewMode, customQueryParams, location: location2 } = useStorybookState(), { state, pendingReview, isStale, isInReviewMode } = useReview(), lastPageviewKeyRef = useRef(null), collectionParam = customQueryParams?.[REVIEW_COLLECTION_QUERY_PARAM], filtersRef = useReviewFiltersRef(), syncActiveReviewStatuses = useCallback((review) => { 11584 applyReviewStatuses(reviewStatusStore, collectReviewStoryIds(review)); 11585 }, []), emit = useChannel({ 11586 [REVIEW_EVENTS.DISPLAY_REVIEW]: (next) => { 11587 let current = reviewStore.getState().state; 11588 if (isDeferredReviewUpdate(current, next)) { 11589 reviewStore.deferReview(next); 11590 return; 11591 } 11592 if (isSameReviewPayload(current, next)) { 11593 reviewStore.setStale(!!next.stale), syncActiveReviewStatuses(next); 11594 return; 11595 } 11596 sessionStore.remove(AUTO_ENTERED_SESSION_KEY), reviewStore.displayReview(next); 11597 }, 11598 [REVIEW_EVENTS.REVIEW_STALE]: () => { 11599 reviewStore.setStale(!0); 11600 }, 11601 [REVIEW_EVENTS.REVIEW_DISMISSED]: (returnSearch) => { 11602 clearReviewStatuses(reviewStatusStore), sessionStore.remove(AUTO_ENTERED_SESSION_KEY); 11603 let { state: displayed, pendingReview: deferred } = reviewStore.getState(); 11604 clearReviewNotificationsOnDismiss(api, displayed, deferred), reviewStore.clearReview(), navigateOutOfReview(api, navigate, returnSearch, { recordVisit: !1 }); 11605 } 11606 }); 11607 useEffect(() => { 11608 emit(REVIEW_EVENTS.REQUEST_REVIEW); 11609 }, [emit]), useEffect(() => { 11610 state && syncActiveReviewStatuses(state); 11611 }, [state, syncActiveReviewStatuses]); 11612 let flattenedEntries = useMemo(() => state ? buildFlattenedNavEntries(state) : [], [state]), allStatuses = experimental_useStatusStore(), newlyAddedStoryIds = useMemo( 11613 () => state ? buildNewlyAddedStoryIds(state, allStatuses) : /* @__PURE__ */ new Set(), 11614 [allStatuses, state] 11615 ), storyInfo = useMemo( 11616 () => state ? buildStoryInfo(state, index, internal_index, api, allStatuses, newlyAddedStoryIds) : {}, 11617 [allStatuses, api, index, internal_index, newlyAddedStoryIds, state] 11618 ), collectionIndex = parseCollectionIndex(collectionParam), storyIdFromPath = parseStoryIdFromPath(path), activeEntry = state && storyIdFromPath ? resolveActiveNavEntry(flattenedEntries, storyIdFromPath, collectionIndex) : null, activeIndex = activeEntry ? resolveNavIndex(flattenedEntries, activeEntry) : -1, isSummaryVisible = isReviewSummaryPath(path), onAcceptPendingUpdate = useCallback(() => { 11619 acceptPendingReview(api, navigate, filtersRef.current); 11620 }, [api, navigate, filtersRef]), banner = useMemo( 11621 () => pendingReview !== null ? { kind: "pending-update", onAccept: onAcceptPendingUpdate } : isStale ? { kind: "stale" } : null, 11622 [pendingReview, isStale, onAcceptPendingUpdate] 11623 ); 11624 useEffect(() => { 11625 if (!state) { 11626 lastPageviewKeyRef.current = null; 11627 return; 11628 } 11629 let page = null, key = null; 11630 isSummaryVisible ? (page = "summary", key = "summary") : isInReviewMode && activeEntry && (page = "detail", key = `detail:${activeEntry.storyId}`), !(!page || key === lastPageviewKeyRef.current) && (lastPageviewKeyRef.current = key, emit(REVIEW_EVENTS.PAGEVIEW, { page, reviewCreatedAt: state.createdAt })); 11631 }
11631, [state, isSummaryVisible, isInReviewMode, activeEntry, emit]), useEffect(() => { 11632 !state || !isSummaryVisible || isReviewModeActive() || reviewStore.getState().isExiting || sessionStore.read(AUTO_ENTERED_SESSION_KEY) !== "1" && (sessionStore.write(AUTO_ENTERED_SESSION_KEY, "1"), enterReviewMode(api, filtersRef.current)); 11633 }, [state, isSummaryVisible, api, filtersRef]), useEffect(() => { 11634 if (isInReviewMode || viewMode !== "story" && viewMode !== "docs") 11635 return; 11636 let search = location2?.search; 11637 search && !isReviewReturnSearch(search) && sessionStore.write(PRE_REVIEW_RETURN_KEY, search); 11638 }, [isInReviewMode, viewMode, location2?.search]); 11639 let derived2 = useMemo( 11640 () => ({ 11641 storyInfo, 11642 flattenedEntries, 11643 newlyAddedStoryIds, 11644 activeEntry, 11645 activeIndex, 11646 isSummaryVisible, 11647 banner 11648 }), 11649 [ 11650 storyInfo, 11651 flattenedEntries, 11652 newlyAddedStoryIds, 11653 activeEntry, 11654 activeIndex, 11655 isSummaryVisible, 11656 banner 11657 ] 11658 ); 11659 return useLayoutEffect(() => { 11660 reviewStore.setDerived(derived2); 11661 }, [derived2]), children; 11662}; 11663
11664// src/manager/components/review/components/ReviewPersistentLayer.tsx 11665var ReviewNavigationLayer = () => (useReviewNavigationInterceptor(), react_default.createElement(react_default.Fragment, null, react_default.createElement(ReviewNotification, null), react_default.createElement(ReviewSummaryHost, null))), ReviewPersistentLayer = () => react_default.createElement(ReviewProvider, null, react_default.createElement(ReviewNavigationLayer, null))
vendor: 13,444 bytes, lines 11665-11914
11665; 11666 11667// src/manager/container/Panel.tsx 11668init_react(); 11669 11670// src/core-events/index.ts 11671var events = /* @__PURE__ */ ((events2) => (events2.CHANNEL_WS_DISCONNECT = "channelWSDisconnect", events2.CHANNEL_CREATED = "channelCreated", events2.CONFIG_ERROR = "configError", events2.STORY_INDEX_INVALIDATED = "storyIndexInvalidated", events2.STORY_SPECIFIED = "storySpecified", events2.SET_CONFIG = "setConfig", events2.SET_STORIES = "setStories", events2.SET_INDEX = "setIndex", events2.SET_CURRENT_STORY = "setCurrentStory", events2.CURRENT_STORY_WAS_SET = "currentStoryWasSet", events2.FORCE_RE_RENDER = "forceReRender", events2.FORCE_REMOUNT = "forceRemount", events2.PRELOAD_ENTRIES = "preloadStories", events2.STORY_PREPARED = "storyPrepared", events2.DOCS_PREPARED = "docsPrepared", events2.STORY_CHANGED = "storyChanged", events2.STORY_UNCHANGED = "storyUnchanged", events2.STORY_RENDERED = "storyRendered", events2.STORY_FINISHED = "storyFinished", events2.STORY_MISSING = "storyMissing", events2.STORY_ERRORED = "storyErrored", events2.STORY_THREW_EXCEPTION = "storyThrewException", events2.STORY_RENDER_PHASE_CHANGED = "storyRenderPhaseChanged", events2.STORY_HOT_UPDATED = "storyHotUpdated", events2.PLAY_FUNCTION_THREW_EXCEPTION = "playFunctionThrewException", events2.UNHANDLED_ERRORS_WHILE_PLAYING = "unhandledErrorsWhilePlaying", events2.UPDATE_STORY_ARGS = "updateStoryArgs", events2.STORY_ARGS_UPDATED = "storyArgsUpdated", events2.RESET_STORY_ARGS = "resetStoryArgs", events2.SET_FILTER = "setFilter", events2.SET_GLOBALS = "setGlobals", events2.UPDATE_GLOBALS = "updateGlobals", events2.GLOBALS_UPDATED = "globalsUpdated", events2.REGISTER_SUBSCRIPTION = "registerSubscription", events2.PREVIEW_INITIALIZED = "previewInitialized", events2.PREVIEW_KEYDOWN = "previewKeydown", events2.PREVIEW_BUILDER_PROGRESS = "preview_builder_progress", events2.SELECT_STORY = "selectStory", events2.STORIES_COLLAPSE_ALL = "storiesCollapseAll", events2.STORIES_EXPAND_ALL = "storiesExpandAll", events2.DOCS_RENDERED = "docsRendered", events2.SHARED_STATE_CHANGED = "sharedStateChanged", events2.SHARED_STATE_SET = "sharedStateSet", events2.NAVIGATE_URL = "navigateUrl", events2.UPDATE_QUERY_PARAMS = "updateQueryParams", events2.REQUEST_WHATS_NEW_DATA = "requestWhatsNewData", events2.RESULT_WHATS_NEW_DATA = "resultWhatsNewData", events2.SET_WHATS_NEW_CACHE = "setWhatsNewCache", events2.TOGGLE_WHATS_NEW_NOTIFICATIONS = "toggleWhatsNewNotifications", events2.TELEMETRY_ERROR = "telemetryError", events2.FILE_COMPONENT_SEARCH_REQUEST = "fileComponentSearchRequest", events2.FILE_COMPONENT_SEARCH_RESPONSE = "fileComponentSearchResponse", events2.SAVE_STORY_REQUEST = "saveStoryRequest", events2.SAVE_STORY_RESPONSE = "saveStoryResponse", events2.ARGTYPES_INFO_REQUEST = "argtypesInfoRequest", events2.ARGTYPES_INFO_RESPONSE = "argtypesInfoResponse", events2.CREATE_NEW_STORYFILE_REQUEST = "createNewStoryfileRequest", events2.CREATE_NEW_STORYFILE_RESPONSE = "createNewStoryfileResponse", events2.GHOST_STORIES_REQUEST = "ghostStoriesRequest", events2.GHOST_STORIES_RESPONSE = "ghostStoriesResponse", events2.AI_SETUP_ANALYTICS_RESPONSE = "aiSetupAnalyticsResponse", events2.AI_SETUP_ANALYTICS_REQUEST = "aiSetupAnalyticsRequest", events2.OPEN_IN_EDITOR_REQUEST = "openInEditorRequest", events2.OPEN_IN_EDITOR_RESPONSE = "openInEditorResponse", events2.MANAGER_INERT_ATTRIBUTE_CHANGED = "managerInertAttributeChanged", events2.SHARE_ISOLATE_MODE = "shareIsolateMode", events2.AI_PROMPT_NUDGE = "aiPromptNudge", events2.SIDEBAR_FILTER_CHANGED = "sidebarFilterChanged", events2))(events || {}); 11672var { 11673 CHANNEL_WS_DISCONNECT: CHANNEL_WS_DISCONNECT2, 11674 CHANNEL_CREATED: CHANNEL_CREATED2, 11675 CONFIG_ERROR: CONFIG_ERROR2, 11676 CREATE_NEW_STORYFILE_REQUEST: CREATE_NEW_STORYFILE_REQUEST2, 11677 CREATE_NEW_STORYFILE_RESPONSE: CREATE_NEW_STORYFILE_RESPONSE2, 11678 CURRENT_STORY_WAS_SET: CURRENT_STORY_WAS_SET2, 11679 DOCS_PREPARED: DOCS_PREPARED2, 11680 DOCS_RENDERED: DOCS_RENDERED2, 11681 FILE_COMPONENT_SEARCH_REQUEST: FILE_COMPONENT_SEARCH_REQUEST2, 11682 FILE_COMPONENT_SEARCH_RESPONSE: FILE_COMPONENT_SEARCH_RESPONSE2, 11683 FORCE_RE_RENDER: FORCE_RE_RENDER2, 11684 FORCE_REMOUNT: FORCE_REMOUNT2, 11685 GLOBALS_UPDATED: GLOBALS_UPDATED2, 11686 NAVIGATE_URL: NAVIGATE_URL2, 11687 PLAY_FUNCTION_THREW_EXCEPTION: PLAY_FUNCTION_THREW_EXCEPTION2, 11688 UNHANDLED_ERRORS_WHILE_PLAYING: UNHANDLED_ERRORS_WHILE_PLAYING2, 11689 PRELOAD_ENTRIES: PRELOAD_ENTRIES2, 11690 PREVIEW_INITIALIZED: PREVIEW_INITIALIZED2, 11691 PREVIEW_BUILDER_PROGRESS: PREVIEW_BUILDER_PROGRESS2, 11692 PREVIEW_KEYDOWN: PREVIEW_KEYDOWN2, 11693 REGISTER_SUBSCRIPTION: REGISTER_SUBSCRIPTION2, 11694 RESET_STORY_ARGS: RESET_STORY_ARGS2, 11695 SELECT_STORY: SELECT_STORY2, 11696 SET_CONFIG: SET_CONFIG2, 11697 SET_CURRENT_STORY: SET_CURRENT_STORY2, 11698 SET_FILTER: SET_FILTER2, 11699 SET_GLOBALS: SET_GLOBALS2, 11700 SET_INDEX: SET_INDEX2, 11701 SET_STORIES: SET_STORIES2, 11702 SHARED_STATE_CHANGED: SHARED_STATE_CHANGED2, 11703 SHARED_STATE_SET: SHARED_STATE_SET2, 11704 STORIES_COLLAPSE_ALL: STORIES_COLLAPSE_ALL2, 11705 STORIES_EXPAND_ALL: STORIES_EXPAND_ALL2, 11706 STORY_ARGS_UPDATED: STORY_ARGS_UPDATED2, 11707 STORY_CHANGED: STORY_CHANGED2, 11708 STORY_ERRORED: STORY_ERRORED2, 11709 STORY_INDEX_INVALIDATED: STORY_INDEX_INVALIDATED2, 11710 STORY_MISSING: STORY_MISSING2, 11711 STORY_PREPARED: STORY_PREPARED2, 11712 STORY_RENDER_PHASE_CHANGED: STORY_RENDER_PHASE_CHANGED2, 11713 STORY_RENDERED: STORY_RENDERED2, 11714 STORY_FINISHED: STORY_FINISHED2, 11715 STORY_SPECIFIED: STORY_SPECIFIED2, 11716 STORY_THREW_EXCEPTION: STORY_THREW_EXCEPTION2, 11717 STORY_UNCHANGED: STORY_UNCHANGED2, 11718 STORY_HOT_UPDATED: STORY_HOT_UPDATED2, 11719 UPDATE_GLOBALS: UPDATE_GLOBALS2, 11720 UPDATE_QUERY_PARAMS: UPDATE_QUERY_PARAMS2, 11721 UPDATE_STORY_ARGS: UPDATE_STORY_ARGS2, 11722 REQUEST_WHATS_NEW_DATA: REQUEST_WHATS_NEW_DATA2, 11723 RESULT_WHATS_NEW_DATA: RESULT_WHATS_NEW_DATA2, 11724 SET_WHATS_NEW_CACHE: SET_WHATS_NEW_CACHE2, 11725 TOGGLE_WHATS_NEW_NOTIFICATIONS: TOGGLE_WHATS_NEW_NOTIFICATIONS2, 11726 TELEMETRY_ERROR: TELEMETRY_ERROR2, 11727 SAVE_STORY_REQUEST: SAVE_STORY_REQUEST2, 11728 SAVE_STORY_RESPONSE: SAVE_STORY_RESPONSE2, 11729 ARGTYPES_INFO_REQUEST: ARGTYPES_INFO_REQUEST2, 11730 ARGTYPES_INFO_RESPONSE: ARGTYPES_INFO_RESPONSE2, 11731 GHOST_STORIES_REQUEST: GHOST_STORIES_REQUEST2, 11732 GHOST_STORIES_RESPONSE: GHOST_STORIES_RESPONSE2, 11733 AI_SETUP_ANALYTICS_RESPONSE: AI_SETUP_ANALYTICS_RESPONSE2, 11734 AI_SETUP_ANALYTICS_REQUEST: AI_SETUP_ANALYTICS_REQUEST2, 11735 OPEN_IN_EDITOR_REQUEST: OPEN_IN_EDITOR_REQUEST2, 11736 OPEN_IN_EDITOR_RESPONSE: OPEN_IN_EDITOR_RESPONSE2, 11737 MANAGER_INERT_ATTRIBUTE_CHANGED: MANAGER_INERT_ATTRIBUTE_CHANGED2, 11738 SHARE_ISOLATE_MODE: SHARE_ISOLATE_MODE2, 11739 AI_PROMPT_NUDGE: AI_PROMPT_NUDGE2, 11740 SIDEBAR_FILTER_CHANGED: SIDEBAR_FILTER_CHANGED2 11741} = events; 11742 11743// src/manager/components/panel/Panel.tsx 11744init_react(); 11745var TabErrorBoundary = class extends Component { 11746 constructor(props) { 11747 super(props), this.state = { hasError: !1 }; 11748 } 11749 static getDerivedStateFromError() { 11750 return { hasError: !0 }; 11751 } 11752 componentDidCatch(error, info) { 11753 console.error("Error rendering addon panel"), console.error(error), console.error(info.componentStack); 11754 } 11755 render() { 11756 let { hasError } = this.state; 11757 if (hasError) 11758 return react_default.createElement( 11759 EmptyTabContent, 11760 { 11761 title: "This addon has errors", 11762 description: "Check your browser logs and addon code to pinpoint what went wrong. This issue was not caused by Storybook." 11763 } 11764 ); 11765 let { children } = this.props; 11766 return children; 11767 } 11768}, Aside = styled.aside({ 11769 height: "100%", 11770 display: "flex", 11771 flexDirection: "column" 11772}); 11773function renderChild(RenderProp) { 11774 return react_default.createElement(RenderProp, { active: !0 }); 11775} 11776var PreRenderAddons = ({ panels }) => Object.entries(panels).map(([k2, v2]) => react_default.createElement(StatelessTabPanel, { key: k2, name: k2, hasScrollbar: !1 }, react_default.createElement(TabErrorBoundary, { key: k2 }, renderChild(v2.render)))), AddonPanel2 = react_default.memo(({ panels, shortcuts, actions, selectedPanel = null, panelPosition = "right" }) => { 11777 let { isDesktop, setMobilePanelOpen } = useLayout(), emptyState = react_default.createElement( 11778 EmptyTabContent, 11779 { 11780 title: "Storybook add-ons", 11781 description: react_default.createElement(react_default.Fragment, null, "Integrate your tools with Storybook to connect workflows and unlock advanced features."), 11782 footer: react_default.createElement(Link, { href: "https://storybook.js.org/addons?ref=ui", target: "_blank", withArrow: !0 }, react_default.createElement(DocumentIcon, null), " Explore integrations catalog") 11783 } 11784 ), tools = useMemo( 11785 () => react_default.createElement(ActionsWrapper, null, isDesktop ? react_default.createElement(react_default.Fragment, null, react_default.createElement( 11786 Button, 11787 { 11788 key: "position", 11789 padding: "small", 11790 variant: "ghost", 11791 onClick: actions.togglePosition, 11792 ariaLabel: panelPosition === "bottom" ? "Move addon panel to right" : "Move addon panel to bottom", 11793 ariaDescription: "Changes the location of the addon panel to the bottom or right of the screen, but does not have any effect on its content.", 11794 shortcut: shortcuts.panelPosition 11795 }, 11796 panelPosition === "bottom" ? react_default.createElement(SidebarAltIcon, null) : react_default.createElement(BottomBarIcon, null) 11797 ), react_default.createElement( 11798 Button, 11799 { 11800 key: "visibility", 11801 padding: "small", 11802 variant: "ghost", 11803 onClick: actions.toggleVisibility, 11804 ariaLabel: "Hide addon panel", 11805 shortcut: shortcuts.togglePanel 11806 }, 11807 react_default.createElement(CloseIcon, null) 11808 )) : react_default.createElement( 11809 Button, 11810 { 11811 padding: "small", 11812 variant: "ghost", 11813 onClick: () => setMobilePanelOpen(!1), 11814 ariaLabel: "Close addon panel" 11815 }, 11816 react_default.createElement(CloseIcon, null) 11817 )), 11818 [actions, isDesktop, panelPosition, setMobilePanelOpen, shortcuts] 11819 ), asideRef = useRef(null), { landmarkProps } = useLandmark( 11820 { "aria-labelledby": "storybook-panel-heading", role: "region" }, 11821 asideRef 11822 ); 11823 return react_default.createElement(Aside, { ref: asideRef, id: focusableUIElements.addonPanel, ...landmarkProps }, react_default.createElement("h2", { id: "storybook-panel-heading", className: "sb-sr-only" }, "Addon panel"), react_default.createElement( 11824 StatelessTabsView, 11825 { 11826 id: focusableUIElements.storyPanelRoot, 11827 showToolsWhenEmpty: !0, 11828 emptyState, 11829 selected: selectedPanel ?? void 0, 11830 onSelectionChange: (id) => actions.onSelect(id), 11831 tools 11832 }, 11833 react_default.createElement(StatelessTabList, { "aria-label": "Available addons" }, Object.entries(panels).map(([k2, v2]) => react_default.createElement(StatelessTab, { key: k2, name: k2 }, typeof v2.title == "function" ? react_default.createElement(v2.title, null) : v2.title))), 11834 Object.keys(panels).length ? react_default.createElement(PreRenderAddons, { panels }) : null 11835 )); 11836}); 11837AddonPanel2.displayName = "AddonPanel"; 11838var ActionsWrapper = styled.div({ 11839 display: "flex", 11840 alignItems: "center", 11841 gap: 6 11842}); 11843 11844// src/manager/container/Panel.tsx 11845var Panel = (props) => { 11846 let api = useStorybookApi(), state = useStorybookState(), [story, setStory] = useState(api.getCurrentStoryData()); 11847 useChannel( 11848 { 11849 [STORY_PREPARED2]: () => { 11850 setStory(api.getCurrentStoryData()); 11851 } 11852 }, 11853 [] 11854 ); 11855 let { parameters, type } = story ?? {}, panelActions = useMemo( 11856 () => ({ 11857 onSelect: (panel) => api.setSelectedPanel(panel), 11858 toggleVisibility: async () => { 11859 let wasPanelShown = api.getIsPanelShown(); 11860 api.togglePanel(), wasPanelShown && await api.focusOnUIElement(focusableUIElements.showAddonPanel) === !1 && document.body.focus(); 11861 }, 11862 togglePosition: () => api.togglePanelPosition() 11863 }), 11864 [api] 11865 ), panels = useMemo(() => { 11866 let allPanels = api.getElements(Addon_TypesEnum.PANEL); 11867 if (!allPanels || type !== "story") 11868 return allPanels; 11869 let filteredPanels = {}; 11870 return Object.entries(allPanels).forEach(([id, p2]) => { 11871 let { paramKey } = p2; 11872 paramKey && parameters && parameters[paramKey] && parameters[paramKey].disable || p2.disabled === !0 || typeof p2.disabled == "function" && p2.disabled(parameters) || (filteredPanels[id] = p2); 11873 }), filteredPanels; 11874 }, [api, type, parameters]); 11875 return react_default.createElement( 11876 AddonPanel2, 11877 { 11878 panels, 11879 selectedPanel: api.getSelectedPanel(), 11880 panelPosition: state.layout.panelPosition, 11881 actions: panelActions, 11882 shortcuts: api.getShortcutKeys(), 11883 ...props 11884 } 11885 ); 11886}, Panel_default = Panel; 11887 11888// src/manager/container/Preview.tsx 11889init_react(); 11890var import_memoizerific2 = __toESM(require_memoizerific(), 1); 11891 11892// src/manager/components/preview/Preview.tsx 11893init_react(); 11894 11895// src/manager/components/review/components/ReviewToolbarHeader.tsx 11896init_react(); 11897 11898// src/manager/components/review/components/ReviewCollectionPicker.tsx 11899init_react(); 11900var derivePickerLabel = (storyId, info) => { 11901 if (info) 11902 return { component: info.title.split("/").pop() ?? info.title, story: info.name }; 11903 let [componentId, ...rest2] = storyId.split("--"); 11904 return { 11905 component: prettifyComponentId(componentId), 11906 story: prettifyComponentId(rest2.join("--")) || "Story" 11907 }; 11908}, ReviewCollectionPicker = ({ 11909 entries, 11910 activeEntry, 11911 storyInfo, 11912 children 11913}) => { 11914 let
11914api = useStorybookApi(), navigate = useNavigate(), filtersRef = useReviewFiltersRef(), options2 = entries.map((entry, index) => { 11915 let { component, story } = derivePickerLabel(entry.storyId, storyInfo[entry.storyId]); 11916 return { value: index, title: component, description: story }; 11917 }), activeValue = resolveNavIndex(entries, activeEntry), [nextStory, setNextStory] = react_default.useState(void 0); 11918 return useEffect(() => { 11919 nextStory && navigateToReviewEntry(api, navigate, nextStory, filtersRef.current); 11920 }, [nextStory, api, navigate, filtersRef]), react_default.createElement( 11921 Select, 11922 { 11923 ariaLabel: "Select story", 11924 size: "small", 11925 padding: "small", 11926 options: options2, 11927 defaultOptions: activeValue >= 0 ? activeValue : void 0, 11928 showSelectedOptionTitle: !1, 11929 onSelect: (value) => { 11930 let entry = typeof value == "number" ? entries[value] : void 0; 11931 setNextStory(entry); 11932 } 11933 }, 11934 children 11935 ); 11936}; 11937
vendor: 1,903 bytes, lines 11938-11991
11938// src/manager/components/review/components/ReviewToolbarHeader.tsx 11939var Root2 = styled.div(({ theme }) => ({ 11940 display: "flex", 11941 flexDirection: "column", 11942 flexShrink: 0, 11943 width: "100%", 11944 background: theme.background.content, 11945 zIndex: 4 11946})), HeaderWrap = styled.div({ 11947 position: "relative", 11948 flexShrink: 0 11949}), ProgressBar = styled.div(({ theme }) => ({ 11950 position: "absolute", 11951 top: 0, 11952 left: 0, 11953 zIndex: 1, 11954 width: "100%", 11955 height: 3, 11956 overflow: "hidden", 11957 background: theme.background.app 11958})), ProgressFill = styled.div(({ theme }) => ({ 11959 position: "absolute", 11960 insetBlock: 0, 11961 left: 0, 11962 background: theme.color.secondary, 11963 transition: "width 200ms ease" 11964})), SubtitleStrong = styled.span(({ theme }) => ({ 11965 fontWeight: 700, 11966 color: theme.color.defaultText 11967})), SubtitleSeparator = styled.span(({ theme }) => ({ 11968 color: theme.color.defaultText 11969})), SubtitleText = styled.span(({ theme }) => ({ 11970 color: theme.color.defaultText 11971})), Counter = styled.span(({ theme }) => ({ 11972 fontVariantNumeric: "tabular-nums", 11973 fontFamily: theme.typography.fonts.mono, 11974 fontWeight: theme.typography.weight.regular 11975})), NavButton = ({ 11976 entry, 11977 ariaLabel, 11978 icon 11979}) => entry ? react_default.createElement(Button, { variant: "ghost", size: "small", padding: "small", ariaLabel, asChild: !0 }, react_default.createElement("a", { href: buildReviewStoryHref(entry) }, icon)) : react_default.createElement(Button, { variant: "ghost", size: "small", padding: "small", ariaLabel, disabled: !0 }, icon), componentName = (componentTitle) => componentTitle.split("/").map((part) => part.trim()).filter(Boolean).pop() ?? componentTitle, ReviewToolbarHeader = () => { 11980 let { 11981 state, 11982 banner, 11983 storyInfo, 11984 flattenedEntries, 11985 newlyAddedStoryIds, 11986 activeEntry, 11987 activeIndex 11988 } = useReview(); 11989 if (!state || !activeEntry || activeIndex < 0) 11990 return null; 11991 let collectionTitle = state
vendor: 52,912 bytes, lines 11991-13400
11991.collections[activeEntry.collectionIndex]?.title ?? "Review", totalStories = flattenedEntries.length, hasPrevious = activeIndex > 0, hasNext = activeIndex < totalStories - 1, previousEntry = hasPrevious ? flattenedEntries[activeIndex - 1] : null, nextEntry = hasNext ? flattenedEntries[activeIndex + 1] : null, progress = totalStories > 1 ? activeIndex / (totalStories - 1) : 0, currentStoryInfo = storyInfo[activeEntry.storyId], isNewlyAdded = newlyAddedStoryIds.has(activeEntry.storyId), metadataSubtitle = currentStoryInfo?.title && currentStoryInfo.name ? react_default.createElement(react_default.Fragment, null, react_default.createElement(SubtitleStrong, null, componentName(currentStoryInfo.title)), react_default.createElement(SubtitleSeparator, null, "/"), react_default.createElement(SubtitleText, null, currentStoryInfo.name)) : null, subtitle = metadataSubtitle || isNewlyAdded ? react_default.createElement(react_default.Fragment, null, metadataSubtitle, isNewlyAdded ? react_default.createElement(Badge, { status: "positive" }, "New") : null) : void 0; 11992 return react_default.createElement(Root2, { "data-testid": "review-toolbar-header" }, banner && react_default.createElement(AttentionBanner, { ...banner }), react_default.createElement(HeaderWrap, null, react_default.createElement( 11993 ProgressBar, 11994 { 11995 role: "progressbar", 11996 "aria-label": "Review progress", 11997 "aria-valuenow": activeIndex + 1, 11998 "aria-valuemin": 1, 11999 "aria-valuemax": totalStories, 12000 "data-testid": "review-progress" 12001 }, 12002 react_default.createElement( 12003 ProgressFill, 12004 { 12005 "data-testid": "review-progress-fill", 12006 style: { width: `${progress * 100}%` } 12007 } 12008 ) 12009 ), react_default.createElement( 12010 ReviewHeader, 12011 { 12012 variant: "toolbar", 12013 leading: react_default.createElement(Button, { variant: "ghost", size: "small", padding: "small", ariaLabel: "Back to review", asChild: !0 }, react_default.createElement("a", { href: buildReviewChangesSummaryHref() }, react_default.createElement(ChevronSmallLeftIcon, null), react_default.createElement(WandIcon, null))), 12014 title: collectionTitle, 12015 subtitle, 12016 actions: react_default.createElement(react_default.Fragment, null, react_default.createElement( 12017 ReviewCollectionPicker, 12018 { 12019 entries: flattenedEntries, 12020 activeEntry, 12021 storyInfo 12022 }, 12023 react_default.createElement(Counter, null, activeIndex + 1, "/", totalStories) 12024 ), react_default.createElement( 12025 NavButton, 12026 { 12027 entry: previousEntry, 12028 ariaLabel: "Previous story", 12029 icon: react_default.createElement(ChevronSmallLeftIcon, null) 12030 } 12031 ), react_default.createElement( 12032 NavButton, 12033 { 12034 entry: nextEntry, 12035 ariaLabel: "Next story", 12036 icon: react_default.createElement(ChevronSmallRightIcon, null) 12037 } 12038 )) 12039 } 12040 ))); 12041}; 12042 12043// src/manager/components/preview/FramesRenderer.tsx 12044init_react(); 12045 12046// src/manager/components/preview/Viewport.tsx 12047init_react(); 12048 12049// src/viewport/useViewport.ts 12050init_react(); 12051 12052// src/viewport/defaults.ts 12053var MINIMAL_VIEWPORTS = { 12054 mobile1: { 12055 name: "Small mobile", 12056 styles: { 12057 height: "568px", 12058 width: "320px" 12059 }, 12060 type: "mobile" 12061 }, 12062 mobile2: { 12063 name: "Large mobile", 12064 styles: { 12065 height: "896px", 12066 width: "414px" 12067 }, 12068 type: "mobile" 12069 }, 12070 tablet: { 12071 name: "Tablet", 12072 styles: { 12073 height: "1112px", 12074 width: "834px" 12075 }, 12076 type: "tablet" 12077 }, 12078 desktop: { 12079 name: "Desktop", 12080 styles: { 12081 height: "1024px", 12082 width: "1280px" 12083 }, 12084 type: "desktop" 12085 } 12086}; 12087 12088// src/viewport/resolveViewport.ts 12089var VIEWPORT_MIN_WIDTH = 40, VIEWPORT_MIN_HEIGHT = 40, URL_VALUE_PATTERN = /^([0-9]{1,4})([a-z]{0,4})-([0-9]{1,4})([a-z]{0,4})$/, normalizeGlobal = (value, defaultIsRotated) => typeof value == "string" ? { value, isRotated: defaultIsRotated } : { value: value?.value, isRotated: value?.isRotated ?? defaultIsRotated }, resolveViewport = ({ 12090 globals, 12091 storyGlobals, 12092 userGlobals, 12093 options: options2, 12094 lastSelectedOption, 12095 disable = !1, 12096 viewMode 12097}) => { 12098 if (viewMode !== "story") 12099 return { 12100 name: "Responsive", 12101 type: "desktop", 12102 width: "100%", 12103 height: "100%", 12104 value: RESPONSIVE_VIEWPORT_VALUE, 12105 option: void 0, 12106 isCustom: !1, 12107 isDefault: !0, 12108 isLocked: !0, 12109 isRotated: !1 12110 }; 12111 let global2 = normalizeGlobal(globals?.[PARAM_KEY]), userGlobal = normalizeGlobal(userGlobals?.[PARAM_KEY]), storyGlobal = normalizeGlobal(storyGlobals?.[PARAM_KEY]), storyHasViewport = PARAM_KEY in storyGlobals, primaryGlobal = storyHasViewport ? storyGlobal : userGlobal, secondaryGlobal = storyHasViewport ? userGlobal : storyGlobal, value = primaryGlobal?.value ?? secondaryGlobal?.value ?? global2?.value, isRotated = primaryGlobal?.isRotated ?? secondaryGlobal?.isRotated ?? global2?.isRotated ?? !1, keys = Object.keys(options2), isLocked = disable || PARAM_KEY in storyGlobals || !keys.length, [match, vx, ux, vy, uy] = value?.match(URL_VALUE_PATTERN) || []; 12112 if (match) { 12113 let x2 = ux && ux !== "px" ? vx : Math.max(Number(vx), VIEWPORT_MIN_WIDTH), y2 = uy && uy !== "px" ? vy : Math.max(Number(vy), VIEWPORT_MIN_HEIGHT), width = `${x2}${ux === "pct" ? "%" : ux || "px"}`, height = `${y2}${uy === "pct" ? "%" : uy || "px"}`, selection = lastSelectedOption ? options2[lastSelectedOption] : void 0; 12114 return { 12115 name: selection?.name ?? "Custom", 12116 type: selection?.type ?? "other", 12117 width: isRotated ? height : width, 12118 height: isRotated ? width : height, 12119 value: match, 12120 option: void 0, 12121 isCustom: !0, 12122 isDefault: !1, 12123 isLocked, 12124 isRotated 12125 }; 12126 } 12127 if (value && keys.length) { 12128 let { name, styles: styles2, type = "other" } = options2[value] ?? options2[keys[0]]; 12129 return { 12130 name, 12131 type, 12132 width: isRotated ? styles2.height : styles2.width, 12133 height: isRotated ? styles2.width : styles2.height, 12134 value, 12135 option: value, 12136 isCustom: !1, 12137 isDefault: !1, 12138 isLocked, 12139 isRotated 12140 }; 12141 } 12142 return { 12143 name: "Responsive", 12144 type: "desktop", 12145 width: "100%", 12146 height: "100%", 12147 value: RESPONSIVE_VIEWPORT_VALUE, 12148 option: void 0, 12149 isCustom: !1, 12150 isDefault: !0, 12151 isLocked, 12152 isRotated: !1 12153 }; 12154}; 12155 12156// src/viewport/useViewport.ts 12157var cycle = (viewports, current, direction = 1) => { 12158 let keys = Object.keys(viewports), nextIndex = (current ? keys.indexOf(current) : -1) + direction; 12159 return nextIndex < 0 ? keys[keys.length - 1] : nextIndex >= keys.length ? keys[0] : keys[nextIndex]; 12160}, normalizeGlobal2 = (value, defaultIsRotated) => typeof value == "string" ? { value, isRotated: defaultIsRotated } : { value: value?.value, isRotated: value?.isRotated ?? defaultIsRotated }, useViewport = () => { 12161 let api = useStorybookApi(), { viewMode } = api.getUrlState(), lastSelectedOption = useRef(), parameter = useParameter(PARAM_KEY), [globals, updateGlobals, storyGlobals, userGlobals] = useGlobals(); 12162 useEffect(() => { 12163 if (parameter && "defaultViewport" in parameter) { 12164 let value2 = parameter.defaultViewport; 12165 deprecate( 12166 `The \`viewport.defaultViewport\` parameter was removed in Storybook 10. Use \`globals: { viewport: ${JSON.stringify(value2)} }\` instead, or run \`npx storybook automigrate\` to update your code automatically.` 12167 ); 12168 } 12169 }, [parameter]); 12170 let { options: options2 = MINIMAL_VIEWPORTS, disable = !1 } = parameter || {}, { name, type, width, height, value, option, isCustom, isDefault, isLocked, isRotated } = resolveViewport({ 12171 globals, 12172 storyGlobals, 12173 userGlobals, 12174 options: options2, 12175 lastSelectedOption: lastSelectedOption.current, 12176 disable, 12177 viewMode 12178 }), update2 = useCallback( 12179 (input) => updateGlobals({ [PARAM_KEY]: normalizeGlobal2(input, !1) }), 12180 [updateGlobals] 12181 ), resize = useCallback( 12182 (width2, height2) => { 12183 let w2 = width2.replace(/px$/, "").replace(/%$/, "pct"), h2 = height2.replace(/px$/, "").replace(/%$/, "pct"), value2 = isRotated ? `${h2}-${w2}` : `${w2}-${h2}`; 12184 update2({ value: value2, isRotated }); 12185 }, 12186 [update2, isRotated] 12187 ); 12188 return useEffect(() => { 12189 parameter && option && (Object.hasOwn(options2, option) ? lastSelectedOption.current = option : (lastSelectedOption.current = void 0, PARAM_KEY in storyGlobals || update2({ value: void 0, isRotated: !1 }))); 12190 }, [parameter, storyGlobals, options2, option, update2]), useEffect(() => { 12191 api.setAddonShortcut(ADDON_ID, { 12192 label: "Next viewport", 12193 defaultShortcut: ["alt", "V"], 12194 actionName: "next", 12195 action: () => update2({ value: cycle(options2, lastSelectedOption.current), isRotated }) 12196 }), api.setAddonShortcut(ADDON_ID, { 12197 label: "Previous viewport", 12198 defaultShortcut: ["alt", "shift", "V"], 12199 actionName: "previous", 12200 action: () => update2({ value: cycle(options2, lastSelectedOption.current, -1), isRotated }) 12201 }), api.setAddonShortcut(ADDON_ID, { 12202 label: "Reset viewport", 12203 defaultShortcut: ["alt", "control", "V"], 12204 actionName: "reset", 12205 action: () => update2({ value: void 0, isRotated: !1 }) 12206 }); 12207 }, [api, update2, options2, isRotated]), useMemo( 12208 () => ({ 12209 name, 12210 type, 12211 width, 12212 height, 12213 value, 12214 option, 12215 isCustom, 12216 isDefault, 12217 isLocked, 12218 isRotated, 12219 options: options2, 12220 lastSelectedOption: lastSelectedOption.current, 12221 resize, 12222 reset: () => update2({ value: void 0, isRotated: !1 }), 12223 rotate: () => update2({ value, isRotated: !isRotated }), 12224 select: (value2) => update2({ value: value2, isRotated }) 12225 }), 12226 [ 12227 name, 12228 type, 12229 width, 12230 height, 12231 value, 12232 option, 12233 isCustom, 12234 isDefault, 12235 isRotated, 12236 isLocked, 12237 options2, 12238 resize, 12239 update2 12240 ] 12241 ); 12242}; 12243 12244// src/manager/components/preview/Iframe.tsx 12245init_react(); 12246var StyledIframe = styled.iframe(({ theme }) => ({ 12247 backgroundColor: theme.background.preview, 12248 display: "block", 12249 boxSizing: "content-box", 12250 height: "100%", 12251 width: "100%", 12252 border: "none", 12253 transition: "background-position 0s, visibility 0s", 12254 backgroundPosition: "-1px -1px, -1px -1px, -1px -1px, -1px -1px", 12255 margin: "auto" 12256})); 12257function IFrame(props) { 12258 let { active, id, title: title2, src, allowFullScreen, scale, ...rest2 } = props, iFrameRef = react_default.useRef(null); 12259 return react_default.createElement(Zoom.IFrame, { scale, active, iFrameRef }, react_default.createElement( 12260 StyledIframe, 12261 { 12262 "data-is-storybook": active ? "true" : "false", 12263 onLoad: (e2) => e2.currentTarget.setAttribute("data-is-loaded", "true"), 12264 id, 12265 title: title2, 12266 src, 12267 allow: "clipboard-write;", 12268 allowFullScreen, 12269 ref: iFrameRef, 12270 ...rest2 12271 } 12272 )); 12273} 12274 12275// src/manager/components/preview/NumericInput.tsx 12276init_react(); 12277var Wrapper = styled.div( 12278 ({ after: after2, before: before2, theme }) => ({ 12279 position: "relative", 12280 display: "flex", 12281 alignItems: "center", 12282 width: "100%", 12283 height: 32, 12284 paddingInline: 9, 12285 fontSize: theme.typography.size.s1, 12286 color: theme.textMutedColor, 12287 background: theme.input.background, 12288 boxShadow: `${theme.input.border} 0 0 0 1px inset`, 12289 borderRadius: theme.input.borderRadius, 12290 svg: { 12291 display: "block" 12292 }, 12293 input: { 12294 width: "100%", 12295 height: "100%", 12296 minHeight: "100%", 12297 flex: "1 1 auto", 12298 paddingInline: 0, 12299 fontSize: "inherit", 12300 background: "transparent", 12301 border: "none", 12302 boxShadow: "none", 12303 color: theme.input.color, 12304 "&:focus, &:focus-visible": { 12305 boxShadow: "none", 12306 outline: "none" 12307 } 12308 }, 12309 "input:disabled": { 12310 background: "transparent" 12311 }, 12312 "input + div": { 12313 paddingInline: 0, 12314 fontSize: "inherit" 12315 }, 12316 "&:has(input:focus-visible)": { 12317 outline: `2px solid ${theme.color.secondary}`, 12318 outlineOffset: -2 12319 }, 12320 "&:has(input:disabled)": { 12321 background: theme.base === "light" ? theme.color.lighter : theme.input.background, 12322 cursor: "not-allowed" 12323 }, 12324 ...after2 && { paddingRight: 2 }, 12325 ...before2 && { paddingLeft: 2 } 12326 }) 12327), NumericInput = forwardRef(function({ 12328 label, 12329 before: before2, 12330 after: after2, 12331 value, 12332 setValue, 12333 minValue = -1 / 0, 12334 maxValue = 1 / 0, 12335 step = 1, 12336 unit: fixedUnit, 12337 baseUnit = fixedUnit, 12338 className, 12339 style, 12340 ...props 12341}, forwardedRef) { 12342 let baseUnitRegex = useMemo(() => baseUnit && new RegExp(`${baseUnit}$`), [baseUnit]), inputId = $bdb11010cef70236$export$f680877a34711e37(), inputRef = useRef(null), [inputValue, setInputValue] = useState( 12343 baseUnitRegex ? value.replace(baseUnitRegex, "") : value 12344 ), id = props.id || inputId; 12345 useImperativeHandle(forwardedRef, () => inputRef.current); 12346 let parseValue = useCallback( 12347 (value2) => { 12348 let [, inputValue2, unit = fixedUnit || baseUnit || ""] = value2.match(/(-?\d+(?:\.\d+)?)(\%|[a-z]{1,4})?$/) || []; 12349 return { number: Math.max(minValue, Math.min(parseFloat(inputValue2), maxValue)), unit }; 12350 }, 12351 [minValue, maxValue, fixedUnit, baseUnit] 12352 ), updateValue = useCallback( 12353 (value2) => { 12354 let { number, unit } = parseValue(value2); 12355 Number.isNaN(number) ? setInputValue(value2) : (setInputValue(`${number}${unit === baseUnit ? "" : unit}`), setValue(`${number}${unit}`)); 12356 }, 12357 [parseValue, setValue, baseUnit] 12358 ), onChange = useCallback( 12359 (e2) => updateValue(e2.target.value), 12360 [updateValue] 12361 ), setInputSelection = useCallback(() => { 12362 requestAnimationFrame(() => { 12363 let input = inputRef.current, index = input?.value.search(/[^-\d.]/) ?? -1; 12364 input && index >= 0 && input.setSelectionRange(index, index); 12365 }); 12366 }, []), updateInputValue = useCallback( 12367 () => setInputValue(baseUnitRegex ? value.replace(baseUnitRegex, "") : value), 12368 [value, baseUnitRegex] 12369 ); 12370 return useEffect(() => { 12371 inputRef.current !== document.activeElement && updateInputValue(); 12372 }, [updateInputValue]), useEffect(() => { 12373 let handleKeyDown = (e2) => { 12374 if (e2.key !== "ArrowUp" && e2.key !== "ArrowDown") 12375 return; 12376 e2.preventDefault(); 12377 let { number, unit } = parseValue(inputValue); 12378 if (!Number.isNaN(number)) { 12379 let delta = e2.shiftKey ? step * 10 : step; 12380 updateValue(`${e2.key === "ArrowUp" ? number + delta : number - delta}${unit}`), setInputSelection(); 12381 } 12382 }, input = inputRef.current; 12383 if (input) 12384 return input.addEventListener("keydown", handleKeyDown), () => input.removeEventListener("keydown", handleKeyDown); 12385 }, [inputValue, parseValue, setInputSelection, step, updateValue]), react_default.createElement(Wrapper, { after: after2, before: before2, className, style }, before2 && react_default.createElement("div", null, before2), label && react_default.createElement("label", { htmlFor: id, className: "sb-sr-only" }, label), react_default.createElement( 12386 Form.Input, 12387 { 12388 ...props, 12389 id, 12390 ref: inputRef, 12391 value: inputValue, 12392 suffix: fixedUnit || inputValue && baseUnit, 12393 onChange, 12394 onFocus: setInputSelection, 12395 onBlur: updateInputValue 12396 } 12397 ), after2 && react_default.createElement("div", null, after2)); 12398}); 12399 12400// src/manager/components/preview/Viewport.tsx 12401var ViewportWrapper = styled.div(({ active, isDefault, theme }) => ({ 12402 gridArea: "1 / 1", 12403 alignSelf: "start", 12404 justifySelf: "start", 12405 display: active ? "inline-flex" : "none", 12406 flexDirection: "column", 12407 gap: 6, 12408 width: "100%", 12409 height: "100%", 12410 paddingTop: isDefault ? 0 : 6, 12411 paddingBottom: isDefault ? 0 : 40, 12412 paddingInline: isDefault ? 0 : 40, 12413 '&:has([data-size-input="width"]:focus-visible)': { 12414 "[data-dragging]": { 12415 borderRightColor: theme.color.secondary, 12416 boxShadow: `4px 0 5px -2px ${theme.background.hoverable}` 12417 } 12418 }, 12419 '&:has([data-size-input="height"]:focus-visible)': { 12420 "[data-dragging]": { 12421 borderBottomColor: theme.color.secondary, 12422 boxShadow: `0 4px 5px -2px ${theme.background.hoverable}` 12423 } 12424 } 12425})), ViewportControls = styled.div({ 12426 display: "flex", 12427 gap: 6 12428}), ViewportDimensions = styled.div({ 12429 display: "flex", 12430 gap: 2 12431}), FrameWrapper = styled.div(({ isDefault, "data-dragging": dragging, theme }) => ({ 12432 position: "relative", 12433 minWidth: VIEWPORT_MIN_WIDTH, 12434 minHeight: VIEWPORT_MIN_HEIGHT, 12435 boxSizing: "content-box", 12436 // we're sizing the contents, not the box itself 12437 border: `1px solid ${theme.button.border}`, 12438 borderWidth: isDefault ? 0 : 1, 12439 borderRadius: isDefault ? 0 : 4, 12440 transition: "border-color 0.2s, box-shadow 0.2s", 12441 '&:has([data-side="right"]:hover), &[data-dragging="right"]': { 12442 borderRightColor: theme.color.secondary, 12443 boxShadow: `4px 0 5px -2px ${theme.background.hoverable}`, 12444 '[data-side="right"]::after': { 12445 opacity: 1 12446 } 12447 }, 12448 '&:has([data-side="bottom"]:hover), &[data-dragging="bottom"]': { 12449 borderBottomColor: theme.color.secondary, 12450 boxShadow: `0 4px 5px -2px ${theme.background.hoverable}`, 12451 '[data-side="bottom"]::after': { 12452 opacity: 1 12453 } 12454 }, 12455 '&:has([data-side="both"]:hover), &[data-dragging="both"]': { 12456 boxShadow: `3px 3px 5px -2px ${theme.background.hoverable}`, 12457 "&::after, [data-side]::after": { 12458 opacity: 1 12459 } 12460 }, 12461 "&::after": { 12462 content: '""', 12463 display: "block", 12464 position: "absolute", 12465 pointerEvents: "none", 12466 bottom: 1, 12467 right: 1, 12468 width: 12, 12469 height: 12, 12470 opacity: 0, 12471 transition: "opacity 0.2s", 12472 background: `linear-gradient(to top left, 12473 rgba(0,0,0,0) 0%, 12474 rgba(0,0,0,0) calc(25% - 1px), 12475 ${theme.color.secondary} 25%, 12476 rgba(0,0,0,0) calc(25% + 1px), 12477 rgba(0,0,0,0) calc(45% - 1px), 12478 ${theme.color.secondary} 45%, 12479 rgba(0,0,0,0) calc(45% + 1px), 12480 rgba(0,0,0,0) 100%)` 12481 }, 12482 iframe: { 12483 pointerEvents: dragging === "none" ? "auto" : "none" 12484 } 12485})), DragHandle2 = styled.div( 12486 { display: "none" }, 12487 ({ theme, isDefault }) => !isDefault && { 12488 display: "block", 12489 position: "absolute", 12490 fontSize: 10, 12491 '&[data-side="both"]': { 12492 right: -12, 12493 bottom: -12, 12494 width: 25, 12495 height: 25, 12496 cursor: "nwse-resize" 12497 }, 12498 '&[data-side="bottom"]': { 12499 left: 0, 12500 right: 13, 12501 bottom: -12, 12502 height: 20, 12503 cursor: "row-resize", 12504 "&::after": { 12505 content: "attr(data-value)", 12506 position: "absolute", 12507 top: "50%", 12508 left: "50%", 12509 transform: "translate(-50%, -50%)", 12510 borderRadius: 4, 12511 backgroundColor: theme.background.hoverable, 12512 padding: "2px 4px", 12513 opacity: 0, 12514 transition: "opacity 0.2s" 12515 } 12516 }, 12517 '&[data-side="right"]': { 12518 top: 0, 12519 right: -12, 12520 bottom: 13, 12521 width: 20, 12522 cursor: "col-resize", 12523 "&::after": { 12524 content: "attr(data-value)", 12525 position: "absolute", 12526 top: "50%", 12527 left: "50%", 12528 transform: "translate(-50%, -50%)", 12529 borderRadius: 4, 12530 backgroundColor: theme.background.hoverable, 12531 padding: "2px 4px", 12532 opacity: 0, 12533 transition: "opacity 0.2s" 12534 } 12535 } 12536 } 12537), ScrollEdge = styled.div({ 12538 position: "absolute", 12539 pointerEvents: "none", 12540 width: 0, 12541 height: 0, 12542 '&[data-edge="right"]': { 12543 right: -40, 12544 height: "100%" 12545 }, 12546 '&[data-edge="bottom"]': { 12547 bottom: -40, 12548 width: "100%" 12549 }, 12550 '&[data-edge="both"]': { 12551 right: -40, 12552 bottom: -40 12553 } 12554}), SizeInput = styled(NumericInput)({ 12555 width: 85, 12556 height: 28, 12557 minHeight: 28 12558}), Viewport = ({ 12559 active, 12560 id, 12561 src, 12562 scale 12563}) => { 12564 let { width, height, isCustom, isDefault, lastSelectedOption, resize, rotate, select } = useViewport(), [dragging, setDragging] = useState("none"), targetRef = useRef(null), dragRefX = useRef(null), dragRefY = useRef(null), dragRefXY = useRef(null), dragSide = useRef("none"), dragStart = useRef(), dragScrollTarget = useRef(null); 12565 useEffect(() => { 12566 let onDrag = (e2) => { 12567 if (!(!targetRef.current || !dragStart.current)) { 12568 if (dragRefX.current && (dragSide.current === "both" || dragSide.current === "right")) { 12569 let newWidth = Math.max(VIEWPORT_MIN_WIDTH, dragStart.current[0] + e2.clientX); 12570 targetRef.current.style.width = `${newWidth}px`, dragRefX.current.dataset.value = `${Math.round(newWidth / scale)}`; 12571 } 12572 if (dragRefY.current && (dragSide.current === "both" || dragSide.current === "bottom")) { 12573 let newHeight = Math.max(VIEWPORT_MIN_HEIGHT, dragStart.current[1] + e2.clientY); 12574 targetRef.current.style.height = `${newHeight}px`, dragRefY.current.dataset.value = `${Math.round(newHeight / scale)}`; 12575 } 12576 dragScrollTarget.current && dragScrollTarget.current.scrollIntoView({ block: "center", inline: "center" }); 12577 } 12578 }, onEnd = () => { 12579 if (window.removeEventListener("mouseup", onEnd), window.removeEventListener("mousemove", onDrag), setDragging("none"), dragStart.current = void 0, targetRef.current) { 12580 let { clientWidth, clientHeight, dataset } = targetRef.current, scale2 = Number(dataset.scale) || 1; 12581 resize(`${Math.round(clientWidth / scale2)}px`, `${Math.round(clientHeight / scale2)}px`); 12582 } 12583 }, onStart = (e2) => { 12584 e2.preventDefault(), window.addEventListener("mouseup", onEnd), window.addEventListener("mousemove", onDrag), dragSide.current = e2.currentTarget.dataset.side, dragStart.current = [ 12585 (targetRef.current?.clientWidth ?? 0) - e2.clientX, 12586 (targetRef.current?.clientHeight ?? 0) - e2.clientY 12587 ], dragScrollTarget.current = targetRef.current?.querySelector( 12588 `[data-edge="${dragSide.current}"]` 12589 ), setDragging(dragSide.current); 12590 }, handles = [dragRefX.current, dragRefY.current, dragRefXY.current]; 12591 return handles.forEach((el) => el?.addEventListener("mousedown", onStart)), () => handles.forEach((el) => el?.removeEventListener("mousedown", onStart)); 12592 }, [resize, scale]); 12593 let dimensions = useMemo(() => { 12594 let [, nx = "", ux = "px"] = width.match(/^(\d+(?:\.\d+)?)(\%|[a-z]{1,4})?$/) || [], [, ny = "", uy = "px"] = height.match(/^(\d+(?:\.\d+)?)(\%|[a-z]{1,4})?$/) || []; 12595 return { 12596 frame: { 12597 width: `calc(${width} * ${scale})`, 12598 height: `calc(${height} * ${scale})` 12599 }, 12600 display: { 12601 width: `${nx || width}${ux === "px" ? "" : ux}`, 12602 height: `${ny || height}${uy === "px" ? "" : uy}` 12603 }, 12604 locked: { 12605 width: !nx || !ny, 12606 height: !nx || !ny 12607 } 12608 }; 12609 }, [width, height, scale]); 12610 return react_default.createElement(ViewportWrapper, { key: id, active, isDefault }, !isDefault && react_default.createElement(ViewportControls, null, react_default.createElement(ViewportDimensions, null, react_default.createElement( 12611 SizeInput, 12612 { 12613 "aria-label": "Viewport width", 12614 "data-size-input": "width", 12615 label: "Viewport width", 12616 before: react_default.createElement(ActionList.Action, { size: "small", readOnly: !0, "aria-hidden": !0 }, "W"), 12617 value: width, 12618 minValue: 0, 12619 setValue: (value) => resize(value, height), 12620 disabled: dimensions.locked.width 12621 } 12622 ), react_default.createElement( 12623 ActionList.Button, 12624 { 12625 key: "viewport-rotate", 12626 size: "small", 12627 padding: "small", 12628 ariaLabel: "Rotate viewport", 12629 onClick: rotate 12630 }, 12631 react_default.createElement(TransferIcon, null) 12632 ), react_default.createElement( 12633 SizeInput, 12634 { 12635 "aria-label": "Viewport height", 12636 "data-size-input": "height", 12637 label: "Viewport height", 12638 before: react_default.createElement(ActionList.Action, { size: "small", readOnly: !0, "aria-hidden": !0 }, "H"), 12639 value: height, 12640 minValue: 0, 12641 setValue: (value) => resize(width, value), 12642 disabled: dimensions.locked.height 12643 } 12644 ), isCustom && lastSelectedOption && react_default.createElement( 12645 ActionList.Button, 12646 { 12647 key: "viewport-restore", 12648 size: "small", 12649 padding: "small", 12650 ariaLabel: "Restore viewport", 12651 onClick: () => select(lastSelectedOption) 12652 }, 12653 react_default.createElement(UndoIcon, null) 12654 ))), react_default.createElement( 12655 FrameWrapper, 12656 { 12657 isDefault, 12658 "data-dragging": dragging, 12659 "data-scale": scale, 12660 style: isDefault ? { height: "100%", width: "100%" } : dimensions.frame, 12661 ref: targetRef 12662 }, 12663 react_default.createElement( 12664 "div", 12665 { 12666 style: { 12667 height: `${1 / scale * 100}%`, 12668 width: `${1 / scale * 100}%`, 12669 transform: scale !== 1 ? `scale(${scale})` : "none", 12670 transformOrigin: "top left" 12671 } 12672 }, 12673 react_default.createElement(IFrame, { allowFullScreen: !0, active, key: id, id, title: id, src, scale: 1 }), 12674 !isDefault && react_default.createElement(react_default.Fragment, null, react_default.createElement(ScrollEdge, { "data-edge": "right" }), react_default.createElement(ScrollEdge, { "data-edge": "bottom" }), react_default.createElement(ScrollEdge, { "data-edge": "both" })) 12675 ), 12676 !dimensions.locked.width && react_default.createElement( 12677 DragHandle2, 12678 { 12679 ref: dragRefX, 12680 isDefault, 12681 "data-side": "right", 12682 "data-value": dimensions.display.width 12683 } 12684 ), 12685 !dimensions.locked.height && react_default.createElement( 12686 DragHandle2, 12687 { 12688 ref: dragRefY, 12689 isDefault, 12690 "data-side": "bottom", 12691 "data-value": dimensions.display.height 12692 } 12693 ), 12694 !dimensions.locked.width && !dimensions.locked.height && react_default.createElement(DragHandle2, { ref: dragRefXY, isDefault, "data-side": "both" }) 12695 )); 12696}; 12697 12698// src/manager/components/preview/FramesRenderer.tsx 12699var getActive = (refId, refs) => refId && refs[refId] ? `storybook-ref-${refId}` : "storybook-preview-iframe", SkipToSidebarLink = styled(Button)(({ theme }) => ({ 12700 display: "none", 12701 "@media (min-width: 600px)": { 12702 position: "absolute", 12703 display: "block", 12704 top: 10, 12705 right: 15, 12706 padding: "10px 15px", 12707 fontSize: theme.typography.size.s1, 12708 transform: "translateY(-100px)", 12709 "&:focus": { 12710 transform: "translateY(0)", 12711 zIndex: 1 12712 } 12713 } 12714})), whenSidebarIsVisible = ({ api, state }) => ({ 12715 isFullscreen: api.getIsFullscreen(), 12716 isNavShown: api.getNavAvailability() === "shown", 12717 selectedStoryId: state.storyId 12718}), styles = { 12719 '#root [data-is-storybook="false"]': { 12720 display: "none" 12721 }, 12722 '#root [data-is-storybook="true"]': { 12723 display: "block" 12724 } 12725}, FramesRenderer = ({ 12726 api, 12727 refs, 12728 scale, 12729 viewMode = "story", 12730 refId, 12731 queryParams = {}, 12732 storyId = "*" 12733}) => { 12734 let version3 = refs[refId]?.version, active = getActive(refId, refs), { current: frames } = useRef({}), refsToLoad = Object.values(refs).filter((ref) => ref.type === "auto-inject" || ref.id === refId, {}); 12735 return frames["storybook-preview-iframe"] || (frames["storybook-preview-iframe"] = api.getStoryHrefs(storyId, { 12736 queryParams: { ...queryParams, ...version3 && { version: version3 } }, 12737 refId: void 0, 12738 viewMode 12739 }).previewHref), refsToLoad.forEach((ref) => { 12740 let id = `storybook-ref-${ref.id}`; 12741 frames[id]?.startsWith(`${ref.url.replace(/\/?$/, "/")}iframe.html`) || (frames[id] = api.getStoryHrefs(storyId, { 12742 queryParams: { ...queryParams, ...version3 && { version: version3 } }, 12743 refId: ref.id, 12744 viewMode 12745 }).previewHref); 12746 }), react_default.createElement(Fragment, null, react_default.createElement(Global, { styles }), react_default.createElement(Consumer, { filter: whenSidebarIsVisible }, ({ isFullscreen, isNavShown, selectedStoryId }) => isFullscreen || !isNavShown || !selectedStoryId ? null : react_default.createElement(SkipToSidebarLink, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: `#${selectedStoryId}`, tabIndex: 0 }, "Skip to sidebar"))), Object.entries(frames).map(([id, src]) => react_default.createElement(Viewport, { key: id, id, src, active: id === active, scale }))); 12747}; 12748 12749// src/manager/components/preview/Toolbar.tsx 12750init_react(); 12751var fullScreenMapper = ({ api, state }) => ({ 12752 toggle: api.toggleFullscreen, 12753 isFullscreen: api.getIsFullscreen(), 12754 shortcut: api.getShortcutKeys().fullScreen, 12755 hasPanel: Object.keys(api.getElements(Addon_TypesEnum.PANEL)).length > 0, 12756 singleStory: state.singleStory, 12757 isNavUnavailable: api.getNavAvailability() === "unavailable" 12758}), fullScreenTool = { 12759 title: "fullscreen", 12760 id: "fullscreen", 12761 type: types.TOOL, 12762 // @ts-expect-error (non strict) 12763 match: (p2) => ["story", "docs"].includes(p2.viewMode), 12764 render: () => { 12765 let { isMobile: isMobile2 } = useLayout(); 12766 return isMobile2 ? null : react_default.createElement(Consumer, { filter: fullScreenMapper }, ({ toggle, isFullscreen, shortcut, hasPanel, singleStory, isNavUnavailable }) => !isNavUnavailable && (!singleStory || singleStory && hasPanel) && react_default.createElement( 12767 Button, 12768 { 12769 key: "full", 12770 padding: "small", 12771 variant: "ghost", 12772 onClick: () => toggle(), 12773 ariaLabel: isFullscreen ? "Exit full screen" : "Enter full screen", 12774 shortcut 12775 }, 12776 isFullscreen ? react_default.createElement(CloseIcon, null) : react_default.createElement(ExpandIcon, null) 12777 )); 12778 } 12779}, ToolbarComp = react_default.memo(function({ 12780 isShown, 12781 tools, 12782 toolsExtra, 12783 tabs, 12784 tabState 12785}) { 12786 let sectionRef = useRef(null), { landmarkProps } = useLandmark( 12787 { "aria-labelledby": "sb-preview-toolbar-title", role: "region" }, 12788 sectionRef 12789 ); 12790 return isShown && (tabs || tools || toolsExtra) ? react_default.createElement( 12791 StyledSection, 12792 { 12793 className: "sb-bar", 12794 key: "toolbar", 12795 "data-testid": "sb-preview-toolbar", 12796 ref: sectionRef, 12797 ...landmarkProps 12798 }, 12799 react_default.createElement("h2", { id: "sb-preview-toolbar-title", className: "sb-sr-only" }, "Toolbar"), 12800 tabs.length > 1 ? react_default.createElement(react_default.Fragment, null, react_default.createElement(TabList, { state: tabState }), react_default.createElement(Separator, null)) : null, 12801 react_default.createElement(StyledToolbar, null, react_default.createElement(Tools, { key: "left", list: tools }), react_default.createElement(Tools, { key: "right", list: toolsExtra })) 12802 ) : null; 12803}), Tools = react_default.memo(function({ list }) { 12804 return react_default.createElement(ToolGroup, null, list.filter(Boolean).map(({ render: Render, id, ...t2 }, index) => ( 12805 // @ts-expect-error (Converted from ts-ignore) 12806 react_default.createElement(Render, { key: id || t2.key || `f-${index}` }) 12807 ))); 12808}); 12809function toolbarItemHasBeenExcluded(item, entry) { 12810 let parameters = entry?.type === "story" && entry?.prepared ? entry?.parameters : {}, toolbarItemsFromStoryParameters = "toolbar" in parameters ? parameters.toolbar : void 0, { toolbar: toolbarItemsFromAddonsConfig } = addons.getConfig(), toolbarItems = merge( 12811 toolbarItemsFromAddonsConfig || {}, 12812 toolbarItemsFromStoryParameters || {} 12813 ); 12814 return toolbarItems ? !!toolbarItems[item?.id]?.hidden : !1; 12815} 12816function filterToolsSide(tools, entry, viewMode, location2, path, tabId) { 12817 let filter = (item) => item && (!item.match || item.match({ 12818 storyId: entry?.id, 12819 refId: entry?.refId, 12820 viewMode, 12821 location: location2, 12822 path, 12823 tabId 12824 })) && !toolbarItemHasBeenExcluded(item, entry); 12825 return tools.filter(filter); 12826} 12827var StyledSection = styled.section(({ theme }) => ({ 12828 position: "relative", 12829 display: "flex", 12830 alignItems: "center", 12831 color: theme.barTextColor, 12832 width: "100%", 12833 flexShrink: 0, 12834 overflowX: "auto", 12835 overflowY: "hidden", 12836 boxShadow: `${theme.appBorderColor} 0 -1px 0 0 inset`, 12837 background: theme.barBg, 12838 scrollbarColor: `${theme.barTextColor} ${theme.barBg}`, 12839 scrollbarWidth: "thin", 12840 zIndex: 4 12841})), StyledToolbar = styled(AbstractToolbar)({ 12842 flex: 1, 12843 display: "flex", 12844 justifyContent: "space-between", 12845 flexWrap: "nowrap", 12846 flexShrink: 0, 12847 height: 40, 12848 marginInline: 10, 12849 gap: 30 12850}), ToolGroup = styled.div({ 12851 display: "flex", 12852 whiteSpace: "nowrap", 12853 flexBasis: "auto", 12854 gap: 6, 12855 alignItems: "center" 12856}); 12857 12858// src/manager/components/preview/Wrappers.tsx 12859init_react(); 12860 12861// src/manager/components/preview/utils/components.ts 12862var PreviewContainer = styled.div({ 12863 display: "flex", 12864 flexDirection: "column", 12865 width: "100%", 12866 height: "100%", 12867 overflow: "hidden" 12868}), FrameWrap = styled.main(({ theme }) => ({ 12869 overflow: "auto", 12870 width: "100%", 12871 zIndex: 3, 12872 background: theme.background.app, 12873 flex: 1 12874})), CanvasWrap = styled.div( 12875 { 12876 alignContent: "center", 12877 alignItems: "center", 12878 justifyContent: "center", 12879 justifyItems: "center", 12880 overflow: "auto", 12881 gridTemplateColumns: "100%", 12882 gridTemplateRows: "100%", 12883 position: "relative", 12884 width: "100%", 12885 height: "100%" 12886 }, 12887 ({ show }) => ({ display: show ? "grid" : "none" }) 12888), UnstyledLink = styled(Link2)({ 12889 color: "inherit", 12890 textDecoration: "inherit", 12891 display: "inline-block" 12892}), DesktopOnly = styled.span({ 12893 // Hides full screen icon at mobile breakpoint defined in app.js 12894 "@media (max-width: 599px)": { 12895 display: "none" 12896 } 12897}), IframeWrapper = styled.div(({ theme }) => ({ 12898 alignContent: "center", 12899 alignItems: "center", 12900 justifyContent: "center", 12901 justifyItems: "center", 12902 overflow: "auto", 12903 display: "grid", 12904 gridTemplateColumns: "100%", 12905 gridTemplateRows: "100%", 12906 position: "relative", 12907 width: "100%", 12908 height: "100%" 12909})), LoaderWrapper = styled.div(({ theme }) => ({ 12910 position: "absolute", 12911 top: 0, 12912 left: 0, 12913 bottom: 0, 12914 right: 0, 12915 background: theme.background.preview, 12916 zIndex: 1 12917})); 12918 12919// src/manager/components/preview/Wrappers.tsx 12920var ApplyWrappers = ({ 12921 wrappers, 12922 id, 12923 storyId, 12924 children 12925}) => react_default.createElement(Fragment, null, wrappers.reduceRight( 12926 (acc, wrapper, index) => react_default.createElement(wrapper.render, { index, children: acc, id, storyId }), 12927 children 12928)), defaultWrappers = [ 12929 { 12930 id: "iframe-wrapper", 12931 type: Addon_TypesEnum.PREVIEW, 12932 render: (p2) => react_default.createElement(IframeWrapper, { id: "storybook-preview-wrapper" }, p2.children) 12933 } 12934]; 12935 12936// src/manager/components/preview/tools/zoom.tsx 12937init_react(); 12938 12939// src/manager/components/Shortcut.tsx 12940init_react(); 12941var Wrapper2 = styled.span(({ theme }) => ({ 12942 display: "inline-flex", 12943 alignItems: "center", 12944 justifyContent: "center", 12945 height: 16, 12946 fontSize: "11px", 12947 fontWeight: theme.typography.weight.regular, 12948 background: theme.base === "light" ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.05)", 12949 color: theme.base === "light" ? theme.color.dark : theme.textMutedColor, 12950 borderRadius: 2, 12951 userSelect: "none", 12952 pointerEvents: "none", 12953 padding: "0 4px" 12954})), Key = styled.kbd(({ theme }) => ({ 12955 padding: 0, 12956 fontFamily: theme.typography.fonts.base, 12957 verticalAlign: "middle", 12958 "& + &": { 12959 marginLeft: 6 12960 } 12961})), Shortcut = ({ keys }) => react_default.createElement(Wrapper2, null, (keys ?? []).map((key) => react_default.createElement(Key, { key }, shortcutToHumanString([key])))); 12962 12963// src/manager/components/preview/tools/zoom.tsx 12964var ZOOM_LEVELS = [0.25, 0.5, 0.75, 0.9, 1, 1.1, 1.25, 1.5, 2, 3, 4, 8], INITIAL_ZOOM_LEVEL = 1, ZoomButton = styled(ToggleButton)({ 12965 minWidth: 48 12966}), ZoomResetButton = styled(ActionList.Button)( 12967 ({ $isInitialValue }) => ({ 12968 visibility: $isInitialValue ? "hidden" : void 0 12969 }) 12970), Context = createContext({ value: INITIAL_ZOOM_LEVEL, set: (v2) => { 12971} }), ZoomInput = styled(NumericInput)({ 12972 input: { 12973 width: 100 12974 } 12975}), ZoomConsumer = Context.Consumer, ZoomProvider = class extends Component { 12976 constructor() { 12977 super(...arguments); 12978 this.state = { 12979 value: INITIAL_ZOOM_LEVEL 12980 }; 12981 this.set = (value) => this.setState({ value }); 12982 } 12983 render() { 12984 let { children, shouldScale } = this.props, { set } = this, { value } = this.state; 12985 return react_default.createElement(Context.Provider, { value: { value: shouldScale ? value : INITIAL_ZOOM_LEVEL, set } }, children); 12986 } 12987}, Zoom2 = memo(function({ value, zoomIn, zoomOut, zoomTo, zoomBy }) { 12988 let inputRef = useRef(null); 12989 return react_default.createElement( 12990 PopoverProvider, 12991 { 12992 padding: "none", 12993 onVisibleChange: (isVisible) => { 12994 isVisible && requestAnimationFrame(() => inputRef.current?.select()); 12995 }, 12996 popover: react_default.createElement(react_default.Fragment, null, react_default.createElement(ActionList, null, react_default.createElement(ActionList.Item, null, react_default.createElement( 12997 ZoomInput, 12998 { 12999 "aria-label": "Zoom percentage", 13000 ref: inputRef, 13001 unit: "%", 13002 before: react_default.createElement(ActionList.Button, { size: "small", padding: "small", readOnly: !0, "aria-hidden": !0 }, react_default.createElement(ZoomIcon, null)), 13003 after: react_default.createElement( 13004 ZoomResetButton, 13005 { 13006 size: "small", 13007 padding: "small", 13008 $isInitialValue: value === INITIAL_ZOOM_LEVEL, 13009 onClick: () => zoomTo(INITIAL_ZOOM_LEVEL), 13010 ariaLabel: "Reset zoom", 13011 "aria-hidden": value === INITIAL_ZOOM_LEVEL 13012 }, 13013 react_default.createElement(UndoIcon, null) 13014 ), 13015 value: `${Math.round(value * 100)}%`, 13016 minValue: 1, 13017 maxValue: 800, 13018 setValue: (value2) => { 13019 let zoomLevel = parseInt(value2, 10) / 100; 13020 Number.isNaN(zoomLevel) || zoomTo(zoomLevel); 13021 } 13022 } 13023 ))), react_default.createElement(ActionList, null, react_default.createElement(ActionList.Item, null, react_default.createElement( 13024 ActionList.Action, 13025 { 13026 onClick: zoomIn, 13027 ariaLabel: "Zoom in", 13028 disabled: value >= ZOOM_LEVELS.at(-1) 13029 }, 13030 react_default.createElement(ActionList.Text, null, "Zoom in"), 13031 react_default.createElement(Shortcut, { keys: ["alt", "+"] }) 13032 )), react_default.createElement(ActionList.Item, null, react_default.createElement( 13033 ActionList.Action, 13034 { 13035 onClick: zoomOut, 13036 ariaLabel: "Zoom out", 13037 disabled: value <= ZOOM_LEVELS.at(0) 13038 }, 13039 react_default.createElement(ActionList.Text, null, "Zoom out"), 13040 react_default.createElement(Shortcut, { keys: ["alt", "-"] }) 13041 )), react_default.createElement(ActionList.Item, { active: value === 0.5 }, react_default.createElement(ActionList.Action, { onClick: () => zoomTo(0.5), ariaLabel: "Zoom to 50%" }, react_default.createElement(ActionList.Text, null, "50%"))), react_default.createElement(ActionList.Item, { active: value === 1 }, react_default.createElement(ActionList.Action, { onClick: () => zoomTo(1), ariaLabel: "Zoom to 100%" }, react_default.createElement(ActionList.Text, null, "100%"), react_default.createElement(Shortcut, { keys: ["alt", "0"] }))), react_default.createElement(ActionList.Item, { active: value === 2 }, react_default.createElement(ActionList.Action, { onClick: () => zoomTo(2), ariaLabel: "Zoom to 200%" }, "200%")))) 13042 }, 13043 react_default.createElement( 13044 ZoomButton, 13045 { 13046 padding: "small", 13047 variant: "ghost", 13048 ariaLabel: "Change zoom level", 13049 pressed: value !== INITIAL_ZOOM_LEVEL, 13050 onKeyDown: (e2) => { 13051 e2.key === "ArrowDown" ? (zoomBy(e2.getModifierState("Shift") ? -0.1 : -0.01), e2.preventDefault()) : e2.key === "ArrowUp" ? (zoomBy(e2.getModifierState("Shift") ? 0.1 : 0.01), e2.preventDefault()) : e2.key === "PageDown" ? (zoomOut(), e2.preventDefault()) : e2.key === "PageUp" ? (zoomIn(), e2.preventDefault()) : e2.key === "Home" ? (zoomTo(ZOOM_LEVELS[ZOOM_LEVELS.length - 1]), e2.preventDefault()) : e2.key === "End" && (zoomTo(ZOOM_LEVELS[0]), e2.preventDefault()); 13052 }, 13053 onWheel: (e2) => { 13054 e2.deltaY < 0 ? zoomIn() : e2.deltaY > 0 && zoomOut(), e2.preventDefault(); 13055 } 13056 }, 13057 Math.round(value * 100), 13058 "%" 13059 ) 13060 ); 13061}), ZoomWrapper = memo(function({ set, value }) { 13062 let api = useStorybookApi(), zoomIn = useCallback(() => { 13063 let higherZoomLevel = ZOOM_LEVELS.find((level) => level > value); 13064 higherZoomLevel && set(higherZoomLevel); 13065 }, [set, value]), zoomOut = useCallback(() => { 13066 let lowerZoomLevel = ZOOM_LEVELS.findLast((level) => level < value); 13067 lowerZoomLevel && set(lowerZoomLevel); 13068 }, [set, value]), zoomBy = useCallback( 13069 (delta) => { 13070 let min = ZOOM_LEVELS[0], max = ZOOM_LEVELS[ZOOM_LEVELS.length - 1]; 13071 set(Math.max(min, Math.min(max, value + delta))); 13072 }, 13073 [set, value] 13074 ), zoomTo = useCallback( 13075 (value2) => { 13076 set(value2); 13077 }, 13078 [set] 13079 ); 13080 return useEffect(() => { 13081 api.setAddonShortcut("zoom", { 13082 label: "Zoom to 100%", 13083 defaultShortcut: ["alt", "0"], 13084 actionName: "zoomReset", 13085 action: () => zoomTo(1) 13086 }), api.setAddonShortcut("zoom", { 13087 label: "Zoom in", 13088 defaultShortcut: ["alt", "="], 13089 actionName: "zoomIn", 13090 action: zoomIn 13091 }), api.setAddonShortcut("zoom", { 13092 label: "Zoom in", 13093 defaultShortcut: ["alt", "+"], 13094 actionName: "zoomPlus", 13095 action: zoomIn 13096 }), api.setAddonShortcut("zoom", { 13097 label: "Zoom out", 13098 defaultShortcut: ["alt", "-"], 13099 actionName: "zoomOut", 13100 action: zoomOut 13101 }); 13102 }, [api, zoomIn, zoomOut, zoomTo]), react_default.createElement(Zoom2, { key: "zoom", value, zoomIn, zoomOut, zoomTo, zoomBy }); 13103}), zoomTool = { 13104 title: "zoom", 13105 id: "zoom", 13106 type: types.TOOL, 13107 match: ({ viewMode, tabId }) => viewMode === "story" && !tabId, 13108 render: () => react_default.createElement(ZoomConsumer, null, (zoomContext) => react_default.createElement(ZoomWrapper, { ...zoomContext })) 13109}; 13110 13111// src/manager/components/preview/Preview.tsx 13112var canvasMapper = ({ state, api }) => ({ 13113 api, 13114 storyId: state.storyId, 13115 refId: state.refId, 13116 viewMode: state.viewMode, 13117 customCanvas: api.renderPreview, 13118 queryParams: state.customQueryParams, 13119 getElements: api.getElements, 13120 entry: api.getData(state.storyId, state.refId), 13121 previewInitialized: state.previewInitialized, 13122 refs: state.refs 13123}), createCanvasTab = () => ({ 13124 id: "canvas", 13125 type: types.TAB, 13126 title: "Canvas", 13127 route: ({ storyId, refId }) => refId ? `/story/${refId}_${storyId}` : `/story/${storyId}`, 13128 match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)), 13129 render: () => null 13130}), Preview2 = react_default.memo(function(props) { 13131 let { 13132 api, 13133 id: previewId, 13134 options: options2, 13135 viewMode, 13136 storyId, 13137 entry = void 0, 13138 description, 13139 baseUrl, 13140 withLoader = !0, 13141 tools, 13142 toolsExtra, 13143 tabs, 13144 wrappers, 13145 tabId, 13146 path, 13147 queryParams 13148 } = props, tabState = useTabsState({ 13149 selected: tabId ?? "canvas", 13150 onSelectionChange: (key) => { 13151 api.applyQueryParams({ tab: key === "canvas" ? void 0 : key }); 13152 }, 13153 tabs: tabs.map((tab, index) => ({ 13154 id: tab.id ?? `tab-${index}`, 13155 title: tab.title, 13156 isDisabled: !!tab.disabled, 13157 children: () => tab.render({ active: !0 }) 13158 })) 13159 }); 13160 tabs.length > 1 && deprecate("Addon tabs are deprecated and will be removed in Storybook 11."); 13161 let tabContent = tabs.find((tab) => tab.id === tabId)?.render, shouldScale = viewMode === "story", { showToolbar } = options2, customisedShowToolbar = api.getShowToolbarWithCustomisations(showToolbar), isReviewCollectionStory = isReviewFeatureEnabled(scope.FEATURES) && isReviewCollectionStoryRoute(path, queryParams), previousStoryId = useRef(storyId); 13162 useEffect(() => { 13163 if (entry && viewMode) { 13164 if (storyId === previousStoryId.current) 13165 return; 13166 if (previousStoryId.current = storyId, viewMode.match(/docs|story/)) { 13167 let { refId, id } = entry; 13168 api.emit(SET_CURRENT_STORY, { 13169 storyId: id, 13170 viewMode, 13171 options: { target: refId } 13172 }); 13173 } 13174 } 13175 }, [entry, viewMode, storyId, api]); 13176 let mainRef = useRef(null), { landmarkProps } = useLandmark( 13177 { "aria-labelledby": "main-preview-heading", role: "main" }, 13178 mainRef 13179 ); 13180 return react_default.createElement(Fragment, null, previewId === "main" && react_default.createElement(W, { key: "description" }, react_default.createElement("title", null, description)), react_default.createElement(ZoomProvider, { shouldScale }, react_default.createElement(PreviewContainer, null, customisedShowToolbar && isReviewCollectionStory ? react_default.createElement(ReviewToolbarHeader, null) : null, react_default.createElement( 13181 ToolbarComp, 13182 { 13183 key: "tools", 13184 isShown: customisedShowToolbar, 13185 tabs, 13186 tabState, 13187 tools, 13188 toolsExtra 13189 } 13190 ), react_default.createElement(FrameWrap, { ref: mainRef, ...landmarkProps }, react_default.createElement("h2", { id: "main-preview-heading", className: "sb-sr-only" }, "Main preview area"), tabContent && react_default.createElement(IframeWrapper, null, tabContent({ active: !0 })), react_default.createElement(CanvasWrap, { show: !tabId || tabId === "canvas" }, react_default.createElement(Canvas, { withLoader, baseUrl, wrappers })))))); 13191}); 13192var Canvas = ({ baseUrl, withLoader, wrappers }) => react_default.createElement(Consumer, { filter: canvasMapper }, ({ 13193 api, 13194 entry, 13195 refs, 13196 customCanvas, 13197 storyId, 13198 refId, 13199 viewMode, 13200 queryParams, 13201 previewInitialized 13202}) => { 13203 let id = "canvas", [progress, setProgress] = useState(void 0); 13204 useEffect(() => { 13205 if (scope.CONFIG_TYPE === "DEVELOPMENT") 13206 try { 13207 addons.getChannel().on(PREVIEW_BUILDER_PROGRESS, (options2) => { 13208 setProgress(options2); 13209 }); 13210 } catch { 13211 } 13212 }, []); 13213 let refLoading = !!refs[refId] && !refs[refId].previewInitialized, isBuilding = !(progress?.value === 1 || progress === void 0), rootLoading = !refId && (!previewInitialized || isBuilding), isLoading = entry && refLoading || rootLoading; 13214 return react_default.createElement(ZoomConsumer, null, ({ value: scale }) => react_default.createElement(react_default.Fragment, null, withLoader && isLoading && react_default.createElement(LoaderWrapper, null, react_default.createElement(Loader, { id: "preview-loader", role: "progressbar", progress })), react_default.createElement(ApplyWrappers, { id, storyId, viewMode, wrappers }, customCanvas ? customCanvas(storyId, viewMode, id, baseUrl, scale, queryParams) : react_default.createElement( 13215 FramesRenderer, 13216 { 13217 api, 13218 refs, 13219 scale, 13220 entry, 13221 viewMode, 13222 refId, 13223 queryParams, 13224 storyId 13225 } 13226 )))); 13227}); 13228function filterTabs(panels, parameters) { 13229 let { previewTabs } = addons.getConfig(), parametersTabs = parameters ? parameters.previewTabs : void 0; 13230 if (previewTabs || parametersTabs) { 13231 let tabs = merge(previewTabs || {}, parametersTabs || {}), arrTabs = Object.keys(tabs).map((key, index) => ({ 13232 index, 13233 ...typeof tabs[key] == "string" ? { title: tabs[key] } : tabs[key], 13234 id: key 13235 })); 13236 return panels.filter((panel) => { 13237 let t2 = arrTabs.find((tab) => tab.id === panel.id); 13238 return t2 === void 0 || t2.id === "canvas" || !t2.hidden; 13239 }).map((panel, index) => ({ ...panel, index })).sort((p1, p2) => { 13240 let tab_1 = arrTabs.find((tab) => tab.id === p1.id), index_1 = tab_1 ? tab_1.index : arrTabs.length + p1.index, tab_2 = arrTabs.find((tab) => tab.id === p2.id), index_2 = tab_2 ? tab_2.index : arrTabs.length + p2.index; 13241 return index_1 - index_2; 13242 }).map((panel) => { 13243 let t2 = arrTabs.find((tab) => tab.id === panel.id); 13244 return t2 ? { 13245 ...panel, 13246 title: t2.title || panel.title, 13247 disabled: t2.disabled, 13248 hidden: t2.hidden 13249 } : panel; 13250 }); 13251 } 13252 return panels; 13253} 13254 13255// src/manager/components/preview/tools/addons.tsx 13256init_react(); 13257var SHOW_ADDON_PANEL_BUTTON_ID = "storybook-show-addon-panel", menuMapper = ({ api, state }) => ({ 13258 isVisible: api.getIsPanelShown(), 13259 singleStory: state.singleStory, 13260 panelPosition: state.layout.panelPosition, 13261 showPanel: async (forceFocus) => { 13262 api.togglePanel(!0), api.focusOnUIElement(focusableUIElements.addonPanel, { 13263 forceFocus, 13264 poll: !0 13265 }); 13266 } 13267}), addonsTool = { 13268 title: "addons", 13269 id: "addons", 13270 type: types.TOOL, 13271 match: ({ viewMode, tabId }) => viewMode === "story" && !tabId, 13272 render: () => react_default.createElement(Consumer, { filter: menuMapper }, ({ isVisible, showPanel, singleStory, panelPosition }) => !singleStory && !isVisible && react_default.createElement(react_default.Fragment, null, react_default.createElement( 13273 Button, 13274 { 13275 padding: "small", 13276 variant: "ghost", 13277 ariaLabel: "Show addon panel", 13278 id: SHOW_ADDON_PANEL_BUTTON_ID, 13279 key: "addons", 13280 onClick: () => showPanel(!1), 13281 onKeyDown: (e2) => { 13282 (e2.key === "Enter" || e2.key === " ") && (e2.preventDefault(), showPanel(!0)); 13283 } 13284 }, 13285 panelPosition === "bottom" ? react_default.createElement(BottomBarIcon, null) : react_default.createElement(SidebarAltIcon, null) 13286 ))) 13287}; 13288 13289// src/manager/components/preview/tools/menu.tsx 13290init_react(); 13291var menuMapper2 = ({ api, state }) => ({ 13292 navAvailability: api.getNavAvailability(), 13293 singleStory: state.singleStory, 13294 showSidebar: async (forceFocus) => { 13295 api.toggleNav(!0), api.focusOnUIElement(focusableUIElements.sidebarRegion, { 13296 forceFocus, 13297 poll: !0 13298 }); 13299 } 13300}), menuTool = { 13301 title: "menu", 13302 id: "menu", 13303 type: types.TOOL, 13304 // @ts-expect-error (non strict) 13305 match: ({ viewMode }) => ["story", "docs"].includes(viewMode), 13306 render: () => react_default.createElement(Consumer, { filter: menuMapper2 }, ({ navAvailability, showSidebar, singleStory }) => !singleStory && navAvailability === "hidden" && react_default.createElement(react_default.Fragment, null, react_default.createElement( 13307 Button, 13308 { 13309 padding: "small", 13310 variant: "ghost", 13311 ariaLabel: "Show sidebar", 13312 id: focusableUIElements.showSidebar, 13313 key: "menu", 13314 onClick: () => showSidebar(!1), 13315 onKeyDown: (e2) => { 13316 (e2.key === "Enter" || e2.key === " ") && (e2.preventDefault(), showSidebar(!0)); 13317 } 13318 }, 13319 react_default.createElement(MenuIcon, null) 13320 ), react_default.createElement(Separator, null))) 13321}; 13322 13323// src/manager/components/preview/tools/open-in-editor.tsx 13324init_react(); 13325var mapper2 = ({ state, api }) => { 13326 let { storyId, refId } = state, entry = api.getData(storyId, refId); 13327 return { 13328 storyId, 13329 isCompositionStory: !!refId, 13330 importPath: entry?.importPath 13331 }; 13332}, openInEditorTool = { 13333 title: "open-in-editor", 13334 id: "open-in-editor", 13335 type: types.TOOL, 13336 match: ({ viewMode, tabId }) => scope.CONFIG_TYPE === "DEVELOPMENT" && (viewMode === "story" || viewMode === "docs") && !tabId, 13337 render: () => react_default.createElement(Consumer, { filter: mapper2 }, ({ importPath, isCompositionStory }) => { 13338 let api = useStorybookApi(); 13339 return isCompositionStory || !importPath ? null : react_default.createElement( 13340 Button, 13341 { 13342 key: "open-in-editor", 13343 onClick: () => api.openInEditor({ 13344 file: importPath 13345 }), 13346 ariaLabel: "Open in editor", 13347 padding: "small", 13348 variant: "ghost" 13349 }, 13350 react_default.createElement(EditorIcon, null) 13351 ); 13352 }) 13353}; 13354 13355// src/manager/components/preview/tools/remount.tsx 13356init_react(); 13357var StyledAnimatedButton = styled(Button)(({ theme, animating, disabled }) => ({ 13358 opacity: disabled ? 0.5 : 1, 13359 svg: { 13360 animation: animating ? `${theme.animation.rotate360} 1000ms ease-out` : void 0 13361 } 13362})), menuMapper3 = ({ api, state }) => { 13363 let { storyId } = state; 13364 return { 13365 storyId, 13366 remount: () => api.emit(FORCE_REMOUNT, { storyId: state.storyId }), 13367 api 13368 }; 13369}, remountTool = { 13370 title: "remount", 13371 id: "remount", 13372 type: types.TOOL, 13373 match: ({ viewMode, tabId }) => viewMode === "story" && !tabId, 13374 render: () => react_default.createElement(Consumer, { filter: menuMapper3 }, ({ remount, storyId, api }) => { 13375 let [isAnimating, setIsAnimating] = useState(!1), remountComponent = () => { 13376 storyId && remount(); 13377 }; 13378 return useEffect(() => { 13379 let handler = () => setIsAnimating(!0); 13380 return api.on(FORCE_REMOUNT, handler), () => api.off?.(FORCE_REMOUNT, handler); 13381 }, [api]), react_default.createElement( 13382 StyledAnimatedButton, 13383 { 13384 key: "remount", 13385 padding: "small", 13386 variant: "ghost", 13387 ariaLabel: "Reload story", 13388 onClick: remountComponent, 13389 onAnimationEnd: () => setIsAnimating(!1), 13390 animating: isAnimating, 13391 disabled: !storyId 13392 }, 13393 react_default.createElement(SyncIcon, null) 13394 ); 13395 }) 13396}; 13397 13398// src/manager/components/preview/tools/share.tsx 13399init_react(); 13400
vendor: 40,955 bytes, lines 13401-14224
13401// ../../node_modules/qrcode.react/lib/esm/index.js 13402init_react(); 13403var __defProp2 = Object.defineProperty, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp2 = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a2, b2) => { 13404 for (var prop in b2 || (b2 = {})) 13405 __hasOwnProp2.call(b2, prop) && __defNormalProp(a2, prop, b2[prop]); 13406 if (__getOwnPropSymbols) 13407 for (var prop of __getOwnPropSymbols(b2)) 13408 __propIsEnum.call(b2, prop) && __defNormalProp(a2, prop, b2[prop]); 13409 return a2; 13410}, __objRest = (source, exclude) => { 13411 var target = {}; 13412 for (var prop in source) 13413 __hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0 && (target[prop] = source[prop]); 13414 if (source != null && __getOwnPropSymbols) 13415 for (var prop of __getOwnPropSymbols(source)) 13416 exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop) && (target[prop] = source[prop]); 13417 return target; 13418}; 13419var qrcodegen; 13420((qrcodegen2) => { 13421 let _QrCode = class _QrCode2 { 13422 /*-- Constructor (low level) and fields --*/ 13423 // Creates a new QR Code with the given version number, 13424 // error correction level, data codeword bytes, and mask number. 13425 // This is a low-level API that most users should not use directly. 13426 // A mid-level API is the encodeSegments() function. 13427 constructor(version3, errorCorrectionLevel, dataCodewords, msk) { 13428 if (this.version = version3, this.errorCorrectionLevel = errorCorrectionLevel, this.modules = [], this.isFunction = [], version3 < _QrCode2.MIN_VERSION || version3 > _QrCode2.MAX_VERSION) 13429 throw new RangeError("Version value out of range"); 13430 if (msk < -1 || msk > 7) 13431 throw new RangeError("Mask value out of range"); 13432 this.size = version3 * 4 + 17; 13433 let row = []; 13434 for (let i2 = 0; i2 < this.size; i2++) 13435 row.push(!1); 13436 for (let i2 = 0; i2 < this.size; i2++) 13437 this.modules.push(row.slice()), this.isFunction.push(row.slice()); 13438 this.drawFunctionPatterns(); 13439 let allCodewords = this.addEccAndInterleave(dataCodewords); 13440 if (this.drawCodewords(allCodewords), msk == -1) { 13441 let minPenalty = 1e9; 13442 for (let i2 = 0; i2 < 8; i2++) { 13443 this.applyMask(i2), this.drawFormatBits(i2); 13444 let penalty = this.getPenaltyScore(); 13445 penalty < minPenalty && (msk = i2, minPenalty = penalty), this.applyMask(i2); 13446 } 13447 } 13448 assert(0 <= msk && msk <= 7), this.mask = msk, this.applyMask(msk), this.drawFormatBits(msk), this.isFunction = []; 13449 } 13450 /*-- Static factory functions (high level) --*/ 13451 // Returns a QR Code representing the given Unicode text string at the given error correction level. 13452 // As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer 13453 // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible 13454 // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the 13455 // ecl argument if it can be done without increasing the version. 13456 static encodeText(text, ecl) { 13457 let segs = qrcodegen2.QrSegment.makeSegments(text); 13458 return _QrCode2.encodeSegments(segs, ecl); 13459 } 13460 // Returns a QR Code representing the given binary data at the given error correction level. 13461 // This function always encodes using the binary segment mode, not any text mode. The maximum number of 13462 // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output. 13463 // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version. 13464 static encodeBinary(data, ecl) { 13465 let seg = qrcodegen2.QrSegment.makeBytes(data); 13466 return _QrCode2.encodeSegments([seg], ecl); 13467 } 13468 /*-- Static factory functions (mid level) --*/ 13469 // Returns a QR Code representing the given segments with the given encoding parameters. 13470 // The smallest possible QR Code version within the given range is automatically 13471 // chosen for the output. Iff boostEcl is true, then the ECC level of the result 13472 // may be higher than the ecl argument if it can be done without increasing the 13473 // version. The mask number is either between 0 to 7 (inclusive) to force that 13474 // mask, or -1 to automatically choose an appropriate mask (which may be slow). 13475 // This function allows the user to create a custom sequence of segments that switches 13476 // between modes (such as alphanumeric and byte) to encode text in less space. 13477 // This is a mid-level API; the high-level API is encodeText() and encodeBinary(). 13478 static encodeSegments(segs, ecl, minVersion = 1, maxVersion = 40, mask = -1, boostEcl = !0) { 13479 if (!(_QrCode2.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= _QrCode2.MAX_VERSION) || mask < -1 || mask > 7) 13480 throw new RangeError("Invalid value"); 13481 let version3, dataUsedBits; 13482 for (version3 = minVersion; ; version3++) { 13483 let dataCapacityBits2 = _QrCode2.getNumDataCodewords(version3, ecl) * 8, usedBits = QrSegment.getTotalBits(segs, version3); 13484 if (usedBits <= dataCapacityBits2) { 13485 dataUsedBits = usedBits; 13486 break; 13487 } 13488 if (version3 >= maxVersion) 13489 throw new RangeError("Data too long"); 13490 } 13491 for (let newEcl of [_QrCode2.Ecc.MEDIUM, _QrCode2.Ecc.QUARTILE, _QrCode2.Ecc.HIGH]) 13492 boostEcl && dataUsedBits <= _QrCode2.getNumDataCodewords(version3, newEcl) * 8 && (ecl = newEcl); 13493 let bb = []; 13494 for (let seg of segs) { 13495 appendBits(seg.mode.modeBits, 4, bb), appendBits(seg.numChars, seg.mode.numCharCountBits(version3), bb); 13496 for (let b2 of seg.getData()) 13497 bb.push(b2); 13498 } 13499 assert(bb.length == dataUsedBits); 13500 let dataCapacityBits = _QrCode2.getNumDataCodewords(version3, ecl) * 8; 13501 assert(bb.length <= dataCapacityBits), appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb), appendBits(0, (8 - bb.length % 8) % 8, bb), assert(bb.length % 8 == 0); 13502 for (let padByte = 236; bb.length < dataCapacityBits; padByte ^= 253) 13503 appendBits(padByte, 8, bb); 13504 let dataCodewords = []; 13505 for (; dataCodewords.length * 8 < bb.length; ) 13506 dataCodewords.push(0); 13507 return bb.forEach((b2, i2) => dataCodewords[i2 >>> 3] |= b2 << 7 - (i2 & 7)), new _QrCode2(version3, ecl, dataCodewords, mask); 13508 } 13509 /*-- Accessor methods --*/ 13510 // Returns the color of the module (pixel) at the given coordinates, which is false 13511 // for light or true for dark. The top left corner has the coordinates (x=0, y=0). 13512 // If the given coordinates are out of bounds, then false (light) is returned. 13513 getModule(x2, y2) { 13514 return 0 <= x2 && x2 < this.size && 0 <= y2 && y2 < this.size && this.modules[y2][x2]; 13515 } 13516 // Modified to expose modules for easy access 13517 getModules() { 13518 return this.modules; 13519 } 13520 /*-- Private helper methods for constructor: Drawing function modules --*/ 13521 // Reads this object's version field, and draws and marks all function modules. 13522 drawFunctionPatterns() { 13523 for (let i2 = 0; i2 < this.size; i2++) 13524 this.setFunctionModule(6, i2, i2 % 2 == 0), this.setFunctionModule(i2, 6, i2 % 2 == 0); 13525 this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4); 13526 let alignPatPos = this.getAlignmentPatternPositions(), numAlign = alignPatPos.length; 13527 for (let i2 = 0; i2 < numAlign; i2++) 13528 for (let j2 = 0; j2 < numAlign; j2++) 13529 i2 == 0 && j2 == 0 || i2 == 0 && j2 == numAlign - 1 || i2 == numAlign - 1 && j2 == 0 || this.drawAlignmentPattern(alignPatPos[i2], alignPatPos[j2]); 13530 this.drawFormatBits(0), this.drawVersion(); 13531 } 13532 // Draws two copies of the format bits (with its own error correction code) 13533 // based on the given mask and this object's error correction level field. 13534 drawFormatBits(mask) { 13535 let data = this.errorCorrectionLevel.formatBits << 3 | mask, rem2 = data; 13536 for (let i2 = 0; i2 < 10; i2++) 13537 rem2 = rem2 << 1 ^ (rem2 >>> 9) * 1335; 13538 let bits = (data << 10 | rem2) ^ 21522; 13539 assert(bits >>> 15 == 0); 13540 for (let i2 = 0; i2 <= 5; i2++) 13541 this.setFunctionModule(8, i2, getBit(bits, i2)); 13542 this.setFunctionModule(8, 7, getBit(bits, 6)), this.setFunctionModule(8, 8, getBit(bits, 7)), this.setFunctionModule(7, 8, getBit(bits, 8)); 13543 for (let i2 = 9; i2 < 15; i2++) 13544 this.setFunctionModule(14 - i2, 8, getBit(bits, i2)); 13545 for (let i2 = 0; i2 < 8; i2++) 13546 this.setFunctionModule(this.size - 1 - i2, 8, getBit(bits, i2)); 13547 for (let i2 = 8; i2 < 15; i2++) 13548 this.setFunctionModule(8, this.size - 15 + i2, getBit(bits, i2)); 13549 this.setFunctionModule(8, this.size - 8, !0); 13550 } 13551 // Draws two copies of the version bits (with its own error correction code), 13552 // based on this object's version field, iff 7 <= version <= 40. 13553 drawVersion() { 13554 if (this.version < 7) 13555 return; 13556 let rem2 = this.version; 13557 for (let i2 = 0; i2 < 12; i2++) 13558 rem2 = rem2 << 1 ^ (rem2 >>> 11) * 7973; 13559 let bits = this.version << 12 | rem2; 13560 assert(bits >>> 18 == 0); 13561 for (let i2 = 0; i2 < 18; i2++) { 13562 let color2 = getBit(bits, i2), a2 = this.size - 11 + i2 % 3, b2 = Math.floor(i2 / 3); 13563 this.setFunctionModule(a2, b2, color2), this.setFunctionModule(b2, a2, color2); 13564 } 13565 } 13566 // Draws a 9*9 finder pattern including the border separator, 13567 // with the center module at (x, y). Modules can be out of bounds. 13568 drawFinderPattern(x2, y2) { 13569 for (let dy = -4; dy <= 4; dy++) 13570 for (let dx = -4; dx <= 4; dx++) { 13571 let dist = Math.max(Math.abs(dx), Math.abs(dy)), xx = x2 + dx, yy = y2 + dy; 13572 0 <= xx && xx < this.size && 0 <= yy && yy < this.size && this.setFunctionModule(xx, yy, dist != 2 && dist != 4); 13573 } 13574 } 13575 // Draws a 5*5 alignment pattern, with the center module 13576 // at (x, y). All modules must be in bounds. 13577 drawAlignmentPattern(x2, y2) { 13578 for (let dy = -2; dy <= 2; dy++) 13579 for (let dx = -2; dx <= 2; dx++) 13580 this.setFunctionModule(x2 + dx, y2 + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1); 13581 } 13582 // Sets the color of a module and marks it as a function module. 13583 // Only used by the constructor. Coordinates must be in bounds. 13584 setFunctionModule(x2, y2, isDark) { 13585 this.modules[y2][x2] = isDark, this.isFunction[y2][x2] = !0; 13586 } 13587 /*-- Private helper methods for constructor: Codewords and masking --*/ 13588 // Returns a new byte string representing the given data with the appropriate error correction 13589 // codewords appended to it, based on this object's version and error correction level. 13590 addEccAndInterleave(data) { 13591 let ver = this.version, ecl = this.errorCorrectionLevel; 13592 if (data.length != _QrCode2.getNumDataCodewords(ver, ecl)) 13593 throw new RangeError("Invalid argument"); 13594 let numBlocks = _QrCode2.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver], blockEccLen = _QrCode2.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver], rawCodewords = Math.floor(_QrCode2.getNumRawDataModules(ver) / 8), numShortBlocks = numBlocks - rawCodewords % numBlocks, shortBlockLen = Math.floor(rawCodewords / numBlocks), blocks = [], rsDiv = _QrCode2.reedSolomonComputeDivisor(blockEccLen); 13595 for (let i2 = 0, k2 = 0; i2 < numBlocks; i2++) { 13596 let dat = data.slice(k2, k2 + shortBlockLen - blockEccLen + (i2 < numShortBlocks ? 0 : 1)); 13597 k2 += dat.length; 13598 let ecc = _QrCode2.reedSolomonComputeRemainder(dat, rsDiv); 13599 i2 < numShortBlocks && dat.push(0), blocks.push(dat.concat(ecc)); 13600 } 13601 let result = []; 13602 for (let i2 = 0; i2 < blocks[0].length; i2++) 13603 blocks.forEach((block, j2) => { 13604 (i2 != shortBlockLen - blockEccLen || j2 >= numShortBlocks) && result.push(block[i2]); 13605 }); 13606 return assert(result.length == rawCodewords), result; 13607 } 13608 // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire 13609 // data area of this QR Code. Function modules need to be marked off before this is called. 13610 drawCodewords(data) { 13611 if (data.length != Math.floor(_QrCode2.getNumRawDataModules(this.version) / 8)) 13612 throw new RangeError("Invalid argument"); 13613 let i2 = 0; 13614 for (let right = this.size - 1; right >= 1; right -= 2) { 13615 right == 6 && (right = 5); 13616 for (let vert = 0; vert < this.size; vert++) 13617 for (let j2 = 0; j2 < 2; j2++) { 13618 let x2 = right - j2, y2 = (right + 1 & 2) == 0 ? this.size - 1 - vert : vert; 13619 !this.isFunction[y2][x2] && i2 < data.length * 8 && (this.modules[y2][x2] = getBit(data[i2 >>> 3], 7 - (i2 & 7)), i2++); 13620 } 13621 } 13622 assert(i2 == data.length * 8); 13623 } 13624 // XORs the codeword modules in this QR Code with the given mask pattern. 13625 // The function modules must be marked and the codeword bits must be drawn 13626 // before masking. Due to the arithmetic of XOR, calling applyMask() with 13627 // the same mask value a second time will undo the mask. A final well-formed 13628 // QR Code needs exactly one (not zero, two, etc.) mask applied. 13629 applyMask(mask) { 13630 if (mask < 0 || mask > 7) 13631 throw new RangeError("Mask value out of range"); 13632 for (let y2 = 0; y2 < this.size; y2++) 13633 for (let x2 = 0; x2 < this.size; x2++) { 13634 let invert2; 13635 switch (mask) { 13636 case 0: 13637 invert2 = (x2 + y2) % 2 == 0; 13638 break; 13639 case 1: 13640 invert2 = y2 % 2 == 0; 13641 break; 13642 case 2: 13643 invert2 = x2 % 3 == 0; 13644 break; 13645 case 3: 13646 invert2 = (x2 + y2) % 3 == 0; 13647 break; 13648 case 4: 13649 invert2 = (Math.floor(x2 / 3) + Math.floor(y2 / 2)) % 2 == 0; 13650 break; 13651 case 5: 13652 invert2 = x2 * y2 % 2 + x2 * y2 % 3 == 0; 13653 break; 13654 case 6: 13655 invert2 = (x2 * y2 % 2 + x2 * y2 % 3) % 2 == 0; 13656 break; 13657 case 7: 13658 invert2 = ((x2 + y2) % 2 + x2 * y2 % 3) % 2 == 0; 13659 break; 13660 default: 13661 throw new Error("Unreachable"); 13662 } 13663 !this.isFunction[y2][x2] && invert2 && (this.modules[y2][x2] = !this.modules[y2][x2]); 13664 } 13665 } 13666 // Calculates and returns the penalty score based on state of this QR Code's current modules. 13667 // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score. 13668 getPenaltyScore() { 13669 let result = 0; 13670 for (let y2 = 0; y2 < this.size; y2++) { 13671 let runColor = !1, runX = 0, runHistory = [0, 0, 0, 0, 0, 0, 0]; 13672 for (let x2 = 0; x2 < this.size; x2++) 13673 this.modules[y2][x2] == runColor ? (runX++, runX == 5 ? result += _QrCode2.PENALTY_N1 : runX > 5 && result++) : (this.finderPenaltyAddHistory(runX, runHistory), runColor || (result += this.finderPenaltyCountPatterns(runHistory) * _QrCode2.PENALTY_N3), runColor = this.modules[y2][x2], runX = 1); 13674 result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * _QrCode2.PENALTY_N3; 13675 } 13676 for (let x2 = 0; x2 < this.size; x2++) { 13677 let runColor = !1, runY = 0, runHistory = [0, 0, 0, 0, 0, 0, 0]; 13678 for (let y2 = 0; y2 < this.size; y2++) 13679 this.modules[y2][x2] == runColor ? (runY++, runY == 5 ? result += _QrCode2.PENALTY_N1 : runY > 5 && result++) : (this.finderPenaltyAddHistory(runY, runHistory), runColor || (result += this.finderPenaltyCountPatterns(runHistory) * _QrCode2.PENALTY_N3), runColor = this.modules[y2][x2], runY = 1); 13680 result += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * _QrCode2.PENALTY_N3; 13681 } 13682 for (let y2 = 0; y2 < this.size - 1; y2++) 13683 for (let x2 = 0; x2 < this.size - 1; x2++) { 13684 let color2 = this.modules[y2][x2]; 13685 color2 == this.modules[y2][x2 + 1] && color2 == this.modules[y2 + 1][x2] && color2 == this.modules[y2 + 1][x2 + 1] && (result += _QrCode2.PENALTY_N2); 13686 } 13687 let dark = 0; 13688 for (let row of this.modules) 13689 dark = row.reduce((sum, color2) => sum + (color2 ? 1 : 0), dark); 13690 let total = this.size * this.size, k2 = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1; 13691 return assert(0 <= k2 && k2 <= 9), result += k2 * _QrCode2.PENALTY_N4, assert(0 <= result && result <= 2568888), result; 13692 } 13693 /*-- Private helper functions --*/ 13694 // Returns an ascending list of positions of alignment patterns for this version number. 13695 // Each position is in the range [0,177), and are used on both the x and y axes. 13696 // This could be implemented as lookup table of 40 variable-length lists of integers. 13697 getAlignmentPatternPositions() { 13698 if (this.version == 1) 13699 return []; 13700 { 13701 let numAlign = Math.floor(this.version / 7) + 2, step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2, result = [6]; 13702 for (let pos = this.size - 7; result.length < numAlign; pos -= step) 13703 result.splice(1, 0, pos); 13704 return result; 13705 } 13706 } 13707 // Returns the number of data bits that can be stored in a QR Code of the given version number, after 13708 // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. 13709 // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. 13710 static getNumRawDataModules(ver) { 13711 if (ver < _QrCode2.MIN_VERSION || ver > _QrCode2.MAX_VERSION) 13712 throw new RangeError("Version number out of range"); 13713 let result = (16 * ver + 128) * ver + 64; 13714 if (ver >= 2) { 13715 let numAlign = Math.floor(ver / 7) + 2; 13716 result -= (25 * numAlign - 10) * numAlign - 55, ver >= 7 && (result -= 36); 13717 } 13718 return assert(208 <= result && result <= 29648), result; 13719 } 13720 // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any 13721 // QR Code of the given version number and error correction level, with remainder bits discarded. 13722 // This stateless pure function could be implemented as a (40*4)-cell lookup table. 13723 static getNumDataCodewords(ver, ecl) { 13724 return Math.floor(_QrCode2.getNumRawDataModules(ver) / 8) - _QrCode2.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * _QrCode2.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver]; 13725 } 13726 // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be 13727 // implemented as a lookup table over all possible parameter values, instead of as an algorithm. 13728 static reedSolomonComputeDivisor(degree) { 13729 if (degree < 1 || degree > 255) 13730 throw new RangeError("Degree out of range"); 13731 let result = []; 13732 for (let i2 = 0; i2 < degree - 1; i2++) 13733 result.push(0); 13734 result.push(1); 13735 let root2 = 1; 13736 for (let i2 = 0; i2 < degree; i2++) { 13737 for (let j2 = 0; j2 < result.length; j2++) 13738 result[j2] = _QrCode2.reedSolomonMultiply(result[j2], root2), j2 + 1 < result.length && (result[j2] ^= result[j2 + 1]); 13739 root2 = _QrCode2.reedSolomonMultiply(root2, 2); 13740 } 13741 return result; 13742 } 13743 // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials. 13744 static reedSolomonComputeRemainder(data, divisor) { 13745 let result = divisor.map((_2) => 0); 13746 for (let b2 of data) { 13747 let factor = b2 ^ result.shift(); 13748 result.push(0), divisor.forEach((coef, i2) => result[i2] ^= _QrCode2.reedSolomonMultiply(coef, factor)); 13749 } 13750 return result; 13751 } 13752 // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result 13753 // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8. 13754 static reedSolomonMultiply(x2, y2) { 13755 if (x2 >>> 8 || y2 >>> 8) 13756 throw new RangeError("Byte out of range"); 13757 let z2 = 0; 13758 for (let i2 = 7; i2 >= 0; i2--) 13759 z2 = z2 << 1 ^ (z2 >>> 7) * 285, z2 ^= (y2 >>> i2 & 1) * x2; 13760 return assert(z2 >>> 8 == 0), z2; 13761 } 13762 // Can only be called immediately after a light run is added, and 13763 // returns either 0, 1, or 2. A helper function for getPenaltyScore(). 13764 finderPenaltyCountPatterns(runHistory) { 13765 let n3 = runHistory[1]; 13766 assert(n3 <= this.size * 3); 13767 let core2 = n3 > 0 && runHistory[2] == n3 && runHistory[3] == n3 * 3 && runHistory[4] == n3 && runHistory[5] == n3; 13768 return (core2 && runHistory[0] >= n3 * 4 && runHistory[6] >= n3 ? 1 : 0) + (core2 && runHistory[6] >= n3 * 4 && runHistory[0] >= n3 ? 1 : 0); 13769 } 13770 // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore(). 13771 finderPenaltyTerminateAndCount(currentRunColor, currentRunLength, runHistory) { 13772 return currentRunColor && (this.finderPenaltyAddHistory(currentRunLength, runHistory), currentRunLength = 0), currentRunLength += this.size, this.finderPenaltyAddHistory(currentRunLength, runHistory), this.finderPenaltyCountPatterns(runHistory); 13773 } 13774 // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore(). 13775 finderPenaltyAddHistory(currentRunLength, runHistory) { 13776 runHistory[0] == 0 && (currentRunLength += this.size), runHistory.pop(), runHistory.unshift(currentRunLength); 13777 } 13778 }; 13779 _QrCode.MIN_VERSION = 1, _QrCode.MAX_VERSION = 40, _QrCode.PENALTY_N1 = 3, _QrCode.PENALTY_N2 = 3, _QrCode.PENALTY_N3 = 40, _QrCode.PENALTY_N4 = 10, _QrCode.ECC_CODEWORDS_PER_BLOCK = [ 13780 // Version: (note that index 0 is for padding, and is set to an illegal value) 13781 //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level 13782 [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], 13783 // Low 13784 [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28], 13785 // Medium 13786 [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], 13787 // Quartile 13788 [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30] 13789 // High 13790 ], _QrCode.NUM_ERROR_CORRECTION_BLOCKS = [ 13791 // Version: (note that index 0 is for padding, and is set to an illegal value) 13792 //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level 13793 [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25], 13794 // Low 13795 [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49], 13796 // Medium 13797 [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68], 13798 // Quartile 13799 [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81] 13800 // High 13801 ]; 13802 let QrCode = _QrCode; 13803 qrcodegen2.QrCode = _QrCode; 13804 function appendBits(val, len, bb) { 13805 if (len < 0 || len > 31 || val >>> len) 13806 throw new RangeError("Value out of range"); 13807 for (let i2 = len - 1; i2 >= 0; i2--) 13808 bb.push(val >>> i2 & 1); 13809 } 13810 function getBit(x2, i2) { 13811 return (x2 >>> i2 & 1) != 0; 13812 } 13813 function assert(cond) { 13814 if (!cond) 13815 throw new Error("Assertion error"); 13816 } 13817 let _QrSegment = class _QrSegment2 { 13818 /*-- Constructor (low level) and fields --*/ 13819 // Creates a new QR Code segment with the given attributes and data. 13820 // The character count (numChars) must agree with the mode and the bit buffer length, 13821 // but the constraint isn't checked. The given bit buffer is cloned and stored. 13822 constructor(mode, numChars, bitData) { 13823 if (this.mode = mode, this.numChars = numChars, this.bitData = bitData, numChars < 0) 13824 throw new RangeError("Invalid argument"); 13825 this.bitData = bitData.slice(); 13826 } 13827 /*-- Static factory functions (mid level) --*/ 13828 // Returns a segment representing the given binary data encoded in 13829 // byte mode. All input byte arrays are acceptable. Any text string 13830 // can be converted to UTF-8 bytes and encoded as a byte mode segment. 13831 static makeBytes(data) { 13832 let bb = []; 13833 for (let b2 of data) 13834 appendBits(b2, 8, bb); 13835 return new _QrSegment2(_QrSegment2.Mode.BYTE, data.length, bb); 13836 } 13837 // Returns a segment representing the given string of decimal digits encoded in numeric mode. 13838 static makeNumeric(digits) { 13839 if (!_QrSegment2.isNumeric(digits)) 13840 throw new RangeError("String contains non-numeric characters"); 13841 let bb = []; 13842 for (let i2 = 0; i2 < digits.length; ) { 13843 let n3 = Math.min(digits.length - i2, 3); 13844 appendBits(parseInt(digits.substring(i2, i2 + n3), 10), n3 * 3 + 1, bb), i2 += n3; 13845 } 13846 return new _QrSegment2(_QrSegment2.Mode.NUMERIC, digits.length, bb); 13847 } 13848 // Returns a segment representing the given text string encoded in alphanumeric mode. 13849 // The characters allowed are: 0 to 9, A to Z (uppercase only), space, 13850 // dollar, percent, asterisk, plus, hyphen, period, slash, colon. 13851 static makeAlphanumeric(text) { 13852 if (!_QrSegment2.isAlphanumeric(text)) 13853 throw new RangeError("String contains unencodable characters in alphanumeric mode"); 13854 let bb = [], i2; 13855 for (i2 = 0; i2 + 2 <= text.length; i2 += 2) { 13856 let temp = _QrSegment2.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i2)) * 45; 13857 temp += _QrSegment2.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i2 + 1)), appendBits(temp, 11, bb); 13858 } 13859 return i2 < text.length && appendBits(_QrSegment2.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i2)), 6, bb), new _QrSegment2(_QrSegment2.Mode.ALPHANUMERIC, text.length, bb); 13860 } 13861 // Returns a new mutable list of zero or more segments to represent the given Unicode text string. 13862 // The result may use various segment modes and switch modes to optimize the length of the bit stream. 13863 static makeSegments(text) { 13864 return text == "" ? [] : _QrSegment2.isNumeric(text) ? [_QrSegment2.makeNumeric(text)] : _QrSegment2.isAlphanumeric(text) ? [_QrSegment2.makeAlphanumeric(text)] : [_QrSegment2.makeBytes(_QrSegment2.toUtf8ByteArray(text))]; 13865 } 13866 // Returns a segment representing an Extended Channel Interpretation 13867 // (ECI) designator with the given assignment value. 13868 static makeEci(assignVal) { 13869 let bb = []; 13870 if (assignVal < 0) 13871 throw new RangeError("ECI assignment value out of range"); 13872 if (assignVal < 128) 13873 appendBits(assignVal, 8, bb); 13874 else if (assignVal < 16384) 13875 appendBits(2, 2, bb), appendBits(assignVal, 14, bb); 13876 else if (assignVal < 1e6) 13877 appendBits(6, 3, bb), appendBits(assignVal, 21, bb); 13878 else 13879 throw new RangeError("ECI assignment value out of range"); 13880 return new _QrSegment2(_QrSegment2.Mode.ECI, 0, bb); 13881 } 13882 // Tests whether the given string can be encoded as a segment in numeric mode. 13883 // A string is encodable iff each character is in the range 0 to 9. 13884 static isNumeric(text) { 13885 return _QrSegment2.NUMERIC_REGEX.test(text); 13886 } 13887 // Tests whether the given string can be encoded as a segment in alphanumeric mode. 13888 // A string is encodable iff each character is in the following set: 0 to 9, A to Z 13889 // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon. 13890 static isAlphanumeric(text) { 13891 return _QrSegment2.ALPHANUMERIC_REGEX.test(text); 13892 } 13893 /*-- Methods --*/ 13894 // Returns a new copy of the data bits of this segment. 13895 getData() { 13896 return this.bitData.slice(); 13897 } 13898 // (Package-private) Calculates and returns the number of bits needed to encode the given segments at 13899 // the given version. The result is infinity if a segment has too many characters to fit its length field. 13900 static getTotalBits(segs, version3) { 13901 let result = 0; 13902 for (let seg of segs) { 13903 let ccbits = seg.mode.numCharCountBits(version3); 13904 if (seg.numChars >= 1 << ccbits) 13905 return 1 / 0; 13906 result += 4 + ccbits + seg.bitData.length; 13907 } 13908 return result; 13909 } 13910 // Returns a new array of bytes representing the given string encoded in UTF-8. 13911 static toUtf8ByteArray(str) { 13912 str = encodeURI(str); 13913 let result = []; 13914 for (let i2 = 0; i2 < str.length; i2++) 13915 str.charAt(i2) != "%" ? result.push(str.charCodeAt(i2)) : (result.push(parseInt(str.substring(i2 + 1, i2 + 3), 16)), i2 += 2); 13916 return result; 13917 } 13918 }; 13919 _QrSegment.NUMERIC_REGEX = /^[0-9]*$/, _QrSegment.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, _QrSegment.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"; 13920 let QrSegment = _QrSegment; 13921 qrcodegen2.QrSegment = _QrSegment; 13922})(qrcodegen || (qrcodegen = {})); 13923((qrcodegen2) => { 13924 let QrCode; 13925 ((QrCode2) => { 13926 let _Ecc = class { 13927 // The QR Code can tolerate about 30% erroneous codewords 13928 /*-- Constructor and fields --*/ 13929 constructor(ordinal, formatBits) { 13930 this.ordinal = ordinal, this.formatBits = formatBits; 13931 } 13932 }; 13933 _Ecc.LOW = new _Ecc(0, 1), _Ecc.MEDIUM = new _Ecc(1, 0), _Ecc.QUARTILE = new _Ecc(2, 3), _Ecc.HIGH = new _Ecc(3, 2); 13934 let Ecc = _Ecc; 13935 QrCode2.Ecc = _Ecc; 13936 })(QrCode = qrcodegen2.QrCode || (qrcodegen2.QrCode = {})); 13937})(qrcodegen || (qrcodegen = {})); 13938((qrcodegen2) => { 13939 let QrSegment; 13940 ((QrSegment2) => { 13941 let _Mode = class { 13942 /*-- Constructor and fields --*/ 13943 constructor(modeBits, numBitsCharCount) { 13944 this.modeBits = modeBits, this.numBitsCharCount = numBitsCharCount; 13945 } 13946 /*-- Method --*/ 13947 // (Package-private) Returns the bit width of the character count field for a segment in 13948 // this mode in a QR Code at the given version number. The result is in the range [0, 16]. 13949 numCharCountBits(ver) { 13950 return this.numBitsCharCount[Math.floor((ver + 7) / 17)]; 13951 } 13952 }; 13953 _Mode.NUMERIC = new _Mode(1, [10, 12, 14]), _Mode.ALPHANUMERIC = new _Mode(2, [9, 11, 13]), _Mode.BYTE = new _Mode(4, [8, 16, 16]), _Mode.KANJI = new _Mode(8, [8, 10, 12]), _Mode.ECI = new _Mode(7, [0, 0, 0]); 13954 let Mode = _Mode; 13955 QrSegment2.Mode = _Mode; 13956 })(QrSegment = qrcodegen2.QrSegment || (qrcodegen2.QrSegment = {})); 13957})(qrcodegen || (qrcodegen = {})); 13958var qrcodegen_default = qrcodegen; 13959var ERROR_LEVEL_MAP = { 13960 L: qrcodegen_default.QrCode.Ecc.LOW, 13961 M: qrcodegen_default.QrCode.Ecc.MEDIUM, 13962 Q: qrcodegen_default.QrCode.Ecc.QUARTILE, 13963 H: qrcodegen_default.QrCode.Ecc.HIGH 13964}, DEFAULT_SIZE = 128, DEFAULT_LEVEL = "L", DEFAULT_BGCOLOR = "#FFFFFF", DEFAULT_FGCOLOR = "#000000", DEFAULT_INCLUDEMARGIN = !1, DEFAULT_MINVERSION = 1, SPEC_MARGIN_SIZE = 4, DEFAULT_MARGIN_SIZE = 0, DEFAULT_IMG_SCALE = 0.1; 13965function generatePath(modules, margin = 0) { 13966 let ops = []; 13967 return modules.forEach(function(row, y2) { 13968 let start = null; 13969 row.forEach(function(cell, x2) { 13970 if (!cell && start !== null) { 13971 ops.push( 13972 `M${start + margin} ${y2 + margin}h${x2 - start}v1H${start + margin}z` 13973 ), start = null; 13974 return; 13975 } 13976 if (x2 === row.length - 1) { 13977 if (!cell) 13978 return; 13979 start === null ? ops.push(`M${x2 + margin},${y2 + margin} h1v1H${x2 + margin}z`) : ops.push( 13980 `M${start + margin},${y2 + margin} h${x2 + 1 - start}v1H${start + margin}z` 13981 ); 13982 return; 13983 } 13984 cell && start === null && (start = x2); 13985 }); 13986 }), ops.join(""); 13987} 13988function excavateModules(modules, excavation) { 13989 return modules.slice().map((row, y2) => y2 < excavation.y || y2 >= excavation.y + excavation.h ? row : row.map((cell, x2) => x2 < excavation.x || x2 >= excavation.x + excavation.w ? cell : !1)); 13990} 13991function getImageSettings(cells, size, margin, imageSettings) { 13992 if (imageSettings == null) 13993 return null; 13994 let numCells = cells.length + margin * 2, defaultSize = Math.floor(size * DEFAULT_IMG_SCALE), scale = numCells / size, w2 = (imageSettings.width || defaultSize) * scale, h2 = (imageSettings.height || defaultSize) * scale, x2 = imageSettings.x == null ? cells.length / 2 - w2 / 2 : imageSettings.x * scale, y2 = imageSettings.y == null ? cells.length / 2 - h2 / 2 : imageSettings.y * scale, opacity = imageSettings.opacity == null ? 1 : imageSettings.opacity, excavation = null; 13995 if (imageSettings.excavate) { 13996 let floorX = Math.floor(x2), floorY = Math.floor(y2), ceilW = Math.ceil(w2 + x2 - floorX), ceilH = Math.ceil(h2 + y2 - floorY); 13997 excavation = { x: floorX, y: floorY, w: ceilW, h: ceilH }; 13998 } 13999 let crossOrigin = imageSettings.crossOrigin; 14000 return { x: x2, y: y2, h: h2, w: w2, excavation, opacity, crossOrigin }; 14001} 14002function getMarginSize(includeMargin, marginSize) { 14003 return marginSize != null ? Math.max(Math.floor(marginSize), 0) : includeMargin ? SPEC_MARGIN_SIZE : DEFAULT_MARGIN_SIZE; 14004} 14005function useQRCode({ 14006 value, 14007 level, 14008 minVersion, 14009 includeMargin, 14010 marginSize, 14011 imageSettings, 14012 size, 14013 boostLevel 14014}) { 14015 let qrcode = react_default.useMemo(() => { 14016 let segments = (Array.isArray(value) ? value : [value]).reduce((accum, v2) => (accum.push(...qrcodegen_default.QrSegment.makeSegments(v2)), accum), []); 14017 return qrcodegen_default.QrCode.encodeSegments( 14018 segments, 14019 ERROR_LEVEL_MAP[level], 14020 minVersion, 14021 void 0, 14022 void 0, 14023 boostLevel 14024 ); 14025 }, [value, level, minVersion, boostLevel]), { cells, margin, numCells, calculatedImageSettings } = react_default.useMemo(() => { 14026 let cells2 = qrcode.getModules(), margin2 = getMarginSize(includeMargin, marginSize), numCells2 = cells2.length + margin2 * 2, calculatedImageSettings2 = getImageSettings( 14027 cells2, 14028 size, 14029 margin2, 14030 imageSettings 14031 ); 14032 return { 14033 cells: cells2, 14034 margin: margin2, 14035 numCells: numCells2, 14036 calculatedImageSettings: calculatedImageSettings2 14037 }; 14038 }, [qrcode, size, imageSettings, includeMargin, marginSize]); 14039 return { 14040 qrcode, 14041 margin, 14042 cells, 14043 numCells, 14044 calculatedImageSettings 14045 }; 14046} 14047var SUPPORTS_PATH2D = (function() { 14048 try { 14049 new Path2D().addPath(new Path2D()); 14050 } catch { 14051 return !1; 14052 } 14053 return !0; 14054})(), QRCodeCanvas = react_default.forwardRef( 14055 function(props, forwardedRef) { 14056 let _a2 = props, { 14057 value, 14058 size = DEFAULT_SIZE, 14059 level = DEFAULT_LEVEL, 14060 bgColor = DEFAULT_BGCOLOR, 14061 fgColor = DEFAULT_FGCOLOR, 14062 includeMargin = DEFAULT_INCLUDEMARGIN, 14063 minVersion = DEFAULT_MINVERSION, 14064 boostLevel, 14065 marginSize, 14066 imageSettings 14067 } = _a2, _b = __objRest(_a2, [ 14068 "value", 14069 "size", 14070 "level", 14071 "bgColor", 14072 "fgColor", 14073 "includeMargin", 14074 "minVersion", 14075 "boostLevel", 14076 "marginSize", 14077 "imageSettings" 14078 ]), { style } = _b, otherProps = __objRest(_b, ["style"]), imgSrc = imageSettings?.src, _canvas = react_default.useRef(null), _image = react_default.useRef(null), setCanvasRef = react_default.useCallback( 14079 (node) => { 14080 _canvas.current = node, typeof forwardedRef == "function" ? forwardedRef(node) : forwardedRef && (forwardedRef.current = node); 14081 }, 14082 [forwardedRef] 14083 ), [isImgLoaded, setIsImageLoaded] = react_default.useState(!1), { margin, cells, numCells, calculatedImageSettings } = useQRCode({ 14084 value, 14085 level, 14086 minVersion, 14087 boostLevel, 14088 includeMargin, 14089 marginSize, 14090 imageSettings, 14091 size 14092 }); 14093 react_default.useEffect(() => { 14094 if (_canvas.current != null) { 14095 let canvas = _canvas.current, ctx = canvas.getContext("2d"); 14096 if (!ctx) 14097 return; 14098 let cellsToDraw = cells, image = _image.current, haveImageToRender = calculatedImageSettings != null && image !== null && image.complete && image.naturalHeight !== 0 && image.naturalWidth !== 0; 14099 haveImageToRender && calculatedImageSettings.excavation != null && (cellsToDraw = excavateModules( 14100 cells, 14101 calculatedImageSettings.excavation 14102 )); 14103 let pixelRatio = window.devicePixelRatio || 1; 14104 canvas.height = canvas.width = size * pixelRatio; 14105 let scale = size / numCells * pixelRatio; 14106 ctx.scale(scale, scale), ctx.fillStyle = bgColor, ctx.fillRect(0, 0, numCells, numCells), ctx.fillStyle = fgColor, SUPPORTS_PATH2D ? ctx.fill(new Path2D(generatePath(cellsToDraw, margin))) : cells.forEach(function(row, rdx) { 14107 row.forEach(function(cell, cdx) { 14108 cell && ctx.fillRect(cdx + margin, rdx + margin, 1, 1); 14109 }); 14110 }), calculatedImageSettings && (ctx.globalAlpha = calculatedImageSettings.opacity), haveImageToRender && ctx.drawImage( 14111 image, 14112 calculatedImageSettings.x + margin, 14113 calculatedImageSettings.y + margin, 14114 calculatedImageSettings.w, 14115 calculatedImageSettings.h 14116 ); 14117 } 14118 }), react_default.useEffect(() => { 14119 setIsImageLoaded(!1); 14120 }, [imgSrc]); 14121 let canvasStyle = __spreadValues({ height: size, width: size }, style), img = null; 14122 return imgSrc != null && (img = react_default.createElement( 14123 "img", 14124 { 14125 src: imgSrc, 14126 key: imgSrc, 14127 style: { display: "none" }, 14128 onLoad: () => { 14129 setIsImageLoaded(!0); 14130 }, 14131 ref: _image, 14132 crossOrigin: calculatedImageSettings?.crossOrigin 14133 } 14134 )), react_default.createElement(react_default.Fragment, null, react_default.createElement( 14135 "canvas", 14136 __spreadValues({ 14137 style: canvasStyle, 14138 height: size, 14139 width: size, 14140 ref: setCanvasRef, 14141 role: "img" 14142 }, otherProps) 14143 ), img); 14144 } 14145); 14146QRCodeCanvas.displayName = "QRCodeCanvas"; 14147var QRCodeSVG = react_default.forwardRef( 14148 function(props, forwardedRef) { 14149 let _a2 = props, { 14150 value, 14151 size = DEFAULT_SIZE, 14152 level = DEFAULT_LEVEL, 14153 bgColor = DEFAULT_BGCOLOR, 14154 fgColor = DEFAULT_FGCOLOR, 14155 includeMargin = DEFAULT_INCLUDEMARGIN, 14156 minVersion = DEFAULT_MINVERSION, 14157 boostLevel, 14158 title: title2, 14159 marginSize, 14160 imageSettings 14161 } = _a2, otherProps = __objRest(_a2, [ 14162 "value", 14163 "size", 14164 "level", 14165 "bgColor", 14166 "fgColor", 14167 "includeMargin", 14168 "minVersion", 14169 "boostLevel", 14170 "title", 14171 "marginSize", 14172 "imageSettings" 14173 ]), { margin, cells, numCells, calculatedImageSettings } = useQRCode({ 14174 value, 14175 level, 14176 minVersion, 14177 boostLevel, 14178 includeMargin, 14179 marginSize, 14180 imageSettings, 14181 size 14182 }), cellsToDraw = cells, image = null; 14183 imageSettings != null && calculatedImageSettings != null && (calculatedImageSettings.excavation != null && (cellsToDraw = excavateModules( 14184 cells, 14185 calculatedImageSettings.excavation 14186 )), image = react_default.createElement( 14187 "image", 14188 { 14189 href: imageSettings.src, 14190 height: calculatedImageSettings.h, 14191 width: calculatedImageSettings.w, 14192 x: calculatedImageSettings.x + margin, 14193 y: calculatedImageSettings.y + margin, 14194 preserveAspectRatio: "none", 14195 opacity: calculatedImageSettings.opacity, 14196 crossOrigin: calculatedImageSettings.crossOrigin 14197 } 14198 )); 14199 let fgPath = generatePath(cellsToDraw, margin); 14200 return react_default.createElement( 14201 "svg", 14202 __spreadValues({ 14203 height: size, 14204 width: size, 14205 viewBox: `0 0 ${numCells} ${numCells}`, 14206 ref: forwardedRef, 14207 role: "img" 14208 }, otherProps), 14209 !!title2 && react_default.createElement("title", null, title2), 14210 react_default.createElement( 14211 "path", 14212 { 14213 fill: bgColor, 14214 d: `M0,0 h${numCells}v${numCells}H0z`, 14215 shapeRendering: "crispEdges" 14216 } 14217 ), 14218 react_default.createElement("path", { fill: fgColor, d: fgPath, shapeRendering: "crispEdges" }), 14219 image 14220 ); 14221 } 14222); 14223QRCodeSVG.displayName = "QRCodeSVG"; 14224
vendor: 13,376 bytes, lines 14225-14540
14225// src/manager/components/preview/tools/share.tsx 14226var mapper3 = ({ api, state }) => { 14227 let { storyId, refId } = state; 14228 return { api, refId, storyId }; 14229}, QRContainer = styled.div( 14230 () => ({ 14231 display: "flex", 14232 flexDirection: "column", 14233 padding: 8, 14234 width: 300, 14235 maxWidth: 300, 14236 gap: 8 14237 }) 14238), QRRow = styled.div(() => ({ 14239 display: "flex", 14240 alignItems: "center" 14241})), ShareLinkInput = styled.input(({ theme }) => ({ 14242 width: "100%", 14243 border: `1px solid ${theme.appBorderColor}`, 14244 borderRadius: 4, 14245 padding: "6px 8px", 14246 fontSize: theme.typography.size.s1, 14247 color: theme.color.defaultText, 14248 backgroundColor: theme.background.app, 14249 outline: "none", 14250 textOverflow: "ellipsis", 14251 overflow: "hidden", 14252 whiteSpace: "nowrap", 14253 "&:focus": { 14254 borderColor: theme.color.secondary 14255 } 14256})), QRImageContainer = styled.div(() => ({ 14257 width: 64, 14258 height: 64, 14259 marginRight: 12, 14260 backgroundColor: "white", 14261 padding: 2 14262})); 14263var QRContent = styled.div(() => ({})), QRTitle = styled.div(({ theme }) => ({ 14264 fontWeight: theme.typography.weight.bold, 14265 fontSize: theme.typography.size.s1, 14266 marginBottom: 4 14267})), QRDescription = styled.div(({ theme }) => ({ 14268 fontSize: theme.typography.size.s1, 14269 color: theme.textMutedColor 14270})), isolationModeTool = { 14271 title: "isolation mode", 14272 id: "isolationMode", 14273 type: types.TOOLEXTRA, 14274 match: ({ viewMode, tabId }) => viewMode === "story" && !tabId, 14275 render: () => react_default.createElement(Consumer, { filter: mapper3 }, ({ api, storyId, refId }) => storyId ? react_default.createElement( 14276 Button, 14277 { 14278 padding: "small", 14279 variant: "ghost", 14280 ariaLabel: "Open in isolation mode", 14281 tooltip: "Open in isolation mode", 14282 onClick: () => { 14283 let originHrefs = api.getStoryHrefs(storyId, { 14284 base: "origin", 14285 refId, 14286 inheritArgs: !0 14287 }); 14288 window.open(originHrefs.previewHref, "_blank", "noopener,noreferrer"), api.emit(SHARE_ISOLATE_MODE, originHrefs.previewHref); 14289 } 14290 }, 14291 react_default.createElement(PopOutIcon, null) 14292 ) : null) 14293}; 14294 14295// src/manager/container/Preview.tsx 14296var defaultTabs = [createCanvasTab()], defaultTools = [menuTool, remountTool], defaultToolsExtra = [ 14297 isolationModeTool, 14298 zoomTool, 14299 addonsTool, 14300 fullScreenTool, 14301 openInEditorTool 14302], emptyTabsList = [], memoizedTabs = (0, import_memoizerific2.default)(1)( 14303 (_2, tabElements, parameters, showTabs) => showTabs ? filterTabs([...defaultTabs, ...Object.values(tabElements)], parameters) : emptyTabsList 14304), memoizedTools = (0, import_memoizerific2.default)(1)( 14305 (_2, toolElements, filterProps) => filterToolsSide([...defaultTools, ...Object.values(toolElements)], ...filterProps) 14306), memoizedExtra = (0, import_memoizerific2.default)(1)( 14307 (_2, extraElements, filterProps) => filterToolsSide([...defaultToolsExtra, ...Object.values(extraElements)], ...filterProps) 14308), memoizedWrapper = (0, import_memoizerific2.default)(1)((_2, previewElements) => [ 14309 ...defaultWrappers, 14310 ...Object.values(previewElements) 14311]), { PREVIEW_URL } = scope, splitTitleAddExtraSpace = (input) => input.split("/").join(" / ").replace(/\s\s/, " "), getDescription = (item) => { 14312 if (item?.type === "story" || item?.type === "docs") { 14313 let { title: title2, name } = item; 14314 return title2 && name ? splitTitleAddExtraSpace(`${title2} - ${name} \u22C5 Storybook`) : "Storybook"; 14315 } 14316 return item?.name ? `${item.name} \u22C5 Storybook` : "Storybook"; 14317}, mapper4 = ({ 14318 api, 14319 state 14320 // @ts-expect-error (non strict) 14321}) => { 14322 let { layout, location: location2, customQueryParams, storyId, refs, viewMode, path, refId } = state, entry = api.getData(storyId, refId), tabsList = Object.values(api.getElements(Addon_TypesEnum.TAB)), wrapperList = Object.values(api.getElements(Addon_TypesEnum.PREVIEW)), toolsList = Object.values(api.getElements(Addon_TypesEnum.TOOL)), toolsExtraList = Object.values(api.getElements(Addon_TypesEnum.TOOLEXTRA)), tabId = api.getQueryParam("tab"), tools = memoizedTools(toolsList.length, api.getElements(Addon_TypesEnum.TOOL), [ 14323 entry, 14324 viewMode, 14325 location2, 14326 path, 14327 // @ts-expect-error (non strict) 14328 tabId 14329 ]), toolsExtra = memoizedExtra( 14330 toolsExtraList.length, 14331 api.getElements(Addon_TypesEnum.TOOLEXTRA), 14332 // @ts-expect-error (non strict) 14333 [entry, viewMode, location2, path, tabId] 14334 ); 14335 return { 14336 api, 14337 entry, 14338 options: layout, 14339 description: getDescription(entry), 14340 viewMode, 14341 refs, 14342 storyId, 14343 baseUrl: PREVIEW_URL || "iframe.html", 14344 path, 14345 queryParams: customQueryParams, 14346 tools, 14347 toolsExtra, 14348 tabs: memoizedTabs( 14349 tabsList.length, 14350 api.getElements(Addon_TypesEnum.TAB), 14351 entry ? entry.parameters : void 0, 14352 layout.showTabs 14353 ), 14354 wrappers: memoizedWrapper( 14355 wrapperList.length, 14356 api.getElements(Addon_TypesEnum.PREVIEW) 14357 ), 14358 tabId 14359 }; 14360}, PreviewConnected = react_default.memo(function(props) { 14361 return react_default.createElement(Consumer, { filter: mapper4 }, (fromState) => react_default.createElement(Preview2, { ...props, ...fromState })); 14362}), Preview_default = PreviewConnected; 14363 14364// src/manager/container/Sidebar.tsx 14365init_react(); 14366 14367// src/manager/components/sidebar/Sidebar.tsx 14368init_react(); 14369 14370// src/manager/components/sidebar/ChecklistWidget.tsx 14371init_react(); 14372 14373// src/manager/components/Optional/Optional.tsx 14374init_react(); 14375var Wrapper3 = styled.div({ 14376 display: "inline-grid", 14377 gridTemplateColumns: "max-content", 14378 overflow: "hidden" 14379}), Content2 = styled.div(({ isHidden }) => ({ 14380 display: "inline-block", 14381 gridArea: "1/1", 14382 opacity: isHidden === null ? 0 : 1, 14383 visibility: isHidden ? "hidden" : "visible" 14384})), Optional = ({ 14385 content, 14386 fallback 14387}) => { 14388 let contentRef = useRef(null), wrapperRef = useRef(null), [hidden, setHidden] = useState(null), contentWidth = useRef(contentRef.current?.offsetWidth ?? 0), wrapperWidth = useRef(wrapperRef.current?.offsetWidth ?? 0); 14389 return useEffect(() => { 14390 if (contentRef.current && wrapperRef.current) { 14391 let resizeObserver = new ResizeObserver(() => { 14392 wrapperWidth.current = wrapperRef.current?.offsetWidth || wrapperWidth.current, contentWidth.current = contentRef.current?.offsetWidth || contentWidth.current, setHidden(contentWidth.current > wrapperWidth.current); 14393 }); 14394 return resizeObserver.observe(wrapperRef.current), () => resizeObserver.disconnect(); 14395 } 14396 }, []), react_default.createElement(Wrapper3, { ref: wrapperRef }, react_default.createElement(Content2, { isHidden: hidden, ref: contentRef }, content), fallback && react_default.createElement(Content2, { isHidden: !hidden }, fallback)); 14397}; 14398 14399// src/manager/components/Particles/Particles.tsx 14400init_react(); 14401var Shape = styled.svg(({ color: color2 }) => ({ 14402 fill: color2, 14403 position: "absolute", 14404 inset: "0", 14405 margin: "auto", 14406 width: "12px", 14407 height: "12px", 14408 pointerEvents: "none" 14409})), Donut = (props) => react_default.createElement(Shape, { viewBox: "0 0 90 90", xmlns: "http://www.w3.org/2000/svg", color: "red", ...props }, react_default.createElement("path", { d: "M45 0c24.853 0 45 20.147 45 45S69.853 90 45 90 0 69.853 0 45 20.147 0 45 0zm.5 27C35.283 27 27 35.283 27 45.5S35.283 64 45.5 64 64 55.717 64 45.5 55.717 27 45.5 27z" })), L2 = (props) => react_default.createElement(Shape, { viewBox: "0 0 55 89", xmlns: "http://www.w3.org/2000/svg", color: "#66BF3C", ...props }, react_default.createElement("path", { d: "M55 3v83a3 3 0 01-3 3H3a3 3 0 01-3-3V64a3 3 0 013-3h21a3 3 0 003-3V3a3 3 0 013-3h22a3 3 0 013 3z" })), Slice = (props) => react_default.createElement(Shape, { viewBox: "0 0 92 92", xmlns: "http://www.w3.org/2000/svg", color: "#FF4785", ...props }, react_default.createElement("path", { d: "M92 89V3c0-3-2.056-3-3-3C39.294 0 0 39.294 0 89c0 0 0 3 3 3h86a3 3 0 003-3z" })), Square = ({ style, ...props }) => react_default.createElement( 14410 Shape, 14411 { 14412 viewBox: "0 0 90 90", 14413 xmlns: "http://www.w3.org/2000/svg", 14414 color: "#1EA7FD", 14415 ...props, 14416 style: { borderRadius: 5, ...style } 14417 }, 14418 react_default.createElement("path", { d: "M0 0h90v90H0z" }) 14419), Triangle = (props) => react_default.createElement(Shape, { viewBox: "0 0 96 88", xmlns: "http://www.w3.org/2000/svg", color: "#FFAE00", ...props }, react_default.createElement("path", { d: "M50.63 1.785l44.928 81.77A3 3 0 0192.928 88H3.072a3 3 0 01-2.629-4.445l44.929-81.77a3 3 0 015.258 0z" })), T2 = (props) => react_default.createElement(Shape, { viewBox: "0 0 92 62", xmlns: "http://www.w3.org/2000/svg", color: "#FC521F", ...props }, react_default.createElement("path", { d: "M63 3v25a3 3 0 003 3h23a3 3 0 013 3v25a3 3 0 01-3 3H3a3 3 0 01-3-3V34a3 3 0 013-3h24a3 3 0 003-3V3a3 3 0 013-3h27a3 3 0 013 3z" })), Z = (props) => react_default.createElement(Shape, { viewBox: "0 0 56 90", xmlns: "http://www.w3.org/2000/svg", color: "#6F2CAC", ...props }, react_default.createElement("path", { d: "M28 3v25a3 3 0 003 3h22a3 3 0 013 3v53a3 3 0 01-3 3H31a3 3 0 01-3-3V62a3 3 0 00-3-3H3a3 3 0 01-3-3V3a3 3 0 013-3h22a3 3 0 013 3z" })), fadeToTransparent = keyframes` 14420 to { 14421 opacity: 0; 14422 } 14423`, disperse = keyframes` 14424 to { 14425 transform: translate( 14426 calc(cos(var(--angle)) * var(--distance)), 14427 calc(sin(var(--angle)) * var(--distance)) 14428 ) rotate(var(--rotation)); 14429 } 14430`, slideDown = keyframes` 14431 to { 14432 transform: translateY(50px); 14433 } 14434`, Container8 = styled.div({ 14435 position: "absolute", 14436 display: "flex", 14437 flexDirection: "row", 14438 flexWrap: "wrap", 14439 gap: 10, 14440 "--particle-curve": "cubic-bezier(0.2, 0.56, 0, 1)", 14441 animation: `${slideDown} 1000ms forwards cubic-bezier(0.587, -0.381, 0.583, 0.599)`, 14442 animationDelay: "150ms", 14443 zIndex: 999, 14444 svg: { 14445 width: 15, 14446 height: 15, 14447 animation: `${fadeToTransparent} var(--fade-duration) forwards, ${disperse} 1000ms forwards var(--particle-curve)` 14448 } 14449}), FADE_DURATION = 1200, NUM_OF_PARTICLES = 8, JITTER = 15, random = (min, max) => Math.random() * (max - min) + min, sortRandomly = (array) => array.sort(() => Math.random() - 0.5), Particles = memo(function({ 14450 anchor: Anchor 14451}) { 14452 let anchorRef = useRef(null), [left, setLeft] = useState(0), [top, setTop] = useState(0), shapes = sortRandomly([Donut, L2, Slice, Square, Triangle, T2, Z]), colors = sortRandomly([ 14453 "#FF0000", 14454 "#FF4787", 14455 "#66BF3C", 14456 "#1EA7FD", 14457 "#FC521F", 14458 "#6F2CAC", 14459 "#FFAE00" 14460 ]); 14461 return useLayoutEffect(() => { 14462 let rect = anchorRef.current?.getBoundingClientRect(); 14463 rect && (setLeft(rect.left + rect.width / 2), setTop(rect.top + rect.height / 2)); 14464 }, []), react_default.createElement("div", { ref: anchorRef }, react_default.createElement(Anchor, null), createPortal( 14465 react_default.createElement(Container8, { style: { top: top + "px", left: left + "px" } }, shapes.map((Particle, index) => { 14466 let angle = 360 / NUM_OF_PARTICLES * index + random(-JITTER, JITTER), distance = random(50, 80), rotation = random(-360, 360), style = { 14467 "--angle": angle + "deg", 14468 "--distance": distance + "px", 14469 "--rotation": rotation + "deg", 14470 "--fade-duration": FADE_DURATION + "ms" 14471 }; 14472 return react_default.createElement(Particle, { key: Particle.name, style, color: colors[index] }); 14473 })), 14474 document.getElementById("root") ?? document.body 14475 )); 14476}); 14477 14478// src/manager/components/TextFlip.tsx 14479init_react(); 14480var slideIn2 = keyframes({ 14481 from: { 14482 transform: "translateY(var(--slide-in-from))", 14483 opacity: 0 14484 } 14485}), slideOut = keyframes({ 14486 to: { 14487 transform: "translateY(var(--slide-out-to))", 14488 opacity: 0 14489 } 14490}), Container9 = styled.div({ 14491 display: "inline-grid", 14492 gridTemplateColumns: "1fr", 14493 justifyContent: "center", 14494 alignItems: "center" 14495}), Placeholder2 = styled.div({ 14496 gridArea: "1 / 1", 14497 userSelect: "none", 14498 visibility: "hidden" 14499}), Text2 = styled.span(({ duration, isExiting, isEntering, reverse }) => { 14500 let animation; 14501 return isExiting ? animation = `${slideOut} ${duration}ms forwards` : isEntering && (animation = `${slideIn2} ${duration}ms forwards`), { 14502 gridArea: "1 / 1", 14503 animation, 14504 pointerEvents: isExiting ? "none" : "auto", 14505 userSelect: isExiting ? "none" : "text", 14506 "--slide-in-from": reverse ? "-100%" : "100%", 14507 "--slide-out-to": reverse ? "100%" : "-100%", 14508 "@media (prefers-reduced-motion: reduce)": { 14509 animation: "none", 14510 opacity: isExiting ? 0 : 1, 14511 transform: "translateY(0)" 14512 } 14513 }; 14514}), TextFlip = ({ 14515 text, 14516 duration = 250, 14517 placeholder, 14518 ...props 14519}) => { 14520 let textRef = useRef(text), [staleValue, setStaleValue] = useState(text), isAnimating = text !== staleValue, reverse = isAnimating && numericCompare(staleValue, text); 14521 return textRef.current = text, react_default.createElement(Container9, { ...props }, isAnimating && react_default.createElement( 14522 Text2, 14523 { 14524 "aria-hidden": !0, 14525 duration, 14526 reverse, 14527 isExiting: !0, 14528 onAnimationEnd: () => setStaleValue(textRef.current) 14529 }, 14530 staleValue 14531 ), react_default.createElement(Text2, { duration, reverse, isEntering: isAnimating }, text), placeholder && react_default.createElement(Placeholder2, { "aria-hidden": !0 }, placeholder)); 14532}; 14533function numericCompare(a2, b2) { 14534 let na = Number(a2), nb = Number(b2); 14535 return Number.isNaN(na) || Number.isNaN(nb) ? a2.localeCompare(b2, void 0, { numeric: !0 }) > 0 : na > nb; 14536} 14537 14538// src/manager/components/sidebar/useChecklist.ts 14539init_react(); 14540
vendor: 1,238 bytes, lines 14541-14566
14541// ../../node_modules/es-toolkit/dist/function/debounce.mjs 14542function debounce(func, debounceMs, { signal, edges } = {}) { 14543 let pendingThis, pendingArgs = null, leading = edges != null && edges.includes("leading"), trailing = edges == null || edges.includes("trailing"), invoke = () => { 14544 pendingArgs !== null && (func.apply(pendingThis, pendingArgs), pendingThis = void 0, pendingArgs = null); 14545 }, onTimerEnd = () => { 14546 trailing && invoke(), cancel(); 14547 }, timeoutId = null, schedule = () => { 14548 timeoutId != null && clearTimeout(timeoutId), timeoutId = setTimeout(() => { 14549 timeoutId = null, onTimerEnd(); 14550 }, debounceMs); 14551 }, cancelTimer = () => { 14552 timeoutId !== null && (clearTimeout(timeoutId), timeoutId = null); 14553 }, cancel = () => { 14554 cancelTimer(), pendingThis = void 0, pendingArgs = null; 14555 }, flush = () => { 14556 invoke(); 14557 }, debounced = function(...args) { 14558 if (signal?.aborted) 14559 return; 14560 pendingThis = this, pendingArgs = args; 14561 let isFirstCall = timeoutId == null; 14562 schedule(), leading && isFirstCall && invoke(); 14563 }; 14564 return debounced.schedule = schedule, debounced.cancel = cancel, debounced.flush = flush, signal?.addEventListener("abort", cancel, { once: !0 }), debounced; 14565} 14566
vendor: 751 bytes, lines 14567-14580
14567// ../../node_modules/es-toolkit/dist/function/partial.mjs 14568function partial(func, ...partialArgs) { 14569 return partialImpl(func, placeholderSymbol, ...partialArgs); 14570} 14571function partialImpl(func, placeholder, ...partialArgs) { 14572 let partialed = function(...providedArgs) { 14573 let providedArgsIndex = 0, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg), remainingArgs = providedArgs.slice(providedArgsIndex); 14574 return func.apply(this, substitutedArgs.concat(remainingArgs)); 14575 }; 14576 return func.prototype && (partialed.prototype = Object.create(func.prototype)), partialed; 14577} 14578var placeholderSymbol = /* @__PURE__ */ Symbol("partial.placeholder"); 14579partial.placeholder = placeholderSymbol; 14580
vendor: 951 bytes, lines 14581-14594
14581// ../../node_modules/es-toolkit/dist/function/partialRight.mjs 14582function partialRight(func, ...partialArgs) { 14583 return partialRightImpl(func, placeholderSymbol2, ...partialArgs); 14584} 14585function partialRightImpl(func, placeholder, ...partialArgs) { 14586 let partialedRight = function(...providedArgs) { 14587 let placeholderLength = partialArgs.filter((arg) => arg === placeholder).length, rangeLength = Math.max(providedArgs.length - placeholderLength, 0), remainingArgs = providedArgs.slice(0, rangeLength), providedArgsIndex = rangeLength, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg); 14588 return func.apply(this, remainingArgs.concat(substitutedArgs)); 14589 }; 14590 return func.prototype && (partialedRight.prototype = Object.create(func.prototype)), partialedRight; 14591} 14592var placeholderSymbol2 = /* @__PURE__ */ Symbol("partialRight.placeholder"); 14593partialRight.placeholder = placeholderSymbol2; 14594
vendor: 106 bytes, lines 14595-14597
14595// ../../node_modules/es-toolkit/dist/function/retry.mjs 14596var DEFAULT_RETRIES = Number.POSITIVE_INFINITY; 14597
vendor: 678 bytes, lines 14598-14611
14598// ../../node_modules/es-toolkit/dist/function/throttle.mjs 14599function throttle(func, throttleMs, { signal, edges = ["leading", "trailing"] } = {}) { 14600 let pendingAt = null, debounced = debounce(function(...args) { 14601 pendingAt = Date.now(), func.apply(this, args); 14602 }, throttleMs, { signal, edges }), throttled = function(...args) { 14603 if (pendingAt == null && (pendingAt = Date.now()), Date.now() - pendingAt >= throttleMs) { 14604 pendingAt = Date.now(), func.apply(this, args), debounced.cancel(), debounced.schedule(); 14605 return; 14606 } 14607 debounced.apply(this, args); 14608 }; 14609 return throttled.cancel = debounced.cancel, throttled.flush = debounced.flush, throttled; 14610} 14611
vendor: 2,356 bytes, lines 14612-14671
14612// src/shared/checklist-store/checklistData.tsx 14613init_react(); 14614 14615// ../addons/a11y/src/constants.ts 14616var ADDON_ID2 = "storybook/a11y", PANEL_ID2 = `${ADDON_ID2}/panel`; 14617var UI_STATE_ID = `${ADDON_ID2}/ui`, RESULT = `${ADDON_ID2}/result`, REQUEST = `${ADDON_ID2}/request`, RUNNING = `${ADDON_ID2}/running`, ERROR = `${ADDON_ID2}/error`, MANUAL = `${ADDON_ID2}/manual`, SELECT = `${ADDON_ID2}/select`, DOCUMENTATION_LINK = "writing-tests/accessibility-testing", DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#why-are-my-tests-failing-in-different-environments`; 14618 14619// ../addons/onboarding/src/constants.ts 14620var ADDON_ID3 = "storybook/onboarding", ADDON_ONBOARDING_CHANNEL = `${ADDON_ID3}/channel`; 14621 14622// src/component-testing/constants.ts 14623var ADDON_ID4 = "storybook/interactions", PANEL_ID3 = `${ADDON_ID4}/panel`; 14624var DOCUMENTATION_LINK2 = "writing-tests/integrations/vitest-addon", DOCUMENTATION_DISCREPANCY_LINK2 = `${DOCUMENTATION_LINK2}#what-happens-when-there-are-different-test-results-in-multiple-environments`; 14625 14626// ../addons/vitest/src/constants.ts 14627var ADDON_ID5 = "storybook/test", TEST_PROVIDER_ID = `${ADDON_ID5}/test-provider`, STORYBOOK_ADDON_TEST_CHANNEL = `${ADDON_ID5}/channel`; 14628var DOCUMENTATION_LINK3 = "writing-tests/integrations/vitest-addon", DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK3}#what-happens-if-vitest-itself-has-an-error`; 14629var storeOptions = { 14630 id: ADDON_ID5, 14631 initialState: { 14632 config: { 14633 coverage: !1, 14634 a11y: !1 14635 }, 14636 watching: !1, 14637 cancelling: !1, 14638 fatalError: void 0, 14639 index: { entries: {}, v: 5 }, 14640 previewAnnotations: [], 14641 currentRun: { 14642 triggeredBy: void 0, 14643 config: { 14644 coverage: !1, 14645 a11y: !1 14646 }, 14647 componentTestStatuses: [], 14648 a11yStatuses: [], 14649 a11yReports: {}, 14650 reports: {}, 14651 componentTestCount: { 14652 success: 0, 14653 error: 0 14654 }, 14655 a11yCount: { 14656 success: 0, 14657 warning: 0, 14658 error: 0 14659 }, 14660 storyIds: void 0, 14661 totalTestCount: void 0, 14662 startedAt: void 0, 14663 finishedAt: void 0, 14664 unhandledErrors: [], 14665 coverageSummary: void 0 14666 } 14667 } 14668}; 14669var STORE_CHANNEL_EVENT_NAME = `UNIVERSAL_STORE:${storeOptions.id}`; 14670var TRIGGER_TEST_RUN_REQUEST = `${ADDON_ID5}/trigger-test-run-request`, TRIGGER_TEST_RUN_RESPONSE = `${ADDON_ID5}/trigger-test-run-response`; 14671
vendor: 91 bytes, lines 14672-14674
14672// src/server-errors.ts 14673var import_picocolors = __toESM(require_picocolors_browser(), 1); 14674
vendor: 1,046 bytes, lines 14675-14695
14675// src/shared/status-store/index.ts 14676var STATUS_VALUE_PREFIX = "status-value:"; 14677var statusValueShortName = (value) => value === "status-value:affected" ? "related" : value.slice(STATUS_VALUE_PREFIX.length), statusValueDescription = (value) => ({ 14678 "status-value:pending": "Stories with pending status", 14679 "status-value:success": "Stories with passing tests", 14680 "status-value:new": "Newly added stories", 14681 "status-value:modified": "Stories closely linked to code changes", 14682 "status-value:affected": "Stories likely to be affected by code changes", 14683 "status-value:reviewing": "Stories included in the active review", 14684 "status-value:warning": "Stories with warnings", 14685 "status-value:error": "Stories with failing tests", 14686 "status-value:unknown": "Stories with unknown status" 14687})[value]; 14688function countStatusesByValue(allStatuses) { 14689 let counts = {}; 14690 for (let statusByTypeId of Object.values(allStatuses)) 14691 for (let status of Object.values(statusByTypeId)) 14692 counts[status.value] = (counts[status.value] ?? 0) + 1; 14693 return counts; 14694} 14695
vendor: 513 bytes, lines 14696-14711
14696// src/cli/AddonVitestService.constants.ts 14697var SUPPORTED_FRAMEWORKS = [ 14698 "angular-vite" /* ANGULAR_VITE */, 14699 "html-vite" /* HTML_VITE */, 14700 "nextjs-vite" /* NEXTJS_VITE */, 14701 "preact-vite" /* PREACT_VITE */, 14702 "react-native-web-vite" /* REACT_NATIVE_WEB_VITE */, 14703 "react-vite" /* REACT_VITE */, 14704 "solid" /* SOLID */, 14705 "svelte-vite" /* SVELTE_VITE */, 14706 "sveltekit" /* SVELTEKIT */, 14707 "vue3-vite" /* VUE3_VITE */, 14708 "web-components-vite" /* WEB_COMPONENTS_VITE */, 14709 "tanstack-react" /* TANSTACK_REACT */ 14710]; 14711
vendor: 218 bytes, lines 14712-14718
14712// src/docs-tools/shared.ts 14713var ADDON_ID6 = "storybook/docs", PANEL_ID4 = `${ADDON_ID6}/panel`; 14714var SNIPPET_RENDERED = `${ADDON_ID6}/snippet-rendered`; 14715 14716// src/manager/components/TourGuide/TourGuide.tsx 14717init_react(); 14718
vendor: 66 bytes, lines 14719-14721
14719// ../../node_modules/react-joyride/dist/index.mjs 14720init_react(); 14721
vendor: 2,897 bytes, lines 14722-14799
14722// ../../node_modules/@gilbarbara/deep-equal/dist/index.mjs 14723function isOfType(type) { 14724 return (value) => typeof value === type; 14725} 14726var isFunction2 = isOfType("function"), isNull2 = (value) => value === null, isRegex = (value) => Object.prototype.toString.call(value).slice(8, -1) === "RegExp", isObject = (value) => !isUndefined2(value) && !isNull2(value) && (isFunction2(value) || typeof value == "object"), isUndefined2 = isOfType("undefined"); 14727function equalArray(left, right) { 14728 let { length } = left; 14729 if (length !== right.length) 14730 return !1; 14731 for (let index = length; index-- !== 0; ) 14732 if (!equal(left[index], right[index])) 14733 return !1; 14734 return !0; 14735} 14736function equalArrayBuffer(left, right) { 14737 if (left.byteLength !== right.byteLength) 14738 return !1; 14739 let view1 = new DataView(left.buffer), view2 = new DataView(right.buffer), index = left.byteLength; 14740 for (; index--; ) 14741 if (view1.getUint8(index) !== view2.getUint8(index)) 14742 return !1; 14743 return !0; 14744} 14745function equalMap(left, right) { 14746 if (left.size !== right.size) 14747 return !1; 14748 for (let index of left.entries()) 14749 if (!right.has(index[0])) 14750 return !1; 14751 for (let index of left.entries()) 14752 if (!equal(index[1], right.get(index[0]))) 14753 return !1; 14754 return !0; 14755} 14756function equalSet(left, right) { 14757 if (left.size !== right.size) 14758 return !1; 14759 for (let index of left.entries()) 14760 if (!right.has(index[0])) 14761 return !1; 14762 return !0; 14763} 14764function equal(left, right) { 14765 if (left === right) 14766 return !0; 14767 if (left && isObject(left) && right && isObject(right)) { 14768 if (left.constructor !== right.constructor) 14769 return !1; 14770 if (Array.isArray(left) && Array.isArray(right)) 14771 return equalArray(left, right); 14772 if (left instanceof Map && right instanceof Map) 14773 return equalMap(left, right); 14774 if (left instanceof Set && right instanceof Set) 14775 return equalSet(left, right); 14776 if (ArrayBuffer.isView(left) && ArrayBuffer.isView(right)) 14777 return equalArrayBuffer(left, right); 14778 if (isRegex(left) && isRegex(right)) 14779 return left.source === right.source && left.flags === right.flags; 14780 if (left.valueOf !== Object.prototype.valueOf) 14781 return left.valueOf() === right.valueOf(); 14782 if (left.toString !== Object.prototype.toString) 14783 return left.toString() === right.toString(); 14784 let leftKeys = Object.keys(left), rightKeys = Object.keys(right); 14785 if (leftKeys.length !== rightKeys.length) 14786 return !1; 14787 for (let index = leftKeys.length; index-- !== 0; ) 14788 if (!Object.prototype.hasOwnProperty.call(right, leftKeys[index])) 14789 return !1; 14790 for (let index = leftKeys.length; index-- !== 0; ) { 14791 let key = leftKeys[index]; 14792 if (!(key === "_owner" && left.$$typeof) && !equal(left[key], right[key])) 14793 return !1; 14794 } 14795 return !0; 14796 } 14797 return Number.isNaN(left) && Number.isNaN(right) ? !0 : left === right; 14798} 14799
vendor: 4,371 bytes, lines 14800-14927
14800// ../../node_modules/is-lite/dist/index.mjs 14801var objectTypes = [ 14802 "Array", 14803 "ArrayBuffer", 14804 "AsyncFunction", 14805 "AsyncGenerator", 14806 "AsyncGeneratorFunction", 14807 "Date", 14808 "Error", 14809 "Function", 14810 "Generator", 14811 "GeneratorFunction", 14812 "HTMLElement", 14813 "Map", 14814 "Object", 14815 "Promise", 14816 "RegExp", 14817 "Set", 14818 "WeakMap", 14819 "WeakSet" 14820], primitiveTypes = [ 14821 "bigint", 14822 "boolean", 14823 "null", 14824 "number", 14825 "string", 14826 "symbol", 14827 "undefined" 14828]; 14829function getObjectType(value) { 14830 let objectTypeName = Object.prototype.toString.call(value).slice(8, -1); 14831 if (/HTML\w+Element/.test(objectTypeName)) 14832 return "HTMLElement"; 14833 if (isObjectType(objectTypeName)) 14834 return objectTypeName; 14835} 14836function isObjectOfType(type) { 14837 return (value) => getObjectType(value) === type; 14838} 14839function isObjectType(name) { 14840 return objectTypes.includes(name); 14841} 14842function isOfType2(type) { 14843 return (value) => typeof value === type; 14844} 14845function isPrimitiveType(name) { 14846 return primitiveTypes.includes(name); 14847} 14848var DOM_PROPERTIES_TO_CHECK = [ 14849 "innerHTML", 14850 "ownerDocument", 14851 "style", 14852 "attributes", 14853 "nodeValue" 14854]; 14855function is(value) { 14856 if (value === null) 14857 return "null"; 14858 switch (typeof value) { 14859 case "bigint": 14860 return "bigint"; 14861 case "boolean": 14862 return "boolean"; 14863 case "number": 14864 return "number"; 14865 case "string": 14866 return "string"; 14867 case "symbol": 14868 return "symbol"; 14869 case "undefined": 14870 return "undefined"; 14871 default: 14872 } 14873 if (is.array(value)) 14874 return "Array"; 14875 if (is.plainFunction(value)) 14876 return "Function"; 14877 let tagType = getObjectType(value); 14878 return tagType || "Object"; 14879} 14880is.array = Array.isArray; 14881is.arrayOf = (target, predicate) => !is.array(target) && !is.function(predicate) ? !1 : target.every((d2) => predicate(d2)); 14882is.asyncGeneratorFunction = (value) => getObjectType(value) === "AsyncGeneratorFunction"; 14883is.asyncFunction = isObjectOfType("AsyncFunction"); 14884is.bigint = isOfType2("bigint"); 14885is.boolean = (value) => value === !0 || value === !1; 14886is.date = isObjectOfType("Date"); 14887is.defined = (value) => !is.undefined(value); 14888is.domElement = (value) => is.object(value) && !is.plainObject(value) && value.nodeType === 1 && is.string(value.nodeName) && DOM_PROPERTIES_TO_CHECK.every((property) => property in value); 14889is.empty = (value) => is.string(value) && value.length === 0 || is.array(value) && value.length === 0 || is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0 || is.set(value) && value.size === 0 || is.map(value) && value.size === 0; 14890is.error = isObjectOfType("Error"); 14891is.function = isOfType2("function"); 14892is.generator = (value) => is.iterable(value) && is.function(value.next) && is.function(value.throw); 14893is.generatorFunction = isObjectOfType("GeneratorFunction"); 14894is.instanceOf = (instance, class_) => !instance || !class_ ? !1 : Object.getPrototypeOf(instance) === class_.prototype; 14895is.iterable = (value) => !is.nullOrUndefined(value) && is.function(value[Symbol.iterator]); 14896is.map = isObjectOfType("Map"); 14897is.nan = (value) => Number.isNaN(value); 14898is.null = (value) => value === null; 14899is.nullOrUndefined = (value) => is.null(value) || is.undefined(value); 14900is.number = (value) => isOfType2("number")(value) && !is.nan(value); 14901is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value)); 14902is.object = (value) => !is.nullOrUndefined(value) && (is.function(value) || typeof value == "object"); 14903is.oneOf = (target, value) => is.array(target) ? target.indexOf(value) > -1 : !1; 14904is.plainFunction = isObjectOfType("Function"); 14905is.plainObject = (value) => { 14906 if (getObjectType(value) !== "Object") 14907 return !1; 14908 let prototype = Object.getPrototypeOf(value); 14909 return prototype === null || prototype === Object.getPrototypeOf({}); 14910}; 14911is.primitive = (value) => is.null(value) || isPrimitiveType(typeof value); 14912is.promise = isObjectOfType("Promise"); 14913is.propertyOf = (target, key, predicate) => { 14914 if (!is.object(target) || !key) 14915 return !1; 14916 let value = target[key]; 14917 return is.function(predicate) ? predicate(value) : is.defined(value); 14918}; 14919is.regexp = isObjectOfType("RegExp"); 14920is.set = isObjectOfType("Set"); 14921is.string = isOfType2("string"); 14922is.symbol = isOfType2("symbol"); 14923is.undefined = isOfType2("undefined"); 14924is.weakMap = isObjectOfType("WeakMap"); 14925is.weakSet = isObjectOfType("WeakSet"); 14926var src_default = is; 14927
vendor: 6,261 bytes, lines 14928-15049
14928// ../../node_modules/react-joyride/node_modules/tree-changes/dist/index.mjs 14929function canHaveLength(...arguments_) { 14930 return arguments_.every((d2) => src_default.string(d2) || src_default.array(d2) || src_default.plainObject(d2)); 14931} 14932function checkEquality(left, right, value) { 14933 return isSameType(left, right) ? [left, right].every(src_default.array) ? !left.some(hasValue(value)) && right.some(hasValue(value)) : [left, right].every(src_default.plainObject) ? !Object.entries(left).some(hasEntry(value)) && Object.entries(right).some(hasEntry(value)) : right === value : !1; 14934} 14935function compareNumbers(previousData, data, options2) { 14936 let { actual, key, previous, type } = options2, left = nested(previousData, key), right = nested(data, key), changed = [left, right].every(src_default.number) && (type === "increased" ? left < right : left > right); 14937 return src_default.undefined(actual) || (changed = changed && right === actual), src_default.undefined(previous) || (changed = changed && left === previous), changed; 14938} 14939function compareValues(previousData, data, options2) { 14940 let { key, type, value } = options2, left = nested(previousData, key), right = nested(data, key), primary = type === "added" ? left : right, secondary = type === "added" ? right : left; 14941 if (!src_default.nullOrUndefined(value)) { 14942 if (src_default.defined(primary)) { 14943 if (src_default.array(primary) || src_default.plainObject(primary)) 14944 return checkEquality(primary, secondary, value); 14945 } else 14946 return equal(secondary, value); 14947 return !1; 14948 } 14949 return [left, right].every(src_default.array) ? !secondary.every(isEqualPredicate(primary)) : [left, right].every(src_default.plainObject) ? hasExtraKeys(Object.keys(primary), Object.keys(secondary)) : ![left, right].every((d2) => src_default.primitive(d2) && src_default.defined(d2)) && (type === "added" ? !src_default.defined(left) && src_default.defined(right) : src_default.defined(left) && !src_default.defined(right)); 14950} 14951function getIterables(previousData, data, { key } = {}) { 14952 let left = nested(previousData, key), right = nested(data, key); 14953 if (!isSameType(left, right)) 14954 throw new TypeError("Inputs have different types"); 14955 if (!canHaveLength(left, right)) 14956 throw new TypeError("Inputs don't have length"); 14957 return [left, right].every(src_default.plainObject) && (left = Object.keys(left), right = Object.keys(right)), [left, right]; 14958} 14959function hasEntry(input) { 14960 return ([key, value]) => src_default.array(input) ? equal(input, value) || input.some((d2) => equal(d2, value) || src_default.array(value) && isEqualPredicate(value)(d2)) : src_default.plainObject(input) && input[key] ? !!input[key] && equal(input[key], value) : equal(input, value); 14961} 14962function hasExtraKeys(left, right) { 14963 return right.some((d2) => !left.includes(d2)); 14964} 14965function hasValue(input) { 14966 return (value) => src_default.array(input) ? input.some((d2) => equal(d2, value) || src_default.array(value) && isEqualPredicate(value)(d2)) : equal(input, value); 14967} 14968function includesOrEqualsTo(previousValue, value) { 14969 return src_default.array(previousValue) ? previousValue.some((d2) => equal(d2, value)) : equal(previousValue, value); 14970} 14971function isEqualPredicate(data) { 14972 return (value) => data.some((d2) => equal(d2, value)); 14973} 14974function isSameType(...arguments_) { 14975 return arguments_.every(src_default.array) || arguments_.every(src_default.number) || arguments_.every(src_default.plainObject) || arguments_.every(src_default.string); 14976} 14977function nested(data, property) { 14978 return src_default.plainObject(data) || src_default.array(data) ? src_default.string(property) ? property.split(".").reduce((acc, d2) => acc && acc[d2], data) : src_default.number(property) ? data[property] : data : data; 14979} 14980function treeChanges(previousData, data) { 14981 if ([previousData, data].some(src_default.nullOrUndefined)) 14982 throw new Error("Missing required parameters"); 14983 if (![previousData, data].every((d2) => src_default.plainObject(d2) || src_default.array(d2))) 14984 throw new Error("Expected plain objects or array"); 14985 return { added: (key, value) => { 14986 try { 14987 return compareValues(previousData, data, { key, type: "added", value }); 14988 } catch { 14989 return !1; 14990 } 14991 }, changed: (key, actual, previous) => { 14992 try { 14993 let left = nested(previousData, key), right = nested(data, key), hasActual = src_default.defined(actual), hasPrevious = src_default.defined(previous); 14994 if (hasActual || hasPrevious) { 14995 let leftComparator = hasPrevious ? includesOrEqualsTo(previous, left) : !includesOrEqualsTo(actual, left), rightComparator = includesOrEqualsTo(actual, right); 14996 return leftComparator && rightComparator; 14997 } 14998 return [left, right].every(src_default.array) || [left, right].every(src_default.plainObject) ? !equal(left, right) : left !== right; 14999 } catch { 15000 return !1; 15001 } 15002 }, changedFrom: (key, previous, actual) => { 15003 if (!src_default.defined(key)) 15004 return !1; 15005 try { 15006 let left = nested(previousData, key), right = nested(data, key), hasActual = src_default.defined(actual); 15007 return includesOrEqualsTo(previous, left) && (hasActual ? includesOrEqualsTo(actual, right) : !hasActual); 15008 } catch { 15009 return !1; 15010 } 15011 }, decreased: (key, actual, previous) => { 15012 if (!src_default.defined(key)) 15013 return !1; 15014 try { 15015 return compareNumbers(previousData, data, { key, actual, previous, type: "decreased" }); 15016 } catch { 15017 return !1; 15018 } 15019 }, emptied: (key) => { 15020 try { 15021 let [left, right] = getIterables(previousData, data, { key }); 15022 return !!left.length && !right.length; 15023 } catch { 15024 return !1; 15025 } 15026 }, filled: (key) => { 15027 try { 15028 let [left, right] = getIterables(previousData, data, { key }); 15029 return !left.length && !!right.length; 15030 } catch { 15031 return !1; 15032 } 15033 }, increased: (key, actual, previous) => { 15034 if (!src_default.defined(key)) 15035 return !1; 15036 try { 15037 return compareNumbers(previousData, data, { key, actual, previous, type: "increased" }); 15038 } catch { 15039 return !1; 15040 } 15041 }, removed: (key, value) => { 15042 try { 15043 return compareValues(previousData, data, { key, type: "removed", value }); 15044 } catch { 15045 return !1; 15046 } 15047 } }; 15048} 15049
vendor: 400 bytes, lines 15050-15060
15050// ../../node_modules/react-joyride/dist/index.mjs 15051var import_scroll = __toESM(require_scroll(), 1), import_scrollparent = __toESM(require_scrollparent(), 1); 15052init_react(); 15053var import_react_innertext = __toESM(require_react_innertext(), 1); 15054var import_deepmerge2 = __toESM(require_cjs(), 1); 15055var import_deepmerge3 = __toESM(require_cjs(), 1); 15056init_react(); 15057init_react(); 15058init_react(); 15059init_react(); 15060
vendor: 119 bytes, lines 15061-15064
15061// ../../node_modules/react-floater/es/index.js 15062init_react(); 15063var import_prop_types2 = __toESM(require_prop_types()); 15064
vendor: 54,955 bytes, lines 15065-16069
15065// ../../node_modules/popper.js/dist/esm/popper.js 15066var isBrowser2 = typeof window < "u" && typeof document < "u" && typeof navigator < "u", timeoutDuration = (function() { 15067 for (var longerTimeoutBrowsers = ["Edge", "Trident", "Firefox"], i2 = 0; i2 < longerTimeoutBrowsers.length; i2 += 1) 15068 if (isBrowser2 && navigator.userAgent.indexOf(longerTimeoutBrowsers[i2]) >= 0) 15069 return 1; 15070 return 0; 15071})(); 15072function microtaskDebounce(fn) { 15073 var called = !1; 15074 return function() { 15075 called || (called = !0, window.Promise.resolve().then(function() { 15076 called = !1, fn(); 15077 })); 15078 }; 15079} 15080function taskDebounce(fn) { 15081 var scheduled = !1; 15082 return function() { 15083 scheduled || (scheduled = !0, setTimeout(function() { 15084 scheduled = !1, fn(); 15085 }, timeoutDuration)); 15086 }; 15087} 15088var supportsMicroTasks = isBrowser2 && window.Promise, debounce2 = supportsMicroTasks ? microtaskDebounce : taskDebounce; 15089function isFunction3(functionToCheck) { 15090 var getType = {}; 15091 return functionToCheck && getType.toString.call(functionToCheck) === "[object Function]"; 15092} 15093function getStyleComputedProperty(element, property) { 15094 if (element.nodeType !== 1) 15095 return []; 15096 var window2 = element.ownerDocument.defaultView, css2 = window2.getComputedStyle(element, null); 15097 return property ? css2[property] : css2; 15098} 15099function getParentNode(element) { 15100 return element.nodeName === "HTML" ? element : element.parentNode || element.host; 15101} 15102function getScrollParent(element) { 15103 if (!element) 15104 return document.body; 15105 switch (element.nodeName) { 15106 case "HTML": 15107 case "BODY": 15108 return element.ownerDocument.body; 15109 case "#document": 15110 return element.body; 15111 } 15112 var _getStyleComputedProp = getStyleComputedProperty(element), overflow = _getStyleComputedProp.overflow, overflowX = _getStyleComputedProp.overflowX, overflowY = _getStyleComputedProp.overflowY; 15113 return /(auto|scroll|overlay)/.test(overflow + overflowY + overflowX) ? element : getScrollParent(getParentNode(element)); 15114} 15115function getReferenceNode(reference) { 15116 return reference && reference.referenceNode ? reference.referenceNode : reference; 15117} 15118var isIE11 = isBrowser2 && !!(window.MSInputMethodContext && document.documentMode), isIE10 = isBrowser2 && /MSIE 10/.test(navigator.userAgent); 15119function isIE(version3) { 15120 return version3 === 11 ? isIE11 : version3 === 10 ? isIE10 : isIE11 || isIE10; 15121} 15122function getOffsetParent(element) { 15123 if (!element) 15124 return document.documentElement; 15125 for (var noOffsetParent = isIE(10) ? document.body : null, offsetParent = element.offsetParent || null; offsetParent === noOffsetParent && element.nextElementSibling; ) 15126 offsetParent = (element = element.nextElementSibling).offsetParent; 15127 var nodeName = offsetParent && offsetParent.nodeName; 15128 return !nodeName || nodeName === "BODY" || nodeName === "HTML" ? element ? element.ownerDocument.documentElement : document.documentElement : ["TH", "TD", "TABLE"].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, "position") === "static" ? getOffsetParent(offsetParent) : offsetParent; 15129} 15130function isOffsetContainer(element) { 15131 var nodeName = element.nodeName; 15132 return nodeName === "BODY" ? !1 : nodeName === "HTML" || getOffsetParent(element.firstElementChild) === element; 15133} 15134function getRoot(node) { 15135 return node.parentNode !== null ? getRoot(node.parentNode) : node; 15136} 15137function findCommonOffsetParent(element1, element2) { 15138 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) 15139 return document.documentElement; 15140 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING, start = order ? element1 : element2, end = order ? element2 : element1, range = document.createRange(); 15141 range.setStart(start, 0), range.setEnd(end, 0); 15142 var commonAncestorContainer = range.commonAncestorContainer; 15143 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) 15144 return isOffsetContainer(commonAncestorContainer) ? commonAncestorContainer : getOffsetParent(commonAncestorContainer); 15145 var element1root = getRoot(element1); 15146 return element1root.host ? findCommonOffsetParent(element1root.host, element2) : findCommonOffsetParent(element1, getRoot(element2).host); 15147} 15148function getScroll(element) { 15149 var side = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "top", upperSide = side === "top" ? "scrollTop" : "scrollLeft", nodeName = element.nodeName; 15150 if (nodeName === "BODY" || nodeName === "HTML") { 15151 var html = element.ownerDocument.documentElement, scrollingElement = element.ownerDocument.scrollingElement || html; 15152 return scrollingElement[upperSide]; 15153 } 15154 return element[upperSide]; 15155} 15156function includeScroll(rect, element) { 15157 var subtract = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, scrollTop = getScroll(element, "top"), scrollLeft = getScroll(element, "left"), modifier = subtract ? -1 : 1; 15158 return rect.top += scrollTop * modifier, rect.bottom += scrollTop * modifier, rect.left += scrollLeft * modifier, rect.right += scrollLeft * modifier, rect; 15159} 15160function getBordersSize(styles2, axis) { 15161 var sideA = axis === "x" ? "Left" : "Top", sideB = sideA === "Left" ? "Right" : "Bottom"; 15162 return parseFloat(styles2["border" + sideA + "Width"]) + parseFloat(styles2["border" + sideB + "Width"]); 15163} 15164function getSize(axis, body, html, computedStyle) { 15165 return Math.max(body["offset" + axis], body["scroll" + axis], html["client" + axis], html["offset" + axis], html["scroll" + axis], isIE(10) ? parseInt(html["offset" + axis]) + parseInt(computedStyle["margin" + (axis === "Height" ? "Top" : "Left")]) + parseInt(computedStyle["margin" + (axis === "Height" ? "Bottom" : "Right")]) : 0); 15166} 15167function getWindowSizes(document11) { 15168 var body = document11.body, html = document11.documentElement, computedStyle = isIE(10) && getComputedStyle(html); 15169 return { 15170 height: getSize("Height", body, html, computedStyle), 15171 width: getSize("Width", body, html, computedStyle) 15172 }; 15173} 15174var classCallCheck = function(instance, Constructor) { 15175 if (!(instance instanceof Constructor)) 15176 throw new TypeError("Cannot call a class as a function"); 15177}, createClass = /* @__PURE__ */ (function() { 15178 function defineProperties(target, props) { 15179 for (var i2 = 0; i2 < props.length; i2++) { 15180 var descriptor = props[i2]; 15181 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 15182 } 15183 } 15184 return function(Constructor, protoProps, staticProps) { 15185 return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; 15186 }; 15187})(), defineProperty = function(obj, key, value) { 15188 return key in obj ? Object.defineProperty(obj, key, { 15189 value, 15190 enumerable: !0, 15191 configurable: !0, 15192 writable: !0 15193 }) : obj[key] = value, obj; 15194}, _extends2 = Object.assign || function(target) { 15195 for (var i2 = 1; i2 < arguments.length; i2++) { 15196 var source = arguments[i2]; 15197 for (var key in source) 15198 Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); 15199 } 15200 return target; 15201}; 15202function getClientRect(offsets) { 15203 return _extends2({}, offsets, { 15204 right: offsets.left + offsets.width, 15205 bottom: offsets.top + offsets.height 15206 }); 15207} 15208function getBoundingClientRect(element) { 15209 var rect = {}; 15210 try { 15211 if (isIE(10)) { 15212 rect = element.getBoundingClientRect(); 15213 var scrollTop = getScroll(element, "top"), scrollLeft = getScroll(element, "left"); 15214 rect.top += scrollTop, rect.left += scrollLeft, rect.bottom += scrollTop, rect.right += scrollLeft; 15215 } else 15216 rect = element.getBoundingClientRect(); 15217 } catch { 15218 } 15219 var result = { 15220 left: rect.left, 15221 top: rect.top, 15222 width: rect.right - rect.left, 15223 height: rect.bottom - rect.top 15224 }, sizes = element.nodeName === "HTML" ? getWindowSizes(element.ownerDocument) : {}, width = sizes.width || element.clientWidth || result.width, height = sizes.height || element.clientHeight || result.height, horizScrollbar = element.offsetWidth - width, vertScrollbar = element.offsetHeight - height; 15225 if (horizScrollbar || vertScrollbar) { 15226 var styles2 = getStyleComputedProperty(element); 15227 horizScrollbar -= getBordersSize(styles2, "x"), vertScrollbar -= getBordersSize(styles2, "y"), result.width -= horizScrollbar, result.height -= vertScrollbar; 15228 } 15229 return getClientRect(result); 15230} 15231function getOffsetRectRelativeToArbitraryNode(children, parent) { 15232 var fixedPosition = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, isIE102 = isIE(10), isHTML = parent.nodeName === "HTML", childrenRect = getBoundingClientRect(children), parentRect = getBoundingClientRect(parent), scrollParent2 = getScrollParent(children), styles2 = getStyleComputedProperty(parent), borderTopWidth = parseFloat(styles2.borderTopWidth), borderLeftWidth = parseFloat(styles2.borderLeftWidth); 15233 fixedPosition && isHTML && (parentRect.top = Math.max(parentRect.top, 0), parentRect.left = Math.max(parentRect.left, 0)); 15234 var offsets = getClientRect({ 15235 top: childrenRect.top - parentRect.top - borderTopWidth, 15236 left: childrenRect.left - parentRect.left - borderLeftWidth, 15237 width: childrenRect.width, 15238 height: childrenRect.height 15239 }); 15240 if (offsets.marginTop = 0, offsets.marginLeft = 0, !isIE102 && isHTML) { 15241 var marginTop = parseFloat(styles2.marginTop), marginLeft = parseFloat(styles2.marginLeft); 15242 offsets.top -= borderTopWidth - marginTop, offsets.bottom -= borderTopWidth - marginTop, offsets.left -= borderLeftWidth - marginLeft, offsets.right -= borderLeftWidth - marginLeft, offsets.marginTop = marginTop, offsets.marginLeft = marginLeft; 15243 } 15244 return (isIE102 && !fixedPosition ? parent.contains(scrollParent2) : parent === scrollParent2 && scrollParent2.nodeName !== "BODY") && (offsets = includeScroll(offsets, parent)), offsets; 15245} 15246function getViewportOffsetRectRelativeToArtbitraryNode(element) { 15247 var excludeScroll = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, html = element.ownerDocument.documentElement, relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html), width = Math.max(html.clientWidth, window.innerWidth || 0), height = Math.max(html.clientHeight, window.innerHeight || 0), scrollTop = excludeScroll ? 0 : getScroll(html), scrollLeft = excludeScroll ? 0 : getScroll(html, "left"), offset2 = { 15248 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 15249 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 15250 width, 15251 height 15252 }; 15253 return getClientRect(offset2); 15254} 15255function isFixed(element) { 15256 var nodeName = element.nodeName; 15257 if (nodeName === "BODY" || nodeName === "HTML") 15258 return !1; 15259 if (getStyleComputedProperty(element, "position") === "fixed") 15260 return !0; 15261 var parentNode = getParentNode(element); 15262 return parentNode ? isFixed(parentNode) : !1; 15263} 15264function getFixedPositionOffsetParent(element) { 15265 if (!element || !element.parentElement || isIE()) 15266 return document.documentElement; 15267 for (var el = element.parentElement; el && getStyleComputedProperty(el, "transform") === "none"; ) 15268 el = el.parentElement; 15269 return el || document.documentElement; 15270} 15271function getBoundaries(popper, reference, padding, boundariesElement) { 15272 var fixedPosition = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, boundaries = { top: 0, left: 0 }, offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 15273 if (boundariesElement === "viewport") 15274 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 15275 else { 15276 var boundariesNode = void 0; 15277 boundariesElement === "scrollParent" ? (boundariesNode = getScrollParent(getParentNode(reference)), boundariesNode.nodeName === "BODY" && (boundariesNode = popper.ownerDocument.documentElement)) : boundariesElement === "window" ? boundariesNode = popper.ownerDocument.documentElement : boundariesNode = boundariesElement; 15278 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 15279 if (boundariesNode.nodeName === "HTML" && !isFixed(offsetParent)) { 15280 var _getWindowSizes = getWindowSizes(popper.ownerDocument), height = _getWindowSizes.height, width = _getWindowSizes.width; 15281 boundaries.top += offsets.top - offsets.marginTop, boundaries.bottom = height + offsets.top, boundaries.left += offsets.left - offsets.marginLeft, boundaries.right = width + offsets.left; 15282 } else 15283 boundaries = offsets; 15284 } 15285 padding = padding || 0; 15286 var isPaddingNumber = typeof padding == "number"; 15287 return boundaries.left += isPaddingNumber ? padding : padding.left || 0, boundaries.top += isPaddingNumber ? padding : padding.top || 0, boundaries.right -= isPaddingNumber ? padding : padding.right || 0, boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0, boundaries; 15288} 15289function getArea(_ref) { 15290 var width = _ref.width, height = _ref.height; 15291 return width * height; 15292} 15293function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 15294 var padding = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 0; 15295 if (placement.indexOf("auto") === -1) 15296 return placement; 15297 var boundaries = getBoundaries(popper, reference, padding, boundariesElement), rects = { 15298 top: { 15299 width: boundaries.width, 15300 height: refRect.top - boundaries.top 15301 }, 15302 right: { 15303 width: boundaries.right - refRect.right, 15304 height: boundaries.height 15305 }, 15306 bottom: { 15307 width: boundaries.width, 15308 height: boundaries.bottom - refRect.bottom 15309 }, 15310 left: { 15311 width: refRect.left - boundaries.left, 15312 height: boundaries.height 15313 } 15314 }, sortedAreas = Object.keys(rects).map(function(key) { 15315 return _extends2({ 15316 key 15317 }, rects[key], { 15318 area: getArea(rects[key]) 15319 }); 15320 }).sort(function(a2, b2) { 15321 return b2.area - a2.area; 15322 }), filteredAreas = sortedAreas.filter(function(_ref2) { 15323 var width = _ref2.width, height = _ref2.height; 15324 return width >= popper.clientWidth && height >= popper.clientHeight; 15325 }), computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key, variation = placement.split("-")[1]; 15326 return computedPlacement + (variation ? "-" + variation : ""); 15327} 15328function getReferenceOffsets(state, popper, reference) { 15329 var fixedPosition = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 15330 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 15331} 15332function getOuterSizes(element) { 15333 var window2 = element.ownerDocument.defaultView, styles2 = window2.getComputedStyle(element), x2 = parseFloat(styles2.marginTop || 0) + parseFloat(styles2.marginBottom || 0), y2 = parseFloat(styles2.marginLeft || 0) + parseFloat(styles2.marginRight || 0), result = { 15334 width: element.offsetWidth + y2, 15335 height: element.offsetHeight + x2 15336 }; 15337 return result; 15338} 15339function getOppositePlacement(placement) { 15340 var hash = { left: "right", right: "left", bottom: "top", top: "bottom" }; 15341 return placement.replace(/left|right|bottom|top/g, function(matched) { 15342 return hash[matched]; 15343 }); 15344} 15345function getPopperOffsets(popper, referenceOffsets, placement) { 15346 placement = placement.split("-")[0]; 15347 var popperRect = getOuterSizes(popper), popperOffsets = { 15348 width: popperRect.width, 15349 height: popperRect.height 15350 }, isHoriz = ["right", "left"].indexOf(placement) !== -1, mainSide = isHoriz ? "top" : "left", secondarySide = isHoriz ? "left" : "top", measurement = isHoriz ? "height" : "width", secondaryMeasurement = isHoriz ? "width" : "height"; 15351 return popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2, placement === secondarySide ? popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement] : popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)], popperOffsets; 15352} 15353function find(arr, check) { 15354 return Array.prototype.find ? arr.find(check) : arr.filter(check)[0]; 15355} 15356function findIndex(arr, prop, value) { 15357 if (Array.prototype.findIndex) 15358 return arr.findIndex(function(cur) { 15359 return cur[prop] === value; 15360 }); 15361 var match = find(arr, function(obj) { 15362 return obj[prop] === value; 15363 }); 15364 return arr.indexOf(match); 15365} 15366function runModifiers(modifiers2, data, ends) { 15367 var modifiersToRun = ends === void 0 ? modifiers2 : modifiers2.slice(0, findIndex(modifiers2, "name", ends)); 15368 return modifiersToRun.forEach(function(modifier) { 15369 modifier.function && console.warn("`modifier.function` is deprecated, use `modifier.fn`!"); 15370 var fn = modifier.function || modifier.fn; 15371 modifier.enabled && isFunction3(fn) && (data.offsets.popper = getClientRect(data.offsets.popper), data.offsets.reference = getClientRect(data.offsets.reference), data = fn(data, modifier)); 15372 }), data; 15373} 15374function update() { 15375 if (!this.state.isDestroyed) { 15376 var data = { 15377 instance: this, 15378 styles: {}, 15379 arrowStyles: {}, 15380 attributes: {}, 15381 flipped: !1, 15382 offsets: {} 15383 }; 15384 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed), data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding), data.originalPlacement = data.placement, data.positionFixed = this.options.positionFixed, data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement), data.offsets.popper.position = this.options.positionFixed ? "fixed" : "absolute", data = runModifiers(this.modifiers, data), this.state.isCreated ? this.options.onUpdate(data) : (this.state.isCreated = !0, this.options.onCreate(data)); 15385 } 15386} 15387function isModifierEnabled(modifiers2, modifierName) { 15388 return modifiers2.some(function(_ref) { 15389 var name = _ref.name, enabled = _ref.enabled; 15390 return enabled && name === modifierName; 15391 }); 15392} 15393function getSupportedPropertyName(property) { 15394 for (var prefixes = [!1, "ms", "Webkit", "Moz", "O"], upperProp = property.charAt(0).toUpperCase() + property.slice(1), i2 = 0; i2 < prefixes.length; i2++) { 15395 var prefix = prefixes[i2], toCheck = prefix ? "" + prefix + upperProp : property; 15396 if (typeof document.body.style[toCheck] < "u") 15397 return toCheck; 15398 } 15399 return null; 15400} 15401function destroy() { 15402 return this.state.isDestroyed = !0, isModifierEnabled(this.modifiers, "applyStyle") && (this.popper.removeAttribute("x-placement"), this.popper.style.position = "", this.popper.style.top = "", this.popper.style.left = "", this.popper.style.right = "", this.popper.style.bottom = "", this.popper.style.willChange = "", this.popper.style[getSupportedPropertyName("transform")] = ""), this.disableEventListeners(), this.options.removeOnDestroy && this.popper.parentNode.removeChild(this.popper), this; 15403} 15404function getWindow(element) { 15405 var ownerDocument = element.ownerDocument; 15406 return ownerDocument ? ownerDocument.defaultView : window; 15407} 15408function attachToScrollParents(scrollParent2, event, callback, scrollParents) { 15409 var isBody = scrollParent2.nodeName === "BODY", target = isBody ? scrollParent2.ownerDocument.defaultView : scrollParent2; 15410 target.addEventListener(event, callback, { passive: !0 }), isBody || attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents), scrollParents.push(target); 15411} 15412function setupEventListeners(reference, options2, state, updateBound) { 15413 state.updateBound = updateBound, getWindow(reference).addEventListener("resize", state.updateBound, { passive: !0 }); 15414 var scrollElement = getScrollParent(reference); 15415 return attachToScrollParents(scrollElement, "scroll", state.updateBound, state.scrollParents), state.scrollElement = scrollElement, state.eventsEnabled = !0, state; 15416} 15417function enableEventListeners() { 15418 this.state.eventsEnabled || (this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate)); 15419} 15420function removeEventListeners(reference, state) { 15421 return getWindow(reference).removeEventListener("resize", state.updateBound), state.scrollParents.forEach(function(target) { 15422 target.removeEventListener("scroll", state.updateBound); 15423 }), state.updateBound = null, state.scrollParents = [], state.scrollElement = null, state.eventsEnabled = !1, state; 15424} 15425function disableEventListeners() { 15426 this.state.eventsEnabled && (cancelAnimationFrame(this.scheduleUpdate), this.state = removeEventListeners(this.reference, this.state)); 15427} 15428function isNumeric(n3) { 15429 return n3 !== "" && !isNaN(parseFloat(n3)) && isFinite(n3); 15430} 15431function setStyles(element, styles2) { 15432 Object.keys(styles2).forEach(function(prop) { 15433 var unit = ""; 15434 ["width", "height", "top", "right", "bottom", "left"].indexOf(prop) !== -1 && isNumeric(styles2[prop]) && (unit = "px"), element.style[prop] = styles2[prop] + unit; 15435 }); 15436} 15437function setAttributes(element, attributes) { 15438 Object.keys(attributes).forEach(function(prop) { 15439 var value = attributes[prop]; 15440 value !== !1 ? element.setAttribute(prop, attributes[prop]) : element.removeAttribute(prop); 15441 }); 15442} 15443function applyStyle(data) { 15444 return setStyles(data.instance.popper, data.styles), setAttributes(data.instance.popper, data.attributes), data.arrowElement && Object.keys(data.arrowStyles).length && setStyles(data.arrowElement, data.arrowStyles), data; 15445} 15446function applyStyleOnLoad(reference, popper, options2, modifierOptions, state) { 15447 var referenceOffsets = getReferenceOffsets(state, popper, reference, options2.positionFixed), placement = computeAutoPlacement(options2.placement, referenceOffsets, popper, reference, options2.modifiers.flip.boundariesElement, options2.modifiers.flip.padding); 15448 return popper.setAttribute("x-placement", placement), setStyles(popper, { position: options2.positionFixed ? "fixed" : "absolute" }), options2; 15449} 15450function getRoundedOffsets(data, shouldRound) { 15451 var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, round = Math.round, floor = Math.floor, noRound = function(v2) { 15452 return v2; 15453 }, referenceWidth = round(reference.width), popperWidth = round(popper.width), isVertical = ["left", "right"].indexOf(data.placement) !== -1, isVariation = data.placement.indexOf("-") !== -1, sameWidthParity = referenceWidth % 2 === popperWidth % 2, bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1, horizontalToInteger = shouldRound ? isVertical || isVariation || sameWidthParity ? round : floor : noRound, verticalToInteger = shouldRound ? round : noRound; 15454 return { 15455 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 15456 top: verticalToInteger(popper.top), 15457 bottom: verticalToInteger(popper.bottom), 15458 right: horizontalToInteger(popper.right) 15459 }; 15460} 15461var isFirefox = isBrowser2 && /Firefox/i.test(navigator.userAgent); 15462function computeStyle(data, options2) { 15463 var x2 = options2.x, y2 = options2.y, popper = data.offsets.popper, legacyGpuAccelerationOption = find(data.instance.modifiers, function(modifier) { 15464 return modifier.name === "applyStyle"; 15465 }).gpuAcceleration; 15466 legacyGpuAccelerationOption !== void 0 && console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!"); 15467 var gpuAcceleration = legacyGpuAccelerationOption !== void 0 ? legacyGpuAccelerationOption : options2.gpuAcceleration, offsetParent = getOffsetParent(data.instance.popper), offsetParentRect = getBoundingClientRect(offsetParent), styles2 = { 15468 position: popper.position 15469 }, offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox), sideA = x2 === "bottom" ? "top" : "bottom", sideB = y2 === "right" ? "left" : "right", prefixedProperty = getSupportedPropertyName("transform"), left = void 0, top = void 0; 15470 if (sideA === "bottom" ? offsetParent.nodeName === "HTML" ? top = -offsetParent.clientHeight + offsets.bottom : top = -offsetParentRect.height + offsets.bottom : top = offsets.top, sideB === "right" ? offsetParent.nodeName === "HTML" ? left = -offsetParent.clientWidth + offsets.right : left = -offsetParentRect.width + offsets.right : left = offsets.left, gpuAcceleration && prefixedProperty) 15471 styles2[prefixedProperty] = "translate3d(" + left + "px, " + top + "px, 0)", styles2[sideA] = 0, styles2[sideB] = 0, styles2.willChange = "transform"; 15472 else { 15473 var invertTop = sideA === "bottom" ? -1 : 1, invertLeft = sideB === "right" ? -1 : 1; 15474 styles2[sideA] = top * invertTop, styles2[sideB] = left * invertLeft, styles2.willChange = sideA + ", " + sideB; 15475 } 15476 var attributes = { 15477 "x-placement": data.placement 15478 }; 15479 return data.attributes = _extends2({}, attributes, data.attributes), data.styles = _extends2({}, styles2, data.styles), data.arrowStyles = _extends2({}, data.offsets.arrow, data.arrowStyles), data; 15480} 15481function isModifierRequired(modifiers2, requestingName, requestedName) { 15482 var requesting = find(modifiers2, function(_ref) { 15483 var name = _ref.name; 15484 return name === requestingName; 15485 }), isRequired = !!requesting && modifiers2.some(function(modifier) { 15486 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 15487 }); 15488 if (!isRequired) { 15489 var _requesting = "`" + requestingName + "`", requested = "`" + requestedName + "`"; 15490 console.warn(requested + " modifier is required by " + _requesting + " modifier in order to work, be sure to include it before " + _requesting + "!"); 15491 } 15492 return isRequired; 15493} 15494function arrow(data, options2) { 15495 var _data$offsets$arrow; 15496 if (!isModifierRequired(data.instance.modifiers, "arrow", "keepTogether")) 15497 return data; 15498 var arrowElement = options2.element; 15499 if (typeof arrowElement == "string") { 15500 if (arrowElement = data.instance.popper.querySelector(arrowElement), !arrowElement) 15501 return data; 15502 } else if (!data.instance.popper.contains(arrowElement)) 15503 return console.warn("WARNING: `arrow.element` must be child of its popper element!"), data; 15504 var placement = data.placement.split("-")[0], _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, isVertical = ["left", "right"].indexOf(placement) !== -1, len = isVertical ? "height" : "width", sideCapitalized = isVertical ? "Top" : "Left", side = sideCapitalized.toLowerCase(), altSide = isVertical ? "left" : "top", opSide = isVertical ? "bottom" : "right", arrowElementSize = getOuterSizes(arrowElement)[len]; 15505 reference[opSide] - arrowElementSize < popper[side] && (data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize)), reference[side] + arrowElementSize > popper[opSide] && (data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]), data.offsets.popper = getClientRect(data.offsets.popper); 15506 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2, css2 = getStyleComputedProperty(data.instance.popper), popperMarginSide = parseFloat(css2["margin" + sideCapitalized]), popperBorderSide = parseFloat(css2["border" + sideCapitalized + "Width"]), sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 15507 return sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0), data.arrowElement = arrowElement, data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ""), _data$offsets$arrow), data; 15508} 15509function getOppositeVariation(variation) { 15510 return variation === "end" ? "start" : variation === "start" ? "end" : variation; 15511} 15512var placements = ["auto-start", "auto", "auto-end", "top-start", "top", "top-end", "right-start", "right", "right-end", "bottom-end", "bottom", "bottom-start", "left-end", "left", "left-start"], validPlacements = placements.slice(3); 15513function clockwise(placement) { 15514 var counter = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, index = validPlacements.indexOf(placement), arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 15515 return counter ? arr.reverse() : arr; 15516} 15517var BEHAVIORS = { 15518 FLIP: "flip", 15519 CLOCKWISE: "clockwise", 15520 COUNTERCLOCKWISE: "counterclockwise" 15521}; 15522function flip(data, options2) { 15523 if (isModifierEnabled(data.instance.modifiers, "inner") || data.flipped && data.placement === data.originalPlacement) 15524 return data; 15525 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options2.padding, options2.boundariesElement, data.positionFixed), placement = data.placement.split("-")[0], placementOpposite = getOppositePlacement(placement), variation = data.placement.split("-")[1] || "", flipOrder = []; 15526 switch (options2.behavior) { 15527 case BEHAVIORS.FLIP: 15528 flipOrder = [placement, placementOpposite]; 15529 break; 15530 case BEHAVIORS.CLOCKWISE: 15531 flipOrder = clockwise(placement); 15532 break; 15533 case BEHAVIORS.COUNTERCLOCKWISE: 15534 flipOrder = clockwise(placement, !0); 15535 break; 15536 default: 15537 flipOrder = options2.behavior; 15538 } 15539 return flipOrder.forEach(function(step, index) { 15540 if (placement !== step || flipOrder.length === index + 1) 15541 return data; 15542 placement = data.placement.split("-")[0], placementOpposite = getOppositePlacement(placement); 15543 var popperOffsets = data.offsets.popper, refOffsets = data.offsets.reference, floor = Math.floor, overlapsRef = placement === "left" && floor(popperOffsets.right) > floor(refOffsets.left) || placement === "right" && floor(popperOffsets.left) < floor(refOffsets.right) || placement === "top" && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === "bottom" && floor(popperOffsets.top) < floor(refOffsets.bottom), overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left), overflowsRight = floor(popperOffsets.right) > floor(boundaries.right), overflowsTop = floor(popperOffsets.top) < floor(boundaries.top), overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom), overflowsBoundaries = placement === "left" && overflowsLeft || placement === "right" && overflowsRight || placement === "top" && overflowsTop || placement === "bottom" && overflowsBottom, isVertical = ["top", "bottom"].indexOf(placement) !== -1, flippedVariationByRef = !!options2.flipVariations && (isVertical && variation === "start" && overflowsLeft || isVertical && variation === "end" && overflowsRight || !isVertical && variation === "start" && overflowsTop || !isVertical && variation === "end" && overflowsBottom), flippedVariationByContent = !!options2.flipVariationsByContent && (isVertical && variation === "start" && overflowsRight || isVertical && variation === "end" && overflowsLeft || !isVertical && variation === "start" && overflowsBottom || !isVertical && variation === "end" && overflowsTop), flippedVariation = flippedVariationByRef || flippedVariationByContent; 15544 (overlapsRef || overflowsBoundaries || flippedVariation) && (data.flipped = !0, (overlapsRef || overflowsBoundaries) && (placement = flipOrder[index + 1]), flippedVariation && (variation = getOppositeVariation(variation)), data.placement = placement + (variation ? "-" + variation : ""), data.offsets.popper = _extends2({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)), data = runModifiers(data.instance.modifiers, data, "flip")); 15545 }), data; 15546} 15547function keepTogether(data) { 15548 var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, placement = data.placement.split("-")[0], floor = Math.floor, isVertical = ["top", "bottom"].indexOf(placement) !== -1, side = isVertical ? "right" : "bottom", opSide = isVertical ? "left" : "top", measurement = isVertical ? "width" : "height"; 15549 return popper[side] < floor(reference[opSide]) && (data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]), popper[opSide] > floor(reference[side]) && (data.offsets.popper[opSide] = floor(reference[side])), data; 15550} 15551function toValue(str, measurement, popperOffsets, referenceOffsets) { 15552 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/), value = +split[1], unit = split[2]; 15553 if (!value) 15554 return str; 15555 if (unit.indexOf("%") === 0) { 15556 var element = void 0; 15557 unit === "%p" ? element = popperOffsets : element = referenceOffsets; 15558 var rect = getClientRect(element); 15559 return rect[measurement] / 100 * value; 15560 } else if (unit === "vh" || unit === "vw") { 15561 var size = void 0; 15562 return unit === "vh" ? size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) : size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0), size / 100 * value; 15563 } else 15564 return value; 15565} 15566function parseOffset(offset2, popperOffsets, referenceOffsets, basePlacement) { 15567 var offsets = [0, 0], useHeight = ["right", "left"].indexOf(basePlacement) !== -1, fragments = offset2.split(/(\+|\-)/).map(function(frag) { 15568 return frag.trim(); 15569 }), divider = fragments.indexOf(find(fragments, function(frag) { 15570 return frag.search(/,|\s/) !== -1; 15571 })); 15572 fragments[divider] && fragments[divider].indexOf(",") === -1 && console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead."); 15573 var splitRegex = /\s*,\s*|\s+/, ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 15574 return ops = ops.map(function(op, index) { 15575 var measurement = (index === 1 ? !useHeight : useHeight) ? "height" : "width", mergeWithPrevious = !1; 15576 return op.reduce(function(a2, b2) { 15577 return a2[a2.length - 1] === "" && ["+", "-"].indexOf(b2) !== -1 ? (a2[a2.length - 1] = b2, mergeWithPrevious = !0, a2) : mergeWithPrevious ? (a2[a2.length - 1] += b2, mergeWithPrevious = !1, a2) : a2.concat(b2); 15578 }, []).map(function(str) { 15579 return toValue(str, measurement, popperOffsets, referenceOffsets); 15580 }); 15581 }), ops.forEach(function(op, index) { 15582 op.forEach(function(frag, index2) { 15583 isNumeric(frag) && (offsets[index] += frag * (op[index2 - 1] === "-" ? -1 : 1)); 15584 }); 15585 }), offsets; 15586} 15587function offset(data, _ref) { 15588 var offset2 = _ref.offset, placement = data.placement, _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, basePlacement = placement.split("-")[0], offsets = void 0; 15589 return isNumeric(+offset2) ? offsets = [+offset2, 0] : offsets = parseOffset(offset2, popper, reference, basePlacement), basePlacement === "left" ? (popper.top += offsets[0], popper.left -= offsets[1]) : basePlacement === "right" ? (popper.top += offsets[0], popper.left += offsets[1]) : basePlacement === "top" ? (popper.left += offsets[0], popper.top -= offsets[1]) : basePlacement === "bottom" && (popper.left += offsets[0], popper.top += offsets[1]), data.popper = popper, data; 15590} 15591function preventOverflow(data, options2) { 15592 var boundariesElement = options2.boundariesElement || getOffsetParent(data.instance.popper); 15593 data.instance.reference === boundariesElement && (boundariesElement = getOffsetParent(boundariesElement)); 15594 var transformProp = getSupportedPropertyName("transform"), popperStyles = data.instance.popper.style, top = popperStyles.top, left = popperStyles.left, transform = popperStyles[transformProp]; 15595 popperStyles.top = "", popperStyles.left = "", popperStyles[transformProp] = ""; 15596 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options2.padding, boundariesElement, data.positionFixed); 15597 popperStyles.top = top, popperStyles.left = left, popperStyles[transformProp] = transform, options2.boundaries = boundaries; 15598 var order = options2.priority, popper = data.offsets.popper, check = { 15599 primary: function(placement) { 15600 var value = popper[placement]; 15601 return popper[placement] < boundaries[placement] && !options2.escapeWithReference && (value = Math.max(popper[placement], boundaries[placement])), defineProperty({}, placement, value); 15602 }, 15603 secondary: function(placement) { 15604 var mainSide = placement === "right" ? "left" : "top", value = popper[mainSide]; 15605 return popper[placement] > boundaries[placement] && !options2.escapeWithReference && (value = Math.min(popper[mainSide], boundaries[placement] - (placement === "right" ? popper.width : popper.height))), defineProperty({}, mainSide, value); 15606 } 15607 }; 15608 return order.forEach(function(placement) { 15609 var side = ["left", "top"].indexOf(placement) !== -1 ? "primary" : "secondary"; 15610 popper = _extends2({}, popper, check[side](placement)); 15611 }), data.offsets.popper = popper, data; 15612} 15613function shift(data) { 15614 var placement = data.placement, basePlacement = placement.split("-")[0], shiftvariation = placement.split("-")[1]; 15615 if (shiftvariation) { 15616 var _data$offsets = data.offsets, reference = _data$offsets.reference, popper = _data$offsets.popper, isVertical = ["bottom", "top"].indexOf(basePlacement) !== -1, side = isVertical ? "left" : "top", measurement = isVertical ? "width" : "height", shiftOffsets = { 15617 start: defineProperty({}, side, reference[side]), 15618 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 15619 }; 15620 data.offsets.popper = _extends2({}, popper, shiftOffsets[shiftvariation]); 15621 } 15622 return data; 15623} 15624function hide(data) { 15625 if (!isModifierRequired(data.instance.modifiers, "hide", "preventOverflow")) 15626 return data; 15627 var refRect = data.offsets.reference, bound = find(data.instance.modifiers, function(modifier) { 15628 return modifier.name === "preventOverflow"; 15629 }).boundaries; 15630 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 15631 if (data.hide === !0) 15632 return data; 15633 data.hide = !0, data.attributes["x-out-of-boundaries"] = ""; 15634 } else { 15635 if (data.hide === !1) 15636 return data; 15637 data.hide = !1, data.attributes["x-out-of-boundaries"] = !1; 15638 } 15639 return data; 15640} 15641function inner(data) { 15642 var placement = data.placement, basePlacement = placement.split("-")[0], _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, isHoriz = ["left", "right"].indexOf(basePlacement) !== -1, subtractLength = ["top", "left"].indexOf(basePlacement) === -1; 15643 return popper[isHoriz ? "left" : "top"] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? "width" : "height"] : 0), data.placement = getOppositePlacement(placement), data.offsets.popper = getClientRect(popper), data; 15644} 15645var modifiers = { 15646 /** 15647 * Modifier used to shift the popper on the start or end of its reference 15648 * element.<br /> 15649 * It will read the variation of the `placement` property.<br /> 15650 * It can be one either `-end` or `-start`. 15651 * @memberof modifiers 15652 * @inner 15653 */ 15654 shift: { 15655 /** @prop {number} order=100 - Index used to define the order of execution */ 15656 order: 100, 15657 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15658 enabled: !0, 15659 /** @prop {ModifierFn} */ 15660 fn: shift 15661 }, 15662 /** 15663 * The `offset` modifier can shift your popper on both its axis. 15664 * 15665 * It accepts the following units: 15666 * - `px` or unit-less, interpreted as pixels 15667 * - `%` or `%r`, percentage relative to the length of the reference element 15668 * - `%p`, percentage relative to the length of the popper element 15669 * - `vw`, CSS viewport width unit 15670 * - `vh`, CSS viewport height unit 15671 * 15672 * For length is intended the main axis relative to the placement of the popper.<br /> 15673 * This means that if the placement is `top` or `bottom`, the length will be the 15674 * `width`. In case of `left` or `right`, it will be the `height`. 15675 * 15676 * You can provide a single value (as `Number` or `String`), or a pair of values 15677 * as `String` divided by a comma or one (or more) white spaces.<br /> 15678 * The latter is a deprecated method because it leads to confusion and will be 15679 * removed in v2.<br /> 15680 * Additionally, it accepts additions and subtractions between different units. 15681 * Note that multiplications and divisions aren't supported. 15682 * 15683 * Valid examples are: 15684 * ``` 15685 * 10 15686 * '10%' 15687 * '10, 10' 15688 * '10%, 10' 15689 * '10 + 10%' 15690 * '10 - 5vh + 3%' 15691 * '-10px + 5vh, 5px - 6%' 15692 * ``` 15693 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 15694 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 15695 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 15696 * 15697 * @memberof modifiers 15698 * @inner 15699 */ 15700 offset: { 15701 /** @prop {number} order=200 - Index used to define the order of execution */ 15702 order: 200, 15703 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15704 enabled: !0, 15705 /** @prop {ModifierFn} */ 15706 fn: offset, 15707 /** @prop {Number|String} offset=0 15708 * The offset value as described in the modifier description 15709 */ 15710 offset: 0 15711 }, 15712 /** 15713 * Modifier used to prevent the popper from being positioned outside the boundary. 15714 * 15715 * A scenario exists where the reference itself is not within the boundaries.<br /> 15716 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 15717 * In this case we need to decide whether the popper should either: 15718 * 15719 * - detach from the reference and remain "trapped" in the boundaries, or 15720 * - if it should ignore the boundary and "escape with its reference" 15721 * 15722 * When `escapeWithReference` is set to`true` and reference is completely 15723 * outside its boundaries, the popper will overflow (or completely leave) 15724 * the boundaries in order to remain attached to the edge of the reference. 15725 * 15726 * @memberof modifiers 15727 * @inner 15728 */ 15729 preventOverflow: { 15730 /** @prop {number} order=300 - Index used to define the order of execution */ 15731 order: 300, 15732 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15733 enabled: !0, 15734 /** @prop {ModifierFn} */ 15735 fn: preventOverflow, 15736 /** 15737 * @prop {Array} [priority=['left','right','top','bottom']] 15738 * Popper will try to prevent overflow following these priorities by default, 15739 * then, it could overflow on the left and on top of the `boundariesElement` 15740 */ 15741 priority: ["left", "right", "top", "bottom"], 15742 /** 15743 * @prop {number} padding=5 15744 * Amount of pixel used to define a minimum distance between the boundaries 15745 * and the popper. This makes sure the popper always has a little padding 15746 * between the edges of its container 15747 */ 15748 padding: 5, 15749 /** 15750 * @prop {String|HTMLElement} boundariesElement='scrollParent' 15751 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 15752 * `viewport` or any DOM element. 15753 */ 15754 boundariesElement: "scrollParent" 15755 }, 15756 /** 15757 * Modifier used to make sure the reference and its popper stay near each other 15758 * without leaving any gap between the two. Especially useful when the arrow is 15759 * enabled and you want to ensure that it points to its reference element. 15760 * It cares only about the first axis. You can still have poppers with margin 15761 * between the popper and its reference element. 15762 * @memberof modifiers 15763 * @inner 15764 */ 15765 keepTogether: { 15766 /** @prop {number} order=400 - Index used to define the order of execution */ 15767 order: 400, 15768 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15769 enabled: !0, 15770 /** @prop {ModifierFn} */ 15771 fn: keepTogether 15772 }, 15773 /** 15774 * This modifier is used to move the `arrowElement` of the popper to make 15775 * sure it is positioned between the reference element and its popper element. 15776 * It will read the outer size of the `arrowElement` node to detect how many 15777 * pixels of conjunction are needed. 15778 * 15779 * It has no effect if no `arrowElement` is provided. 15780 * @memberof modifiers 15781 * @inner 15782 */ 15783 arrow: { 15784 /** @prop {number} order=500 - Index used to define the order of execution */ 15785 order: 500, 15786 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15787 enabled: !0, 15788 /** @prop {ModifierFn} */ 15789 fn: arrow, 15790 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 15791 element: "[x-arrow]" 15792 }, 15793 /** 15794 * Modifier used to flip the popper's placement when it starts to overlap its 15795 * reference element. 15796 * 15797 * Requires the `preventOverflow` modifier before it in order to work. 15798 * 15799 * **NOTE:** this modifier will interrupt the current update cycle and will 15800 * restart it if it detects the need to flip the placement. 15801 * @memberof modifiers 15802 * @inner 15803 */ 15804 flip: { 15805 /** @prop {number} order=600 - Index used to define the order of execution */ 15806 order: 600, 15807 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15808 enabled: !0, 15809 /** @prop {ModifierFn} */ 15810 fn: flip, 15811 /** 15812 * @prop {String|Array} behavior='flip' 15813 * The behavior used to change the popper's placement. It can be one of 15814 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 15815 * placements (with optional variations) 15816 */ 15817 behavior: "flip", 15818 /** 15819 * @prop {number} padding=5 15820 * The popper will flip if it hits the edges of the `boundariesElement` 15821 */ 15822 padding: 5, 15823 /** 15824 * @prop {String|HTMLElement} boundariesElement='viewport' 15825 * The element which will define the boundaries of the popper position. 15826 * The popper will never be placed outside of the defined boundaries 15827 * (except if `keepTogether` is enabled) 15828 */ 15829 boundariesElement: "viewport", 15830 /** 15831 * @prop {Boolean} flipVariations=false 15832 * The popper will switch placement variation between `-start` and `-end` when 15833 * the reference element overlaps its boundaries. 15834 * 15835 * The original placement should have a set variation. 15836 */ 15837 flipVariations: !1, 15838 /** 15839 * @prop {Boolean} flipVariationsByContent=false 15840 * The popper will switch placement variation between `-start` and `-end` when 15841 * the popper element overlaps its reference boundaries. 15842 * 15843 * The original placement should have a set variation. 15844 */ 15845 flipVariationsByContent: !1 15846 }, 15847 /** 15848 * Modifier used to make the popper flow toward the inner of the reference element. 15849 * By default, when this modifier is disabled, the popper will be placed outside 15850 * the reference element. 15851 * @memberof modifiers 15852 * @inner 15853 */ 15854 inner: { 15855 /** @prop {number} order=700 - Index used to define the order of execution */ 15856 order: 700, 15857 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 15858 enabled: !1, 15859 /** @prop {ModifierFn} */ 15860 fn: inner 15861 }, 15862 /** 15863 * Modifier used to hide the popper when its reference element is outside of the 15864 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 15865 * be used to hide with a CSS selector the popper when its reference is 15866 * out of boundaries. 15867 * 15868 * Requires the `preventOverflow` modifier before it in order to work. 15869 * @memberof modifiers 15870 * @inner 15871 */ 15872 hide: { 15873 /** @prop {number} order=800 - Index used to define the order of execution */ 15874 order: 800, 15875 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15876 enabled: !0, 15877 /** @prop {ModifierFn} */ 15878 fn: hide 15879 }, 15880 /** 15881 * Computes the style that will be applied to the popper element to gets 15882 * properly positioned. 15883 * 15884 * Note that this modifier will not touch the DOM, it just prepares the styles 15885 * so that `applyStyle` modifier can apply it. This separation is useful 15886 * in case you need to replace `applyStyle` with a custom implementation. 15887 * 15888 * This modifier has `850` as `order` value to maintain backward compatibility 15889 * with previous versions of Popper.js. Expect the modifiers ordering method 15890 * to change in future major versions of the library. 15891 * 15892 * @memberof modifiers 15893 * @inner 15894 */ 15895 computeStyle: { 15896 /** @prop {number} order=850 - Index used to define the order of execution */ 15897 order: 850, 15898 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15899 enabled: !0, 15900 /** @prop {ModifierFn} */ 15901 fn: computeStyle, 15902 /** 15903 * @prop {Boolean} gpuAcceleration=true 15904 * If true, it uses the CSS 3D transformation to position the popper. 15905 * Otherwise, it will use the `top` and `left` properties 15906 */ 15907 gpuAcceleration: !0, 15908 /** 15909 * @prop {string} [x='bottom'] 15910 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 15911 * Change this if your popper should grow in a direction different from `bottom` 15912 */ 15913 x: "bottom", 15914 /** 15915 * @prop {string} [x='left'] 15916 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 15917 * Change this if your popper should grow in a direction different from `right` 15918 */ 15919 y: "right" 15920 }, 15921 /** 15922 * Applies the computed styles to the popper element. 15923 * 15924 * All the DOM manipulations are limited to this modifier. This is useful in case 15925 * you want to integrate Popper.js inside a framework or view library and you 15926 * want to delegate all the DOM manipulations to it. 15927 * 15928 * Note that if you disable this modifier, you must make sure the popper element 15929 * has its position set to `absolute` before Popper.js can do its work! 15930 * 15931 * Just disable this modifier and define your own to achieve the desired effect. 15932 * 15933 * @memberof modifiers 15934 * @inner 15935 */ 15936 applyStyle: { 15937 /** @prop {number} order=900 - Index used to define the order of execution */ 15938 order: 900, 15939 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 15940 enabled: !0, 15941 /** @prop {ModifierFn} */ 15942 fn: applyStyle, 15943 /** @prop {Function} */ 15944 onLoad: applyStyleOnLoad, 15945 /** 15946 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 15947 * @prop {Boolean} gpuAcceleration=true 15948 * If true, it uses the CSS 3D transformation to position the popper. 15949 * Otherwise, it will use the `top` and `left` properties 15950 */ 15951 gpuAcceleration: void 0 15952 } 15953}, Defaults = { 15954 /** 15955 * Popper's placement. 15956 * @prop {Popper.placements} placement='bottom' 15957 */ 15958 placement: "bottom", 15959 /** 15960 * Set this to true if you want popper to position it self in 'fixed' mode 15961 * @prop {Boolean} positionFixed=false 15962 */ 15963 positionFixed: !1, 15964 /** 15965 * Whether events (resize, scroll) are initially enabled. 15966 * @prop {Boolean} eventsEnabled=true 15967 */ 15968 eventsEnabled: !0, 15969 /** 15970 * Set to true if you want to automatically remove the popper when 15971 * you call the `destroy` method. 15972 * @prop {Boolean} removeOnDestroy=false 15973 */ 15974 removeOnDestroy: !1, 15975 /** 15976 * Callback called when the popper is created.<br /> 15977 * By default, it is set to no-op.<br /> 15978 * Access Popper.js instance with `data.instance`. 15979 * @prop {onCreate} 15980 */ 15981 onCreate: function() { 15982 }, 15983 /** 15984 * Callback called when the popper is updated. This callback is not called 15985 * on the initialization/creation of the popper, but only on subsequent 15986 * updates.<br /> 15987 * By default, it is set to no-op.<br /> 15988 * Access Popper.js instance with `data.instance`. 15989 * @prop {onUpdate} 15990 */ 15991 onUpdate: function() { 15992 }, 15993 /** 15994 * List of modifiers used to modify the offsets before they are applied to the popper. 15995 * They provide most of the functionalities of Popper.js. 15996 * @prop {modifiers} 15997 */ 15998 modifiers 15999}, Popper = (function() { 16000 function Popper2(reference, popper) { 16001 var _this = this, options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 16002 classCallCheck(this, Popper2), this.scheduleUpdate = function() { 16003 return requestAnimationFrame(_this.update); 16004 }, this.update = debounce2(this.update.bind(this)), this.options = _extends2({}, Popper2.Defaults, options2), this.state = { 16005 isDestroyed: !1, 16006 isCreated: !1, 16007 scrollParents: [] 16008 }, this.reference = reference && reference.jquery ? reference[0] : reference, this.popper = popper && popper.jquery ? popper[0] : popper, this.options.modifiers = {}, Object.keys(_extends2({}, Popper2.Defaults.modifiers, options2.modifiers)).forEach(function(name) { 16009 _this.options.modifiers[name] = _extends2({}, Popper2.Defaults.modifiers[name] || {}, options2.modifiers ? options2.modifiers[name] : {}); 16010 }), this.modifiers = Object.keys(this.options.modifiers).map(function(name) { 16011 return _extends2({ 16012 name 16013 }, _this.options.modifiers[name]); 16014 }).sort(function(a2, b2) { 16015 return a2.order - b2.order; 16016 }), this.modifiers.forEach(function(modifierOptions) { 16017 modifierOptions.enabled && isFunction3(modifierOptions.onLoad) && modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 16018 }), this.update(); 16019 var eventsEnabled = this.options.eventsEnabled; 16020 eventsEnabled && this.enableEventListeners(), this.state.eventsEnabled = eventsEnabled; 16021 } 16022 return createClass(Popper2, [{ 16023 key: "update", 16024 value: function() { 16025 return update.call(this); 16026 } 16027 }, { 16028 key: "destroy", 16029 value: function() { 16030 return destroy.call(this); 16031 } 16032 }, { 16033 key: "enableEventListeners", 16034 value: function() { 16035 return enableEventListeners.call(this); 16036 } 16037 }, { 16038 key: "disableEventListeners", 16039 value: function() { 16040 return disableEventListeners.call(this); 16041 } 16042 /** 16043 * Schedules an update. It will run on the next UI update available. 16044 * @method scheduleUpdate 16045 * @memberof Popper 16046 */ 16047 /** 16048 * Collection of utilities useful when writing custom modifiers. 16049 * Starting from version 1.7, this method is available only if you 16050 * include `popper-utils.js` before `popper.js`. 16051 * 16052 * **DEPRECATION**: This way to access PopperUtils is deprecated 16053 * and will be removed in v2! Use the PopperUtils module directly instead. 16054 * Due to the high instability of the methods contained in Utils, we can't 16055 * guarantee them to follow semver. Use them at your own risk! 16056 * @static 16057 * @private 16058 * @type {Object} 16059 * @deprecated since version 1.8 16060 * @member Utils 16061 * @memberof Popper 16062 */ 16063 }]), Popper2; 16064})(); 16065Popper.Utils = (typeof window < "u" ? window : global).PopperUtils; 16066Popper.placements = placements; 16067Popper.Defaults = Defaults; 16068var popper_default = Popper; 16069
vendor: 96 bytes, lines 16070-16072
16070// ../../node_modules/react-floater/es/index.js 16071var import_deepmerge = __toESM(require_cjs()); 16072
vendor: 4,913 bytes, lines 16073-16241
16073// ../../node_modules/react-floater/node_modules/is-lite/esm/index.js 16074var DOM_PROPERTIES_TO_CHECK2 = [ 16075 "innerHTML", 16076 "ownerDocument", 16077 "style", 16078 "attributes", 16079 "nodeValue" 16080], objectTypes2 = [ 16081 "Array", 16082 "ArrayBuffer", 16083 "AsyncFunction", 16084 "AsyncGenerator", 16085 "AsyncGeneratorFunction", 16086 "Date", 16087 "Error", 16088 "Function", 16089 "Generator", 16090 "GeneratorFunction", 16091 "HTMLElement", 16092 "Map", 16093 "Object", 16094 "Promise", 16095 "RegExp", 16096 "Set", 16097 "WeakMap", 16098 "WeakSet" 16099], primitiveTypes2 = [ 16100 "bigint", 16101 "boolean", 16102 "null", 16103 "number", 16104 "string", 16105 "symbol", 16106 "undefined" 16107]; 16108function getObjectType2(value) { 16109 var objectTypeName = Object.prototype.toString.call(value).slice(8, -1); 16110 if (/HTML\w+Element/.test(objectTypeName)) 16111 return "HTMLElement"; 16112 if (isObjectType2(objectTypeName)) 16113 return objectTypeName; 16114} 16115function isObjectOfType2(type) { 16116 return function(value) { 16117 return getObjectType2(value) === type; 16118 }; 16119} 16120function isObjectType2(name) { 16121 return objectTypes2.includes(name); 16122} 16123function isOfType3(type) { 16124 return function(value) { 16125 return typeof value === type; 16126 }; 16127} 16128function isPrimitiveType2(name) { 16129 return primitiveTypes2.includes(name); 16130} 16131function is2(value) { 16132 if (value === null) 16133 return "null"; 16134 switch (typeof value) { 16135 case "bigint": 16136 return "bigint"; 16137 case "boolean": 16138 return "boolean"; 16139 case "number": 16140 return "number"; 16141 case "string": 16142 return "string"; 16143 case "symbol": 16144 return "symbol"; 16145 case "undefined": 16146 return "undefined"; 16147 default: 16148 } 16149 if (is2.array(value)) 16150 return "Array"; 16151 if (is2.plainFunction(value)) 16152 return "Function"; 16153 var tagType = getObjectType2(value); 16154 return tagType || "Object"; 16155} 16156is2.array = Array.isArray; 16157is2.arrayOf = function(target, predicate) { 16158 return !is2.array(target) && !is2.function(predicate) ? !1 : target.every(function(d2) { 16159 return predicate(d2); 16160 }); 16161}; 16162is2.asyncGeneratorFunction = function(value) { 16163 return getObjectType2(value) === "AsyncGeneratorFunction"; 16164}; 16165is2.asyncFunction = isObjectOfType2("AsyncFunction"); 16166is2.bigint = isOfType3("bigint"); 16167is2.boolean = function(value) { 16168 return value === !0 || value === !1; 16169}; 16170is2.date = isObjectOfType2("Date"); 16171is2.defined = function(value) { 16172 return !is2.undefined(value); 16173}; 16174is2.domElement = function(value) { 16175 return is2.object(value) && !is2.plainObject(value) && value.nodeType === 1 && is2.string(value.nodeName) && DOM_PROPERTIES_TO_CHECK2.every(function(property) { 16176 return property in value; 16177 }); 16178}; 16179is2.empty = function(value) { 16180 return is2.string(value) && value.length === 0 || is2.array(value) && value.length === 0 || is2.object(value) && !is2.map(value) && !is2.set(value) && Object.keys(value).length === 0 || is2.set(value) && value.size === 0 || is2.map(value) && value.size === 0; 16181}; 16182is2.error = isObjectOfType2("Error"); 16183is2.function = isOfType3("function"); 16184is2.generator = function(value) { 16185 return is2.iterable(value) && is2.function(value.next) && is2.function(value.throw); 16186}; 16187is2.generatorFunction = isObjectOfType2("GeneratorFunction"); 16188is2.instanceOf = function(instance, class_) { 16189 return !instance || !class_ ? !1 : Object.getPrototypeOf(instance) === class_.prototype; 16190}; 16191is2.iterable = function(value) { 16192 return !is2.nullOrUndefined(value) && is2.function(value[Symbol.iterator]); 16193}; 16194is2.map = isObjectOfType2("Map"); 16195is2.nan = function(value) { 16196 return Number.isNaN(value); 16197}; 16198is2.null = function(value) { 16199 return value === null; 16200}; 16201is2.nullOrUndefined = function(value) { 16202 return is2.null(value) || is2.undefined(value); 16203}; 16204is2.number = function(value) { 16205 return isOfType3("number")(value) && !is2.nan(value); 16206}; 16207is2.numericString = function(value) { 16208 return is2.string(value) && value.length > 0 && !Number.isNaN(Number(value)); 16209}; 16210is2.object = function(value) { 16211 return !is2.nullOrUndefined(value) && (is2.function(value) || typeof value == "object"); 16212}; 16213is2.oneOf = function(target, value) { 16214 return is2.array(target) ? target.indexOf(value) > -1 : !1; 16215}; 16216is2.plainFunction = isObjectOfType2("Function"); 16217is2.plainObject = function(value) { 16218 if (getObjectType2(value) !== "Object") 16219 return !1; 16220 var prototype = Object.getPrototypeOf(value); 16221 return prototype === null || prototype === Object.getPrototypeOf({}); 16222}; 16223is2.primitive = function(value) { 16224 return is2.null(value) || isPrimitiveType2(typeof value); 16225}; 16226is2.promise = isObjectOfType2("Promise"); 16227is2.propertyOf = function(target, key, predicate) { 16228 if (!is2.object(target) || !key) 16229 return !1; 16230 var value = target[key]; 16231 return is2.function(predicate) ? predicate(value) : is2.defined(value); 16232}; 16233is2.regexp = isObjectOfType2("RegExp"); 16234is2.set = isObjectOfType2("Set"); 16235is2.string = isOfType3("string"); 16236is2.symbol = isOfType3("symbol"); 16237is2.undefined = isOfType3("undefined"); 16238is2.weakMap = isObjectOfType2("WeakMap"); 16239is2.weakSet = isObjectOfType2("WeakSet"); 16240var esm_default = is2; 16241
vendor: 559 bytes, lines 16242-16255
16242// ../../node_modules/tree-changes/node_modules/@gilbarbara/deep-equal/esm/helpers.js 16243function isOfType4(type) { 16244 return function(value) { 16245 return typeof value === type; 16246 }; 16247} 16248var isFunction4 = isOfType4("function"), isNull3 = function(value) { 16249 return value === null; 16250}, isRegex2 = function(value) { 16251 return Object.prototype.toString.call(value).slice(8, -1) === "RegExp"; 16252}, isObject2 = function(value) { 16253 return !isUndefined3(value) && !isNull3(value) && (isFunction4(value) || typeof value == "object"); 16254}, isUndefined3 = isOfType4("undefined"); 16255
vendor: 3,865 bytes, lines 16256-16376
16256// ../../node_modules/tree-changes/node_modules/@gilbarbara/deep-equal/esm/index.js 16257var __values = function(o3) { 16258 var s2 = typeof Symbol == "function" && Symbol.iterator, m2 = s2 && o3[s2], i2 = 0; 16259 if (m2) return m2.call(o3); 16260 if (o3 && typeof o3.length == "number") return { 16261 next: function() { 16262 return o3 && i2 >= o3.length && (o3 = void 0), { value: o3 && o3[i2++], done: !o3 }; 16263 } 16264 }; 16265 throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); 16266}; 16267function equalArray2(left, right) { 16268 var length = left.length; 16269 if (length !== right.length) 16270 return !1; 16271 for (var index = length; index-- !== 0; ) 16272 if (!equal2(left[index], right[index])) 16273 return !1; 16274 return !0; 16275} 16276function equalArrayBuffer2(left, right) { 16277 if (left.byteLength !== right.byteLength) 16278 return !1; 16279 for (var view1 = new DataView(left.buffer), view2 = new DataView(right.buffer), index = left.byteLength; index--; ) 16280 if (view1.getUint8(index) !== view2.getUint8(index)) 16281 return !1; 16282 return !0; 16283} 16284function equalMap2(left, right) { 16285 var e_1, _a2, e_2, _b; 16286 if (left.size !== right.size) 16287 return !1; 16288 try { 16289 for (var _c = __values(left.entries()), _d = _c.next(); !_d.done; _d = _c.next()) { 16290 var index = _d.value; 16291 if (!right.has(index[0])) 16292 return !1; 16293 } 16294 } catch (e_1_1) { 16295 e_1 = { error: e_1_1 }; 16296 } finally { 16297 try { 16298 _d && !_d.done && (_a2 = _c.return) && _a2.call(_c); 16299 } finally { 16300 if (e_1) throw e_1.error; 16301 } 16302 } 16303 try { 16304 for (var _e = __values(left.entries()), _f = _e.next(); !_f.done; _f = _e.next()) { 16305 var index = _f.value; 16306 if (!equal2(index[1], right.get(index[0]))) 16307 return !1; 16308 } 16309 } catch (e_2_1) { 16310 e_2 = { error: e_2_1 }; 16311 } finally { 16312 try { 16313 _f && !_f.done && (_b = _e.return) && _b.call(_e); 16314 } finally { 16315 if (e_2) throw e_2.error; 16316 } 16317 } 16318 return !0; 16319} 16320function equalSet2(left, right) { 16321 var e_3, _a2; 16322 if (left.size !== right.size) 16323 return !1; 16324 try { 16325 for (var _b = __values(left.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { 16326 var index = _c.value; 16327 if (!right.has(index[0])) 16328 return !1; 16329 } 16330 } catch (e_3_1) { 16331 e_3 = { error: e_3_1 }; 16332 } finally { 16333 try { 16334 _c && !_c.done && (_a2 = _b.return) && _a2.call(_b); 16335 } finally { 16336 if (e_3) throw e_3.error; 16337 } 16338 } 16339 return !0; 16340} 16341function equal2(left, right) { 16342 if (left === right) 16343 return !0; 16344 if (left && isObject2(left) && right && isObject2(right)) { 16345 if (left.constructor !== right.constructor) 16346 return !1; 16347 if (Array.isArray(left) && Array.isArray(right)) 16348 return equalArray2(left, right); 16349 if (left instanceof Map && right instanceof Map) 16350 return equalMap2(left, right); 16351 if (left instanceof Set && right instanceof Set) 16352 return equalSet2(left, right); 16353 if (ArrayBuffer.isView(left) && ArrayBuffer.isView(right)) 16354 return equalArrayBuffer2(left, right); 16355 if (isRegex2(left) && isRegex2(right)) 16356 return left.source === right.source && left.flags === right.flags; 16357 if (left.valueOf !== Object.prototype.valueOf) 16358 return left.valueOf() === right.valueOf(); 16359 if (left.toString !== Object.prototype.toString) 16360 return left.toString() === right.toString(); 16361 var leftKeys = Object.keys(left), rightKeys = Object.keys(right); 16362 if (leftKeys.length !== rightKeys.length) 16363 return !1; 16364 for (var index = leftKeys.length; index-- !== 0; ) 16365 if (!Object.prototype.hasOwnProperty.call(right, leftKeys[index])) 16366 return !1; 16367 for (var index = leftKeys.length; index-- !== 0; ) { 16368 var key = leftKeys[index]; 16369 if (!(key === "_owner" && left.$$typeof) && !equal2(left[key], right[key])) 16370 return !1; 16371 } 16372 return !0; 16373 } 16374 return Number.isNaN(left) && Number.isNaN(right) ? !0 : left === right; 16375} 16376
vendor: 4,913 bytes, lines 16377-16545
16377// ../../node_modules/tree-changes/node_modules/is-lite/esm/index.js 16378var DOM_PROPERTIES_TO_CHECK3 = [ 16379 "innerHTML", 16380 "ownerDocument", 16381 "style", 16382 "attributes", 16383 "nodeValue" 16384], objectTypes3 = [ 16385 "Array", 16386 "ArrayBuffer", 16387 "AsyncFunction", 16388 "AsyncGenerator", 16389 "AsyncGeneratorFunction", 16390 "Date", 16391 "Error", 16392 "Function", 16393 "Generator", 16394 "GeneratorFunction", 16395 "HTMLElement", 16396 "Map", 16397 "Object", 16398 "Promise", 16399 "RegExp", 16400 "Set", 16401 "WeakMap", 16402 "WeakSet" 16403], primitiveTypes3 = [ 16404 "bigint", 16405 "boolean", 16406 "null", 16407 "number", 16408 "string", 16409 "symbol", 16410 "undefined" 16411]; 16412function getObjectType3(value) { 16413 var objectTypeName = Object.prototype.toString.call(value).slice(8, -1); 16414 if (/HTML\w+Element/.test(objectTypeName)) 16415 return "HTMLElement"; 16416 if (isObjectType3(objectTypeName)) 16417 return objectTypeName; 16418} 16419function isObjectOfType3(type) { 16420 return function(value) { 16421 return getObjectType3(value) === type; 16422 }; 16423} 16424function isObjectType3(name) { 16425 return objectTypes3.includes(name); 16426} 16427function isOfType5(type) { 16428 return function(value) { 16429 return typeof value === type; 16430 }; 16431} 16432function isPrimitiveType3(name) { 16433 return primitiveTypes3.includes(name); 16434} 16435function is3(value) { 16436 if (value === null) 16437 return "null"; 16438 switch (typeof value) { 16439 case "bigint": 16440 return "bigint"; 16441 case "boolean": 16442 return "boolean"; 16443 case "number": 16444 return "number"; 16445 case "string": 16446 return "string"; 16447 case "symbol": 16448 return "symbol"; 16449 case "undefined": 16450 return "undefined"; 16451 default: 16452 } 16453 if (is3.array(value)) 16454 return "Array"; 16455 if (is3.plainFunction(value)) 16456 return "Function"; 16457 var tagType = getObjectType3(value); 16458 return tagType || "Object"; 16459} 16460is3.array = Array.isArray; 16461is3.arrayOf = function(target, predicate) { 16462 return !is3.array(target) && !is3.function(predicate) ? !1 : target.every(function(d2) { 16463 return predicate(d2); 16464 }); 16465}; 16466is3.asyncGeneratorFunction = function(value) { 16467 return getObjectType3(value) === "AsyncGeneratorFunction"; 16468}; 16469is3.asyncFunction = isObjectOfType3("AsyncFunction"); 16470is3.bigint = isOfType5("bigint"); 16471is3.boolean = function(value) { 16472 return value === !0 || value === !1; 16473}; 16474is3.date = isObjectOfType3("Date"); 16475is3.defined = function(value) { 16476 return !is3.undefined(value); 16477}; 16478is3.domElement = function(value) { 16479 return is3.object(value) && !is3.plainObject(value) && value.nodeType === 1 && is3.string(value.nodeName) && DOM_PROPERTIES_TO_CHECK3.every(function(property) { 16480 return property in value; 16481 }); 16482}; 16483is3.empty = function(value) { 16484 return is3.string(value) && value.length === 0 || is3.array(value) && value.length === 0 || is3.object(value) && !is3.map(value) && !is3.set(value) && Object.keys(value).length === 0 || is3.set(value) && value.size === 0 || is3.map(value) && value.size === 0; 16485}; 16486is3.error = isObjectOfType3("Error"); 16487is3.function = isOfType5("function"); 16488is3.generator = function(value) { 16489 return is3.iterable(value) && is3.function(value.next) && is3.function(value.throw); 16490}; 16491is3.generatorFunction = isObjectOfType3("GeneratorFunction"); 16492is3.instanceOf = function(instance, class_) { 16493 return !instance || !class_ ? !1 : Object.getPrototypeOf(instance) === class_.prototype; 16494}; 16495is3.iterable = function(value) { 16496 return !is3.nullOrUndefined(value) && is3.function(value[Symbol.iterator]); 16497}; 16498is3.map = isObjectOfType3("Map"); 16499is3.nan = function(value) { 16500 return Number.isNaN(value); 16501}; 16502is3.null = function(value) { 16503 return value === null; 16504}; 16505is3.nullOrUndefined = function(value) { 16506 return is3.null(value) || is3.undefined(value); 16507}; 16508is3.number = function(value) { 16509 return isOfType5("number")(value) && !is3.nan(value); 16510}; 16511is3.numericString = function(value) { 16512 return is3.string(value) && value.length > 0 && !Number.isNaN(Number(value)); 16513}; 16514is3.object = function(value) { 16515 return !is3.nullOrUndefined(value) && (is3.function(value) || typeof value == "object"); 16516}; 16517is3.oneOf = function(target, value) { 16518 return is3.array(target) ? target.indexOf(value) > -1 : !1; 16519}; 16520is3.plainFunction = isObjectOfType3("Function"); 16521is3.plainObject = function(value) { 16522 if (getObjectType3(value) !== "Object") 16523 return !1; 16524 var prototype = Object.getPrototypeOf(value); 16525 return prototype === null || prototype === Object.getPrototypeOf({}); 16526}; 16527is3.primitive = function(value) { 16528 return is3.null(value) || isPrimitiveType3(typeof value); 16529}; 16530is3.promise = isObjectOfType3("Promise"); 16531is3.propertyOf = function(target, key, predicate) { 16532 if (!is3.object(target) || !key) 16533 return !1; 16534 var value = target[key]; 16535 return is3.function(predicate) ? predicate(value) : is3.defined(value); 16536}; 16537is3.regexp = isObjectOfType3("RegExp"); 16538is3.set = isObjectOfType3("Set"); 16539is3.string = isOfType5("string"); 16540is3.symbol = isOfType5("symbol"); 16541is3.undefined = isOfType5("undefined"); 16542is3.weakMap = isObjectOfType3("WeakMap"); 16543is3.weakSet = isObjectOfType3("WeakSet"); 16544var esm_default2 = is3; 16545
vendor: 4,472 bytes, lines 16546-16632
16546// ../../node_modules/tree-changes/esm/helpers.js 16547function canHaveLength2() { 16548 for (var arguments_ = [], _i = 0; _i < arguments.length; _i++) 16549 arguments_[_i] = arguments[_i]; 16550 return arguments_.every(function(d2) { 16551 return esm_default2.string(d2) || esm_default2.array(d2) || esm_default2.plainObject(d2); 16552 }); 16553} 16554function checkEquality2(left, right, value) { 16555 return isSameType2(left, right) ? [left, right].every(esm_default2.array) ? !left.some(hasValue2(value)) && right.some(hasValue2(value)) : [left, right].every(esm_default2.plainObject) ? !Object.entries(left).some(hasEntry2(value)) && Object.entries(right).some(hasEntry2(value)) : right === value : !1; 16556} 16557function compareNumbers2(previousData, data, options2) { 16558 var actual = options2.actual, key = options2.key, previous = options2.previous, type = options2.type, left = nested2(previousData, key), right = nested2(data, key), changed = [left, right].every(esm_default2.number) && (type === "increased" ? left < right : left > right); 16559 return esm_default2.undefined(actual) || (changed = changed && right === actual), esm_default2.undefined(previous) || (changed = changed && left === previous), changed; 16560} 16561function compareValues2(previousData, data, options2) { 16562 var key = options2.key, type = options2.type, value = options2.value, left = nested2(previousData, key), right = nested2(data, key), primary = type === "added" ? left : right, secondary = type === "added" ? right : left; 16563 if (!esm_default2.nullOrUndefined(value)) { 16564 if (esm_default2.defined(primary)) { 16565 if (esm_default2.array(primary) || esm_default2.plainObject(primary)) 16566 return checkEquality2(primary, secondary, value); 16567 } else 16568 return equal2(secondary, value); 16569 return !1; 16570 } 16571 return [left, right].every(esm_default2.array) ? !secondary.every(isEqualPredicate2(primary)) : [left, right].every(esm_default2.plainObject) ? hasExtraKeys2(Object.keys(primary), Object.keys(secondary)) : ![left, right].every(function(d2) { 16572 return esm_default2.primitive(d2) && esm_default2.defined(d2); 16573 }) && (type === "added" ? !esm_default2.defined(left) && esm_default2.defined(right) : esm_default2.defined(left) && !esm_default2.defined(right)); 16574} 16575function getIterables2(previousData, data, _a2) { 16576 var _b = _a2 === void 0 ? {} : _a2, key = _b.key, left = nested2(previousData, key), right = nested2(data, key); 16577 if (!isSameType2(left, right)) 16578 throw new TypeError("Inputs have different types"); 16579 if (!canHaveLength2(left, right)) 16580 throw new TypeError("Inputs don't have length"); 16581 return [left, right].every(esm_default2.plainObject) && (left = Object.keys(left), right = Object.keys(right)), [left, right]; 16582} 16583function hasEntry2(input) { 16584 return function(_a2) { 16585 var key = _a2[0], value = _a2[1]; 16586 return esm_default2.array(input) ? equal2(input, value) || input.some(function(d2) { 16587 return equal2(d2, value) || esm_default2.array(value) && isEqualPredicate2(value)(d2); 16588 }) : esm_default2.plainObject(input) && input[key] ? !!input[key] && equal2(input[key], value) : equal2(input, value); 16589 }; 16590} 16591function hasExtraKeys2(left, right) { 16592 return right.some(function(d2) { 16593 return !left.includes(d2); 16594 }); 16595} 16596function hasValue2(input) { 16597 return function(value) { 16598 return esm_default2.array(input) ? input.some(function(d2) { 16599 return equal2(d2, value) || esm_default2.array(value) && isEqualPredicate2(value)(d2); 16600 }) : equal2(input, value); 16601 }; 16602} 16603function includesOrEqualsTo2(previousValue, value) { 16604 return esm_default2.array(previousValue) ? previousValue.some(function(d2) { 16605 return equal2(d2, value); 16606 }) : equal2(previousValue, value); 16607} 16608function isEqualPredicate2(data) { 16609 return function(value) { 16610 return data.some(function(d2) { 16611 return equal2(d2, value); 16612 }); 16613 }; 16614} 16615function isSameType2() { 16616 for (var arguments_ = [], _i = 0; _i < arguments.length; _i++) 16617 arguments_[_i] = arguments[_i]; 16618 return arguments_.every(esm_default2.array) || arguments_.every(esm_default2.number) || arguments_.every(esm_default2.plainObject) || arguments_.every(esm_default2.string); 16619} 16620function nested2(data, property) { 16621 if (esm_default2.plainObject(data) || esm_default2.array(data)) { 16622 if (esm_default2.string(property)) { 16623 var props = property.split("."); 16624 return props.reduce(function(acc, d2) { 16625 return acc && acc[d2]; 16626 }, data); 16627 } 16628 return esm_default2.number(property) ? data[property] : data; 16629 } 16630 return data; 16631} 16632
vendor: 2,903 bytes, lines 16633-16708
16633// ../../node_modules/tree-changes/esm/index.js 16634function treeChanges2(previousData, data) { 16635 if ([previousData, data].some(esm_default2.nullOrUndefined)) 16636 throw new Error("Missing required parameters"); 16637 if (![previousData, data].every(function(d2) { 16638 return esm_default2.plainObject(d2) || esm_default2.array(d2); 16639 })) 16640 throw new Error("Expected plain objects or array"); 16641 var added = function(key, value) { 16642 try { 16643 return compareValues2(previousData, data, { key, type: "added", value }); 16644 } catch { 16645 return !1; 16646 } 16647 }, changed = function(key, actual, previous) { 16648 try { 16649 var left = nested2(previousData, key), right = nested2(data, key), hasActual = esm_default2.defined(actual), hasPrevious = esm_default2.defined(previous); 16650 if (hasActual || hasPrevious) { 16651 var leftComparator = hasPrevious ? includesOrEqualsTo2(previous, left) : !includesOrEqualsTo2(actual, left), rightComparator = includesOrEqualsTo2(actual, right); 16652 return leftComparator && rightComparator; 16653 } 16654 return [left, right].every(esm_default2.array) || [left, right].every(esm_default2.plainObject) ? !equal2(left, right) : left !== right; 16655 } catch { 16656 return !1; 16657 } 16658 }, changedFrom = function(key, previous, actual) { 16659 if (!esm_default2.defined(key)) 16660 return !1; 16661 try { 16662 var left = nested2(previousData, key), right = nested2(data, key), hasActual = esm_default2.defined(actual); 16663 return includesOrEqualsTo2(previous, left) && (hasActual ? includesOrEqualsTo2(actual, right) : !hasActual); 16664 } catch { 16665 return !1; 16666 } 16667 }, changedTo = function(key, actual) { 16668 return esm_default2.defined(key) ? changed(key, actual) : !1; 16669 }, decreased = function(key, actual, previous) { 16670 if (!esm_default2.defined(key)) 16671 return !1; 16672 try { 16673 return compareNumbers2(previousData, data, { key, actual, previous, type: "decreased" }); 16674 } catch { 16675 return !1; 16676 } 16677 }, emptied = function(key) { 16678 try { 16679 var _a2 = getIterables2(previousData, data, { key }), left = _a2[0], right = _a2[1]; 16680 return !!left.length && !right.length; 16681 } catch { 16682 return !1; 16683 } 16684 }, filled = function(key) { 16685 try { 16686 var _a2 = getIterables2(previousData, data, { key }), left = _a2[0], right = _a2[1]; 16687 return !left.length && !!right.length; 16688 } catch { 16689 return !1; 16690 } 16691 }, increased = function(key, actual, previous) { 16692 if (!esm_default2.defined(key)) 16693 return !1; 16694 try { 16695 return compareNumbers2(previousData, data, { key, actual, previous, type: "increased" }); 16696 } catch { 16697 return !1; 16698 } 16699 }, removed = function(key, value) { 16700 try { 16701 return compareValues2(previousData, data, { key, type: "removed", value }); 16702 } catch { 16703 return !1; 16704 } 16705 }; 16706 return { added, changed, changedFrom, changedTo, decreased, emptied, filled, increased, removed }; 16707} 16708
vendor: 40,401 bytes, lines 16709-17129
16709// ../../node_modules/react-floater/es/index.js 16710function ownKeys(e2, r4) { 16711 var t2 = Object.keys(e2); 16712 if (Object.getOwnPropertySymbols) { 16713 var o3 = Object.getOwnPropertySymbols(e2); 16714 r4 && (o3 = o3.filter(function(r5) { 16715 return Object.getOwnPropertyDescriptor(e2, r5).enumerable; 16716 })), t2.push.apply(t2, o3); 16717 } 16718 return t2; 16719} 16720function _objectSpread2(e2) { 16721 for (var r4 = 1; r4 < arguments.length; r4++) { 16722 var t2 = arguments[r4] != null ? arguments[r4] : {}; 16723 r4 % 2 ? ownKeys(Object(t2), !0).forEach(function(r5) { 16724 _defineProperty(e2, r5, t2[r5]); 16725 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r5) { 16726 Object.defineProperty(e2, r5, Object.getOwnPropertyDescriptor(t2, r5)); 16727 }); 16728 } 16729 return e2; 16730} 16731function _classCallCheck(instance, Constructor) { 16732 if (!(instance instanceof Constructor)) 16733 throw new TypeError("Cannot call a class as a function"); 16734} 16735function _defineProperties(target, props) { 16736 for (var i2 = 0; i2 < props.length; i2++) { 16737 var descriptor = props[i2]; 16738 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); 16739 } 16740} 16741function _createClass(Constructor, protoProps, staticProps) { 16742 return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Object.defineProperty(Constructor, "prototype", { 16743 writable: !1 16744 }), Constructor; 16745} 16746function _defineProperty(obj, key, value) { 16747 return key = _toPropertyKey(key), key in obj ? Object.defineProperty(obj, key, { 16748 value, 16749 enumerable: !0, 16750 configurable: !0, 16751 writable: !0 16752 }) : obj[key] = value, obj; 16753} 16754function _inherits(subClass, superClass) { 16755 if (typeof superClass != "function" && superClass !== null) 16756 throw new TypeError("Super expression must either be null or a function"); 16757 subClass.prototype = Object.create(superClass && superClass.prototype, { 16758 constructor: { 16759 value: subClass, 16760 writable: !0, 16761 configurable: !0 16762 } 16763 }), Object.defineProperty(subClass, "prototype", { 16764 writable: !1 16765 }), superClass && _setPrototypeOf2(subClass, superClass); 16766} 16767function _getPrototypeOf2(o3) { 16768 return _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(o4) { 16769 return o4.__proto__ || Object.getPrototypeOf(o4); 16770 }, _getPrototypeOf2(o3); 16771} 16772function _setPrototypeOf2(o3, p2) { 16773 return _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o4, p3) { 16774 return o4.__proto__ = p3, o4; 16775 }, _setPrototypeOf2(o3, p2); 16776} 16777function _isNativeReflectConstruct2() { 16778 if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1; 16779 if (typeof Proxy == "function") return !0; 16780 try { 16781 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { 16782 })), !0; 16783 } catch { 16784 return !1; 16785 } 16786} 16787function _objectWithoutPropertiesLoose(source, excluded) { 16788 if (source == null) return {}; 16789 var target = {}, sourceKeys = Object.keys(source), key, i2; 16790 for (i2 = 0; i2 < sourceKeys.length; i2++) 16791 key = sourceKeys[i2], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]); 16792 return target; 16793} 16794function _objectWithoutProperties(source, excluded) { 16795 if (source == null) return {}; 16796 var target = _objectWithoutPropertiesLoose(source, excluded), key, i2; 16797 if (Object.getOwnPropertySymbols) { 16798 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 16799 for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) 16800 key = sourceSymbolKeys[i2], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]); 16801 } 16802 return target; 16803} 16804function _assertThisInitialized2(self2) { 16805 if (self2 === void 0) 16806 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 16807 return self2; 16808} 16809function _possibleConstructorReturn(self2, call) { 16810 if (call && (typeof call == "object" || typeof call == "function")) 16811 return call; 16812 if (call !== void 0) 16813 throw new TypeError("Derived constructors may only return object or undefined"); 16814 return _assertThisInitialized2(self2); 16815} 16816function _createSuper(Derived) { 16817 var hasNativeReflectConstruct = _isNativeReflectConstruct2(); 16818 return function() { 16819 var Super = _getPrototypeOf2(Derived), result; 16820 if (hasNativeReflectConstruct) { 16821 var NewTarget = _getPrototypeOf2(this).constructor; 16822 result = Reflect.construct(Super, arguments, NewTarget); 16823 } else 16824 result = Super.apply(this, arguments); 16825 return _possibleConstructorReturn(this, result); 16826 }; 16827} 16828function _toPrimitive(input, hint) { 16829 if (typeof input != "object" || input === null) return input; 16830 var prim = input[Symbol.toPrimitive]; 16831 if (prim !== void 0) { 16832 var res = prim.call(input, hint || "default"); 16833 if (typeof res != "object") return res; 16834 throw new TypeError("@@toPrimitive must return a primitive value."); 16835 } 16836 return (hint === "string" ? String : Number)(input); 16837} 16838function _toPropertyKey(arg) { 16839 var key = _toPrimitive(arg, "string"); 16840 return typeof key == "symbol" ? key : String(key); 16841} 16842var DEFAULTS = { flip: { padding: 20 }, preventOverflow: { padding: 10 } }, VALIDATOR_ARG_ERROR_MESSAGE = "The typeValidator argument must be a function with the signature function(props, propName, componentName).", MESSAGE_ARG_ERROR_MESSAGE = "The error message is optional, but must be a string if provided."; 16843function propIsRequired(condition, props, propName, componentName2) { 16844 return typeof condition == "boolean" ? condition : typeof condition == "function" ? condition(props, propName, componentName2) : condition ? !!condition : !1; 16845} 16846function propExists(props, propName) { 16847 return Object.hasOwnProperty.call(props, propName); 16848} 16849function missingPropError(props, propName, componentName2, message) { 16850 return message ? new Error(message) : new Error("Required ".concat(props[propName], " `").concat(propName, "` was not specified in `").concat(componentName2, "`.")); 16851} 16852function guardAgainstInvalidArgTypes(typeValidator, message) { 16853 if (typeof typeValidator != "function") 16854 throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE); 16855 if (message && typeof message != "string") 16856 throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE); 16857} 16858function isRequiredIf(typeValidator, condition, message) { 16859 return guardAgainstInvalidArgTypes(typeValidator, message), function(props, propName, componentName2) { 16860 for (var _len = arguments.length, rest2 = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) 16861 rest2[_key - 3] = arguments[_key]; 16862 return propIsRequired(condition, props, propName, componentName2) ? propExists(props, propName) ? typeValidator.apply(void 0, [props, propName, componentName2].concat(rest2)) : missingPropError(props, propName, componentName2, message) : typeValidator.apply(void 0, [props, propName, componentName2].concat(rest2)); 16863 }; 16864} 16865var STATUS2 = { INIT: "init", IDLE: "idle", OPENING: "opening", OPEN: "open", CLOSING: "closing", ERROR: "error" }, isReact16 = react_dom_default.createPortal !== void 0; 16866function canUseDOM() { 16867 return !!(typeof window < "u" && window.document && window.document.createElement); 16868} 16869function isMobile() { 16870 return "ontouchstart" in window && /Mobi/.test(navigator.userAgent); 16871} 16872function log(_ref) { 16873 var title2 = _ref.title, data = _ref.data, _ref$warn = _ref.warn, warn = _ref$warn === void 0 ? !1 : _ref$warn, _ref$debug = _ref.debug, debug = _ref$debug === void 0 ? !1 : _ref$debug, logFn = warn ? console.warn || console.error : console.log; 16874 debug && title2 && data && (console.groupCollapsed("%creact-floater: ".concat(title2), "color: #9b00ff; font-weight: bold; font-size: 12px;"), Array.isArray(data) ? data.forEach(function(d2) { 16875 esm_default.plainObject(d2) && d2.key ? logFn.apply(console, [d2.key, d2.value]) : logFn.apply(console, [d2]); 16876 }) : logFn.apply(console, [data]), console.groupEnd()); 16877} 16878function on(element, event, cb) { 16879 var capture = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1; 16880 element.addEventListener(event, cb, capture); 16881} 16882function off(element, event, cb) { 16883 var capture = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1; 16884 element.removeEventListener(event, cb, capture); 16885} 16886function once3(element, event, cb) { 16887 var capture = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, _nextCB; 16888 _nextCB = function(e2) { 16889 cb(e2), off(element, event, _nextCB); 16890 }, on(element, event, _nextCB, capture); 16891} 16892function noop2() { 16893} 16894var ReactFloaterPortal = (function(_React$Component) { 16895 _inherits(ReactFloaterPortal2, _React$Component); 16896 var _super = _createSuper(ReactFloaterPortal2); 16897 function ReactFloaterPortal2() { 16898 return _classCallCheck(this, ReactFloaterPortal2), _super.apply(this, arguments); 16899 } 16900 return _createClass(ReactFloaterPortal2, [{ key: "componentDidMount", value: function() { 16901 canUseDOM() && (this.node || this.appendNode(), isReact16 || this.renderPortal()); 16902 } }, { key: "componentDidUpdate", value: function() { 16903 canUseDOM() && (isReact16 || this.renderPortal()); 16904 } }, { key: "componentWillUnmount", value: function() { 16905 !canUseDOM() || !this.node || (isReact16 || react_dom_default.unmountComponentAtNode(this.node), this.node && this.node.parentNode === document.body && (document.body.removeChild(this.node), this.node = void 0)); 16906 } }, { key: "appendNode", value: function() { 16907 var _this$props = this.props, id = _this$props.id, zIndex = _this$props.zIndex; 16908 this.node || (this.node = document.createElement("div"), id && (this.node.id = id), zIndex && (this.node.style.zIndex = zIndex), document.body.appendChild(this.node)); 16909 } }, { key: "renderPortal", value: function() { 16910 if (!canUseDOM()) return null; 16911 var _this$props2 = this.props, children = _this$props2.children, setRef = _this$props2.setRef; 16912 if (this.node || this.appendNode(), isReact16) 16913 return react_dom_default.createPortal(children, this.node); 16914 var portal = react_dom_default.unstable_renderSubtreeIntoContainer(this, children.length > 1 ? react_default.createElement("div", null, children) : children[0], this.node); 16915 return setRef(portal), null; 16916 } }, { key: "renderReact16", value: function() { 16917 var _this$props3 = this.props, hasChildren = _this$props3.hasChildren, placement = _this$props3.placement, target = _this$props3.target; 16918 return hasChildren ? this.renderPortal() : target || placement === "center" ? this.renderPortal() : null; 16919 } }, { key: "render", value: function() { 16920 return isReact16 ? this.renderReact16() : null; 16921 } }]), ReactFloaterPortal2; 16922})(react_default.Component); 16923_defineProperty(ReactFloaterPortal, "propTypes", { children: import_prop_types2.default.oneOfType([import_prop_types2.default.element, import_prop_types2.default.array]), hasChildren: import_prop_types2.default.bool, id: import_prop_types2.default.oneOfType([import_prop_types2.default.string, import_prop_types2.default.number]), placement: import_prop_types2.default.string, setRef: import_prop_types2.default.func.isRequired, target: import_prop_types2.default.oneOfType([import_prop_types2.default.object, import_prop_types2.default.string]), zIndex: import_prop_types2.default.number }); 16924var FloaterArrow = (function(_React$Component) { 16925 _inherits(FloaterArrow2, _React$Component); 16926 var _super = _createSuper(FloaterArrow2); 16927 function FloaterArrow2() { 16928 return _classCallCheck(this, FloaterArrow2), _super.apply(this, arguments); 16929 } 16930 return _createClass(FloaterArrow2, [{ key: "parentStyle", get: function() { 16931 var _this$props = this.props, placement = _this$props.placement, styles2 = _this$props.styles, length = styles2.arrow.length, arrow2 = { pointerEvents: "none", position: "absolute", width: "100%" }; 16932 return placement.startsWith("top") ? (arrow2.bottom = 0, arrow2.left = 0, arrow2.right = 0, arrow2.height = length) : placement.startsWith("bottom") ? (arrow2.left = 0, arrow2.right = 0, arrow2.top = 0, arrow2.height = length) : placement.startsWith("left") ? (arrow2.right = 0, arrow2.top = 0, arrow2.bottom = 0) : placement.startsWith("right") && (arrow2.left = 0, arrow2.top = 0), arrow2; 16933 } }, { key: "render", value: function() { 16934 var _this$props2 = this.props, placement = _this$props2.placement, setArrowRef = _this$props2.setArrowRef, styles2 = _this$props2.styles, _styles$arrow = styles2.arrow, color2 = _styles$arrow.color, display = _styles$arrow.display, length = _styles$arrow.length, margin = _styles$arrow.margin, position = _styles$arrow.position, spread2 = _styles$arrow.spread, arrowStyles = { display, position }, points, x2 = spread2, y2 = length; 16935 return placement.startsWith("top") ? (points = "0,0 ".concat(x2 / 2, ",").concat(y2, " ").concat(x2, ",0"), arrowStyles.bottom = 0, arrowStyles.marginLeft = margin, arrowStyles.marginRight = margin) : placement.startsWith("bottom") ? (points = "".concat(x2, ",").concat(y2, " ").concat(x2 / 2, ",0 0,").concat(y2), arrowStyles.top = 0, arrowStyles.marginLeft = margin, arrowStyles.marginRight = margin) : placement.startsWith("left") ? (y2 = spread2, x2 = length, points = "0,0 ".concat(x2, ",").concat(y2 / 2, " 0,").concat(y2), arrowStyles.right = 0, arrowStyles.marginTop = margin, arrowStyles.marginBottom = margin) : placement.startsWith("right") && (y2 = spread2, x2 = length, points = "".concat(x2, ",").concat(y2, " ").concat(x2, ",0 0,").concat(y2 / 2), arrowStyles.left = 0, arrowStyles.marginTop = margin, arrowStyles.marginBottom = margin), react_default.createElement("div", { className: "__floater__arrow", style: this.parentStyle }, react_default.createElement("span", { ref: setArrowRef, style: arrowStyles }, react_default.createElement("svg", { width: x2, height: y2, version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, react_default.createElement("polygon", { points, fill: color2 })))); 16936 } }]), FloaterArrow2; 16937})(react_default.Component); 16938_defineProperty(FloaterArrow, "propTypes", { placement: import_prop_types2.default.string.isRequired, setArrowRef: import_prop_types2.default.func.isRequired, styles: import_prop_types2.default.object.isRequired }); 16939var _excluded$1 = ["color", "height", "width"]; 16940function FloaterCloseBtn(_ref) { 16941 var handleClick = _ref.handleClick, styles2 = _ref.styles, color2 = styles2.color, height = styles2.height, width = styles2.width, style = _objectWithoutProperties(styles2, _excluded$1); 16942 return react_default.createElement("button", { "aria-label": "close", onClick: handleClick, style, type: "button" }, react_default.createElement("svg", { width: "".concat(width, "px"), height: "".concat(height, "px"), viewBox: "0 0 18 18", version: "1.1", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid" }, react_default.createElement("g", null, react_default.createElement("path", { d: "M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z", fill: color2 })))); 16943} 16944FloaterCloseBtn.propTypes = { handleClick: import_prop_types2.default.func.isRequired, styles: import_prop_types2.default.object.isRequired }; 16945function FloaterContainer(_ref) { 16946 var content = _ref.content, footer = _ref.footer, handleClick = _ref.handleClick, open = _ref.open, positionWrapper = _ref.positionWrapper, showCloseButton = _ref.showCloseButton, title2 = _ref.title, styles2 = _ref.styles, output = { content: react_default.isValidElement(content) ? content : react_default.createElement("div", { className: "__floater__content", style: styles2.content }, content) }; 16947 return title2 && (output.title = react_default.isValidElement(title2) ? title2 : react_default.createElement("div", { className: "__floater__title", style: styles2.title }, title2)), footer && (output.footer = react_default.isValidElement(footer) ? footer : react_default.createElement("div", { className: "__floater__footer", style: styles2.footer }, footer)), (showCloseButton || positionWrapper) && !esm_default.boolean(open) && (output.close = react_default.createElement(FloaterCloseBtn, { styles: styles2.close, handleClick })), react_default.createElement("div", { className: "__floater__container", style: styles2.container }, output.close, output.title, output.content, output.footer); 16948} 16949FloaterContainer.propTypes = { content: import_prop_types2.default.node.isRequired, footer: import_prop_types2.default.node, handleClick: import_prop_types2.default.func.isRequired, open: import_prop_types2.default.bool, positionWrapper: import_prop_types2.default.bool.isRequired, showCloseButton: import_prop_types2.default.bool.isRequired, styles: import_prop_types2.default.object.isRequired, title: import_prop_types2.default.node }; 16950var Floater = (function(_React$Component) { 16951 _inherits(Floater2, _React$Component); 16952 var _super = _createSuper(Floater2); 16953 function Floater2() { 16954 return _classCallCheck(this, Floater2), _super.apply(this, arguments); 16955 } 16956 return _createClass(Floater2, [{ key: "style", get: function() { 16957 var _this$props = this.props, disableAnimation = _this$props.disableAnimation, component = _this$props.component, placement = _this$props.placement, hideArrow = _this$props.hideArrow, status = _this$props.status, styles2 = _this$props.styles, length = styles2.arrow.length, floater = styles2.floater, floaterCentered = styles2.floaterCentered, floaterClosing = styles2.floaterClosing, floaterOpening = styles2.floaterOpening, floaterWithAnimation = styles2.floaterWithAnimation, floaterWithComponent = styles2.floaterWithComponent, element = {}; 16958 return hideArrow || (placement.startsWith("top") ? element.padding = "0 0 ".concat(length, "px") : placement.startsWith("bottom") ? element.padding = "".concat(length, "px 0 0") : placement.startsWith("left") ? element.padding = "0 ".concat(length, "px 0 0") : placement.startsWith("right") && (element.padding = "0 0 0 ".concat(length, "px"))), [STATUS2.OPENING, STATUS2.OPEN].indexOf(status) !== -1 && (element = _objectSpread2(_objectSpread2({}, element), floaterOpening)), status === STATUS2.CLOSING && (element = _objectSpread2(_objectSpread2({}, element), floaterClosing)), status === STATUS2.OPEN && !disableAnimation && (element = _objectSpread2(_objectSpread2({}, element), floaterWithAnimation)), placement === "center" && (element = _objectSpread2(_objectSpread2({}, element), floaterCentered)), component && (element = _objectSpread2(_objectSpread2({}, element), floaterWithComponent)), _objectSpread2(_objectSpread2({}, floater), element); 16959 } }, { key: "render", value: function() { 16960 var _this$props2 = this.props, component = _this$props2.component, closeFn = _this$props2.handleClick, hideArrow = _this$props2.hideArrow, setFloaterRef = _this$props2.setFloaterRef, status = _this$props2.status, output = {}, classes = ["__floater"]; 16961 return component ? react_default.isValidElement(component) ? output.content = react_default.cloneElement(component, { closeFn }) : output.content = component({ closeFn }) : output.content = react_default.createElement(FloaterContainer, this.props), status === STATUS2.OPEN && classes.push("__floater__open"), hideArrow || (output.arrow = react_default.createElement(FloaterArrow, this.props)), react_default.createElement("div", { ref: setFloaterRef, className: classes.join(" "), style: this.style }, react_default.createElement("div", { className: "__floater__body" }, output.content, output.arrow)); 16962 } }]), Floater2; 16963})(react_default.Component); 16964_defineProperty(Floater, "propTypes", { component: import_prop_types2.default.oneOfType([import_prop_types2.default.func, import_prop_types2.default.element]), content: import_prop_types2.default.node, disableAnimation: import_prop_types2.default.bool.isRequired, footer: import_prop_types2.default.node, handleClick: import_prop_types2.default.func.isRequired, hideArrow: import_prop_types2.default.bool.isRequired, open: import_prop_types2.default.bool, placement: import_prop_types2.default.string.isRequired, positionWrapper: import_prop_types2.default.bool.isRequired, setArrowRef: import_prop_types2.default.func.isRequired, setFloaterRef: import_prop_types2.default.func.isRequired, showCloseButton: import_prop_types2.default.bool, status: import_prop_types2.default.string.isRequired, styles: import_prop_types2.default.object.isRequired, title: import_prop_types2.default.node }); 16965var ReactFloaterWrapper = (function(_React$Component) { 16966 _inherits(ReactFloaterWrapper2, _React$Component); 16967 var _super = _createSuper(ReactFloaterWrapper2); 16968 function ReactFloaterWrapper2() { 16969 return _classCallCheck(this, ReactFloaterWrapper2), _super.apply(this, arguments); 16970 } 16971 return _createClass(ReactFloaterWrapper2, [{ key: "render", value: function() { 16972 var _this$props = this.props, children = _this$props.children, handleClick = _this$props.handleClick, handleMouseEnter = _this$props.handleMouseEnter, handleMouseLeave = _this$props.handleMouseLeave, setChildRef = _this$props.setChildRef, setWrapperRef = _this$props.setWrapperRef, style = _this$props.style, styles2 = _this$props.styles, element; 16973 if (children) 16974 if (react_default.Children.count(children) === 1) 16975 if (!react_default.isValidElement(children)) 16976 element = react_default.createElement("span", null, children); 16977 else { 16978 var refProp = esm_default.function(children.type) ? "innerRef" : "ref"; 16979 element = react_default.cloneElement(react_default.Children.only(children), _defineProperty({}, refProp, setChildRef)); 16980 } 16981 else 16982 element = children; 16983 return element ? react_default.createElement("span", { ref: setWrapperRef, style: _objectSpread2(_objectSpread2({}, styles2), style), onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, element) : null; 16984 } }]), ReactFloaterWrapper2; 16985})(react_default.Component); 16986_defineProperty(ReactFloaterWrapper, "propTypes", { children: import_prop_types2.default.node, handleClick: import_prop_types2.default.func.isRequired, handleMouseEnter: import_prop_types2.default.func.isRequired, handleMouseLeave: import_prop_types2.default.func.isRequired, setChildRef: import_prop_types2.default.func.isRequired, setWrapperRef: import_prop_types2.default.func.isRequired, style: import_prop_types2.default.object, styles: import_prop_types2.default.object.isRequired }); 16987var defaultOptions = { zIndex: 100 }; 16988function getStyles(styles2) { 16989 var options2 = (0, import_deepmerge.default)(defaultOptions, styles2.options || {}); 16990 return { wrapper: { cursor: "help", display: "inline-flex", flexDirection: "column", zIndex: options2.zIndex }, wrapperPosition: { left: -1e3, position: "absolute", top: -1e3, visibility: "hidden" }, floater: { display: "inline-block", filter: "drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))", maxWidth: 300, opacity: 0, position: "relative", transition: "opacity 0.3s", visibility: "hidden", zIndex: options2.zIndex }, floaterOpening: { opacity: 1, visibility: "visible" }, floaterWithAnimation: { opacity: 1, transition: "opacity 0.3s, transform 0.2s", visibility: "visible" }, floaterWithComponent: { maxWidth: "100%" }, floaterClosing: { opacity: 0, visibility: "visible" }, floaterCentered: { left: "50%", position: "fixed", top: "50%", transform: "translate(-50%, -50%)" }, container: { backgroundColor: "#fff", color: "#666", minHeight: 60, minWidth: 200, padding: 20, position: "relative", zIndex: 10 }, title: { borderBottom: "1px solid #555", color: "#555", fontSize: 18, marginBottom: 5, paddingBottom: 6, paddingRight: 18 }, content: { fontSize: 15 }, close: { backgroundColor: "transparent", border: 0, borderRadius: 0, color: "#555", fontSize: 0, height: 15, outline: "none", padding: 10, position: "absolute", right: 0, top: 0, width: 15, WebkitAppearance: "none" }, footer: { borderTop: "1px solid #ccc", fontSize: 13, marginTop: 10, paddingTop: 5 }, arrow: { color: "#fff", display: "inline-flex", length: 16, margin: 8, position: "absolute", spread: 32 }, options: options2 }; 16991} 16992var _excluded = ["arrow", "flip", "offset"], POSITIONING_PROPS = ["position", "top", "right", "bottom", "left"], ReactFloater = (function(_React$Component) { 16993 _inherits(ReactFloater2, _React$Component); 16994 var _super = _createSuper(ReactFloater2); 16995 function ReactFloater2(props) { 16996 var _this; 16997 return _classCallCheck(this, ReactFloater2), _this = _super.call(this, props), _defineProperty(_assertThisInitialized2(_this), "setArrowRef", function(ref) { 16998 _this.arrowRef = ref; 16999 }), _defineProperty(_assertThisInitialized2(_this), "setChildRef", function(ref) { 17000 _this.childRef = ref; 17001 }), _defineProperty(_assertThisInitialized2(_this), "setFloaterRef", function(ref) { 17002 _this.floaterRef = ref; 17003 }), _defineProperty(_assertThisInitialized2(_this), "setWrapperRef", function(ref) { 17004 _this.wrapperRef = ref; 17005 }), _defineProperty(_assertThisInitialized2(_this), "handleTransitionEnd", function() { 17006 var status = _this.state.status, callback = _this.props.callback; 17007 _this.wrapperPopper && _this.wrapperPopper.instance.update(), _this.setState({ status: status === STATUS2.OPENING ? STATUS2.OPEN : STATUS2.IDLE }, function() { 17008 var newStatus = _this.state.status; 17009 callback(newStatus === STATUS2.OPEN ? "open" : "close", _this.props); 17010 }); 17011 }), _defineProperty(_assertThisInitialized2(_this), "handleClick", function() { 17012 var _this$props = _this.props, event = _this$props.event, open = _this$props.open; 17013 if (!esm_default.boolean(open)) { 17014 var _this$state = _this.state, positionWrapper = _this$state.positionWrapper, status = _this$state.status; 17015 (_this.event === "click" || _this.event === "hover" && positionWrapper) && (log({ title: "click", data: [{ event, status: status === STATUS2.OPEN ? "closing" : "opening" }], debug: _this.debug }), _this.toggle()); 17016 } 17017 }), _defineProperty(_assertThisInitialized2(_this), "handleMouseEnter", function() { 17018 var _this$props2 = _this.props, event = _this$props2.event, open = _this$props2.open; 17019 if (!(esm_default.boolean(open) || isMobile())) { 17020 var status = _this.state.status; 17021 _this.event === "hover" && status === STATUS2.IDLE && (log({ title: "mouseEnter", data: [{ key: "originalEvent", value: event }], debug: _this.debug }), clearTimeout(_this.eventDelayTimeout), _this.toggle()); 17022 } 17023 }), _defineProperty(_assertThisInitialized2(_this), "handleMouseLeave", function() { 17024 var _this$props3 = _this.props, event = _this$props3.event, eventDelay = _this$props3.eventDelay, open = _this$props3.open; 17025 if (!(esm_default.boolean(open) || isMobile())) { 17026 var _this$state2 = _this.state, status = _this$state2.status, positionWrapper = _this$state2.positionWrapper; 17027 _this.event === "hover" && (log({ title: "mouseLeave", data: [{ key: "originalEvent", value: event }], debug: _this.debug }), eventDelay ? [STATUS2.OPENING, STATUS2.OPEN].indexOf(status) !== -1 && !positionWrapper && !_this.eventDelayTimeout && (_this.eventDelayTimeout = setTimeout(function() { 17028 delete _this.eventDelayTimeout, _this.toggle(); 17029 }, eventDelay * 1e3)) : _this.toggle(STATUS2.IDLE)); 17030 } 17031 }), _this.state = { currentPlacement: props.placement, needsUpdate: !1, positionWrapper: props.wrapperOptions.position && !!props.target, status: STATUS2.INIT, statusWrapper: STATUS2.INIT }, _this._isMounted = !1, _this.hasMounted = !1, canUseDOM() && window.addEventListener("load", function() { 17032 _this.popper && _this.popper.instance.update(), _this.wrapperPopper && _this.wrapperPopper.instance.update(); 17033 }), _this; 17034 } 17035 return _createClass(ReactFloater2, [{ key: "componentDidMount", value: function() { 17036 if (canUseDOM()) { 17037 var positionWrapper = this.state.positionWrapper, _this$props5 = this.props, children = _this$props5.children, open = _this$props5.open, target = _this$props5.target; 17038 this._isMounted = !0, log({ title: "init", data: { hasChildren: !!children, hasTarget: !!target, isControlled: esm_default.boolean(open), positionWrapper, target: this.target, floater: this.floaterRef }, debug: this.debug }), this.hasMounted || (this.initPopper(), this.hasMounted = !0), !children && target && esm_default.boolean(open); 17039 } 17040 } }, { key: "componentDidUpdate", value: function(prevProps, prevState) { 17041 if (canUseDOM()) { 17042 var _this$props6 = this.props, autoOpen = _this$props6.autoOpen, open = _this$props6.open, target = _this$props6.target, wrapperOptions = _this$props6.wrapperOptions, _treeChanges = treeChanges2(prevState, this.state), changedFrom = _treeChanges.changedFrom, changed = _treeChanges.changed; 17043 if (prevProps.open !== open) { 17044 var forceStatus; 17045 esm_default.boolean(open) && (forceStatus = open ? STATUS2.OPENING : STATUS2.CLOSING), this.toggle(forceStatus); 17046 } 17047 (prevProps.wrapperOptions.position !== wrapperOptions.position || prevProps.target !== target) && this.changeWrapperPosition(this.props), changed("status", STATUS2.IDLE) && open ? this.toggle(STATUS2.OPEN) : changedFrom("status", STATUS2.INIT, STATUS2.IDLE) && autoOpen && this.toggle(STATUS2.OPEN), this.popper && changed("status", STATUS2.OPENING) && this.popper.instance.update(), this.floaterRef && (changed("status", STATUS2.OPENING) || changed("status", STATUS2.CLOSING)) && once3(this.floaterRef, "transitionend", this.handleTransitionEnd), changed("needsUpdate", !0) && this.rebuildPopper(); 17048 } 17049 } }, { key: "componentWillUnmount", value: function() { 17050 canUseDOM() && (this._isMounted = !1, this.popper && this.popper.instance.destroy(), this.wrapperPopper && this.wrapperPopper.instance.destroy()); 17051 } }, { key: "initPopper", value: function() { 17052 var _this2 = this, target = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.target, positionWrapper = this.state.positionWrapper, _this$props7 = this.props, disableFlip = _this$props7.disableFlip, getPopper = _this$props7.getPopper, hideArrow = _this$props7.hideArrow, offset2 = _this$props7.offset, placement = _this$props7.placement, wrapperOptions = _this$props7.wrapperOptions, flipBehavior = placement === "top" || placement === "bottom" ? "flip" : ["right", "bottom-end", "top-end", "left", "top-start", "bottom-start"]; 17053 if (placement === "center") 17054 this.setState({ status: STATUS2.IDLE }); 17055 else if (target && this.floaterRef) { 17056 var _this$options = this.options, arrow2 = _this$options.arrow, flip2 = _this$options.flip, offsetOptions = _this$options.offset, rest2 = _objectWithoutProperties(_this$options, _excluded); 17057 new popper_default(target, this.floaterRef, { placement, modifiers: _objectSpread2({ arrow: _objectSpread2({ enabled: !hideArrow, element: this.arrowRef }, arrow2), flip: _objectSpread2({ enabled: !disableFlip, behavior: flipBehavior }, flip2), offset: _objectSpread2({ offset: "0, ".concat(offset2, "px") }, offsetOptions) }, rest2), onCreate: function(data) { 17058 var _this2$floaterRef; 17059 if (_this2.popper = data, !((_this2$floaterRef = _this2.floaterRef) !== null && _this2$floaterRef !== void 0 && _this2$floaterRef.isConnected)) { 17060 _this2.setState({ needsUpdate: !0 }); 17061 return; 17062 } 17063 getPopper(data, "floater"), _this2._isMounted && _this2.setState({ currentPlacement: data.placement, status: STATUS2.IDLE }), placement !== data.placement && setTimeout(function() { 17064 data.instance.update(); 17065 }, 1); 17066 }, onUpdate: function(data) { 17067 _this2.popper = data; 17068 var currentPlacement = _this2.state.currentPlacement; 17069 _this2._isMounted && data.placement !== currentPlacement && _this2.setState({ currentPlacement: data.placement }); 17070 } }); 17071 } 17072 if (positionWrapper) { 17073 var wrapperOffset = esm_default.undefined(wrapperOptions.offset) ? 0 : wrapperOptions.offset; 17074 new popper_default(this.target, this.wrapperRef, { placement: wrapperOptions.placement || placement, modifiers: { arrow: { enabled: !1 }, offset: { offset: "0, ".concat(wrapperOffset, "px") }, flip: { enabled: !1 } }, onCreate: function(data) { 17075 _this2.wrapperPopper = data, _this2._isMounted && _this2.setState({ statusWrapper: STATUS2.IDLE }), getPopper(data, "wrapper"), placement !== data.placement && setTimeout(function() { 17076 data.instance.update(); 17077 }, 1); 17078 } }); 17079 } 17080 } }, { key: "rebuildPopper", value: function() { 17081 var _this3 = this; 17082 this.floaterRefInterval = setInterval(function() { 17083 var _this3$floaterRef; 17084 (_this3$floaterRef = _this3.floaterRef) !== null && _this3$floaterRef !== void 0 && _this3$floaterRef.isConnected && (clearInterval(_this3.floaterRefInterval), _this3.setState({ needsUpdate: !1 }), _this3.initPopper()); 17085 }, 50); 17086 } }, { key: "changeWrapperPosition", value: function(_ref) { 17087 var target = _ref.target, wrapperOptions = _ref.wrapperOptions; 17088 this.setState({ positionWrapper: wrapperOptions.position && !!target }); 17089 } }, { key: "toggle", value: function(forceStatus) { 17090 var status = this.state.status, nextStatus = status === STATUS2.OPEN ? STATUS2.CLOSING : STATUS2.OPENING; 17091 esm_default.undefined(forceStatus) || (nextStatus = forceStatus), this.setState({ status: nextStatus }); 17092 } }, { key: "debug", get: function() { 17093 var debug = this.props.debug; 17094 return debug || canUseDOM() && "ReactFloaterDebug" in window && !!window.ReactFloaterDebug; 17095 } }, { key: "event", get: function() { 17096 var _this$props8 = this.props, disableHoverToClick = _this$props8.disableHoverToClick, event = _this$props8.event; 17097 return event === "hover" && isMobile() && !disableHoverToClick ? "click" : event; 17098 } }, { key: "options", get: function() { 17099 var options2 = this.props.options; 17100 return (0, import_deepmerge.default)(DEFAULTS, options2 || {}); 17101 } }, { key: "styles", get: function() { 17102 var _this4 = this, _this$state3 = this.state, status = _this$state3.status, positionWrapper = _this$state3.positionWrapper, statusWrapper = _this$state3.statusWrapper, styles2 = this.props.styles, nextStyles = (0, import_deepmerge.default)(getStyles(styles2), styles2); 17103 if (positionWrapper) { 17104 var wrapperStyles; 17105 [STATUS2.IDLE].indexOf(status) === -1 || [STATUS2.IDLE].indexOf(statusWrapper) === -1 ? wrapperStyles = nextStyles.wrapperPosition : wrapperStyles = this.wrapperPopper.styles, nextStyles.wrapper = _objectSpread2(_objectSpread2({}, nextStyles.wrapper), wrapperStyles); 17106 } 17107 if (this.target) { 17108 var targetStyles = window.getComputedStyle(this.target); 17109 this.wrapperStyles ? nextStyles.wrapper = _objectSpread2(_objectSpread2({}, nextStyles.wrapper), this.wrapperStyles) : ["relative", "static"].indexOf(targetStyles.position) === -1 && (this.wrapperStyles = {}, positionWrapper || (POSITIONING_PROPS.forEach(function(d2) { 17110 _this4.wrapperStyles[d2] = targetStyles[d2]; 17111 }), nextStyles.wrapper = _objectSpread2(_objectSpread2({}, nextStyles.wrapper), this.wrapperStyles), this.target.style.position = "relative", this.target.style.top = "auto", this.target.style.right = "auto", this.target.style.bottom = "auto", this.target.style.left = "auto")); 17112 } 17113 return nextStyles; 17114 } }, { key: "target", get: function() { 17115 if (!canUseDOM()) return null; 17116 var target = this.props.target; 17117 return target ? esm_default.domElement(target) ? target : document.querySelector(target) : this.childRef || this.wrapperRef; 17118 } }, { key: "render", value: function() { 17119 var _this$state4 = this.state, currentPlacement = _this$state4.currentPlacement, positionWrapper = _this$state4.positionWrapper, status = _this$state4.status, _this$props9 = this.props, children = _this$props9.children, component = _this$props9.component, content = _this$props9.content, disableAnimation = _this$props9.disableAnimation, footer = _this$props9.footer, hideArrow = _this$props9.hideArrow, id = _this$props9.id, open = _this$props9.open, showCloseButton = _this$props9.showCloseButton, style = _this$props9.style, target = _this$props9.target, title2 = _this$props9.title, wrapper = react_default.createElement(ReactFloaterWrapper, { handleClick: this.handleClick, handleMouseEnter: this.handleMouseEnter, handleMouseLeave: this.handleMouseLeave, setChildRef: this.setChildRef, setWrapperRef: this.setWrapperRef, style, styles: this.styles.wrapper }, children), output = {}; 17120 return positionWrapper ? output.wrapperInPortal = wrapper : output.wrapperAsChildren = wrapper, react_default.createElement("span", null, react_default.createElement(ReactFloaterPortal, { hasChildren: !!children, id, placement: currentPlacement, setRef: this.setFloaterRef, target, zIndex: this.styles.options.zIndex }, react_default.createElement(Floater, { component, content, disableAnimation, footer, handleClick: this.handleClick, hideArrow: hideArrow || currentPlacement === "center", open, placement: currentPlacement, positionWrapper, setArrowRef: this.setArrowRef, setFloaterRef: this.setFloaterRef, showCloseButton, status, styles: this.styles, title: title2 }), output.wrapperInPortal), output.wrapperAsChildren); 17121 } }]), ReactFloater2; 17122})(react_default.Component); 17123_defineProperty(ReactFloater, "propTypes", { autoOpen: import_prop_types2.default.bool, callback: import_prop_types2.default.func, children: import_prop_types2.default.node, component: isRequiredIf(import_prop_types2.default.oneOfType([import_prop_types2.default.func, import_prop_types2.default.element]), function(props) { 17124 return !props.content; 17125}), content: isRequiredIf(import_prop_types2.default.node, function(props) { 17126 return !props.component; 17127}), debug: import_prop_types2.default.bool, disableAnimation: import_prop_types2.default.bool, disableFlip: import_prop_types2.default.bool, disableHoverToClick: import_prop_types2.default.bool, event: import_prop_types2.default.oneOf(["hover", "click"]), eventDelay: import_prop_types2.default.number, footer: import_prop_types2.default.node, getPopper: import_prop_types2.default.func, hideArrow: import_prop_types2.default.bool, id: import_prop_types2.default.oneOfType([import_prop_types2.default.string, import_prop_types2.default.number]), offset: import_prop_types2.default.number, open: import_prop_types2.default.bool, options: import_prop_types2.default.object, placement: import_prop_types2.default.oneOf(["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end", "auto", "center"]), showCloseButton: import_prop_types2.default.bool, style: import_prop_types2.default.object, styles: import_prop_types2.default.object, target: import_prop_types2.default.oneOfType([import_prop_types2.default.object, import_prop_types2.default.string]), title: import_prop_types2.default.node, wrapperOptions: import_prop_types2.default.shape({ offset: import_prop_types2.default.number, placement: import_prop_types2.default.oneOf(["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end", "auto"]), position: import_prop_types2.default.bool }) }); 17128_defineProperty(ReactFloater, "defaultProps", { autoOpen: !1, callback: noop2, debug: !1, disableAnimation: !1, disableFlip: !1, disableHoverToClick: !1, event: "click", eventDelay: 0.4, getPopper: noop2, hideArrow: !1, offset: 15, placement: "bottom", showCloseButton: !1, styles: {}, target: null, wrapperOptions: { position: !1 } }); 17129
vendor: 58,264 bytes, lines 17130-18582
17130// ../../node_modules/react-joyride/dist/index.mjs 17131init_react(); 17132init_react(); 17133init_react(); 17134init_react(); 17135var __defProp3 = Object.defineProperty, __defNormalProp2 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp2(obj, typeof key != "symbol" ? key + "" : key, value), ACTIONS = { 17136 INIT: "init", 17137 START: "start", 17138 STOP: "stop", 17139 RESET: "reset", 17140 PREV: "prev", 17141 NEXT: "next", 17142 GO: "go", 17143 CLOSE: "close", 17144 SKIP: "skip", 17145 UPDATE: "update" 17146}, EVENTS = { 17147 TOUR_START: "tour:start", 17148 STEP_BEFORE: "step:before", 17149 BEACON: "beacon", 17150 TOOLTIP: "tooltip", 17151 STEP_AFTER: "step:after", 17152 TOUR_END: "tour:end", 17153 TOUR_STATUS: "tour:status", 17154 TARGET_NOT_FOUND: "error:target_not_found", 17155 ERROR: "error" 17156}, LIFECYCLE = { 17157 INIT: "init", 17158 READY: "ready", 17159 BEACON: "beacon", 17160 TOOLTIP: "tooltip", 17161 COMPLETE: "complete", 17162 ERROR: "error" 17163}; 17164var STATUS3 = { 17165 IDLE: "idle", 17166 READY: "ready", 17167 WAITING: "waiting", 17168 RUNNING: "running", 17169 PAUSED: "paused", 17170 SKIPPED: "skipped", 17171 FINISHED: "finished", 17172 ERROR: "error" 17173}; 17174function canUseDOM2() { 17175 var _a2; 17176 return !!(typeof window < "u" && ((_a2 = window.document) != null && _a2.createElement)); 17177} 17178function getClientRect2(element) { 17179 return element ? element.getBoundingClientRect() : null; 17180} 17181function getDocumentHeight(median = !1) { 17182 let { body, documentElement } = document; 17183 if (!body || !documentElement) 17184 return 0; 17185 if (median) { 17186 let heights = [ 17187 body.scrollHeight, 17188 body.offsetHeight, 17189 documentElement.clientHeight, 17190 documentElement.scrollHeight, 17191 documentElement.offsetHeight 17192 ].sort((a2, b2) => a2 - b2), middle = Math.floor(heights.length / 2); 17193 return heights.length % 2 === 0 ? (heights[middle - 1] + heights[middle]) / 2 : heights[middle]; 17194 } 17195 return Math.max( 17196 body.scrollHeight, 17197 body.offsetHeight, 17198 documentElement.clientHeight, 17199 documentElement.scrollHeight, 17200 documentElement.offsetHeight 17201 ); 17202} 17203function getElement(element) { 17204 if (typeof element == "string") 17205 try { 17206 return document.querySelector(element); 17207 } catch { 17208 return null; 17209 } 17210 return element; 17211} 17212function getStyleComputedProperty2(el) { 17213 return !el || el.nodeType !== 1 ? null : getComputedStyle(el); 17214} 17215function getScrollParent2(element, skipFix, forListener) { 17216 if (!element) 17217 return scrollDocument(); 17218 let parent = (0, import_scrollparent.default)(element); 17219 if (parent) { 17220 if (parent.isSameNode(scrollDocument())) 17221 return forListener ? document : scrollDocument(); 17222 if (!(parent.scrollHeight > parent.offsetHeight) && !skipFix) 17223 return parent.style.overflow = "initial", scrollDocument(); 17224 } 17225 return parent; 17226} 17227function hasCustomScrollParent(element, skipFix) { 17228 if (!element) 17229 return !1; 17230 let parent = getScrollParent2(element, skipFix); 17231 return parent ? !parent.isSameNode(scrollDocument()) : !1; 17232} 17233function hasCustomOffsetParent(element) { 17234 return element.offsetParent !== document.body; 17235} 17236function hasPosition(el, type = "fixed") { 17237 if (!el || !(el instanceof HTMLElement)) 17238 return !1; 17239 let { nodeName } = el, styles2 = getStyleComputedProperty2(el); 17240 return nodeName === "BODY" || nodeName === "HTML" ? !1 : styles2 && styles2.position === type ? !0 : el.parentNode ? hasPosition(el.parentNode, type) : !1; 17241} 17242function isElementVisible(element) { 17243 var _a2; 17244 if (!element) 17245 return !1; 17246 let parentElement = element; 17247 for (; parentElement && parentElement !== document.body; ) { 17248 if (parentElement instanceof HTMLElement) { 17249 let { display, visibility } = getComputedStyle(parentElement); 17250 if (display === "none" || visibility === "hidden") 17251 return !1; 17252 } 17253 parentElement = (_a2 = parentElement.parentElement) != null ? _a2 : null; 17254 } 17255 return !0; 17256} 17257function getElementPosition(element, offset2, skipFix) { 17258 var _a2, _b, _c; 17259 let elementRect = getClientRect2(element), parent = getScrollParent2(element, skipFix), hasScrollParent = hasCustomScrollParent(element, skipFix), isFixedTarget = hasPosition(element), parentTop = 0, top = (_a2 = elementRect?.top) != null ? _a2 : 0; 17260 if (hasScrollParent && isFixedTarget) { 17261 let offsetTop = (_b = element?.offsetTop) != null ? _b : 0, parentScrollTop = (_c = parent?.scrollTop) != null ? _c : 0; 17262 top = offsetTop - parentScrollTop; 17263 } else parent instanceof HTMLElement && (parentTop = parent.scrollTop, !hasScrollParent && !hasPosition(element) && (top += parentTop), parent.isSameNode(scrollDocument()) || (top += scrollDocument().scrollTop)); 17264 return Math.floor(top - offset2); 17265} 17266function getScrollTo(element, offset2, skipFix) { 17267 var _a2; 17268 if (!element) 17269 return 0; 17270 let { offsetTop = 0, scrollTop = 0 } = (_a2 = (0, import_scrollparent.default)(element)) != null ? _a2 : {}, top = element.getBoundingClientRect().top + scrollTop; 17271 offsetTop && (hasCustomScrollParent(element, skipFix) || hasCustomOffsetParent(element)) && (top -= offsetTop); 17272 let output = Math.floor(top - offset2); 17273 return output < 0 ? 0 : output; 17274} 17275function scrollDocument() { 17276 var _a2; 17277 return (_a2 = document.scrollingElement) != null ? _a2 : document.documentElement; 17278} 17279function scrollTo(value, options2) { 17280 let { duration, element } = options2; 17281 return new Promise((resolve, reject) => { 17282 let { scrollTop } = element, limit = value > scrollTop ? value - scrollTop : scrollTop - value; 17283 import_scroll.default.top(element, value, { duration: limit < 100 ? 50 : duration }, (error) => error && error.message !== "Element already at target scroll position" ? reject(error) : resolve()); 17284 }); 17285} 17286var isReact162 = createPortal !== void 0; 17287function getBrowser(userAgent = navigator.userAgent) { 17288 let browser = userAgent; 17289 return typeof window > "u" ? browser = "node" : document.documentMode ? browser = "ie" : /Edge/.test(userAgent) ? browser = "edge" : window.opera || userAgent.includes(" OPR/") ? browser = "opera" : typeof window.InstallTrigger < "u" ? browser = "firefox" : window.chrome ? browser = "chrome" : /(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(userAgent) && (browser = "safari"), browser; 17290} 17291function getObjectType4(value) { 17292 return Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); 17293} 17294function getReactNodeText(input, options2 = {}) { 17295 let { defaultValue, step, steps } = options2, text = (0, import_react_innertext.default)(input); 17296 if (text) 17297 (text.includes("{step}") || text.includes("{steps}")) && step && steps && (text = text.replace("{step}", step.toString()).replace("{steps}", steps.toString())); 17298 else if (isValidElement(input) && !Object.values(input.props).length && getObjectType4(input.type) === "function") { 17299 let component = input.type({}); 17300 text = getReactNodeText(component, options2); 17301 } else 17302 text = (0, import_react_innertext.default)(defaultValue); 17303 return text; 17304} 17305function hasValidKeys(object, keys) { 17306 return !src_default.plainObject(object) || !src_default.array(keys) ? !1 : Object.keys(object).every((d2) => keys.includes(d2)); 17307} 17308function hexToRGB(hex) { 17309 let shorthandRegex = /^#?([\da-f])([\da-f])([\da-f])$/i, properHex = hex.replace(shorthandRegex, (_m, r4, g2, b2) => r4 + r4 + g2 + g2 + b2 + b2), result = /^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(properHex); 17310 return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : []; 17311} 17312function hideBeacon(step) { 17313 return step.disableBeacon || step.placement === "center"; 17314} 17315function isLegacy() { 17316 return !["chrome", "safari", "firefox", "opera"].includes(getBrowser()); 17317} 17318function log2({ data, debug = !1, title: title2, warn = !1 }) { 17319 let logFn = warn ? console.warn || console.error : console.log; 17320 debug && (title2 && data ? (console.groupCollapsed( 17321 `%creact-joyride: ${title2}`, 17322 "color: #ff0044; font-weight: bold; font-size: 12px;" 17323 ), Array.isArray(data) ? data.forEach((d2) => { 17324 src_default.plainObject(d2) && d2.key ? logFn.apply(console, [d2.key, d2.value]) : logFn.apply(console, [d2]); 17325 }) : logFn.apply(console, [data]), console.groupEnd()) : console.error("Missing title or data props")); 17326} 17327function objectKeys(input) { 17328 return Object.keys(input); 17329} 17330function omit2(input, ...filter) { 17331 if (!src_default.plainObject(input)) 17332 throw new TypeError("Expected an object"); 17333 let output = {}; 17334 for (let key in input) 17335 ({}).hasOwnProperty.call(input, key) && (filter.includes(key) || (output[key] = input[key])); 17336 return output; 17337} 17338function pick2(input, ...filter) { 17339 if (!src_default.plainObject(input)) 17340 throw new TypeError("Expected an object"); 17341 if (!filter.length) 17342 return input; 17343 let output = {}; 17344 for (let key in input) 17345 ({}).hasOwnProperty.call(input, key) && filter.includes(key) && (output[key] = input[key]); 17346 return output; 17347} 17348function replaceLocaleContent(input, step, steps) { 17349 let replacer = (text) => text.replace("{step}", String(step)).replace("{steps}", String(steps)); 17350 if (getObjectType4(input) === "string") 17351 return replacer(input); 17352 if (!isValidElement(input)) 17353 return input; 17354 let { children } = input.props; 17355 if (getObjectType4(children) === "string" && children.includes("{step}")) 17356 return cloneElement(input, { 17357 children: replacer(children) 17358 }); 17359 if (Array.isArray(children)) 17360 return cloneElement(input, { 17361 children: children.map((child) => typeof child == "string" ? replacer(child) : replaceLocaleContent(child, step, steps)) 17362 }); 17363 if (getObjectType4(input.type) === "function" && !Object.values(input.props).length) { 17364 let component = input.type({}); 17365 return replaceLocaleContent(component, step, steps); 17366 } 17367 return input; 17368} 17369function shouldScroll(options2) { 17370 let { isFirstStep, lifecycle, previousLifecycle, scrollToFirstStep, step, target } = options2; 17371 return !step.disableScrolling && (!isFirstStep || scrollToFirstStep || lifecycle === LIFECYCLE.TOOLTIP) && step.placement !== "center" && (!step.isFixed || !hasPosition(target)) && // fixed steps don't need to scroll 17372 previousLifecycle !== lifecycle && [LIFECYCLE.BEACON, LIFECYCLE.TOOLTIP].includes(lifecycle); 17373} 17374var defaultFloaterProps = { 17375 options: { 17376 preventOverflow: { 17377 boundariesElement: "scrollParent" 17378 } 17379 }, 17380 wrapperOptions: { 17381 offset: -18, 17382 position: !0 17383 } 17384}, defaultLocale = { 17385 back: "Back", 17386 close: "Close", 17387 last: "Last", 17388 next: "Next", 17389 nextLabelWithProgress: "Next (Step {step} of {steps})", 17390 open: "Open the dialog", 17391 skip: "Skip" 17392}, defaultStep = { 17393 event: "click", 17394 placement: "bottom", 17395 offset: 10, 17396 disableBeacon: !1, 17397 disableCloseOnEsc: !1, 17398 disableOverlay: !1, 17399 disableOverlayClose: !1, 17400 disableScrollParentFix: !1, 17401 disableScrolling: !1, 17402 hideBackButton: !1, 17403 hideCloseButton: !1, 17404 hideFooter: !1, 17405 isFixed: !1, 17406 locale: defaultLocale, 17407 showProgress: !1, 17408 showSkipButton: !1, 17409 spotlightClicks: !1, 17410 spotlightPadding: 10 17411}, defaultProps = { 17412 continuous: !1, 17413 debug: !1, 17414 disableCloseOnEsc: !1, 17415 disableOverlay: !1, 17416 disableOverlayClose: !1, 17417 disableScrolling: !1, 17418 disableScrollParentFix: !1, 17419 getHelpers: void 0, 17420 hideBackButton: !1, 17421 run: !0, 17422 scrollOffset: 20, 17423 scrollDuration: 300, 17424 scrollToFirstStep: !1, 17425 showSkipButton: !1, 17426 showProgress: !1, 17427 spotlightClicks: !1, 17428 spotlightPadding: 10, 17429 steps: [] 17430}, defaultOptions2 = { 17431 arrowColor: "#fff", 17432 backgroundColor: "#fff", 17433 beaconSize: 36, 17434 overlayColor: "rgba(0, 0, 0, 0.5)", 17435 primaryColor: "#f04", 17436 spotlightShadow: "0 0 15px rgba(0, 0, 0, 0.5)", 17437 textColor: "#333", 17438 width: 380, 17439 zIndex: 100 17440}, buttonBase = { 17441 backgroundColor: "transparent", 17442 border: 0, 17443 borderRadius: 0, 17444 color: "#555", 17445 cursor: "pointer", 17446 fontSize: 16, 17447 lineHeight: 1, 17448 padding: 8, 17449 WebkitAppearance: "none" 17450}, spotlight = { 17451 borderRadius: 4, 17452 position: "absolute" 17453}; 17454function getStyles2(props, step) { 17455 var _a2, _b, _c, _d, _e; 17456 let { floaterProps, styles: styles2 } = props, mergedFloaterProps = (0, import_deepmerge3.default)((_a2 = step.floaterProps) != null ? _a2 : {}, floaterProps ?? {}), mergedStyles = (0, import_deepmerge3.default)(styles2 ?? {}, (_b = step.styles) != null ? _b : {}), options2 = (0, import_deepmerge3.default)(defaultOptions2, mergedStyles.options || {}), hideBeacon2 = step.placement === "center" || step.disableBeacon, { width } = options2; 17457 window.innerWidth > 480 && (width = 380), "width" in options2 && (width = typeof options2.width == "number" && window.innerWidth < options2.width ? window.innerWidth - 30 : options2.width); 17458 let overlay = { 17459 bottom: 0, 17460 left: 0, 17461 overflow: "hidden", 17462 position: "absolute", 17463 right: 0, 17464 top: 0, 17465 zIndex: options2.zIndex 17466 }, defaultStyles = { 17467 beacon: { 17468 ...buttonBase, 17469 display: hideBeacon2 ? "none" : "inline-block", 17470 height: options2.beaconSize, 17471 position: "relative", 17472 width: options2.beaconSize, 17473 zIndex: options2.zIndex 17474 }, 17475 beaconInner: { 17476 animation: "joyride-beacon-inner 1.2s infinite ease-in-out", 17477 backgroundColor: options2.primaryColor, 17478 borderRadius: "50%", 17479 display: "block", 17480 height: "50%", 17481 left: "50%", 17482 opacity: 0.7, 17483 position: "absolute", 17484 top: "50%", 17485 transform: "translate(-50%, -50%)", 17486 width: "50%" 17487 }, 17488 beaconOuter: { 17489 animation: "joyride-beacon-outer 1.2s infinite ease-in-out", 17490 backgroundColor: `rgba(${hexToRGB(options2.primaryColor).join(",")}, 0.2)`, 17491 border: `2px solid ${options2.primaryColor}`, 17492 borderRadius: "50%", 17493 boxSizing: "border-box", 17494 display: "block", 17495 height: "100%", 17496 left: 0, 17497 opacity: 0.9, 17498 position: "absolute", 17499 top: 0, 17500 transformOrigin: "center", 17501 width: "100%" 17502 }, 17503 tooltip: { 17504 backgroundColor: options2.backgroundColor, 17505 borderRadius: 5, 17506 boxSizing: "border-box", 17507 color: options2.textColor, 17508 fontSize: 16, 17509 maxWidth: "100%", 17510 padding: 15, 17511 position: "relative", 17512 width 17513 }, 17514 tooltipContainer: { 17515 lineHeight: 1.4, 17516 textAlign: "center" 17517 }, 17518 tooltipTitle: { 17519 fontSize: 18, 17520 margin: 0 17521 }, 17522 tooltipContent: { 17523 padding: "20px 10px" 17524 }, 17525 tooltipFooter: { 17526 alignItems: "center", 17527 display: "flex", 17528 justifyContent: "flex-end", 17529 marginTop: 15 17530 }, 17531 tooltipFooterSpacer: { 17532 flex: 1 17533 }, 17534 buttonNext: { 17535 ...buttonBase, 17536 backgroundColor: options2.primaryColor, 17537 borderRadius: 4, 17538 color: "#fff" 17539 }, 17540 buttonBack: { 17541 ...buttonBase, 17542 color: options2.primaryColor, 17543 marginLeft: "auto", 17544 marginRight: 5 17545 }, 17546 buttonClose: { 17547 ...buttonBase, 17548 color: options2.textColor, 17549 height: 14, 17550 padding: 15, 17551 position: "absolute", 17552 right: 0, 17553 top: 0, 17554 width: 14 17555 }, 17556 buttonSkip: { 17557 ...buttonBase, 17558 color: options2.textColor, 17559 fontSize: 14 17560 }, 17561 overlay: { 17562 ...overlay, 17563 backgroundColor: options2.overlayColor, 17564 mixBlendMode: "hard-light" 17565 }, 17566 overlayLegacy: { 17567 ...overlay 17568 }, 17569 overlayLegacyCenter: { 17570 ...overlay, 17571 backgroundColor: options2.overlayColor 17572 }, 17573 spotlight: { 17574 ...spotlight, 17575 backgroundColor: "gray" 17576 }, 17577 spotlightLegacy: { 17578 ...spotlight, 17579 boxShadow: `0 0 0 9999px ${options2.overlayColor}, ${options2.spotlightShadow}` 17580 }, 17581 floaterStyles: { 17582 arrow: { 17583 color: (_e = (_d = (_c = mergedFloaterProps?.styles) == null ? void 0 : _c.arrow) == null ? void 0 : _d.color) != null ? _e : options2.arrowColor 17584 }, 17585 options: { 17586 zIndex: options2.zIndex + 100 17587 } 17588 }, 17589 options: options2 17590 }; 17591 return (0, import_deepmerge3.default)(defaultStyles, mergedStyles); 17592} 17593function getTourProps(props) { 17594 return pick2( 17595 props, 17596 "beaconComponent", 17597 "disableCloseOnEsc", 17598 "disableOverlay", 17599 "disableOverlayClose", 17600 "disableScrolling", 17601 "disableScrollParentFix", 17602 "floaterProps", 17603 "hideBackButton", 17604 "hideCloseButton", 17605 "locale", 17606 "showProgress", 17607 "showSkipButton", 17608 "spotlightClicks", 17609 "spotlightPadding", 17610 "styles", 17611 "tooltipComponent" 17612 ); 17613} 17614function getMergedStep(props, currentStep) { 17615 var _a2, _b, _c, _d, _e, _f; 17616 let step = currentStep ?? {}, mergedStep = import_deepmerge2.default.all([defaultStep, getTourProps(props), step], { 17617 isMergeableObject: src_default.plainObject 17618 }), mergedStyles = getStyles2(props, mergedStep), scrollParent2 = hasCustomScrollParent( 17619 getElement(mergedStep.target), 17620 mergedStep.disableScrollParentFix 17621 ), floaterProps = import_deepmerge2.default.all([ 17622 defaultFloaterProps, 17623 (_a2 = props.floaterProps) != null ? _a2 : {}, 17624 (_b = mergedStep.floaterProps) != null ? _b : {} 17625 ]); 17626 return floaterProps.offset = mergedStep.offset, floaterProps.styles = (0, import_deepmerge2.default)((_c = floaterProps.styles) != null ? _c : {}, mergedStyles.floaterStyles), floaterProps.offset += (_e = (_d = props.spotlightPadding) != null ? _d : mergedStep.spotlightPadding) != null ? _e : 0, mergedStep.placementBeacon && floaterProps.wrapperOptions && (floaterProps.wrapperOptions.placement = mergedStep.placementBeacon), scrollParent2 && floaterProps.options.preventOverflow && (floaterProps.options.preventOverflow.boundariesElement = "window"), { 17627 ...mergedStep, 17628 locale: import_deepmerge2.default.all([defaultLocale, (_f = props.locale) != null ? _f : {}, mergedStep.locale || {}]), 17629 floaterProps, 17630 styles: omit2(mergedStyles, "floaterStyles") 17631 }; 17632} 17633function validateStep(step, debug = !1) { 17634 return src_default.plainObject(step) ? step.target ? !0 : (log2({ 17635 title: "validateStep", 17636 data: "target is missing from the step", 17637 warn: !0, 17638 debug 17639 }), !1) : (log2({ 17640 title: "validateStep", 17641 data: "step must be an object", 17642 warn: !0, 17643 debug 17644 }), !1); 17645} 17646function validateSteps(steps, debug = !1) { 17647 return src_default.array(steps) ? steps.every((d2) => validateStep(d2, debug)) : (log2({ 17648 title: "validateSteps", 17649 data: "steps must be an array", 17650 warn: !0, 17651 debug 17652 }), !1); 17653} 17654var defaultState = { 17655 action: "init", 17656 controlled: !1, 17657 index: 0, 17658 lifecycle: LIFECYCLE.INIT, 17659 origin: null, 17660 size: 0, 17661 status: STATUS3.IDLE 17662}, validKeys = objectKeys(omit2(defaultState, "controlled", "size")), Store = class { 17663 constructor(options2) { 17664 __publicField(this, "beaconPopper"), __publicField(this, "tooltipPopper"), __publicField(this, "data", /* @__PURE__ */ new Map()), __publicField(this, "listener"), __publicField(this, "store", /* @__PURE__ */ new Map()), __publicField(this, "addListener", (listener) => { 17665 this.listener = listener; 17666 }), __publicField(this, "setSteps", (steps2) => { 17667 let { size, status } = this.getState(), state = { 17668 size: steps2.length, 17669 status 17670 }; 17671 this.data.set("steps", steps2), status === STATUS3.WAITING && !size && steps2.length && (state.status = STATUS3.RUNNING), this.setState(state); 17672 }), __publicField(this, "getPopper", (name) => name === "beacon" ? this.beaconPopper : this.tooltipPopper), __publicField(this, "setPopper", (name, popper) => { 17673 name === "beacon" ? this.beaconPopper = popper : this.tooltipPopper = popper; 17674 }), __publicField(this, "cleanupPoppers", () => { 17675 this.beaconPopper = null, this.tooltipPopper = null; 17676 }), __publicField(this, "close", (origin = null) => { 17677 let { index, status } = this.getState(); 17678 status === STATUS3.RUNNING && this.setState({ 17679 ...this.getNextState({ action: ACTIONS.CLOSE, index: index + 1, origin }) 17680 }); 17681 }), __publicField(this, "go", (nextIndex) => { 17682 let { controlled, status } = this.getState(); 17683 if (controlled || status !== STATUS3.RUNNING) 17684 return; 17685 let step = this.getSteps()[nextIndex]; 17686 this.setState({ 17687 ...this.getNextState({ action: ACTIONS.GO, index: nextIndex }), 17688 status: step ? status : STATUS3.FINISHED 17689 }); 17690 }), __publicField(this, "info", () => this.getState()), __publicField(this, "next", () => { 17691 let { index, status } = this.getState(); 17692 status === STATUS3.RUNNING && this.setState(this.getNextState({ action: ACTIONS.NEXT, index: index + 1 })); 17693 }), __publicField(this, "open", () => { 17694 let { status } = this.getState(); 17695 status === STATUS3.RUNNING && this.setState({ 17696 ...this.getNextState({ action: ACTIONS.UPDATE, lifecycle: LIFECYCLE.TOOLTIP }) 17697 }); 17698 }), __publicField(this, "prev", () => { 17699 let { index, status } = this.getState(); 17700 status === STATUS3.RUNNING && this.setState({ 17701 ...this.getNextState({ action: ACTIONS.PREV, index: index - 1 }) 17702 }); 17703 }), __publicField(this, "reset", (restart = !1) => { 17704 let { controlled } = this.getState(); 17705 controlled || this.setState({ 17706 ...this.getNextState({ action: ACTIONS.RESET, index: 0 }), 17707 status: restart ? STATUS3.RUNNING : STATUS3.READY 17708 }); 17709 }), __publicField(this, "skip", () => { 17710 let { status } = this.getState(); 17711 status === STATUS3.RUNNING && this.setState({ 17712 action: ACTIONS.SKIP, 17713 lifecycle: LIFECYCLE.INIT, 17714 status: STATUS3.SKIPPED 17715 }); 17716 }), __publicField(this, "start", (nextIndex) => { 17717 let { index, size } = this.getState(); 17718 this.setState({ 17719 ...this.getNextState( 17720 { 17721 action: ACTIONS.START, 17722 index: src_default.number(nextIndex) ? nextIndex : index 17723 }, 17724 !0 17725 ), 17726 status: size ? STATUS3.RUNNING : STATUS3.WAITING 17727 }); 17728 }), __publicField(this, "stop", (advance = !1) => { 17729 let { index, status } = this.getState(); 17730 [STATUS3.FINISHED, STATUS3.SKIPPED].includes(status) || this.setState({ 17731 ...this.getNextState({ action: ACTIONS.STOP, index: index + (advance ? 1 : 0) }), 17732 status: STATUS3.PAUSED 17733 }); 17734 }), __publicField(this, "update", (state) => { 17735 var _a2, _b; 17736 if (!hasValidKeys(state, validKeys)) 17737 throw new Error(`State is not valid. Valid keys: ${validKeys.join(", ")}`); 17738 this.setState({ 17739 ...this.getNextState( 17740 { 17741 ...this.getState(), 17742 ...state, 17743 action: (_a2 = state.action) != null ? _a2 : ACTIONS.UPDATE, 17744 origin: (_b = state.origin) != null ? _b : null 17745 }, 17746 !0 17747 ) 17748 }); 17749 }); 17750 let { continuous = !1, stepIndex, steps = [] } = options2 ?? {}; 17751 this.setState( 17752 { 17753 action: ACTIONS.INIT, 17754 controlled: src_default.number(stepIndex), 17755 continuous, 17756 index: src_default.number(stepIndex) ? stepIndex : 0, 17757 lifecycle: LIFECYCLE.INIT, 17758 origin: null, 17759 status: steps.length ? STATUS3.READY : STATUS3.IDLE 17760 }, 17761 !0 17762 ), this.beaconPopper = null, this.tooltipPopper = null, this.listener = null, this.setSteps(steps); 17763 } 17764 getState() { 17765 return this.store.size ? { 17766 action: this.store.get("action") || "", 17767 controlled: this.store.get("controlled") || !1, 17768 index: parseInt(this.store.get("index"), 10), 17769 lifecycle: this.store.get("lifecycle") || "", 17770 origin: this.store.get("origin") || null, 17771 size: this.store.get("size") || 0, 17772 status: this.store.get("status") || "" 17773 } : { ...defaultState }; 17774 } 17775 getNextState(state, force = !1) { 17776 var _a2, _b, _c, _d, _e; 17777 let { action, controlled, index, size, status } = this.getState(), newIndex = src_default.number(state.index) ? state.index : index, nextIndex = controlled && !force ? index : Math.min(Math.max(newIndex, 0), size); 17778 return { 17779 action: (_a2 = state.action) != null ? _a2 : action, 17780 controlled, 17781 index: nextIndex, 17782 lifecycle: (_b = state.lifecycle) != null ? _b : LIFECYCLE.INIT, 17783 origin: (_c = state.origin) != null ? _c : null, 17784 size: (_d = state.size) != null ? _d : size, 17785 status: nextIndex === size ? STATUS3.FINISHED : (_e = state.status) != null ? _e : status 17786 }; 17787 } 17788 getSteps() { 17789 let steps = this.data.get("steps"); 17790 return Array.isArray(steps) ? steps : []; 17791 } 17792 hasUpdatedState(oldState) { 17793 let before2 = JSON.stringify(oldState), after2 = JSON.stringify(this.getState()); 17794 return before2 !== after2; 17795 } 17796 setState(nextState, initial = !1) { 17797 let state = this.getState(), { 17798 action, 17799 index, 17800 lifecycle, 17801 origin = null, 17802 size, 17803 status 17804 } = { 17805 ...state, 17806 ...nextState 17807 }; 17808 this.store.set("action", action), this.store.set("index", index), this.store.set("lifecycle", lifecycle), this.store.set("origin", origin), this.store.set("size", size), this.store.set("status", status), initial && (this.store.set("controlled", nextState.controlled), this.store.set("continuous", nextState.continuous)), this.listener && this.hasUpdatedState(state) && this.listener(this.getState()); 17809 } 17810 getHelpers() { 17811 return { 17812 close: this.close, 17813 go: this.go, 17814 info: this.info, 17815 next: this.next, 17816 open: this.open, 17817 prev: this.prev, 17818 reset: this.reset, 17819 skip: this.skip 17820 }; 17821 } 17822}; 17823function createStore(options2) { 17824 return new Store(options2); 17825} 17826function JoyrideSpotlight({ styles: styles2 }) { 17827 return createElement( 17828 "div", 17829 { 17830 key: "JoyrideSpotlight", 17831 className: "react-joyride__spotlight", 17832 "data-test-id": "spotlight", 17833 style: styles2 17834 } 17835 ); 17836} 17837var Spotlight_default = JoyrideSpotlight, JoyrideOverlay = class extends Component { 17838 constructor() { 17839 super(...arguments), __publicField(this, "isActive", !1), __publicField(this, "resizeTimeout"), __publicField(this, "scrollTimeout"), __publicField(this, "scrollParent"), __publicField(this, "state", { 17840 isScrolling: !1, 17841 mouseOverSpotlight: !1, 17842 showSpotlight: !0 17843 }), __publicField(this, "hideSpotlight", () => { 17844 let { continuous, disableOverlay, lifecycle } = this.props, hiddenLifecycles = [ 17845 LIFECYCLE.INIT, 17846 LIFECYCLE.BEACON, 17847 LIFECYCLE.COMPLETE, 17848 LIFECYCLE.ERROR 17849 ]; 17850 return disableOverlay || (continuous ? hiddenLifecycles.includes(lifecycle) : lifecycle !== LIFECYCLE.TOOLTIP); 17851 }), __publicField(this, "handleMouseMove", (event) => { 17852 let { mouseOverSpotlight } = this.state, { height, left, position, top, width } = this.spotlightStyles, offsetY = position === "fixed" ? event.clientY : event.pageY, offsetX = position === "fixed" ? event.clientX : event.pageX, inSpotlightHeight = offsetY >= top && offsetY <= top + height, inSpotlight = offsetX >= left && offsetX <= left + width && inSpotlightHeight; 17853 inSpotlight !== mouseOverSpotlight && this.updateState({ mouseOverSpotlight: inSpotlight }); 17854 }), __publicField(this, "handleScroll", () => { 17855 let { target } = this.props, element = getElement(target); 17856 if (this.scrollParent !== document) { 17857 let { isScrolling } = this.state; 17858 isScrolling || this.updateState({ isScrolling: !0, showSpotlight: !1 }), clearTimeout(this.scrollTimeout), this.scrollTimeout = window.setTimeout(() => { 17859 this.updateState({ isScrolling: !1, showSpotlight: !0 }); 17860 }, 50); 17861 } else hasPosition(element, "sticky") && this.updateState({}); 17862 }), __publicField(this, "handleResize", () => { 17863 clearTimeout(this.resizeTimeout), this.resizeTimeout = window.setTimeout(() => { 17864 this.isActive && this.forceUpdate(); 17865 }, 100); 17866 }); 17867 } 17868 componentDidMount() { 17869 let { debug, disableScrolling, disableScrollParentFix = !1, target } = this.props, element = getElement(target); 17870 this.scrollParent = getScrollParent2(element ?? document.body, disableScrollParentFix, !0), this.isActive = !0, window.addEventListener("resize", this.handleResize); 17871 } 17872 componentDidUpdate(previousProps) { 17873 var _a2; 17874 let { disableScrollParentFix, lifecycle, spotlightClicks, target } = this.props, { changed } = treeChanges(previousProps, this.props); 17875 if (changed("target") || changed("disableScrollParentFix")) { 17876 let element = getElement(target); 17877 this.scrollParent = getScrollParent2(element ?? document.body, disableScrollParentFix, !0); 17878 } 17879 changed("lifecycle", LIFECYCLE.TOOLTIP) && ((_a2 = this.scrollParent) == null || _a2.addEventListener("scroll", this.handleScroll, { passive: !0 }), setTimeout(() => { 17880 let { isScrolling } = this.state; 17881 isScrolling || this.updateState({ showSpotlight: !0 }); 17882 }, 100)), (changed("spotlightClicks") || changed("disableOverlay") || changed("lifecycle")) && (spotlightClicks && lifecycle === LIFECYCLE.TOOLTIP ? window.addEventListener("mousemove", this.handleMouseMove, !1) : lifecycle !== LIFECYCLE.TOOLTIP && window.removeEventListener("mousemove", this.handleMouseMove)); 17883 } 17884 componentWillUnmount() { 17885 var _a2; 17886 this.isActive = !1, window.removeEventListener("mousemove", this.handleMouseMove), window.removeEventListener("resize", this.handleResize), clearTimeout(this.resizeTimeout), clearTimeout(this.scrollTimeout), (_a2 = this.scrollParent) == null || _a2.removeEventListener("scroll", this.handleScroll); 17887 } 17888 get overlayStyles() { 17889 let { mouseOverSpotlight } = this.state, { disableOverlayClose, placement, styles: styles2 } = this.props, baseStyles = styles2.overlay; 17890 return isLegacy() && (baseStyles = placement === "center" ? styles2.overlayLegacyCenter : styles2.overlayLegacy), { 17891 cursor: disableOverlayClose ? "default" : "pointer", 17892 height: getDocumentHeight(), 17893 pointerEvents: mouseOverSpotlight ? "none" : "auto", 17894 ...baseStyles 17895 }; 17896 } 17897 get spotlightStyles() { 17898 var _a2, _b, _c; 17899 let { showSpotlight } = this.state, { 17900 disableScrollParentFix = !1, 17901 spotlightClicks, 17902 spotlightPadding = 0, 17903 styles: styles2, 17904 target 17905 } = this.props, element = getElement(target), elementRect = getClientRect2(element), isFixedTarget = hasPosition(element), top = getElementPosition(element, spotlightPadding, disableScrollParentFix); 17906 return { 17907 ...isLegacy() ? styles2.spotlightLegacy : styles2.spotlight, 17908 height: Math.round(((_a2 = elementRect?.height) != null ? _a2 : 0) + spotlightPadding * 2), 17909 left: Math.round(((_b = elementRect?.left) != null ? _b : 0) - spotlightPadding), 17910 opacity: showSpotlight ? 1 : 0, 17911 pointerEvents: spotlightClicks ? "none" : "auto", 17912 position: isFixedTarget ? "fixed" : "absolute", 17913 top, 17914 transition: "opacity 0.2s", 17915 width: Math.round(((_c = elementRect?.width) != null ? _c : 0) + spotlightPadding * 2) 17916 }; 17917 } 17918 updateState(state) { 17919 this.isActive && this.setState((previousState) => ({ ...previousState, ...state })); 17920 } 17921 render() { 17922 let { showSpotlight } = this.state, { onClickOverlay, placement } = this.props, { hideSpotlight, overlayStyles, spotlightStyles } = this; 17923 if (hideSpotlight()) 17924 return null; 17925 let spotlight2 = placement !== "center" && showSpotlight && createElement(Spotlight_default, { styles: spotlightStyles }); 17926 if (getBrowser() === "safari") { 17927 let { mixBlendMode, zIndex, ...safariOverlay } = overlayStyles; 17928 spotlight2 = createElement("div", { style: { ...safariOverlay } }, spotlight2), delete overlayStyles.backgroundColor; 17929 } 17930 return createElement( 17931 "div", 17932 { 17933 className: "react-joyride__overlay", 17934 "data-test-id": "overlay", 17935 onClick: onClickOverlay, 17936 role: "presentation", 17937 style: overlayStyles 17938 }, 17939 spotlight2 17940 ); 17941 } 17942}, JoyridePortal = class extends Component { 17943 constructor() { 17944 super(...arguments), __publicField(this, "node", null); 17945 } 17946 componentDidMount() { 17947 let { id } = this.props; 17948 canUseDOM2() && (this.node = document.createElement("div"), this.node.id = id, document.body.appendChild(this.node), isReact162 || this.renderReact15()); 17949 } 17950 componentDidUpdate() { 17951 canUseDOM2() && (isReact162 || this.renderReact15()); 17952 } 17953 componentWillUnmount() { 17954 !canUseDOM2() || !this.node || (isReact162 || unmountComponentAtNode(this.node), this.node.parentNode === document.body && (document.body.removeChild(this.node), this.node = null)); 17955 } 17956 renderReact15() { 17957 if (!canUseDOM2()) 17958 return; 17959 let { children } = this.props; 17960 this.node && unstable_renderSubtreeIntoContainer(this, children, this.node); 17961 } 17962 renderReact16() { 17963 if (!canUseDOM2() || !isReact162) 17964 return null; 17965 let { children } = this.props; 17966 return this.node ? createPortal(children, this.node) : null; 17967 } 17968 render() { 17969 return isReact162 ? this.renderReact16() : null; 17970 } 17971}, Scope = class { 17972 constructor(element, options2) { 17973 if (__publicField(this, "element"), __publicField(this, "options"), __publicField(this, "canBeTabbed", (element2) => { 17974 let { tabIndex } = element2; 17975 return tabIndex === null || tabIndex < 0 ? !1 : this.canHaveFocus(element2); 17976 }), __publicField(this, "canHaveFocus", (element2) => { 17977 let validTabNodes = /input|select|textarea|button|object/, nodeName = element2.nodeName.toLowerCase(); 17978 return (validTabNodes.test(nodeName) && !element2.getAttribute("disabled") || nodeName === "a" && !!element2.getAttribute("href")) && this.isVisible(element2); 17979 }), __publicField(this, "findValidTabElements", () => [].slice.call(this.element.querySelectorAll("*"), 0).filter(this.canBeTabbed)), __publicField(this, "handleKeyDown", (event) => { 17980 let { code = "Tab" } = this.options; 17981 event.code === code && this.interceptTab(event); 17982 }), __publicField(this, "interceptTab", (event) => { 17983 event.preventDefault(); 17984 let elements = this.findValidTabElements(), { shiftKey } = event; 17985 if (!elements.length) 17986 return; 17987 let x2 = document.activeElement ? elements.indexOf(document.activeElement) : 0; 17988 x2 === -1 || !shiftKey && x2 + 1 === elements.length ? x2 = 0 : shiftKey && x2 === 0 ? x2 = elements.length - 1 : x2 += shiftKey ? -1 : 1, elements[x2].focus(); 17989 }), __publicField(this, "isHidden", (element2) => { 17990 let noSize = element2.offsetWidth <= 0 && element2.offsetHeight <= 0, style = window.getComputedStyle(element2); 17991 return noSize && !element2.innerHTML ? !0 : noSize && style.getPropertyValue("overflow") !== "visible" || style.getPropertyValue("display") === "none"; 17992 }), __publicField(this, "isVisible", (element2) => { 17993 let parentElement = element2; 17994 for (; parentElement; ) 17995 if (parentElement instanceof HTMLElement) { 17996 if (parentElement === document.body) 17997 break; 17998 if (this.isHidden(parentElement)) 17999 return !1; 18000 parentElement = parentElement.parentNode; 18001 } 18002 return !0; 18003 }), __publicField(this, "removeScope", () => { 18004 window.removeEventListener("keydown", this.handleKeyDown); 18005 }), __publicField(this, "checkFocus", (target) => { 18006 document.activeElement !== target && (target.focus(), window.requestAnimationFrame(() => this.checkFocus(target))); 18007 }), __publicField(this, "setFocus", () => { 18008 let { selector } = this.options; 18009 if (!selector) 18010 return; 18011 let target = this.element.querySelector(selector); 18012 target && window.requestAnimationFrame(() => this.checkFocus(target)); 18013 }), !(element instanceof HTMLElement)) 18014 throw new TypeError("Invalid parameter: element must be an HTMLElement"); 18015 this.element = element, this.options = options2, window.addEventListener("keydown", this.handleKeyDown, !1), this.setFocus(); 18016 } 18017}, JoyrideBeacon = class extends Component { 18018 constructor(props) { 18019 if (super(props), __publicField(this, "beacon", null), __publicField(this, "setBeaconRef", (c2) => { 18020 this.beacon = c2; 18021 }), props.beaconComponent) 18022 return; 18023 let head = document.head || document.getElementsByTagName("head")[0], style = document.createElement("style"); 18024 style.id = "joyride-beacon-animation", props.nonce && style.setAttribute("nonce", props.nonce), style.appendChild(document.createTextNode(` 18025 @keyframes joyride-beacon-inner { 18026 20% { 18027 opacity: 0.9; 18028 } 18029 18030 90% { 18031 opacity: 0.7; 18032 } 18033 } 18034 18035 @keyframes joyride-beacon-outer { 18036 0% { 18037 transform: scale(1); 18038 } 18039 18040 45% { 18041 opacity: 0.7; 18042 transform: scale(0.75); 18043 } 18044 18045 100% { 18046 opacity: 0.9; 18047 transform: scale(1); 18048 } 18049 } 18050 `)), head.appendChild(style); 18051 } 18052 componentDidMount() { 18053 let { shouldFocus } = this.props; 18054 setTimeout(() => { 18055 src_default.domElement(this.beacon) && shouldFocus && this.beacon.focus(); 18056 }, 0); 18057 } 18058 componentWillUnmount() { 18059 let style = document.getElementById("joyride-beacon-animation"); 18060 style?.parentNode && style.parentNode.removeChild(style); 18061 } 18062 render() { 18063 let { 18064 beaconComponent, 18065 continuous, 18066 index, 18067 isLastStep, 18068 locale, 18069 onClickOrHover, 18070 size, 18071 step, 18072 styles: styles2 18073 } = this.props, title2 = getReactNodeText(locale.open), sharedProps = { 18074 "aria-label": title2, 18075 onClick: onClickOrHover, 18076 onMouseEnter: onClickOrHover, 18077 ref: this.setBeaconRef, 18078 title: title2 18079 }, component; 18080 return beaconComponent ? component = createElement( 18081 beaconComponent, 18082 { 18083 continuous, 18084 index, 18085 isLastStep, 18086 size, 18087 step, 18088 ...sharedProps 18089 } 18090 ) : component = createElement( 18091 "button", 18092 { 18093 key: "JoyrideBeacon", 18094 className: "react-joyride__beacon", 18095 "data-test-id": "button-beacon", 18096 style: styles2.beacon, 18097 type: "button", 18098 ...sharedProps 18099 }, 18100 createElement("span", { style: styles2.beaconInner }), 18101 createElement("span", { style: styles2.beaconOuter }) 18102 ), component; 18103 } 18104}; 18105function JoyrideTooltipCloseButton({ styles: styles2, ...props }) { 18106 let { color: color2, height, width, ...style } = styles2; 18107 return react_default.createElement("button", { style, type: "button", ...props }, react_default.createElement( 18108 "svg", 18109 { 18110 height: typeof height == "number" ? `${height}px` : height, 18111 preserveAspectRatio: "xMidYMid", 18112 version: "1.1", 18113 viewBox: "0 0 18 18", 18114 width: typeof width == "number" ? `${width}px` : width, 18115 xmlns: "http://www.w3.org/2000/svg" 18116 }, 18117 react_default.createElement("g", null, react_default.createElement( 18118 "path", 18119 { 18120 d: "M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z", 18121 fill: color2 18122 } 18123 )) 18124 )); 18125} 18126var CloseButton_default = JoyrideTooltipCloseButton; 18127function JoyrideTooltipContainer(props) { 18128 let { backProps, closeProps, index, isLastStep, primaryProps, skipProps, step, tooltipProps } = props, { content, hideBackButton, hideCloseButton, hideFooter, showSkipButton, styles: styles2, title: title2 } = step, output = {}; 18129 return output.primary = createElement( 18130 "button", 18131 { 18132 "data-test-id": "button-primary", 18133 style: styles2.buttonNext, 18134 type: "button", 18135 ...primaryProps 18136 } 18137 ), showSkipButton && !isLastStep && (output.skip = createElement( 18138 "button", 18139 { 18140 "aria-live": "off", 18141 "data-test-id": "button-skip", 18142 style: styles2.buttonSkip, 18143 type: "button", 18144 ...skipProps 18145 } 18146 )), !hideBackButton && index > 0 && (output.back = createElement("button", { "data-test-id": "button-back", style: styles2.buttonBack, type: "button", ...backProps })), output.close = !hideCloseButton && createElement(CloseButton_default, { "data-test-id": "button-close", styles: styles2.buttonClose, ...closeProps }), createElement( 18147 "div", 18148 { 18149 key: "JoyrideTooltip", 18150 "aria-label": getReactNodeText(title2 ?? content), 18151 className: "react-joyride__tooltip", 18152 style: styles2.tooltip, 18153 ...tooltipProps 18154 }, 18155 createElement("div", { style: styles2.tooltipContainer }, title2 && createElement("h1", { "aria-label": getReactNodeText(title2), style: styles2.tooltipTitle }, title2), createElement("div", { style: styles2.tooltipContent }, content)), 18156 !hideFooter && createElement("div", { style: styles2.tooltipFooter }, createElement("div", { style: styles2.tooltipFooterSpacer }, output.skip), output.back, output.primary), 18157 output.close 18158 ); 18159} 18160var Container_default = JoyrideTooltipContainer, JoyrideTooltip = class extends Component { 18161 constructor() { 18162 super(...arguments), __publicField(this, "handleClickBack", (event) => { 18163 event.preventDefault(); 18164 let { helpers } = this.props; 18165 helpers.prev(); 18166 }), __publicField(this, "handleClickClose", (event) => { 18167 event.preventDefault(); 18168 let { helpers } = this.props; 18169 helpers.close("button_close"); 18170 }), __publicField(this, "handleClickPrimary", (event) => { 18171 event.preventDefault(); 18172 let { continuous, helpers } = this.props; 18173 if (!continuous) { 18174 helpers.close("button_primary"); 18175 return; 18176 } 18177 helpers.next(); 18178 }), __publicField(this, "handleClickSkip", (event) => { 18179 event.preventDefault(); 18180 let { helpers } = this.props; 18181 helpers.skip(); 18182 }), __publicField(this, "getElementsProps", () => { 18183 let { continuous, index, isLastStep, setTooltipRef, size, step } = this.props, { back, close, last, next, nextLabelWithProgress, skip } = step.locale, backText = getReactNodeText(back), closeText = getReactNodeText(close), lastText = getReactNodeText(last), nextText = getReactNodeText(next), skipText = getReactNodeText(skip), primary = close, primaryText = closeText; 18184 if (continuous) { 18185 if (primary = next, primaryText = nextText, step.showProgress && !isLastStep) { 18186 let labelWithProgress = getReactNodeText(nextLabelWithProgress, { 18187 step: index + 1, 18188 steps: size 18189 }); 18190 primary = replaceLocaleContent(nextLabelWithProgress, index + 1, size), primaryText = labelWithProgress; 18191 } 18192 isLastStep && (primary = last, primaryText = lastText); 18193 } 18194 return { 18195 backProps: { 18196 "aria-label": backText, 18197 children: back, 18198 "data-action": "back", 18199 onClick: this.handleClickBack, 18200 role: "button", 18201 title: backText 18202 }, 18203 closeProps: { 18204 "aria-label": closeText, 18205 children: close, 18206 "data-action": "close", 18207 onClick: this.handleClickClose, 18208 role: "button", 18209 title: closeText 18210 }, 18211 primaryProps: { 18212 "aria-label": primaryText, 18213 children: primary, 18214 "data-action": "primary", 18215 onClick: this.handleClickPrimary, 18216 role: "button", 18217 title: primaryText 18218 }, 18219 skipProps: { 18220 "aria-label": skipText, 18221 children: skip, 18222 "data-action": "skip", 18223 onClick: this.handleClickSkip, 18224 role: "button", 18225 title: skipText 18226 }, 18227 tooltipProps: { 18228 "aria-modal": !0, 18229 ref: setTooltipRef, 18230 role: "alertdialog" 18231 } 18232 }; 18233 }); 18234 } 18235 render() { 18236 let { continuous, index, isLastStep, setTooltipRef, size, step } = this.props, { beaconComponent, tooltipComponent, ...cleanStep } = step, component; 18237 if (tooltipComponent) { 18238 let renderProps = { 18239 ...this.getElementsProps(), 18240 continuous, 18241 index, 18242 isLastStep, 18243 size, 18244 step: cleanStep, 18245 setTooltipRef 18246 }; 18247 component = createElement(tooltipComponent, { ...renderProps }); 18248 } else 18249 component = createElement( 18250 Container_default, 18251 { 18252 ...this.getElementsProps(), 18253 continuous, 18254 index, 18255 isLastStep, 18256 size, 18257 step 18258 } 18259 ); 18260 return component; 18261 } 18262}, JoyrideStep = class extends Component { 18263 constructor() { 18264 super(...arguments), __publicField(this, "scope", null), __publicField(this, "tooltip", null), __publicField(this, "handleClickHoverBeacon", (event) => { 18265 let { step, store: store2 } = this.props; 18266 event.type === "mouseenter" && step.event !== "hover" || store2.update({ lifecycle: LIFECYCLE.TOOLTIP }); 18267 }), __publicField(this, "setTooltipRef", (element) => { 18268 this.tooltip = element; 18269 }), __publicField(this, "setPopper", (popper, type) => { 18270 var _a2; 18271 let { action, lifecycle, step, store: store2 } = this.props; 18272 type === "wrapper" ? store2.setPopper("beacon", popper) : store2.setPopper("tooltip", popper), store2.getPopper("beacon") && (store2.getPopper("tooltip") || step.placement === "center") && lifecycle === LIFECYCLE.INIT && store2.update({ 18273 action, 18274 lifecycle: LIFECYCLE.READY 18275 }), (_a2 = step.floaterProps) != null && _a2.getPopper && step.floaterProps.getPopper(popper, type); 18276 }), __publicField(this, "renderTooltip", (renderProps) => { 18277 let { continuous, helpers, index, size, step } = this.props; 18278 return createElement( 18279 JoyrideTooltip, 18280 { 18281 continuous, 18282 helpers, 18283 index, 18284 isLastStep: index + 1 === size, 18285 setTooltipRef: this.setTooltipRef, 18286 size, 18287 step, 18288 ...renderProps 18289 } 18290 ); 18291 }); 18292 } 18293 componentDidMount() { 18294 let { debug, index } = this.props; 18295 log2({ 18296 title: `step:${index}`, 18297 data: [{ key: "props", value: this.props }], 18298 debug 18299 }); 18300 } 18301 componentDidUpdate(previousProps) { 18302 var _a2; 18303 let { 18304 action, 18305 callback, 18306 continuous, 18307 controlled, 18308 debug, 18309 helpers, 18310 index, 18311 lifecycle, 18312 shouldScroll: shouldScroll2, 18313 status, 18314 step, 18315 store: store2 18316 } = this.props, { changed, changedFrom } = treeChanges(previousProps, this.props), state = helpers.info(), skipBeacon = continuous && action !== ACTIONS.CLOSE && (index > 0 || action === ACTIONS.PREV), hasStoreChanged = changed("action") || changed("index") || changed("lifecycle") || changed("status"), isInitial = changedFrom("lifecycle", [LIFECYCLE.TOOLTIP, LIFECYCLE.INIT], LIFECYCLE.INIT), isAfterAction = changed("action", [ 18317 ACTIONS.NEXT, 18318 ACTIONS.PREV, 18319 ACTIONS.SKIP, 18320 ACTIONS.CLOSE 18321 ]), isControlled = controlled && index === previousProps.index; 18322 if (isAfterAction && (isInitial || isControlled) && callback({ 18323 ...state, 18324 index: previousProps.index, 18325 lifecycle: LIFECYCLE.COMPLETE, 18326 step: previousProps.step, 18327 type: EVENTS.STEP_AFTER 18328 }), step.placement === "center" && status === STATUS3.RUNNING && changed("index") && action !== ACTIONS.START && lifecycle === LIFECYCLE.INIT && store2.update({ lifecycle: LIFECYCLE.READY }), hasStoreChanged) { 18329 let element = getElement(step.target), elementExists = !!element; 18330 elementExists && isElementVisible(element) ? (changedFrom("status", STATUS3.READY, STATUS3.RUNNING) || changedFrom("lifecycle", LIFECYCLE.INIT, LIFECYCLE.READY)) && callback({ 18331 ...state, 18332 step, 18333 type: EVENTS.STEP_BEFORE 18334 }) : (console.warn(elementExists ? "Target not visible" : "Target not mounted", step), callback({ 18335 ...state, 18336 type: EVENTS.TARGET_NOT_FOUND, 18337 step 18338 }), controlled || store2.update({ index: index + (action === ACTIONS.PREV ? -1 : 1) })); 18339 } 18340 changedFrom("lifecycle", LIFECYCLE.INIT, LIFECYCLE.READY) && store2.update({ 18341 lifecycle: hideBeacon(step) || skipBeacon ? LIFECYCLE.TOOLTIP : LIFECYCLE.BEACON 18342 }), changed("index") && log2({ 18343 title: `step:${lifecycle}`, 18344 data: [{ key: "props", value: this.props }], 18345 debug 18346 }), changed("lifecycle", LIFECYCLE.BEACON) && callback({ 18347 ...state, 18348 step, 18349 type: EVENTS.BEACON 18350 }), changed("lifecycle", LIFECYCLE.TOOLTIP) && (callback({ 18351 ...state, 18352 step, 18353 type: EVENTS.TOOLTIP 18354 }), shouldScroll2 && this.tooltip && (this.scope = new Scope(this.tooltip, { selector: "[data-action=primary]" }), this.scope.setFocus())), changedFrom("lifecycle", [LIFECYCLE.TOOLTIP, LIFECYCLE.INIT], LIFECYCLE.INIT) && ((_a2 = this.scope) == null || _a2.removeScope(), store2.cleanupPoppers()); 18355 } 18356 componentWillUnmount() { 18357 var _a2; 18358 (_a2 = this.scope) == null || _a2.removeScope(); 18359 } 18360 get open() { 18361 let { lifecycle, step } = this.props; 18362 return hideBeacon(step) || lifecycle === LIFECYCLE.TOOLTIP; 18363 } 18364 render() { 18365 let { continuous, debug, index, nonce, shouldScroll: shouldScroll2, size, step } = this.props, target = getElement(step.target); 18366 return !validateStep(step) || !src_default.domElement(target) ? null : createElement("div", { key: `JoyrideStep-${index}`, className: "react-joyride__step" }, createElement( 18367 ReactFloater, 18368 { 18369 ...step.floaterProps, 18370 component: this.renderTooltip, 18371 debug, 18372 getPopper: this.setPopper, 18373 id: `react-joyride-step-${index}`, 18374 open: this.open, 18375 placement: step.placement, 18376 target: step.target 18377 }, 18378 createElement( 18379 JoyrideBeacon, 18380 { 18381 beaconComponent: step.beaconComponent, 18382 continuous, 18383 index, 18384 isLastStep: index + 1 === size, 18385 locale: step.locale, 18386 nonce, 18387 onClickOrHover: this.handleClickHoverBeacon, 18388 shouldFocus: shouldScroll2, 18389 size, 18390 step, 18391 styles: step.styles 18392 } 18393 ) 18394 )); 18395 } 18396}, Joyride = class extends Component { 18397 constructor(props) { 18398 super(props), __publicField(this, "helpers"), __publicField(this, "store"), __publicField(this, "callback", (data) => { 18399 let { callback } = this.props; 18400 src_default.function(callback) && callback(data); 18401 }), __publicField(this, "handleKeyboard", (event) => { 18402 let { index, lifecycle } = this.state, { steps } = this.props, step = steps[index]; 18403 lifecycle === LIFECYCLE.TOOLTIP && event.code === "Escape" && step && !step.disableCloseOnEsc && this.store.close("keyboard"); 18404 }), __publicField(this, "handleClickOverlay", () => { 18405 let { index } = this.state, { steps } = this.props; 18406 getMergedStep(this.props, steps[index]).disableOverlayClose || this.helpers.close("overlay"); 18407 }), __publicField(this, "syncState", (state) => { 18408 this.setState(state); 18409 }); 18410 let { debug, getHelpers, run = !0, stepIndex } = props; 18411 this.store = createStore({ 18412 ...props, 18413 controlled: run && src_default.number(stepIndex) 18414 }), this.helpers = this.store.getHelpers(); 18415 let { addListener } = this.store; 18416 log2({ 18417 title: "init", 18418 data: [ 18419 { key: "props", value: this.props }, 18420 { key: "state", value: this.state } 18421 ], 18422 debug 18423 }), addListener(this.syncState), getHelpers && getHelpers(this.helpers), this.state = this.store.getState(); 18424 } 18425 componentDidMount() { 18426 if (!canUseDOM2()) 18427 return; 18428 let { debug, disableCloseOnEsc, run, steps } = this.props, { start } = this.store; 18429 validateSteps(steps, debug) && run && start(), disableCloseOnEsc || document.body.addEventListener("keydown", this.handleKeyboard, { passive: !0 }); 18430 } 18431 componentDidUpdate(previousProps, previousState) { 18432 if (!canUseDOM2()) 18433 return; 18434 let { action, controlled, index, status } = this.state, { debug, run, stepIndex, steps } = this.props, { stepIndex: previousStepIndex, steps: previousSteps } = previousProps, { reset, setSteps, start, stop, update: update2 } = this.store, { changed: changedProps } = treeChanges(previousProps, this.props), { changed, changedFrom } = treeChanges(previousState, this.state), step = getMergedStep(this.props, steps[index]), stepsChanged = !equal(previousSteps, steps), stepIndexChanged = src_default.number(stepIndex) && changedProps("stepIndex"), target = getElement(step.target); 18435 if (stepsChanged && (validateSteps(steps, debug) ? setSteps(steps) : console.warn("Steps are not valid", steps)), changedProps("run") && (run ? start(stepIndex) : stop()), stepIndexChanged) { 18436 let nextAction = src_default.number(previousStepIndex) && previousStepIndex < stepIndex ? ACTIONS.NEXT : ACTIONS.PREV; 18437 action === ACTIONS.STOP && (nextAction = ACTIONS.START), [STATUS3.FINISHED, STATUS3.SKIPPED].includes(status) || update2({ 18438 action: action === ACTIONS.CLOSE ? ACTIONS.CLOSE : nextAction, 18439 index: stepIndex, 18440 lifecycle: LIFECYCLE.INIT 18441 }); 18442 } 18443 !controlled && status === STATUS3.RUNNING && index === 0 && !target && (this.store.update({ index: index + 1 }), this.callback({ 18444 ...this.state, 18445 type: EVENTS.TARGET_NOT_FOUND, 18446 step 18447 })); 18448 let callbackData = { 18449 ...this.state, 18450 index, 18451 step 18452 }; 18453 if (changed("action", [ 18454 ACTIONS.NEXT, 18455 ACTIONS.PREV, 18456 ACTIONS.SKIP, 18457 ACTIONS.CLOSE 18458 ]) && changed("status", STATUS3.PAUSED)) { 18459 let previousStep = getMergedStep(this.props, steps[previousState.index]); 18460 this.callback({ 18461 ...callbackData, 18462 index: previousState.index, 18463 lifecycle: LIFECYCLE.COMPLETE, 18464 step: previousStep, 18465 type: EVENTS.STEP_AFTER 18466 }); 18467 } 18468 if (changed("status", [STATUS3.FINISHED, STATUS3.SKIPPED])) { 18469 let previousStep = getMergedStep(this.props, steps[previousState.index]); 18470 controlled || this.callback({ 18471 ...callbackData, 18472 index: previousState.index, 18473 lifecycle: LIFECYCLE.COMPLETE, 18474 step: previousStep, 18475 type: EVENTS.STEP_AFTER 18476 }), this.callback({ 18477 ...callbackData, 18478 type: EVENTS.TOUR_END, 18479 // Return the last step when the tour is finished 18480 step: previousStep, 18481 index: previousState.index 18482 }), reset(); 18483 } else changedFrom("status", [STATUS3.IDLE, STATUS3.READY], STATUS3.RUNNING) ? this.callback({ 18484 ...callbackData, 18485 type: EVENTS.TOUR_START 18486 }) : (changed("status") || changed("action", ACTIONS.RESET)) && this.callback({ 18487 ...callbackData, 18488 type: EVENTS.TOUR_STATUS 18489 }); 18490 this.scrollToStep(previousState); 18491 } 18492 componentWillUnmount() { 18493 let { disableCloseOnEsc } = this.props; 18494 disableCloseOnEsc || document.body.removeEventListener("keydown", this.handleKeyboard); 18495 } 18496 scrollToStep(previousState) { 18497 let { index, lifecycle, status } = this.state, { 18498 debug, 18499 disableScrollParentFix = !1, 18500 scrollDuration, 18501 scrollOffset = 20, 18502 scrollToFirstStep = !1, 18503 steps 18504 } = this.props, step = getMergedStep(this.props, steps[index]), target = getElement(step.target), shouldScrollToStep = shouldScroll({ 18505 isFirstStep: index === 0, 18506 lifecycle, 18507 previousLifecycle: previousState.lifecycle, 18508 scrollToFirstStep, 18509 step, 18510 target 18511 }); 18512 if (status === STATUS3.RUNNING && shouldScrollToStep) { 18513 let hasCustomScroll = hasCustomScrollParent(target, disableScrollParentFix), scrollParent2 = getScrollParent2(target, disableScrollParentFix), scrollY = Math.floor(getScrollTo(target, scrollOffset, disableScrollParentFix)) || 0; 18514 log2({ 18515 title: "scrollToStep", 18516 data: [ 18517 { key: "index", value: index }, 18518 { key: "lifecycle", value: lifecycle }, 18519 { key: "status", value: status } 18520 ], 18521 debug 18522 }); 18523 let beaconPopper = this.store.getPopper("beacon"), tooltipPopper = this.store.getPopper("tooltip"); 18524 if (lifecycle === LIFECYCLE.BEACON && beaconPopper) { 18525 let { offsets, placement } = beaconPopper; 18526 !["bottom"].includes(placement) && !hasCustomScroll && (scrollY = Math.floor(offsets.popper.top - scrollOffset)); 18527 } else if (lifecycle === LIFECYCLE.TOOLTIP && tooltipPopper) { 18528 let { flipped, offsets, placement } = tooltipPopper; 18529 ["top", "right", "left"].includes(placement) && !flipped && !hasCustomScroll ? scrollY = Math.floor(offsets.popper.top - scrollOffset) : scrollY -= step.spotlightPadding; 18530 } 18531 scrollY = scrollY >= 0 ? scrollY : 0, status === STATUS3.RUNNING && scrollTo(scrollY, { element: scrollParent2, duration: scrollDuration }).then( 18532 () => { 18533 setTimeout(() => { 18534 var _a2; 18535 (_a2 = this.store.getPopper("tooltip")) == null || _a2.instance.update(); 18536 }, 10); 18537 } 18538 ); 18539 } 18540 } 18541 render() { 18542 if (!canUseDOM2()) 18543 return null; 18544 let { index, lifecycle, status } = this.state, { 18545 continuous = !1, 18546 debug = !1, 18547 nonce, 18548 scrollToFirstStep = !1, 18549 steps 18550 } = this.props, isRunning = status === STATUS3.RUNNING, content = {}; 18551 if (isRunning && steps[index]) { 18552 let step = getMergedStep(this.props, steps[index]); 18553 content.step = createElement( 18554 JoyrideStep, 18555 { 18556 ...this.state, 18557 callback: this.callback, 18558 continuous, 18559 debug, 18560 helpers: this.helpers, 18561 nonce, 18562 shouldScroll: !step.disableScrolling && (index !== 0 || scrollToFirstStep), 18563 step, 18564 store: this.store 18565 } 18566 ), content.overlay = createElement(JoyridePortal, { id: "react-joyride-portal" }, createElement( 18567 JoyrideOverlay, 18568 { 18569 ...step, 18570 continuous, 18571 debug, 18572 lifecycle, 18573 onClickOverlay: this.handleClickOverlay 18574 } 18575 )); 18576 } 18577 return createElement("div", { className: "react-joyride" }, content.step, content.overlay); 18578 } 18579}; 18580__publicField(Joyride, "defaultProps", defaultProps); 18581var components_default2 = Joyride; 18582
vendor: 11,366 bytes, lines 18583-18841
18583// src/manager/components/TourGuide/HighlightElement.tsx 18584init_react(); 18585var HIGHLIGHT_KEYFRAMES_ID = "storybook-highlight-element-keyframes", keyframes2 = ` 18586 @keyframes sb-highlight-pulsate { 18587 0% { 18588 box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 0 rgba(2, 156, 253, 0.7), 0 0 0 0 rgba(2, 156, 253, 0.4); 18589 } 18590 50% { 18591 box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 20px rgba(2, 156, 253, 0), 0 0 0 40px rgba(2, 156, 253, 0); 18592 } 18593 100% { 18594 box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 0 rgba(2, 156, 253, 0), 0 0 0 0 rgba(2, 156, 253, 0); 18595 } 18596 } 18597`, createOverlay = (element) => { 18598 let overlay = document.createElement("div"); 18599 return overlay.id = "storybook-highlight-element", overlay.style.position = "fixed", overlay.style.pointerEvents = "none", overlay.style.zIndex = "2147483647", overlay.style.transition = "opacity 0.2s ease-in-out", requestAnimationFrame(() => { 18600 updateOverlayStyles(element, overlay), element.scrollIntoView({ behavior: "smooth", block: "center" }); 18601 }), overlay; 18602}, updateOverlayStyles = (element, overlay) => { 18603 let rect = element.getBoundingClientRect(), computedStyle = window.getComputedStyle(element); 18604 overlay.style.top = `${rect.top}px`, overlay.style.left = `${rect.left}px`, overlay.style.width = `${rect.width}px`, overlay.style.height = `${rect.height}px`, overlay.style.borderRadius = computedStyle.borderRadius; 18605}, findScrollableAncestors = (element) => { 18606 let scrollableAncestors = [window], parent = element.parentElement; 18607 for (; parent; ) { 18608 let style = window.getComputedStyle(parent); 18609 (style.overflow === "auto" || style.overflow === "scroll" || style.overflowX === "auto" || style.overflowX === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll") && scrollableAncestors.push(parent), parent = parent.parentElement; 18610 } 18611 return scrollableAncestors; 18612}; 18613function HighlightElement({ 18614 targetSelector, 18615 pulsating = !1 18616}) { 18617 return useEffect(() => { 18618 let element = document.querySelector(targetSelector); 18619 if (!element || !element.parentElement) 18620 return; 18621 let overlay = document.body.appendChild(createOverlay(element)); 18622 if (pulsating) { 18623 if (!document.getElementById(HIGHLIGHT_KEYFRAMES_ID)) { 18624 let style = document.createElement("style"); 18625 style.id = HIGHLIGHT_KEYFRAMES_ID, style.innerHTML = keyframes2, document.head.appendChild(style); 18626 } 18627 overlay.style.animation = "sb-highlight-pulsate 3s infinite", overlay.style.transformOrigin = "center", overlay.style.animationTimingFunction = "ease-in-out"; 18628 } else 18629 overlay.style.boxShadow = "rgba(2,156,253,1) 0 0 2px 1px"; 18630 let scrollTimeout = null, handleScroll = () => { 18631 overlay.parentElement && overlay.remove(), scrollTimeout !== null && clearTimeout(scrollTimeout), scrollTimeout = window.setTimeout(() => { 18632 element && (updateOverlayStyles(element, overlay), overlay.style.opacity = "0", document.body.appendChild(overlay), requestAnimationFrame(() => overlay.style.opacity = "1")); 18633 }, 150); 18634 }, resizeObserver = new ResizeObserver( 18635 () => overlay.parentElement && updateOverlayStyles(element, overlay) 18636 ); 18637 resizeObserver.observe(window.document.body), resizeObserver.observe(element); 18638 let scrollContainers = findScrollableAncestors(element); 18639 return scrollContainers.forEach( 18640 (el) => el.addEventListener("scroll", handleScroll, { passive: !0 }) 18641 ), scrollContainers.filter((el) => el !== window).forEach((el) => resizeObserver.observe(el)), () => { 18642 scrollTimeout !== null && clearTimeout(scrollTimeout), overlay.parentElement && overlay.remove(), scrollContainers.forEach((el) => el.removeEventListener("scroll", handleScroll)), resizeObserver.disconnect(); 18643 }; 18644 }, [targetSelector, pulsating]), null; 18645} 18646 18647// src/manager/components/TourGuide/TourTooltip.tsx 18648init_react(); 18649var ONBOARDING_ARROW_STYLE_ID = "storybook-onboarding-arrow-style", TooltipBody = styled.div` 18650 padding: 15px; 18651 border-radius: 5px; 18652`, Wrapper4 = styled.div` 18653 display: flex; 18654 flex-direction: column; 18655 align-items: flex-start; 18656`, TooltipHeader = styled.div` 18657 display: flex; 18658 align-items: center; 18659 align-self: stretch; 18660 justify-content: space-between; 18661 margin: -5px -5px 5px 0; 18662`, TooltipTitle = styled.div` 18663 line-height: 18px; 18664 font-weight: 700; 18665 font-size: 14px; 18666 margin: 5px 5px 5px 0; 18667`, TooltipContent = styled.p` 18668 font-size: 14px; 18669 line-height: 18px; 18670 text-align: start; 18671 text-wrap: balance; 18672 margin: 0; 18673 margin-top: 5px; 18674`, TooltipFooter = styled.div` 18675 display: flex; 18676 align-items: center; 18677 justify-content: space-between; 18678 margin-top: 15px; 18679`, Count = styled.span` 18680 font-size: 13px; 18681`, NextButton = styled(Button)(({ theme }) => ({ 18682 background: theme.color.lightest, 18683 border: "none", 18684 boxShadow: "none", 18685 color: theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary), 18686 "&:hover, &:focus": { 18687 background: curriedTransparentize$1(0.1, theme.color.lightest), 18688 color: theme.base === "light" ? curriedLighten$1(0.1, theme.color.secondary) : curriedDarken$1(0.3, theme.color.secondary) 18689 } 18690})), TourTooltip = ({ 18691 index, 18692 size, 18693 step, 18694 closeProps, 18695 primaryProps, 18696 tooltipProps 18697}) => (useEffect(() => { 18698 let style = document.createElement("style"); 18699 return style.id = ONBOARDING_ARROW_STYLE_ID, style.innerHTML = ` 18700 .__floater__arrow { container-type: size; } 18701 .__floater__arrow span { background: ${color.secondary}; } 18702 .__floater__arrow span::before, .__floater__arrow span::after { 18703 content: ''; 18704 display: block; 18705 width: 2px; 18706 height: 2px; 18707 background: ${color.secondary}; 18708 box-shadow: 0 0 0 2px ${color.secondary}; 18709 border-radius: 3px; 18710 flex: 0 0 2px; 18711 } 18712 @container (min-height: 1px) { 18713 .__floater__arrow span { flex-direction: column; } 18714 } 18715 `, document.head.appendChild(style), () => document.getElementById(ONBOARDING_ARROW_STYLE_ID)?.remove(); 18716}, []), react_default.createElement(TooltipBody, { ...tooltipProps, style: step.styles?.tooltip }, react_default.createElement(Wrapper4, null, react_default.createElement(TooltipHeader, null, step.title && react_default.createElement(TooltipTitle, null, step.title), react_default.createElement( 18717 Button, 18718 { 18719 ...closeProps, 18720 onClick: closeProps.onClick, 18721 variant: "solid", 18722 padding: "small", 18723 ariaLabel: "Close" 18724 }, 18725 react_default.createElement(CloseAltIcon, null) 18726)), react_default.createElement(TooltipContent, null, step.content)), react_default.createElement(TooltipFooter, { id: "buttonNext" }, react_default.createElement(Count, null, index + 1, " of ", size), !step.hideNextButton && react_default.createElement(NextButton, { ...primaryProps }, index + 1 === size ? "Done" : "Next")))); 18727 18728// src/manager/components/TourGuide/TourGuide.tsx 18729var TourGuide = ({ 18730 step, 18731 steps, 18732 onNext, 18733 onComplete, 18734 onDismiss 18735}) => { 18736 let [stepIndex, setStepIndex] = useState(step ? null : 0), theme = useTheme(), timeoutRef = useRef(void 0), updateStepIndex = useCallback((index) => { 18737 clearTimeout(timeoutRef.current), setStepIndex((current) => index === -1 ? null : current === null || current === index ? index : (timeoutRef.current = setTimeout(setStepIndex, 300, index), null)); 18738 }, []); 18739 useEffect( 18740 () => step ? updateStepIndex(steps.findIndex(({ key }) => key === step)) : void 0, 18741 [step, steps, updateStepIndex] 18742 ); 18743 let mappedSteps = useMemo(() => steps.map((step2, index) => { 18744 let next = () => updateStepIndex(index + 1); 18745 return { 18746 disableBeacon: !0, 18747 disableOverlay: !0, 18748 spotlightClicks: !0, 18749 offset: 0, 18750 ...step2, 18751 content: react_default.createElement(react_default.Fragment, null, step2.content, step2.highlight && react_default.createElement(HighlightElement, { targetSelector: step2.highlight, pulsating: !0 })), 18752 onNext: step2.onNext ? () => step2.onNext?.({ next }) : onNext && (() => onNext?.({ next })) 18753 }; 18754 }), [steps, onNext, updateStepIndex]), callback = useCallback( 18755 (data) => { 18756 data.action === ACTIONS.NEXT && data.lifecycle === "complete" && (data.index === data.size - 1 ? onComplete?.() : data.step?.onNext ? data.step.onNext() : updateStepIndex(data.index + 1)), data.action === ACTIONS.CLOSE && onDismiss?.(); 18757 }, 18758 [onComplete, onDismiss, updateStepIndex] 18759 ); 18760 return stepIndex === null ? null : react_default.createElement( 18761 components_default2, 18762 { 18763 continuous: !0, 18764 steps: mappedSteps, 18765 stepIndex, 18766 spotlightPadding: 0, 18767 disableCloseOnEsc: !0, 18768 disableOverlayClose: !0, 18769 disableScrolling: !0, 18770 callback, 18771 tooltipComponent: TourTooltip, 18772 floaterProps: { 18773 disableAnimation: !0, 18774 styles: { 18775 arrow: { 18776 length: 20, 18777 spread: 2 18778 }, 18779 floater: { 18780 filter: theme.base === "light" ? "drop-shadow(0px 5px 5px rgba(0,0,0,0.05)) drop-shadow(0 1px 3px rgba(0,0,0,0.1))" : "drop-shadow(#fff5 0px 0px 0.5px) drop-shadow(#fff5 0px 0px 0.5px)" 18781 } 18782 } 18783 }, 18784 styles: { 18785 overlay: { 18786 mixBlendMode: "unset", 18787 backgroundColor: steps[stepIndex]?.target === "body" ? "rgba(27, 28, 29, 0.2)" : "none" 18788 }, 18789 spotlight: { 18790 backgroundColor: "none", 18791 border: `solid 2px ${theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary)}`, 18792 boxShadow: "0px 0px 0px 9999px rgba(27, 28, 29, 0.2)" 18793 }, 18794 tooltip: { 18795 width: 280, 18796 color: theme.color.lightest, 18797 background: theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary) 18798 }, 18799 options: { 18800 zIndex: 9998, 18801 primaryColor: theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary), 18802 arrowColor: theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary) 18803 } 18804 } 18805 } 18806 ); 18807}, root = null; 18808TourGuide.render = (props) => { 18809 let container = document.getElementById("storybook-tour"); 18810 container || (container = document.createElement("div"), container.id = "storybook-tour", document.body.appendChild(container)), root = root ?? createRoot(container), root.render( 18811 props ? react_default.createElement(ThemeProvider, { theme: convert(themes.light) }, react_default.createElement( 18812 TourGuide, 18813 { 18814 ...props, 18815 onComplete: () => { 18816 props.onComplete?.(), root?.render(null), root = null; 18817 }, 18818 onDismiss: () => { 18819 props.onDismiss?.(), root?.render(null), root = null; 18820 } 18821 } 18822 )) : null 18823 ); 18824}; 18825 18826// src/manager/hooks/useLocation.ts 18827init_react(); 18828var LocationMonitor = { 18829 _currentHref: globalThis.window?.location.href ?? "", 18830 _intervalId: null, 18831 _listeners: /* @__PURE__ */ new Set(), 18832 start() { 18833 this._intervalId === null && (this._intervalId = setInterval(() => { 18834 let newLocation = globalThis.window.location; 18835 newLocation.href !== this._currentHref && (this._currentHref = newLocation.href, this._listeners.forEach((listener) => listener(newLocation))); 18836 }, 100)); 18837 }, 18838 stop() { 18839 this._intervalId !== null && (clearInterval(this._intervalId), this._intervalId = null); 18840 }, 18841 subscribe(...listeners
188412) { 18842 return listeners2.forEach((listener) => this._listeners.add(listener)), this.start(), () => { 18843 listeners2
vendor: 48,850 bytes, lines 18843-19768
18843.forEach((listener) => this._listeners.delete(listener)), this._listeners.size === 0 && this.stop(); 18844 }; 18845 } 18846}, useLocationHash = () => { 18847 let [hash, setHash] = useState(globalThis.window?.location.hash ?? ""); 18848 return useEffect(() => LocationMonitor.subscribe((location2) => setHash(location2.hash)), []), hash.slice(1); 18849}; 18850 18851// src/shared/utils/ai-prompts.ts 18852var DEFAULT_STORYBOOK_EXECUTOR = "npx storybook"; 18853function getAiSetupPrompt(executor = DEFAULT_STORYBOOK_EXECUTOR) { 18854 return `Run \`${executor} ai setup\` and follow its instructions precisely.`; 18855} 18856 18857// src/shared/checklist-store/checklistData.tsx 18858var CodeWrapper = styled.div(({ theme }) => ({ 18859 alignSelf: "stretch", 18860 background: theme.background.content, 18861 borderRadius: theme.appBorderRadius, 18862 margin: "5px 0", 18863 padding: 10, 18864 fontSize: theme.typography.size.s1, 18865 ".linenumber": { 18866 opacity: 0.5 18867 } 18868})), CodeSnippet = (props) => react_default.createElement(ThemeProvider, { theme: convert(themes.dark) }, react_default.createElement(CodeWrapper, null, react_default.createElement(SyntaxHighlighter, { ...props }))), isExample = (id) => id.startsWith("example-") || id.startsWith("configure-your-project--"), subscribeToIndex = (condition) => ({ api, done }) => { 18869 let check = () => condition( 18870 Object.entries(api.getIndex()?.entries || {}).reduce( 18871 (acc, [id, entry]) => isExample(entry.id) ? acc : Object.assign(acc, { [id]: entry }), 18872 {} 18873 ) 18874 ); 18875 if (check()) 18876 done(); 18877 else 18878 return api.once(PREVIEW_INITIALIZED, () => check() && done()), api.on(STORY_INDEX_INVALIDATED, () => check() && done()); 18879}, checklistData = { 18880 sections: [ 18881 { 18882 id: "basics", 18883 title: "Storybook basics", 18884 items: [ 18885 { 18886 id: "aiSetup", 18887 label: "Set up with AI", 18888 icon: WandIcon, 18889 available: ({ storeState }) => !!storeState.aiOptIn && storeState.items.aiSetup?.status !== "done", 18890 criteria: "ai setup command has not been run yet", 18891 showOnGuidePage: !1, 18892 action: { 18893 label: "Copy prompt", 18894 copyContent: getAiSetupPrompt(), 18895 onClick: ({ api }) => { 18896 api.emit(AI_PROMPT_NUDGE, { id: "setup", origin: "onboarding-checklist-side" }); 18897 } 18898 } 18899 }, 18900 { 18901 id: "guidedTour", 18902 label: "Take the guided tour", 18903 available: ({ index }) => !!index && "example-button--primary" in index && !!globalThis?.FEATURES?.controls && addons.experimental_getRegisteredAddons().includes(ADDON_ID3), 18904 criteria: "Guided tour is completed", 18905 subscribe: ({ api, accept }) => api.on(ADDON_ONBOARDING_CHANNEL, ({ step, type }) => { 18906 type !== "dismiss" && ["6:IntentSurvey", "7:FinishedOnboarding"].includes(step) && accept(); 18907 }), 18908 action: { 18909 label: "Start", 18910 onClick: ({ api }) => { 18911 api.toggleNav(!0); 18912 let path = api.getUrlState().path || ""; 18913 path.startsWith("/story/") ? document.location.href = `/?path=${path}&onboarding=true` : document.location.href = "/?onboarding=true"; 18914 } 18915 } 18916 }, 18917 { 18918 id: "onboardingSurvey", 18919 label: "Complete the onboarding survey", 18920 available: () => addons.experimental_getRegisteredAddons().includes(ADDON_ID3), 18921 afterCompletion: "immutable", 18922 criteria: "Onboarding survey is completed", 18923 subscribe: ({ api, accept }) => api.on(ADDON_ONBOARDING_CHANNEL, ({ type }) => type === "survey" && accept()), 18924 action: { 18925 label: "Open", 18926 onClick: ({ api }) => { 18927 let path = api.getUrlState().path || ""; 18928 document.location.href = `/?path=${path}&onboarding=survey`; 18929 } 18930 } 18931 }, 18932 { 18933 id: "renderComponent", 18934 label: "Render your first component", 18935 criteria: "A story finished rendering successfully", 18936 subscribe: ({ api, done }) => api.on( 18937 STORY_FINISHED, 18938 ({ storyId, status }) => status === "success" && !isExample(storyId) && done() 18939 ), 18940 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Storybook renders your components in isolation, using stories. That allows you to work on the bit of UI you need, without worrying about the rest of the app."), react_default.createElement("p", null, "Rendering your components can often require", " ", react_default.createElement( 18941 Link, 18942 { 18943 href: api.getDocsUrl({ 18944 subpath: "writing-stories/decorators", 18945 renderer: !0, 18946 ref: "guide" 18947 }), 18948 target: "_blank" 18949 }, 18950 "setting up surrounding context in decorators" 18951 ), " ", "or", " ", react_default.createElement( 18952 Link, 18953 { 18954 href: api.getDocsUrl({ 18955 subpath: "configure/styling-and-css", 18956 renderer: !0, 18957 ref: "guide" 18958 }), 18959 target: "_blank" 18960 }, 18961 "applying global styles" 18962 ), ". Once you've got it working for one component, you're ready to make Storybook the home for all of your UI."), react_default.createElement("p", null, "Stories are written in CSF, a format specifically designed to help with UI development. Here's an example:"), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.ts 18963// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc. 18964import type { Meta, StoryObj } from '@storybook/your-framework'; 18965 18966import { Button } from './Button'; 18967 18968const meta = { 18969 // \u{1F447} The component you're working on 18970 component: Button, 18971} satisfies Meta<typeof Button>; 18972 18973export default meta; 18974// \u{1F447} Type helper to reduce boilerplate 18975type Story = StoryObj<typeof meta>; 18976 18977// \u{1F447} A story named Primary that renders \`<Button primary label="Button" />\` 18978export const Primary: Story = { 18979 args: { 18980 primary: true, 18981 label: 'Button', 18982 }, 18983};`), react_default.createElement("p", null, react_default.createElement( 18984 Link, 18985 { 18986 href: api.getDocsUrl({ 18987 subpath: "writing-stories", 18988 renderer: !0, 18989 ref: "guide" 18990 }), 18991 target: "_blank", 18992 withArrow: !0 18993 }, 18994 "Learn more about stories" 18995 ))) 18996 }, 18997 { 18998 id: "moreComponents", 18999 label: "Add 5 components", 19000 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Storybook gets better as you add more components. Start with the easy ones, like Button or Avatar, and work your way up to more complex components, like Select, Autocomplete, or even full pages."), react_default.createElement( 19001 "img", 19002 { 19003 src: api.getDocsUrl({ 19004 asset: "onboarding/sidebar-components.png", 19005 ref: "guide" 19006 }), 19007 alt: "Components in the sidebar" 19008 } 19009 ), react_default.createElement("p", null, react_default.createElement( 19010 Link, 19011 { 19012 href: api.getDocsUrl({ 19013 subpath: "get-started/whats-a-story#create-a-new-story", 19014 renderer: !0, 19015 ref: "guide" 19016 }), 19017 target: "_blank", 19018 withArrow: !0 19019 }, 19020 "Learn how to add components without writing any code" 19021 ))), 19022 criteria: "At least 5 components exist in the index", 19023 subscribe: subscribeToIndex((entries) => { 19024 let stories = Object.values(entries).filter( 19025 (entry) => entry.type === "story" 19026 ); 19027 return new Set(stories.map(({ title: title2 }) => title2)).size >= 5; 19028 }) 19029 }, 19030 { 19031 id: "moreStories", 19032 label: "Add 20 stories", 19033 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "More stories for your components means better documentation and more test coverage."), react_default.createElement( 19034 "img", 19035 { 19036 src: api.getDocsUrl({ 19037 asset: "onboarding/sidebar-many-stories.png", 19038 ref: "guide" 19039 }), 19040 alt: "Stories in the sidebar" 19041 } 19042 ), react_default.createElement("p", null, react_default.createElement( 19043 Link, 19044 { 19045 href: api.getDocsUrl({ 19046 subpath: "essentials/controls#creating-and-editing-stories-from-controls", 19047 renderer: !0, 19048 ref: "guide" 19049 }), 19050 target: "_blank", 19051 withArrow: !0 19052 }, 19053 "Learn how to use Controls to add stories without writing any code" 19054 ))), 19055 criteria: "At least 20 stories exist in the index", 19056 subscribe: subscribeToIndex((entries) => Object.values(entries).filter( 19057 (entry) => entry.type === "story" 19058 ).length >= 20) 19059 }, 19060 { 19061 id: "whatsNewStorybook10", 19062 label: "See what's new", 19063 criteria: "What's New page is opened", 19064 action: { 19065 label: "Go", 19066 onClick: ({ api }) => api.navigate("/settings/whats-new") 19067 }, 19068 subscribe: ({ accept }) => LocationMonitor.subscribe((l3) => l3.search.endsWith("/settings/whats-new") && accept()) 19069 } 19070 ] 19071 }, 19072 { 19073 id: "development", 19074 title: "Development", 19075 items: [ 19076 { 19077 id: "controls", 19078 label: "Change a story with Controls", 19079 available: () => !!globalThis?.FEATURES?.controls, 19080 criteria: "Story args are updated", 19081 subscribe: ({ api, done }) => api.on(STORY_ARGS_UPDATED, done), 19082 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "When you change the value of one of the inputs in the Controls table, the story automatically updates to reflect that change. It's a great way to explore how a component handles various inputs."), react_default.createElement( 19083 "img", 19084 { 19085 src: api.getDocsUrl({ 19086 asset: "api/doc-block-controls.png", 19087 ref: "guide" 19088 }), 19089 alt: "Screenshot of Controls block" 19090 } 19091 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19092 Link, 19093 { 19094 href: api.getDocsUrl({ 19095 subpath: "essentials/controls", 19096 renderer: !0, 19097 ref: "guide" 19098 }), 19099 target: "_blank" 19100 }, 19101 "Controls documentation" 19102 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to use the Controls panel to edit or save a new story"), react_default.createElement("li", null, "How to configure the table"))) 19103 }, 19104 { 19105 id: "viewports", 19106 label: "Check responsiveness with Viewports", 19107 available: () => !!globalThis?.FEATURES?.viewport, 19108 criteria: "Viewport global is updated", 19109 subscribe: ({ api, done }) => api.on(UPDATE_GLOBALS, ({ globals }) => globals?.viewport && done()), 19110 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Many UI components need to be responsive to the viewport size. Storybook has built-in support for previewing stories in various device sizes."), react_default.createElement( 19111 "img", 19112 { 19113 src: api.getDocsUrl({ 19114 asset: "onboarding/viewports-menu.png", 19115 ref: "guide" 19116 }), 19117 alt: "Screenshot of Viewports menu" 19118 } 19119 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19120 Link, 19121 { 19122 href: api.getDocsUrl({ 19123 subpath: "essentials/viewport", 19124 renderer: !0, 19125 ref: "guide" 19126 }), 19127 target: "_blank" 19128 }, 19129 "Viewports documentation" 19130 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to configure which viewports are available"), react_default.createElement("li", null, "How to force a story to ", react_default.createElement("em", null, "always"), " render in a specific viewport"))) 19131 }, 19132 { 19133 id: "organizeStories", 19134 label: "Group your components", 19135 criteria: "A root node exists in the index", 19136 subscribe: subscribeToIndex( 19137 (entries) => Object.values(entries).some(({ title: title2 }) => title2.includes("/")) 19138 ), 19139 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "It's helpful for projects to organize their sidebar into groups. We're big fans of Atomic Design (atoms, molecules, organisms, pages), but we've also seen organization by domain (profile, billing, dashboard, etc). Being organized helps everyone use your Storybook more effectively."), react_default.createElement("p", null, "You can create a section like so:"), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.js 19140 19141export default { 19142 component: Button, 19143- title: 'Button', // You may not have this 19144+ title: 'Atoms/Button', 19145}`), react_default.createElement("p", null, "Which would look like:"), react_default.createElement( 19146 "img", 19147 { 19148 src: api.getDocsUrl({ 19149 asset: "onboarding/sidebar-with-groups.png", 19150 ref: "guide" 19151 }), 19152 alt: "Grouped components in the sidebar" 19153 } 19154 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19155 Link, 19156 { 19157 href: api.getDocsUrl({ 19158 subpath: "writing-stories/naming-components-and-hierarchy", 19159 renderer: !0, 19160 ref: "guide" 19161 }), 19162 target: "_blank" 19163 }, 19164 "story organization documentation" 19165 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "The full hierarchy available"), react_default.createElement("li", null, "How to configure the sorting of your stories"))) 19166 } 19167 ] 19168 }, 19169 { 19170 id: "share", 19171 title: "Share", 19172 items: [ 19173 { 19174 id: "shareStorybook", 19175 label: "Share your Storybook for feedback", 19176 available: () => addons.experimental_getRegisteredAddons(Addon_TypesEnum.TOOLEXTRA).includes("chromaui/addon-visual-tests/share-tool"), 19177 criteria: "User has shared their Storybook", 19178 subscribe: ({ api, done }) => { 19179 let SHARE_PROGRESS_KEY = "chromaui/addon-visual-tests/shareProgress"; 19180 return api.on("experimental_useSharedState_setValue", (key, value) => { 19181 key === SHARE_PROGRESS_KEY && value?.status === "complete" && done(); 19182 }); 19183 }, 19184 action: { 19185 label: "Share", 19186 onClick: () => document.getElementById("chromatic-share-button")?.click() 19187 }, 19188 content: () => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Share your Storybook with your team in one click using Chromatic. Click the", " ", react_default.createElement("strong", null, "Share"), " button in the toolbar to publish and get a shareable link."), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(Link, { href: "https://www.chromatic.com/docs/sharing", target: "_blank", withArrow: !0 }, "sharing documentation"))) 19189 }, 19190 { 19191 id: "publishStorybook", 19192 label: "Publish your Storybook for feedback", 19193 available: () => !addons.experimental_getRegisteredAddons(Addon_TypesEnum.TOOLEXTRA).includes("chromaui/addon-visual-tests/share-tool"), 19194 criteria: "User has published their Storybook", 19195 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Publishing your Storybook is easy and unlocks super clear review cycles and other collaborative workflows."), react_default.createElement("p", null, "Run ", react_default.createElement("code", null, "npx storybook build"), " in CI and deploy it using services like", " ", react_default.createElement(Link, { href: "https://chromatic.com", target: "_blank" }, "Chromatic"), ",", " ", react_default.createElement(Link, { href: "https://vercel.com", target: "_blank", rel: "noopener noreferrer" }, "Vercel"), ", or", " ", react_default.createElement(Link, { href: "https://www.netlify.com", target: "_blank", rel: "noopener noreferrer" }, "Netlify"), "."), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19196 Link, 19197 { 19198 href: api.getDocsUrl({ 19199 subpath: "sharing/publish-storybook", 19200 renderer: !0, 19201 ref: "guide" 19202 }), 19203 target: "_blank", 19204 withArrow: !0 19205 }, 19206 "publishing documentation" 19207 ))) 19208 } 19209 ] 19210 }, 19211 { 19212 id: "testing", 19213 title: "Testing", 19214 items: [ 19215 { 19216 id: "installVitest", 19217 label: "Install Vitest addon", 19218 afterCompletion: "unavailable", 19219 available: () => !!globalThis.STORYBOOK_FRAMEWORK && SUPPORTED_FRAMEWORKS.includes(globalThis.STORYBOOK_FRAMEWORK), 19220 criteria: "@storybook/addon-vitest registered in .storybook/main.js|ts", 19221 subscribe: ({ done }) => { 19222 addons.experimental_getRegisteredAddons().includes(ADDON_ID5) && done(); 19223 }, 19224 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Run this command to install the Vitest addon, enabling you to run component tests on your stories inside Storybook\u2019s UI:"), react_default.createElement(CodeSnippet, { language: "bash" }, "npx storybook add @storybook/addon-vitest"), react_default.createElement("p", null, react_default.createElement("em", null, "Restart your Storybook after installing the addon.")), react_default.createElement( 19225 "img", 19226 { 19227 src: api.getDocsUrl({ 19228 asset: "writing-tests/testing-ui-overview.png", 19229 ref: "guide" 19230 }), 19231 alt: "Storybook app with story status indicators, testing widget, and addon panel annotated" 19232 } 19233 ), react_default.createElement("p", null, react_default.createElement( 19234 Link, 19235 { 19236 href: api.getDocsUrl({ 19237 subpath: "writing-tests/integrations/vitest-addon", 19238 renderer: !0, 19239 ref: "guide" 19240 }), 19241 target: "_blank", 19242 withArrow: !0 19243 }, 19244 "Learn more about the Vitest addon" 19245 ))) 19246 }, 19247 { 19248 id: "runTests", 19249 after: ["installVitest"], 19250 label: "Test your components", 19251 criteria: "Component tests are run from the test widget in the sidebar", 19252 subscribe: ({ done }) => internal_universalTestProviderStore.onStateChange((state) => { 19253 state["storybook/test"] === "test-provider-state:running" && (TourGuide.render(null), done()); 19254 }), 19255 action: { 19256 label: "Start", 19257 onClick: ({ api }) => { 19258 api.toggleNav(!0), TourGuide.render({ 19259 // eslint-disable-next-line @typescript-eslint/ban-ts-comment 19260 // @ts-ignore Circular reference in Step type 19261 steps: [ 19262 { 19263 title: "Testing widget", 19264 content: "Run tests right from your Storybook sidebar using the testing widget.", 19265 placement: "right-end", 19266 target: "#storybook-testing-module", 19267 highlight: "#storybook-testing-module", 19268 onNext: ({ next }) => { 19269 let toggle = document.getElementById("testing-module-collapse-toggle"); 19270 toggle?.getAttribute("aria-label") === "Expand testing module" ? (toggle.click(), setTimeout(next, 300)) : next(); 19271 } 19272 }, 19273 { 19274 title: "Start a test run", 19275 content: "Start a test run at the click of a button using Vitest.", 19276 placement: "right", 19277 target: '[data-module-id="storybook/test/test-provider"] button[aria-label="Start test run"]', 19278 highlight: '[data-module-id="storybook/test/test-provider"] button[aria-label="Start test run"]', 19279 hideNextButton: !0 19280 } 19281 ] 19282 }); 19283 } 19284 }, 19285 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Stories make great test cases. You can quickly test all of your stories directly from the test widget, at the bottom of the sidebar."), react_default.createElement( 19286 "img", 19287 { 19288 src: api.getDocsUrl({ 19289 asset: "onboarding/test-widget-with-failures.png", 19290 ref: "guide" 19291 }), 19292 alt: "Test widget showing test failures" 19293 } 19294 ), react_default.createElement("p", null, "Use the menu on a story or component to see details about a test failure or run tests for just that selection."), react_default.createElement( 19295 "img", 19296 { 19297 src: api.getDocsUrl({ 19298 asset: "writing-tests/context-menu.png", 19299 ref: "guide" 19300 }), 19301 alt: "Screenshot of story sidebar item with open menu" 19302 } 19303 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19304 Link, 19305 { 19306 href: api.getDocsUrl({ 19307 subpath: "writing-tests#component-tests", 19308 renderer: !0, 19309 ref: "guide" 19310 }), 19311 target: "_blank" 19312 }, 19313 "component testing documentation" 19314 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "About helpful features, like watch mode and sidebar filtering"), react_default.createElement("li", null, "How to run tests via CLI and in CI"), react_default.createElement("li", null, "About other capabilities, like accessibility checks and code coverage reporting"))) 19315 }, 19316 { 19317 id: "writeInteractions", 19318 label: "Test functionality with interactions", 19319 available: () => !!globalThis?.FEATURES?.interactions, 19320 criteria: "At least one story with a play or test function", 19321 subscribe: subscribeToIndex( 19322 (entries) => Object.values(entries).some( 19323 (entry) => entry.tags?.includes(Tag.PLAY_FN) || entry.tags?.includes(Tag.TEST_FN) 19324 ) 19325 ), 19326 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "When you need to test non-visual or particularly complex behavior of a component, add a play function."), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.ts 19327// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc. 19328import type { Meta, StoryObj } from '@storybook/your-framework'; 19329import { expect, fn } from 'storybook/test'; 19330 19331import { Button } from './Button'; 19332 19333const meta = { 19334 component: Button, 19335 args: { 19336 // \u{1F447} Provide a mock function to spy on 19337 onClick: fn(), 19338 }, 19339} satisfies Meta<typeof Button>; 19340 19341export default meta; 19342type Story = StoryObj<typeof meta>; 19343 19344export const Disabled: Story = { 19345 args: { 19346 disabled: true, 19347 label: 'Button', 19348 }, 19349 play: async function({ args, canvas, userEvent }) { 19350 const button = canvas.getByRole('button', { name: /button/i }); 19351 19352 // \u{1F447} Simulate behavior 19353 await userEvent.click(button); 19354 19355 // \u{1F447} Make assertions 19356 await expect(button).toHaveAttribute('aria-disabled', 'true'); 19357 await expect(args.onClick).not.toHaveBeenCalled(); 19358 } 19359};`), react_default.createElement("p", null, "You can interact with and debug each step defined in a play function within the Interactions panel."), react_default.createElement( 19360 "img", 19361 { 19362 src: api.getDocsUrl({ 19363 asset: "writing-tests/interaction-test-pass.png", 19364 ref: "guide" 19365 }), 19366 alt: "Storybook with a LoginForm component and passing interactions in the Interactions panel" 19367 } 19368 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19369 Link, 19370 { 19371 href: api.getDocsUrl({ 19372 subpath: "writing-tests/interaction-testing", 19373 renderer: !0, 19374 ref: "guide" 19375 }), 19376 target: "_blank" 19377 }, 19378 "interaction testing documentation" 19379 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "The full ", react_default.createElement("code", null, "play"), " function API"), react_default.createElement("li", null, "How to run code before and after tests"), react_default.createElement("li", null, "How to group interactions into steps"))) 19380 }, 19381 { 19382 id: "installA11y", 19383 label: "Install Accessibility addon", 19384 afterCompletion: "unavailable", 19385 criteria: "@storybook/addon-a11y registered in .storybook/main.js|ts", 19386 subscribe: ({ done }) => { 19387 addons.experimental_getRegisteredAddons().includes(ADDON_ID2) && done(); 19388 }, 19389 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Accessibility tests help ensure your UI is usable by everyone, no matter their ability."), react_default.createElement("p", null, "If you are not yet using the accessibility addon, run this command to install and set it up, enabling you to run accessibility checks alongside your component tests:"), react_default.createElement(CodeSnippet, { language: "bash" }, "npx storybook add @storybook/addon-a11y"), react_default.createElement("p", null, react_default.createElement("em", null, "Restart your Storybook after installing the addon.")), react_default.createElement("p", null, react_default.createElement( 19390 Link, 19391 { 19392 href: api.getDocsUrl({ 19393 subpath: "writing-tests/accessibility-testing", 19394 renderer: !0, 19395 ref: "guide" 19396 }), 19397 target: "_blank", 19398 withArrow: !0 19399 }, 19400 "Learn more about the Accessibility addon" 19401 ))) 19402 }, 19403 { 19404 id: "accessibilityTests", 19405 after: ["installA11y"], 19406 label: "Run accessibility tests", 19407 criteria: "Accessibility tests are run from the test widget in the sidebar", 19408 subscribe: ({ api, done }) => api.on( 19409 STORYBOOK_ADDON_TEST_CHANNEL, 19410 ({ type, payload }) => type === "test-run-completed" && payload.config.a11y && done() 19411 ), 19412 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Expand the test widget, check the Accessibility checkbox, and click the Run component tests button."), react_default.createElement( 19413 "img", 19414 { 19415 src: api.getDocsUrl({ 19416 asset: "writing-tests/test-widget-a11y-enabled.png", 19417 ref: "guide" 19418 }), 19419 alt: "Testing widget with accessibility activated" 19420 } 19421 ), react_default.createElement("p", null, "If there are any failures, you can use the Accessibility panel to debug any violations."), react_default.createElement( 19422 "img", 19423 { 19424 src: api.getDocsUrl({ 19425 asset: "writing-tests/addon-a11y-debug-violations.png", 19426 ref: "guide" 19427 }), 19428 alt: "Storybook app with accessibility panel open, showing violations and an interactive popover on the violating elements in the preview" 19429 } 19430 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19431 Link, 19432 { 19433 href: api.getDocsUrl({ 19434 subpath: "writing-tests/accessibility-testing", 19435 renderer: !0, 19436 ref: "guide" 19437 }), 19438 target: "_blank" 19439 }, 19440 "accessibility testing documentation" 19441 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "The recommended workflow"), react_default.createElement("li", null, "How to run accessibility tests via CLI and in CI"), react_default.createElement("li", null, "How to configure accessibility checks"))) 19442 }, 19443 { 19444 id: "installChromatic", 19445 label: "Install Visual Tests addon", 19446 afterCompletion: "unavailable", 19447 available: () => !0, 19448 // TODO check for compatibility with the project (not React Native) 19449 criteria: "@chromatic-com/storybook registered in .storybook/main.js|ts", 19450 subscribe: ({ done }) => { 19451 addons.experimental_getRegisteredAddons().includes("chromaui/addon-visual-tests") && done(); 19452 }, 19453 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Visual tests verify the appearance of your UI components."), react_default.createElement("p", null, "If you are not yet using the visual tests addon, run this command to install and set it up, enabling you to run visual tests on your stories (this requires a free Chromatic account):"), react_default.createElement(CodeSnippet, { language: "bash" }, "npx storybook add @chromatic-com/storybook"), react_default.createElement("p", null, react_default.createElement("em", null, "Restart your Storybook after installing the addon.")), react_default.createElement("p", null, react_default.createElement( 19454 Link, 19455 { 19456 href: api.getDocsUrl({ 19457 subpath: "writing-tests/visual-testing", 19458 renderer: !0, 19459 ref: "guide" 19460 }), 19461 target: "_blank", 19462 withArrow: !0 19463 }, 19464 "Learn more about the Visual Tests addon" 19465 ))) 19466 }, 19467 { 19468 id: "visualTests", 19469 after: ["installChromatic"], 19470 label: "Run visual tests", 19471 criteria: "Visual tests are run from the test widget in the sidebar or the Visual Tests panel", 19472 subscribe: ({ api, done }) => api.on("chromaui/addon-visual-tests/startBuild", done), 19473 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Expand the test widget and click the Run visual tests button."), react_default.createElement( 19474 "img", 19475 { 19476 src: api.getDocsUrl({ 19477 asset: "writing-tests/test-widget-expanded-with-vta.png", 19478 ref: "guide" 19479 }), 19480 alt: "Expanded testing widget, showing the Visual tests section" 19481 } 19482 ), react_default.createElement("p", null, "You can use the Visual tests panel to verify the resulting diffs as either an unexpected change which needs fixed or an expected change which can then be accepted and become the new baseline."), react_default.createElement( 19483 "img", 19484 { 19485 src: api.getDocsUrl({ 19486 asset: "writing-tests/vta-run-from-panel.png", 19487 ref: "guide" 19488 }), 19489 alt: "Visual tests addon panel showing a diff from the baseline" 19490 } 19491 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19492 Link, 19493 { 19494 href: api.getDocsUrl({ 19495 subpath: "writing-tests/visual-testing", 19496 renderer: !0, 19497 ref: "guide" 19498 }), 19499 target: "_blank" 19500 }, 19501 "visual testing documentation" 19502 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to automate your visual tests in CI"))) 19503 }, 19504 { 19505 id: "coverage", 19506 after: ["installVitest"], 19507 label: "Generate a coverage report", 19508 criteria: "Generate a coverage report", 19509 subscribe: ({ api, done }) => api.on( 19510 STORYBOOK_ADDON_TEST_CHANNEL, 19511 ({ type, payload }) => type === "test-run-completed" && payload.config.coverage && done() 19512 ), 19513 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Coverage reports show you which code is\u2014and, more importantly\u2014isn't executed while running your component tests. You use it to be sure you're testing the right things."), react_default.createElement("p", null, "To generate a coverage report, expand the test widget in the sidebar and check the Coverage checkbox. The next time you run component tests, it will generate an interactive report, which you can view by clicking the results summary in the test widget."), react_default.createElement( 19514 "img", 19515 { 19516 src: api.getDocsUrl({ 19517 asset: "writing-tests/test-widget-coverage-summary.png", 19518 ref: "guide" 19519 }), 19520 alt: "Test widget with coverage summary" 19521 } 19522 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19523 Link, 19524 { 19525 href: api.getDocsUrl({ 19526 subpath: "writing-tests/test-coverage", 19527 renderer: !0, 19528 ref: "guide" 19529 }), 19530 target: "_blank" 19531 }, 19532 "test coverage documentation" 19533 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to automate reporting in CI"), react_default.createElement("li", null, "How to configure the coverage results"))) 19534 }, 19535 { 19536 id: "ciTests", 19537 label: "Automate tests in CI", 19538 criteria: "Have a CI workflow that runs component tests, either with Vitest or Chromatic", 19539 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Automating component tests in CI is the best tool ensuring the quality and reliability of your project."), react_default.createElement("p", null, "You can automate all of Storybook's tests by using Chromatic or by running the", react_default.createElement("code", null, "vitest --project storybook"), " command in your CI scripts."), react_default.createElement( 19540 "img", 19541 { 19542 src: api.getDocsUrl({ 19543 asset: "writing-tests/test-ci-workflow-pr-status-checks.png", 19544 ref: "guide" 19545 }), 19546 alt: 'GitHub pull request status checks, with a failing "UI Tests / test" check' 19547 } 19548 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19549 Link, 19550 { 19551 href: api.getDocsUrl({ 19552 subpath: "writing-tests/in-ci", 19553 renderer: !0, 19554 ref: "guide" 19555 }), 19556 target: "_blank" 19557 }, 19558 "testing in CI documentation" 19559 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to test in your CI platform (GitHub Actions, Circle CI, etc.)"), react_default.createElement("li", null, "How to debug test failures in a published Storybook"), react_default.createElement("li", null, "How to run your other Vitest tests alongside your Storybook tests"))) 19560 } 19561 ] 19562 }, 19563 { 19564 id: "document", 19565 title: "Document", 19566 items: [ 19567 { 19568 id: "installDocs", 19569 label: "Install Docs addon", 19570 afterCompletion: "unavailable", 19571 criteria: "@storybook/addon-docs registered in .storybook/main.js|ts", 19572 subscribe: ({ done }) => { 19573 addons.experimental_getRegisteredAddons().includes(ADDON_ID6) && done(); 19574 }, 19575 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Storybook Docs transforms your Storybook stories into component documentation. Add the Docs addon to your Storybook project to get started:"), react_default.createElement(CodeSnippet, { language: "bash" }, "npx storybook add @storybook/addon-docs"), react_default.createElement("p", null, react_default.createElement("em", null, "Restart your Storybook after installing the addon.")), react_default.createElement("p", null, react_default.createElement( 19576 Link, 19577 { 19578 href: api.getDocsUrl({ 19579 subpath: "writing-docs", 19580 renderer: !0, 19581 ref: "guide" 19582 }), 19583 target: "_blank", 19584 withArrow: !0 19585 }, 19586 "Learn more about Storybook Docs" 19587 ))) 19588 }, 19589 { 19590 id: "autodocs", 19591 after: ["installDocs"], 19592 label: "Automatically document your components", 19593 criteria: "At least one component with the autodocs tag applied", 19594 subscribe: subscribeToIndex( 19595 (entries) => Object.values(entries).some((entry) => entry.tags?.includes(Tag.AUTODOCS)) 19596 ), 19597 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Add the autodocs tag to a component's meta to automatically generate documentation for that component, complete with examples, source code, an API table, and a description."), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.js 19598 19599const meta = { 19600 component: Button, 19601 tags: ['autodocs'], // \u{1F448} Add this tag 19602} 19603 19604export default meta;`), react_default.createElement("p", null, "That tag can also be applied in ", react_default.createElement("code", null, ".storybook/preview.ts"), ", to generate documentation for ", react_default.createElement("em", null, "all"), " components."), react_default.createElement( 19605 "img", 19606 { 19607 src: api.getDocsUrl({ 19608 asset: "writing-docs/autodocs.png", 19609 ref: "guide" 19610 }), 19611 alt: "Storybook autodocs page, showing a title, description, primary story, controls table, and additional stories" 19612 } 19613 ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19614 Link, 19615 { 19616 href: api.getDocsUrl({ 19617 subpath: "writing-docs/autodocs", 19618 renderer: !0, 19619 ref: "guide" 19620 }), 19621 target: "_blank" 19622 }, 19623 "autodocs documentation" 19624 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to generate a table of contents"), react_default.createElement("li", null, "How to enhance your component documentation with JSDoc comments"), react_default.createElement("li", null, "How to customize the generated page"))) 19625 }, 19626 { 19627 id: "mdxDocs", 19628 after: ["installDocs"], 19629 label: "Custom content with MDX", 19630 criteria: "At least one MDX page", 19631 subscribe: subscribeToIndex( 19632 (entries) => Object.values(entries).some((entry) => entry.type === "docs") 19633 ), 19634 content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "You can use MDX (markdown + React components) to provide an introduction to your project, document things like design tokens, or go beyond the automatic documentation for your components."), react_default.createElement("p", null, "For a start, create an ", react_default.createElement("code", null, "introduction.mdx"), " file and (using markdown and Storybook's", " ", react_default.createElement( 19635 Link, 19636 { 19637 href: api.getDocsUrl({ 19638 subpath: "writing-docs/doc-blocks", 19639 renderer: !0, 19640 ref: "guide" 19641 }), 19642 target: "_blank" 19643 }, 19644 "doc blocks" 19645 ), ") write a usage guide for your project."), react_default.createElement(CodeSnippet, { language: "jsx" }, `{ /* introduction.mdx */ } 19646import { Meta, Title, Subtitle } from '@storybook/addon-docs/blocks'; 19647 19648<Meta title="Get started" /> 19649 19650<Title>Get started with My Awesome Project</Title> 19651 19652<Subtitle>It's really awesome</Subtitle> 19653 19654My Awesome Project is designed to work with Your Awesome Project seamlessly. 19655Follow this guide and you'll be ready in no time. 19656 19657## Install 19658 19659\`\`\`sh 19660npm install @my/awesome-project 19661\`\`\``), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement( 19662 Link, 19663 { 19664 href: api.getDocsUrl({ 19665 subpath: "writing-docs/mdx", 19666 renderer: !0, 19667 ref: "guide" 19668 }), 19669 target: "_blank" 19670 }, 19671 "MDX documentation" 19672 ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to reference stories in your content"), react_default.createElement("li", null, "How to import and display markdown files, such as READMEs"))) 19673 } 19674 ] 19675 } 19676 ] 19677}; 19678 19679// src/manager/components/sidebar/useChecklist.ts 19680var subscriptions = /* @__PURE__ */ new Map(), useStoryIndex = () => { 19681 let state = useStorybookState(), [index, setIndex] = useState(() => state.index), updateIndex = useMemo(() => throttle(setIndex, 500), []); 19682 return useEffect(() => updateIndex(state.index), [state.index, updateIndex]), useEffect(() => () => updateIndex.cancel?.(), [updateIndex]), index; 19683}, checkAvailable = (item, itemsById, context) => { 19684 if (item.available && !item.available(context)) 19685 return !1; 19686 for (let afterId of item.after ?? []) 19687 if (itemsById[afterId] && !checkAvailable(itemsById[afterId], itemsById, context)) 19688 return !1; 19689 return !0; 19690}, checkSkipped = (item, itemsById, state) => { 19691 if (state[item.id].status === "skipped") 19692 return !0; 19693 for (let afterId of item.after ?? []) 19694 if (itemsById[afterId] && checkSkipped(itemsById[afterId], itemsById, state)) 19695 return !0; 19696 return !1; 19697}, getAncestorIds = (item, itemsById) => !item.after || item.after.length === 0 ? [] : item.after.flatMap((afterId) => { 19698 let afterItem = itemsById[afterId]; 19699 return afterItem ? [...getAncestorIds(afterItem, itemsById), afterId] : []; 19700}), checkLockedBy = (item, itemsById, state) => getAncestorIds(item, itemsById).find( 19701 (id) => state[id].status !== "accepted" && state[id].status !== "done" 19702), useChecklist = () => { 19703 let api = useStorybookApi(), index = useStoryIndex(), [checklistState] = experimental_useUniversalStore(internal_universalChecklistStore), { loaded, items, widget } = checklistState, { status } = internal_universalChecklistStore, [initialized, setInitialized] = useState(!1), [ready, setReady] = useState(!1), debounceReady = useMemo(() => debounce(() => setReady(!0), 500), []), itemsById = useMemo(() => Object.fromEntries( 19704 checklistData.sections.flatMap( 19705 ({ items: items2, id: sectionId, title: sectionTitle }, sectionIndex) => items2.map(({ id, ...item }, itemIndex) => [id, { id, itemIndex, sectionId, sectionIndex, sectionTitle, ...item }]) 19706 ) 19707 ), []), allItems = useMemo(() => Object.values(itemsById).map((item) => { 19708 let { status: status2, mutedAt } = items[item.id], isOpen = status2 === "open", isAccepted = status2 === "accepted", isDone = status2 === "done", isCompleted = isAccepted || isDone, isSkipped = !isCompleted && checkSkipped(item, itemsById, items), isMuted = !!mutedAt || !!widget.disable, isAvailable = isCompleted ? item.afterCompletion !== "unavailable" : checkAvailable(item, itemsById, { api, index, item, storeState: checklistState }), isLockedBy = checkLockedBy(item, itemsById, items), isImmutable = isCompleted && item.afterCompletion === "immutable"; 19709 return { 19710 ...item, 19711 isAvailable, 19712 isOpen, 19713 isLockedBy, 19714 isImmutable, 19715 isReady: isOpen && isAvailable && !isMuted && !isLockedBy, 19716 isCompleted, 19717 isAccepted, 19718 isDone, 19719 isSkipped, 19720 isMuted 19721 }; 19722 }), [itemsById, items, widget, api, index, checklistState]), itemCollections = useMemo(() => { 19723 let availableItems = allItems.filter((item) => item.isAvailable), openItems = availableItems.filter((item) => item.isOpen), readyItems = openItems.filter((item) => item.isReady), nextItems = Object.values( 19724 readyItems.reduce((acc, item) => (acc[item.sectionId] ??= [], acc[item.sectionId].push({ ...item, itemIndex: acc[item.sectionId].length }), acc), {}) 19725 ).flat().sort((a2, b2) => a2.itemIndex - b2.itemIndex).slice(0, 3).sort((a2, b2) => a2.sectionIndex - b2.sectionIndex), progress = availableItems.length ? Math.round((availableItems.length - openItems.length) / availableItems.length * 100) : 100; 19726 return { availableItems, openItems, readyItems, nextItems, progress }; 19727 }, [allItems]); 19728 return useEffect(() => { 19729 if (!(!loaded || status !== experimental_UniversalStore.Status.READY)) 19730 for (let item of allItems) { 19731 if (!item.subscribe) 19732 continue; 19733 let subscribed = subscriptions.has(item.id); 19734 if (item.isOpen && item.isAvailable && !subscribed) 19735 subscriptions.set( 19736 item.id, 19737 item.subscribe({ 19738 api, 19739 item, 19740 accept: () => internal_checklistStore.accept(item.id), 19741 done: () => internal_checklistStore.done(item.id), 19742 skip: () => internal_checklistStore.skip(item.id) 19743 }) 19744 ); 19745 else if (subscribed && !(item.isOpen && item.isAvailable)) { 19746 let unsubscribe = subscriptions.get(item.id); 19747 subscriptions.delete(item.id), typeof unsubscribe == "function" && unsubscribe(); 19748 } 19749 } 19750 }, [api, loaded, status, allItems]), useEffect(() => { 19751 let initialize = () => setInitialized(!0), timeout = setTimeout(initialize, 1e3); 19752 return api.once(PREVIEW_INITIALIZED, initialize), () => { 19753 clearTimeout(timeout), api.off(PREVIEW_INITIALIZED, initialize); 19754 }; 19755 }, [api]), useEffect(() => { 19756 initialized && items && status === experimental_UniversalStore.Status.READY && debounceReady(); 19757 }, [initialized, items, status, debounceReady]), { 19758 ready, 19759 allItems, 19760 ...itemCollections, 19761 ...internal_checklistStore, 19762 ...checklistState 19763 }; 19764}; 19765 19766// src/shared/useCopyButton.ts 19767init_react(); 19768
vendor: 3,099 bytes, lines 19769-19817
19769// ../../node_modules/@react-aria/live-announcer/dist/LiveAnnouncer.mjs 19770var $319e236875307eab$var$liveAnnouncer = null; 19771function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = 7e3) { 19772 $319e236875307eab$var$liveAnnouncer ? $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout) : ($319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer(), (typeof IS_REACT_ACT_ENVIRONMENT == "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest < "u") ? $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout) : setTimeout(() => { 19773 $319e236875307eab$var$liveAnnouncer?.isAttached() && $319e236875307eab$var$liveAnnouncer?.announce(message, assertiveness, timeout); 19774 }, 100)); 19775} 19776function $319e236875307eab$export$d10ae4f68404609a(assertiveness) { 19777 $319e236875307eab$var$liveAnnouncer && $319e236875307eab$var$liveAnnouncer.clear(assertiveness); 19778} 19779var $319e236875307eab$var$LiveAnnouncer = class { 19780 isAttached() { 19781 var _this_node; 19782 return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected; 19783 } 19784 createLog(ariaLive) { 19785 let node = document.createElement("div"); 19786 return node.setAttribute("role", "log"), node.setAttribute("aria-live", ariaLive), node.setAttribute("aria-relevant", "additions"), node; 19787 } 19788 destroy() { 19789 this.node && (document.body.removeChild(this.node), this.node = null); 19790 } 19791 announce(message, assertiveness = "assertive", timeout = 7e3) { 19792 var _this_assertiveLog, _this_politeLog; 19793 if (!this.node) return; 19794 let node = document.createElement("div"); 19795 typeof message == "object" ? (node.setAttribute("role", "img"), node.setAttribute("aria-labelledby", message["aria-labelledby"])) : node.textContent = message, assertiveness === "assertive" ? (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 || _this_assertiveLog.appendChild(node) : (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 || _this_politeLog.appendChild(node), message !== "" && setTimeout(() => { 19796 node.remove(); 19797 }, timeout); 19798 } 19799 clear(assertiveness) { 19800 this.node && ((!assertiveness || assertiveness === "assertive") && this.assertiveLog && (this.assertiveLog.innerHTML = ""), (!assertiveness || assertiveness === "polite") && this.politeLog && (this.politeLog.innerHTML = "")); 19801 } 19802 constructor() { 19803 this.node = null, this.assertiveLog = null, this.politeLog = null, typeof document < "u" && (this.node = document.createElement("div"), this.node.dataset.liveAnnouncer = "true", Object.assign(this.node.style, { 19804 border: 0, 19805 clip: "rect(0 0 0 0)", 19806 clipPath: "inset(50%)", 19807 height: "1px", 19808 margin: "-1px", 19809 overflow: "hidden", 19810 padding: 0, 19811 position: "absolute", 19812 width: "1px", 19813 whiteSpace: "nowrap" 19814 }), this.assertiveLog = this.createLog("assertive"), this.node.appendChild(this.assertiveLog), this.politeLog = this.createLog("polite"), this.node.appendChild(this.politeLog), document.body.prepend(this.node)); 19815 } 19816}; 19817
vendor: 12,058 bytes, lines 19818-20147
19818// src/shared/useCopyButton.ts 19819function useCopyButton2({ 19820 children = "Copy", 19821 childrenOnCopy = "Copied!", 19822 content, 19823 onCopy, 19824 ariaLabel = !1, 19825 ariaLabelOnCopy = !1, 19826 duration = 3e3 19827}) { 19828 let [copied, setCopied] = useState(!1), timerRef = useRef(null); 19829 useEffect( 19830 () => () => { 19831 timerRef.current && clearTimeout(timerRef.current); 19832 }, 19833 [] 19834 ); 19835 let handleClick = useCallback( 19836 (e2) => { 19837 timerRef.current && clearTimeout(timerRef.current); 19838 let announcement = typeof ariaLabelOnCopy == "string" ? ariaLabelOnCopy : "Copied to clipboard"; 19839 navigator.clipboard?.writeText(content).then(() => { 19840 onCopy?.(e2), setCopied(!0), $319e236875307eab$export$a9b970dcc4ae71a9(announcement, "polite"), timerRef.current = setTimeout(() => { 19841 setCopied(!1), $319e236875307eab$export$d10ae4f68404609a("polite"), timerRef.current = null; 19842 }, duration); 19843 }); 19844 }, 19845 [content, onCopy, ariaLabelOnCopy, duration] 19846 ); 19847 return { 19848 // @ts-expect-error - TypeScript is not realising T is constrained identically in both interfaces. 19849 children: copied ? childrenOnCopy : children, 19850 buttonProps: useMemo( 19851 () => ({ 19852 onClick: handleClick, 19853 ariaLabel: copied ? ariaLabelOnCopy : ariaLabel 19854 }), 19855 [handleClick, copied, ariaLabelOnCopy, ariaLabel] 19856 ) 19857 }; 19858} 19859 19860// src/manager/components/sidebar/ChecklistWidget.tsx 19861var fadeScaleIn = keyframes` 19862 from { 19863 opacity: 0; 19864 transform: scale(0.7); 19865 } 19866 to { 19867 opacity: 1; 19868 transform: scale(1); 19869 } 19870`, expand = keyframes` 19871 from { 19872 transform: scaleX(0); 19873 } 19874 to { 19875 transform: scaleX(1); 19876 } 19877`, useTransitionArray = (array, subset, options2) => { 19878 let keyFnRef = useRef(options2.keyFn), { setItem, toggle, stateMap } = useTransitionMap({ 19879 allowMultiple: !0, 19880 mountOnEnter: !0, 19881 unmountOnExit: !0, 19882 preEnter: !0, 19883 ...options2 19884 }); 19885 return useEffect(() => { 19886 let keyFn = keyFnRef.current; 19887 array.forEach((task) => setItem(keyFn(task))); 19888 }, [array, setItem]), useEffect(() => { 19889 let keyFn = keyFnRef.current; 19890 array.forEach((task) => toggle(keyFn(task), subset.map(keyFn).includes(keyFn(task)))); 19891 }, [array, subset, toggle]), Array.from(stateMap).map( 19892 ([key, value]) => [array.find((item) => keyFnRef.current(item) === key), value] 19893 ); 19894}, CollapsibleWithMargin = styled(Collapsible)(({ collapsed }) => ({ 19895 marginTop: collapsed ? 0 : 16 19896})), HoverCard = styled(Card)({ 19897 "&:hover #checklist-module-collapse-toggle": { 19898 opacity: 1 19899 } 19900}), CollapseToggle2 = styled(ActionList.Button)({ 19901 opacity: 0, 19902 transition: "opacity var(--transition-duration, 0.2s)", 19903 "&:focus, &:hover": { 19904 opacity: 1 19905 } 19906}), ProgressCircle = styled(ProgressSpinner)(({ theme }) => ({ 19907 color: theme.color.secondary 19908})), Checked = styled(StatusPassIcon)(({ theme }) => ({ 19909 padding: 1, 19910 borderRadius: "50%", 19911 background: theme.color.positive, 19912 color: theme.background.content, 19913 animation: `${fadeScaleIn} 500ms forwards` 19914})), ItemLabel = styled.span( 19915 ({ theme, isCompleted, isSkipped }) => ({ 19916 position: "relative", 19917 margin: "0 -2px", 19918 padding: "0 2px", 19919 color: isSkipped ? theme.color.mediumdark : isCompleted ? theme.base === "dark" ? theme.color.positive : theme.color.positiveText : theme.color.defaultText, 19920 transition: "color 500ms" 19921 }), 19922 ({ theme, isSkipped }) => isSkipped && { 19923 alignSelf: "flex-start", 19924 "&:after": { 19925 content: '""', 19926 position: "absolute", 19927 top: "50%", 19928 left: 0, 19929 width: "100%", 19930 height: 1, 19931 background: theme.color.mediumdark, 19932 animation: `${expand} 500ms forwards`, 19933 transformOrigin: "left" 19934 } 19935 } 19936), title = (progress) => { 19937 switch (!0) { 19938 case progress < 50: 19939 return "Get started"; 19940 case progress < 75: 19941 return "Level up"; 19942 default: 19943 return "Become an expert"; 19944 } 19945}, OpenGuideButton = ({ 19946 children, 19947 afterClick 19948}) => { 19949 let api = useStorybookApi(); 19950 return react_default.createElement( 19951 ActionList.Action, 19952 { 19953 ariaLabel: "Open onboarding guide", 19954 onClick: (e2) => { 19955 e2.stopPropagation(), api.navigate("/settings/guide"), afterClick?.(); 19956 } 19957 }, 19958 react_default.createElement(ActionList.Icon, null, react_default.createElement(ListUnorderedIcon, null)), 19959 children 19960 ); 19961}, CopyButton2 = ({ 19962 label, 19963 copyContent, 19964 onClick, 19965 ...props 19966}) => { 19967 let { children: copyChildren, buttonProps: copyButtonProps } = useCopyButton2({ 19968 children: label, 19969 childrenOnCopy: react_default.createElement(react_default.Fragment, null, react_default.createElement(CheckIcon, null), " Copied!"), 19970 onCopy: onClick, 19971 content: copyContent 19972 }); 19973 return react_default.createElement(ActionList.Button, { ...props, ...copyButtonProps }, copyChildren); 19974}, ChecklistWidget = () => { 19975 let api = useStorybookApi(), { loaded, ready, allItems, nextItems, progress, accept, mute, items } = useChecklist(), [renderItems, setRenderItems] = useState(nextItems), [animated, setAnimated] = useState(!1); 19976 useEffect(() => { 19977 if (ready) { 19978 let timeout = setTimeout(setAnimated, 1e3, !0); 19979 return () => clearTimeout(timeout); 19980 } 19981 }, [ready]), useEffect(() => { 19982 if (!animated) { 19983 setRenderItems(nextItems); 19984 return; 19985 } 19986 setRenderItems((current) => { 19987 let animateOut = !1, prevItems = current.map((item) => { 19988 let { status } = items[item.id], isAccepted = status === "accepted", isDone = status === "done", isSkipped = status === "skipped"; 19989 return animateOut = animateOut || isAccepted || isDone || isSkipped, { ...item, isCompleted: isAccepted || isDone, isAccepted, isDone, isSkipped }; 19990 }); 19991 return animateOut ? prevItems : nextItems; 19992 }); 19993 let timeout = setTimeout(setRenderItems, 2e3, nextItems); 19994 return () => clearTimeout(timeout); 19995 }, [animated, nextItems, items]); 19996 let hasItems = renderItems.length > 0, transitionItems = useTransitionArray(allItems, renderItems, { 19997 keyFn: (item) => item.id, 19998 timeout: animated ? 300 : 0 19999 }); 20000 return api.getIsNavShown() ? react_default.createElement(CollapsibleWithMargin, { collapsed: !hasItems || !loaded }, react_default.createElement(HoverCard, { id: "storybook-checklist-widget", outlineAnimation: "rainbow" }, react_default.createElement( 20001 Collapsible, 20002 { 20003 storageKey: "checklist-widget", 20004 initialCollapsed: !hasItems, 20005 disabled: !hasItems, 20006 summary: ({ isCollapsed, toggleCollapsed, toggleProps }) => react_default.createElement(ActionList, { as: "div", onClick: toggleCollapsed }, react_default.createElement(ActionList.Item, { as: "div" }, react_default.createElement(ActionList.Item, { as: "div", style: { flexShrink: 1 } }, loaded && react_default.createElement( 20007 Optional, 20008 { 20009 content: react_default.createElement(OpenGuideButton, null, react_default.createElement("strong", null, title(progress))), 20010 fallback: react_default.createElement(OpenGuideButton, null) 20011 } 20012 )), react_default.createElement(ActionList.Item, { as: "div" }, react_default.createElement( 20013 CollapseToggle2, 20014 { 20015 ...toggleProps, 20016 id: "checklist-module-collapse-toggle", 20017 ariaLabel: `${isCollapsed ? "Expand" : "Collapse"} onboarding guide` 20018 }, 20019 react_default.createElement( 20020 ChevronSmallUpIcon, 20021 { 20022 style: { 20023 transform: isCollapsed ? "rotate(180deg)" : "none", 20024 transition: "transform 250ms", 20025 willChange: "auto" 20026 } 20027 } 20028 ) 20029 ), loaded && react_default.createElement( 20030 PopoverProvider, 20031 { 20032 ariaLabel: "Onboarding guide menu", 20033 padding: 0, 20034 popover: ({ onHide }) => react_default.createElement(ActionList, null, react_default.createElement(ActionList.Item, null, react_default.createElement(OpenGuideButton, { afterClick: onHide }, react_default.createElement(ActionList.Text, null, "Open full guide"))), react_default.createElement(ActionList.Item, null, react_default.createElement( 20035 ActionList.Action, 20036 { 20037 ariaLabel: !1, 20038 onClick: (e2) => { 20039 e2.stopPropagation(), mute(allItems.map(({ id }) => id)), onHide(); 20040 } 20041 }, 20042 react_default.createElement(ActionList.Icon, null, react_default.createElement(EyeCloseIcon, null)), 20043 react_default.createElement(ActionList.Text, null, "Remove from sidebar") 20044 ))) 20045 }, 20046 react_default.createElement( 20047 ActionList.Button, 20048 { 20049 ariaLabel: `${progress}% completed`, 20050 onClick: (e2) => e2.stopPropagation() 20051 }, 20052 react_default.createElement( 20053 ProgressCircle, 20054 { 20055 percentage: progress, 20056 running: !1, 20057 size: 16, 20058 width: 1.5 20059 } 20060 ), 20061 react_default.createElement(TextFlip, { text: `${progress}%`, placeholder: "00%" }) 20062 ) 20063 )))) 20064 }, 20065 react_default.createElement(ActionList, null, transitionItems.map( 20066 ([item, { status, isMounted }]) => isMounted && react_default.createElement(ActionList.HoverItem, { key: item.id, targetId: item.id, transitionStatus: status }, react_default.createElement( 20067 ActionList.Action, 20068 { 20069 ariaLabel: `Open onboarding guide for ${item.label}`, 20070 onClick: () => api.navigate(`/settings/guide#${item.id}`) 20071 }, 20072 react_default.createElement(ActionList.Icon, null, item.isCompleted && animated ? react_default.createElement(Particles, { anchor: Checked, key: item.id }) : item.icon ? react_default.createElement(item.icon, null) : react_default.createElement(CircleHollowIcon, null)), 20073 react_default.createElement(ActionList.Text, null, react_default.createElement(ItemLabel, { isCompleted: item.isCompleted, isSkipped: item.isSkipped }, item.label)) 20074 ), item.action && (item.action.copyContent ? react_default.createElement( 20075 CopyButton2, 20076 { 20077 "data-target-id": item.id, 20078 label: item.action.label, 20079 copyContent: item.action.copyContent, 20080 onClick: (e2) => { 20081 e2.stopPropagation(), item.action?.onClick({ 20082 api, 20083 accept: () => accept(item.id) 20084 }); 20085 } 20086 } 20087 ) : react_default.createElement( 20088 ActionList.Button, 20089 { 20090 "data-target-id": item.id, 20091 ariaLabel: !1, 20092 onClick: (e2) => { 20093 e2.stopPropagation(), item.action?.onClick({ 20094 api, 20095 accept: () => accept(item.id) 20096 }); 20097 } 20098 }, 20099 item.action.label 20100 ))) 20101 )) 20102 ))) : null; 20103}; 20104 20105// src/manager/components/sidebar/CreateNewStoryFileModal.tsx 20106init_react(); 20107 20108// src/manager/hooks/useDebounce.ts 20109init_react(); 20110function useDebounce(value, delay2) { 20111 let [debouncedValue, setDebouncedValue] = useState(value); 20112 return useEffect(() => { 20113 let handler = setTimeout(() => { 20114 setDebouncedValue(value); 20115 }, delay2); 20116 return () => { 20117 clearTimeout(handler); 20118 }; 20119 }, [value, delay2]), debouncedValue; 20120} 20121 20122// src/manager/components/sidebar/FileSearchModal.tsx 20123init_react(); 20124 20125// src/manager/hooks/useMeasure.tsx 20126init_react(); 20127function useMeasure() { 20128 let [dimensions, setDimensions] = react_default.useState({ 20129 width: null, 20130 height: null 20131 }), prevObserver = react_default.useRef(null); 20132 return [react_default.useCallback((node) => { 20133 if (prevObserver.current && (prevObserver.current.disconnect(), prevObserver.current = null), node?.nodeType === Node.ELEMENT_NODE) { 20134 let observer = new ResizeObserver(([entry]) => { 20135 if (entry && entry.borderBoxSize) { 20136 let { inlineSize: width, blockSize: height } = entry.borderBoxSize[0]; 20137 setDimensions({ width, height }); 20138 } 20139 }); 20140 observer.observe(node), prevObserver.current = observer; 20141 } 20142 }, []), dimensions]; 20143} 20144 20145// src/manager/components/sidebar/FileSearchList.tsx 20146init_react(); 20147
vendor: 79 bytes, lines 20148-20150
20148// ../../node_modules/@tanstack/react-virtual/dist/esm/index.js 20149init_react(); 20150
vendor: 1,898 bytes, lines 20151-20198
20151// ../../node_modules/@tanstack/virtual-core/dist/esm/utils.js 20152function memo2(getDeps, fn, opts) { 20153 let deps = opts.initialDeps ?? [], result; 20154 function memoizedFunction() { 20155 var _a2, _b, _c, _d; 20156 let depTime; 20157 opts.key && ((_a2 = opts.debug) != null && _a2.call(opts)) && (depTime = Date.now()); 20158 let newDeps = getDeps(); 20159 if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep))) 20160 return result; 20161 deps = newDeps; 20162 let resultTime; 20163 if (opts.key && ((_b = opts.debug) != null && _b.call(opts)) && (resultTime = Date.now()), result = fn(...newDeps), opts.key && ((_c = opts.debug) != null && _c.call(opts))) { 20164 let depEndTime = Math.round((Date.now() - depTime) * 100) / 100, resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100, resultFpsPercentage = resultEndTime / 16, pad = (str, num) => { 20165 for (str = String(str); str.length < num; ) 20166 str = " " + str; 20167 return str; 20168 }; 20169 console.info( 20170 `%c\u23F1 ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, 20171 ` 20172 font-size: .6rem; 20173 font-weight: bold; 20174 color: hsl(${Math.max( 20175 0, 20176 Math.min(120 - 120 * resultFpsPercentage, 120) 20177 )}deg 100% 31%);`, 20178 opts?.key 20179 ); 20180 } 20181 return (_d = opts?.onChange) == null || _d.call(opts, result), result; 20182 } 20183 return memoizedFunction.updateDeps = (newDeps) => { 20184 deps = newDeps; 20185 }, memoizedFunction; 20186} 20187function notUndefined(value, msg) { 20188 if (value === void 0) 20189 throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`); 20190 return value; 20191} 20192var approxEqual = (a2, b2) => Math.abs(a2 - b2) < 1.01, debounce3 = (targetWindow, fn, ms) => { 20193 let timeoutId; 20194 return function(...args) { 20195 targetWindow.clearTimeout(timeoutId), timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms); 20196 }; 20197}; 20198
vendor: 21,201 bytes, lines 20199-20678
20199// ../../node_modules/@tanstack/virtual-core/dist/esm/index.js 20200var getRect = (element) => { 20201 let { offsetWidth, offsetHeight } = element; 20202 return { width: offsetWidth, height: offsetHeight }; 20203}, defaultKeyExtractor = (index) => index, defaultRangeExtractor = (range) => { 20204 let start = Math.max(range.startIndex - range.overscan, 0), end = Math.min(range.endIndex + range.overscan, range.count - 1), arr = []; 20205 for (let i2 = start; i2 <= end; i2++) 20206 arr.push(i2); 20207 return arr; 20208}, observeElementRect = (instance, cb) => { 20209 let element = instance.scrollElement; 20210 if (!element) 20211 return; 20212 let targetWindow = instance.targetWindow; 20213 if (!targetWindow) 20214 return; 20215 let handler = (rect) => { 20216 let { width, height } = rect; 20217 cb({ width: Math.round(width), height: Math.round(height) }); 20218 }; 20219 if (handler(getRect(element)), !targetWindow.ResizeObserver) 20220 return () => { 20221 }; 20222 let observer = new targetWindow.ResizeObserver((entries) => { 20223 let run = () => { 20224 let entry = entries[0]; 20225 if (entry?.borderBoxSize) { 20226 let box = entry.borderBoxSize[0]; 20227 if (box) { 20228 handler({ width: box.inlineSize, height: box.blockSize }); 20229 return; 20230 } 20231 } 20232 handler(getRect(element)); 20233 }; 20234 instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run(); 20235 }); 20236 return observer.observe(element, { box: "border-box" }), () => { 20237 observer.unobserve(element); 20238 }; 20239}, addEventListenerOptions = { 20240 passive: !0 20241}; 20242var supportsScrollend = typeof window > "u" ? !0 : "onscrollend" in window, observeElementOffset = (instance, cb) => { 20243 let element = instance.scrollElement; 20244 if (!element) 20245 return; 20246 let targetWindow = instance.targetWindow; 20247 if (!targetWindow) 20248 return; 20249 let offset2 = 0, fallback = instance.options.useScrollendEvent && supportsScrollend ? () => { 20250 } : debounce3( 20251 targetWindow, 20252 () => { 20253 cb(offset2, !1); 20254 }, 20255 instance.options.isScrollingResetDelay 20256 ), createHandler = (isScrolling) => () => { 20257 let { horizontal, isRtl } = instance.options; 20258 offset2 = horizontal ? element.scrollLeft * (isRtl && -1 || 1) : element.scrollTop, fallback(), cb(offset2, isScrolling); 20259 }, handler = createHandler(!0), endHandler = createHandler(!1); 20260 endHandler(), element.addEventListener("scroll", handler, addEventListenerOptions); 20261 let registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend; 20262 return registerScrollendEvent && element.addEventListener("scrollend", endHandler, addEventListenerOptions), () => { 20263 element.removeEventListener("scroll", handler), registerScrollendEvent && element.removeEventListener("scrollend", endHandler); 20264 }; 20265}; 20266var measureElement = (element, entry, instance) => { 20267 if (entry?.borderBoxSize) { 20268 let box = entry.borderBoxSize[0]; 20269 if (box) 20270 return Math.round( 20271 box[instance.options.horizontal ? "inlineSize" : "blockSize"] 20272 ); 20273 } 20274 return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"]; 20275}; 20276var elementScroll = (offset2, { 20277 adjustments = 0, 20278 behavior 20279}, instance) => { 20280 var _a2, _b; 20281 let toOffset = offset2 + adjustments; 20282 (_b = (_a2 = instance.scrollElement) == null ? void 0 : _a2.scrollTo) == null || _b.call(_a2, { 20283 [instance.options.horizontal ? "left" : "top"]: toOffset, 20284 behavior 20285 }); 20286}, Virtualizer = class { 20287 constructor(opts) { 20288 this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => { 20289 let _ro = null, get2 = () => _ro || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : _ro = new this.targetWindow.ResizeObserver((entries) => { 20290 entries.forEach((entry) => { 20291 let run = () => { 20292 this._measureElement(entry.target, entry); 20293 }; 20294 this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run(); 20295 }); 20296 })); 20297 return { 20298 disconnect: () => { 20299 var _a2; 20300 (_a2 = get2()) == null || _a2.disconnect(), _ro = null; 20301 }, 20302 observe: (target) => { 20303 var _a2; 20304 return (_a2 = get2()) == null ? void 0 : _a2.observe(target, { box: "border-box" }); 20305 }, 20306 unobserve: (target) => { 20307 var _a2; 20308 return (_a2 = get2()) == null ? void 0 : _a2.unobserve(target); 20309 } 20310 }; 20311 })(), this.range = null, this.setOptions = (opts2) => { 20312 Object.entries(opts2).forEach(([key, value]) => { 20313 typeof value > "u" && delete opts2[key]; 20314 }), this.options = { 20315 debug: !1, 20316 initialOffset: 0, 20317 overscan: 1, 20318 paddingStart: 0, 20319 paddingEnd: 0, 20320 scrollPaddingStart: 0, 20321 scrollPaddingEnd: 0, 20322 horizontal: !1, 20323 getItemKey: defaultKeyExtractor, 20324 rangeExtractor: defaultRangeExtractor, 20325 onChange: () => { 20326 }, 20327 measureElement, 20328 initialRect: { width: 0, height: 0 }, 20329 scrollMargin: 0, 20330 gap: 0, 20331 indexAttribute: "data-index", 20332 initialMeasurementsCache: [], 20333 lanes: 1, 20334 isScrollingResetDelay: 150, 20335 enabled: !0, 20336 isRtl: !1, 20337 useScrollendEvent: !1, 20338 useAnimationFrameWithResizeObserver: !1, 20339 ...opts2 20340 }; 20341 }, this.notify = (sync) => { 20342 var _a2, _b; 20343 (_b = (_a2 = this.options).onChange) == null || _b.call(_a2, this, sync); 20344 }, this.maybeNotify = memo2( 20345 () => (this.calculateRange(), [ 20346 this.isScrolling, 20347 this.range ? this.range.startIndex : null, 20348 this.range ? this.range.endIndex : null 20349 ]), 20350 (isScrolling) => { 20351 this.notify(isScrolling); 20352 }, 20353 { 20354 key: !1, 20355 debug: () => this.options.debug, 20356 initialDeps: [ 20357 this.isScrolling, 20358 this.range ? this.range.startIndex : null, 20359 this.range ? this.range.endIndex : null 20360 ] 20361 } 20362 ), this.cleanup = () => { 20363 this.unsubs.filter(Boolean).forEach((d2) => d2()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null; 20364 }, this._didMount = () => () => { 20365 this.cleanup(); 20366 }, this._willUpdate = () => { 20367 var _a2; 20368 let scrollElement = this.options.enabled ? this.options.getScrollElement() : null; 20369 if (this.scrollElement !== scrollElement) { 20370 if (this.cleanup(), !scrollElement) { 20371 this.maybeNotify(); 20372 return; 20373 } 20374 this.scrollElement = scrollElement, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((_a2 = this.scrollElement) == null ? void 0 : _a2.window) ?? null, this.elementsCache.forEach((cached) => { 20375 this.observer.observe(cached); 20376 }), this._scrollToOffset(this.getScrollOffset(), { 20377 adjustments: void 0, 20378 behavior: void 0 20379 }), this.unsubs.push( 20380 this.options.observeElementRect(this, (rect) => { 20381 this.scrollRect = rect, this.maybeNotify(); 20382 }) 20383 ), this.unsubs.push( 20384 this.options.observeElementOffset(this, (offset2, isScrolling) => { 20385 this.scrollAdjustments = 0, this.scrollDirection = isScrolling ? this.getScrollOffset() < offset2 ? "forward" : "backward" : null, this.scrollOffset = offset2, this.isScrolling = isScrolling, this.maybeNotify(); 20386 }) 20387 ); 20388 } 20389 }, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (measurements, index) => { 20390 let furthestMeasurementsFound = /* @__PURE__ */ new Map(), furthestMeasurements = /* @__PURE__ */ new Map(); 20391 for (let m2 = index - 1; m2 >= 0; m2--) { 20392 let measurement = measurements[m2]; 20393 if (furthestMeasurementsFound.has(measurement.lane)) 20394 continue; 20395 let previousFurthestMeasurement = furthestMeasurements.get( 20396 measurement.lane 20397 ); 20398 if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end ? furthestMeasurements.set(measurement.lane, measurement) : measurement.end < previousFurthestMeasurement.end && furthestMeasurementsFound.set(measurement.lane, !0), furthestMeasurementsFound.size === this.options.lanes) 20399 break; 20400 } 20401 return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a2, b2) => a2.end === b2.end ? a2.index - b2.index : a2.end - b2.end)[0] : void 0; 20402 }, this.getMeasurementOptions = memo2( 20403 () => [ 20404 this.options.count, 20405 this.options.paddingStart, 20406 this.options.scrollMargin, 20407 this.options.getItemKey, 20408 this.options.enabled 20409 ], 20410 (count, paddingStart, scrollMargin, getItemKey, enabled) => (this.pendingMeasuredCacheIndexes = [], { 20411 count, 20412 paddingStart, 20413 scrollMargin, 20414 getItemKey, 20415 enabled 20416 }), 20417 { 20418 key: !1 20419 } 20420 ), this.getMeasurements = memo2( 20421 () => [this.getMeasurementOptions(), this.itemSizeCache], 20422 ({ count, paddingStart, scrollMargin, getItemKey, enabled }, itemSizeCache) => { 20423 if (!enabled) 20424 return this.measurementsCache = [], this.itemSizeCache.clear(), []; 20425 this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((item) => { 20426 this.itemSizeCache.set(item.key, item.size); 20427 })); 20428 let min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0; 20429 this.pendingMeasuredCacheIndexes = []; 20430 let measurements = this.measurementsCache.slice(0, min); 20431 for (let i2 = min; i2 < count; i2++) { 20432 let key = getItemKey(i2), furthestMeasurement = this.options.lanes === 1 ? measurements[i2 - 1] : this.getFurthestMeasurement(measurements, i2), start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin, measuredSize = itemSizeCache.get(key), size = typeof measuredSize == "number" ? measuredSize : this.options.estimateSize(i2), end = start + size, lane = furthestMeasurement ? furthestMeasurement.lane : i2 % this.options.lanes; 20433 measurements[i2] = { 20434 index: i2, 20435 start, 20436 size, 20437 end, 20438 key, 20439 lane 20440 }; 20441 } 20442 return this.measurementsCache = measurements, measurements; 20443 }, 20444 { 20445 key: !1, 20446 debug: () => this.options.debug 20447 } 20448 ), this.calculateRange = memo2( 20449 () => [ 20450 this.getMeasurements(), 20451 this.getSize(), 20452 this.getScrollOffset(), 20453 this.options.lanes 20454 ], 20455 (measurements, outerSize, scrollOffset, lanes) => this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({ 20456 measurements, 20457 outerSize, 20458 scrollOffset, 20459 lanes 20460 }) : null, 20461 { 20462 key: !1, 20463 debug: () => this.options.debug 20464 } 20465 ), this.getVirtualIndexes = memo2( 20466 () => { 20467 let startIndex = null, endIndex = null, range = this.calculateRange(); 20468 return range && (startIndex = range.startIndex, endIndex = range.endIndex), this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]), [ 20469 this.options.rangeExtractor, 20470 this.options.overscan, 20471 this.options.count, 20472 startIndex, 20473 endIndex 20474 ]; 20475 }, 20476 (rangeExtractor, overscan, count, startIndex, endIndex) => startIndex === null || endIndex === null ? [] : rangeExtractor({ 20477 startIndex, 20478 endIndex, 20479 overscan, 20480 count 20481 }), 20482 { 20483 key: !1, 20484 debug: () => this.options.debug 20485 } 20486 ), this.indexFromElement = (node) => { 20487 let attributeName = this.options.indexAttribute, indexStr = node.getAttribute(attributeName); 20488 return indexStr ? parseInt(indexStr, 10) : (console.warn( 20489 `Missing attribute name '${attributeName}={index}' on measured element.` 20490 ), -1); 20491 }, this._measureElement = (node, entry) => { 20492 let index = this.indexFromElement(node), item = this.measurementsCache[index]; 20493 if (!item) 20494 return; 20495 let key = item.key, prevNode = this.elementsCache.get(key); 20496 prevNode !== node && (prevNode && this.observer.unobserve(prevNode), this.observer.observe(node), this.elementsCache.set(key, node)), node.isConnected && this.resizeItem(index, this.options.measureElement(node, entry, this)); 20497 }, this.resizeItem = (index, size) => { 20498 let item = this.measurementsCache[index]; 20499 if (!item) 20500 return; 20501 let itemSize = this.itemSizeCache.get(item.key) ?? item.size, delta = size - itemSize; 20502 delta !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments) && this._scrollToOffset(this.getScrollOffset(), { 20503 adjustments: this.scrollAdjustments += delta, 20504 behavior: void 0 20505 }), this.pendingMeasuredCacheIndexes.push(item.index), this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size)), this.notify(!1)); 20506 }, this.measureElement = (node) => { 20507 if (!node) { 20508 this.elementsCache.forEach((cached, key) => { 20509 cached.isConnected || (this.observer.unobserve(cached), this.elementsCache.delete(key)); 20510 }); 20511 return; 20512 } 20513 this._measureElement(node, void 0); 20514 }, this.getVirtualItems = memo2( 20515 () => [this.getVirtualIndexes(), this.getMeasurements()], 20516 (indexes, measurements) => { 20517 let virtualItems = []; 20518 for (let k2 = 0, len = indexes.length; k2 < len; k2++) { 20519 let i2 = indexes[k2], measurement = measurements[i2]; 20520 virtualItems.push(measurement); 20521 } 20522 return virtualItems; 20523 }, 20524 { 20525 key: !1, 20526 debug: () => this.options.debug 20527 } 20528 ), this.getVirtualItemForOffset = (offset2) => { 20529 let measurements = this.getMeasurements(); 20530 if (measurements.length !== 0) 20531 return notUndefined( 20532 measurements[findNearestBinarySearch( 20533 0, 20534 measurements.length - 1, 20535 (index) => notUndefined(measurements[index]).start, 20536 offset2 20537 )] 20538 ); 20539 }, this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => { 20540 let size = this.getSize(), scrollOffset = this.getScrollOffset(); 20541 align === "auto" && (align = toOffset >= scrollOffset + size ? "end" : "start"), align === "center" ? toOffset += (itemSize - size) / 2 : align === "end" && (toOffset -= size); 20542 let maxOffset = this.getTotalSize() + this.options.scrollMargin - size; 20543 return Math.max(Math.min(maxOffset, toOffset), 0); 20544 }, this.getOffsetForIndex = (index, align = "auto") => { 20545 index = Math.max(0, Math.min(index, this.options.count - 1)); 20546 let item = this.measurementsCache[index]; 20547 if (!item) 20548 return; 20549 let size = this.getSize(), scrollOffset = this.getScrollOffset(); 20550 if (align === "auto") 20551 if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) 20552 align = "end"; 20553 else if (item.start <= scrollOffset + this.options.scrollPaddingStart) 20554 align = "start"; 20555 else 20556 return [scrollOffset, align]; 20557 let toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart; 20558 return [ 20559 this.getOffsetForAlignment(toOffset, align, item.size), 20560 align 20561 ]; 20562 }, this.isDynamicMode = () => this.elementsCache.size > 0, this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => { 20563 behavior === "smooth" && this.isDynamicMode() && console.warn( 20564 "The `smooth` scroll behavior is not fully supported with dynamic size." 20565 ), this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), { 20566 adjustments: void 0, 20567 behavior 20568 }); 20569 }, this.scrollToIndex = (index, { align: initialAlign = "auto", behavior } = {}) => { 20570 behavior === "smooth" && this.isDynamicMode() && console.warn( 20571 "The `smooth` scroll behavior is not fully supported with dynamic size." 20572 ), index = Math.max(0, Math.min(index, this.options.count - 1)); 20573 let attempts = 0, maxAttempts = 10, tryScroll = (currentAlign) => { 20574 if (!this.targetWindow) return; 20575 let offsetInfo = this.getOffsetForIndex(index, currentAlign); 20576 if (!offsetInfo) { 20577 console.warn("Failed to get offset for index:", index); 20578 return; 20579 } 20580 let [offset2, align] = offsetInfo; 20581 this._scrollToOffset(offset2, { adjustments: void 0, behavior }), this.targetWindow.requestAnimationFrame(() => { 20582 let currentOffset = this.getScrollOffset(), afterInfo = this.getOffsetForIndex(index, align); 20583 if (!afterInfo) { 20584 console.warn("Failed to get offset for index:", index); 20585 return; 20586 } 20587 approxEqual(afterInfo[0], currentOffset) || scheduleRetry(align); 20588 }); 20589 }, scheduleRetry = (align) => { 20590 this.targetWindow && (attempts++, attempts < maxAttempts ? this.targetWindow.requestAnimationFrame(() => tryScroll(align)) : console.warn( 20591 `Failed to scroll to index ${index} after ${maxAttempts} attempts.` 20592 )); 20593 }; 20594 tryScroll(initialAlign); 20595 }, this.scrollBy = (delta, { behavior } = {}) => { 20596 behavior === "smooth" && this.isDynamicMode() && console.warn( 20597 "The `smooth` scroll behavior is not fully supported with dynamic size." 20598 ), this._scrollToOffset(this.getScrollOffset() + delta, { 20599 adjustments: void 0, 20600 behavior 20601 }); 20602 }, this.getTotalSize = () => { 20603 var _a2; 20604 let measurements = this.getMeasurements(), end; 20605 if (measurements.length === 0) 20606 end = this.options.paddingStart; 20607 else if (this.options.lanes === 1) 20608 end = ((_a2 = measurements[measurements.length - 1]) == null ? void 0 : _a2.end) ?? 0; 20609 else { 20610 let endByLane = Array(this.options.lanes).fill(null), endIndex = measurements.length - 1; 20611 for (; endIndex >= 0 && endByLane.some((val) => val === null); ) { 20612 let item = measurements[endIndex]; 20613 endByLane[item.lane] === null && (endByLane[item.lane] = item.end), endIndex--; 20614 } 20615 end = Math.max(...endByLane.filter((val) => val !== null)); 20616 } 20617 return Math.max( 20618 end - this.options.scrollMargin + this.options.paddingEnd, 20619 0 20620 ); 20621 }, this._scrollToOffset = (offset2, { 20622 adjustments, 20623 behavior 20624 }) => { 20625 this.options.scrollToFn(offset2, { behavior, adjustments }, this); 20626 }, this.measure = () => { 20627 this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1); 20628 }, this.setOptions(opts); 20629 } 20630}, findNearestBinarySearch = (low, high, getCurrentValue, value) => { 20631 for (; low <= high; ) { 20632 let middle = (low + high) / 2 | 0, currentValue = getCurrentValue(middle); 20633 if (currentValue < value) 20634 low = middle + 1; 20635 else if (currentValue > value) 20636 high = middle - 1; 20637 else 20638 return middle; 20639 } 20640 return low > 0 ? low - 1 : 0; 20641}; 20642function calculateRange({ 20643 measurements, 20644 outerSize, 20645 scrollOffset, 20646 lanes 20647}) { 20648 let lastIndex = measurements.length - 1, getOffset = (index) => measurements[index].start; 20649 if (measurements.length <= lanes) 20650 return { 20651 startIndex: 0, 20652 endIndex: lastIndex 20653 }; 20654 let startIndex = findNearestBinarySearch( 20655 0, 20656 lastIndex, 20657 getOffset, 20658 scrollOffset 20659 ), endIndex = startIndex; 20660 if (lanes === 1) 20661 for (; endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize; ) 20662 endIndex++; 20663 else if (lanes > 1) { 20664 let endPerLane = Array(lanes).fill(0); 20665 for (; endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize); ) { 20666 let item = measurements[endIndex]; 20667 endPerLane[item.lane] = item.end, endIndex++; 20668 } 20669 let startPerLane = Array(lanes).fill(scrollOffset + outerSize); 20670 for (; startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset); ) { 20671 let item = measurements[startIndex]; 20672 startPerLane[item.lane] = item.start, startIndex--; 20673 } 20674 startIndex = Math.max(0, startIndex - startIndex % lanes), endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes)); 20675 } 20676 return { startIndex, endIndex }; 20677} 20678
vendor: 876 bytes, lines 20679-20701
20679// ../../node_modules/@tanstack/react-virtual/dist/esm/index.js 20680var useIsomorphicLayoutEffect = typeof document < "u" ? useLayoutEffect : useEffect; 20681function useVirtualizerBase(options2) { 20682 let rerender = useReducer(() => ({}), {})[1], resolvedOptions = { 20683 ...options2, 20684 onChange: (instance2, sync) => { 20685 var _a2; 20686 sync ? flushSync(rerender) : rerender(), (_a2 = options2.onChange) == null || _a2.call(options2, instance2, sync); 20687 } 20688 }, [instance] = useState( 20689 () => new Virtualizer(resolvedOptions) 20690 ); 20691 return instance.setOptions(resolvedOptions), useIsomorphicLayoutEffect(() => instance._didMount(), []), useIsomorphicLayoutEffect(() => instance._willUpdate()), instance; 20692} 20693function useVirtualizer(options2) { 20694 return useVirtualizerBase({ 20695 observeElementRect, 20696 observeElementOffset, 20697 scrollToFn: elementScroll, 20698 ...options2 20699 }); 20700} 20701
vendor: 21,481 bytes, lines 20702-21274
20702// src/manager/components/sidebar/FIleSearchList.utils.tsx 20703init_react(); 20704var useArrowKeyNavigation = ({ 20705 parentRef, 20706 rowVirtualizer, 20707 selectedItem 20708}) => { 20709 useEffect(() => { 20710 let handleArrowKeys = (event) => { 20711 if (!parentRef.current) 20712 return; 20713 let maxIndex = rowVirtualizer.options.count, activeElement = document.activeElement, rowIndex = parseInt(activeElement.getAttribute("data-index") || "-1", 10), isActiveElementInput = activeElement.tagName === "INPUT", getFirstElement = () => document.querySelector('[data-index="0"]'), getLastElement = () => document.querySelector(`[data-index="${maxIndex - 1}"]`); 20714 if (event.code === "ArrowDown" && activeElement) { 20715 if (event.stopPropagation(), isActiveElementInput) { 20716 getFirstElement()?.focus(); 20717 return; 20718 } 20719 if (rowIndex === maxIndex - 1) { 20720 flushSync(() => { 20721 rowVirtualizer.scrollToIndex(0, { align: "start" }); 20722 }), setTimeout(() => { 20723 getFirstElement()?.focus(); 20724 }, 100); 20725 return; 20726 } 20727 if (selectedItem === rowIndex) { 20728 document.querySelector( 20729 `[data-index-position="${selectedItem}_first"]` 20730 )?.focus(); 20731 return; 20732 } 20733 if (selectedItem !== null && activeElement.getAttribute("data-index-position")?.includes("last")) { 20734 document.querySelector( 20735 `[data-index="${selectedItem + 1}"]` 20736 )?.focus(); 20737 return; 20738 } 20739 activeElement.nextElementSibling?.focus(); 20740 } 20741 if (event.code === "ArrowUp" && activeElement) { 20742 if (isActiveElementInput) { 20743 flushSync(() => { 20744 rowVirtualizer.scrollToIndex(maxIndex - 1, { align: "start" }); 20745 }), setTimeout(() => { 20746 getLastElement()?.focus(); 20747 }, 100); 20748 return; 20749 } 20750 if (selectedItem !== null && activeElement.getAttribute("data-index-position")?.includes("first")) { 20751 document.querySelector( 20752 `[data-index="${selectedItem}"]` 20753 )?.focus(); 20754 return; 20755 } 20756 activeElement.previousElementSibling?.focus(); 20757 } 20758 }; 20759 return document.addEventListener("keydown", handleArrowKeys, { capture: !0 }), () => { 20760 document.removeEventListener("keydown", handleArrowKeys, { capture: !0 }); 20761 }; 20762 }, [rowVirtualizer, selectedItem, parentRef]); 20763}; 20764 20765// src/manager/components/sidebar/FileList.tsx 20766var FileListWrapper = styled("div")(({ theme }) => ({ 20767 marginTop: "-16px", 20768 // after element which fades out the list 20769 "&::after": { 20770 content: '""', 20771 position: "fixed", 20772 pointerEvents: "none", 20773 bottom: 0, 20774 left: 0, 20775 right: 0, 20776 height: "80px", 20777 background: `linear-gradient(${rgba(theme.barBg, 0)} 10%, ${theme.barBg} 80%)` 20778 } 20779})), FileList = styled("div")({ 20780 height: "280px", 20781 overflow: "auto", 20782 msOverflowStyle: "none", 20783 scrollbarWidth: "none", 20784 position: "relative", 20785 "::-webkit-scrollbar": { 20786 display: "none" 20787 } 20788}), FileListLi = styled("li")(({ theme }) => ({ 20789 ":focus-visible": { 20790 outline: "none", 20791 ".file-list-item": { 20792 borderRadius: "4px", 20793 background: theme.base === "dark" ? "rgba(255,255,255,.1)" : theme.color.mediumlight, 20794 "> svg": { 20795 display: "flex" 20796 } 20797 } 20798 } 20799})), FileListItem = styled("div")({ 20800 display: "flex", 20801 flexDirection: "column", 20802 position: "relative" 20803}), FileListItemContentWrapper = styled.div(({ theme, selected, disabled, error }) => ({ 20804 display: "flex", 20805 alignItems: "flex-start", 20806 gap: "8px", 20807 alignSelf: "stretch", 20808 padding: "8px 16px", 20809 cursor: "pointer", 20810 borderRadius: "4px", 20811 ...selected && { 20812 borderRadius: "4px", 20813 background: theme.base === "dark" ? "rgba(255,255,255,.1)" : theme.color.mediumlight, 20814 "> svg": { 20815 display: "flex" 20816 } 20817 }, 20818 ...disabled && { 20819 cursor: "not-allowed", 20820 div: { 20821 color: `${theme.textMutedColor} !important` 20822 } 20823 }, 20824 ...error && { 20825 background: theme.base === "light" ? "#00000011" : "#00000033" 20826 }, 20827 "&:hover": { 20828 background: error ? "#00000022" : theme.base === "dark" ? "rgba(255,255,255,.1)" : theme.color.mediumlight, 20829 "> svg": { 20830 display: "flex" 20831 } 20832 } 20833})), FileListUl = styled("ul")({ 20834 margin: 0, 20835 padding: "0 0 0 0", 20836 width: "100%", 20837 position: "relative" 20838}), FileListItemContent = styled("div")({ 20839 display: "flex", 20840 flexDirection: "column", 20841 alignItems: "flex-start", 20842 width: "calc(100% - 50px)" 20843}), FileListIconWrapper = styled("div")(({ theme, error }) => ({ 20844 color: error ? theme.color.negativeText : theme.color.secondary 20845})), FileListItemLabel = styled("div")(({ theme, error }) => ({ 20846 color: error ? theme.color.negativeText : theme.base === "dark" ? theme.color.lighter : theme.color.darkest, 20847 fontSize: "14px", 20848 whiteSpace: "nowrap", 20849 textOverflow: "ellipsis", 20850 overflow: "hidden", 20851 maxWidth: "100%" 20852})), FileListItemPath = styled("div")(({ theme }) => ({ 20853 color: theme.textMutedColor, 20854 fontSize: "14px", 20855 whiteSpace: "nowrap", 20856 textOverflow: "ellipsis", 20857 overflow: "hidden", 20858 maxWidth: "100%" 20859})), FileListExport = styled("ul")({ 20860 margin: 0, 20861 padding: 0 20862}), FileListItemExport = styled("li")(({ theme, error }) => ({ 20863 padding: "8px 16px 8px 58px", 20864 display: "flex", 20865 gap: "8px", 20866 alignItems: "center", 20867 justifyContent: "space-between", 20868 fontSize: "14px", 20869 cursor: "pointer", 20870 borderRadius: "4px", 20871 ":focus-visible": { 20872 outline: "none" 20873 }, 20874 ...error && { 20875 background: "#F9ECEC", 20876 color: theme.color.negativeText 20877 }, 20878 "&:hover,:focus-visible": { 20879 background: error ? "#F9ECEC" : theme.base === "dark" ? "rgba(255, 255, 255, 0.1)" : theme.color.mediumlight, 20880 "> svg": { 20881 display: "flex" 20882 } 20883 }, 20884 "> div > svg": { 20885 color: error ? theme.color.negativeText : theme.color.secondary 20886 } 20887})), FileListItemExportName = styled("div")({ 20888 display: "flex", 20889 alignItems: "center", 20890 gap: "8px", 20891 width: "calc(100% - 20px)" 20892}), FileListItemExportNameContent = styled("span")(({ theme }) => ({ 20893 whiteSpace: "nowrap", 20894 textOverflow: "ellipsis", 20895 overflow: "hidden", 20896 display: "inline-block", 20897 color: theme.base === "dark" ? theme.color.lightest : theme.color.darkest 20898})), FileListItemExportNameContentWithExport = styled(FileListItemExportNameContent)({ 20899 maxWidth: "calc(100% - 120px)" 20900}), DefaultExport = styled("span")(({ theme }) => ({ 20901 display: "inline-block", 20902 padding: `1px ${theme.appBorderRadius}px`, 20903 borderRadius: "2px", 20904 fontSize: "10px", 20905 color: theme.color.defaultText, 20906 backgroundColor: theme.base === "dark" ? "rgba(255, 255, 255, 0.1)" : "#F2F4F5" 20907})), NoResults = styled("div")(({ theme }) => ({ 20908 textAlign: "center", 20909 maxWidth: "334px", 20910 margin: "16px auto 50px auto", 20911 fontSize: "14px", 20912 color: theme.base === "dark" ? theme.color.lightest : "#000" 20913})), NoResultsDescription = styled("p")(({ theme }) => ({ 20914 margin: 0, 20915 color: theme.textMutedColor 20916})); 20917 20918// src/manager/components/sidebar/FileSearchListSkeleton.tsx 20919init_react(); 20920var FileListItemContentWrapperSkeleton = styled("div")(({ theme }) => ({ 20921 display: "flex", 20922 alignItems: "flex-start", 20923 gap: "8px", 20924 alignSelf: "stretch", 20925 padding: "8px 16px" 20926})), FileListItemContentSkeleton = styled("div")({ 20927 display: "flex", 20928 flexDirection: "column", 20929 alignItems: "flex-start", 20930 width: "100%", 20931 borderRadius: "3px" 20932}), FileListIconWrapperSkeleton = styled.div(({ theme }) => ({ 20933 width: "14px", 20934 height: "14px", 20935 borderRadius: "3px", 20936 marginTop: "1px", 20937 background: theme.base === "dark" ? "rgba(255,255,255,.1)" : "rgba(0,0,0,.1)", 20938 animation: `${theme.animation.glow} 1.5s ease-in-out infinite` 20939})), FileListItemSkeleton = styled.div(({ theme }) => ({ 20940 height: "16px", 20941 borderRadius: "3px", 20942 background: theme.base === "dark" ? "rgba(255,255,255,.1)" : "rgba(0,0,0,.1)", 20943 animation: `${theme.animation.glow} 1.5s ease-in-out infinite`, 20944 width: "100%", 20945 maxWidth: "100%", 20946 "+ div": { 20947 marginTop: "6px" 20948 } 20949})), FileSearchListLoadingSkeleton = () => react_default.createElement(FileList, null, [1, 2, 3].map((result) => react_default.createElement(FileListItem, { key: result }, react_default.createElement(FileListItemContentWrapperSkeleton, null, react_default.createElement(FileListIconWrapperSkeleton, null), react_default.createElement(FileListItemContentSkeleton, null, react_default.createElement(FileListItemSkeleton, { style: { width: "90px" } }), react_default.createElement(FileListItemSkeleton, { style: { width: "300px" } })))))); 20950 20951// src/manager/components/sidebar/FileSearchList.tsx 20952var TreeExpandIconStyled = styled(ChevronSmallRightIcon)(({ theme }) => ({ 20953 color: theme.textMutedColor, 20954 marginTop: 2 20955})), TreeCollapseIconStyled = styled(ChevronSmallDownIcon)(({ theme }) => ({ 20956 color: theme.textMutedColor, 20957 marginTop: 2 20958})), FileSearchList = memo(function({ 20959 isLoading, 20960 searchResults, 20961 onNewStory, 20962 errorItemId 20963}) { 20964 let [selectedItem, setSelectedItem] = useState(null), parentRef = react_default.useRef(), sortedSearchResults = useMemo(() => [...searchResults ?? []].sort((a2, b2) => { 20965 let isALowPriority = a2.exportedComponents === null || a2.exportedComponents?.length === 0, hasAStory = a2.storyFileExists, isBLowPriority = b2.exportedComponents === null || b2.exportedComponents?.length === 0, hasBStory = b2.storyFileExists; 20966 return hasAStory && !hasBStory ? -1 : hasBStory && !hasAStory || isALowPriority && !isBLowPriority ? 1 : !isALowPriority && isBLowPriority ? -1 : 0; 20967 }), [searchResults]), count = searchResults?.length || 0, rowVirtualizer = useVirtualizer({ 20968 count, 20969 // @ts-expect-error (non strict) 20970 getScrollElement: () => parentRef.current, 20971 paddingStart: 16, 20972 paddingEnd: 40, 20973 estimateSize: () => 54, 20974 overscan: 2 20975 }); 20976 useArrowKeyNavigation({ rowVirtualizer, parentRef, selectedItem }); 20977 let handleFileItemSelection = useCallback( 20978 ({ virtualItem, searchResult, itemId }) => { 20979 searchResult?.exportedComponents?.length > 1 ? setSelectedItem((sItem) => sItem === virtualItem.index ? null : virtualItem.index) : searchResult?.exportedComponents?.length === 1 && onNewStory({ 20980 componentExportName: searchResult.exportedComponents[0].name, 20981 componentFilePath: searchResult.filepath, 20982 componentIsDefaultExport: searchResult.exportedComponents[0].default, 20983 selectedItemId: itemId, 20984 componentExportCount: 1 20985 }); 20986 }, 20987 [onNewStory] 20988 ), handleFileItemComponentSelection = useCallback( 20989 ({ searchResult, component, id }) => { 20990 onNewStory({ 20991 componentExportName: component.name, 20992 componentFilePath: searchResult.filepath, 20993 componentIsDefaultExport: component.default, 20994 selectedItemId: id, 20995 // @ts-expect-error (non strict) 20996 componentExportCount: searchResult.exportedComponents.length 20997 }); 20998 }, 20999 [onNewStory] 21000 ), ListItem2 = useCallback( 21001 ({ 21002 virtualItem, 21003 selected, 21004 searchResult, 21005 noExports 21006 }) => { 21007 let itemError = errorItemId === searchResult.filepath, itemSelected = selected === virtualItem.index, tooltip = noExports ? "We can't evaluate exports for this file. Automatic story creation is disabled." : void 0; 21008 return react_default.createElement( 21009 FileListItem, 21010 { 21011 "aria-expanded": itemSelected, 21012 "aria-controls": `file-list-export-${virtualItem.index}`, 21013 id: `file-list-item-wrapper-${virtualItem.index}` 21014 }, 21015 react_default.createElement( 21016 TooltipProvider, 21017 { 21018 tooltip: tooltip ? react_default.createElement(TooltipNote, { note: tooltip }) : void 0, 21019 placement: "top-start", 21020 delayHide: 100, 21021 delayShow: 200 21022 }, 21023 react_default.createElement( 21024 FileListItemContentWrapper, 21025 { 21026 className: "file-list-item", 21027 selected: itemSelected, 21028 error: itemError, 21029 disabled: noExports 21030 }, 21031 itemSelected ? react_default.createElement(TreeCollapseIconStyled, { size: 14 }) : react_default.createElement(TreeExpandIconStyled, { size: 14 }), 21032 react_default.createElement(FileListIconWrapper, { error: itemError }, react_default.createElement(ComponentIcon, null)), 21033 react_default.createElement(FileListItemContent, null, react_default.createElement(FileListItemLabel, { error: itemError }, searchResult.filepath.split("/").at(-1)), react_default.createElement(FileListItemPath, null, searchResult.filepath)) 21034 ) 21035 ), 21036 searchResult?.exportedComponents?.length > 1 && itemSelected && react_default.createElement( 21037 FileListExport, 21038 { 21039 role: "region", 21040 id: `file-list-export-${virtualItem.index}`, 21041 "aria-labelledby": `file-list-item-wrapper-${virtualItem.index}`, 21042 onClick: (e2) => { 21043 e2.stopPropagation(); 21044 }, 21045 onKeyUp: (e2) => { 21046 e2.key === "Enter" && e2.stopPropagation(); 21047 } 21048 }, 21049 searchResult.exportedComponents?.map((component, itemExportId) => { 21050 let itemExportError = errorItemId === `${searchResult.filepath}_${itemExportId}`, position = itemExportId === 0 ? "first" : ( 21051 // @ts-expect-error (non strict) 21052 itemExportId === searchResult.exportedComponents.length - 1 ? "last" : "middle" 21053 ); 21054 return react_default.createElement( 21055 FileListItemExport, 21056 { 21057 tabIndex: 0, 21058 "data-index-position": `${virtualItem.index}_${position}`, 21059 key: component.name, 21060 error: itemExportError, 21061 onClick: () => { 21062 handleFileItemComponentSelection({ 21063 searchResult, 21064 component, 21065 id: `${searchResult.filepath}_${itemExportId}` 21066 }); 21067 }, 21068 onKeyUp: (event) => { 21069 event.key === "Enter" && handleFileItemComponentSelection({ 21070 searchResult, 21071 component, 21072 id: `${searchResult.filepath}_${itemExportId}` 21073 }); 21074 } 21075 }, 21076 react_default.createElement(FileListItemExportName, null, react_default.createElement(BookmarkHollowIcon, null), component.default ? react_default.createElement(react_default.Fragment, null, react_default.createElement(FileListItemExportNameContentWithExport, null, searchResult.filepath.split("/").at(-1)?.split(".")?.at(0)), react_default.createElement(DefaultExport, null, "Default export")) : react_default.createElement(FileListItemExportNameContent, null, component.name)) 21077 ); 21078 }) 21079 ) 21080 ); 21081 }, 21082 [handleFileItemComponentSelection, errorItemId] 21083 ); 21084 return isLoading && (searchResults === null || searchResults?.length === 0) ? react_default.createElement(FileSearchListLoadingSkeleton, null) : searchResults?.length === 0 ? react_default.createElement(NoResults, null, react_default.createElement("p", null, "We could not find any file with that name"), react_default.createElement(NoResultsDescription, null, "You may want to try using different keywords, check for typos, and adjust your filters")) : sortedSearchResults?.length > 0 ? react_default.createElement(FileListWrapper, null, react_default.createElement(FileList, { ref: parentRef }, react_default.createElement( 21085 FileListUl, 21086 { 21087 style: { 21088 height: `${rowVirtualizer.getTotalSize()}px` 21089 } 21090 }, 21091 rowVirtualizer.getVirtualItems().map((virtualItem) => { 21092 let searchResult = sortedSearchResults[virtualItem.index], noExports = searchResult.exportedComponents === null || searchResult.exportedComponents?.length === 0, itemProps = {}; 21093 return react_default.createElement( 21094 FileListLi, 21095 { 21096 key: virtualItem.key, 21097 "data-index": virtualItem.index, 21098 ref: rowVirtualizer.measureElement, 21099 onClick: () => { 21100 handleFileItemSelection({ 21101 virtualItem, 21102 itemId: searchResult.filepath, 21103 searchResult 21104 }); 21105 }, 21106 onKeyUp: (event) => { 21107 event.key === "Enter" && handleFileItemSelection({ 21108 virtualItem, 21109 itemId: searchResult.filepath, 21110 searchResult 21111 }); 21112 }, 21113 style: { 21114 position: "absolute", 21115 top: 0, 21116 left: 0, 21117 width: "100%", 21118 transform: `translateY(${virtualItem.start}px)` 21119 }, 21120 tabIndex: 0 21121 }, 21122 react_default.createElement( 21123 ListItem2, 21124 { 21125 ...itemProps, 21126 key: virtualItem.index, 21127 searchResult, 21128 selected: selectedItem, 21129 virtualItem, 21130 noExports 21131 } 21132 ) 21133 ); 21134 }) 21135 ))) : null; 21136}); 21137 21138// src/manager/components/sidebar/FileSearchModal.tsx 21139var MODAL_HEIGHT = 418, ModalStyled = styled(Modal)(() => ({ 21140 boxShadow: "none", 21141 background: "transparent", 21142 overflow: "visible" 21143})), ModalChild = styled.div(({ theme, height }) => ({ 21144 backgroundColor: theme.background.bar, 21145 borderRadius: 6, 21146 boxShadow: "rgba(255, 255, 255, 0.05) 0 0 0 1px inset, rgba(14, 18, 22, 0.35) 0px 10px 18px -10px", 21147 padding: "16px", 21148 transition: "height 0.3s", 21149 height: height ? `${height + 32}px` : "auto", 21150 overflow: "hidden" 21151})), ModalContent = styled(Modal.Content)(({ theme }) => ({ 21152 margin: 0, 21153 color: theme.color.defaultText 21154})), ModalInput = styled(Form.Input)(({ theme }) => ({ 21155 paddingLeft: 40, 21156 paddingRight: 28, 21157 fontSize: 14, 21158 height: 40, 21159 ...theme.base === "light" && { 21160 color: theme.color.darkest 21161 }, 21162 "::placeholder": { 21163 color: theme.color.mediumdark 21164 }, 21165 "&:invalid:not(:placeholder-shown)": { 21166 boxShadow: `${theme.color.negative} 0 0 0 1px inset` 21167 }, 21168 "&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration": { 21169 display: "none" 21170 } 21171})), SearchField = styled.div({ 21172 display: "flex", 21173 flexDirection: "column", 21174 flexGrow: 1, 21175 position: "relative" 21176}), SearchIconWrapper = styled.div(({ theme }) => ({ 21177 position: "absolute", 21178 top: 0, 21179 left: 16, 21180 zIndex: 1, 21181 pointerEvents: "none", 21182 color: theme.darkest, 21183 display: "flex", 21184 alignItems: "center", 21185 height: "100%" 21186})), LoadingIcon = styled.div(({ theme }) => ({ 21187 position: "absolute", 21188 top: 0, 21189 right: 16, 21190 zIndex: 1, 21191 color: theme.darkest, 21192 display: "flex", 21193 alignItems: "center", 21194 height: "100%", 21195 "@keyframes spin": { 21196 from: { transform: "rotate(0deg)" }, 21197 to: { transform: "rotate(360deg)" } 21198 }, 21199 animation: "spin 1s linear infinite" 21200})), ModalError = styled(Modal.Error)({ 21201 position: "absolute", 21202 padding: "8px 40px 8px 16px", 21203 bottom: 0, 21204 maxHeight: "initial", 21205 width: "100%", 21206 div: { 21207 wordBreak: "break-word" 21208 }, 21209 "> div": { 21210 padding: 0 21211 } 21212}), ModalErrorCloseIcon = styled(CloseAltIcon)({ 21213 position: "absolute", 21214 top: 4, 21215 right: -24, 21216 cursor: "pointer" 21217}), FileSearchModal = ({ 21218 open, 21219 onOpenChange, 21220 fileSearchQuery, 21221 setFileSearchQuery, 21222 isLoading, 21223 error, 21224 searchResults, 21225 onCreateNewStory, 21226 setError 21227}) => { 21228 let [modalContentRef, modalContentDimensions] = useMeasure(), [modalMaxHeight, setModalMaxHeight] = useState(modalContentDimensions.height), [, startTransition2] = useTransition(), [searchInputValue, setSearchInputValue] = useState(fileSearchQuery); 21229 return useEffect(() => { 21230 modalMaxHeight < modalContentDimensions.height && setModalMaxHeight(modalContentDimensions.height); 21231 }, [modalContentDimensions.height, modalMaxHeight]), react_default.createElement( 21232 ModalStyled, 21233 { 21234 ariaLabel: "Add a new story", 21235 height: MODAL_HEIGHT, 21236 width: 440, 21237 open, 21238 onOpenChange 21239 }, 21240 react_default.createElement(ModalChild, { height: fileSearchQuery === "" ? modalContentDimensions.height : modalMaxHeight }, react_default.createElement(ModalContent, { ref: modalContentRef }, react_default.createElement(Modal.Header, null, react_default.createElement(Modal.Title, null, "Add a new story"), react_default.createElement(Modal.Description, null, "We will create a new story for your component")), react_default.createElement(SearchField, null, react_default.createElement(SearchIconWrapper, null, react_default.createElement(SearchIcon, null)), react_default.createElement( 21241 ModalInput, 21242 { 21243 placeholder: "./components/**/*.tsx", 21244 type: "search", 21245 required: !0, 21246 autoFocus: !0, 21247 value: searchInputValue, 21248 onChange: (e2) => { 21249 let newValue = e2.target.value; 21250 setSearchInputValue(newValue), startTransition2(() => { 21251 setFileSearchQuery(newValue); 21252 }); 21253 } 21254 } 21255 ), isLoading && react_default.createElement(LoadingIcon, null, react_default.createElement(SyncIcon, null))), react_default.createElement( 21256 FileSearchList, 21257 { 21258 errorItemId: error?.selectedItemId, 21259 isLoading, 21260 searchResults, 21261 onNewStory: onCreateNewStory 21262 } 21263 ))), 21264 error && fileSearchQuery !== "" && react_default.createElement(ModalError, null, react_default.createElement("div", null, error.error), react_default.createElement( 21265 ModalErrorCloseIcon, 21266 { 21267 onClick: () => { 21268 setError(null); 21269 } 21270 } 21271 )) 21272 ); 21273}; 21274
vendor: 376 bytes, lines 21275-21285
21275// src/manager/utils/trySelectStory.ts 21276async function trySelectStory(selectStory, storyId, attempt = 1) { 21277 if (attempt > 10) 21278 throw new Error("We could not select the new story. Please try again."); 21279 try { 21280 selectStory(storyId); 21281 } catch { 21282 return await new Promise((resolve) => setTimeout(resolve, 500)), trySelectStory(selectStory, storyId, attempt + 1); 21283 } 21284} 21285
vendor: 47,191 bytes, lines 21286-22208
21286// src/manager/components/sidebar/CreateNewStoryFileModal.tsx 21287var isRendererReact = scope.STORYBOOK_RENDERER === "react", CreateNewStoryFileModal = ({ open, onOpenChange }) => { 21288 let [isLoading, setLoading] = useState(!1), [fileSearchQuery, setFileSearchQuery] = useState(""), fileSearchQueryDebounced = useDebounce(fileSearchQuery, 600), fileSearchQueryDeferred = useDeferredValue(fileSearchQueryDebounced), emittedValue = useRef(null), [error, setError] = useState( 21289 null 21290 ), api = useStorybookApi(), hasRunGhostStoriesFlow = useRef(!1), [searchResults, setSearchResults] = useState(null), handleSuccessfullyCreatedStory = useCallback( 21291 (componentExportName) => { 21292 api.addNotification({ 21293 id: "create-new-story-file-success", 21294 content: { 21295 headline: "Story file created", 21296 subHeadline: `${componentExportName} was created` 21297 }, 21298 duration: 8e3, 21299 icon: react_default.createElement(CheckIcon, null) 21300 }), onOpenChange(!1); 21301 }, 21302 [api, onOpenChange] 21303 ), handleStoryAlreadyExists = useCallback(() => { 21304 api.addNotification({ 21305 id: "create-new-story-file-error", 21306 content: { 21307 headline: "Story already exists", 21308 subHeadline: "Successfully navigated to existing story" 21309 }, 21310 duration: 8e3, 21311 icon: react_default.createElement(CheckIcon, null) 21312 }), onOpenChange(!1); 21313 }, [api, onOpenChange]), handleFileSearch = useCallback(() => { 21314 setLoading(!0); 21315 let channel2 = addons.getChannel(), set = (data) => { 21316 data.id === fileSearchQueryDeferred && (data.success ? setSearchResults(data.payload.files) : setError({ error: data.error }), channel2.off(FILE_COMPONENT_SEARCH_RESPONSE, set), setLoading(!1), emittedValue.current = null); 21317 }; 21318 return channel2.on(FILE_COMPONENT_SEARCH_RESPONSE, set), fileSearchQueryDeferred !== "" && emittedValue.current !== fileSearchQueryDeferred ? (emittedValue.current = fileSearchQueryDeferred, channel2.emit(FILE_COMPONENT_SEARCH_REQUEST, { 21319 id: fileSearchQueryDeferred, 21320 payload: {} 21321 })) : (setSearchResults(null), setLoading(!1)), () => { 21322 channel2.off(FILE_COMPONENT_SEARCH_RESPONSE, set); 21323 }; 21324 }, [fileSearchQueryDeferred]), handleCreateNewStory = useCallback( 21325 async ({ 21326 componentExportName, 21327 componentFilePath, 21328 componentIsDefaultExport, 21329 componentExportCount, 21330 selectedItemId 21331 }) => { 21332 try { 21333 let channel2 = addons.getChannel(), createNewStoryResult = await experimental_requestResponse(channel2, CREATE_NEW_STORYFILE_REQUEST, CREATE_NEW_STORYFILE_RESPONSE, { 21334 componentExportName, 21335 componentFilePath, 21336 componentIsDefaultExport, 21337 componentExportCount 21338 }); 21339 setError(null); 21340 let storyId = createNewStoryResult.storyId; 21341 await trySelectStory(api.selectStory, storyId), handleSuccessfullyCreatedStory(componentExportName), handleFileSearch(); 21342 } catch (e2) { 21343 if (e2?.payload?.type === "STORY_FILE_EXISTS") { 21344 let err = e2; 21345 await trySelectStory(api.selectStory, err.payload.kind), handleStoryAlreadyExists(); 21346 } else 21347 setError({ selectedItemId, error: e2?.message }); 21348 } 21349 }, 21350 [api?.selectStory, handleSuccessfullyCreatedStory, handleFileSearch, handleStoryAlreadyExists] 21351 ); 21352 useEffect(() => { 21353 setError(null); 21354 }, [fileSearchQueryDeferred]), useEffect(() => handleFileSearch(), [handleFileSearch]); 21355 let executeGhostStoriesFlow = useCallback(async () => { 21356 addons.getChannel().emit(GHOST_STORIES_REQUEST); 21357 }, []); 21358 return useEffect(() => { 21359 open && isRendererReact && !hasRunGhostStoriesFlow.current && (hasRunGhostStoriesFlow.current = !0, executeGhostStoriesFlow()); 21360 }, [open, executeGhostStoriesFlow]), react_default.createElement( 21361 FileSearchModal, 21362 { 21363 error, 21364 fileSearchQuery, 21365 fileSearchQueryDeferred, 21366 onCreateNewStory: handleCreateNewStory, 21367 isLoading, 21368 onOpenChange, 21369 open, 21370 searchResults, 21371 setError, 21372 setFileSearchQuery 21373 } 21374 ); 21375}; 21376 21377// src/manager/components/sidebar/Explorer.tsx 21378init_react(); 21379 21380// src/manager/components/sidebar/HighlightStyles.tsx 21381init_react(); 21382var HighlightStyles = ({ refId, itemId }) => react_default.createElement( 21383 Global, 21384 { 21385 styles: ({ color: color2 }) => { 21386 let background2 = curriedTransparentize$1(0.85, color2.secondary); 21387 return { 21388 [`[data-ref-id="${refId}"][data-item-id="${itemId}"]:not([data-selected="true"])`]: { 21389 '&[data-nodetype="component"], &[data-nodetype="group"]': { 21390 background: background2, 21391 "&:hover, &:focus": { background: background2 } 21392 }, 21393 '&[data-nodetype="story"], &[data-nodetype="document"], &[data-nodetype="test"]': { 21394 color: color2.defaultText, 21395 background: background2, 21396 "&:hover, &:focus": { background: background2 } 21397 } 21398 } 21399 }; 21400 } 21401 } 21402); 21403 21404// src/manager/components/sidebar/Refs.tsx 21405init_react(); 21406 21407// src/shared/constants/tags.ts 21408var Tag2 = { 21409 /** Indicates that autodocs should be generated for this component */ 21410 AUTODOCS: "autodocs", 21411 /** MDX documentation attached to a component's stories file */ 21412 ATTACHED_MDX: "attached-mdx", 21413 /** Standalone MDX documentation not attached to stories */ 21414 UNATTACHED_MDX: "unattached-mdx", 21415 /** Story has a play function */ 21416 PLAY_FN: "play-fn", 21417 /** Story has a test function */ 21418 TEST_FN: "test-fn", 21419 /** Development environment tag */ 21420 DEV: "dev", 21421 /** Test environment tag */ 21422 TEST: "test", 21423 /** Manifest generation tag */ 21424 MANIFEST: "manifest" 21425}, BUILT_IN_FILTERS = { 21426 _docs: (entry, excluded) => excluded ? entry.type !== "docs" : entry.type === "docs", 21427 _play: (entry, excluded) => excluded ? entry.type !== "story" || !entry.tags?.includes(Tag2.PLAY_FN) : entry.type === "story" && !!entry.tags?.includes(Tag2.PLAY_FN), 21428 _test: (entry, excluded) => excluded ? entry.type !== "story" || entry.subtype !== "test" : entry.type === "story" && entry.subtype === "test" 21429}, USER_TAG_FILTER = (tag) => (entry, excluded) => excluded ? !entry.tags?.includes(tag) : !!entry.tags?.includes(tag); 21430 21431// src/shared/utils/story-index-filters.ts 21432var getActiveFilterCount = ({ 21433 includedTagFilters, 21434 excludedTagFilters, 21435 includedStatusFilters, 21436 excludedStatusFilters 21437}) => (includedTagFilters?.length ?? 0) + (excludedTagFilters?.length ?? 0) + (includedStatusFilters?.length ?? 0) + (excludedStatusFilters?.length ?? 0); 21438 21439// src/manager/utils/tree.ts 21440var import_memoizerific3 = __toESM(require_memoizerific(), 1); 21441var { document: document3, window: globalWindow } = scope, createId = (itemId, refId) => !refId || refId === DEFAULT_REF_ID ? itemId : `${refId}_${itemId}`, getLink = (item, refId) => `${document3.location.pathname}?path=/${item.type}/${createId(item.id, refId)}`; 21442var get = (0, import_memoizerific3.default)(1e3)((id, dataset) => dataset[id]), getParent = (0, import_memoizerific3.default)(1e3)((id, dataset) => { 21443 let item = get(id, dataset); 21444 return item && item.type !== "root" ? get(item.parent, dataset) : void 0; 21445}), getParents = (0, import_memoizerific3.default)(1e3)((id, dataset) => { 21446 let parent = getParent(id, dataset); 21447 return parent ? [parent, ...getParents(parent.id, dataset)] : []; 21448}), getAncestorIds2 = (0, import_memoizerific3.default)(1e3)( 21449 (data, id) => getParents(id, data).map((item) => item.id) 21450), getDescendantIds = (0, import_memoizerific3.default)(1e3)((data, id, skipLeafs) => { 21451 let entry = data[id]; 21452 return !entry || !("children" in entry) || !entry.children ? [] : entry.children.reduce((acc, childId) => { 21453 let child = data[childId]; 21454 return !child || skipLeafs && (child.type === "story" || child.type === "docs") || acc.push(childId, ...getDescendantIds(data, childId, skipLeafs)), acc; 21455 }, []); 21456}); 21457function getPath(item, ref) { 21458 let parent = item.type !== "root" && item.parent ? ref.index[item.parent] : null; 21459 return parent ? [...getPath(parent, ref), parent.name] : ref.id === DEFAULT_REF_ID ? [] : [ref.title || ref.id]; 21460} 21461var searchItem = (item, ref) => ({ ...item, refId: ref.id, path: getPath(item, ref) }); 21462function cycle2(array, index, delta) { 21463 let next = index + delta % array.length; 21464 return next < 0 && (next = array.length + next), next >= array.length && (next -= array.length), next; 21465} 21466var scrollIntoView = (element, center = !1) => { 21467 if (!element) 21468 return; 21469 let { top, bottom } = element.getBoundingClientRect(); 21470 if (!top || !bottom) 21471 return; 21472 let bottomOffset = document3?.querySelector("#sidebar-bottom-wrapper")?.getBoundingClientRect().top || globalWindow.innerHeight || document3.documentElement.clientHeight; 21473 bottom > bottomOffset && element.scrollIntoView({ block: center ? "center" : "nearest" }); 21474}, getStateType = (isLoading, isAuthRequired, isError2, isEmpty) => { 21475 switch (!0) { 21476 case isAuthRequired: 21477 return "auth"; 21478 case isError2: 21479 return "error"; 21480 case isLoading: 21481 return "loading"; 21482 case isEmpty: 21483 return "empty"; 21484 default: 21485 return "ready"; 21486 } 21487}, isAncestor = (element, maybeAncestor) => !element || !maybeAncestor ? !1 : element === maybeAncestor ? !0 : isAncestor(element.parentElement || void 0, maybeAncestor), removeNoiseFromName = (storyName) => storyName.replaceAll(/(\s|-|_)/gi, ""), isStoryHoistable = (storyName, componentName2) => removeNoiseFromName(storyName) === removeNoiseFromName(componentName2); 21488 21489// src/manager/components/sidebar/RefBlocks.tsx 21490init_react(); 21491 21492// src/manager/components/sidebar/Loader.tsx 21493init_react(); 21494var LOADER_SEQUENCE = [0, 0, 1, 1, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3], Loadingitem = styled.div( 21495 { 21496 cursor: "progress", 21497 fontSize: 13, 21498 height: "16px", 21499 marginTop: 4, 21500 marginBottom: 4, 21501 alignItems: "center", 21502 overflow: "hidden" 21503 }, 21504 ({ depth = 0 }) => ({ 21505 marginLeft: depth * 15, 21506 maxWidth: 85 - depth * 5 21507 }), 21508 ({ theme }) => theme.animation.inlineGlow, 21509 ({ theme }) => ({ 21510 background: theme.appBorderColor 21511 }) 21512), Contained = styled.div({ 21513 display: "flex", 21514 flexDirection: "column", 21515 paddingLeft: 20, 21516 paddingRight: 20 21517}), Loader2 = ({ size }) => { 21518 let repeats = Math.ceil(size / LOADER_SEQUENCE.length), sequence = Array.from(Array(repeats)).fill(LOADER_SEQUENCE).flat().slice(0, size); 21519 return react_default.createElement(Fragment, null, sequence.map((depth, index) => react_default.createElement(Loadingitem, { depth, key: index }))); 21520}; 21521 21522// src/manager/components/sidebar/NoResults.tsx 21523var NoResults2 = styled.div(({ theme }) => ({ 21524 display: "flex", 21525 flexDirection: "column", 21526 textAlign: "center", 21527 textWrap: "balance", 21528 gap: 4, 21529 padding: "20px 0", 21530 lineHeight: "18px", 21531 fontSize: `${theme.typography.size.s2}px`, 21532 color: theme.color.defaultText, 21533 small: { 21534 color: theme.textMutedColor, 21535 fontSize: `${theme.typography.size.s1}px` 21536 }, 21537 button: { 21538 marginTop: 8, 21539 alignSelf: "center" 21540 } 21541})); 21542 21543// src/manager/components/sidebar/RefBlocks.tsx 21544var { window: globalWindow2 } = scope, TextStyle = styled.div(({ theme }) => ({ 21545 fontSize: theme.typography.size.s2, 21546 lineHeight: "20px", 21547 margin: 0 21548})), Text3 = styled.div(({ theme }) => ({ 21549 fontSize: theme.typography.size.s2, 21550 lineHeight: "20px", 21551 margin: 0, 21552 code: { 21553 fontSize: theme.typography.size.s1 21554 }, 21555 ul: { 21556 paddingLeft: 20, 21557 marginTop: 8, 21558 marginBottom: 8 21559 } 21560})), ErrorDisplay = styled.pre( 21561 { 21562 boxSizing: "border-box", 21563 borderRadius: 8, 21564 overflow: "auto", 21565 whiteSpace: "pre" 21566 }, 21567 ({ isMobile: isMobile2 }) => isMobile2 ? { 21568 maxWidth: "calc(100vw - 40px)" 21569 } : { 21570 minWidth: 420, 21571 maxWidth: 640 21572 }, 21573 ({ theme }) => ({ 21574 color: theme.color.dark 21575 }) 21576), AuthBlock = ({ loginUrl, id }) => { 21577 let [isAuthAttempted, setAuthAttempted] = useState(!1), refresh = useCallback(() => { 21578 globalWindow2.document.location.reload(); 21579 }, []), open = useCallback((e2) => { 21580 e2.preventDefault(); 21581 let childWindow = globalWindow2.open(loginUrl, `storybook_auth_${id}`, "resizable,scrollbars"), timer = setInterval(() => { 21582 childWindow ? childWindow.closed && (clearInterval(timer), setAuthAttempted(!0)) : (logger.error("unable to access loginUrl window"), clearInterval(timer)); 21583 }, 1e3); 21584 }, []); 21585 return react_default.createElement(Contained, null, react_default.createElement(Spaced, null, isAuthAttempted ? react_default.createElement(Fragment, null, react_default.createElement(Text3, null, "Authentication on ", react_default.createElement("strong", null, loginUrl), " concluded. Refresh the page to fetch this Storybook."), react_default.createElement("div", null, react_default.createElement(Button, { ariaLabel: !1, size: "small", variant: "outline", onClick: refresh }, react_default.createElement(SyncIcon, null), "Refresh now"))) : react_default.createElement(Fragment, null, react_default.createElement(Text3, null, "Sign in to browse this Storybook."), react_default.createElement("div", null, react_default.createElement(Button, { size: "small", variant: "outline", onClick: open }, react_default.createElement(LockIcon, null), "Sign in"))))); 21586}, ErrorBlock = ({ error }) => { 21587 let { isMobile: isMobile2 } = useLayout(); 21588 return react_default.createElement(Contained, null, react_default.createElement(Spaced, null, react_default.createElement(TextStyle, null, "Oh no! Something went wrong loading this Storybook.", react_default.createElement("br", null), react_default.createElement( 21589 PopoverProvider, 21590 { 21591 ariaLabel: "Error details", 21592 hasCloseButton: !0, 21593 offset: isMobile2 ? 0 : 8, 21594 placement: isMobile2 ? "bottom-end" : "bottom-start", 21595 popover: react_default.createElement(ErrorDisplay, { isMobile: isMobile2 }, react_default.createElement(ErrorFormatter, { error })) 21596 }, 21597 react_default.createElement(Link, null, "View error ", react_default.createElement(ChevronDownIcon, null)) 21598 ), " ", react_default.createElement(Link, { href: "https://storybook.js.org/docs?ref=ui", cancel: !1, target: "_blank" }, "View docs")))); 21599}, FlexSpaced = styled(Spaced)({ 21600 display: "flex" 21601}), WideSpaced = styled(Spaced)({ 21602 flex: 1 21603}), EmptyBlock = ({ 21604 isMain, 21605 hasEntries, 21606 activeFilterCount 21607}) => { 21608 let api = useStorybookApi(); 21609 return react_default.createElement(Contained, null, react_default.createElement(FlexSpaced, { col: 1 }, react_default.createElement(WideSpaced, null, hasEntries ? react_default.createElement(NoResults2, null, react_default.createElement("strong", null, "No stories found"), activeFilterCount > 0 ? react_default.createElement("small", null, "Your selected filters did not match any stories.") : react_default.createElement("small", null, "Try adding some stories!"), activeFilterCount > 0 ? react_default.createElement( 21610 Button, 21611 { 21612 ariaLabel: !1, 21613 size: "small", 21614 variant: "outline", 21615 onClick: async () => { 21616 await api.setAllTagFilters([], []), await api.resetStatusFilters(); 21617 } 21618 }, 21619 react_default.createElement(SweepIcon, null), 21620 "Clear filters" 21621 ) : null) : isMain ? react_default.createElement(Text3, null, "Oh no! Your Storybook is empty. This can happen when:", react_default.createElement("ul", null, react_default.createElement("li", null, "Your", " ", react_default.createElement( 21622 Link, 21623 { 21624 href: "https://storybook.js.org/docs/api/main-config/main-config-stories?ref=ui", 21625 cancel: !1, 21626 target: "_blank" 21627 }, 21628 "stories glob configuration" 21629 ), " ", "does not match any files.", " "), react_default.createElement("li", null, "You have", " ", react_default.createElement( 21630 Link, 21631 { 21632 href: "https://storybook.js.org/docs/writing-stories?ref=ui", 21633 cancel: !1, 21634 target: "_blank" 21635 }, 21636 "no stories defined" 21637 ), " ", "in your story files.", " "))) : react_default.createElement(Text3, null, "This composed Storybook is empty. Perhaps no stories match your selected filters.")))); 21638}, LoaderBlock = ({ isMain }) => react_default.createElement(Contained, null, react_default.createElement(Loader2, { size: isMain ? 17 : 5 })); 21639 21640// src/manager/components/sidebar/RefIndicator.tsx 21641init_react(); 21642var { document: document4, window: globalWindow3 } = scope, IndicatorPlacement = styled.div(({ theme }) => ({ 21643 height: 16, 21644 display: "flex", 21645 alignItems: "center", 21646 "& > * + *": { 21647 marginLeft: theme.layoutMargin 21648 } 21649})), IndicatorClickTarget = styled(Button)(({ theme }) => ({ 21650 color: theme.textMutedColor, 21651 svg: { 21652 height: 14, 21653 width: 14, 21654 padding: 2, 21655 transition: "all 150ms ease-out", 21656 color: "inherit" 21657 } 21658})), MessageTitle = styled.span(({ theme }) => ({ 21659 fontWeight: theme.typography.weight.bold 21660})), StyledMessage = styled.a(({ theme }) => ({ 21661 textDecoration: "none", 21662 lineHeight: "16px", 21663 padding: 15, 21664 display: "flex", 21665 flexDirection: "row", 21666 alignItems: "flex-start", 21667 color: theme.color.defaultText, 21668 "&:not(:last-child)": { 21669 borderBottom: `1px solid ${theme.appBorderColor}` 21670 }, 21671 "&:hover": { 21672 background: theme.background.hoverable, 21673 color: theme.color.defaultText 21674 }, 21675 "&:link, &:active, &:focus": { 21676 color: theme.color.defaultText 21677 }, 21678 "&:focus-visible": { 21679 background: theme.background.hoverable, 21680 borderRadius: 8, 21681 boxShadow: `inset 0 0 0 2px ${theme.color.secondary}`, 21682 outline: "none" 21683 }, 21684 "& > *": { 21685 flex: 1 21686 }, 21687 "& > svg": { 21688 marginTop: 3, 21689 width: 16, 21690 height: 16, 21691 marginRight: 10, 21692 flex: "unset" 21693 } 21694})), Message2 = ({ href, blank = !0, children, onClick }) => react_default.createElement(StyledMessage, { href, target: blank ? "_blank" : void 0, onClick }, children), MessageWrapper = styled.div( 21695 ({ isMobile: isMobile2 }) => ({ 21696 width: isMobile2 ? "calc(100vw - 20px)" : 280, 21697 boxSizing: "border-box", 21698 borderRadius: 8, 21699 overflow: "hidden" 21700 }), 21701 ({ theme }) => ({ 21702 color: theme.color.dark 21703 }) 21704), SubtleSelect = styled(Select)(({ theme }) => ({ 21705 background: "transparent", 21706 color: theme.color.defaultText, 21707 fontSize: theme.typography.size.s1, 21708 fontWeight: theme.typography.weight.regular 21709})), RefIndicator = react_default.memo( 21710 forwardRef( 21711 ({ state, ...ref }, forwardedRef) => { 21712 let api = useStorybookApi(), { isMobile: isMobile2 } = useLayout(), list = useMemo(() => Object.values(ref.index || {}), [ref.index]), componentCount = useMemo( 21713 () => list.filter((v2) => v2.type === "component").length, 21714 [list] 21715 ), leafCount = useMemo( 21716 () => list.filter((v2) => v2.type === "docs" || v2.type === "story").length, 21717 [list] 21718 ), currentVersion = useMemo(() => { 21719 if (ref.versions) 21720 return Object.entries(ref.versions).find(([, v2]) => v2 === ref.url)?.[0]; 21721 }, [ref.versions, ref.url]); 21722 return react_default.createElement(IndicatorPlacement, { ref: forwardedRef }, react_default.createElement( 21723 PopoverProvider, 21724 { 21725 ariaLabel: "Composed Storybook status", 21726 placement: isMobile2 ? "bottom" : "bottom-start", 21727 padding: 0, 21728 popover: () => react_default.createElement(MessageWrapper, { isMobile: isMobile2 }, react_default.createElement(Spaced, { row: 0 }, state === "loading" && react_default.createElement(LoadingMessage, { url: ref.url }), (state === "error" || state === "empty") && react_default.createElement(ErrorOccurredMessage, { url: ref.url }), state === "ready" && react_default.createElement(react_default.Fragment, null, react_default.createElement(ReadyMessage, { url: ref.url, componentCount, leafCount }), ref.sourceUrl && react_default.createElement(SourceCodeMessage, { url: ref.sourceUrl })), state === "auth" && react_default.createElement(LoginRequiredMessage, { ...ref }), ref.type === "auto-inject" && state !== "error" && react_default.createElement(PerformanceDegradedMessage, null), state !== "loading" && react_default.createElement(ReadDocsMessage, null))) 21729 }, 21730 react_default.createElement( 21731 IndicatorClickTarget, 21732 { 21733 variant: "ghost", 21734 padding: "small", 21735 size: "small", 21736 "data-action": "toggle-indicator", 21737 ariaLabel: "Extra actions" 21738 }, 21739 react_default.createElement(GlobeIcon, null) 21740 ) 21741 ), ref.versions && Object.keys(ref.versions).length ? react_default.createElement(react_default.Fragment, null, react_default.createElement( 21742 SubtleSelect, 21743 { 21744 padding: "small", 21745 size: "small", 21746 ariaLabel: "Version", 21747 tooltip: "Choose version", 21748 defaultOptions: currentVersion, 21749 onSelect: (item) => { 21750 let href = ref.versions?.[item]; 21751 href && api.changeRefVersion(ref.id, href); 21752 }, 21753 options: Object.entries(ref.versions).map(([id, href]) => ({ 21754 value: id, 21755 title: id, 21756 href 21757 })) 21758 }, 21759 "version" 21760 )) : null); 21761 } 21762 ) 21763), ReadyMessage = ({ url, componentCount, leafCount }) => { 21764 let theme = useTheme(); 21765 return react_default.createElement(Message2, { href: url.replace(/\/?$/, "/index.html") }, react_default.createElement(GlobeIcon, { color: theme.color.secondary }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "View external Storybook"), react_default.createElement("div", null, "Explore ", componentCount, " components and ", leafCount, " stories in a new browser tab."))); 21766}, SourceCodeMessage = ({ url }) => { 21767 let theme = useTheme(); 21768 return react_default.createElement(Message2, { href: url }, react_default.createElement(MarkupIcon, { color: theme.color.secondary }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "View source code"))); 21769}, LoginRequiredMessage = ({ loginUrl, id }) => { 21770 let theme = useTheme(), open = useCallback( 21771 (e2) => { 21772 e2.preventDefault(); 21773 let childWindow = globalWindow3.open( 21774 loginUrl, 21775 `storybook_auth_${id}`, 21776 "resizable,scrollbars" 21777 ), timer = setInterval(() => { 21778 childWindow ? childWindow.closed && (clearInterval(timer), document4.location.reload()) : clearInterval(timer); 21779 }, 1e3); 21780 }, 21781 [id, loginUrl] 21782 ); 21783 return react_default.createElement(Message2, { onClick: open, blank: !1 }, react_default.createElement(LockIcon, { color: theme.color.gold }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Log in required"), react_default.createElement("div", null, "You need to authenticate to view this Storybook's components."))); 21784}, ReadDocsMessage = () => { 21785 let theme = useTheme(); 21786 return react_default.createElement(Message2, { href: "https://storybook.js.org/docs/sharing/storybook-composition?ref=ui" }, react_default.createElement(DocumentIcon, { color: theme.color.green }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Read Composition docs"), react_default.createElement("div", null, "Learn how to combine multiple Storybooks into one."))); 21787}, ErrorOccurredMessage = ({ url }) => { 21788 let theme = useTheme(); 21789 return react_default.createElement(Message2, { href: url.replace(/\/?$/, "/index.html") }, react_default.createElement(AlertIcon, { color: theme.color.negative }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Something went wrong"), react_default.createElement("div", null, "This external Storybook didn't load. Debug it in a new tab now."))); 21790}, LoadingMessage = ({ url }) => { 21791 let theme = useTheme(); 21792 return react_default.createElement(Message2, { href: url.replace(/\/?$/, "/index.html") }, react_default.createElement(TimeIcon, { color: theme.color.secondary }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Please wait"), react_default.createElement("div", null, "This Storybook is loading."))); 21793}, PerformanceDegradedMessage = () => { 21794 let theme = useTheme(); 21795 return react_default.createElement(Message2, { href: "https://storybook.js.org/docs/sharing/storybook-composition?ref=ui" }, react_default.createElement(LightningIcon, { color: theme.color.gold }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Reduce lag"), react_default.createElement("div", null, "Learn how to speed up Composition performance."))); 21796}; 21797 21798// src/manager/components/sidebar/Tree.tsx 21799init_react(); 21800 21801// src/manager/utils/status.tsx 21802init_react(); 21803var import_memoizerific4 = __toESM(require_memoizerific(), 1); 21804 21805// src/manager/components/sidebar/IconSymbols.tsx 21806init_react(); 21807var Svg2 = styled.svg` 21808 position: absolute; 21809 width: 0; 21810 height: 0; 21811 display: inline-block; 21812 shape-rendering: inherit; 21813 vertical-align: middle; 21814`, GROUP_ID = "icon--group", COMPONENT_ID = "icon--component", DOCUMENT_ID = "icon--document", STORY_ID = "icon--story", TEST_ID = "icon--test", SUCCESS_ID = "icon--success", ERROR_ID = "icon--error", WARNING_ID = "icon--warning", DOT_ID = "icon--dot", NEW_ID = "icon--new", MODIFIED_ID = "icon--modified", AFFECTED_ID = "icon--affected", REVIEWING_ID = "icon--reviewing", IconSymbols = () => react_default.createElement(Svg2, { "data-chromatic": "ignore" }, react_default.createElement("symbol", { id: GROUP_ID }, react_default.createElement( 21815 "path", 21816 { 21817 fillRule: "evenodd", 21818 clipRule: "evenodd", 21819 d: "M6.586 3.504l-1.5-1.5H1v9h12v-7.5H6.586zm.414-1L5.793 1.297a1 1 0 00-.707-.293H.5a.5.5 0 00-.5.5v10a.5.5 0 00.5.5h13a.5.5 0 00.5-.5v-8.5a.5.5 0 00-.5-.5H7z", 21820 fill: "currentColor" 21821 } 21822)), react_default.createElement("symbol", { id: COMPONENT_ID }, react_default.createElement( 21823 "path", 21824 { 21825 fillRule: "evenodd", 21826 clipRule: "evenodd", 21827 d: "M3.5 1.004a2.5 2.5 0 00-2.5 2.5v7a2.5 2.5 0 002.5 2.5h7a2.5 2.5 0 002.5-2.5v-7a2.5 2.5 0 00-2.5-2.5h-7zm8.5 5.5H7.5v-4.5h3a1.5 1.5 0 011.5 1.5v3zm0 1v3a1.5 1.5 0 01-1.5 1.5h-3v-4.5H12zm-5.5 4.5v-4.5H2v3a1.5 1.5 0 001.5 1.5h3zM2 6.504h4.5v-4.5h-3a1.5 1.5 0 00-1.5 1.5v3z", 21828 fill: "currentColor" 21829 } 21830)), react_default.createElement("symbol", { id: DOCUMENT_ID }, react_default.createElement( 21831 "path", 21832 { 21833 d: "M4 5.5a.5.5 0 01.5-.5h5a.5.5 0 010 1h-5a.5.5 0 01-.5-.5zM4.5 7.5a.5.5 0 000 1h5a.5.5 0 000-1h-5zM4 10.5a.5.5 0 01.5-.5h5a.5.5 0 010 1h-5a.5.5 0 01-.5-.5z", 21834 fill: "currentColor" 21835 } 21836), react_default.createElement( 21837 "path", 21838 { 21839 fillRule: "evenodd", 21840 clipRule: "evenodd", 21841 d: "M1.5 0a.5.5 0 00-.5.5v13a.5.5 0 00.5.5h11a.5.5 0 00.5-.5V3.207a.5.5 0 00-.146-.353L10.146.146A.5.5 0 009.793 0H1.5zM2 1h7.5v2a.5.5 0 00.5.5h2V13H2V1z", 21842 fill: "currentColor" 21843 } 21844)), react_default.createElement("symbol", { id: STORY_ID }, react_default.createElement( 21845 "path", 21846 { 21847 fillRule: "evenodd", 21848 clipRule: "evenodd", 21849 d: "M3.5 0h7a.5.5 0 01.5.5v13a.5.5 0 01-.454.498.462.462 0 01-.371-.118L7 11.159l-3.175 2.72a.46.46 0 01-.379.118A.5.5 0 013 13.5V.5a.5.5 0 01.5-.5zM4 12.413l2.664-2.284a.454.454 0 01.377-.128.498.498 0 01.284.12L10 12.412V1H4v11.413z", 21850 fill: "currentColor" 21851 } 21852)), react_default.createElement("symbol", { id: TEST_ID }, react_default.createElement( 21853 "path", 21854 { 21855 fillRule: "evenodd", 21856 clipRule: "evenodd", 21857 d: "M4.5 2h.75v3.866l-3.034 5.26A1.25 1.25 0 003.299 13H10.7a1.25 1.25 0 001.083-1.875L8.75 5.866V2h.75a.5.5 0 100-1h-5a.5.5 0 000 1zm1.75 4V2h1.5v4.134l.067.116L8.827 8H5.173l1.01-1.75.067-.116V6zM4.597 9l-1.515 2.625A.25.25 0 003.3 12H10.7a.25.25 0 00.217-.375L9.404 9H4.597z", 21858 fill: "currentColor" 21859 } 21860)), react_default.createElement("symbol", { id: SUCCESS_ID }, react_default.createElement( 21861 "path", 21862 { 21863 fillRule: "evenodd", 21864 clipRule: "evenodd", 21865 d: "M10.854 4.146a.5.5 0 010 .708l-5 5a.5.5 0 01-.708 0l-2-2a.5.5 0 11.708-.708L5.5 8.793l4.646-4.647a.5.5 0 01.708 0z", 21866 fill: "currentColor" 21867 } 21868)), react_default.createElement("symbol", { id: ERROR_ID }, react_default.createElement( 21869 "path", 21870 { 21871 fillRule: "evenodd", 21872 clipRule: "evenodd", 21873 d: "M7 4a3 3 0 100 6 3 3 0 000-6zM3 7a4 4 0 118 0 4 4 0 01-8 0z", 21874 fill: "currentColor" 21875 } 21876)), react_default.createElement("symbol", { id: WARNING_ID }, react_default.createElement( 21877 "path", 21878 { 21879 fillRule: "evenodd", 21880 clipRule: "evenodd", 21881 d: "M7.206 3.044a.498.498 0 01.23.212l3.492 5.985a.494.494 0 01.006.507.497.497 0 01-.443.252H3.51a.499.499 0 01-.437-.76l3.492-5.984a.497.497 0 01.642-.212zM7 4.492L4.37 9h5.26L7 4.492z", 21882 fill: "currentColor" 21883 } 21884)), react_default.createElement("symbol", { id: DOT_ID }, react_default.createElement("circle", { cx: "3", cy: "3", r: "3", fill: "currentColor" })), react_default.createElement("symbol", { id: NEW_ID }, react_default.createElement("rect", { x: "6", y: "3.5", width: "2", height: "7", rx: "1", fill: "currentColor" }), react_default.createElement("rect", { x: "3.5", y: "6", width: "7", height: "2", rx: "1", fill: "currentColor" })), react_default.createElement("symbol", { id: MODIFIED_ID }, react_default.createElement("circle", { cx: "7", cy: "7", r: "3", fill: "currentColor" })), react_default.createElement("symbol", { id: AFFECTED_ID }, react_default.createElement("circle", { cx: "7", cy: "7", r: "3", fill: "currentColor" })), react_default.createElement("symbol", { id: REVIEWING_ID }, react_default.createElement( 21885 "path", 21886 { 21887 d: "M7.052 3.004c.01 0 .02 0 .03.002.004 0 .01.003.015.004a.493.493 0 01.051.013l.043.015a.497.497 0 01.089.049l.03.023c.015.012.029.023.042.036.012.012.023.026.035.04l.023.03c.01.015.019.03.027.047.008.014.016.028.022.043.006.014.01.028.015.043.005.017.01.034.013.051l.005.017.03.182A3.5 3.5 0 0010.4 6.476l.182.03c.005 0 .01.003.016.004a.494.494 0 01.051.013l.043.015a.503.503 0 01.089.049l.03.023c.015.012.029.023.042.036.012.012.023.026.035.04l.023.03c.01.015.019.03.027.047.008.014.016.028.022.043l.014.04.014.054.005.017c.002.01 0 .019.001.028.002.018.004.036.004.054 0 .018-.002.035-.004.053v.03l-.006.015a.479.479 0 01-.013.051l-.015.043a.507.507 0 01-.049.089l-.023.03-.035.042-.042.035-.03.023a.503.503 0 01-.046.027c-.014.008-.028.016-.043.022-.014.006-.028.01-.043.015a.491.491 0 01-.051.013l-.016.005-.182.03A3.5 3.5 0 007.522 10.4l-.03.182c0 .005-.004.01-.005.016a.491.491 0 01-.013.051l-.015.043a.503.503 0 01-.049.089l-.023.03-.035.042-.041.035-.03.023a.507.507 0 01-.047.027c-.014.008-.028.016-.043.022-.014.006-.028.01-.043.015a.479.479 0 01-.051.013l-.016.005c-.01.002-.02 0-.03.001-.017.002-.034.004-.052.004-.018 0-.036-.002-.054-.004h-.028c-.006-.002-.011-.005-.017-.006a.503.503 0 01-.051-.013l-.043-.015a.505.505 0 01-.089-.049l-.03-.023c-.015-.012-.029-.023-.041-.035-.013-.013-.024-.027-.036-.042l-.023-.03a.503.503 0 01-.027-.046c-.008-.014-.016-.028-.022-.043-.006-.014-.01-.028-.015-.043a.494.494 0 01-.013-.051l-.004-.016-.03-.182a3.5 3.5 0 00-2.877-2.877l-.182-.03c-.006 0-.011-.004-.017-.005a.493.493 0 01-.051-.013l-.043-.015a.492.492 0 01-.089-.049l-.03-.023c-.015-.012-.029-.023-.041-.035-.013-.013-.024-.027-.036-.041l-.023-.03a.497.497 0 01-.027-.047c-.008-.014-.016-.028-.022-.043-.006-.013-.01-.028-.015-.043a.493.493 0 01-.013-.051l-.004-.016c-.002-.01-.001-.02-.002-.03C3.002 7.035 3 7.018 3 7c0-.018.002-.036.004-.054 0-.009 0-.019.002-.028 0-.006.003-.011.004-.017l.015-.054.013-.04a.498.498 0 01.049-.089l.023-.03.026-.032.02-.02.03-.025.03-.023a.498.498 0 01.047-.027c.014-.008.028-.016.043-.022.014-.006.028-.01.043-.015A.493.493 0 013.4 6.51l.017-.004.182-.03a3.5 3.5 0 002.877-2.877l.03-.182c0-.006.003-.011.004-.017a.493.493 0 01.013-.051l.015-.043a.498.498 0 01.049-.089l.023-.03.026-.032.02-.02.03-.025.03-.023a.498.498 0 01.047-.027c.014-.008.028-.016.043-.022.014-.006.028-.01.043-.015A.493.493 0 016.9 3.01l.017-.004c.01-.002.019-.001.028-.002C6.963 3.002 6.981 3 7 3c.018 0 .035.002.053.004z", 21888 fill: "currentColor" 21889 } 21890))), UseSymbol = ({ type }) => type === "group" ? react_default.createElement("use", { xlinkHref: `#${GROUP_ID}` }) : type === "component" ? react_default.createElement("use", { xlinkHref: `#${COMPONENT_ID}` }) : type === "document" ? react_default.createElement("use", { xlinkHref: `#${DOCUMENT_ID}` }) : type === "story" ? react_default.createElement("use", { xlinkHref: `#${STORY_ID}` }) : type === "test" ? react_default.createElement("use", { xlinkHref: `#${TEST_ID}` }) : type === "success" ? react_default.createElement("use", { xlinkHref: `#${SUCCESS_ID}` }) : type === "error" ? react_default.createElement("use", { xlinkHref: `#${ERROR_ID}` }) : type === "warning" ? react_default.createElement("use", { xlinkHref: `#${WARNING_ID}` }) : type === "dot" ? react_default.createElement("use", { xlinkHref: `#${DOT_ID}` }) : type === "new" ? react_default.createElement("use", { xlinkHref: `#${NEW_ID}` }) : type === "reviewing" ? react_default.createElement("use", { xlinkHref: `#${REVIEWING_ID}` }) : type === "modified" ? react_default.createElement("use", { xlinkHref: `#${MODIFIED_ID}` }) : type === "affected" ? react_default.createElement("use", { xlinkHref: `#${AFFECTED_ID}` }) : null; 21891 21892// src/manager/utils/status.tsx 21893var SmallIcons = styled(CircleIcon)({ 21894 // specificity hack 21895 "&&&": { 21896 width: 6, 21897 height: 6 21898 } 21899}), LoadingIcons = styled(SmallIcons)(({ theme: { animation } }) => ({ 21900 // specificity hack 21901 animation: `${animation.glow} 1.5s ease-in-out infinite` 21902})), statusPriority = [ 21903 "status-value:unknown", 21904 "status-value:pending", 21905 "status-value:success", 21906 "status-value:affected", 21907 "status-value:reviewing", 21908 "status-value:modified", 21909 "status-value:new", 21910 "status-value:warning", 21911 "status-value:error" 21912], getStatus = (0, import_memoizerific4.default)(10)((theme, status) => { 21913 let defaultIconColor = theme.base === "light" ? curriedTransparentize$1(0.3, theme.color.defaultText) : curriedTransparentize$1(0.6, theme.color.defaultText); 21914 return { 21915 "status-value:unknown": { 21916 icon: null, 21917 iconColor: defaultIconColor, 21918 textColor: null 21919 }, 21920 "status-value:pending": { 21921 icon: react_default.createElement(LoadingIcons, { key: "icon" }), 21922 iconColor: defaultIconColor, 21923 textColor: "currentColor" 21924 }, 21925 "status-value:success": { 21926 icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "success" })), 21927 iconColor: theme.color.positive, 21928 textColor: "currentColor" 21929 }, 21930 "status-value:new": { 21931 icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "new" })), 21932 iconColor: theme.fgColor.accent, 21933 textColor: null 21934 }, 21935 "status-value:modified": { 21936 icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "modified" })), 21937 iconColor: theme.fgColor.accent, 21938 textColor: null 21939 }, 21940 "status-value:affected": { 21941 icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "affected" })), 21942 iconColor: theme.fgColor.accent, 21943 textColor: null 21944 }, 21945 "status-value:reviewing": { 21946 icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "reviewing" })), 21947 iconColor: theme.fgColor.agentic, 21948 textColor: null 21949 }, 21950 "status-value:warning": { 21951 icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "warning" })), 21952 iconColor: theme.color.warning, 21953 textColor: theme.fgColor.warning 21954 }, 21955 "status-value:error": { 21956 icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "error" })), 21957 iconColor: theme.color.negative, 21958 textColor: theme.fgColor.negative 21959 } 21960 }[status]; 21961}), shouldShowChangeStatus = (changeStatus, isModifiedFilterActive) => changeStatus !== "status-value:unknown" && changeStatus !== "status-value:affected" && (changeStatus !== "status-value:modified" || isModifiedFilterActive), isAggregatedTestStatus = (status) => !NON_AGGREGATED_STATUS_TYPE_IDS.includes(status.typeId); 21962function getSidebarVisibleStatus({ 21963 theme, 21964 item, 21965 statuses, 21966 groupDualStatus, 21967 isModifiedFilterActive 21968}) { 21969 let statusByType = statuses ?? {}; 21970 if (item.type === "group" || item.type === "component" || item.type === "story" && item.children && item.children.length > 0) { 21971 let { changeStatus: localChange, testStatus: localTest } = getChangeDetectionStatus(statusByType), groupDual = groupDualStatus?.[item.id] ?? { 21972 change: "status-value:unknown", 21973 test: "status-value:unknown" 21974 }, branchChange = getMostCriticalStatusValue([localChange, groupDual.change]), branchTest = getMostCriticalStatusValue([localTest, groupDual.test]); 21975 return shouldShowChangeStatus(branchChange, isModifiedFilterActive) ? { icon: getStatus(theme, branchChange).icon, status: branchChange } : { icon: getStatus(theme, branchTest).icon, status: branchTest }; 21976 } 21977 if (item.type === "story" && !(item.children && item.children.length > 0) && item.subtype !== "test" || item.type === "docs") { 21978 let { changeStatus, testStatus } = getChangeDetectionStatus(statusByType); 21979 return shouldShowChangeStatus(changeStatus, isModifiedFilterActive) ? { icon: getStatus(theme, changeStatus).icon, status: changeStatus } : { icon: getStatus(theme, testStatus).icon, status: testStatus }; 21980 } 21981 let leafStatuses = Object.values(statusByType).filter( 21982 (status) => isAggregatedTestStatus(status) || status.value === "status-value:new" 21983 ), leafStatus = getMostCriticalStatusValue(leafStatuses.map((s2) => s2.value)); 21984 return { icon: getStatus(theme, leafStatus).icon, status: leafStatus }; 21985} 21986function getChangeDetectionStatus(statuses) { 21987 let changeValues = Object.values(statuses).filter((status) => status.typeId === CHANGE_DETECTION_STATUS_TYPE_ID).map((status) => status.value), testValues = Object.values(statuses).filter(isAggregatedTestStatus).map((status) => status.value); 21988 return { 21989 changeStatus: getMostCriticalStatusValue(changeValues), 21990 testStatus: getMostCriticalStatusValue(testValues) 21991 }; 21992} 21993var getMostCriticalStatusValue = (statusValues) => statusPriority.reduce( 21994 (acc, value) => statusValues.includes(value) ? value : acc, 21995 "status-value:unknown" 21996), statusesExcludingReview = (statuses) => statuses.filter((status) => status.typeId !== REVIEW_STATUS_TYPE_ID); 21997function getGroupStatus(collapsedData, allStatuses) { 21998 return Object.values(collapsedData).reduce((acc, item) => { 21999 if (item.type === "group" || item.type === "component" || item.type === "story") { 22000 let leafs = getDescendantIds(collapsedData, item.id, !1).map((id) => collapsedData[id]).filter((i2) => i2.type === "story"), combinedStatus = getMostCriticalStatusValue( 22001 statusesExcludingReview( 22002 leafs.flatMap( 22003 (story) => Object.values(allStatuses[story.id] || {}) 22004 ) 22005 ).map((s2) => s2.value) 22006 ); 22007 combinedStatus && (acc[item.id] = combinedStatus); 22008 } 22009 return acc; 22010 }, {}); 22011} 22012function getGroupDualStatus(collapsedData, allStatuses) { 22013 return Object.values(collapsedData).reduce((acc, item) => { 22014 if (item.type === "group" || item.type === "component" || item.type === "story") { 22015 let allDescendantStatuses = getDescendantIds(collapsedData, item.id, !1).map((id) => collapsedData[id]).filter((i2) => i2.type === "story").flatMap( 22016 (story) => Object.values(allStatuses[story.id] || {}) 22017 ), changeValues = allDescendantStatuses.filter((s2) => s2.typeId === CHANGE_DETECTION_STATUS_TYPE_ID).map((s2) => s2.value), testValues = allDescendantStatuses.filter(isAggregatedTestStatus).map((s2) => s2.value); 22018 acc[item.id] = { 22019 change: getMostCriticalStatusValue(changeValues), 22020 test: getMostCriticalStatusValue(testValues) 22021 }; 22022 } 22023 return acc; 22024 }, {}); 22025} 22026 22027// src/manager/components/sidebar/ContextMenu.tsx 22028init_react(); 22029 22030// src/manager/components/sidebar/StatusButton.tsx 22031init_react(); 22032var withStatusColor = ({ theme, status }) => ({ 22033 color: getStatus(theme, status).iconColor ?? void 0 22034}), StatusLabel = styled.div(withStatusColor, { 22035 margin: 3 22036}), StyledButton = styled(Button)( 22037 withStatusColor, 22038 ({ theme, height, width }) => ({ 22039 transition: "none", 22040 display: "inline-flex", 22041 alignItems: "center", 22042 justifyContent: "center", 22043 width: width || 28, 22044 height: height || 28, 22045 "&:hover": { 22046 color: theme.color.secondary, 22047 background: theme.base === "dark" ? curriedDarken$1(0.3, theme.color.secondary) : curriedLighten$1(0.4, theme.color.secondary) 22048 }, 22049 '[data-selected="true"] &': { 22050 background: theme.base === "dark" ? curriedDarken$1(0.18, theme.color.secondary) : theme.color.secondary, 22051 boxShadow: `0 0 5px 5px ${theme.base === "dark" ? curriedDarken$1(0.18, theme.color.secondary) : theme.color.secondary}`, 22052 "&:hover": { 22053 background: theme.base === "dark" ? curriedDarken$1(0.1, theme.color.secondary) : theme.color.secondary 22054 } 22055 }, 22056 "&:focus": { 22057 color: theme.color.secondary, 22058 borderColor: theme.color.secondary, 22059 outlineOffset: -2, 22060 "&:not(:focus-visible)": { 22061 borderColor: "transparent" 22062 } 22063 } 22064 }), 22065 ({ theme, selectedItem }) => selectedItem && { 22066 "&:hover": { 22067 boxShadow: `inset 0 0 0 2px ${theme.color.secondary}`, 22068 background: "rgba(255, 255, 255, 0.2)" 22069 } 22070 } 22071), StatusButton = forwardRef((props, ref) => react_default.createElement(StyledButton, { variant: "ghost", padding: "small", ...props, ref })); 22072StatusButton.displayName = "StatusButton"; 22073 22074// src/manager/components/sidebar/ContextMenu.tsx 22075var empty = { 22076 onMouseEnter: () => { 22077 }, 22078 node: null 22079}, FloatingStatusButton = styled(StatusButton)({ 22080 background: "var(--tree-node-background-hover)", 22081 boxShadow: "0 0 5px 5px var(--tree-node-background-hover)", 22082 position: "absolute", 22083 right: 0, 22084 zIndex: 1, 22085 "&:focus-visible": { 22086 outlineOffset: -2 22087 } 22088}), useContextMenu = (context, links, api, visibleStatus) => { 22089 let [hoverCount, setHoverCount] = useState(0), [isOpen, setIsOpen] = useState(!1), exportName = context && "exportName" in context ? context.exportName ?? "" : "", { children: copyText, buttonProps: copyButtonProps } = useCopyButton2({ 22090 children: "Copy story name", 22091 content: exportName 22092 }), openInEditorShortcut = api.getShortcutKeys()?.openInEditor, topLinks = useMemo(() => { 22093 let defaultLinks = []; 22094 return context && "importPath" in context && context.importPath && defaultLinks.push({ 22095 id: "open-in-editor", 22096 title: "Open in editor", 22097 icon: react_default.createElement(EditorIcon, null), 22098 right: openInEditorShortcut ? react_default.createElement(Shortcut, { keys: openInEditorShortcut }) : null, 22099 onClick: (e2) => { 22100 context.importPath && (e2.preventDefault(), api.openInEditor({ file: context.importPath })); 22101 } 22102 }), context.type === "story" && defaultLinks.push({ 22103 id: "copy-story-name", 22104 title: copyText, 22105 icon: react_default.createElement(CopyIcon, null), 22106 // TODO: bring this back once we want to add shortcuts for this 22107 // right: 22108 // enableShortcuts && shortcutKeys.copyStoryName ? ( 22109 // <Shortcut keys={shortcutKeys.copyStoryName} /> 22110 // ) : null, 22111 onClick: (e2) => { 22112 e2.preventDefault(), copyButtonProps.onClick(e2); 22113 } 22114 }), defaultLinks; 22115 }, [api, context, copyText, copyButtonProps, openInEditorShortcut]), handlers = useMemo(() => ({ 22116 onMouseEnter: () => { 22117 setHoverCount((c2) => c2 + 1); 22118 }, 22119 onOpen: (event) => { 22120 event.stopPropagation(), setIsOpen(!0); 22121 }, 22122 onClose: () => { 22123 setIsOpen(!1); 22124 } 22125 }), []), providerLinks = useMemo(() => { 22126 let registeredTestProviders = api.getElements(Addon_TypesEnum.experimental_TEST_PROVIDER); 22127 return hoverCount ? generateTestProviderLinks(registeredTestProviders, context) : []; 22128 }, [api, context, hoverCount]), shouldRender = !context.refId && (providerLinks.length > 0 || links.length > 0 || topLinks.length > 0), buttonStatus = visibleStatus?.status ?? "status-value:unknown", menuIcon = visibleStatus?.icon ?? react_default.createElement(EllipsisIcon, null); 22129 return useMemo(() => globalThis.CONFIG_TYPE !== "DEVELOPMENT" ? empty : { 22130 onMouseEnter: handlers.onMouseEnter, 22131 node: shouldRender ? react_default.createElement( 22132 PopoverProvider, 22133 { 22134 ariaLabel: "Context menu", 22135 placement: "bottom-end", 22136 defaultVisible: !1, 22137 visible: isOpen, 22138 onVisibleChange: setIsOpen, 22139 popover: react_default.createElement(LiveContextMenu, { context, links: [...topLinks, ...links] }), 22140 hasChrome: !0, 22141 padding: 0 22142 }, 22143 react_default.createElement( 22144 FloatingStatusButton, 22145 { 22146 "data-displayed": isOpen ? "on" : "off", 22147 "data-testid": "context-menu", 22148 ariaLabel: "Open context menu", 22149 type: "button", 22150 status: buttonStatus, 22151 onClick: handlers.onOpen 22152 }, 22153 menuIcon 22154 ) 22155 ) : null 22156 }, [context, handlers, isOpen, shouldRender, links, topLinks, buttonStatus, menuIcon]); 22157}, LiveContextMenu = ({ 22158 context, 22159 links, 22160 ...rest2 22161}) => { 22162 let registeredTestProviders = useStorybookApi().getElements( 22163 Addon_TypesEnum.experimental_TEST_PROVIDER 22164 ), providerLinks = generateTestProviderLinks(registeredTestProviders, context), all = (Array.isArray(links[0]) || links.length === 0 ? links : [links]).concat([providerLinks]); 22165 return react_default.createElement(TooltipLinkList, { ...rest2, links: all }); 22166}; 22167function generateTestProviderLinks(registeredTestProviders, context) { 22168 return Object.entries(registeredTestProviders).map(([testProviderId, state]) => { 22169 if (!state) 22170 return null; 22171 let content = state.sidebarContextMenu?.({ context }); 22172 return content ? { 22173 id: testProviderId, 22174 content 22175 } : null; 22176 }).filter(Boolean); 22177} 22178 22179// src/manager/components/sidebar/StatusContext.tsx 22180init_react(); 22181var StatusContext = createContext({}); 22182 22183// src/manager/components/sidebar/TreeNode.tsx 22184init_react(); 22185 22186// src/manager/components/sidebar/components/CollapseIcon.tsx 22187init_react(); 22188var CollapseIconWrapper = styled.div(({ theme, isExpanded }) => ({ 22189 width: 8, 22190 height: 8, 22191 display: "flex", 22192 justifyContent: "center", 22193 alignItems: "center", 22194 transform: isExpanded ? "rotateZ(90deg)" : "none", 22195 transition: "transform .1s ease-out", 22196 color: theme.textMutedColor 22197})), CollapseIcon2 = (props) => react_default.createElement(CollapseIconWrapper, { ...props }, react_default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "8", height: "8", fill: "none" }, react_default.createElement( 22198 "path", 22199 { 22200 fill: "currentColor", 22201 fillRule: "evenodd", 22202 clipRule: "evenodd", 22203 d: "M1.896 7.146a.5.5 0 1 0 .708.708l3.5-3.5a.5.5 0 0 0 0-.708l-3.5-3.5a.5.5 0 1 0-.708.708L5.043 4 1.896 7.146Z" 22204 } 22205))); 22206 22207// src/manager/components/sidebar/TreeNode.tsx 22208var TypeIcon2 = styled.svg(
22208 22209 ({ theme, type }) => ({ 22210 width: 14, 22211 height: 14, 22212 flex: "0 0 auto", 22213 color: type === "group" ? theme.base === "dark" ? theme.color.primary : theme.color.ultraviolet : type === "component" ? theme.color.secondary : type === "document" ? theme.base === "dark" ? theme.color.gold : "#ff8300" : type === "story" ? theme.color.seafoam : type === "test" ? theme.color.green : "currentColor" 22214 })
vendor: 5,338 bytes, lines 22215-22335
22215), commonNodeStyles = ({ 22216 theme, 22217 depth = 0, 22218 isExpandable = !1 22219}) => ({ 22220 flex: 1, 22221 width: "100%", 22222 cursor: "pointer", 22223 display: "flex", 22224 alignItems: "start", 22225 textAlign: "left", 22226 textDecoration: "none", 22227 border: "none", 22228 color: "inherit", 22229 fontSize: `${theme.typography.size.s2}px`, 22230 fontWeight: "inherit", 22231 background: "transparent", 22232 minHeight: 28, 22233 borderRadius: 4, 22234 gap: 6, 22235 paddingLeft: `${(isExpandable ? 8 : 22) + depth * 18}px`, 22236 paddingTop: 5, 22237 paddingBottom: 4, 22238 paddingRight: 6, 22239 overflowWrap: "break-word", 22240 wordWrap: "break-word", 22241 wordBreak: "break-word" 22242}), BranchNode = styled.button(commonNodeStyles), LeafNode = styled.a(commonNodeStyles), RootNode = styled.div({ 22243 display: "flex", 22244 alignItems: "center", 22245 justifyContent: "space-between", 22246 marginTop: 16, 22247 marginBottom: 4, 22248 "&:first-of-type": { 22249 marginTop: 0 22250 } 22251}), Wrapper5 = styled.div({ 22252 display: "flex", 22253 alignItems: "center", 22254 gap: 6, 22255 marginTop: 2 22256}), GroupNode = react_default.memo(function({ 22257 children, 22258 isExpanded = !1, 22259 isExpandable = !1, 22260 ...props 22261}) { 22262 return react_default.createElement(BranchNode, { isExpandable, tabIndex: -1, ...props }, react_default.createElement(Wrapper5, null, isExpandable && react_default.createElement(CollapseIcon2, { isExpanded }), react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "14", height: "14", type: "group" }, react_default.createElement(UseSymbol, { type: "group" }))), children); 22263}), ComponentNode = react_default.memo( 22264 function({ 22265 theme, 22266 children, 22267 isExpanded = !1, 22268 isExpandable = !1, 22269 isSelected, 22270 ...props 22271 }) { 22272 return react_default.createElement(BranchNode, { isExpandable, tabIndex: -1, ...props }, react_default.createElement(Wrapper5, null, isExpandable && react_default.createElement(CollapseIcon2, { isExpanded }), react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "component" }, react_default.createElement(UseSymbol, { type: "component" }))), children); 22273 } 22274), DocumentNode = react_default.memo(function({ theme, children, docsMode, ...props }) { 22275 return react_default.createElement(LeafNode, { tabIndex: -1, rel: "canonical", ...props }, react_default.createElement(Wrapper5, null, react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "document" }, react_default.createElement(UseSymbol, { type: "document" }))), children); 22276}), StoryBranchNode = react_default.memo( 22277 function({ 22278 theme, 22279 children, 22280 isExpandable = !1, 22281 isExpanded = !1, 22282 isSelected, 22283 ...props 22284 }) { 22285 return react_default.createElement(BranchNode, { isExpandable, tabIndex: -1, ...props }, react_default.createElement(Wrapper5, null, isExpandable && react_default.createElement(CollapseIcon2, { isExpanded }), react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "story" }, react_default.createElement(UseSymbol, { type: "story" }))), children); 22286 } 22287), StoryLeafNode = react_default.memo(function({ 22288 theme, 22289 children, 22290 ...props 22291}) { 22292 return react_default.createElement(LeafNode, { tabIndex: -1, rel: "canonical", ...props }, react_default.createElement(Wrapper5, null, react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "story" }, react_default.createElement(UseSymbol, { type: "story" }))), children); 22293}), TestNode = react_default.memo(function({ 22294 theme, 22295 children, 22296 ...props 22297}) { 22298 return react_default.createElement(LeafNode, { tabIndex: -1, rel: "canonical", ...props }, react_default.createElement(Wrapper5, null, react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "test" }, react_default.createElement(UseSymbol, { type: "test" }))), children); 22299}); 22300 22301// src/manager/components/sidebar/useExpanded.ts 22302init_react(); 22303 22304// src/manager/keybinding.ts 22305var codeToKeyMap = { 22306 // event.code => event.key 22307 Space: " ", 22308 Slash: "/", 22309 ArrowLeft: "ArrowLeft", 22310 ArrowUp: "ArrowUp", 22311 ArrowRight: "ArrowRight", 22312 ArrowDown: "ArrowDown", 22313 Escape: "Escape", 22314 Enter: "Enter" 22315}, allFalse = { alt: !1, ctrl: !1, meta: !1, shift: !1 }, matchesModifiers = (modifiers2, event) => { 22316 let { alt, ctrl, meta, shift: shift2 } = modifiers2 === !1 ? allFalse : modifiers2; 22317 return !(typeof alt == "boolean" && alt !== event.altKey || typeof ctrl == "boolean" && ctrl !== event.ctrlKey || typeof meta == "boolean" && meta !== event.metaKey || typeof shift2 == "boolean" && shift2 !== event.shiftKey); 22318}, matchesKeyCode = (code, event) => event.code ? event.code === code : event.key === codeToKeyMap[code]; 22319 22320// src/manager/components/sidebar/useExpanded.ts 22321var { document: document5 } = scope, initializeExpanded = ({ 22322 refId, 22323 data, 22324 initialExpanded, 22325 highlightedRef, 22326 rootIds, 22327 selectedStoryId 22328}) => { 22329 let selectedStory = selectedStoryId && data[selectedStoryId], candidates = [...rootIds]; 22330 return highlightedRef.current?.refId === refId && candidates.push(...getAncestorIds2(data, highlightedRef.current?.itemId)), selectedStory && "children" in selectedStory && selectedStory.children?.length && candidates.push(selectedStoryId), candidates.reduce( 22331 // @ts-expect-error (non strict) 22332 (acc, id) => Object.assign(acc, { [id]: id in initialExpanded ? initialExpanded[id] : !0 }), 22333 {} 22334 ); 22335}, noop
vendor: 1,816 bytes, lines 22335-22383
223353 = () => { 22336}, useExpanded = ({ 22337 containerRef, 22338 isBrowsing, 22339 refId, 22340 data, 22341 initialExpanded, 22342 rootIds, 22343 highlightedRef, 22344 setHighlightedItemId, 22345 selectedStoryId, 22346 onSelectStoryId 22347}) => { 22348 let api = useStorybookApi(), [expanded, setExpanded] = useReducer( 22349 (state, { ids, value }) => ids.reduce((acc, id) => Object.assign(acc, { [id]: value }), { ...state }), 22350 // @ts-expect-error (non strict) 22351 { refId, data, highlightedRef, rootIds, initialExpanded, selectedStoryId }, 22352 initializeExpanded 22353 ), getElementByDataItemId = useCallback( 22354 (id) => containerRef.current?.querySelector(`[data-item-id="${id}"]`), 22355 [containerRef] 22356 ), highlightElement = useCallback( 22357 (element) => { 22358 setHighlightedItemId(element.getAttribute("data-item-id")), scrollIntoView(element); 22359 }, 22360 [setHighlightedItemId] 22361 ), updateExpanded = useCallback( 22362 ({ ids, value }) => { 22363 if (setExpanded({ ids, value }), ids.length === 1) { 22364 let element = containerRef.current?.querySelector( 22365 `[data-item-id="${ids[0]}"][data-ref-id="${refId}"]` 22366 ); 22367 element && highlightElement(element); 22368 } 22369 }, 22370 [containerRef, highlightElement, refId] 22371 ); 22372 useEffect(() => { 22373 setExpanded({ ids: getAncestorIds2(data, selectedStoryId), value: !0 }); 22374 }, [data, selectedStoryId]); 22375 let collapseAll = useCallback(() => { 22376 let ids = Object.keys(data).filter((id) => !rootIds.includes(id)); 22377 setExpanded({ ids, value: !1 }); 22378 }, [data, rootIds]), expandAll = useCallback(() => { 22379 setExpanded({ ids: Object.keys(data), value: !0 }); 22380 }, [data]); 22381 return useEffect(() => api ? (api.on(STORIES_COLLAPSE_ALL, collapseAll), api.on(STORIES_EXPAND_ALL, expandAll), () => { 22382 api.off(STORIES_COLLAPSE_ALL, collapseAll), api.off(STORIES_EXPAND_ALL, expandAll); 22383 }) : noop3
vendor: 5,062 bytes, lines 22383-22521
22383, [api, collapseAll, expandAll]), useEffect(() => { 22384 let menuElement = document5.getElementById("storybook-explorer-menu"), navigateTree = throttle((event) => { 22385 let highlightedItemId = highlightedRef.current?.refId === refId && highlightedRef.current?.itemId; 22386 if (!isBrowsing || !containerRef.current || !highlightedItemId || event.repeat || !matchesModifiers(!1, event)) 22387 return; 22388 let isEnter = matchesKeyCode("Enter", event), isSpace = matchesKeyCode("Space", event), isArrowLeft = matchesKeyCode("ArrowLeft", event), isArrowRight = matchesKeyCode("ArrowRight", event); 22389 if (!(isEnter || isSpace || isArrowLeft || isArrowRight)) 22390 return; 22391 let highlightedElement = getElementByDataItemId(highlightedItemId); 22392 if (!highlightedElement || highlightedElement.getAttribute("data-ref-id") !== refId) 22393 return; 22394 let target = event.target; 22395 if (!isAncestor(menuElement, target) && !isAncestor(target, menuElement)) 22396 return; 22397 if (target.hasAttribute("data-action")) { 22398 if (isEnter || isSpace) 22399 return; 22400 target.blur(); 22401 } 22402 let type = highlightedElement.getAttribute("data-nodetype"); 22403 type && (isEnter || isSpace) && ["component", "story", "document", "test"].includes(type) && onSelectStoryId(highlightedItemId); 22404 let isExpanded = highlightedElement.getAttribute("aria-expanded"); 22405 if (isArrowLeft) { 22406 if (isExpanded === "true") { 22407 setExpanded({ ids: [highlightedItemId], value: !1 }); 22408 return; 22409 } 22410 let parentId = highlightedElement.getAttribute("data-parent-id"), parentElement = parentId && getElementByDataItemId(parentId); 22411 if (parentElement && parentElement.getAttribute("data-highlightable") === "true") { 22412 highlightElement(parentElement); 22413 return; 22414 } 22415 setExpanded({ ids: getDescendantIds(data, highlightedItemId, !0), value: !1 }); 22416 return; 22417 } 22418 isArrowRight && (isExpanded === "false" ? updateExpanded({ ids: [highlightedItemId], value: !0 }) : isExpanded === "true" && updateExpanded({ ids: getDescendantIds(data, highlightedItemId, !0), value: !0 })); 22419 }, 60); 22420 return document5.addEventListener("keydown", navigateTree), () => document5.removeEventListener("keydown", navigateTree); 22421 }, [ 22422 containerRef, 22423 isBrowsing, 22424 refId, 22425 data, 22426 highlightedRef, 22427 setHighlightedItemId, 22428 onSelectStoryId 22429 ]), [expanded, updateExpanded]; 22430}; 22431 22432// src/manager/components/sidebar/Tree.tsx 22433var CollapseButton = styled(Button)(({ theme }) => ({ 22434 fontSize: `${theme.typography.size.s1 - 1}px`, 22435 fontWeight: theme.typography.weight.bold, 22436 letterSpacing: "0.16em", 22437 textTransform: "uppercase", 22438 color: theme.textMutedColor, 22439 padding: "0 8px" 22440})), LeafNodeStyleWrapper = styled.div(({ theme }) => ({ 22441 position: "relative", 22442 display: "flex", 22443 justifyContent: "space-between", 22444 alignItems: "flex-start", 22445 color: theme.color.defaultText, 22446 background: "transparent", 22447 minHeight: 28, 22448 borderRadius: 4, 22449 overflow: "hidden", 22450 "--tree-node-background-hover": theme.background.content, 22451 [MEDIA_DESKTOP_BREAKPOINT]: { 22452 "--tree-node-background-hover": theme.background.app 22453 }, 22454 "&:hover, &:focus": { 22455 "--tree-node-background-hover": theme.background.hoverable, 22456 background: "var(--tree-node-background-hover)", 22457 outline: "none" 22458 }, 22459 '& [data-displayed="off"]': { 22460 visibility: "hidden" 22461 }, 22462 '&:hover [data-displayed="off"]': { 22463 visibility: "visible" 22464 }, 22465 '& [data-displayed="on"] + *': { 22466 visibility: "hidden" 22467 }, 22468 '&:hover [data-displayed="off"] + *': { 22469 visibility: "hidden" 22470 }, 22471 '&[data-selected="true"]': { 22472 color: theme.color.lightest, 22473 background: theme.base === "dark" ? curriedDarken$1(0.18, theme.color.secondary) : theme.color.secondary, 22474 fontWeight: theme.typography.weight.bold, 22475 "&&:hover, &&:focus": { 22476 background: theme.base === "dark" ? curriedDarken$1(0.18, theme.color.secondary) : theme.color.secondary 22477 }, 22478 svg: { color: theme.color.lightest } 22479 }, 22480 a: { color: "currentColor" } 22481})), SkipToContentLink = styled(Button)(({ theme }) => ({ 22482 display: "none", 22483 "@media (min-width: 600px)": { 22484 display: "block", 22485 fontSize: "10px", 22486 overflow: "hidden", 22487 width: 1, 22488 height: "20px", 22489 boxSizing: "border-box", 22490 opacity: 0, 22491 padding: 0, 22492 "&:focus": { 22493 opacity: 1, 22494 padding: "5px 10px", 22495 background: "white", 22496 color: theme.color.secondary, 22497 width: "auto" 22498 } 22499 } 22500})), StatusSlots = styled.div({ 22501 display: "flex", 22502 alignItems: "center" 22503}); 22504var getStatusLabel = (status) => status.split(":")[1].replace(/^./, (char) => char.toUpperCase()), Node2 = react_default.memo(function(props) { 22505 let { 22506 item, 22507 statuses, 22508 groupDualStatus, 22509 refId, 22510 docsMode, 22511 isOrphan, 22512 isDisplayed, 22513 isSelected, 22514 isFullyExpanded, 22515 setFullyExpanded, 22516 isExpanded, 22517 setExpanded, 22518 onSelectStoryId, 22519 api, 22520 isModifiedFilterActive 22521 } = props, theme = useTheme(), { isDesktop, isMobile: isMobile2
vendor: 11,372 bytes, lines 22521-22782
22521, setMobileMenuOpen } = useLayout(), statusLinks = useMemo(() => item.type === "story" || item.type === "docs" ? Object.entries(statuses).filter(([, status]) => status.sidebarContextMenu !== !1).filter(([, status]) => status.typeId !== REVIEW_STATUS_TYPE_ID).sort((a2, b2) => statusPriority.indexOf(a2[1].value) - statusPriority.indexOf(b2[1].value)).map(([typeId, status]) => ({ 22522 id: typeId, 22523 title: status.title, 22524 description: status.description, 22525 "aria-label": `Test status for ${status.title}: ${status.value}`, 22526 icon: getStatus(theme, status.value).icon, 22527 onClick: () => { 22528 onSelectStoryId(item.id), internal_fullStatusStore.selectStatuses([status]); 22529 } 22530 })) : [], [item.id, item.type, onSelectStoryId, statuses, theme]), visibleStatus = useMemo( 22531 () => getSidebarVisibleStatus({ 22532 theme, 22533 item, 22534 statuses, 22535 groupDualStatus, 22536 isModifiedFilterActive 22537 }), 22538 [theme, item, statuses, groupDualStatus, isModifiedFilterActive] 22539 ), contextMenu = useContextMenu(item, statusLinks, api, visibleStatus); 22540 refId !== "storybook_internal" && (contextMenu = { node: null, onMouseEnter: () => { 22541 } }); 22542 let id = createId(item.id, refId); 22543 if (item.type === "story" && !("children" in item && item.children) && (!("subtype" in item) || item.subtype !== "test") || item.type === "docs") { 22544 let LeafNode3 = item.type === "docs" ? DocumentNode : StoryLeafNode, { changeStatus, testStatus } = getChangeDetectionStatus(statuses || {}), leafChangeIcon = shouldShowChangeStatus(changeStatus, isModifiedFilterActive) ? getStatus(theme, changeStatus).icon : null, { icon: testIcon } = getStatus(theme, testStatus), overallStoryStatus = getMostCriticalStatusValue([changeStatus, testStatus]), { textColor } = getStatus(theme, overallStoryStatus); 22545 return react_default.createElement( 22546 LeafNodeStyleWrapper, 22547 { 22548 key: id, 22549 className: "sidebar-item", 22550 "data-selected": isSelected, 22551 "data-ref-id": refId, 22552 "data-item-id": item.id, 22553 "data-parent-id": item.parent, 22554 "data-nodetype": item.type === "docs" ? "document" : "story", 22555 "data-highlightable": isDisplayed, 22556 onMouseEnter: contextMenu.onMouseEnter 22557 }, 22558 react_default.createElement( 22559 LeafNode3, 22560 { 22561 style: isSelected ? {} : { color: textColor }, 22562 href: getLink(item, refId), 22563 id, 22564 depth: isOrphan ? item.depth : item.depth - 1, 22565 onClick: (event) => { 22566 event.preventDefault(), onSelectStoryId(item.id), isMobile2 && setMobileMenuOpen(!1); 22567 }, 22568 ...item.type === "docs" && { docsMode } 22569 }, 22570 item.renderLabel?.(item, api) || item.name 22571 ), 22572 isSelected && react_default.createElement(SkipToContentLink, { asChild: !0, ariaLabel: !1 }, react_default.createElement("a", { href: "#storybook-preview-wrapper" }, "Skip to content")), 22573 contextMenu.node, 22574 leafChangeIcon && testIcon ? react_default.createElement(StatusSlots, null, react_default.createElement( 22575 StatusButton, 22576 { 22577 ariaLabel: `Change status: ${getStatusLabel(changeStatus)}`, 22578 "data-testid": "tree-change-status-button", 22579 type: "button", 22580 status: changeStatus, 22581 selectedItem: isSelected 22582 }, 22583 leafChangeIcon 22584 ), react_default.createElement( 22585 StatusButton, 22586 { 22587 ariaLabel: `Test status: ${getStatusLabel(testStatus)}`, 22588 "data-testid": "tree-status-button", 22589 type: "button", 22590 status: testStatus, 22591 selectedItem: isSelected 22592 }, 22593 testIcon 22594 )) : leafChangeIcon ? react_default.createElement( 22595 StatusButton, 22596 { 22597 ariaLabel: `Change status: ${getStatusLabel(changeStatus)}`, 22598 "data-testid": "tree-change-status-button", 22599 type: "button", 22600 status: changeStatus, 22601 selectedItem: isSelected 22602 }, 22603 leafChangeIcon 22604 ) : testIcon ? react_default.createElement( 22605 StatusButton, 22606 { 22607 ariaLabel: `Test status: ${getStatusLabel(testStatus)}`, 22608 "data-testid": "tree-status-button", 22609 type: "button", 22610 status: testStatus, 22611 selectedItem: isSelected 22612 }, 22613 testIcon 22614 ) : null 22615 ); 22616 } 22617 if (item.type === "root") 22618 return react_default.createElement( 22619 RootNode, 22620 { 22621 key: id, 22622 id, 22623 className: "sidebar-subheading", 22624 "data-ref-id": refId, 22625 "data-item-id": item.id, 22626 "data-nodetype": "root" 22627 }, 22628 react_default.createElement( 22629 CollapseButton, 22630 { 22631 variant: "ghost", 22632 ariaLabel: isExpanded ? "Collapse" : "Expand", 22633 "data-action": "collapse-root", 22634 onClick: (event) => { 22635 event.preventDefault(), setExpanded({ ids: [item.id], value: !isExpanded }); 22636 }, 22637 "aria-expanded": isExpanded 22638 }, 22639 react_default.createElement(CollapseIcon2, { isExpanded }), 22640 item.renderLabel?.(item, api) || item.name 22641 ), 22642 isExpanded && react_default.createElement( 22643 Button, 22644 { 22645 padding: "small", 22646 variant: "ghost", 22647 className: "sidebar-subheading-action", 22648 ariaLabel: isFullyExpanded ? "Collapse all" : "Expand all", 22649 "data-action": "expand-all", 22650 "data-expanded": isFullyExpanded, 22651 onClick: (event) => { 22652 event.preventDefault(), setFullyExpanded(); 22653 } 22654 }, 22655 isFullyExpanded ? react_default.createElement(CollapseIcon, null) : react_default.createElement(ExpandAltIcon, null) 22656 ) 22657 ); 22658 if (item.type === "component" || item.type === "group" || item.type === "story" && "children" in item && item.children) { 22659 let { children = [] } = item, BranchNode2 = { component: ComponentNode, group: GroupNode, story: StoryBranchNode }[item.type], { changeStatus: localChange, testStatus: localTest } = getChangeDetectionStatus( 22660 statuses || {} 22661 ), groupDual = groupDualStatus?.[item.id] || { 22662 change: "status-value:unknown", 22663 test: "status-value:unknown" 22664 }, branchChange = getMostCriticalStatusValue([localChange, groupDual.change]), branchTest = getMostCriticalStatusValue([localTest, groupDual.test]), branchChangeIcon = shouldShowChangeStatus(branchChange, isModifiedFilterActive) ? getStatus(theme, branchChange).icon : null, branchTestIcon = getStatus(theme, branchTest).icon, overallStatus = getMostCriticalStatusValue([branchChange, branchTest]), color2 = overallStatus ? getStatus(theme, overallStatus).textColor : null; 22665 return react_default.createElement( 22666 LeafNodeStyleWrapper, 22667 { 22668 key: id, 22669 className: "sidebar-item", 22670 "data-selected": isSelected, 22671 "data-ref-id": refId, 22672 "data-item-id": item.id, 22673 "data-parent-id": item.parent, 22674 "data-nodetype": item.type, 22675 "data-highlightable": isDisplayed, 22676 onMouseEnter: contextMenu.onMouseEnter 22677 }, 22678 react_default.createElement( 22679 BranchNode2, 22680 { 22681 id, 22682 style: color2 && !isSelected ? { color: color2 } : {}, 22683 "aria-controls": children.join(" "), 22684 "aria-expanded": isExpanded, 22685 depth: isOrphan ? item.depth : item.depth - 1, 22686 isExpandable: children.length > 0, 22687 isExpanded, 22688 onClick: (event) => { 22689 event.preventDefault(), item.type === "story" ? (onSelectStoryId(item.id), (!isExpanded || isSelected) && setExpanded({ ids: [item.id], value: !isExpanded })) : item.type === "component" ? (!isExpanded && isDesktop && onSelectStoryId(item.id), setExpanded({ ids: [item.id], value: !isExpanded })) : setExpanded({ ids: [item.id], value: !isExpanded }); 22690 }, 22691 onMouseEnter: () => { 22692 (item.type === "component" || item.type === "story") && api.emit(PRELOAD_ENTRIES, { 22693 ids: [children[0]], 22694 options: { target: refId } 22695 }); 22696 } 22697 }, 22698 item.renderLabel?.(item, api) || item.name 22699 ), 22700 isSelected && react_default.createElement(SkipToContentLink, { asChild: !0, ariaLabel: !1 }, react_default.createElement("a", { href: "#storybook-preview-wrapper" }, "Skip to content")), 22701 contextMenu.node, 22702 branchChangeIcon && branchTestIcon ? react_default.createElement(StatusSlots, null, react_default.createElement( 22703 StatusButton, 22704 { 22705 ariaLabel: `Change status: ${getStatusLabel(branchChange)}`, 22706 "data-testid": "tree-change-status-button", 22707 type: "button", 22708 status: branchChange, 22709 selectedItem: isSelected 22710 }, 22711 branchChangeIcon 22712 ), react_default.createElement( 22713 StatusButton, 22714 { 22715 ariaLabel: `Test status: ${getStatusLabel(branchTest)}`, 22716 "data-testid": "tree-status-button", 22717 type: "button", 22718 status: branchTest, 22719 selectedItem: isSelected 22720 }, 22721 branchTestIcon 22722 )) : branchChangeIcon ? react_default.createElement( 22723 StatusButton, 22724 { 22725 ariaLabel: `Change status: ${getStatusLabel(branchChange)}`, 22726 "data-testid": "tree-change-status-button", 22727 type: "button", 22728 status: branchChange, 22729 selectedItem: isSelected 22730 }, 22731 branchChangeIcon 22732 ) : branchTestIcon ? react_default.createElement( 22733 StatusButton, 22734 { 22735 ariaLabel: `Test status: ${getStatusLabel(branchTest)}`, 22736 "data-testid": "tree-status-button", 22737 type: "button", 22738 status: branchTest, 22739 selectedItem: isSelected 22740 }, 22741 branchTestIcon 22742 ) : null 22743 ); 22744 } 22745 let isTest = item.type === "story" && item.subtype === "test", LeafNode2 = isTest ? TestNode : { docs: DocumentNode, story: StoryLeafNode }[item.type], nodeType = isTest ? "test" : { docs: "document", story: "story" }[item.type], leafStatuses = Object.fromEntries( 22746 Object.entries(statuses || {}).filter( 22747 ([, status]) => status.typeId !== CHANGE_DETECTION_STATUS_TYPE_ID || status.value === "status-value:new" 22748 ) 22749 ), leafStatus = getMostCriticalStatusValue(Object.values(leafStatuses).map((s2) => s2.value)), { icon: leafIcon, textColor: leafColor } = getStatus(theme, leafStatus), leafStatusButton = leafIcon ? react_default.createElement( 22750 StatusButton, 22751 { 22752 ariaLabel: `Status: ${getStatusLabel(leafStatus)}`, 22753 "data-testid": "tree-status-button", 22754 role: "status", 22755 type: "button", 22756 status: leafStatus, 22757 selectedItem: isSelected 22758 }, 22759 leafIcon 22760 ) : null; 22761 return react_default.createElement( 22762 LeafNodeStyleWrapper, 22763 { 22764 key: id, 22765 className: "sidebar-item", 22766 "data-selected": isSelected, 22767 "data-ref-id": refId, 22768 "data-item-id": item.id, 22769 "data-parent-id": item.parent, 22770 "data-nodetype": nodeType, 22771 "data-highlightable": isDisplayed, 22772 onMouseEnter: contextMenu.onMouseEnter 22773 }, 22774 react_default.createElement( 22775 LeafNode2, 22776 { 22777 style: leafColor && !isSelected ? { color: leafColor } : {}, 22778 href: getLink(item, refId), 22779 id, 22780 depth: isOrphan ? item.depth : item.depth - 1, 22781 onClick: (event) => { 22782 event.preventDefault(), onSelectStoryId(item.id), isMobile2 && setMobileMenuOpe
vendor: 33,540 bytes, lines 22782-23636
22782n(!1); 22783 } 22784 }, 22785 item.renderLabel?.(item, api) || item.name 22786 ), 22787 isSelected && react_default.createElement(SkipToContentLink, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: "#storybook-preview-wrapper" }, "Skip to content")), 22788 contextMenu.node, 22789 leafStatusButton 22790 ); 22791}), Root3 = react_default.memo(function({ 22792 setExpanded, 22793 isFullyExpanded, 22794 expandableDescendants, 22795 ...props 22796}) { 22797 let setFullyExpanded = useCallback( 22798 () => setExpanded({ ids: expandableDescendants, value: !isFullyExpanded }), 22799 [setExpanded, isFullyExpanded, expandableDescendants] 22800 ); 22801 return react_default.createElement( 22802 Node2, 22803 { 22804 ...props, 22805 setExpanded, 22806 isFullyExpanded, 22807 setFullyExpanded 22808 } 22809 ); 22810}), Tree = react_default.memo(function({ 22811 isBrowsing, 22812 refId, 22813 data, 22814 allStatuses, 22815 docsMode, 22816 highlightedRef, 22817 setHighlightedItemId, 22818 selectedStoryId, 22819 onSelectStoryId 22820}) { 22821 let containerRef = useRef(null), api = useStorybookApi(), isModifiedFilterActive = (useStorybookState().includedStatusFilters ?? []).includes("status-value:modified"), [rootIds, orphanIds, initialExpanded] = useMemo( 22822 () => Object.keys(data).reduce( 22823 (acc, id) => { 22824 let item = data[id]; 22825 return item.type === "root" ? acc[0].push(id) : item.parent || acc[1].push(id), item.type === "root" && item.startCollapsed && (acc[2][id] = !1), acc; 22826 }, 22827 [[], [], {}] 22828 ), 22829 [data] 22830 ), { expandableDescendants } = useMemo(() => [...orphanIds, ...rootIds].reduce( 22831 (acc, nodeId) => (acc.expandableDescendants[nodeId] = getDescendantIds(data, nodeId, !1).filter( 22832 (d2) => !["story", "docs"].includes(data[d2].type) 22833 ), acc), 22834 { orphansFirst: [], expandableDescendants: {} } 22835 ), [data, rootIds, orphanIds]), singleStoryComponentIds = useMemo(() => Object.keys(data).filter((id) => { 22836 let entry = data[id]; 22837 if (entry.type !== "component") 22838 return !1; 22839 let { children = [], name } = entry; 22840 if (children.length !== 1) 22841 return !1; 22842 let onlyChild = data[children[0]]; 22843 return onlyChild.type === "docs" ? !0 : onlyChild.type === "story" && onlyChild.subtype === "story" ? isStoryHoistable(onlyChild.name, name) : !1; 22844 }), [data]), collapsedItems = useMemo( 22845 () => Object.keys(data).filter((id) => !singleStoryComponentIds.includes(id)), 22846 [data, singleStoryComponentIds] 22847 ), collapsedData = useMemo(() => singleStoryComponentIds.reduce( 22848 (acc, id) => { 22849 let { children, parent, name } = data[id], [childId] = children; 22850 if (parent) { 22851 let siblings = [...data[parent].children]; 22852 siblings[siblings.indexOf(id)] = childId, acc[parent] = { ...data[parent], children: siblings }; 22853 } 22854 return acc[childId] = { 22855 ...data[childId], 22856 name, 22857 parent, 22858 depth: data[childId].depth - 1 22859 }, acc; 22860 }, 22861 { ...data } 22862 ), [data, singleStoryComponentIds]), ancestry = useMemo(() => collapsedItems.reduce( 22863 (acc, id) => Object.assign(acc, { [id]: getAncestorIds2(collapsedData, id) }), 22864 {} 22865 ), [collapsedItems, collapsedData]), [expanded, setExpanded] = useExpanded({ 22866 // @ts-expect-error (non strict) 22867 containerRef, 22868 isBrowsing, 22869 refId, 22870 data: collapsedData, 22871 initialExpanded, 22872 rootIds, 22873 highlightedRef, 22874 setHighlightedItemId, 22875 selectedStoryId, 22876 onSelectStoryId 22877 }), groupStatus = useMemo( 22878 () => getGroupStatus(collapsedData, allStatuses ?? {}), 22879 [collapsedData, allStatuses] 22880 ), groupDualStatus = useMemo( 22881 () => getGroupDualStatus(collapsedData, allStatuses ?? {}), 22882 [collapsedData, allStatuses] 22883 ), treeItems = useMemo(() => collapsedItems.map((itemId) => { 22884 let item = collapsedData[itemId], id = createId(itemId, refId); 22885 if (item.type === "root") { 22886 let descendants = expandableDescendants[item.id], isFullyExpanded = descendants.every((d2) => expanded[d2]); 22887 return ( 22888 // @ts-expect-error (TODO) 22889 react_default.createElement( 22890 Root3, 22891 { 22892 api, 22893 key: id, 22894 item, 22895 refId, 22896 collapsedData, 22897 isOrphan: !1, 22898 isDisplayed: !0, 22899 isSelected: selectedStoryId === itemId, 22900 isExpanded: !!expanded[itemId], 22901 setExpanded, 22902 isFullyExpanded, 22903 expandableDescendants: descendants, 22904 onSelectStoryId, 22905 isModifiedFilterActive 22906 } 22907 ) 22908 ); 22909 } 22910 let isDisplayed = !item.parent || ancestry[itemId].every((a2) => expanded[a2]); 22911 return isDisplayed === !1 ? null : react_default.createElement( 22912 Node2, 22913 { 22914 api, 22915 collapsedData, 22916 key: id, 22917 item, 22918 statuses: allStatuses?.[itemId] ?? {}, 22919 groupDualStatus, 22920 refId, 22921 docsMode, 22922 isOrphan: orphanIds.some((oid) => itemId === oid || itemId.startsWith(`${oid}-`)), 22923 isDisplayed, 22924 isSelected: selectedStoryId === itemId, 22925 isExpanded: !!expanded[itemId], 22926 setExpanded, 22927 onSelectStoryId, 22928 isModifiedFilterActive 22929 } 22930 ); 22931 }), [ 22932 ancestry, 22933 api, 22934 collapsedData, 22935 collapsedItems, 22936 docsMode, 22937 expandableDescendants, 22938 expanded, 22939 groupDualStatus, 22940 isModifiedFilterActive, 22941 onSelectStoryId, 22942 orphanIds, 22943 refId, 22944 selectedStoryId, 22945 setExpanded, 22946 allStatuses 22947 ]); 22948 return react_default.createElement(StatusContext.Provider, { value: { data, allStatuses, groupStatus } }, react_default.createElement("div", { ref: containerRef }, treeItems)); 22949}); 22950 22951// src/manager/components/sidebar/Refs.tsx 22952var Wrapper6 = styled.div(({ isMain }) => ({ 22953 position: "relative", 22954 marginTop: isMain ? void 0 : 0 22955})), RefHead = styled.div(({ theme }) => ({ 22956 fontWeight: theme.typography.weight.bold, 22957 fontSize: theme.typography.size.s2, 22958 // Similar to ListItem.tsx 22959 textDecoration: "none", 22960 lineHeight: "16px", 22961 display: "flex", 22962 alignItems: "center", 22963 justifyContent: "space-between", 22964 background: "transparent", 22965 width: "100%", 22966 marginTop: 20, 22967 paddingTop: 16, 22968 paddingBottom: 12, 22969 borderTop: `1px solid ${theme.appBorderColor}`, 22970 color: theme.color.defaultText 22971})), RefTitle = styled.div({ 22972 textOverflow: "ellipsis", 22973 whiteSpace: "nowrap", 22974 flex: 1, 22975 overflow: "hidden", 22976 marginLeft: 2 22977}), CollapseButton2 = styled.button(({ theme }) => ({ 22978 all: "unset", 22979 display: "flex", 22980 padding: "0px 8px", 22981 gap: 6, 22982 alignItems: "center", 22983 cursor: "pointer", 22984 overflow: "hidden", 22985 "&:focus": { 22986 borderColor: theme.color.secondary, 22987 "span:first-of-type": { 22988 borderLeftColor: theme.color.secondary 22989 } 22990 } 22991})), Ref = react_default.memo(function(props) { 22992 let storybookState = useStorybookState(), api = useStorybookApi(), { 22993 filteredIndex: index, 22994 id: refId, 22995 title: title2 = refId, 22996 isLoading: isLoadingMain, 22997 isBrowsing, 22998 hasEntries, 22999 selectedStoryId, 23000 highlightedRef, 23001 setHighlighted, 23002 loginUrl, 23003 type, 23004 expanded = !0, 23005 indexError, 23006 previewInitialized, 23007 allStatuses 23008 } = props, length = useMemo(() => index ? Object.keys(index).length : 0, [index]), indicatorRef = useRef(null), isMain = refId === DEFAULT_REF_ID, isLoading = isLoadingMain || (type === "auto-inject" && !previewInitialized || type === "server-checked") || type === "unknown", isError2 = !!indexError, isEmpty = !isLoading && length === 0, isAuthRequired = !!loginUrl && length === 0, activeFilterCount = getActiveFilterCount(storybookState), state = getStateType(isLoading, isAuthRequired, isError2, isEmpty), [isExpanded, setExpanded] = useState(expanded); 23009 useEffect(() => { 23010 index && selectedStoryId && index[selectedStoryId] && setExpanded(!0); 23011 }, [index, selectedStoryId]); 23012 let handleClick = useCallback(() => setExpanded((value) => !value), []), setHighlightedItemId = useCallback( 23013 (itemId) => setHighlighted({ itemId, refId }), 23014 [setHighlighted, refId] 23015 ), onSelectStoryId = useCallback( 23016 (storyId) => api?.selectStory(storyId, void 0, { ref: isMain ? void 0 : refId }), 23017 [api, isMain, refId] 23018 ); 23019 return react_default.createElement(react_default.Fragment, null, isMain || react_default.createElement( 23020 RefHead, 23021 { 23022 "aria-label": `${isExpanded ? "Hide" : "Show"} ${title2} stories`, 23023 "aria-expanded": isExpanded 23024 }, 23025 react_default.createElement(CollapseButton2, { "data-action": "collapse-ref", onClick: handleClick }, react_default.createElement(CollapseIcon2, { isExpanded }), react_default.createElement(RefTitle, { title: title2 }, title2)), 23026 react_default.createElement(RefIndicator, { ...props, state, ref: indicatorRef }) 23027 ), isExpanded && react_default.createElement(Wrapper6, { "data-title": title2, isMain }, state === "auth" && react_default.createElement(AuthBlock, { id: refId, loginUrl }), state === "error" && react_default.createElement(ErrorBlock, { error: indexError }), state === "loading" && react_default.createElement(LoaderBlock, { isMain }), state === "empty" && react_default.createElement( 23028 EmptyBlock, 23029 { 23030 isMain, 23031 hasEntries, 23032 activeFilterCount 23033 } 23034 ), state === "ready" && react_default.createElement( 23035 Tree, 23036 { 23037 allStatuses, 23038 isBrowsing, 23039 isMain, 23040 refId, 23041 data: index, 23042 docsMode: storybookState.docsOptions.docsMode, 23043 selectedStoryId, 23044 onSelectStoryId, 23045 highlightedRef, 23046 setHighlightedItemId 23047 } 23048 ))); 23049}); 23050 23051// src/manager/components/sidebar/useHighlighted.ts 23052init_react(); 23053var { document: document6, window: globalWindow4 } = scope, fromSelection = (selection) => selection ? { itemId: selection.storyId, refId: selection.refId } : null, scrollToSelector = (selector, options2 = {}, _attempt = 1) => { 23054 let { containerRef, center = !1, attempts = 3, delay: delay2 = 500 } = options2, element = (containerRef ? containerRef.current : document6)?.querySelector(selector); 23055 element ? scrollIntoView(element, center) : _attempt <= attempts && setTimeout(scrollToSelector, delay2, selector, options2, _attempt + 1); 23056}, useHighlighted = ({ 23057 containerRef, 23058 isLoading, 23059 isBrowsing, 23060 selected 23061}) => { 23062 let initialHighlight = fromSelection(selected), highlightedRef = useRef(initialHighlight), [highlighted, setHighlighted] = useState(initialHighlight), api = useStorybookApi(), updateHighlighted = useCallback( 23063 (highlight) => { 23064 highlightedRef.current = highlight, setHighlighted(highlight); 23065 }, 23066 [highlightedRef] 23067 ), highlightElement = useCallback( 23068 (element, center = !1) => { 23069 let itemId = element.getAttribute("data-item-id"), refId = element.getAttribute("data-ref-id"); 23070 !itemId || !refId || (updateHighlighted({ itemId, refId }), scrollIntoView(element, center)); 23071 }, 23072 [updateHighlighted] 23073 ); 23074 return useEffect(() => { 23075 let highlight = fromSelection(selected); 23076 updateHighlighted(highlight), highlight && scrollToSelector(`[data-item-id="${highlight.itemId}"][data-ref-id="${highlight.refId}"]`, { 23077 containerRef, 23078 center: !0 23079 }); 23080 }, [containerRef, selected, updateHighlighted]), useEffect(() => { 23081 let menuElement = document6.getElementById("storybook-explorer-menu"), lastRequestId, navigateTree = (event) => { 23082 if (isLoading || !isBrowsing || !containerRef.current || !matchesModifiers(!1, event)) 23083 return; 23084 let isArrowUp = matchesKeyCode("ArrowUp", event), isArrowDown = matchesKeyCode("ArrowDown", event); 23085 if (!(isArrowUp || isArrowDown)) 23086 return; 23087 let requestId = globalWindow4.requestAnimationFrame(() => { 23088 globalWindow4.cancelAnimationFrame(lastRequestId), lastRequestId = requestId; 23089 let target = event.target; 23090 if (!isAncestor(menuElement, target) && !isAncestor(target, menuElement)) 23091 return; 23092 target.hasAttribute("data-action") && target.blur(); 23093 let highlightable = Array.from( 23094 containerRef.current?.querySelectorAll("[data-highlightable=true]") || [] 23095 ), currentIndex = highlightable.findIndex( 23096 (el) => el.getAttribute("data-item-id") === highlightedRef.current?.itemId && el.getAttribute("data-ref-id") === highlightedRef.current?.refId 23097 ), nextIndex = cycle2(highlightable, currentIndex, isArrowUp ? -1 : 1), didRunAround = isArrowUp ? nextIndex === highlightable.length - 1 : nextIndex === 0; 23098 if (highlightElement(highlightable[nextIndex], didRunAround), highlightable[nextIndex].getAttribute("data-nodetype") === "component") { 23099 let { itemId, refId } = highlightedRef.current, item = api.resolveStory(itemId, refId === "storybook_internal" ? void 0 : refId); 23100 item?.type === "component" && api.emit(PRELOAD_ENTRIES, { 23101 ids: [item.children[0]], 23102 options: { target: refId } 23103 }); 23104 } 23105 }); 23106 }; 23107 return document6.addEventListener("keydown", navigateTree), () => document6.removeEventListener("keydown", navigateTree); 23108 }, [api, containerRef, isLoading, isBrowsing, highlightedRef, highlightElement]), [highlighted, updateHighlighted, highlightedRef]; 23109}; 23110 23111// src/manager/components/sidebar/Explorer.tsx 23112var Explorer = react_default.memo(function({ 23113 hasEntries, 23114 isLoading, 23115 isBrowsing, 23116 isHidden, 23117 dataset, 23118 selected, 23119 ...restProps 23120}) { 23121 let containerRef = useRef(null), [highlighted, setHighlighted, highlightedRef] = useHighlighted({ 23122 containerRef, 23123 isLoading, 23124 isBrowsing, 23125 selected 23126 }), { landmarkProps } = useLandmark( 23127 { "aria-labelledby": "storybook-explorer-tree-heading", role: "navigation" }, 23128 containerRef 23129 ); 23130 return react_default.createElement( 23131 "nav", 23132 { 23133 hidden: isHidden || void 0, 23134 "aria-hidden": isHidden || void 0, 23135 className: isBrowsing ? void 0 : "sb-sr-only", 23136 ref: containerRef, 23137 id: "storybook-explorer-tree", 23138 "data-highlighted-ref-id": highlighted?.refId, 23139 "data-highlighted-item-id": highlighted?.itemId, 23140 ...landmarkProps, 23141 ...restProps 23142 }, 23143 react_default.createElement("h2", { id: "storybook-explorer-tree-heading", className: "sb-sr-only" }, "Stories"), 23144 highlighted && react_default.createElement(HighlightStyles, { ...highlighted }), 23145 dataset.entries.map(([refId, ref]) => react_default.createElement( 23146 Ref, 23147 { 23148 ...ref, 23149 key: refId, 23150 isLoading, 23151 isBrowsing, 23152 hasEntries, 23153 selectedStoryId: selected?.refId === ref.id ? selected.storyId : null, 23154 highlightedRef, 23155 setHighlighted 23156 } 23157 )) 23158 ); 23159}); 23160 23161// src/manager/components/sidebar/Filter.tsx 23162init_react(); 23163 23164// src/manager/components/sidebar/FilterPanel.tsx 23165init_react(); 23166 23167// src/manager/components/sidebar/FilterPanelLink.tsx 23168init_react(); 23169var MutedText = styled.span(({ theme }) => ({ 23170 color: theme.textMutedColor 23171})), StatusIcon2 = styled.span(({ $iconColor }) => ({ 23172 display: "contents", 23173 color: $iconColor ?? void 0, 23174 "> svg": { 23175 transform: "scale(1.3)" 23176 } 23177})), createFilterLink = ({ 23178 id, 23179 type, 23180 title: title2, 23181 tooltip, 23182 count, 23183 icon, 23184 isIncluded, 23185 isExcluded, 23186 onCheckboxChange, 23187 onInvert 23188}) => { 23189 let isChecked = isIncluded || isExcluded, toggleLabel = `${type} filter: ${isExcluded ? `exclude ${title2}` : title2}`, toggleTooltip = tooltip ?? `${isChecked ? "Remove" : "Add"} ${type} filter: ${title2}`, invertButtonLabel = `${isExcluded ? "Include" : "Exclude"} ${type}: ${title2}`; 23190 return { 23191 id: `filter-${type}-${id}`, 23192 content: react_default.createElement(ActionList.HoverItem, { targetId: `filter-${type}-${id}` }, react_default.createElement(ActionList.Action, { as: "label", ariaLabel: !1, tabIndex: -1, tooltip: toggleTooltip }, react_default.createElement(ActionList.Icon, null, isExcluded ? react_default.createElement(DeleteIcon, null) : isIncluded ? null : icon, react_default.createElement( 23193 Form.Checkbox, 23194 { 23195 checked: isChecked, 23196 onChange: onCheckboxChange, 23197 "data-tag": title2, 23198 "aria-label": toggleLabel 23199 } 23200 )), react_default.createElement(ActionList.Text, null, react_default.createElement("span", null, title2, isExcluded && react_default.createElement(MutedText, null, " (excluded)"))), isExcluded ? react_default.createElement("s", null, count) : react_default.createElement("span", null, count)), react_default.createElement( 23201 ActionList.Button, 23202 { 23203 "data-target-id": `filter-${type}-${id}`, 23204 ariaLabel: invertButtonLabel, 23205 onClick: onInvert 23206 }, 23207 react_default.createElement("span", { style: { minWidth: 45 } }, isExcluded ? "Include" : "Exclude") 23208 )) 23209 }; 23210}; 23211 23212// src/manager/components/sidebar/FilterPanel.utils.ts 23213var BUILT_IN_TAGS = /* @__PURE__ */ new Set([ 23214 "dev", 23215 "test", 23216 "autodocs", 23217 "attached-mdx", 23218 "unattached-mdx", 23219 "play-fn", 23220 "test-fn", 23221 "manifest" 23222]), STATUS_DISPLAY_ORDER = [ 23223 "status-value:new", 23224 "status-value:modified", 23225 "status-value:affected", 23226 "status-value:reviewing" 23227], areFiltersEqual = (left, right) => left.length === right.length && (/* @__PURE__ */ new Set([...left, ...right])).size === left.length, getFilterFunction = (tag) => Object.hasOwn(BUILT_IN_FILTERS, tag) ? BUILT_IN_FILTERS[tag] : USER_TAG_FILTER(tag); 23228 23229// src/manager/components/sidebar/useFilterData.tsx 23230init_react(); 23231var BUILT_IN_FILTER_DEFS = [ 23232 { id: "_docs", title: "Documentation", icon: react_default.createElement(DocumentIcon, { color: color.gold }), tag: "_docs" }, 23233 { id: "_play", title: "Play", icon: react_default.createElement(PlayHollowIcon, { color: color.seafoam }), tag: "_play" }, 23234 { id: "_test", title: "Testing", icon: react_default.createElement(BeakerIcon, { color: color.green }), tag: "_test" } 23235]; 23236function useTagFilterEntries(indexJson) { 23237 return useMemo(() => { 23238 let entries = Object.values(indexJson.entries), userTagsCounts = entries.reduce((acc, entry) => (entry.tags?.forEach((tag) => { 23239 BUILT_IN_TAGS.has(tag) || (acc[tag] = (acc[tag] || 0) + 1); 23240 }), acc), {}), tagEntries = Object.entries(userTagsCounts).map(([tag, count]) => ({ 23241 id: tag, 23242 type: "tag", 23243 title: tag, 23244 count, 23245 icon: null 23246 })), getBuiltInCount = (filterFn) => entries.filter((entry) => filterFn?.(entry)).length; 23247 return { builtInEntries: BUILT_IN_FILTER_DEFS.map((def) => ({ 23248 id: def.id, 23249 type: "built-in", 23250 title: def.title, 23251 icon: def.icon, 23252 count: getBuiltInCount(getFilterFunction(def.tag)) 23253 })), tagEntries }; 23254 }, [indexJson.entries]); 23255} 23256function useStatusFilterEntries(allStatuses) { 23257 return useMemo(() => { 23258 let changeDetectionEnabled = !!globalThis?.FEATURES?.changeDetection, counts = countStatusesByValue(allStatuses), reviewingCount = counts["status-value:reviewing"] ?? 0; 23259 return !changeDetectionEnabled && reviewingCount === 0 ? [] : (changeDetectionEnabled ? STATUS_DISPLAY_ORDER : ["status-value:reviewing"]).map((statusValue) => ({ 23260 statusValue, 23261 shortName: statusValueShortName(statusValue), 23262 description: statusValueDescription(statusValue), 23263 count: counts[statusValue] ?? 0 23264 })).filter((entry) => entry.statusValue !== "status-value:reviewing" || entry.count > 0); 23265 }, [allStatuses]); 23266} 23267 23268// src/manager/components/sidebar/FilterPanel.tsx 23269var Wrapper7 = styled.div({ 23270 minWidth: 240, 23271 maxWidth: 300, 23272 maxHeight: 15.5 * 32 + 8, 23273 // 15.5 items at 32px each + 8px padding 23274 overflow: "hidden", 23275 overflowY: "auto", 23276 scrollbarWidth: "thin" 23277}), FilterPanel = ({ 23278 api, 23279 indexJson, 23280 defaultIncludedFilters, 23281 defaultExcludedFilters, 23282 includedFilters, 23283 excludedFilters, 23284 allStatuses, 23285 includedStatusFilters, 23286 excludedStatusFilters 23287}) => { 23288 let theme = useTheme(), { builtInEntries, tagEntries } = useTagFilterEntries(indexJson), statusEntries = useStatusFilterEntries(allStatuses), toTagFilterItem = useCallback( 23289 (entry) => { 23290 if (entry.count === 0 && entry.type === "built-in") return null; 23291 let isIncluded = includedFilters.includes(entry.id), isExcluded = excludedFilters.includes(entry.id), isChecked = isIncluded || isExcluded; 23292 return { 23293 id: entry.id, 23294 type: entry.type, 23295 title: entry.title, 23296 count: entry.count, 23297 icon: entry.icon, 23298 isIncluded, 23299 isExcluded, 23300 onCheckboxChange: () => { 23301 isChecked ? api.removeTagFilters([entry.id]) : api.addTagFilters([entry.id], !1); 23302 }, 23303 onInvert: () => api.addTagFilters([entry.id], !isExcluded) 23304 }; 23305 }, 23306 [api, includedFilters, excludedFilters] 23307 ), toStatusFilterItem = useCallback( 23308 (entry) => { 23309 let isRelated = entry.statusValue === "status-value:affected", shortName = isRelated ? "related" : entry.shortName, isIncluded = includedStatusFilters.includes(entry.statusValue), isExcluded = excludedStatusFilters.includes(entry.statusValue), isChecked = isIncluded || isExcluded, { icon: statusIconEl, iconColor } = getStatus(theme, entry.statusValue), icon = isRelated ? react_default.createElement("span", { "aria-hidden": "true" }) : statusIconEl ? react_default.createElement(StatusIcon2, { $iconColor: iconColor }, statusIconEl) : null; 23310 return { 23311 id: shortName, 23312 type: "status", 23313 title: shortName.charAt(0).toUpperCase() + shortName.slice(1), 23314 tooltip: entry.description, 23315 count: entry.count, 23316 icon, 23317 isIncluded, 23318 isExcluded, 23319 onCheckboxChange: () => { 23320 isChecked ? api.removeStatusFilters([entry.statusValue]) : api.addStatusFilters([entry.statusValue], !1); 23321 }, 23322 onInvert: () => api.addStatusFilters([entry.statusValue], !isExcluded) 23323 }; 23324 }, 23325 [api, includedStatusFilters, excludedStatusFilters, theme] 23326 ), builtInItems = useMemo( 23327 () => builtInEntries.sort((a2, b2) => a2.id.localeCompare(b2.id)).map(toTagFilterItem).filter((f2) => f2 !== null), 23328 [builtInEntries, toTagFilterItem] 23329 ), tagItems = useMemo( 23330 () => tagEntries.sort((a2, b2) => a2.id.localeCompare(b2.id)).map(toTagFilterItem).filter((f2) => f2 !== null), 23331 [tagEntries, toTagFilterItem] 23332 ), statusItems = useMemo( 23333 () => statusEntries.map(toStatusFilterItem), 23334 [statusEntries, toStatusFilterItem] 23335 ), changeDetectionStatusItems = useMemo( 23336 () => statusItems.filter((item) => item.id !== "reviewing"), 23337 [statusItems] 23338 ), reviewingStatusItems = useMemo( 23339 () => statusItems.filter((item) => item.id === "reviewing"), 23340 [statusItems] 23341 ), filterIds = useMemo( 23342 () => [...builtInEntries.map((e2) => e2.id), ...tagEntries.map((e2) => e2.id)], 23343 [builtInEntries, tagEntries] 23344 ), setAllFilters = useCallback( 23345 (selected) => api.setAllTagFilters(selected ? filterIds : [], []), 23346 [api, filterIds] 23347 ), isDefaultSelection = areFiltersEqual(includedFilters, defaultIncludedFilters) && areFiltersEqual(excludedFilters, defaultExcludedFilters), hasDefaultSelection = defaultIncludedFilters.length > 0 || defaultExcludedFilters.length > 0, isNothingSelectedYet = includedFilters.length === 0 && excludedFilters.length === 0 && includedStatusFilters.length === 0 && excludedStatusFilters.length === 0, hasItems = builtInItems.length > 0 || tagItems.length > 0; 23348 return react_default.createElement(Wrapper7, null, hasItems && react_default.createElement(ActionList, { as: "div" }, react_default.createElement(ActionList.Item, { as: "div" }, isNothingSelectedYet ? react_default.createElement( 23349 ActionList.Button, 23350 { 23351 ariaLabel: !1, 23352 id: "select-all", 23353 key: "select-all", 23354 onClick: () => setAllFilters(!0) 23355 }, 23356 react_default.createElement(BatchAcceptIcon, null), 23357 react_default.createElement(ActionList.Text, null, "Select all") 23358 ) : react_default.createElement( 23359 ActionList.Button, 23360 { 23361 ariaLabel: !1, 23362 id: "deselect-all", 23363 key: "deselect-all", 23364 onClick: async () => { 23365 await setAllFilters(!1), await api.resetStatusFilters(); 23366 } 23367 }, 23368 react_default.createElement(SweepIcon, null), 23369 react_default.createElement(ActionList.Text, null, "Clear filters") 23370 ), hasDefaultSelection && react_default.createElement( 23371 ActionList.Button, 23372 { 23373 id: "reset-filters", 23374 key: "reset-filters", 23375 onClick: () => api.resetTagFilters(), 23376 ariaLabel: "Reset filters", 23377 tooltip: "Reset to default selection", 23378 disabled: isDefaultSelection 23379 }, 23380 react_default.createElement(UndoIcon, null) 23381 ))), reviewingStatusItems.length > 0 && react_default.createElement(ActionList, null, reviewingStatusItems.map((item) => { 23382 let link = createFilterLink(item); 23383 return react_default.createElement(Fragment, { key: link.id }, link.content); 23384 })), builtInItems.length > 0 && react_default.createElement(ActionList, null, builtInItems.map((item) => { 23385 let link = createFilterLink(item); 23386 return react_default.createElement(Fragment, { key: link.id }, link.content); 23387 })), changeDetectionStatusItems.length > 0 && react_default.createElement(ActionList, null, changeDetectionStatusItems.map((item) => { 23388 let link = createFilterLink(item); 23389 return react_default.createElement(Fragment, { key: link.id }, link.content); 23390 })), tagItems.length > 0 && react_default.createElement(ActionList, null, tagItems.map((item) => { 23391 let link = createFilterLink(item); 23392 return react_default.createElement(Fragment, { key: link.id }, link.content); 23393 })), tagItems.length === 0 && react_default.createElement(ActionList, { as: "div" }, react_default.createElement(ActionList.Item, { as: "div" }, react_default.createElement( 23394 ActionList.Link, 23395 { 23396 ariaLabel: !1, 23397 href: api.getDocsUrl({ subpath: "writing-stories/tags#custom-tags" }), 23398 target: "_blank" 23399 }, 23400 react_default.createElement(ActionList.Icon, null, react_default.createElement(DocumentIcon, null)), 23401 react_default.createElement(ActionList.Text, null, react_default.createElement("span", null, "Learn how to add tags")), 23402 react_default.createElement(ActionList.Icon, null, react_default.createElement(ShareAltIcon, null)) 23403 )))); 23404}; 23405 23406// src/manager/components/sidebar/Filter.tsx 23407var StyledButton2 = styled(Button)(({ $isHighlighted, theme }) => ({ 23408 "&:focus-visible": { 23409 outlineOffset: 4 23410 }, 23411 ...$isHighlighted && { 23412 background: theme.background.hoverable, 23413 color: theme.color.secondary 23414 } 23415})), TagSelected = styled(Badge)(({ theme }) => ({ 23416 position: "absolute", 23417 top: 7, 23418 right: 7, 23419 transform: "translate(50%, -50%)", 23420 display: "flex", 23421 alignItems: "center", 23422 justifyContent: "center", 23423 padding: 3, 23424 height: 6, 23425 minWidth: 6, 23426 lineHeight: "px", 23427 boxShadow: `${theme.barSelectedColor} 0 0 0 1px inset`, 23428 fontSize: theme.typography.size.s1 - 1, 23429 background: theme.barSelectedColor, 23430 color: theme.color.inverseText 23431})), filterMapper = ({ api, state }) => ({ 23432 api, 23433 indexJson: state.internal_index, 23434 activeFilterCount: getActiveFilterCount(state), 23435 defaultIncludedFilters: state.defaultIncludedTagFilters, 23436 defaultExcludedFilters: state.defaultExcludedTagFilters, 23437 includedFilters: state.includedTagFilters, 23438 excludedFilters: state.excludedTagFilters, 23439 includedStatusFilters: state.includedStatusFilters ?? [], 23440 excludedStatusFilters: state.excludedStatusFilters ?? [] 23441}), FilterInner = ({ 23442 api, 23443 indexJson, 23444 activeFilterCount, 23445 defaultIncludedFilters, 23446 defaultExcludedFilters, 23447 includedFilters, 23448 excludedFilters, 23449 includedStatusFilters, 23450 excludedStatusFilters 23451}) => { 23452 let [expanded, setExpanded] = useState(!1), allStatuses = experimental_useStatusStore(), handleToggleExpand = useCallback( 23453 (event) => { 23454 event.preventDefault(), setExpanded(!expanded); 23455 }, 23456 [expanded] 23457 ); 23458 return react_default.createElement( 23459 PopoverProvider, 23460 { 23461 ariaLabel: "Tag filters", 23462 placement: "bottom", 23463 onVisibleChange: setExpanded, 23464 offset: 8, 23465 padding: 0, 23466 popover: () => react_default.createElement( 23467 FilterPanel, 23468 { 23469 api, 23470 indexJson, 23471 defaultIncludedFilters, 23472 defaultExcludedFilters, 23473 includedFilters, 23474 excludedFilters, 23475 allStatuses, 23476 includedStatusFilters, 23477 excludedStatusFilters 23478 } 23479 ) 23480 }, 23481 react_default.createElement( 23482 StyledButton2, 23483 { 23484 key: "tags", 23485 ariaLabel: activeFilterCount ? `${activeFilterCount} active tag ${activeFilterCount !== 1 ? "filters" : "filter"}` : "Tag filters", 23486 ariaDescription: "Filter the items shown in a sidebar based on the tags applied to them.", 23487 variant: "ghost", 23488 padding: "small", 23489 $isHighlighted: activeFilterCount > 0, 23490 onClick: handleToggleExpand 23491 }, 23492 react_default.createElement(FilterIcon, null), 23493 activeFilterCount > 0 && react_default.createElement(TagSelected, null) 23494 ) 23495 ); 23496}, Filter = () => react_default.createElement(Consumer, { filter: filterMapper }, ({ 23497 api, 23498 indexJson, 23499 activeFilterCount, 23500 defaultIncludedFilters, 23501 defaultExcludedFilters, 23502 includedFilters, 23503 excludedFilters, 23504 includedStatusFilters, 23505 excludedStatusFilters 23506}) => indexJson ? react_default.createElement( 23507 FilterInner, 23508 { 23509 api, 23510 indexJson, 23511 activeFilterCount, 23512 defaultIncludedFilters, 23513 defaultExcludedFilters, 23514 includedFilters, 23515 excludedFilters, 23516 includedStatusFilters, 23517 excludedStatusFilters 23518 } 23519) : null); 23520 23521// src/manager/components/sidebar/Heading.tsx 23522init_react(); 23523 23524// src/manager/components/sidebar/Brand.tsx 23525init_react(); 23526var StorybookLogoStyled = styled(StorybookLogo)(({ theme }) => ({ 23527 width: "auto", 23528 height: "22px !important", 23529 display: "block", 23530 color: theme.base === "light" ? theme.color.defaultText : theme.color.lightest 23531})), Img2 = styled.img({ 23532 display: "block", 23533 maxWidth: "150px !important", 23534 maxHeight: "100px" 23535}), LogoLink = styled.a(({ theme }) => ({ 23536 display: "inline-flex", 23537 alignItems: "center", 23538 height: "100%", 23539 margin: "-3px -4px", 23540 padding: "2px 3px", 23541 border: "1px solid transparent", 23542 borderRadius: 3, 23543 color: "inherit", 23544 textDecoration: "none", 23545 "&:focus-visible": { 23546 outline: `2px solid ${theme.color.secondary}`, 23547 outlineOffset: 2 23548 } 23549})), Brand = withTheme(({ theme }) => { 23550 let { title: title2 = "Storybook", url = "./", image, target } = theme.brand, targetValue = target || (url === "./" ? "" : "_blank"); 23551 if (image === null) 23552 return title2 === null ? null : url ? react_default.createElement(LogoLink, { href: url, target: targetValue, dangerouslySetInnerHTML: { __html: title2 } }) : react_default.createElement("div", { dangerouslySetInnerHTML: { __html: title2 } }); 23553 let logo = image ? react_default.createElement(Img2, { src: image, alt: title2 }) : react_default.createElement(StorybookLogoStyled, { alt: title2 }); 23554 return url ? react_default.createElement(LogoLink, { title: title2, href: url, target: targetValue }, logo) : react_default.createElement("div", null, logo); 23555}); 23556 23557// src/manager/components/sidebar/Menu.tsx 23558init_react(); 23559var buttonStyleAdditions = ({ 23560 highlighted, 23561 isMobile: isMobile2, 23562 theme 23563}) => css` 23564 position: relative; 23565 overflow: visible; 23566 margin-top: 0; 23567 z-index: 1; 23568 ${isMobile2 && ` 23569 width: 36px; 23570 height: 36px; 23571 `} 23572 ${highlighted && ` 23573 &:before, 23574 &:after { 23575 content: ''; 23576 position: absolute; 23577 top: 6px; 23578 right: 6px; 23579 width: 5px; 23580 height: 5px; 23581 z-index: 2; 23582 border-radius: 50%; 23583 background: ${theme.background.app}; 23584 border: 1px solid ${theme.background.app}; 23585 box-shadow: 0 0 0 2px ${theme.background.app}; 23586 } 23587 &:after { 23588 background: ${theme.color.positive}; 23589 border: 1px solid rgba(0, 0, 0, 0.1); 23590 box-shadow: 0 0 0 2px ${theme.background.app}; 23591 } 23592 &:hover:after, 23593 &:focus-visible:after { 23594 box-shadow: 0 0 0 2px ${curriedTransparentize$1(0.88, theme.color.secondary)}; 23595 } 23596 `} 23597`, Container10 = styled.div({ 23598 minWidth: 250 23599}), SidebarButton = styled(Button)(buttonStyleAdditions), SidebarToggleButton = styled(ToggleButton)(buttonStyleAdditions), MenuButtonGroup = styled.div({ 23600 display: "flex", 23601 gap: 6 23602}), SidebarMenuList = ({ menu, onHide }) => react_default.createElement(Container10, null, menu.filter((links) => links.length).flatMap((links) => react_default.createElement(ActionList, { key: links.map((link) => link.id).join("_") }, links.map((link) => { 23603 let linkContent = react_default.createElement(react_default.Fragment, null, (link.icon || link.input) && react_default.createElement(ActionList.Icon, null, link.icon || link.input), (link.title || link.center) && react_default.createElement(ActionList.Text, null, link.title || link.center), link.right); 23604 return react_default.createElement(ActionList.Item, { key: link.id, active: link.active }, react_default.createElement( 23605 ActionList.Action, 23606 { 23607 asChild: !!link.href, 23608 ariaLabel: !1, 23609 id: `list-item-${link.id}`, 23610 disabled: link.disabled, 23611 onClick: (e2) => { 23612 if (link.disabled) { 23613 e2.preventDefault(); 23614 return; 23615 } 23616 link.href && link.internal && e2.preventDefault(), link.onClick?.(e2, { 23617 id: link.id, 23618 active: link.active, 23619 disabled: link.disabled, 23620 title: link.title, 23621 href: link.href 23622 }), link.closeOnClick && onHide(); 23623 } 23624 }, 23625 link.href ? react_default.createElement( 23626 "a", 23627 { 23628 href: link.href, 23629 target: link.internal ? void 0 : "_blank", 23630 rel: link.internal ? "canonical" : "noreferrer" 23631 }, 23632 linkContent 23633 ) : linkContent 23634 )); 23635})))), SidebarMenu = ({ menu, isHighlighted, onClick }) => { 23636 let [isTooltipVisible, setIsTooltipVisible] = useState(!1), { isMobile: isMobile2
23636, setMobileMenuOpen } = useLayout(); 23637 return isMobile2 ? react_default.createElement(MenuButtonGroup, null, react_default.createElement( 23638 SidebarButton, 23639 { 23640 padding: "small", 23641 variant: "ghost", 23642 ariaLabel: "About Storybook", 23643 highlighted: !!isHighlighted, 23644 onClick: (e2) => { 23645 onClick?.(e2), e2.preventDefault(); 23646 }, 23647 isMobile: !0, 23648 asChild: !0 23649 }, 23650 react_default.createElement("a", { href: "./?path=/settings/about", rel: "canonical" }, react_default.createElement(CogIcon, null)) 23651 ), react_default.createElement( 23652 SidebarButton, 23653 { 23654 padding: "small", 23655 variant: "ghost", 23656 ariaLabel: "Close menu", 23657 highlighted: !1, 23658 onClick: () => setMobileMenuOpe
vendor: 3,521 bytes, lines 23658-23779
23658n(!1), 23659 isMobile: !0 23660 }, 23661 react_default.createElement(CloseIcon, null) 23662 )) : react_default.createElement( 23663 PopoverProvider, 23664 { 23665 ariaLabel: "Storybook menu", 23666 placement: "bottom-start", 23667 padding: 0, 23668 popover: ({ onHide }) => react_default.createElement(SidebarMenuList, { onHide, menu }), 23669 onVisibleChange: setIsTooltipVisible 23670 }, 23671 react_default.createElement( 23672 SidebarToggleButton, 23673 { 23674 ariaLabel: "Settings", 23675 pressed: isTooltipVisible, 23676 highlighted: !!isHighlighted, 23677 padding: "small", 23678 variant: "ghost", 23679 size: "medium", 23680 isMobile: !1 23681 }, 23682 react_default.createElement(CogIcon, null) 23683 ) 23684 ); 23685}; 23686 23687// src/manager/components/sidebar/Heading.tsx 23688var BrandArea = styled.div(({ theme }) => ({ 23689 fontSize: theme.typography.size.s2, 23690 fontWeight: theme.typography.weight.bold, 23691 color: theme.color.defaultText, 23692 marginRight: 20, 23693 display: "flex", 23694 width: "100%", 23695 alignItems: "center", 23696 minHeight: 22, 23697 "& > * > *": { 23698 maxWidth: "100%" 23699 }, 23700 "& > *": { 23701 maxWidth: "100%", 23702 height: "auto", 23703 display: "block", 23704 flex: "1 1 auto" 23705 } 23706})), HeadingWrapper = styled.div({ 23707 display: "flex", 23708 alignItems: "center", 23709 justifyContent: "space-between", 23710 position: "relative", 23711 minHeight: 42, 23712 paddingLeft: 8 23713}), SkipToCanvasLink = styled(Button)(({ theme }) => ({ 23714 display: "none", 23715 "@media (min-width: 600px)": { 23716 display: "block", 23717 position: "absolute", 23718 fontSize: theme.typography.size.s1, 23719 border: 0, 23720 width: 1, 23721 height: 1, 23722 padding: 0, 23723 margin: -1, 23724 overflow: "hidden", 23725 clip: "rect(0, 0, 0, 0)", 23726 whiteSpace: "nowrap", 23727 wordWrap: "normal", 23728 opacity: 0, 23729 transition: "opacity 150ms ease-out", 23730 "&:focus": { 23731 width: "100%", 23732 height: "inherit", 23733 padding: "10px 15px", 23734 margin: 0, 23735 clip: "unset", 23736 overflow: "unset", 23737 opacity: 1, 23738 zIndex: 3 23739 } 23740 } 23741})), Heading2 = ({ 23742 menuHighlighted = !1, 23743 menu, 23744 skipLinkHref, 23745 isLoading, 23746 onMenuClick, 23747 ...props 23748}) => react_default.createElement(HeadingWrapper, { ...props }, skipLinkHref && react_default.createElement(SkipToCanvasLink, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: skipLinkHref, tabIndex: 0 }, "Skip to content")), react_default.createElement(BrandArea, null, react_default.createElement(Brand, null)), react_default.createElement(SidebarMenu, { menu, isHighlighted: menuHighlighted, onClick: onMenuClick })); 23749 23750// src/manager/components/sidebar/ReviewWidget.tsx 23751init_react(); 23752var HEADING_ID = "storybook-review-widget-heading", Region2 = styled.section({ 23753 width: "100%" 23754}), HeaderContent = styled(ActionList.Text)({ 23755 display: "flex", 23756 flexDirection: "row", 23757 justifyContent: "flex-start", 23758 alignItems: "center", 23759 gap: 6, 23760 // Reserve room for the dismiss button, which is positioned in the top-right 23761 // corner so it comes last in the tab order (after the review action). 23762 paddingRight: 24 23763}), HeaderTitle = styled.h2(({ theme }) => ({ 23764 margin: 0, 23765 color: theme.color.defaultText, 23766 fontWeight: theme.typography.weight.bold, 23767 fontSize: theme.typography.size.s1, 23768 lineHeight: `${theme.typography.size.s3}px` 23769})), AgenticIcon = styled(WandIcon)(({ theme }) => ({ 23770 color: theme.fgColor.agentic 23771})), DismissButton = styled(ActionList.Button)({ 23772 position: "absolute", 23773 top: 4, 23774 right: 4, 23775 zIndex: 1 23776}), DismissIcon = styled(CloseAltIcon)({ 23777 padding: 1 23778}), useActiveReviewStoryCount = () => { 23779 let {
23779state } = useReview(); 23780 return useMemo(() => state ? collectReviewStoryIds(state).size : 0, [state]); 23781}, useActiveReviewTitle = () => { 23782 let { state } = useReview(); 23783 return state?.title ?? null; 23784}, ReviewWidget = () => { 23785 let api = useStorybookApi(), navigate = useNavigate(), storyCount = useActiveReviewStoryCount(), reviewTitle = useActiveReviewTitle(), { 23786 includedStatusFilters = [], 23787 excludedStatusFilters = [], 23788 includedTagFilters = [], 23789 excludedTagFilters = [] 23790 } = useStorybookState(), emit = useChannel({}), regionRef = useRef(null), { landmarkProps } = useLandmark( 23791 { role: "region", "aria-labelledby": HEADING_ID }, 23792 regionRef 23793 ); 23794 if (!api.getIsNavShown() || storyCount === 0) 23795 return null; 23796 let onOpen = () => { 23797 navigateToReviewSummary(api, navigate, { 23798 includedStatusFilters, 23799 excludedStatusFilters, 23800 includedTagFilters, 23801 excludedTagFilters 23802 }); 23803 }, onDismiss = (event) => { 23804 event.stopPropagation(), emit(REVIEW_EVENTS.DISMISS_REVIEW
vendor: 1,449 bytes, lines 23804-23820
23804); 23805 }, storyLabel = storyCount === 1 ? "story" : "stories"; 23806 return react_default.createElement(Region2, { ref: regionRef, ...landmarkProps }, react_default.createElement(Card, { color: "agentic", outlineAnimation: "spin", id: "storybook-review-widget" }, react_default.createElement(ActionList, { as: "div" }, react_default.createElement(ActionList.Item, { as: "div" }, react_default.createElement(HeaderContent, null, react_default.createElement(AgenticIcon, { "aria-hidden": !0 }), react_default.createElement(HeaderTitle, { id: HEADING_ID }, "Quick review")))), react_default.createElement(ActionList, { as: "div" }, react_default.createElement(ActionList.Item, { as: "div" }, react_default.createElement( 23807 ActionList.Action, 23808 { 23809 ariaLabel: reviewTitle ? `Review ${storyCount} ${storyLabel}: ${reviewTitle}` : `Review ${storyCount} ${storyLabel}`, 23810 disableAllTooltips: !0, 23811 appearance: "agentic", 23812 onClick: onOpen 23813 }, 23814 react_default.createElement(ActionList.Text, null, react_default.createElement("strong", null, "Review ", storyCount, " ", storyLabel), reviewTitle ? react_default.createElement("small", null, reviewTitle) : null) 23815 ))), react_default.createElement(DismissButton, { appearance: "agentic", ariaLabel: "Dismiss review", onClick: onDismiss }, react_default.createElement(DismissIcon, null)))); 23816}, ReviewWidget_default = ReviewWidget; 23817 23818// src/manager/components/sidebar/Search.tsx 23819init_react(); 23820
vendor: 316 bytes, lines 23821-23831
23821// ../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js 23822function _objectWithoutPropertiesLoose2(r4, e2) { 23823 if (r4 == null) return {}; 23824 var t2 = {}; 23825 for (var n3 in r4) if ({}.hasOwnProperty.call(r4, n3)) { 23826 if (e2.indexOf(n3) !== -1) continue; 23827 t2[n3] = r4[n3]; 23828 } 23829 return t2; 23830} 23831
vendor: 176 bytes, lines 23832-23836
23832// ../../node_modules/downshift/dist/downshift.esm.js 23833var import_prop_types3 = __toESM(require_prop_types()); 23834init_react(); 23835var import_react_is = __toESM(require_react_is()); 23836
vendor: 4,403 bytes, lines 23837-23888
23837// ../../node_modules/compute-scroll-into-view/dist/index.js 23838var t = (t2) => typeof t2 == "object" && t2 != null && t2.nodeType === 1, e = (t2, e2) => (!e2 || t2 !== "hidden") && t2 !== "visible" && t2 !== "clip", n2 = (t2, n3) => { 23839 if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) { 23840 let o3 = getComputedStyle(t2, null); 23841 return e(o3.overflowY, n3) || e(o3.overflowX, n3) || ((t3) => { 23842 let e2 = ((t4) => { 23843 if (!t4.ownerDocument || !t4.ownerDocument.defaultView) return null; 23844 try { 23845 return t4.ownerDocument.defaultView.frameElement; 23846 } catch { 23847 return null; 23848 } 23849 })(t3); 23850 return !!e2 && (e2.clientHeight < t3.scrollHeight || e2.clientWidth < t3.scrollWidth); 23851 })(t2); 23852 } 23853 return !1; 23854}, o2 = (t2, e2, n3, o3, l3, r4, i2, s2) => r4 < t2 && i2 > e2 || r4 > t2 && i2 < e2 ? 0 : r4 <= t2 && s2 <= n3 || i2 >= e2 && s2 >= n3 ? r4 - t2 - o3 : i2 > e2 && s2 < n3 || r4 < t2 && s2 > n3 ? i2 - e2 + l3 : 0, l2 = (t2) => { 23855 let e2 = t2.parentElement; 23856 return e2 ?? (t2.getRootNode().host || null); 23857}, r3 = (e2, r4) => { 23858 var i2, s2, d2, h2; 23859 if (typeof document > "u") return []; 23860 let { scrollMode: c2, block: f2, inline: u2, boundary: a2, skipOverflowHiddenElements: g2 } = r4, p2 = typeof a2 == "function" ? a2 : (t2) => t2 !== a2; 23861 if (!t(e2)) throw new TypeError("Invalid target"); 23862 let m2 = document.scrollingElement || document.documentElement, w2 = [], W2 = e2; 23863 for (; t(W2) && p2(W2); ) { 23864 if (W2 = l2(W2), W2 === m2) { 23865 w2.push(W2); 23866 break; 23867 } 23868 W2 != null && W2 === document.body && n2(W2) && !n2(document.documentElement) || W2 != null && n2(W2, g2) && w2.push(W2); 23869 } 23870 let b2 = (s2 = (i2 = window.visualViewport) == null ? void 0 : i2.width) != null ? s2 : innerWidth, H7 = (h2 = (d2 = window.visualViewport) == null ? void 0 : d2.height) != null ? h2 : innerHeight, { scrollX: y2, scrollY: M2 } = window, { height: v2, width: E2, top: x2, right: C2, bottom: I2, left: R2 } = e2.getBoundingClientRect(), { top: T3, right: B2, bottom: F2, left: V } = ((t2) => { 23871 let e3 = window.getComputedStyle(t2); 23872 return { top: parseFloat(e3.scrollMarginTop) || 0, right: parseFloat(e3.scrollMarginRight) || 0, bottom: parseFloat(e3.scrollMarginBottom) || 0, left: parseFloat(e3.scrollMarginLeft) || 0 }; 23873 })(e2), k2 = f2 === "start" || f2 === "nearest" ? x2 - T3 : f2 === "end" ? I2 + F2 : x2 + v2 / 2 - T3 + F2, D2 = u2 === "center" ? R2 + E2 / 2 - V + B2 : u2 === "end" ? C2 + B2 : R2 - V, L3 = []; 23874 for (let t2 = 0; t2 < w2.length; t2++) { 23875 let e3 = w2[t2], { height: l3, width: r5, top: i3, right: s3, bottom: d3, left: h3 } = e3.getBoundingClientRect(); 23876 if (c2 === "if-needed" && x2 >= 0 && R2 >= 0 && I2 <= H7 && C2 <= b2 && (e3 === m2 && !n2(e3) || x2 >= i3 && I2 <= d3 && R2 >= h3 && C2 <= s3)) return L3; 23877 let a3 = getComputedStyle(e3), g3 = parseInt(a3.borderLeftWidth, 10), p3 = parseInt(a3.borderTopWidth, 10), W3 = parseInt(a3.borderRightWidth, 10), T4 = parseInt(a3.borderBottomWidth, 10), B3 = 0, F3 = 0, V2 = "offsetWidth" in e3 ? e3.offsetWidth - e3.clientWidth - g3 - W3 : 0, S2 = "offsetHeight" in e3 ? e3.offsetHeight - e3.clientHeight - p3 - T4 : 0, X = "offsetWidth" in e3 ? e3.offsetWidth === 0 ? 0 : r5 / e3.offsetWidth : 0, Y2 = "offsetHeight" in e3 ? e3.offsetHeight === 0 ? 0 : l3 / e3.offsetHeight : 0; 23878 if (m2 === e3) B3 = f2 === "start" ? k2 : f2 === "end" ? k2 - H7 : f2 === "nearest" ? o2(M2, M2 + H7, H7, p3, T4, M2 + k2, M2 + k2 + v2, v2) : k2 - H7 / 2, F3 = u2 === "start" ? D2 : u2 === "center" ? D2 - b2 / 2 : u2 === "end" ? D2 - b2 : o2(y2, y2 + b2, b2, g3, W3, y2 + D2, y2 + D2 + E2, E2), B3 = Math.max(0, B3 + M2), F3 = Math.max(0, F3 + y2); 23879 else { 23880 B3 = f2 === "start" ? k2 - i3 - p3 : f2 === "end" ? k2 - d3 + T4 + S2 : f2 === "nearest" ? o2(i3, d3, l3, p3, T4 + S2, k2, k2 + v2, v2) : k2 - (i3 + l3 / 2) + S2 / 2, F3 = u2 === "start" ? D2 - h3 - g3 : u2 === "center" ? D2 - (h3 + r5 / 2) + V2 / 2 : u2 === "end" ? D2 - s3 + W3 + V2 : o2(h3, s3, r5, g3, W3 + V2, D2, D2 + E2, E2); 23881 let { scrollLeft: t3, scrollTop: n3 } = e3; 23882 B3 = Y2 === 0 ? 0 : Math.max(0, Math.min(n3 + B3 / Y2, e3.scrollHeight - l3 / Y2 + S2)), F3 = X === 0 ? 0 : Math.max(0, Math.min(t3 + F3 / X, e3.scrollWidth - r5 / X + V2)), k2 += n3 - B3, D2 += t3 - F3; 23883 } 23884 L3.push({ el: e3, top: B3, left: F3 }); 23885 } 23886 return L3; 23887}; 23888
vendor: 101,124 bytes, lines 23889-25877
23889// ../../node_modules/downshift/dist/downshift.esm.js 23890var idCounter = 0; 23891function cbToCb(cb) { 23892 return typeof cb == "function" ? cb : noop4; 23893} 23894function noop4() { 23895} 23896function scrollIntoView2(node, menuNode) { 23897 if (node) { 23898 var actions = r3(node, { 23899 boundary: menuNode, 23900 block: "nearest", 23901 scrollMode: "if-needed" 23902 }); 23903 actions.forEach(function(_ref) { 23904 var el = _ref.el, top = _ref.top, left = _ref.left; 23905 el.scrollTop = top, el.scrollLeft = left; 23906 }); 23907 } 23908} 23909function isOrContainsNode(parent, child, environment) { 23910 var result = parent === child || child instanceof environment.Node && parent.contains && parent.contains(child); 23911 return result; 23912} 23913function debounce4(fn, time) { 23914 var timeoutId; 23915 function cancel() { 23916 timeoutId && clearTimeout(timeoutId); 23917 } 23918 function wrapper() { 23919 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) 23920 args[_key] = arguments[_key]; 23921 cancel(), timeoutId = setTimeout(function() { 23922 timeoutId = null, fn.apply(void 0, args); 23923 }, time); 23924 } 23925 return wrapper.cancel = cancel, wrapper; 23926} 23927function callAllEventHandlers() { 23928 for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) 23929 fns[_key2] = arguments[_key2]; 23930 return function(event) { 23931 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) 23932 args[_key3 - 1] = arguments[_key3]; 23933 return fns.some(function(fn) { 23934 return fn && fn.apply(void 0, [event].concat(args)), event.preventDownshiftDefault || event.hasOwnProperty("nativeEvent") && event.nativeEvent.preventDownshiftDefault; 23935 }); 23936 }; 23937} 23938function handleRefs() { 23939 for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) 23940 refs[_key4] = arguments[_key4]; 23941 return function(node) { 23942 refs.forEach(function(ref) { 23943 typeof ref == "function" ? ref(node) : ref && (ref.current = node); 23944 }); 23945 }; 23946} 23947function generateId() { 23948 return String(idCounter++); 23949} 23950function getA11yStatusMessage(_ref2) { 23951 var isOpen = _ref2.isOpen, resultCount = _ref2.resultCount, previousResultCount = _ref2.previousResultCount; 23952 return isOpen ? resultCount ? resultCount !== previousResultCount ? resultCount + " result" + (resultCount === 1 ? " is" : "s are") + " available, use up and down arrow keys to navigate. Press Enter key to select." : "" : "No results are available." : ""; 23953} 23954function unwrapArray(arg, defaultValue) { 23955 return arg = Array.isArray(arg) ? ( 23956 /* istanbul ignore next (preact) */ 23957 arg[0] 23958 ) : arg, !arg && defaultValue ? defaultValue : arg; 23959} 23960function isDOMElement(element) { 23961 return typeof element.type == "string"; 23962} 23963function getElementProps(element) { 23964 return element.props; 23965} 23966var stateKeys = ["highlightedIndex", "inputValue", "isOpen", "selectedItem", "type"]; 23967function pickState(state) { 23968 state === void 0 && (state = {}); 23969 var result = {}; 23970 return stateKeys.forEach(function(k2) { 23971 state.hasOwnProperty(k2) && (result[k2] = state[k2]); 23972 }), result; 23973} 23974function getState2(state, props) { 23975 return !state || !props ? state : Object.keys(state).reduce(function(prevState, key) { 23976 return prevState[key] = isControlledProp(props, key) ? props[key] : state[key], prevState; 23977 }, {}); 23978} 23979function isControlledProp(props, key) { 23980 return props[key] !== void 0; 23981} 23982function normalizeArrowKey(event) { 23983 var key = event.key, keyCode = event.keyCode; 23984 return keyCode >= 37 && keyCode <= 40 && key.indexOf("Arrow") !== 0 ? "Arrow" + key : key; 23985} 23986function getHighlightedIndex(start, offset2, items, isItemDisabled2, circular) { 23987 circular === void 0 && (circular = !1); 23988 var count = items.length; 23989 if (count === 0) 23990 return -1; 23991 var itemsLastIndex = count - 1; 23992 (typeof start != "number" || start < 0 || start > itemsLastIndex) && (start = offset2 > 0 ? -1 : itemsLastIndex + 1); 23993 var current = start + offset2; 23994 current < 0 ? current = circular ? itemsLastIndex : 0 : current > itemsLastIndex && (current = circular ? 0 : itemsLastIndex); 23995 var highlightedIndex = getNonDisabledIndex(current, offset2 < 0, items, isItemDisabled2, circular); 23996 return highlightedIndex === -1 ? start >= count ? -1 : start : highlightedIndex; 23997} 23998function getNonDisabledIndex(start, backwards, items, isItemDisabled2, circular) { 23999 circular === void 0 && (circular = !1); 24000 var count = items.length; 24001 if (backwards) { 24002 for (var index = start; index >= 0; index--) 24003 if (!isItemDisabled2(items[index], index)) 24004 return index; 24005 } else 24006 for (var _index = start; _index < count; _index++) 24007 if (!isItemDisabled2(items[_index], _index)) 24008 return _index; 24009 return circular ? getNonDisabledIndex(backwards ? count - 1 : 0, backwards, items, isItemDisabled2) : -1; 24010} 24011function targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) { 24012 return checkActiveElement === void 0 && (checkActiveElement = !0), environment && downshiftElements.some(function(contextNode) { 24013 return contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment)); 24014 }); 24015} 24016var cleanupStatus = debounce4(function(documentProp) { 24017 getStatusDiv(documentProp).textContent = ""; 24018}, 500); 24019function getStatusDiv(documentProp) { 24020 var statusDiv = documentProp.getElementById("a11y-status-message"); 24021 return statusDiv || (statusDiv = documentProp.createElement("div"), statusDiv.setAttribute("id", "a11y-status-message"), statusDiv.setAttribute("role", "status"), statusDiv.setAttribute("aria-live", "polite"), statusDiv.setAttribute("aria-relevant", "additions text"), Object.assign(statusDiv.style, { 24022 border: "0", 24023 clip: "rect(0 0 0 0)", 24024 height: "1px", 24025 margin: "-1px", 24026 overflow: "hidden", 24027 padding: "0", 24028 position: "absolute", 24029 width: "1px" 24030 }), documentProp.body.appendChild(statusDiv), statusDiv); 24031} 24032function setStatus(status, documentProp) { 24033 if (!(!status || !documentProp)) { 24034 var div = getStatusDiv(documentProp); 24035 div.textContent = status, cleanupStatus(documentProp); 24036 } 24037} 24038function cleanupStatusDiv(documentProp) { 24039 var statusDiv = documentProp?.getElementById("a11y-status-message"); 24040 statusDiv && statusDiv.remove(); 24041} 24042var unknown = 0, mouseUp = 1, itemMouseEnter = 2, keyDownArrowUp = 3, keyDownArrowDown = 4, keyDownEscape = 5, keyDownEnter = 6, keyDownHome = 7, keyDownEnd = 8, clickItem = 9, blurInput = 10, changeInput = 11, keyDownSpaceButton = 12, clickButton = 13, blurButton = 14, controlledPropUpdatedSelectedItem = 15, touchEnd = 16, stateChangeTypes$3 = Object.freeze({ 24043 __proto__: null, 24044 blurButton, 24045 blurInput, 24046 changeInput, 24047 clickButton, 24048 clickItem, 24049 controlledPropUpdatedSelectedItem, 24050 itemMouseEnter, 24051 keyDownArrowDown, 24052 keyDownArrowUp, 24053 keyDownEnd, 24054 keyDownEnter, 24055 keyDownEscape, 24056 keyDownHome, 24057 keyDownSpaceButton, 24058 mouseUp, 24059 touchEnd, 24060 unknown 24061}), _excluded$3 = ["refKey", "ref"], _excluded2$3 = ["onClick", "onPress", "onKeyDown", "onKeyUp", "onBlur"], _excluded3$2 = ["onKeyDown", "onBlur", "onChange", "onInput", "onChangeText"], _excluded4$2 = ["refKey", "ref"], _excluded5 = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"], Downshift = (function() { 24062 var Downshift2 = (function(_Component) { 24063 function Downshift3(_props) { 24064 var _this; 24065 _this = _Component.call(this, _props) || this, _this.id = _this.props.id || "downshift-" + generateId(), _this.menuId = _this.props.menuId || _this.id + "-menu", _this.labelId = _this.props.labelId || _this.id + "-label", _this.inputId = _this.props.inputId || _this.id + "-input", _this.getItemId = _this.props.getItemId || function(index) { 24066 return _this.id + "-item-" + index; 24067 }, _this.items = [], _this.itemCount = null, _this.previousResultCount = 0, _this.timeoutIds = [], _this.internalSetTimeout = function(fn, time) { 24068 var id = setTimeout(function() { 24069 _this.timeoutIds = _this.timeoutIds.filter(function(i2) { 24070 return i2 !== id; 24071 }), fn(); 24072 }, time); 24073 _this.timeoutIds.push(id); 24074 }, _this.setItemCount = function(count) { 24075 _this.itemCount = count; 24076 }, _this.unsetItemCount = function() { 24077 _this.itemCount = null; 24078 }, _this.isItemDisabled = function(_item, index) { 24079 var currentElementNode = _this.getItemNodeFromIndex(index); 24080 return currentElementNode && currentElementNode.hasAttribute("disabled"); 24081 }, _this.setHighlightedIndex = function(highlightedIndex, otherStateToSet) { 24082 highlightedIndex === void 0 && (highlightedIndex = _this.props.defaultHighlightedIndex), otherStateToSet === void 0 && (otherStateToSet = {}), otherStateToSet = pickState(otherStateToSet), _this.internalSetState(_extends({ 24083 highlightedIndex 24084 }, otherStateToSet)); 24085 }, _this.clearSelection = function(cb) { 24086 _this.internalSetState({ 24087 selectedItem: null, 24088 inputValue: "", 24089 highlightedIndex: _this.props.defaultHighlightedIndex, 24090 isOpen: _this.props.defaultIsOpen 24091 }, cb); 24092 }, _this.selectItem = function(item, otherStateToSet, cb) { 24093 otherStateToSet = pickState(otherStateToSet), _this.internalSetState(_extends({ 24094 isOpen: _this.props.defaultIsOpen, 24095 highlightedIndex: _this.props.defaultHighlightedIndex, 24096 selectedItem: item, 24097 inputValue: _this.props.itemToString(item) 24098 }, otherStateToSet), cb); 24099 }, _this.selectItemAtIndex = function(itemIndex, otherStateToSet, cb) { 24100 var item = _this.items[itemIndex]; 24101 item != null && _this.selectItem(item, otherStateToSet, cb); 24102 }, _this.selectHighlightedItem = function(otherStateToSet, cb) { 24103 return _this.selectItemAtIndex(_this.getState().highlightedIndex, otherStateToSet, cb); 24104 }, _this.internalSetState = function(stateToSet, cb) { 24105 var isItemSelected, onChangeArg, onStateChangeArg = {}, isStateToSetFunction = typeof stateToSet == "function"; 24106 return !isStateToSetFunction && stateToSet.hasOwnProperty("inputValue") && _this.props.onInputValueChange(stateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), stateToSet)), _this.setState(function(state) { 24107 var _newStateToSet; 24108 state = _this.getState(state); 24109 var newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet; 24110 newStateToSet = _this.props.stateReducer(state, newStateToSet), isItemSelected = newStateToSet.hasOwnProperty("selectedItem"); 24111 var nextState = {}; 24112 return isItemSelected && newStateToSet.selectedItem !== state.selectedItem && (onChangeArg = newStateToSet.selectedItem), (_newStateToSet = newStateToSet).type || (_newStateToSet.type = unknown), Object.keys(newStateToSet).forEach(function(key) { 24113 state[key] !== newStateToSet[key] && (onStateChangeArg[key] = newStateToSet[key]), key !== "type" && (newStateToSet[key], isControlledProp(_this.props, key) || (nextState[key] = newStateToSet[key])); 24114 }), isStateToSetFunction && newStateToSet.hasOwnProperty("inputValue") && _this.props.onInputValueChange(newStateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), newStateToSet)), nextState; 24115 }, function() { 24116 cbToCb(cb)(); 24117 var hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1; 24118 hasMoreStateThanType && _this.props.onStateChange(onStateChangeArg, _this.getStateAndHelpers()), isItemSelected && _this.props.onSelect(stateToSet.selectedItem, _this.getStateAndHelpers()), onChangeArg !== void 0 && _this.props.onChange(onChangeArg, _this.getStateAndHelpers()), _this.props.onUserAction(onStateChangeArg, _this.getStateAndHelpers()); 24119 }); 24120 }, _this.rootRef = function(node) { 24121 return _this._rootNode = node; 24122 }, _this.getRootProps = function(_temp, _temp2) { 24123 var _extends22, _ref = _temp === void 0 ? {} : _temp, _ref$refKey = _ref.refKey, refKey = _ref$refKey === void 0 ? "ref" : _ref$refKey, ref = _ref.ref, rest2 = _objectWithoutPropertiesLoose2(_ref, _excluded$3), _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$suppressRefErro = _ref2.suppressRefError, suppressRefError = _ref2$suppressRefErro === void 0 ? !1 : _ref2$suppressRefErro; 24124 _this.getRootProps.called = !0, _this.getRootProps.refKey = refKey, _this.getRootProps.suppressRefError = suppressRefError; 24125 var _this$getState = _this.getState(), isOpen = _this$getState.isOpen; 24126 return _extends((_extends22 = {}, _extends22[refKey] = handleRefs(ref, _this.rootRef), _extends22.role = "combobox", _extends22["aria-expanded"] = isOpen, _extends22["aria-haspopup"] = "listbox", _extends22["aria-owns"] = isOpen ? _this.menuId : void 0, _extends22["aria-labelledby"] = _this.labelId, _extends22), rest2); 24127 }, _this.keyDownHandlers = { 24128 ArrowDown: function(event) { 24129 var _this2 = this; 24130 if (event.preventDefault(), this.getState().isOpen) { 24131 var amount = event.shiftKey ? 5 : 1; 24132 this.moveHighlightedIndex(amount, { 24133 type: keyDownArrowDown 24134 }); 24135 } else 24136 this.internalSetState({ 24137 isOpen: !0, 24138 type: keyDownArrowDown 24139 }, function() { 24140 var itemCount = _this2.getItemCount(); 24141 if (itemCount > 0) { 24142 var _this2$getState = _this2.getState(), highlightedIndex = _this2$getState.highlightedIndex, nextHighlightedIndex = getHighlightedIndex(highlightedIndex, 1, { 24143 length: itemCount 24144 }, _this2.isItemDisabled, !0); 24145 _this2.setHighlightedIndex(nextHighlightedIndex, { 24146 type: keyDownArrowDown 24147 }); 24148 } 24149 }); 24150 }, 24151 ArrowUp: function(event) { 24152 var _this3 = this; 24153 if (event.preventDefault(), this.getState().isOpen) { 24154 var amount = event.shiftKey ? -5 : -1; 24155 this.moveHighlightedIndex(amount, { 24156 type: keyDownArrowUp 24157 }); 24158 } else 24159 this.internalSetState({ 24160 isOpen: !0, 24161 type: keyDownArrowUp 24162 }, function() { 24163 var itemCount = _this3.getItemCount(); 24164 if (itemCount > 0) { 24165 var _this3$getState = _this3.getState(), highlightedIndex = _this3$getState.highlightedIndex, nextHighlightedIndex = getHighlightedIndex(highlightedIndex, -1, { 24166 length: itemCount 24167 }, _this3.isItemDisabled, !0); 24168 _this3.setHighlightedIndex(nextHighlightedIndex, { 24169 type: keyDownArrowUp 24170 }); 24171 } 24172 }); 24173 }, 24174 Enter: function(event) { 24175 if (event.which !== 229) { 24176 var _this$getState2 = this.getState(), isOpen = _this$getState2.isOpen, highlightedIndex = _this$getState2.highlightedIndex; 24177 if (isOpen && highlightedIndex != null) { 24178 event.preventDefault(); 24179 var item = this.items[highlightedIndex], itemNode = this.getItemNodeFromIndex(highlightedIndex); 24180 if (item == null || itemNode && itemNode.hasAttribute("disabled")) 24181 return; 24182 this.selectHighlightedItem({ 24183 type: keyDownEnter 24184 }); 24185 } 24186 } 24187 }, 24188 Escape: function(event) { 24189 event.preventDefault(), this.reset(_extends({ 24190 type: keyDownEscape 24191 }, !this.state.isOpen && { 24192 selectedItem: null, 24193 inputValue: "" 24194 })); 24195 } 24196 }, _this.buttonKeyDownHandlers = _extends({}, _this.keyDownHandlers, { 24197 " ": function(event) { 24198 event.preventDefault(), this.toggleMenu({ 24199 type: keyDownSpaceButton 24200 }); 24201 } 24202 }), _this.inputKeyDownHandlers = _extends({}, _this.keyDownHandlers, { 24203 Home: function(event) { 24204 var _this$getState3 = this.getState(), isOpen = _this$getState3.isOpen; 24205 if (isOpen) { 24206 event.preventDefault(); 24207 var itemCount = this.getItemCount(); 24208 if (!(itemCount <= 0 || !isOpen)) { 24209 var newHighlightedIndex = getNonDisabledIndex(0, !1, { 24210 length: itemCount 24211 }, this.isItemDisabled); 24212 this.setHighlightedIndex(newHighlightedIndex, { 24213 type: keyDownHome 24214 }); 24215 } 24216 } 24217 }, 24218 End: function(event) { 24219 var _this$getState4 = this.getState(), isOpen = _this$getState4.isOpen; 24220 if (isOpen) { 24221 event.preventDefault(); 24222 var itemCount = this.getItemCount(); 24223 if (!(itemCount <= 0 || !isOpen)) { 24224 var newHighlightedIndex = getNonDisabledIndex(itemCount - 1, !0, { 24225 length: itemCount 24226 }, this.isItemDisabled); 24227 this.setHighlightedIndex(newHighlightedIndex, { 24228 type: keyDownEnd 24229 }); 24230 } 24231 } 24232 } 24233 }), _this.getToggleButtonProps = function(_temp3) { 24234 var _ref3 = _temp3 === void 0 ? {} : _temp3, onClick = _ref3.onClick; 24235 _ref3.onPress; 24236 var onKeyDown = _ref3.onKeyDown, onKeyUp = _ref3.onKeyUp, onBlur = _ref3.onBlur, rest2 = _objectWithoutPropertiesLoose2(_ref3, _excluded2$3), _this$getState5 = _this.getState(), isOpen = _this$getState5.isOpen, enabledEventHandlers = { 24237 onClick: callAllEventHandlers(onClick, _this.buttonHandleClick), 24238 onKeyDown: callAllEventHandlers(onKeyDown, _this.buttonHandleKeyDown), 24239 onKeyUp: callAllEventHandlers(onKeyUp, _this.buttonHandleKeyUp), 24240 onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur) 24241 }, eventHandlers = rest2.disabled ? {} : enabledEventHandlers; 24242 return _extends({ 24243 type: "button", 24244 role: "button", 24245 "aria-label": isOpen ? "close menu" : "open menu", 24246 "aria-haspopup": !0, 24247 "data-toggle": !0 24248 }, eventHandlers, rest2); 24249 }, _this.buttonHandleKeyUp = function(event) { 24250 event.preventDefault(); 24251 }, _this.buttonHandleKeyDown = function(event) { 24252 var key = normalizeArrowKey(event); 24253 _this.buttonKeyDownHandlers[key] && _this.buttonKeyDownHandlers[key].call(_this, event); 24254 }, _this.buttonHandleClick = function(event) { 24255 if (event.preventDefault(), _this.props.environment) { 24256 var _this$props$environme = _this.props.environment.document, body = _this$props$environme.body, activeElement = _this$props$environme.activeElement; 24257 body && body === activeElement && event.target.focus(); 24258 } 24259 _this.internalSetTimeout(function() { 24260 return _this.toggleMenu({ 24261 type: clickButton 24262 }); 24263 }); 24264 }, _this.buttonHandleBlur = function(event) { 24265 var blurTarget = event.target; 24266 _this.internalSetTimeout(function() { 24267 if (!(_this.isMouseDown || !_this.props.environment)) { 24268 var activeElement = _this.props.environment.document.activeElement; 24269 (activeElement == null || activeElement.id !== _this.inputId) && activeElement !== blurTarget && _this.reset({ 24270 type: blurButton 24271 }); 24272 } 24273 }); 24274 }, _this.getLabelProps = function(props) { 24275 return _extends({ 24276 htmlFor: _this.inputId, 24277 id: _this.labelId 24278 }, props); 24279 }, _this.getInputProps = function(_temp4) { 24280 var _ref4 = _temp4 === void 0 ? {} : _temp4, onKeyDown = _ref4.onKeyDown, onBlur = _ref4.onBlur, onChange = _ref4.onChange, onInput = _ref4.onInput; 24281 _ref4.onChangeText; 24282 var rest2 = _objectWithoutPropertiesLoose2(_ref4, _excluded3$2), onChangeKey, eventHandlers = {}; 24283 onChangeKey = "onChange"; 24284 var _this$getState6 = _this.getState(), inputValue = _this$getState6.inputValue, isOpen = _this$getState6.isOpen, highlightedIndex = _this$getState6.highlightedIndex; 24285 if (!rest2.disabled) { 24286 var _eventHandlers; 24287 eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, _this.inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, _this.inputHandleBlur), _eventHandlers); 24288 } 24289 return _extends({ 24290 "aria-autocomplete": "list", 24291 "aria-activedescendant": isOpen && typeof highlightedIndex == "number" && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : void 0, 24292 "aria-controls": isOpen ? _this.menuId : void 0, 24293 "aria-labelledby": rest2 && rest2["aria-label"] ? void 0 : _this.labelId, 24294 // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion 24295 // revert back since autocomplete="nope" is ignored on latest Chrome and Opera 24296 autoComplete: "off", 24297 value: inputValue, 24298 id: _this.inputId 24299 }, eventHandlers, rest2); 24300 }, _this.inputHandleKeyDown = function(event) { 24301 var key = normalizeArrowKey(event); 24302 key && _this.inputKeyDownHandlers[key] && _this.inputKeyDownHandlers[key].call(_this, event); 24303 }, _this.inputHandleChange = function(event) { 24304 _this.internalSetState({ 24305 type: changeInput, 24306 isOpen: !0, 24307 inputValue: event.target.value, 24308 highlightedIndex: _this.props.defaultHighlightedIndex 24309 }); 24310 }, _this.inputHandleBlur = function() { 24311 _this.internalSetTimeout(function() { 24312 var _activeElement$datase; 24313 if (!(_this.isMouseDown || !_this.props.environment)) { 24314 var activeElement = _this.props.environment.document.activeElement, downshiftButtonIsActive = (activeElement == null || (_activeElement$datase = activeElement.dataset) == null ? void 0 : _activeElement$datase.toggle) && _this._rootNode && _this._rootNode.contains(activeElement); 24315 downshiftButtonIsActive || _this.reset({ 24316 type: blurInput 24317 }); 24318 } 24319 }); 24320 }, _this.menuRef = function(node) { 24321 _this._menuNode = node; 24322 }, _this.getMenuProps = function(_temp5, _temp6) { 24323 var _extends3, _ref5 = _temp5 === void 0 ? {} : _temp5, _ref5$refKey = _ref5.refKey, refKey = _ref5$refKey === void 0 ? "ref" : _ref5$refKey, ref = _ref5.ref, props = _objectWithoutPropertiesLoose2(_ref5, _excluded4$2), _ref6 = _temp6 === void 0 ? {} : _temp6, _ref6$suppressRefErro = _ref6.suppressRefError, suppressRefError = _ref6$suppressRefErro === void 0 ? !1 : _ref6$suppressRefErro; 24324 return _this.getMenuProps.called = !0, _this.getMenuProps.refKey = refKey, _this.getMenuProps.suppressRefError = suppressRefError, _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, _this.menuRef), _extends3.role = "listbox", _extends3["aria-labelledby"] = props && props["aria-label"] ? void 0 : _this.labelId, _extends3.id = _this.menuId, _extends3), props); 24325 }, _this.getItemProps = function(_temp7) { 24326 var _enabledEventHandlers, _ref7 = _temp7 === void 0 ? {} : _temp7, onMouseMove = _ref7.onMouseMove, onMouseDown = _ref7.onMouseDown, onClick = _ref7.onClick; 24327 _ref7.onPress; 24328 var index = _ref7.index, _ref7$item = _ref7.item, item = _ref7$item === void 0 ? ( 24329 /* istanbul ignore next */ 24330 void 0 24331 ) : _ref7$item, rest2 = _objectWithoutPropertiesLoose2(_ref7, _excluded5); 24332 index === void 0 ? (_this.items.push(item), index = _this.items.indexOf(item)) : _this.items[index] = item; 24333 var onSelectKey = "onClick", customClickHandler = onClick, enabledEventHandlers = (_enabledEventHandlers = { 24334 // onMouseMove is used over onMouseEnter here. onMouseMove 24335 // is only triggered on actual mouse movement while onMouseEnter 24336 // can fire on DOM changes, interrupting keyboard navigation 24337 onMouseMove: callAllEventHandlers(onMouseMove, function() { 24338 index !== _this.getState().highlightedIndex && (_this.setHighlightedIndex(index, { 24339 type: itemMouseEnter 24340 }), _this.avoidScrolling = !0, _this.internalSetTimeout(function() { 24341 return _this.avoidScrolling = !1; 24342 }, 250)); 24343 }), 24344 onMouseDown: callAllEventHandlers(onMouseDown, function(event) { 24345 event.preventDefault(); 24346 }) 24347 }, _enabledEventHandlers[onSelectKey] = callAllEventHandlers(customClickHandler, function() { 24348 _this.selectItemAtIndex(index, { 24349 type: clickItem 24350 }); 24351 }), _enabledEventHandlers), eventHandlers = rest2.disabled ? { 24352 onMouseDown: enabledEventHandlers.onMouseDown 24353 } : enabledEventHandlers; 24354 return _extends({ 24355 id: _this.getItemId(index), 24356 role: "option", 24357 "aria-selected": _this.getState().highlightedIndex === index 24358 }, eventHandlers, rest2); 24359 }, _this.clearItems = function() { 24360 _this.items = []; 24361 }, _this.reset = function(otherStateToSet, cb) { 24362 otherStateToSet === void 0 && (otherStateToSet = {}), otherStateToSet = pickState(otherStateToSet), _this.internalSetState(function(_ref8) { 24363 var selectedItem = _ref8.selectedItem; 24364 return _extends({ 24365 isOpen: _this.props.defaultIsOpen, 24366 highlightedIndex: _this.props.defaultHighlightedIndex, 24367 inputValue: _this.props.itemToString(selectedItem) 24368 }, otherStateToSet); 24369 }, cb); 24370 }, _this.toggleMenu = function(otherStateToSet, cb) { 24371 otherStateToSet === void 0 && (otherStateToSet = {}), otherStateToSet = pickState(otherStateToSet), _this.internalSetState(function(_ref9) { 24372 var isOpen = _ref9.isOpen; 24373 return _extends({ 24374 isOpen: !isOpen 24375 }, isOpen && { 24376 highlightedIndex: _this.props.defaultHighlightedIndex 24377 }, otherStateToSet); 24378 }, function() { 24379 var _this$getState7 = _this.getState(), isOpen = _this$getState7.isOpen, highlightedIndex = _this$getState7.highlightedIndex; 24380 isOpen && _this.getItemCount() > 0 && typeof highlightedIndex == "number" && _this.setHighlightedIndex(highlightedIndex, otherStateToSet), cbToCb(cb)(); 24381 }); 24382 }, _this.openMenu = function(cb) { 24383 _this.internalSetState({ 24384 isOpen: !0 24385 }, cb); 24386 }, _this.closeMenu = function(cb) { 24387 _this.internalSetState({ 24388 isOpen: !1 24389 }, cb); 24390 }, _this.updateStatus = debounce4(function() { 24391 var _this$props; 24392 if ((_this$props = _this.props) != null && (_this$props = _this$props.environment) != null && _this$props.document) { 24393 var state = _this.getState(), item = _this.items[state.highlightedIndex], resultCount = _this.getItemCount(), status = _this.props.getA11yStatusMessage(_extends({ 24394 itemToString: _this.props.itemToString, 24395 previousResultCount: _this.previousResultCount, 24396 resultCount, 24397 highlightedItem: item 24398 }, state)); 24399 _this.previousResultCount = resultCount, setStatus(status, _this.props.environment.document); 24400 } 24401 }, 200); 24402 var _this$props2 = _this.props, defaultHighlightedIndex = _this$props2.defaultHighlightedIndex, _this$props2$initialH = _this$props2.initialHighlightedIndex, _highlightedIndex = _this$props2$initialH === void 0 ? defaultHighlightedIndex : _this$props2$initialH, defaultIsOpen = _this$props2.defaultIsOpen, _this$props2$initialI = _this$props2.initialIsOpen, _isOpen = _this$props2$initialI === void 0 ? defaultIsOpen : _this$props2$initialI, _this$props2$initialI2 = _this$props2.initialInputValue, _inputValue = _this$props2$initialI2 === void 0 ? "" : _this$props2$initialI2, _this$props2$initialS = _this$props2.initialSelectedItem, _selectedItem = _this$props2$initialS === void 0 ? null : _this$props2$initialS, _state = _this.getState({ 24403 highlightedIndex: _highlightedIndex, 24404 isOpen: _isOpen, 24405 inputValue: _inputValue, 24406 selectedItem: _selectedItem 24407 }); 24408 return _state.selectedItem != null && _this.props.initialInputValue === void 0 && (_state.inputValue = _this.props.itemToString(_state.selectedItem)), _this.state = _state, _this; 24409 } 24410 _inheritsLoose(Downshift3, _Component); 24411 var _proto = Downshift3.prototype; 24412 return _proto.internalClearTimeouts = function() { 24413 this.timeoutIds.forEach(function(id) { 24414 clearTimeout(id); 24415 }), this.timeoutIds = []; 24416 }, _proto.getState = function(stateToMerge) { 24417 return stateToMerge === void 0 && (stateToMerge = this.state), getState2(stateToMerge, this.props); 24418 }, _proto.getItemCount = function() { 24419 var itemCount = this.items.length; 24420 return this.itemCount != null ? itemCount = this.itemCount : this.props.itemCount !== void 0 && (itemCount = this.props.itemCount), itemCount; 24421 }, _proto.getItemNodeFromIndex = function(index) { 24422 return this.props.environment ? this.props.environment.document.getElementById(this.getItemId(index)) : null; 24423 }, _proto.scrollHighlightedItemIntoView = function() { 24424 { 24425 var node = this.getItemNodeFromIndex(this.getState().highlightedIndex); 24426 this.props.scrollIntoView(node, this._menuNode); 24427 } 24428 }, _proto.moveHighlightedIndex = function(amount, otherStateToSet) { 24429 var itemCount = this.getItemCount(), _this$getState8 = this.getState(), highlightedIndex = _this$getState8.highlightedIndex; 24430 if (itemCount > 0) { 24431 var nextHighlightedIndex = getHighlightedIndex(highlightedIndex, amount, { 24432 length: itemCount 24433 }, this.isItemDisabled, !0); 24434 this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet); 24435 } 24436 }, _proto.getStateAndHelpers = function() { 24437 var _this$getState9 = this.getState(), highlightedIndex = _this$getState9.highlightedIndex, inputValue = _this$getState9.inputValue, selectedItem = _this$getState9.selectedItem, isOpen = _this$getState9.isOpen, itemToString2 = this.props.itemToString, id = this.id, getRootProps = this.getRootProps, getToggleButtonProps = this.getToggleButtonProps, getLabelProps = this.getLabelProps, getMenuProps = this.getMenuProps, getInputProps = this.getInputProps, getItemProps = this.getItemProps, openMenu = this.openMenu, closeMenu = this.closeMenu, toggleMenu = this.toggleMenu, selectItem = this.selectItem, selectItemAtIndex = this.selectItemAtIndex, selectHighlightedItem = this.selectHighlightedItem, setHighlightedIndex = this.setHighlightedIndex, clearSelection = this.clearSelection, clearItems = this.clearItems, reset = this.reset, setItemCount = this.setItemCount, unsetItemCount = this.unsetItemCount, setState = this.internalSetState; 24438 return { 24439 // prop getters 24440 getRootProps, 24441 getToggleButtonProps, 24442 getLabelProps, 24443 getMenuProps, 24444 getInputProps, 24445 getItemProps, 24446 // actions 24447 reset, 24448 openMenu, 24449 closeMenu, 24450 toggleMenu, 24451 selectItem, 24452 selectItemAtIndex, 24453 selectHighlightedItem, 24454 setHighlightedIndex, 24455 clearSelection, 24456 clearItems, 24457 setItemCount, 24458 unsetItemCount, 24459 setState, 24460 // props 24461 itemToString: itemToString2, 24462 // derived 24463 id, 24464 // state 24465 highlightedIndex, 24466 inputValue, 24467 isOpen, 24468 selectedItem 24469 }; 24470 }, _proto.componentDidMount = function() { 24471 var _this4 = this; 24472 if (!this.props.environment) 24473 this.cleanup = function() { 24474 _this4.internalClearTimeouts(); 24475 }; 24476 else { 24477 var onMouseDown = function() { 24478 _this4.isMouseDown = !0; 24479 }, onMouseUp = function(event) { 24480 _this4.isMouseDown = !1; 24481 var contextWithinDownshift = targetWithinDownshift(event.target, [_this4._rootNode, _this4._menuNode], _this4.props.environment); 24482 !contextWithinDownshift && _this4.getState().isOpen && _this4.reset({ 24483 type: mouseUp 24484 }, function() { 24485 return _this4.props.onOuterClick(_this4.getStateAndHelpers()); 24486 }); 24487 }, onTouchStart = function() { 24488 _this4.isTouchMove = !1; 24489 }, onTouchMove = function() { 24490 _this4.isTouchMove = !0; 24491 }, onTouchEnd = function(event) { 24492 var contextWithinDownshift = targetWithinDownshift(event.target, [_this4._rootNode, _this4._menuNode], _this4.props.environment, !1); 24493 !_this4.isTouchMove && !contextWithinDownshift && _this4.getState().isOpen && _this4.reset({ 24494 type: touchEnd 24495 }, function() { 24496 return _this4.props.onOuterClick(_this4.getStateAndHelpers()); 24497 }); 24498 }, environment = this.props.environment; 24499 environment.addEventListener("mousedown", onMouseDown), environment.addEventListener("mouseup", onMouseUp), environment.addEventListener("touchstart", onTouchStart), environment.addEventListener("touchmove", onTouchMove), environment.addEventListener("touchend", onTouchEnd), this.cleanup = function() { 24500 _this4.internalClearTimeouts(), _this4.updateStatus.cancel(), environment.removeEventListener("mousedown", onMouseDown), environment.removeEventListener("mouseup", onMouseUp), environment.removeEventListener("touchstart", onTouchStart), environment.removeEventListener("touchmove", onTouchMove), environment.removeEventListener("touchend", onTouchEnd); 24501 }; 24502 } 24503 }, _proto.shouldScroll = function(prevState, prevProps) { 24504 var _ref0 = this.props.highlightedIndex === void 0 ? this.getState() : this.props, currentHighlightedIndex = _ref0.highlightedIndex, _ref1 = prevProps.highlightedIndex === void 0 ? prevState : prevProps, prevHighlightedIndex = _ref1.highlightedIndex, scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen, scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex; 24505 return scrollWhenOpen || scrollWhenNavigating; 24506 }, _proto.componentDidUpdate = function(prevProps, prevState) { 24507 isControlledProp(this.props, "selectedItem") && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem) && this.internalSetState({ 24508 type: controlledPropUpdatedSelectedItem, 24509 inputValue: this.props.itemToString(this.props.selectedItem) 24510 }), !this.avoidScrolling && this.shouldScroll(prevState, prevProps) && this.scrollHighlightedItemIntoView(), this.updateStatus(); 24511 }, _proto.componentWillUnmount = function() { 24512 this.cleanup(); 24513 }, _proto.render = function() { 24514 var children = unwrapArray(this.props.children, noop4); 24515 this.clearItems(), this.getRootProps.called = !1, this.getRootProps.refKey = void 0, this.getRootProps.suppressRefError = void 0, this.getMenuProps.called = !1, this.getMenuProps.refKey = void 0, this.getMenuProps.suppressRefError = void 0, this.getLabelProps.called = !1, this.getInputProps.called = !1; 24516 var element = unwrapArray(children(this.getStateAndHelpers())); 24517 if (!element) 24518 return null; 24519 if (this.getRootProps.called || this.props.suppressRefError) 24520 return element; 24521 if (isDOMElement(element)) 24522 return cloneElement(element, this.getRootProps(getElementProps(element))); 24523 }, Downshift3; 24524 })(Component); 24525 return Downshift2.defaultProps = { 24526 defaultHighlightedIndex: null, 24527 defaultIsOpen: !1, 24528 getA11yStatusMessage, 24529 itemToString: function(i2) { 24530 return i2 == null ? "" : String(i2); 24531 }, 24532 onStateChange: noop4, 24533 onInputValueChange: noop4, 24534 onUserAction: noop4, 24535 onChange: noop4, 24536 onSelect: noop4, 24537 onOuterClick: noop4, 24538 selectedItemChanged: function(prevItem, item) { 24539 return prevItem !== item; 24540 }, 24541 environment: ( 24542 /* istanbul ignore next (ssr) */ 24543 typeof window > "u" ? void 0 : window 24544 ), 24545 stateReducer: function(state, stateToSet) { 24546 return stateToSet; 24547 }, 24548 suppressRefError: !1, 24549 scrollIntoView: scrollIntoView2 24550 }, Downshift2.stateChangeTypes = stateChangeTypes$3, Downshift2; 24551})(); 24552var dropdownDefaultStateValues = { 24553 highlightedIndex: -1, 24554 isOpen: !1, 24555 selectedItem: null, 24556 inputValue: "" 24557}; 24558function callOnChangeProps(action, state, newState) { 24559 var props = action.props, type = action.type, changes = {}; 24560 Object.keys(state).forEach(function(key) { 24561 invokeOnChangeHandler(key, action, state, newState), newState[key] !== state[key] && (changes[key] = newState[key]); 24562 }), props.onStateChange && Object.keys(changes).length && props.onStateChange(_extends({ 24563 type 24564 }, changes)); 24565} 24566function invokeOnChangeHandler(key, action, state, newState) { 24567 var props = action.props, type = action.type, handler = "on" + capitalizeString(key) + "Change"; 24568 props[handler] && newState[key] !== void 0 && newState[key] !== state[key] && props[handler](_extends({ 24569 type 24570 }, newState)); 24571} 24572function stateReducer(s2, a2) { 24573 return a2.changes; 24574} 24575var updateA11yStatus = debounce4(function(status, document11) { 24576 setStatus(status, document11); 24577}, 200), useIsomorphicLayoutEffect2 = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? useLayoutEffect : useEffect, useElementIds = "useId" in react_default ? function(_ref) { 24578 var id = _ref.id, labelId = _ref.labelId, menuId = _ref.menuId, getItemId = _ref.getItemId, toggleButtonId = _ref.toggleButtonId, inputId = _ref.inputId, reactId = "downshift-" + react_default.useId(); 24579 id || (id = reactId); 24580 var elementIdsRef = useRef({ 24581 labelId: labelId || id + "-label", 24582 menuId: menuId || id + "-menu", 24583 getItemId: getItemId || function(index) { 24584 return id + "-item-" + index; 24585 }, 24586 toggleButtonId: toggleButtonId || id + "-toggle-button", 24587 inputId: inputId || id + "-input" 24588 }); 24589 return elementIdsRef.current; 24590} : function(_ref2) { 24591 var _ref2$id = _ref2.id, id = _ref2$id === void 0 ? "downshift-" + generateId() : _ref2$id, labelId = _ref2.labelId, menuId = _ref2.menuId, getItemId = _ref2.getItemId, toggleButtonId = _ref2.toggleButtonId, inputId = _ref2.inputId, elementIdsRef = useRef({ 24592 labelId: labelId || id + "-label", 24593 menuId: menuId || id + "-menu", 24594 getItemId: getItemId || function(index) { 24595 return id + "-item-" + index; 24596 }, 24597 toggleButtonId: toggleButtonId || id + "-toggle-button", 24598 inputId: inputId || id + "-input" 24599 }); 24600 return elementIdsRef.current; 24601}; 24602function getItemAndIndex(itemProp, indexProp, items, errorMessage) { 24603 var item, index; 24604 if (itemProp === void 0) { 24605 if (indexProp === void 0) 24606 throw new Error(errorMessage); 24607 item = items[indexProp], index = indexProp; 24608 } else 24609 index = indexProp === void 0 ? items.indexOf(itemProp) : indexProp, item = itemProp; 24610 return [item, index]; 24611} 24612function isAcceptedCharacterKey(key) { 24613 return /^\S{1}$/.test(key); 24614} 24615function capitalizeString(string) { 24616 return "" + string.slice(0, 1).toUpperCase() + string.slice(1); 24617} 24618function useLatestRef(val) { 24619 var ref = useRef(val); 24620 return ref.current = val, ref; 24621} 24622function useEnhancedReducer(reducer, props, createInitialState, isStateEqual2) { 24623 var prevStateRef = useRef(), actionRef = useRef(), enhancedReducer = useCallback(function(state2, action2) { 24624 actionRef.current = action2, state2 = getState2(state2, action2.props); 24625 var changes = reducer(state2, action2), newState = action2.props.stateReducer(state2, _extends({}, action2, { 24626 changes 24627 })); 24628 return newState; 24629 }, [reducer]), _useReducer = useReducer(enhancedReducer, props, createInitialState), state = _useReducer[0], dispatch = _useReducer[1], propsRef = useLatestRef(props), dispatchWithProps = useCallback(function(action2) { 24630 return dispatch(_extends({ 24631 props: propsRef.current 24632 }, action2)); 24633 }, [propsRef]), action = actionRef.current; 24634 return useEffect(function() { 24635 var prevState = getState2(prevStateRef.current, action?.props), shouldCallOnChangeProps = action && prevStateRef.current && !isStateEqual2(prevState, state); 24636 shouldCallOnChangeProps && callOnChangeProps(action, prevState, state), prevStateRef.current = state; 24637 }, [state, action, isStateEqual2]), [state, dispatchWithProps]; 24638} 24639function useControlledReducer$1(reducer, props, createInitialState, isStateEqual2) { 24640 var _useEnhancedReducer = useEnhancedReducer(reducer, props, createInitialState, isStateEqual2), state = _useEnhancedReducer[0], dispatch = _useEnhancedReducer[1]; 24641 return [getState2(state, props), dispatch]; 24642} 24643var defaultProps$3 = { 24644 itemToString: function(item) { 24645 return item ? String(item) : ""; 24646 }, 24647 itemToKey: function(item) { 24648 return item; 24649 }, 24650 stateReducer, 24651 scrollIntoView: scrollIntoView2, 24652 environment: ( 24653 /* istanbul ignore next (ssr) */ 24654 typeof window > "u" ? void 0 : window 24655 ) 24656}; 24657function getDefaultValue$1(props, propKey, defaultStateValues2) { 24658 defaultStateValues2 === void 0 && (defaultStateValues2 = dropdownDefaultStateValues); 24659 var defaultValue = props["default" + capitalizeString(propKey)]; 24660 return defaultValue !== void 0 ? defaultValue : defaultStateValues2[propKey]; 24661} 24662function getInitialValue$1(props, propKey, defaultStateValues2) { 24663 defaultStateValues2 === void 0 && (defaultStateValues2 = dropdownDefaultStateValues); 24664 var value = props[propKey]; 24665 if (value !== void 0) 24666 return value; 24667 var initialValue = props["initial" + capitalizeString(propKey)]; 24668 return initialValue !== void 0 ? initialValue : getDefaultValue$1(props, propKey, defaultStateValues2); 24669} 24670function getInitialState$2(props) { 24671 var selectedItem = getInitialValue$1(props, "selectedItem"), isOpen = getInitialValue$1(props, "isOpen"), highlightedIndex = getInitialHighlightedIndex(props), inputValue = getInitialValue$1(props, "inputValue"); 24672 return { 24673 highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.findIndex(function(item) { 24674 return props.itemToKey(item) === props.itemToKey(selectedItem); 24675 }) : highlightedIndex, 24676 isOpen, 24677 selectedItem, 24678 inputValue 24679 }; 24680} 24681function getHighlightedIndexOnOpen(props, state, offset2) { 24682 var items = props.items, initialHighlightedIndex = props.initialHighlightedIndex, defaultHighlightedIndex = props.defaultHighlightedIndex, isItemDisabled2 = props.isItemDisabled, itemToKey2 = props.itemToKey, selectedItem = state.selectedItem, highlightedIndex = state.highlightedIndex; 24683 return items.length === 0 ? -1 : initialHighlightedIndex !== void 0 && highlightedIndex === initialHighlightedIndex && !isItemDisabled2(items[initialHighlightedIndex], initialHighlightedIndex) ? initialHighlightedIndex : defaultHighlightedIndex !== void 0 && !isItemDisabled2(items[defaultHighlightedIndex], defaultHighlightedIndex) ? defaultHighlightedIndex : selectedItem ? items.findIndex(function(item) { 24684 return itemToKey2(selectedItem) === itemToKey2(item); 24685 }) : offset2 < 0 && !isItemDisabled2(items[items.length - 1], items.length - 1) ? items.length - 1 : offset2 > 0 && !isItemDisabled2(items[0], 0) ? 0 : -1; 24686} 24687function useMouseAndTouchTracker(environment, handleBlur, downshiftElementsRefs) { 24688 var mouseAndTouchTrackersRef = useRef({ 24689 isMouseDown: !1, 24690 isTouchMove: !1, 24691 isTouchEnd: !1 24692 }); 24693 return useEffect(function() { 24694 if (!environment) 24695 return noop4; 24696 var downshiftElements = downshiftElementsRefs.map(function(ref) { 24697 return ref.current; 24698 }); 24699 function onMouseDown() { 24700 mouseAndTouchTrackersRef.current.isTouchEnd = !1, mouseAndTouchTrackersRef.current.isMouseDown = !0; 24701 } 24702 function onMouseUp(event) { 24703 mouseAndTouchTrackersRef.current.isMouseDown = !1, targetWithinDownshift(event.target, downshiftElements, environment) || handleBlur(); 24704 } 24705 function onTouchStart() { 24706 mouseAndTouchTrackersRef.current.isTouchEnd = !1, mouseAndTouchTrackersRef.current.isTouchMove = !1; 24707 } 24708 function onTouchMove() { 24709 mouseAndTouchTrackersRef.current.isTouchMove = !0; 24710 } 24711 function onTouchEnd(event) { 24712 mouseAndTouchTrackersRef.current.isTouchEnd = !0, !mouseAndTouchTrackersRef.current.isTouchMove && !targetWithinDownshift(event.target, downshiftElements, environment, !1) && handleBlur(); 24713 } 24714 return environment.addEventListener("mousedown", onMouseDown), environment.addEventListener("mouseup", onMouseUp), environment.addEventListener("touchstart", onTouchStart), environment.addEventListener("touchmove", onTouchMove), environment.addEventListener("touchend", onTouchEnd), function() { 24715 environment.removeEventListener("mousedown", onMouseDown), environment.removeEventListener("mouseup", onMouseUp), environment.removeEventListener("touchstart", onTouchStart), environment.removeEventListener("touchmove", onTouchMove), environment.removeEventListener("touchend", onTouchEnd); 24716 }; 24717 }, [downshiftElementsRefs, environment, handleBlur]), mouseAndTouchTrackersRef.current; 24718} 24719var useGetterPropsCalledChecker = function() { 24720 return noop4; 24721}; 24722function useA11yMessageStatus(getA11yStatusMessage2, options2, dependencyArray, environment) { 24723 environment === void 0 && (environment = {}); 24724 var document11 = environment.document, isInitialMount = useIsInitialMount(); 24725 useEffect(function() { 24726 if (!(!getA11yStatusMessage2 || isInitialMount || !document11)) { 24727 var status = getA11yStatusMessage2(options2); 24728 updateA11yStatus(status, document11); 24729 } 24730 }, dependencyArray), useEffect(function() { 24731 return function() { 24732 updateA11yStatus.cancel(), cleanupStatusDiv(document11); 24733 }; 24734 }, [document11]); 24735} 24736function useScrollIntoView(_ref3) { 24737 var highlightedIndex = _ref3.highlightedIndex, isOpen = _ref3.isOpen, itemRefs = _ref3.itemRefs, getItemNodeFromIndex = _ref3.getItemNodeFromIndex, menuElement = _ref3.menuElement, scrollIntoViewProp = _ref3.scrollIntoView, shouldScrollRef = useRef(!0); 24738 return useIsomorphicLayoutEffect2(function() { 24739 highlightedIndex < 0 || !isOpen || !Object.keys(itemRefs.current).length || (shouldScrollRef.current === !1 ? shouldScrollRef.current = !0 : scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex), menuElement)); 24740 }, [highlightedIndex]), shouldScrollRef; 24741} 24742var useControlPropsValidator = noop4; 24743function getChangesOnSelection(props, highlightedIndex, inputValue) { 24744 var _props$items; 24745 inputValue === void 0 && (inputValue = !0); 24746 var shouldSelect = ((_props$items = props.items) == null ? void 0 : _props$items.length) && highlightedIndex >= 0; 24747 return _extends({ 24748 isOpen: !1, 24749 highlightedIndex: -1 24750 }, shouldSelect && _extends({ 24751 selectedItem: props.items[highlightedIndex], 24752 isOpen: getDefaultValue$1(props, "isOpen"), 24753 highlightedIndex: getDefaultValue$1(props, "highlightedIndex") 24754 }, inputValue && { 24755 inputValue: props.itemToString(props.items[highlightedIndex]) 24756 })); 24757} 24758function isDropdownsStateEqual(prevState, newState) { 24759 return prevState.isOpen === newState.isOpen && prevState.inputValue === newState.inputValue && prevState.highlightedIndex === newState.highlightedIndex && prevState.selectedItem === newState.selectedItem; 24760} 24761function useIsInitialMount() { 24762 var isInitialMountRef = react_default.useRef(!0); 24763 return react_default.useEffect(function() { 24764 return isInitialMountRef.current = !1, function() { 24765 isInitialMountRef.current = !0; 24766 }; 24767 }, []), isInitialMountRef.current; 24768} 24769function getDefaultHighlightedIndex(props) { 24770 var highlightedIndex = getDefaultValue$1(props, "highlightedIndex"); 24771 return highlightedIndex > -1 && props.isItemDisabled(props.items[highlightedIndex], highlightedIndex) ? -1 : highlightedIndex; 24772} 24773function getInitialHighlightedIndex(props) { 24774 var highlightedIndex = getInitialValue$1(props, "highlightedIndex"); 24775 return highlightedIndex > -1 && props.isItemDisabled(props.items[highlightedIndex], highlightedIndex) ? -1 : highlightedIndex; 24776} 24777var commonPropTypes = { 24778 environment: import_prop_types3.default.shape({ 24779 addEventListener: import_prop_types3.default.func.isRequired, 24780 removeEventListener: import_prop_types3.default.func.isRequired, 24781 document: import_prop_types3.default.shape({ 24782 createElement: import_prop_types3.default.func.isRequired, 24783 getElementById: import_prop_types3.default.func.isRequired, 24784 activeElement: import_prop_types3.default.any.isRequired, 24785 body: import_prop_types3.default.any.isRequired 24786 }).isRequired, 24787 Node: import_prop_types3.default.func.isRequired 24788 }), 24789 itemToString: import_prop_types3.default.func, 24790 itemToKey: import_prop_types3.default.func, 24791 stateReducer: import_prop_types3.default.func 24792}, commonDropdownPropTypes = _extends({}, commonPropTypes, { 24793 getA11yStatusMessage: import_prop_types3.default.func, 24794 highlightedIndex: import_prop_types3.default.number, 24795 defaultHighlightedIndex: import_prop_types3.default.number, 24796 initialHighlightedIndex: import_prop_types3.default.number, 24797 isOpen: import_prop_types3.default.bool, 24798 defaultIsOpen: import_prop_types3.default.bool, 24799 initialIsOpen: import_prop_types3.default.bool, 24800 selectedItem: import_prop_types3.default.any, 24801 initialSelectedItem: import_prop_types3.default.any, 24802 defaultSelectedItem: import_prop_types3.default.any, 24803 id: import_prop_types3.default.string, 24804 labelId: import_prop_types3.default.string, 24805 menuId: import_prop_types3.default.string, 24806 getItemId: import_prop_types3.default.func, 24807 toggleButtonId: import_prop_types3.default.string, 24808 onSelectedItemChange: import_prop_types3.default.func, 24809 onHighlightedIndexChange: import_prop_types3.default.func, 24810 onStateChange: import_prop_types3.default.func, 24811 onIsOpenChange: import_prop_types3.default.func, 24812 scrollIntoView: import_prop_types3.default.func 24813}); 24814function downshiftCommonReducer(state, action, stateChangeTypes2) { 24815 var type = action.type, props = action.props, changes; 24816 switch (type) { 24817 case stateChangeTypes2.ItemMouseMove: 24818 changes = { 24819 highlightedIndex: action.disabled ? -1 : action.index 24820 }; 24821 break; 24822 case stateChangeTypes2.MenuMouseLeave: 24823 changes = { 24824 highlightedIndex: -1 24825 }; 24826 break; 24827 case stateChangeTypes2.ToggleButtonClick: 24828 case stateChangeTypes2.FunctionToggleMenu: 24829 changes = { 24830 isOpen: !state.isOpen, 24831 highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0) 24832 }; 24833 break; 24834 case stateChangeTypes2.FunctionOpenMenu: 24835 changes = { 24836 isOpen: !0, 24837 highlightedIndex: getHighlightedIndexOnOpen(props, state, 0) 24838 }; 24839 break; 24840 case stateChangeTypes2.FunctionCloseMenu: 24841 changes = { 24842 isOpen: !1 24843 }; 24844 break; 24845 case stateChangeTypes2.FunctionSetHighlightedIndex: 24846 changes = { 24847 highlightedIndex: props.isItemDisabled(props.items[action.highlightedIndex], action.highlightedIndex) ? -1 : action.highlightedIndex 24848 }; 24849 break; 24850 case stateChangeTypes2.FunctionSetInputValue: 24851 changes = { 24852 inputValue: action.inputValue 24853 }; 24854 break; 24855 case stateChangeTypes2.FunctionReset: 24856 changes = { 24857 highlightedIndex: getDefaultHighlightedIndex(props), 24858 isOpen: getDefaultValue$1(props, "isOpen"), 24859 selectedItem: getDefaultValue$1(props, "selectedItem"), 24860 inputValue: getDefaultValue$1(props, "inputValue") 24861 }; 24862 break; 24863 default: 24864 throw new Error("Reducer called without proper action type."); 24865 } 24866 return _extends({}, state, changes); 24867} 24868function getItemIndexByCharacterKey(_a2) { 24869 for (var keysSoFar = _a2.keysSoFar, highlightedIndex = _a2.highlightedIndex, items = _a2.items, itemToString2 = _a2.itemToString, isItemDisabled2 = _a2.isItemDisabled, lowerCasedKeysSoFar = keysSoFar.toLowerCase(), index = 0; index < items.length; index++) { 24870 var offsetIndex = (index + highlightedIndex + (keysSoFar.length < 2 ? 1 : 0)) % items.length, item = items[offsetIndex]; 24871 if (item !== void 0 && itemToString2(item).toLowerCase().startsWith(lowerCasedKeysSoFar) && !isItemDisabled2(item, offsetIndex)) 24872 return offsetIndex; 24873 } 24874 return highlightedIndex; 24875} 24876var propTypes$2 = __assign(__assign({}, commonDropdownPropTypes), { items: import_prop_types3.default.array.isRequired, isItemDisabled: import_prop_types3.default.func }), defaultProps$2 = __assign(__assign({}, defaultProps$3), { isItemDisabled: function() { 24877 return !1; 24878} }), validatePropTypes$2 = noop4, ToggleButtonClick$1 = 0, ToggleButtonKeyDownArrowDown = 1, ToggleButtonKeyDownArrowUp = 2, ToggleButtonKeyDownCharacter = 3, ToggleButtonKeyDownEscape = 4, ToggleButtonKeyDownHome = 5, ToggleButtonKeyDownEnd = 6, ToggleButtonKeyDownEnter = 7, ToggleButtonKeyDownSpaceButton = 8, ToggleButtonKeyDownPageUp = 9, ToggleButtonKeyDownPageDown = 10, ToggleButtonBlur = 11, MenuMouseLeave$1 = 12, ItemMouseMove$1 = 13, ItemClick$1 = 14, FunctionToggleMenu$1 = 15, FunctionOpenMenu$1 = 16, FunctionCloseMenu$1 = 17, FunctionSetHighlightedIndex$1 = 18, FunctionSelectItem$1 = 19, FunctionSetInputValue$1 = 20, FunctionReset$2 = 21, stateChangeTypes$2 = Object.freeze({ 24879 __proto__: null, 24880 FunctionCloseMenu: FunctionCloseMenu$1, 24881 FunctionOpenMenu: FunctionOpenMenu$1, 24882 FunctionReset: FunctionReset$2, 24883 FunctionSelectItem: FunctionSelectItem$1, 24884 FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1, 24885 FunctionSetInputValue: FunctionSetInputValue$1, 24886 FunctionToggleMenu: FunctionToggleMenu$1, 24887 ItemClick: ItemClick$1, 24888 ItemMouseMove: ItemMouseMove$1, 24889 MenuMouseLeave: MenuMouseLeave$1, 24890 ToggleButtonBlur, 24891 ToggleButtonClick: ToggleButtonClick$1, 24892 ToggleButtonKeyDownArrowDown, 24893 ToggleButtonKeyDownArrowUp, 24894 ToggleButtonKeyDownCharacter, 24895 ToggleButtonKeyDownEnd, 24896 ToggleButtonKeyDownEnter, 24897 ToggleButtonKeyDownEscape, 24898 ToggleButtonKeyDownHome, 24899 ToggleButtonKeyDownPageDown, 24900 ToggleButtonKeyDownPageUp, 24901 ToggleButtonKeyDownSpaceButton 24902}); 24903function downshiftSelectReducer(state, action) { 24904 var _props$items, type = action.type, props = action.props, altKey = action.altKey, changes; 24905 switch (type) { 24906 case ItemClick$1: 24907 changes = { 24908 isOpen: getDefaultValue$1(props, "isOpen"), 24909 highlightedIndex: getDefaultHighlightedIndex(props), 24910 selectedItem: props.items[action.index] 24911 }; 24912 break; 24913 case ToggleButtonKeyDownCharacter: 24914 { 24915 var lowercasedKey = action.key, inputValue = "" + state.inputValue + lowercasedKey, prevHighlightedIndex = !state.isOpen && state.selectedItem ? props.items.findIndex(function(item) { 24916 return props.itemToKey(item) === props.itemToKey(state.selectedItem); 24917 }) : state.highlightedIndex, highlightedIndex = getItemIndexByCharacterKey({ 24918 keysSoFar: inputValue, 24919 highlightedIndex: prevHighlightedIndex, 24920 items: props.items, 24921 itemToString: props.itemToString, 24922 isItemDisabled: props.isItemDisabled 24923 }); 24924 changes = { 24925 inputValue, 24926 highlightedIndex, 24927 isOpen: !0 24928 }; 24929 } 24930 break; 24931 case ToggleButtonKeyDownArrowDown: 24932 { 24933 var _highlightedIndex = state.isOpen ? getHighlightedIndex(state.highlightedIndex, 1, props.items, props.isItemDisabled) : altKey && state.selectedItem == null ? -1 : getHighlightedIndexOnOpen(props, state, 1); 24934 changes = { 24935 highlightedIndex: _highlightedIndex, 24936 isOpen: !0 24937 }; 24938 } 24939 break; 24940 case ToggleButtonKeyDownArrowUp: 24941 if (state.isOpen && altKey) 24942 changes = getChangesOnSelection(props, state.highlightedIndex, !1); 24943 else { 24944 var _highlightedIndex2 = state.isOpen ? getHighlightedIndex(state.highlightedIndex, -1, props.items, props.isItemDisabled) : getHighlightedIndexOnOpen(props, state, -1); 24945 changes = { 24946 highlightedIndex: _highlightedIndex2, 24947 isOpen: !0 24948 }; 24949 } 24950 break; 24951 // only triggered when menu is open. 24952 case ToggleButtonKeyDownEnter: 24953 case ToggleButtonKeyDownSpaceButton: 24954 changes = getChangesOnSelection(props, state.highlightedIndex, !1); 24955 break; 24956 case ToggleButtonKeyDownHome: 24957 changes = { 24958 highlightedIndex: getNonDisabledIndex(0, !1, props.items, props.isItemDisabled), 24959 isOpen: !0 24960 }; 24961 break; 24962 case ToggleButtonKeyDownEnd: 24963 changes = { 24964 highlightedIndex: getNonDisabledIndex(props.items.length - 1, !0, props.items, props.isItemDisabled), 24965 isOpen: !0 24966 }; 24967 break; 24968 case ToggleButtonKeyDownPageUp: 24969 changes = { 24970 highlightedIndex: getHighlightedIndex(state.highlightedIndex, -10, props.items, props.isItemDisabled) 24971 }; 24972 break; 24973 case ToggleButtonKeyDownPageDown: 24974 changes = { 24975 highlightedIndex: getHighlightedIndex(state.highlightedIndex, 10, props.items, props.isItemDisabled) 24976 }; 24977 break; 24978 case ToggleButtonKeyDownEscape: 24979 changes = { 24980 isOpen: !1, 24981 highlightedIndex: -1 24982 }; 24983 break; 24984 case ToggleButtonBlur: 24985 changes = _extends({ 24986 isOpen: !1, 24987 highlightedIndex: -1 24988 }, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && { 24989 selectedItem: props.items[state.highlightedIndex] 24990 }); 24991 break; 24992 case FunctionSelectItem$1: 24993 changes = { 24994 selectedItem: action.selectedItem 24995 }; 24996 break; 24997 default: 24998 return downshiftCommonReducer(state, action, stateChangeTypes$2); 24999 } 25000 return _extends({}, state, changes); 25001} 25002var _excluded$2 = ["onClick"], _excluded2$2 = ["onMouseLeave", "refKey", "ref"], _excluded3$1 = ["onBlur", "onClick", "onPress", "onKeyDown", "refKey", "ref"], _excluded4$1 = ["item", "index", "onMouseMove", "onClick", "onMouseDown", "onPress", "refKey", "disabled", "ref"]; 25003useSelect.stateChangeTypes = stateChangeTypes$2; 25004function useSelect(userProps) { 25005 userProps === void 0 && (userProps = {}), validatePropTypes$2(userProps, useSelect); 25006 var props = _extends({}, defaultProps$2, userProps), scrollIntoView3 = props.scrollIntoView, environment = props.environment, getA11yStatusMessage2 = props.getA11yStatusMessage, _useControlledReducer = useControlledReducer$1(downshiftSelectReducer, props, getInitialState$2, isDropdownsStateEqual), state = _useControlledReducer[0], dispatch = _useControlledReducer[1], isOpen = state.isOpen, highlightedIndex = state.highlightedIndex, selectedItem = state.selectedItem, inputValue = state.inputValue, toggleButtonRef = useRef(null), menuRef = useRef(null), itemRefs = useRef({}), clearTimeoutRef = useRef(null), elementIds = useElementIds(props), latest = useLatestRef({ 25007 state, 25008 props 25009 }), getItemNodeFromIndex = useCallback(function(index) { 25010 return itemRefs.current[elementIds.getItemId(index)]; 25011 }, [elementIds]); 25012 useA11yMessageStatus(getA11yStatusMessage2, state, [isOpen, highlightedIndex, selectedItem, inputValue], environment); 25013 var shouldScrollRef = useScrollIntoView({ 25014 menuElement: menuRef.current, 25015 highlightedIndex, 25016 isOpen, 25017 itemRefs, 25018 scrollIntoView: scrollIntoView3, 25019 getItemNodeFromIndex 25020 }); 25021 useEffect(function() { 25022 return clearTimeoutRef.current = debounce4(function(outerDispatch) { 25023 outerDispatch({ 25024 type: FunctionSetInputValue$1, 25025 inputValue: "" 25026 }); 25027 }, 500), function() { 25028 clearTimeoutRef.current.cancel(); 25029 }; 25030 }, []), useEffect(function() { 25031 inputValue && clearTimeoutRef.current(dispatch); 25032 }, [dispatch, inputValue]), useControlPropsValidator({ 25033 props, 25034 state 25035 }), useEffect(function() { 25036 var focusOnOpen = getInitialValue$1(props, "isOpen"); 25037 focusOnOpen && toggleButtonRef.current && toggleButtonRef.current.focus(); 25038 }, []); 25039 var mouseAndTouchTrackers = useMouseAndTouchTracker(environment, useCallback(function() { 25040 latest.current.state.isOpen && dispatch({ 25041 type: ToggleButtonBlur 25042 }); 25043 }, [dispatch, latest]), useMemo(function() { 25044 return [menuRef, toggleButtonRef]; 25045 }, [menuRef.current, toggleButtonRef.current])), setGetterPropCallInfo = useGetterPropsCalledChecker("getMenuProps", "getToggleButtonProps"); 25046 useEffect(function() { 25047 isOpen || (itemRefs.current = {}); 25048 }, [isOpen]); 25049 var toggleButtonKeyDownHandlers = useMemo(function() { 25050 return { 25051 ArrowDown: function(event) { 25052 event.preventDefault(), dispatch({ 25053 type: ToggleButtonKeyDownArrowDown, 25054 altKey: event.altKey 25055 }); 25056 }, 25057 ArrowUp: function(event) { 25058 event.preventDefault(), dispatch({ 25059 type: ToggleButtonKeyDownArrowUp, 25060 altKey: event.altKey 25061 }); 25062 }, 25063 Home: function(event) { 25064 event.preventDefault(), dispatch({ 25065 type: ToggleButtonKeyDownHome 25066 }); 25067 }, 25068 End: function(event) { 25069 event.preventDefault(), dispatch({ 25070 type: ToggleButtonKeyDownEnd 25071 }); 25072 }, 25073 Escape: function() { 25074 latest.current.state.isOpen && dispatch({ 25075 type: ToggleButtonKeyDownEscape 25076 }); 25077 }, 25078 Enter: function(event) { 25079 event.preventDefault(), dispatch({ 25080 type: latest.current.state.isOpen ? ToggleButtonKeyDownEnter : ToggleButtonClick$1 25081 }); 25082 }, 25083 PageUp: function(event) { 25084 latest.current.state.isOpen && (event.preventDefault(), dispatch({ 25085 type: ToggleButtonKeyDownPageUp 25086 })); 25087 }, 25088 PageDown: function(event) { 25089 latest.current.state.isOpen && (event.preventDefault(), dispatch({ 25090 type: ToggleButtonKeyDownPageDown 25091 })); 25092 }, 25093 " ": function(event) { 25094 event.preventDefault(); 25095 var currentState = latest.current.state; 25096 if (!currentState.isOpen) { 25097 dispatch({ 25098 type: ToggleButtonClick$1 25099 }); 25100 return; 25101 } 25102 currentState.inputValue ? dispatch({ 25103 type: ToggleButtonKeyDownCharacter, 25104 key: " " 25105 }) : dispatch({ 25106 type: ToggleButtonKeyDownSpaceButton 25107 }); 25108 } 25109 }; 25110 }, [dispatch, latest]), toggleMenu = useCallback(function() { 25111 dispatch({ 25112 type: FunctionToggleMenu$1 25113 }); 25114 }, [dispatch]), closeMenu = useCallback(function() { 25115 dispatch({ 25116 type: FunctionCloseMenu$1 25117 }); 25118 }, [dispatch]), openMenu = useCallback(function() { 25119 dispatch({ 25120 type: FunctionOpenMenu$1 25121 }); 25122 }, [dispatch]), setHighlightedIndex = useCallback(function(newHighlightedIndex) { 25123 dispatch({ 25124 type: FunctionSetHighlightedIndex$1, 25125 highlightedIndex: newHighlightedIndex 25126 }); 25127 }, [dispatch]), selectItem = useCallback(function(newSelectedItem) { 25128 dispatch({ 25129 type: FunctionSelectItem$1, 25130 selectedItem: newSelectedItem 25131 }); 25132 }, [dispatch]), reset = useCallback(function() { 25133 dispatch({ 25134 type: FunctionReset$2 25135 }); 25136 }, [dispatch]), setInputValue = useCallback(function(newInputValue) { 25137 dispatch({ 25138 type: FunctionSetInputValue$1, 25139 inputValue: newInputValue 25140 }); 25141 }, [dispatch]), getLabelProps = useCallback(function(_temp) { 25142 var _ref = _temp === void 0 ? {} : _temp, onClick = _ref.onClick, labelProps = _objectWithoutPropertiesLoose2(_ref, _excluded$2), labelHandleClick = function() { 25143 var _toggleButtonRef$curr; 25144 (_toggleButtonRef$curr = toggleButtonRef.current) == null || _toggleButtonRef$curr.focus(); 25145 }; 25146 return _extends({ 25147 id: elementIds.labelId, 25148 htmlFor: elementIds.toggleButtonId, 25149 onClick: callAllEventHandlers(onClick, labelHandleClick) 25150 }, labelProps); 25151 }, [elementIds]), getMenuProps = useCallback(function(_temp2, _temp3) { 25152 var _extends22, _ref2 = _temp2 === void 0 ? {} : _temp2, onMouseLeave = _ref2.onMouseLeave, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, ref = _ref2.ref, rest2 = _objectWithoutPropertiesLoose2(_ref2, _excluded2$2), _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$suppressRefErro = _ref3.suppressRefError, suppressRefError = _ref3$suppressRefErro === void 0 ? !1 : _ref3$suppressRefErro, menuHandleMouseLeave = function() { 25153 dispatch({ 25154 type: MenuMouseLeave$1 25155 }); 25156 }; 25157 return setGetterPropCallInfo("getMenuProps", suppressRefError, refKey, menuRef), _extends((_extends22 = {}, _extends22[refKey] = handleRefs(ref, function(menuNode) { 25158 menuRef.current = menuNode; 25159 }), _extends22.id = elementIds.menuId, _extends22.role = "listbox", _extends22["aria-labelledby"] = rest2 && rest2["aria-label"] ? void 0 : "" + elementIds.labelId, _extends22.onMouseLeave = callAllEventHandlers(onMouseLeave, menuHandleMouseLeave), _extends22), rest2); 25160 }, [dispatch, setGetterPropCallInfo, elementIds]), getToggleButtonProps = useCallback(function(_temp4, _temp5) { 25161 var _extends3, _ref4 = _temp4 === void 0 ? {} : _temp4, onBlur = _ref4.onBlur, onClick = _ref4.onClick; 25162 _ref4.onPress; 25163 var onKeyDown = _ref4.onKeyDown, _ref4$refKey = _ref4.refKey, refKey = _ref4$refKey === void 0 ? "ref" : _ref4$refKey, ref = _ref4.ref, rest2 = _objectWithoutPropertiesLoose2(_ref4, _excluded3$1), _ref5 = _temp5 === void 0 ? {} : _temp5, _ref5$suppressRefErro = _ref5.suppressRefError, suppressRefError = _ref5$suppressRefErro === void 0 ? !1 : _ref5$suppressRefErro, latestState = latest.current.state, toggleButtonHandleClick = function() { 25164 dispatch({ 25165 type: ToggleButtonClick$1 25166 }); 25167 }, toggleButtonHandleBlur = function() { 25168 latestState.isOpen && !mouseAndTouchTrackers.isMouseDown && dispatch({ 25169 type: ToggleButtonBlur 25170 }); 25171 }, toggleButtonHandleKeyDown = function(event) { 25172 var key = normalizeArrowKey(event); 25173 key && toggleButtonKeyDownHandlers[key] ? toggleButtonKeyDownHandlers[key](event) : isAcceptedCharacterKey(key) && dispatch({ 25174 type: ToggleButtonKeyDownCharacter, 25175 key 25176 }); 25177 }, toggleProps = _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function(toggleButtonNode) { 25178 toggleButtonRef.current = toggleButtonNode; 25179 }), _extends3["aria-activedescendant"] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : "", _extends3["aria-controls"] = elementIds.menuId, _extends3["aria-expanded"] = latest.current.state.isOpen, _extends3["aria-haspopup"] = "listbox", _extends3["aria-labelledby"] = rest2 && rest2["aria-label"] ? void 0 : "" + elementIds.labelId, _extends3.id = elementIds.toggleButtonId, _extends3.role = "combobox", _extends3.tabIndex = 0, _extends3.onBlur = callAllEventHandlers(onBlur, toggleButtonHandleBlur), _extends3), rest2); 25180 return rest2.disabled || (toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick), toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown)), setGetterPropCallInfo("getToggleButtonProps", suppressRefError, refKey, toggleButtonRef), toggleProps; 25181 }, [dispatch, elementIds, latest, mouseAndTouchTrackers, setGetterPropCallInfo, toggleButtonKeyDownHandlers]), getItemProps = useCallback(function(_temp6) { 25182 var _extends4, _ref6 = _temp6 === void 0 ? {} : _temp6, itemProp = _ref6.item, indexProp = _ref6.index, onMouseMove = _ref6.onMouseMove, onClick = _ref6.onClick, onMouseDown = _ref6.onMouseDown; 25183 _ref6.onPress; 25184 var _ref6$refKey = _ref6.refKey, refKey = _ref6$refKey === void 0 ? "ref" : _ref6$refKey, disabledProp = _ref6.disabled, ref = _ref6.ref, rest2 = _objectWithoutPropertiesLoose2(_ref6, _excluded4$1); 25185 disabledProp !== void 0 && console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.'); 25186 var _latest$current = latest.current, latestState = _latest$current.state, latestProps = _latest$current.props, _getItemAndIndex = getItemAndIndex(itemProp, indexProp, latestProps.items, "Pass either item or index to getItemProps!"), item = _getItemAndIndex[0], index = _getItemAndIndex[1], disabled = latestProps.isItemDisabled(item, index), itemHandleMouseMove = function() { 25187 mouseAndTouchTrackers.isTouchEnd || index === latestState.highlightedIndex || (shouldScrollRef.current = !1, dispatch({ 25188 type: ItemMouseMove$1, 25189 index, 25190 disabled 25191 })); 25192 }, itemHandleClick = function() { 25193 dispatch({ 25194 type: ItemClick$1, 25195 index 25196 }); 25197 }, itemHandleMouseDown = function(e2) { 25198 return e2.preventDefault(); 25199 }, itemProps = _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function(itemNode) { 25200 itemNode && (itemRefs.current[elementIds.getItemId(index)] = itemNode); 25201 }), _extends4["aria-disabled"] = disabled, _extends4["aria-selected"] = item === latestState.selectedItem, _extends4.id = elementIds.getItemId(index), _extends4.role = "option", _extends4), rest2); 25202 return disabled || (itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick)), itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove), itemProps.onMouseDown = callAllEventHandlers(onMouseDown, itemHandleMouseDown), itemProps; 25203 }, [latest, elementIds, mouseAndTouchTrackers, shouldScrollRef, dispatch]); 25204 return { 25205 // prop getters. 25206 getToggleButtonProps, 25207 getLabelProps, 25208 getMenuProps, 25209 getItemProps, 25210 // actions. 25211 toggleMenu, 25212 openMenu, 25213 closeMenu, 25214 setHighlightedIndex, 25215 selectItem, 25216 reset, 25217 setInputValue, 25218 // state. 25219 highlightedIndex, 25220 isOpen, 25221 selectedItem, 25222 inputValue 25223 }; 25224} 25225var InputKeyDownArrowDown = 0, InputKeyDownArrowUp = 1, InputKeyDownEscape = 2, InputKeyDownHome = 3, InputKeyDownEnd = 4, InputKeyDownPageUp = 5, InputKeyDownPageDown = 6, InputKeyDownEnter = 7, InputChange = 8, InputBlur = 9, InputClick = 10, MenuMouseLeave = 11, ItemMouseMove = 12, ItemClick = 13, ToggleButtonClick = 14, FunctionToggleMenu = 15, FunctionOpenMenu = 16, FunctionCloseMenu = 17, FunctionSetHighlightedIndex = 18, FunctionSelectItem = 19, FunctionSetInputValue = 20, FunctionReset$1 = 21, ControlledPropUpdatedSelectedItem = 22, stateChangeTypes$1 = Object.freeze({ 25226 __proto__: null, 25227 ControlledPropUpdatedSelectedItem, 25228 FunctionCloseMenu, 25229 FunctionOpenMenu, 25230 FunctionReset: FunctionReset$1, 25231 FunctionSelectItem, 25232 FunctionSetHighlightedIndex, 25233 FunctionSetInputValue, 25234 FunctionToggleMenu, 25235 InputBlur, 25236 InputChange, 25237 InputClick, 25238 InputKeyDownArrowDown, 25239 InputKeyDownArrowUp, 25240 InputKeyDownEnd, 25241 InputKeyDownEnter, 25242 InputKeyDownEscape, 25243 InputKeyDownHome, 25244 InputKeyDownPageDown, 25245 InputKeyDownPageUp, 25246 ItemClick, 25247 ItemMouseMove, 25248 MenuMouseLeave, 25249 ToggleButtonClick 25250}); 25251function getInitialState$1(props) { 25252 var initialState = getInitialState$2(props), selectedItem = initialState.selectedItem, inputValue = initialState.inputValue; 25253 return inputValue === "" && selectedItem && props.defaultInputValue === void 0 && props.initialInputValue === void 0 && props.inputValue === void 0 && (inputValue = props.itemToString(selectedItem)), _extends({}, initialState, { 25254 inputValue 25255 }); 25256} 25257var propTypes$1 = _extends({}, commonDropdownPropTypes, { 25258 items: import_prop_types3.default.array.isRequired, 25259 isItemDisabled: import_prop_types3.default.func, 25260 inputValue: import_prop_types3.default.string, 25261 defaultInputValue: import_prop_types3.default.string, 25262 initialInputValue: import_prop_types3.default.string, 25263 inputId: import_prop_types3.default.string, 25264 onInputValueChange: import_prop_types3.default.func 25265}); 25266function useControlledReducer(reducer, props, createInitialState, isStateEqual2) { 25267 var previousSelectedItemRef = useRef(), _useEnhancedReducer = useEnhancedReducer(reducer, props, createInitialState, isStateEqual2), state = _useEnhancedReducer[0], dispatch = _useEnhancedReducer[1], isInitialMount = useIsInitialMount(); 25268 return useEffect(function() { 25269 if (isControlledProp(props, "selectedItem")) { 25270 if (!isInitialMount) { 25271 var shouldCallDispatch = props.itemToKey(props.selectedItem) !== props.itemToKey(previousSelectedItemRef.current); 25272 shouldCallDispatch && dispatch({ 25273 type: ControlledPropUpdatedSelectedItem, 25274 inputValue: props.itemToString(props.selectedItem) 25275 }); 25276 } 25277 previousSelectedItemRef.current = state.selectedItem === previousSelectedItemRef.current ? props.selectedItem : state.selectedItem; 25278 } 25279 }, [state.selectedItem, props.selectedItem]), [getState2(state, props), dispatch]; 25280} 25281var validatePropTypes$1 = noop4, defaultProps$1 = _extends({}, defaultProps$3, { 25282 isItemDisabled: function() { 25283 return !1; 25284 } 25285}); 25286function downshiftUseComboboxReducer(state, action) { 25287 var _props$items, type = action.type, props = action.props, altKey = action.altKey, changes; 25288 switch (type) { 25289 case ItemClick: 25290 changes = { 25291 isOpen: getDefaultValue$1(props, "isOpen"), 25292 highlightedIndex: getDefaultHighlightedIndex(props), 25293 selectedItem: props.items[action.index], 25294 inputValue: props.itemToString(props.items[action.index]) 25295 }; 25296 break; 25297 case InputKeyDownArrowDown: 25298 state.isOpen ? changes = { 25299 highlightedIndex: getHighlightedIndex(state.highlightedIndex, 1, props.items, props.isItemDisabled, !0) 25300 } : changes = { 25301 highlightedIndex: altKey && state.selectedItem == null ? -1 : getHighlightedIndexOnOpen(props, state, 1), 25302 isOpen: props.items.length >= 0 25303 }; 25304 break; 25305 case InputKeyDownArrowUp: 25306 state.isOpen ? altKey ? changes = getChangesOnSelection(props, state.highlightedIndex) : changes = { 25307 highlightedIndex: getHighlightedIndex(state.highlightedIndex, -1, props.items, props.isItemDisabled, !0) 25308 } : changes = { 25309 highlightedIndex: getHighlightedIndexOnOpen(props, state, -1), 25310 isOpen: props.items.length >= 0 25311 }; 25312 break; 25313 case InputKeyDownEnter: 25314 changes = getChangesOnSelection(props, state.highlightedIndex); 25315 break; 25316 case InputKeyDownEscape: 25317 changes = _extends({ 25318 isOpen: !1, 25319 highlightedIndex: -1 25320 }, !state.isOpen && { 25321 selectedItem: null, 25322 inputValue: "" 25323 }); 25324 break; 25325 case InputKeyDownPageUp: 25326 changes = { 25327 highlightedIndex: getHighlightedIndex(state.highlightedIndex, -10, props.items, props.isItemDisabled, !0) 25328 }; 25329 break; 25330 case InputKeyDownPageDown: 25331 changes = { 25332 highlightedIndex: getHighlightedIndex(state.highlightedIndex, 10, props.items, props.isItemDisabled, !0) 25333 }; 25334 break; 25335 case InputKeyDownHome: 25336 changes = { 25337 highlightedIndex: getNonDisabledIndex(0, !1, props.items, props.isItemDisabled) 25338 }; 25339 break; 25340 case InputKeyDownEnd: 25341 changes = { 25342 highlightedIndex: getNonDisabledIndex(props.items.length - 1, !0, props.items, props.isItemDisabled) 25343 }; 25344 break; 25345 case InputBlur: 25346 changes = _extends({ 25347 isOpen: !1, 25348 highlightedIndex: -1 25349 }, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && action.selectItem && { 25350 selectedItem: props.items[state.highlightedIndex], 25351 inputValue: props.itemToString(props.items[state.highlightedIndex]) 25352 }); 25353 break; 25354 case InputChange: 25355 changes = { 25356 isOpen: !0, 25357 highlightedIndex: getDefaultHighlightedIndex(props), 25358 inputValue: action.inputValue 25359 }; 25360 break; 25361 case InputClick: 25362 changes = { 25363 isOpen: !state.isOpen, 25364 highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0) 25365 }; 25366 break; 25367 case FunctionSelectItem: 25368 changes = { 25369 selectedItem: action.selectedItem, 25370 inputValue: props.itemToString(action.selectedItem) 25371 }; 25372 break; 25373 case ControlledPropUpdatedSelectedItem: 25374 changes = { 25375 inputValue: action.inputValue 25376 }; 25377 break; 25378 default: 25379 return downshiftCommonReducer(state, action, stateChangeTypes$1); 25380 } 25381 return _extends({}, state, changes); 25382} 25383var _excluded$12 = ["onMouseLeave", "refKey", "ref"], _excluded2$1 = ["item", "index", "refKey", "ref", "onMouseMove", "onMouseDown", "onClick", "onPress", "disabled"], _excluded3 = ["onClick", "onPress", "refKey", "ref"], _excluded4 = ["onKeyDown", "onChange", "onInput", "onBlur", "onChangeText", "onClick", "refKey", "ref"]; 25384useCombobox.stateChangeTypes = stateChangeTypes$1; 25385function useCombobox(userProps) { 25386 userProps === void 0 && (userProps = {}), validatePropTypes$1(userProps, useCombobox); 25387 var props = _extends({}, defaultProps$1, userProps), items = props.items, scrollIntoView3 = props.scrollIntoView, environment = props.environment, getA11yStatusMessage2 = props.getA11yStatusMessage, _useControlledReducer = useControlledReducer(downshiftUseComboboxReducer, props, getInitialState$1, isDropdownsStateEqual), state = _useControlledReducer[0], dispatch = _useControlledReducer[1], isOpen = state.isOpen, highlightedIndex = state.highlightedIndex, selectedItem = state.selectedItem, inputValue = state.inputValue, menuRef = useRef(null), itemRefs = useRef({}), inputRef = useRef(null), toggleButtonRef = useRef(null), isInitialMount = useIsInitialMount(), elementIds = useElementIds(props), previousResultCountRef = useRef(), latest = useLatestRef({ 25388 state, 25389 props 25390 }), getItemNodeFromIndex = useCallback(function(index) { 25391 return itemRefs.current[elementIds.getItemId(index)]; 25392 }, [elementIds]); 25393 useA11yMessageStatus(getA11yStatusMessage2, state, [isOpen, highlightedIndex, selectedItem, inputValue], environment); 25394 var shouldScrollRef = useScrollIntoView({ 25395 menuElement: menuRef.current, 25396 highlightedIndex, 25397 isOpen, 25398 itemRefs, 25399 scrollIntoView: scrollIntoView3, 25400 getItemNodeFromIndex 25401 }); 25402 useControlPropsValidator({ 25403 props, 25404 state 25405 }), useEffect(function() { 25406 var focusOnOpen = getInitialValue$1(props, "isOpen"); 25407 focusOnOpen && inputRef.current && inputRef.current.focus(); 25408 }, []), useEffect(function() { 25409 isInitialMount || (previousResultCountRef.current = items.length); 25410 }); 25411 var mouseAndTouchTrackers = useMouseAndTouchTracker(environment, useCallback(function() { 25412 latest.current.state.isOpen && dispatch({ 25413 type: InputBlur, 25414 selectItem: !1 25415 }); 25416 }, [dispatch, latest]), useMemo(function() { 25417 return [menuRef, toggleButtonRef, inputRef]; 25418 }, [menuRef.current, toggleButtonRef.current, inputRef.current])), setGetterPropCallInfo = useGetterPropsCalledChecker("getInputProps", "getMenuProps"); 25419 useEffect(function() { 25420 isOpen || (itemRefs.current = {}); 25421 }, [isOpen]), useEffect(function() { 25422 var _inputRef$current; 25423 !isOpen || !(environment != null && environment.document) || !(inputRef != null && (_inputRef$current = inputRef.current) != null && _inputRef$current.focus) || environment.document.activeElement !== inputRef.current && inputRef.current.focus(); 25424 }, [isOpen, environment]); 25425 var inputKeyDownHandlers = useMemo(function() { 25426 return { 25427 ArrowDown: function(event) { 25428 event.preventDefault(), dispatch({ 25429 type: InputKeyDownArrowDown, 25430 altKey: event.altKey 25431 }); 25432 }, 25433 ArrowUp: function(event) { 25434 event.preventDefault(), dispatch({ 25435 type: InputKeyDownArrowUp, 25436 altKey: event.altKey 25437 }); 25438 }, 25439 Home: function(event) { 25440 latest.current.state.isOpen && (event.preventDefault(), dispatch({ 25441 type: InputKeyDownHome 25442 })); 25443 }, 25444 End: function(event) { 25445 latest.current.state.isOpen && (event.preventDefault(), dispatch({ 25446 type: InputKeyDownEnd 25447 })); 25448 }, 25449 Escape: function(event) { 25450 var latestState = latest.current.state; 25451 (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) && (event.preventDefault(), dispatch({ 25452 type: InputKeyDownEscape 25453 })); 25454 }, 25455 Enter: function(event) { 25456 var latestState = latest.current.state; 25457 !latestState.isOpen || event.which === 229 || (event.preventDefault(), dispatch({ 25458 type: InputKeyDownEnter 25459 })); 25460 }, 25461 PageUp: function(event) { 25462 latest.current.state.isOpen && (event.preventDefault(), dispatch({ 25463 type: InputKeyDownPageUp 25464 })); 25465 }, 25466 PageDown: function(event) { 25467 latest.current.state.isOpen && (event.preventDefault(), dispatch({ 25468 type: InputKeyDownPageDown 25469 })); 25470 } 25471 }; 25472 }, [dispatch, latest]), getLabelProps = useCallback(function(labelProps) { 25473 return _extends({ 25474 id: elementIds.labelId, 25475 htmlFor: elementIds.inputId 25476 }, labelProps); 25477 }, [elementIds]), getMenuProps = useCallback(function(_temp, _temp2) { 25478 var _extends22, _ref = _temp === void 0 ? {} : _temp, onMouseLeave = _ref.onMouseLeave, _ref$refKey = _ref.refKey, refKey = _ref$refKey === void 0 ? "ref" : _ref$refKey, ref = _ref.ref, rest2 = _objectWithoutPropertiesLoose2(_ref, _excluded$12), _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$suppressRefErro = _ref2.suppressRefError, suppressRefError = _ref2$suppressRefErro === void 0 ? !1 : _ref2$suppressRefErro; 25479 return setGetterPropCallInfo("getMenuProps", suppressRefError, refKey, menuRef), _extends((_extends22 = {}, _extends22[refKey] = handleRefs(ref, function(menuNode) { 25480 menuRef.current = menuNode; 25481 }), _extends22.id = elementIds.menuId, _extends22.role = "listbox", _extends22["aria-labelledby"] = rest2 && rest2["aria-label"] ? void 0 : "" + elementIds.labelId, _extends22.onMouseLeave = callAllEventHandlers(onMouseLeave, function() { 25482 dispatch({ 25483 type: MenuMouseLeave 25484 }); 25485 }), _extends22), rest2); 25486 }, [dispatch, setGetterPropCallInfo, elementIds]), getItemProps = useCallback(function(_temp3) { 25487 var _extends3, _ref4, _ref3 = _temp3 === void 0 ? {} : _temp3, itemProp = _ref3.item, indexProp = _ref3.index, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, ref = _ref3.ref, onMouseMove = _ref3.onMouseMove, onMouseDown = _ref3.onMouseDown, onClick = _ref3.onClick; 25488 _ref3.onPress; 25489 var disabledProp = _ref3.disabled, rest2 = _objectWithoutPropertiesLoose2(_ref3, _excluded2$1); 25490 disabledProp !== void 0 && console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.'); 25491 var _latest$current = latest.current, latestProps = _latest$current.props, latestState = _latest$current.state, _getItemAndIndex = getItemAndIndex(itemProp, indexProp, latestProps.items, "Pass either item or index to getItemProps!"), item = _getItemAndIndex[0], index = _getItemAndIndex[1], disabled = latestProps.isItemDisabled(item, index), onSelectKey = "onClick", customClickHandler = onClick, itemHandleMouseMove = function() { 25492 mouseAndTouchTrackers.isTouchEnd || index === latestState.highlightedIndex || (shouldScrollRef.current = !1, dispatch({ 25493 type: ItemMouseMove, 25494 index, 25495 disabled 25496 })); 25497 }, itemHandleClick = function() { 25498 dispatch({ 25499 type: ItemClick, 25500 index 25501 }); 25502 }, itemHandleMouseDown = function(e2) { 25503 return e2.preventDefault(); 25504 }; 25505 return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function(itemNode) { 25506 itemNode && (itemRefs.current[elementIds.getItemId(index)] = itemNode); 25507 }), _extends3["aria-disabled"] = disabled, _extends3["aria-selected"] = index === latestState.highlightedIndex, _extends3.id = elementIds.getItemId(index), _extends3.role = "option", _extends3), !disabled && (_ref4 = {}, _ref4[onSelectKey] = callAllEventHandlers(customClickHandler, itemHandleClick), _ref4), { 25508 onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove), 25509 onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown) 25510 }, rest2); 25511 }, [dispatch, elementIds, latest, mouseAndTouchTrackers, shouldScrollRef]), getToggleButtonProps = useCallback(function(_temp4) { 25512 var _extends4, _ref5 = _temp4 === void 0 ? {} : _temp4, onClick = _ref5.onClick; 25513 _ref5.onPress; 25514 var _ref5$refKey = _ref5.refKey, refKey = _ref5$refKey === void 0 ? "ref" : _ref5$refKey, ref = _ref5.ref, rest2 = _objectWithoutPropertiesLoose2(_ref5, _excluded3), latestState = latest.current.state, toggleButtonHandleClick = function() { 25515 dispatch({ 25516 type: ToggleButtonClick 25517 }); 25518 }; 25519 return _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function(toggleButtonNode) { 25520 toggleButtonRef.current = toggleButtonNode; 25521 }), _extends4["aria-controls"] = elementIds.menuId, _extends4["aria-expanded"] = latestState.isOpen, _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest2.disabled && _extends({}, { 25522 onClick: callAllEventHandlers(onClick, toggleButtonHandleClick) 25523 }), rest2); 25524 }, [dispatch, latest, elementIds]), getInputProps = useCallback(function(_temp5, _temp6) { 25525 var _extends5, _ref6 = _temp5 === void 0 ? {} : _temp5, onKeyDown = _ref6.onKeyDown, onChange = _ref6.onChange, onInput = _ref6.onInput, onBlur = _ref6.onBlur; 25526 _ref6.onChangeText; 25527 var onClick = _ref6.onClick, _ref6$refKey = _ref6.refKey, refKey = _ref6$refKey === void 0 ? "ref" : _ref6$refKey, ref = _ref6.ref, rest2 = _objectWithoutPropertiesLoose2(_ref6, _excluded4), _ref7 = _temp6 === void 0 ? {} : _temp6, _ref7$suppressRefErro = _ref7.suppressRefError, suppressRefError = _ref7$suppressRefErro === void 0 ? !1 : _ref7$suppressRefErro; 25528 setGetterPropCallInfo("getInputProps", suppressRefError, refKey, inputRef); 25529 var latestState = latest.current.state, inputHandleKeyDown = function(event) { 25530 var key = normalizeArrowKey(event); 25531 key && inputKeyDownHandlers[key] && inputKeyDownHandlers[key](event); 25532 }, inputHandleChange = function(event) { 25533 dispatch({ 25534 type: InputChange, 25535 inputValue: event.target.value 25536 }); 25537 }, inputHandleBlur = function(event) { 25538 if (environment != null && environment.document && latestState.isOpen && !mouseAndTouchTrackers.isMouseDown) { 25539 var isBlurByTabChange = event.relatedTarget === null && environment.document.activeElement !== environment.document.body; 25540 dispatch({ 25541 type: InputBlur, 25542 selectItem: !isBlurByTabChange 25543 }); 25544 } 25545 }, inputHandleClick = function() { 25546 dispatch({ 25547 type: InputClick 25548 }); 25549 }, onChangeKey = "onChange", eventHandlers = {}; 25550 if (!rest2.disabled) { 25551 var _eventHandlers; 25552 eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, inputHandleBlur), _eventHandlers.onClick = callAllEventHandlers(onClick, inputHandleClick), _eventHandlers); 25553 } 25554 return _extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function(inputNode) { 25555 inputRef.current = inputNode; 25556 }), _extends5["aria-activedescendant"] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : "", _extends5["aria-autocomplete"] = "list", _extends5["aria-controls"] = elementIds.menuId, _extends5["aria-expanded"] = latestState.isOpen, _extends5["aria-labelledby"] = rest2 && rest2["aria-label"] ? void 0 : elementIds.labelId, _extends5.autoComplete = "off", _extends5.id = elementIds.inputId, _extends5.role = "combobox", _extends5.value = latestState.inputValue, _extends5), eventHandlers, rest2); 25557 }, [dispatch, elementIds, environment, inputKeyDownHandlers, latest, mouseAndTouchTrackers, setGetterPropCallInfo]), toggleMenu = useCallback(function() { 25558 dispatch({ 25559 type: FunctionToggleMenu 25560 }); 25561 }, [dispatch]), closeMenu = useCallback(function() { 25562 dispatch({ 25563 type: FunctionCloseMenu 25564 }); 25565 }, [dispatch]), openMenu = useCallback(function() { 25566 dispatch({ 25567 type: FunctionOpenMenu 25568 }); 25569 }, [dispatch]), setHighlightedIndex = useCallback(function(newHighlightedIndex) { 25570 dispatch({ 25571 type: FunctionSetHighlightedIndex, 25572 highlightedIndex: newHighlightedIndex 25573 }); 25574 }, [dispatch]), selectItem = useCallback(function(newSelectedItem) { 25575 dispatch({ 25576 type: FunctionSelectItem, 25577 selectedItem: newSelectedItem 25578 }); 25579 }, [dispatch]), setInputValue = useCallback(function(newInputValue) { 25580 dispatch({ 25581 type: FunctionSetInputValue, 25582 inputValue: newInputValue 25583 }); 25584 }, [dispatch]), reset = useCallback(function() { 25585 dispatch({ 25586 type: FunctionReset$1 25587 }); 25588 }, [dispatch]); 25589 return { 25590 // prop getters. 25591 getItemProps, 25592 getLabelProps, 25593 getMenuProps, 25594 getInputProps, 25595 getToggleButtonProps, 25596 // actions. 25597 toggleMenu, 25598 openMenu, 25599 closeMenu, 25600 setHighlightedIndex, 25601 setInputValue, 25602 selectItem, 25603 reset, 25604 // state. 25605 highlightedIndex, 25606 isOpen, 25607 selectedItem, 25608 inputValue 25609 }; 25610} 25611var defaultStateValues = { 25612 activeIndex: -1, 25613 selectedItems: [] 25614}; 25615function getInitialValue(props, propKey) { 25616 return getInitialValue$1(props, propKey, defaultStateValues); 25617} 25618function getDefaultValue(props, propKey) { 25619 return getDefaultValue$1(props, propKey, defaultStateValues); 25620} 25621function getInitialState(props) { 25622 var activeIndex = getInitialValue(props, "activeIndex"), selectedItems = getInitialValue(props, "selectedItems"); 25623 return { 25624 activeIndex, 25625 selectedItems 25626 }; 25627} 25628function isKeyDownOperationPermitted(event) { 25629 if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) 25630 return !1; 25631 var element = event.target; 25632 return !(element instanceof HTMLInputElement && // if element is a text input 25633 element.value !== "" && // and we have text in it 25634 // and cursor is either not at the start or is currently highlighting text. 25635 (element.selectionStart !== 0 || element.selectionEnd !== 0)); 25636} 25637function isStateEqual(prevState, newState) { 25638 return prevState.selectedItems === newState.selectedItems && prevState.activeIndex === newState.activeIndex; 25639} 25640var propTypes = { 25641 stateReducer: commonPropTypes.stateReducer, 25642 itemToKey: commonPropTypes.itemToKey, 25643 environment: commonPropTypes.environment, 25644 selectedItems: import_prop_types3.default.array, 25645 initialSelectedItems: import_prop_types3.default.array, 25646 defaultSelectedItems: import_prop_types3.default.array, 25647 getA11yStatusMessage: import_prop_types3.default.func, 25648 activeIndex: import_prop_types3.default.number, 25649 initialActiveIndex: import_prop_types3.default.number, 25650 defaultActiveIndex: import_prop_types3.default.number, 25651 onActiveIndexChange: import_prop_types3.default.func, 25652 onSelectedItemsChange: import_prop_types3.default.func, 25653 keyNavigationNext: import_prop_types3.default.string, 25654 keyNavigationPrevious: import_prop_types3.default.string 25655}, defaultProps2 = { 25656 itemToKey: defaultProps$3.itemToKey, 25657 stateReducer: defaultProps$3.stateReducer, 25658 environment: defaultProps$3.environment, 25659 keyNavigationNext: "ArrowRight", 25660 keyNavigationPrevious: "ArrowLeft" 25661}, validatePropTypes = noop4, SelectedItemClick = 0, SelectedItemKeyDownDelete = 1, SelectedItemKeyDownBackspace = 2, SelectedItemKeyDownNavigationNext = 3, SelectedItemKeyDownNavigationPrevious = 4, DropdownKeyDownNavigationPrevious = 5, DropdownKeyDownBackspace = 6, DropdownClick = 7, FunctionAddSelectedItem = 8, FunctionRemoveSelectedItem = 9, FunctionSetSelectedItems = 10, FunctionSetActiveIndex = 11, FunctionReset = 12, stateChangeTypes = Object.freeze({ 25662 __proto__: null, 25663 DropdownClick, 25664 DropdownKeyDownBackspace, 25665 DropdownKeyDownNavigationPrevious, 25666 FunctionAddSelectedItem, 25667 FunctionRemoveSelectedItem, 25668 FunctionReset, 25669 FunctionSetActiveIndex, 25670 FunctionSetSelectedItems, 25671 SelectedItemClick, 25672 SelectedItemKeyDownBackspace, 25673 SelectedItemKeyDownDelete, 25674 SelectedItemKeyDownNavigationNext, 25675 SelectedItemKeyDownNavigationPrevious 25676}); 25677function downshiftMultipleSelectionReducer(state, action) { 25678 var type = action.type, index = action.index, props = action.props, selectedItem = action.selectedItem, activeIndex = state.activeIndex, selectedItems = state.selectedItems, changes; 25679 switch (type) { 25680 case SelectedItemClick: 25681 changes = { 25682 activeIndex: index 25683 }; 25684 break; 25685 case SelectedItemKeyDownNavigationPrevious: 25686 changes = { 25687 activeIndex: activeIndex - 1 < 0 ? 0 : activeIndex - 1 25688 }; 25689 break; 25690 case SelectedItemKeyDownNavigationNext: 25691 changes = { 25692 activeIndex: activeIndex + 1 >= selectedItems.length ? -1 : activeIndex + 1 25693 }; 25694 break; 25695 case SelectedItemKeyDownBackspace: 25696 case SelectedItemKeyDownDelete: { 25697 if (activeIndex < 0) 25698 break; 25699 var newActiveIndex = activeIndex; 25700 selectedItems.length === 1 ? newActiveIndex = -1 : activeIndex === selectedItems.length - 1 && (newActiveIndex = selectedItems.length - 2), changes = _extends({ 25701 selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1)) 25702 }, { 25703 activeIndex: newActiveIndex 25704 }); 25705 break; 25706 } 25707 case DropdownKeyDownNavigationPrevious: 25708 changes = { 25709 activeIndex: selectedItems.length - 1 25710 }; 25711 break; 25712 case DropdownKeyDownBackspace: 25713 changes = { 25714 selectedItems: selectedItems.slice(0, selectedItems.length - 1) 25715 }; 25716 break; 25717 case FunctionAddSelectedItem: 25718 changes = { 25719 selectedItems: [].concat(selectedItems, [selectedItem]) 25720 }; 25721 break; 25722 case DropdownClick: 25723 changes = { 25724 activeIndex: -1 25725 }; 25726 break; 25727 case FunctionRemoveSelectedItem: { 25728 var _newActiveIndex = activeIndex, selectedItemIndex = selectedItems.findIndex(function(item) { 25729 return props.itemToKey(item) === props.itemToKey(selectedItem); 25730 }); 25731 if (selectedItemIndex < 0) 25732 break; 25733 selectedItems.length === 1 ? _newActiveIndex = -1 : selectedItemIndex === selectedItems.length - 1 && (_newActiveIndex = selectedItems.length - 2), changes = { 25734 selectedItems: [].concat(selectedItems.slice(0, selectedItemIndex), selectedItems.slice(selectedItemIndex + 1)), 25735 activeIndex: _newActiveIndex 25736 }; 25737 break; 25738 } 25739 case FunctionSetSelectedItems: { 25740 var newSelectedItems = action.selectedItems; 25741 changes = { 25742 selectedItems: newSelectedItems 25743 }; 25744 break; 25745 } 25746 case FunctionSetActiveIndex: { 25747 var _newActiveIndex2 = action.activeIndex; 25748 changes = { 25749 activeIndex: _newActiveIndex2 25750 }; 25751 break; 25752 } 25753 case FunctionReset: 25754 changes = { 25755 activeIndex: getDefaultValue(props, "activeIndex"), 25756 selectedItems: getDefaultValue(props, "selectedItems") 25757 }; 25758 break; 25759 default: 25760 throw new Error("Reducer called without proper action type."); 25761 } 25762 return _extends({}, state, changes); 25763} 25764var _excluded2 = ["refKey", "ref", "onClick", "onKeyDown", "selectedItem", "index"], _excluded22 = ["refKey", "ref", "onKeyDown", "onClick", "preventKeyAction"]; 25765useMultipleSelection.stateChangeTypes = stateChangeTypes; 25766function useMultipleSelection(userProps) { 25767 userProps === void 0 && (userProps = {}), validatePropTypes(userProps, useMultipleSelection); 25768 var props = _extends({}, defaultProps2, userProps), getA11yStatusMessage2 = props.getA11yStatusMessage, environment = props.environment, keyNavigationNext = props.keyNavigationNext, keyNavigationPrevious = props.keyNavigationPrevious, _useControlledReducer = useControlledReducer$1(downshiftMultipleSelectionReducer, props, getInitialState, isStateEqual), state = _useControlledReducer[0], dispatch = _useControlledReducer[1], activeIndex = state.activeIndex, selectedItems = state.selectedItems, isInitialMount = useIsInitialMount(), dropdownRef = useRef(null), selectedItemRefs = useRef(); 25769 selectedItemRefs.current = []; 25770 var latest = useLatestRef({ 25771 state, 25772 props 25773 }); 25774 useA11yMessageStatus(getA11yStatusMessage2, state, [activeIndex, selectedItems], environment), useEffect(function() { 25775 isInitialMount || (activeIndex === -1 && dropdownRef.current ? dropdownRef.current.focus() : selectedItemRefs.current[activeIndex] && selectedItemRefs.current[activeIndex].focus()); 25776 }, [activeIndex]), useControlPropsValidator({ 25777 props, 25778 state 25779 }); 25780 var setGetterPropCallInfo = useGetterPropsCalledChecker("getDropdownProps"), selectedItemKeyDownHandlers = useMemo(function() { 25781 var _ref; 25782 return _ref = {}, _ref[keyNavigationPrevious] = function() { 25783 dispatch({ 25784 type: SelectedItemKeyDownNavigationPrevious 25785 }); 25786 }, _ref[keyNavigationNext] = function() { 25787 dispatch({ 25788 type: SelectedItemKeyDownNavigationNext 25789 }); 25790 }, _ref.Delete = function() { 25791 dispatch({ 25792 type: SelectedItemKeyDownDelete 25793 }); 25794 }, _ref.Backspace = function() { 25795 dispatch({ 25796 type: SelectedItemKeyDownBackspace 25797 }); 25798 }, _ref; 25799 }, [dispatch, keyNavigationNext, keyNavigationPrevious]), dropdownKeyDownHandlers = useMemo(function() { 25800 var _ref2; 25801 return _ref2 = {}, _ref2[keyNavigationPrevious] = function(event) { 25802 isKeyDownOperationPermitted(event) && dispatch({ 25803 type: DropdownKeyDownNavigationPrevious 25804 }); 25805 }, _ref2.Backspace = function(event) { 25806 isKeyDownOperationPermitted(event) && dispatch({ 25807 type: DropdownKeyDownBackspace 25808 }); 25809 }, _ref2; 25810 }, [dispatch, keyNavigationPrevious]), getSelectedItemProps = useCallback(function(_temp) { 25811 var _extends22, _ref3 = _temp === void 0 ? {} : _temp, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, ref = _ref3.ref, onClick = _ref3.onClick, onKeyDown = _ref3.onKeyDown, selectedItemProp = _ref3.selectedItem, indexProp = _ref3.index, rest2 = _objectWithoutPropertiesLoose2(_ref3, _excluded2), latestState = latest.current.state, _getItemAndIndex = getItemAndIndex(selectedItemProp, indexProp, latestState.selectedItems, "Pass either item or index to getSelectedItemProps!"), index = _getItemAndIndex[1], isFocusable = index > -1 && index === latestState.activeIndex, selectedItemHandleClick = function() { 25812 dispatch({ 25813 type: SelectedItemClick, 25814 index 25815 }); 25816 }, selectedItemHandleKeyDown = function(event) { 25817 var key = normalizeArrowKey(event); 25818 key && selectedItemKeyDownHandlers[key] && selectedItemKeyDownHandlers[key](event); 25819 }; 25820 return _extends((_extends22 = {}, _extends22[refKey] = handleRefs(ref, function(selectedItemNode) { 25821 selectedItemNode && selectedItemRefs.current.push(selectedItemNode); 25822 }), _extends22.tabIndex = isFocusable ? 0 : -1, _extends22.onClick = callAllEventHandlers(onClick, selectedItemHandleClick), _extends22.onKeyDown = callAllEventHandlers(onKeyDown, selectedItemHandleKeyDown), _extends22), rest2); 25823 }, [dispatch, latest, selectedItemKeyDownHandlers]), getDropdownProps = useCallback(function(_temp2, _temp3) { 25824 var _extends3, _ref4 = _temp2 === void 0 ? {} : _temp2, _ref4$refKey = _ref4.refKey, refKey = _ref4$refKey === void 0 ? "ref" : _ref4$refKey, ref = _ref4.ref, onKeyDown = _ref4.onKeyDown, onClick = _ref4.onClick, _ref4$preventKeyActio = _ref4.preventKeyAction, preventKeyAction = _ref4$preventKeyActio === void 0 ? !1 : _ref4$preventKeyActio, rest2 = _objectWithoutPropertiesLoose2(_ref4, _excluded22), _ref5 = _temp3 === void 0 ? {} : _temp3, _ref5$suppressRefErro = _ref5.suppressRefError, suppressRefError = _ref5$suppressRefErro === void 0 ? !1 : _ref5$suppressRefErro; 25825 setGetterPropCallInfo("getDropdownProps", suppressRefError, refKey, dropdownRef); 25826 var dropdownHandleKeyDown = function(event) { 25827 var key = normalizeArrowKey(event); 25828 key && dropdownKeyDownHandlers[key] && dropdownKeyDownHandlers[key](event); 25829 }, dropdownHandleClick = function() { 25830 dispatch({ 25831 type: DropdownClick 25832 }); 25833 }; 25834 return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function(dropdownNode) { 25835 dropdownNode && (dropdownRef.current = dropdownNode); 25836 }), _extends3), !preventKeyAction && { 25837 onKeyDown: callAllEventHandlers(onKeyDown, dropdownHandleKeyDown), 25838 onClick: callAllEventHandlers(onClick, dropdownHandleClick) 25839 }, rest2); 25840 }, [dispatch, dropdownKeyDownHandlers, setGetterPropCallInfo]), addSelectedItem = useCallback(function(selectedItem) { 25841 dispatch({ 25842 type: FunctionAddSelectedItem, 25843 selectedItem 25844 }); 25845 }, [dispatch]), removeSelectedItem = useCallback(function(selectedItem) { 25846 dispatch({ 25847 type: FunctionRemoveSelectedItem, 25848 selectedItem 25849 }); 25850 }, [dispatch]), setSelectedItems = useCallback(function(newSelectedItems) { 25851 dispatch({ 25852 type: FunctionSetSelectedItems, 25853 selectedItems: newSelectedItems 25854 }); 25855 }, [dispatch]), setActiveIndex = useCallback(function(newActiveIndex) { 25856 dispatch({ 25857 type: FunctionSetActiveIndex, 25858 activeIndex: newActiveIndex 25859 }); 25860 }, [dispatch]), reset = useCallback(function() { 25861 dispatch({ 25862 type: FunctionReset 25863 }); 25864 }, [dispatch]); 25865 return { 25866 getSelectedItemProps, 25867 getDropdownProps, 25868 addSelectedItem, 25869 removeSelectedItem, 25870 setSelectedItems, 25871 setActiveIndex, 25872 reset, 25873 selectedItems, 25874 activeIndex 25875 }; 25876} 25877
vendor: 621 bytes, lines 25878-25902
25878// src/manager/components/sidebar/Search.tsx 25879var import_fuse = __toESM(require_fuse(), 1); 25880 25881// src/manager/components/sidebar/types.ts 25882function isExpandType(x2) { 25883 return !!(x2 && x2.showAll); 25884} 25885function isSearchResult(x2) { 25886 return !!(x2 && x2.item); 25887} 25888 25889// src/manager/components/sidebar/Search.tsx 25890var { document: document7 } = scope, DEFAULT_MAX_SEARCH_RESULTS = 50, options = { 25891 shouldSort: !0, 25892 tokenize: !0, 25893 findAllMatches: !0, 25894 includeScore: !0, 25895 includeMatches: !0, 25896 threshold: 0.2, 25897 location: 0, 25898 distance: 100, 25899 maxPatternLength: 32, 25900 minMatchCharLength: 1, 25901 keys: [ 25902 { name: "name", weight: 0.
259027 }, 25903 { name: "path", weight: 0.3 } 25904 ] 25905}, SearchBar = styled.div({ 25906 display: "flex", 25907 flexDirection: "row", 25908 columnGap: 6 25909}), ScreenReaderLabel = styled.label({ 25910 position: "absolute", 25911 left: -1e4, 25912 top: "auto", 25913 width: 1, 25914 height: 1, 25915 overflow: "hidden" 25916}), SearchField2 = styled.div(({ theme, isMobile: isMobile2 }) => ({ 25917 display: "flex", 25918 flexDirection: "row", 25919 alignItems: "center", 25920 padding: isMobile2 ? 4 : 2, 25921 flexGrow: 1, 25922 height: isMobile2 ? 36 : 32, 25923 width: "100%", 25924 boxShadow: `${theme.button.border} 0 0 0 1px inset`, 25925 borderRadius: theme.appBorderRadius + 2, 25926 "&:has(input:focus), &:has(input:active)": { 25927 background: theme.background.app, 25928 outline: `2px solid ${theme.color.secondary}`, 25929 outlineOffset: 2 25930 } 25931})), IconWrapper = styled.div(({ theme, onClick }) => ({ 25932 cursor: onClick ? "pointer" : "default", 25933 flex: "0 0 28px", 25934 height: "100%", 25935 pointerEvents: onClick ? "auto" : "none", 25936 color: theme.textMutedColor, 25937 display: "flex", 25938 alignItems: "center", 25939 justifyContent: "center" 25940})), Input = styled.input(({ theme, isMobile: isMobile2 }) => ({ 25941 appearance: "none", 25942 height: 28, 25943 width: "100%", 25944 padding: 0, 25945 border: 0, 25946 background: "transparent", 25947 fontSize: isMobile2 ? "16px" : `${theme.typography.size.s1 + 1}px`, 25948 fontFamily: "inherit", 25949 transition: "all 150ms", 25950 color: theme.color.defaultText, 25951 outline: 0, 25952 "&::placeholder": { 25953 color: theme.textMutedColor, 25954 opacity: 1 25955 }, 25956 "&:valid ~ code, &:focus ~ code": { 25957 display: "none" 25958 }, 25959 "&:invalid ~ svg": { 25960 display: "none" 25961 }, 25962 "&:valid ~ svg": { 25963 display: "block" 25964 }, 25965 "&::-ms-clear": { 25966 display: "none" 25967 }, 25968 "&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration": { 25969 display: "none" 25970 } 25971})), FocusKey = styled.code(({ theme }) => ({ 25972 margin: 5, 25973 marginTop: 6, 25974 height: 16, 25975 fontFamily: theme.typography.fonts.base, 25976 lineHeight: "16px", 25977 textAlign: "center", 25978 fontSize: "11px", 25979 color: theme.base === "light" ? theme.color.dark : theme.textMutedColor, 25980 userSelect: "none", 25981 pointerEvents: "none", 25982 display: "flex", 25983 alignItems: "center", 25984 gap: 4, 25985 flexShrink: 0 25986})), FocusKeyCmd = styled.span({ 25987 fontSize: "14px" 25988}), Actions2 = styled.div({ 25989 display: "flex", 25990 alignItems: "center", 25991 gap: 2 25992}), FocusContainer = styled.div({ outline: 0 }), Search = react_default.memo(function({ 25993 children, 25994 dataset, 25995 enableShortcuts = !0, 25996 getLastViewed, 25997 initialQuery = "", 25998 searchBarContent, 25999 searchFieldContent 26000}) { 26001 let api = useStorybookApi(), inputRef = useRef(null), [inputPlaceholder, setPlaceholder] = useState("Find components"), [allComponents, showAllComponents] = useState(!1), searchShortcut = api ? shortcutToHumanString(api.getShortcutKeys().search) : "/", makeFuse = useCallback(() => { 26002 let list = dataset.entries.reduce((acc, [refId, { index, allStatuses }]) => { 26003 let groupStatus = getGroupStatus(index || {}, allStatuses ?? {}); 26004 return index && acc.push( 26005 ...Object.values(index).map((item) => { 26006 let storyStatuses = allStatuses?.[item.id], mostCriticalStatusValue = storyStatuses ? getMostCriticalStatusValue( 26007 Object.values(storyStatuses).filter((status) => status.typeId !== REVIEW_STATUS_TYPE_ID).map((status) => status.value) 26008 ) : null; 26009 return { 26010 ...searchItem(item, dataset.hash[refId]), 26011 status: mostCriticalStatusValue ?? groupStatus[item.id] ?? null 26012 }; 26013 }) 26014 ), acc; 26015 }, []); 26016 return new import_fuse.default(list, options); 26017 }, [dataset]), getResults = useCallback( 26018 (input) => { 26019 let fuse = makeFuse(); 26020 if (!input) 26021 return []; 26022 let results = [], resultIds = /* @__PURE__ */ new Set(), distinctResults = fuse.search(input).filter(({ item }) => !(item.type === "component" || item.type === "docs" || item.type === "story") || // @ts-expect-error (non strict) 26023 resultIds.has(item.parent) ? !1 : (resultIds.add(item.id), !0)); 26024 return distinctResults.length && (results = distinctResults.slice(0, allComponents ? 1e3 : DEFAULT_MAX_SEARCH_RESULTS), distinctResults.length > DEFAULT_MAX_SEARCH_RESULTS && !allComponents && results.push({ 26025 showAll: () => showAllComponents(!0), 26026 totalCount: distinctResults.length, 26027 moreCount: distinctResults.length - DEFAULT_MAX_SEARCH_RESULTS 26028 })), results; 26029 }, 26030 [allComponents, makeFuse] 26031 ), onSelect = useCallback( 26032 (selectedItem) => { 26033 if (selectedItem) { 26034 if (isSearchResult(selectedItem)) { 26035 let { id, refId } = selectedItem.item; 26036 api?.selectStory(id, void 0, { ref: refId !== DEFAULT_REF_ID && refId }), inputRef.current.blur(), showAllComponents(!1); 26037 return; 26038 } 26039 isExpandType(selectedItem) && selectedItem.showAll(); 26040 } 26041 }, 26042 [api] 26043 ), onInputValueChange = useCallback((inputValue, stateAndHelpers) => { 26044 showAllComponents(!1); 26045 }, []), stateReducer2 = useCallback( 26046 (state, changes) => { 26047 switch (changes.type) { 26048 case Downshift.stateChangeTypes.blurInput: 26049 return { 26050 ...changes, 26051 // Prevent clearing the input on blur 26052 inputValue: state.inputValue, 26053 // Return to the tree view after selecting an item 26054 isOpen: !!state.inputValue && !state.selectedItem 26055 }; 26056 case Downshift.stateChangeTypes.mouseUp: 26057 return state; 26058 case Downshift.stateChangeTypes.keyDownEscape: 26059 return state.inputValue ? { ...changes, inputValue: "", isOpen: !0, selectedItem: null } : { ...changes, isOpen: !1, selectedItem: null }; 26060 case Downshift.stateChangeTypes.clickItem: 26061 case Downshift.stateChangeTypes.keyDownEnter: 26062 return isSearchResult(changes.selectedItem) ? { ...changes, inputValue: state.inputValue } : isExpandType(changes.selectedItem) ? state : changes; 26063 default: 26064 return changes; 26065 } 26066 }, 26067 [] 26068 ), { isMobile: isMobile2 }
vendor: 6,631 bytes, lines 26068-26252
26068 = useLayout(), searchLandmarkRef = useRef(null), { landmarkProps } = useLandmark({ role: "search" }, searchLandmarkRef); 26069 return react_default.createElement( 26070 Downshift, 26071 { 26072 initialInputValue: initialQuery, 26073 stateReducer: stateReducer2, 26074 itemToString: (result) => result?.item?.name || "", 26075 scrollIntoView: (e2) => scrollIntoView(e2), 26076 onSelect, 26077 onInputValueChange 26078 }, 26079 ({ 26080 isOpen, 26081 openMenu, 26082 closeMenu, 26083 inputValue, 26084 getInputProps, 26085 getItemProps, 26086 getLabelProps, 26087 getMenuProps, 26088 getRootProps, 26089 highlightedIndex, 26090 reset 26091 }) => { 26092 let input = inputValue ? inputValue.trim() : "", results = input ? getResults(input) : [], lastViewed = !input && getLastViewed(); 26093 lastViewed && lastViewed.length && (results = lastViewed.reduce((acc, { storyId, refId }) => { 26094 let data = dataset.hash[refId]; 26095 if (data && data.index && data.index[storyId]) { 26096 let story = data.index[storyId], item = story.type === "story" ? data.index[story.parent] : story; 26097 acc.some((res) => res.item.refId === refId && res.item.id === item.id) || acc.push({ item: searchItem(item, dataset.hash[refId]), matches: [], score: 0 }); 26098 } 26099 return acc; 26100 }, [])); 26101 let inputId = "storybook-explorer-searchfield", inputProps = getInputProps({ 26102 id: inputId, 26103 ref: inputRef, 26104 required: !0, 26105 type: "search", 26106 placeholder: inputPlaceholder, 26107 onFocus: () => { 26108 openMenu(), setPlaceholder("Type to find..."); 26109 }, 26110 onBlur: () => setPlaceholder("Find components"), 26111 onKeyDown: (e2) => { 26112 e2.key === "Escape" && inputValue.length === 0 && inputRef.current.blur(); 26113 } 26114 }), labelProps = getLabelProps({ 26115 htmlFor: inputId 26116 }); 26117 return react_default.createElement(react_default.Fragment, null, react_default.createElement(ScreenReaderLabel, { ...labelProps }, "Search for components"), react_default.createElement(SearchBar, { ref: searchLandmarkRef, ...landmarkProps }, react_default.createElement( 26118 SearchField2, 26119 { 26120 ...getRootProps({ refKey: "" }, { suppressRefError: !0 }), 26121 isMobile: isMobile2, 26122 className: "search-field" 26123 }, 26124 react_default.createElement(IconWrapper, null, react_default.createElement(SearchIcon, null)), 26125 react_default.createElement(Input, { ...inputProps, isMobile: isMobile2 }), 26126 !isMobile2 && enableShortcuts && !isOpen && react_default.createElement(FocusKey, null, searchShortcut === "\u2318 K" ? react_default.createElement(react_default.Fragment, null, react_default.createElement(FocusKeyCmd, null, "\u2318"), "K") : searchShortcut), 26127 react_default.createElement(Actions2, null, input && react_default.createElement( 26128 Button, 26129 { 26130 padding: "small", 26131 variant: "ghost", 26132 ariaLabel: "Clear search", 26133 onClick: () => { 26134 reset({ inputValue: "" }), closeMenu(), inputRef.current?.focus(); 26135 } 26136 }, 26137 react_default.createElement(CloseIcon, null) 26138 ), searchFieldContent) 26139 ), searchBarContent), react_default.createElement(FocusContainer, { tabIndex: 0, id: "storybook-explorer-menu" }, children({ 26140 query: input, 26141 results, 26142 isNavVisible: !isOpen && document7.activeElement !== inputRef.current, 26143 isNavReachable: !isOpen || input.length === 0, 26144 isSearchResultRendered: isOpen, 26145 closeMenu, 26146 getMenuProps, 26147 getItemProps, 26148 highlightedIndex 26149 }))); 26150 } 26151 ); 26152}); 26153 26154// src/manager/components/sidebar/SearchResults.tsx 26155init_react(); 26156var { document: document8 } = scope, ResultsList = styled.ol({ 26157 listStyle: "none", 26158 margin: 0, 26159 padding: 0 26160}), ResultRow = styled.li(({ theme, isHighlighted }) => ({ 26161 width: "100%", 26162 border: "none", 26163 cursor: "pointer", 26164 display: "flex", 26165 alignItems: "start", 26166 justifyContent: "space-between", 26167 textAlign: "left", 26168 color: "inherit", 26169 fontSize: `${theme.typography.size.s2}px`, 26170 background: isHighlighted ? theme.background.hoverable : "transparent", 26171 minHeight: 28, 26172 borderRadius: 4, 26173 gap: 6, 26174 paddingTop: 7, 26175 paddingBottom: 7, 26176 paddingLeft: 8, 26177 paddingRight: 8, 26178 "&:hover, &:focus": { 26179 background: curriedTransparentize$1(0.93, theme.color.secondary), 26180 outline: "none" 26181 } 26182})), IconWrapper2 = styled.div({ 26183 marginTop: 2 26184}), ResultRowContent = styled.div({ 26185 flex: 1, 26186 display: "flex", 26187 flexDirection: "column" 26188}), Mark = styled.mark(({ theme }) => ({ 26189 background: "transparent", 26190 color: theme.color.secondary, 26191 "@media (forced-colors: active)": { 26192 color: "HighlightText", 26193 background: "Highlight" 26194 } 26195})), MoreWrapper = styled.div({ 26196 marginTop: 8 26197}), RecentlyOpenedTitle = styled.div(({ theme }) => ({ 26198 display: "flex", 26199 justifyContent: "space-between", 26200 fontSize: `${theme.typography.size.s1 - 1}px`, 26201 fontWeight: theme.typography.weight.bold, 26202 minHeight: 28, 26203 letterSpacing: "0.16em", 26204 textTransform: "uppercase", 26205 color: theme.textMutedColor, 26206 marginBottom: 4, 26207 alignItems: "center", 26208 ".search-result-recentlyOpened-clear": { 26209 visibility: "hidden" 26210 }, 26211 "&:hover": { 26212 ".search-result-recentlyOpened-clear": { 26213 visibility: "visible" 26214 } 26215 } 26216})), Highlight = react_default.memo(function({ 26217 children, 26218 match 26219}) { 26220 if (!match) 26221 return children; 26222 let { value, indices } = match, { nodes: result } = indices.reduce( 26223 ({ cursor, nodes }, [start, end], index, { length }) => (nodes.push(react_default.createElement("span", { key: `${index}-1` }, value.slice(cursor, start))), nodes.push(react_default.createElement(Mark, { key: `${index}-2` }, value.slice(start, end + 1))), index === length - 1 && nodes.push(react_default.createElement("span", { key: `${index}-3` }, value.slice(end + 1))), { cursor: end + 1, nodes }), 26224 { cursor: 0, nodes: [] } 26225 ); 26226 return react_default.createElement("span", null, result); 26227}), Title3 = styled.div({ 26228 display: "grid", 26229 justifyContent: "start", 26230 gridAutoColumns: "auto", 26231 gridAutoFlow: "column", 26232 "& > span": { 26233 display: "block", 26234 whiteSpace: "nowrap", 26235 overflow: "hidden", 26236 textOverflow: "ellipsis" 26237 } 26238}), Path = styled.div(({ theme }) => ({ 26239 display: "grid", 26240 justifyContent: "start", 26241 gridAutoColumns: "auto", 26242 gridAutoFlow: "column", 26243 fontSize: `${theme.typography.size.s1 - 1}px`, 26244 "& > span": { 26245 display: "block", 26246 whiteSpace: "nowrap", 26247 overflow: "hidden", 26248 textOverflow: "ellipsis" 26249 }, 26250 "& > span + span": { 26251 "&:before": { 26252 content: "' / '
vendor: 17,692 bytes, lines 26252-26649
26252" 26253 } 26254 } 26255})), Result = react_default.memo(function({ item, matches, onClick, ...props }) { 26256 let theme = useTheme(), click = useCallback( 26257 (event) => { 26258 event.preventDefault(), onClick?.(event); 26259 }, 26260 [onClick] 26261 ), api = useStorybookApi(); 26262 useEffect(() => { 26263 api && props.isHighlighted && item.type === "component" && api.emit(PRELOAD_ENTRIES, { ids: [item.children[0]] }, { options: { target: item.refId } }); 26264 }, [api, props.isHighlighted, item]); 26265 let nameMatch = matches.find((match) => match.key === "name"), pathMatches = matches.filter((match) => match.key === "path"), icon = item.status ? getStatus(theme, item.status).icon : null; 26266 return react_default.createElement(ResultRow, { ...props, onClick: click }, react_default.createElement(IconWrapper2, null, item.type === "component" && react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "14", height: "14", type: "component" }, react_default.createElement(UseSymbol, { type: "component" })), item.type === "story" && react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "14", height: "14", type: item.subtype }, react_default.createElement(UseSymbol, { type: item.subtype })), !(item.type === "component" || item.type === "story") && react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "14", height: "14", type: "document" }, react_default.createElement(UseSymbol, { type: "document" }))), react_default.createElement(ResultRowContent, { className: "search-result-item--label" }, react_default.createElement(Title3, null, react_default.createElement(Highlight, { match: nameMatch }, item.name)), react_default.createElement(Path, null, item.path.map((group, index) => react_default.createElement("span", { key: index }, react_default.createElement(Highlight, { match: pathMatches.find((match) => match.arrayIndex === index) }, group))))), item.status ? react_default.createElement(StatusLabel, { status: item.status }, icon) : null); 26267}), SearchResults = react_default.memo(function({ 26268 query, 26269 results, 26270 closeMenu, 26271 getMenuProps, 26272 getItemProps, 26273 highlightedIndex, 26274 isLoading = !1, 26275 enableShortcuts = !0, 26276 clearLastViewed 26277}) { 26278 let api = useStorybookApi(); 26279 useEffect(() => { 26280 let handleEscape = (event) => { 26281 if (!(!enableShortcuts || isLoading || event.repeat) && matchesModifiers(!1, event) && matchesKeyCode("Escape", event)) { 26282 if (event.target?.id === "storybook-explorer-searchfield") 26283 return; 26284 event.preventDefault(), closeMenu(); 26285 } 26286 }; 26287 return document8.addEventListener("keydown", handleEscape), () => document8.removeEventListener("keydown", handleEscape); 26288 }, [closeMenu, enableShortcuts, isLoading]); 26289 let mouseOverHandler = useCallback((event) => { 26290 if (!api) 26291 return; 26292 let currentTarget = event.currentTarget, storyId = currentTarget.getAttribute("data-id"), refId = currentTarget.getAttribute("data-refid"), item = api.resolveStory(storyId, refId === "storybook_internal" ? void 0 : refId); 26293 item?.type === "component" && api.emit(PRELOAD_ENTRIES, { 26294 // @ts-expect-error (TODO) 26295 ids: [item.isLeaf ? item.id : item.children[0]], 26296 options: { target: refId } 26297 }); 26298 }, []), handleClearLastViewed = () => { 26299 clearLastViewed(), closeMenu(); 26300 }; 26301 return react_default.createElement(ResultsList, { ...getMenuProps(), key: "results-list" }, results.length > 0 && !query && react_default.createElement(RecentlyOpenedTitle, { className: "search-result-recentlyOpened" }, "Recently opened", react_default.createElement( 26302 Button, 26303 { 26304 padding: "small", 26305 variant: "ghost", 26306 className: "search-result-recentlyOpened-clear", 26307 onClick: handleClearLastViewed, 26308 ariaLabel: "Clear recently opened items" 26309 }, 26310 react_default.createElement(TrashIcon, null) 26311 )), results.length === 0 && query && react_default.createElement("li", null, react_default.createElement(NoResults2, null, react_default.createElement("strong", null, "No components found"), react_default.createElement("small", null, "Find components by name or path."))), results.map((result, index) => { 26312 if (isExpandType(result)) { 26313 let props = { ...results, ...getItemProps({ key: index, index, item: result }) }, { key: key2, ...rest2 } = props; 26314 return react_default.createElement(MoreWrapper, { key: "search-result-expand" }, react_default.createElement(Button, { key: key2, ...rest2, size: "small" }, "Show ", result.moreCount, " more results")); 26315 } 26316 let { item } = result, key = `${item.refId}::${item.id}`; 26317 return react_default.createElement( 26318 Result, 26319 { 26320 ...result, 26321 ...getItemProps({ key, index, item: result }), 26322 isHighlighted: highlightedIndex === index, 26323 key, 26324 "data-id": result.item.id, 26325 "data-refid": result.item.refId, 26326 onMouseOver: mouseOverHandler, 26327 className: "search-result-item" 26328 } 26329 ); 26330 })); 26331}); 26332 26333// src/manager/components/sidebar/SidebarBottom.tsx 26334init_react(); 26335 26336// src/manager/components/sidebar/TestingWidget.tsx 26337init_react(); 26338 26339// src/manager/components/sidebar/useDynamicFavicon.ts 26340init_react(); 26341var STATUSES = ["active", "critical", "negative", "positive", "warning"], initialIcon, getFaviconUrl = (initialHref = "./favicon.svg", status) => { 26342 initialIcon ??= initialHref; 26343 let href = initialIcon + (status && STATUSES.includes(status) ? `?status=${status}` : ""); 26344 return new Promise((resolve) => { 26345 let img = new Image(); 26346 img.onload = () => resolve({ href, status }), img.onerror = () => resolve({ href: initialIcon, status }), img.src = href; 26347 }); 26348}, useDynamicFavicon = (status) => { 26349 let links = useRef(document.head.querySelectorAll("link[rel*='icon']")); 26350 useEffect(() => { 26351 let isMounted = !0, [element, ...others] = links.current; 26352 if (element && !others.length) 26353 return getFaviconUrl(element.href, status).then( 26354 (result) => { 26355 isMounted && result.status === status && element.dataset.status !== status && (element.href = result.href, result.status ? element.dataset.status = result.status : delete element.dataset.status); 26356 }, 26357 () => { 26358 isMounted && (element.href = initialIcon); 26359 } 26360 ), () => { 26361 isMounted = !1, element.href = initialIcon; 26362 }; 26363 }, [status]); 26364}; 26365 26366// src/manager/components/sidebar/TestingWidget.tsx 26367var DEFAULT_HEIGHT = 500, HoverCard2 = styled(Card)({ 26368 display: "flex", 26369 flexDirection: "column-reverse", 26370 "&:hover #testing-module-collapse-toggle": { 26371 opacity: 1 26372 } 26373}), Collapsible2 = styled.div(({ theme }) => ({ 26374 overflow: "hidden", 26375 boxShadow: `inset 0 -1px 0 ${theme.appBorderColor}` 26376})), Content3 = styled.div({ 26377 display: "flex", 26378 flexDirection: "column" 26379}), Bar3 = styled.div(({ onClick }) => ({ 26380 display: "flex", 26381 width: "100%", 26382 cursor: onClick ? "pointer" : "default", 26383 userSelect: "none", 26384 alignItems: "center", 26385 justifyContent: "space-between", 26386 overflow: "hidden", 26387 padding: 4, 26388 gap: 4 26389})), Action = styled.div({ 26390 display: "flex", 26391 flexBasis: "100%", 26392 containerType: "inline-size" 26393}), Filters = styled.div({ 26394 display: "flex", 26395 justifyContent: "flex-end", 26396 gap: 4 26397}), CollapseToggle3 = styled(ActionList.Button)({ 26398 opacity: 0, 26399 transition: "opacity 250ms", 26400 "&:focus, &:hover": { 26401 opacity: 1 26402 } 26403}), RunButton = ({ 26404 children, 26405 isRunning, 26406 onRunAll, 26407 ...props 26408}) => react_default.createElement( 26409 ActionList.Button, 26410 { 26411 ariaLabel: isRunning ? "Running..." : "Run tests", 26412 tooltip: isRunning ? "Running tests..." : "Start all tests", 26413 disabled: isRunning, 26414 onClick: (e2) => { 26415 e2.stopPropagation(), onRunAll(); 26416 }, 26417 ...props 26418 }, 26419 react_default.createElement(ActionList.Icon, null, react_default.createElement(PlayAllHollowIcon, null)), 26420 children 26421), StatusButton2 = styled(ActionList.Toggle)( 26422 { minWidth: 28, outlineOffset: -2 }, 26423 ({ pressed, status, theme }) => !pressed && (theme.base === "light" ? { 26424 background: { 26425 negative: theme.background.negative, 26426 warning: theme.background.warning 26427 }[status], 26428 color: { 26429 negative: theme.color.negativeText, 26430 warning: theme.color.warningText 26431 }[status] 26432 } : { 26433 background: { 26434 negative: `${theme.color.negative}22`, 26435 warning: `${theme.color.warning}22` 26436 }[status], 26437 color: { 26438 negative: theme.color.negative, 26439 warning: theme.color.warning 26440 }[status] 26441 }) 26442), TestProvider = styled.div(({ theme }) => ({ 26443 padding: 4, 26444 "&:not(:last-child)": { 26445 boxShadow: `inset 0 -1px 0 ${theme.appBorderColor}` 26446 } 26447})), TestingWidget = ({ 26448 registeredTestProviders, 26449 testProviderStates, 26450 hasStatuses, 26451 clearStatuses, 26452 onRunAll, 26453 errorCount, 26454 errorsActive, 26455 setErrorsActive, 26456 warningCount, 26457 warningsActive, 26458 setWarningsActive, 26459 successCount 26460}) => { 26461 let timeoutRef = useRef(null), contentRef = useRef(null), [maxHeight, setMaxHeight] = useState(DEFAULT_HEIGHT), [isCollapsed, setCollapsed] = useState(!0), [isChangingCollapse, setChangingCollapse] = useState(!1), [isUpdated, setIsUpdated] = useState(!1), settingsUpdatedTimeoutRef = useRef(); 26462 useEffect(() => { 26463 let unsubscribe = internal_fullTestProviderStore.onSettingsChanged(() => { 26464 setIsUpdated(!0), clearTimeout(settingsUpdatedTimeoutRef.current), settingsUpdatedTimeoutRef.current = setTimeout(() => { 26465 setIsUpdated(!1); 26466 }, 1e3); 26467 }); 26468 return () => { 26469 unsubscribe(), clearTimeout(settingsUpdatedTimeoutRef.current); 26470 }; 26471 }, []), useEffect(() => { 26472 if (contentRef.current) { 26473 setMaxHeight(contentRef.current?.getBoundingClientRect().height || DEFAULT_HEIGHT); 26474 let resizeObserver = new ResizeObserver(() => { 26475 requestAnimationFrame(() => { 26476 if (contentRef.current && !isCollapsed) { 26477 let height = contentRef.current?.getBoundingClientRect().height || DEFAULT_HEIGHT; 26478 setMaxHeight(height); 26479 } 26480 }); 26481 }); 26482 return resizeObserver.observe(contentRef.current), () => resizeObserver.disconnect(); 26483 } 26484 }, [isCollapsed]); 26485 let toggleCollapsed = useCallback((event, value) => { 26486 event?.stopPropagation(), setChangingCollapse(!0), setCollapsed((s2) => value ?? !s2), timeoutRef.current && clearTimeout(timeoutRef.current), timeoutRef.current = setTimeout(() => { 26487 setChangingCollapse(!1); 26488 }, 250); 26489 }, []), isRunning = Object.values(testProviderStates).some( 26490 (testProviderState) => testProviderState === "test-provider-state:running" 26491 ), isCrashed = Object.values(testProviderStates).some( 26492 (testProviderState) => testProviderState === "test-provider-state:crashed" 26493 ), hasTestProviders = Object.values(registeredTestProviders).length > 0; 26494 useEffect(() => { 26495 isCrashed && isCollapsed && toggleCollapsed(void 0, !1); 26496 }, [isCrashed, isCollapsed, toggleCollapsed]), useDynamicFavicon( 26497 isCrashed ? "critical" : errorCount > 0 ? "negative" : warningCount > 0 ? "warning" : isRunning ? "active" : successCount > 0 ? "positive" : void 0 26498 ); 26499 let cardRef = useRef(null), { landmarkProps } = useLandmark( 26500 { "aria-labelledby": "storybook-testing-widget-heading", role: "region" }, 26501 cardRef 26502 ); 26503 return !hasTestProviders && !errorCount && !warningCount ? null : react_default.createElement( 26504 HoverCard2, 26505 { 26506 id: "storybook-testing-module", 26507 "data-updated": isUpdated, 26508 outlineAnimation: isRunning ? "spin" : "none", 26509 outlineColor: isCrashed || isRunning && errorCount > 0 ? "negative" : isUpdated ? "positive" : void 0, 26510 ref: cardRef, 26511 outlineAttrs: landmarkProps 26512 }, 26513 react_default.createElement("h2", { id: "storybook-testing-widget-heading", className: "sb-sr-only" }, "Component tests"), 26514 react_default.createElement(Bar3, { ...hasTestProviders ? { onClick: (e2) => toggleCollapsed(e2) } : {} }, react_default.createElement(Action, null, hasTestProviders && react_default.createElement( 26515 Optional, 26516 { 26517 content: react_default.createElement(RunButton, { isRunning, onRunAll }, isRunning ? "Running..." : "Run tests"), 26518 fallback: react_default.createElement(RunButton, { isRunning, onRunAll }) 26519 } 26520 )), react_default.createElement(Filters, null, hasTestProviders && react_default.createElement( 26521 CollapseToggle3, 26522 { 26523 onClick: (e2) => toggleCollapsed(e2), 26524 id: "testing-module-collapse-toggle", 26525 ariaLabel: isCollapsed ? "Expand testing module" : "Collapse testing module" 26526 }, 26527 react_default.createElement( 26528 ChevronSmallUpIcon, 26529 { 26530 style: { 26531 transform: isCollapsed ? "none" : "rotate(180deg)", 26532 transition: "transform 250ms" 26533 } 26534 } 26535 ) 26536 ), errorCount > 0 && react_default.createElement( 26537 StatusButton2, 26538 { 26539 id: "errors-found-filter", 26540 size: "medium", 26541 variant: "ghost", 26542 padding: errorCount < 10 ? "medium" : "small", 26543 status: "negative", 26544 pressed: errorsActive, 26545 onClick: (e2) => { 26546 e2.stopPropagation(), setErrorsActive(!errorsActive); 26547 }, 26548 ariaLabel: `Filter main navigation to show ${errorCount} tests with errors`, 26549 tooltip: errorsActive ? "Clear test error filter" : `Filter sidebar to show ${errorCount} tests with errors` 26550 }, 26551 errorCount < 1e3 ? errorCount : "999+" 26552 ), warningCount > 0 && react_default.createElement( 26553 StatusButton2, 26554 { 26555 id: "warnings-found-filter", 26556 size: "medium", 26557 variant: "ghost", 26558 padding: warningCount < 10 ? "medium" : "small", 26559 status: "warning", 26560 pressed: warningsActive, 26561 onClick: (e2) => { 26562 e2.stopPropagation(), setWarningsActive(!warningsActive); 26563 }, 26564 ariaLabel: `Filter main navigation to show ${warningCount} tests with warnings`, 26565 tooltip: warningsActive ? "Clear test warning filter" : `Filter sidebar to show ${warningCount} tests with warnings` 26566 }, 26567 warningCount < 1e3 ? warningCount : "999+" 26568 ), hasStatuses && react_default.createElement( 26569 ActionList.Button, 26570 { 26571 id: "clear-statuses", 26572 onClick: (e2) => { 26573 e2.stopPropagation(), clearStatuses(); 26574 }, 26575 disabled: isRunning, 26576 ariaLabel: isRunning ? "Can't clear statuses while tests are running" : "Clear all statuses" 26577 }, 26578 react_default.createElement(SweepIcon, null) 26579 ))), 26580 hasTestProviders && react_default.createElement( 26581 Collapsible2, 26582 { 26583 "data-testid": "collapse", 26584 ...isCollapsed && { inert: "" }, 26585 style: { 26586 transition: isChangingCollapse ? "max-height 250ms" : "max-height 0ms", 26587 display: hasTestProviders ? "block" : "none", 26588 maxHeight: isCollapsed ? 0 : maxHeight 26589 } 26590 }, 26591 react_default.createElement(Content3, { ref: contentRef }, Object.values(registeredTestProviders).map((registeredTestProvider) => { 26592 let { render: Render, id } = registeredTestProvider; 26593 return Render ? react_default.createElement(TestProvider, { key: id, "data-module-id": id }, react_default.createElement(Render, null)) : (once.warn( 26594 `No render function found for test provider with id '${id}', skipping...` 26595 ), null); 26596 })) 26597 ) 26598 ); 26599}; 26600 26601// src/manager/components/sidebar/SidebarBottom.tsx 26602var SIDEBAR_BOTTOM_SPACER_ID = "sidebar-bottom-spacer", SIDEBAR_BOTTOM_WRAPPER_ID = "sidebar-bottom-wrapper", filterNone = () => !0, filterWarn = ({ statuses = {} }) => Object.values(statuses).some(({ value }) => value === "status-value:warning"), filterError = ({ statuses = {} }) => Object.values(statuses).some(({ value }) => value === "status-value:error"), filterBoth = ({ statuses = {} }) => Object.values(statuses).some( 26603 ({ value }) => ["status-value:warning", "status-value:error"].includes(value) 26604), getFilter = (warningsActive = !1, errorsActive = !1) => warningsActive && errorsActive ? filterBoth : warningsActive ? filterWarn : errorsActive ? filterError : filterNone, Spacer = styled.div({ 26605 pointerEvents: "none" 26606}), Content4 = styled.div(({ theme }) => ({ 26607 position: "absolute", 26608 zIndex: 1, 26609 bottom: 0, 26610 left: 0, 26611 right: 0, 26612 padding: 12, 26613 display: "flex", 26614 flexDirection: "column", 26615 gap: 12, 26616 color: theme.color.defaultText, 26617 fontSize: theme.typography.size.s1, 26618 "&:empty": { 26619 display: "none" 26620 }, 26621 "--card-box-shadow": `0 1px 2px 0 rgba(0, 0, 0, 0.05), 0px -5px 20px 10px ${theme.background.app}`, 26622 // Integrators can use these to style their custom additions 26623 "--sb-sidebar-bottom-card-background": theme.background.content, 26624 "--sb-sidebar-bottom-card-border": `1px solid ${theme.appBorderColor}`, 26625 "--sb-sidebar-bottom-card-border-radius": `${theme.appBorderRadius + 1}px`, 26626 "--sb-sidebar-bottom-card-box-shadow": `0 1px 2px 0 rgba(0, 0, 0, 0.05), 0px -5px 20px 10px ${theme.background.app}` 26627})), SidebarBottomBase = ({ 26628 api, 26629 notifications = [], 26630 errorCount, 26631 warningCount, 26632 successCount, 26633 hasStatuses, 26634 isDevelopment, 26635 testProviderStates, 26636 registeredTestProviders, 26637 onRunAll 26638}) => { 26639 let spacerRef = useRef(null), wrapperRef = useRef(null), [warningsActive, setWarningsActive] = useState(!1), [errorsActive, setErrorsActive] = useState(!1); 26640 return useEffect(() => { 26641 if (spacerRef.current && wrapperRef.current) { 26642 let resizeObserver = new ResizeObserver(() => { 26643 spacerRef.current && wrapperRef.current && (spacerRef.current.style.height = `${wrapperRef.current.scrollHeight}px`); 26644 }); 26645 return resizeObserver.observe(wrapperRef.current), () => resizeObserver.disconnect(); 26646 } 26647 }, []), useEffect(() => { 26648 let filter = getFilter(warningCount > 0 && warningsActive, errorCount > 0 && errorsActive); 26649 api.experimental_setFilter
vendor: 5,428 bytes, lines 26649-26783
26649("sidebar-bottom-filter", filter); 26650 }, [api, warningCount, errorCount, warningsActive, errorsActive]), !warningCount && !errorCount && Object.values(registeredTestProviders).length === 0 && notifications.length === 0 ? null : react_default.createElement(Fragment, null, react_default.createElement(Spacer, { id: SIDEBAR_BOTTOM_SPACER_ID, ref: spacerRef }), react_default.createElement(Content4, { id: SIDEBAR_BOTTOM_WRAPPER_ID, ref: wrapperRef }, react_default.createElement(NotificationList, { notifications, clearNotification: api.clearNotification }), isDevelopment && react_default.createElement( 26651 TestingWidget, 26652 { 26653 registeredTestProviders, 26654 testProviderStates, 26655 onRunAll: () => { 26656 onRunAll(), setErrorsActive(!1), setWarningsActive(!1); 26657 }, 26658 hasStatuses, 26659 clearStatuses: () => { 26660 api.clearStatuses(), setErrorsActive(!1), setWarningsActive(!1); 26661 }, 26662 errorCount, 26663 errorsActive, 26664 setErrorsActive, 26665 warningCount, 26666 warningsActive, 26667 setWarningsActive, 26668 successCount 26669 } 26670 ))); 26671}, SidebarBottom = ({ isDevelopment }) => { 26672 let api = useStorybookApi(), registeredTestProviders = api.getElements(Addon_TypesEnum.experimental_TEST_PROVIDER), { notifications } = useStorybookState(), { hasStatuses, errorCount, warningCount, successCount } = experimental_useStatusStore( 26673 (statuses) => Object.values(statuses).reduce( 26674 (result, storyStatuses) => (Object.values(storyStatuses).forEach((status) => { 26675 result.hasStatuses = !0, status.value === "status-value:error" && (result.errorCount += 1), status.value === "status-value:warning" && (result.warningCount += 1), status.value === "status-value:success" && (result.successCount += 1); 26676 }), result), 26677 { errorCount: 0, warningCount: 0, successCount: 0, hasStatuses: !1 } 26678 ) 26679 ), testProviderStates = experimental_useTestProviderStore(); 26680 return react_default.createElement( 26681 SidebarBottomBase, 26682 { 26683 api, 26684 notifications, 26685 hasStatuses, 26686 errorCount, 26687 warningCount, 26688 successCount, 26689 isDevelopment, 26690 testProviderStates, 26691 registeredTestProviders, 26692 onRunAll: internal_fullTestProviderStore.runAll 26693 } 26694 ); 26695}; 26696 26697// src/manager/components/sidebar/useLastViewed.ts 26698init_react(); 26699var import_store2 = __toESM(require_store2(), 1), save = debounce((value) => import_store2.default.set("lastViewedStoryIds", value), 1e3), useLastViewed = (selection) => { 26700 let initialLastViewedStoryIds = useMemo(() => { 26701 let items = import_store2.default.get("lastViewedStoryIds"); 26702 return !items || !Array.isArray(items) ? [] : items.some((item) => typeof item == "object" && item.storyId && item.refId) ? items : []; 26703 }, [import_store2.default]), lastViewedRef = useRef(initialLastViewedStoryIds), updateLastViewed = useCallback( 26704 (story) => { 26705 let items = lastViewedRef.current, index = items.findIndex( 26706 ({ storyId, refId }) => storyId === story.storyId && refId === story.refId 26707 ); 26708 index !== 0 && (index === -1 ? lastViewedRef.current = [story, ...items] : lastViewedRef.current = [story, ...items.slice(0, index), ...items.slice(index + 1)], save(lastViewedRef.current)); 26709 }, 26710 [lastViewedRef] 26711 ); 26712 return useEffect(() => { 26713 selection && updateLastViewed(selection); 26714 }, [selection]), { 26715 getLastViewed: useCallback(() => lastViewedRef.current, [lastViewedRef]), 26716 clearLastViewed: useCallback(() => { 26717 lastViewedRef.current = lastViewedRef.current.slice(0, 1), save(lastViewedRef.current); 26718 }, [lastViewedRef]) 26719 }; 26720}; 26721 26722// src/manager/components/sidebar/Sidebar.tsx 26723var DEFAULT_REF_ID = "storybook_internal", Container11 = styled.header(({ theme }) => ({ 26724 position: "absolute", 26725 zIndex: 1, 26726 left: 0, 26727 top: 0, 26728 bottom: 0, 26729 right: 0, 26730 width: "100%", 26731 height: "100%", 26732 display: "flex", 26733 flexDirection: "column", 26734 background: theme.background.content, 26735 [MEDIA_DESKTOP_BREAKPOINT]: { 26736 background: theme.background.app 26737 } 26738})), Stack = styled.div({ 26739 display: "flex", 26740 flexDirection: "column", 26741 gap: 16, 26742 padding: "16px 12px 20px 12px" 26743}), CreateNewStoryButton = styled(Button)(({ theme, isMobile: isMobile2 }) => ({ 26744 color: theme.textMutedColor, 26745 width: isMobile2 ? 36 : 32, 26746 height: isMobile2 ? 36 : 32, 26747 borderRadius: theme.appBorderRadius + 2 26748})), useCombination = (index, indexError, previewInitialized, allStatuses, refs) => { 26749 let hash = useMemo( 26750 () => ({ 26751 [DEFAULT_REF_ID]: { 26752 index, 26753 filteredIndex: index, 26754 indexError, 26755 previewInitialized, 26756 allStatuses, 26757 title: null, 26758 id: DEFAULT_REF_ID, 26759 url: "iframe.html" 26760 }, 26761 ...refs 26762 }), 26763 [refs, index, indexError, previewInitialized, allStatuses] 26764 ); 26765 return useMemo(() => ({ hash, entries: Object.entries(hash) }), [hash]); 26766}, isRendererReact2 = scope.STORYBOOK_RENDERER === "react", Sidebar = react_default.memo(function({ 26767 // @ts-expect-error (non strict) 26768 storyId = null, 26769 refId = DEFAULT_REF_ID, 26770 index, 26771 indexJson, 26772 indexError, 26773 allStatuses, 26774 previewInitialized, 26775 menu, 26776 menuHighlighted = !1, 26777 enableShortcuts = !0, 26778 isDevelopment = scope.CONFIG_TYPE === "DEVELOPMENT", 26779 refs = {}, 26780 onMenuClick, 26781 showCreateStoryButton = isDevelopment && isRendererReact2 26782}) { 26783 let [isFileSearchModalOpen, setIsFileSearchModalOpen] = useState(!1), selected = useMemo(() => storyId && { storyId, refId }, [storyId, refId]
vendor: 10,204 bytes, lines 26783-27048
26783), dataset = useCombination(index, indexError, previewInitialized, allStatuses, refs), isLoading = !index && !indexError, hasEntries = Object.keys(indexJson?.entries ?? {}).length > 0, lastViewedProps = useLastViewed(selected), { isMobile: isMobile2 } = useLayout(), api = useStorybookApi(), { viewMode } = api.getUrlState(), headerRef = useRef(null), { landmarkProps } = useLandmark( 26784 { "aria-labelledby": "global-site-h1", role: "banner" }, 26785 headerRef 26786 ), skipLinkHref = isPagesViewMode(viewMode) ? "#main-content-wrapper" : "#storybook-preview-wrapper", showReviewWidget = useActiveReviewStoryCount() > 0, showOnboardingChecklist = !isLoading && scope.CONFIG_TYPE === "DEVELOPMENT" && scope.FEATURES?.sidebarOnboardingChecklist !== !1 && !showReviewWidget; 26787 return react_default.createElement( 26788 Container11, 26789 { 26790 className: "container sidebar-container", 26791 id: focusableUIElements.sidebarRegion, 26792 ref: headerRef, 26793 ...landmarkProps 26794 }, 26795 react_default.createElement("h1", { id: "global-site-h1", className: "sb-sr-only" }, "Storybook"), 26796 react_default.createElement(IconSymbols, null), 26797 react_default.createElement(ScrollArea, { vertical: !0, offset: 3, scrollbarSize: 6, scrollPadding: "4rem" }, react_default.createElement(Stack, null, react_default.createElement("div", null, react_default.createElement( 26798 Heading2, 26799 { 26800 className: "sidebar-header", 26801 menuHighlighted, 26802 menu, 26803 skipLinkHref, 26804 isLoading, 26805 onMenuClick 26806 } 26807 ), showOnboardingChecklist ? react_default.createElement(ChecklistWidget, null) : null), !isLoading && showReviewWidget ? react_default.createElement(ReviewWidget_default, null) : null, react_default.createElement( 26808 Search, 26809 { 26810 dataset, 26811 enableShortcuts, 26812 searchBarContent: showCreateStoryButton && react_default.createElement(react_default.Fragment, null, react_default.createElement( 26813 CreateNewStoryButton, 26814 { 26815 isMobile: isMobile2, 26816 onClick: () => { 26817 setIsFileSearchModalOpen(!0); 26818 }, 26819 ariaLabel: "Create a new story", 26820 variant: "outline", 26821 padding: "small" 26822 }, 26823 react_default.createElement(PlusIcon, null) 26824 ), react_default.createElement( 26825 CreateNewStoryFileModal, 26826 { 26827 open: isFileSearchModalOpen, 26828 onOpenChange: setIsFileSearchModalOpen 26829 } 26830 )), 26831 searchFieldContent: react_default.createElement(Filter, null), 26832 ...lastViewedProps 26833 }, 26834 ({ 26835 query, 26836 results, 26837 isNavVisible, 26838 isNavReachable, 26839 isSearchResultRendered, 26840 closeMenu, 26841 getMenuProps, 26842 getItemProps, 26843 highlightedIndex 26844 }) => react_default.createElement(react_default.Fragment, null, react_default.createElement( 26845 Explorer, 26846 { 26847 dataset, 26848 selected, 26849 isLoading, 26850 isBrowsing: isNavVisible, 26851 isHidden: !isNavReachable, 26852 hasEntries 26853 } 26854 ), isSearchResultRendered && react_default.createElement( 26855 SearchResults, 26856 { 26857 query, 26858 results, 26859 closeMenu, 26860 getMenuProps, 26861 getItemProps, 26862 highlightedIndex, 26863 enableShortcuts, 26864 isLoading, 26865 clearLastViewed: lastViewedProps.clearLastViewed 26866 } 26867 )) 26868 )), isMobile2 || isLoading ? null : react_default.createElement(SidebarBottom, { isDevelopment })) 26869 ); 26870}); 26871 26872// src/manager/container/Menu.tsx 26873init_react(); 26874var ProgressCircle2 = styled(ProgressSpinner)(({ theme }) => ({ 26875 color: theme.color.secondary 26876})), useMenu = ({ 26877 api, 26878 showToolbar, 26879 isPanelShown, 26880 isNavShown, 26881 enableShortcuts 26882}) => { 26883 let shortcutKeys = api.getShortcutKeys(), { progress } = useChecklist(), about = useMemo( 26884 () => ({ 26885 id: "about", 26886 title: "About your Storybook", 26887 onClick: () => api.changeSettingsTab("about"), 26888 href: "./?path=/settings/about", 26889 internal: !0, 26890 closeOnClick: !0, 26891 icon: react_default.createElement(InfoIcon, null) 26892 }), 26893 [api] 26894 ), guide = useMemo( 26895 () => ({ 26896 id: "guide", 26897 title: "Onboarding guide", 26898 onClick: () => api.changeSettingsTab("guide"), 26899 href: "./?path=/settings/guide", 26900 internal: !0, 26901 closeOnClick: !0, 26902 icon: react_default.createElement(ListUnorderedIcon, null), 26903 right: progress < 100 && react_default.createElement(ActionList.Button, { as: "div", readOnly: !0, padding: "none", ariaLabel: `${progress}% completed` }, react_default.createElement(ProgressCircle2, { percentage: progress, running: !1, size: 16, width: 1.5 }), progress, "%") 26904 }), 26905 [api, progress] 26906 ), shortcuts = useMemo( 26907 () => ({ 26908 id: "shortcuts", 26909 title: "Keyboard shortcuts", 26910 onClick: () => api.changeSettingsTab("shortcuts"), 26911 href: "./?path=/settings/shortcuts", 26912 internal: !0, 26913 closeOnClick: !0, 26914 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.shortcutsPage }) : null, 26915 icon: react_default.createElement(CommandIcon, null) 26916 }), 26917 [api, enableShortcuts, shortcutKeys.shortcutsPage] 26918 ), sidebarToggle = useMemo( 26919 () => ({ 26920 id: "S", 26921 title: "Show sidebar", 26922 onClick: () => api.toggleNav(), 26923 closeOnClick: !0, 26924 active: isNavShown, 26925 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.toggleNav }) : null, 26926 icon: isNavShown ? react_default.createElement(CheckIcon, null) : react_default.createElement(react_default.Fragment, null) 26927 }), 26928 [api, enableShortcuts, shortcutKeys, isNavShown] 26929 ), toolbarToogle = useMemo( 26930 () => ({ 26931 id: "T", 26932 title: "Show toolbar", 26933 onClick: () => api.toggleToolbar(), 26934 active: showToolbar, 26935 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.toolbar }) : null, 26936 icon: showToolbar ? react_default.createElement(CheckIcon, null) : react_default.createElement(react_default.Fragment, null) 26937 }), 26938 [api, enableShortcuts, shortcutKeys, showToolbar] 26939 ), addonsToggle = useMemo( 26940 () => ({ 26941 id: "A", 26942 title: "Show addons panel", 26943 onClick: () => api.togglePanel(), 26944 active: isPanelShown, 26945 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.togglePanel }) : null, 26946 icon: isPanelShown ? react_default.createElement(CheckIcon, null) : react_default.createElement(react_default.Fragment, null) 26947 }), 26948 [api, enableShortcuts, shortcutKeys, isPanelShown] 26949 ), up = useMemo( 26950 () => ({ 26951 id: "up", 26952 title: "Previous component", 26953 onClick: () => api.jumpToComponent(-1), 26954 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.prevComponent }) : null, 26955 icon: react_default.createElement(react_default.Fragment, null) 26956 }), 26957 [api, enableShortcuts, shortcutKeys] 26958 ), down = useMemo( 26959 () => ({ 26960 id: "down", 26961 title: "Next component", 26962 onClick: () => api.jumpToComponent(1), 26963 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.nextComponent }) : null, 26964 icon: react_default.createElement(react_default.Fragment, null) 26965 }), 26966 [api, enableShortcuts, shortcutKeys] 26967 ), prev = useMemo( 26968 () => ({ 26969 id: "prev", 26970 title: "Previous story", 26971 onClick: () => api.jumpToStory(-1), 26972 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.prevStory }) : null, 26973 icon: react_default.createElement(react_default.Fragment, null) 26974 }), 26975 [api, enableShortcuts, shortcutKeys] 26976 ), next = useMemo( 26977 () => ({ 26978 id: "next", 26979 title: "Next story", 26980 onClick: () => api.jumpToStory(1), 26981 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.nextStory }) : null, 26982 icon: react_default.createElement(react_default.Fragment, null) 26983 }), 26984 [api, enableShortcuts, shortcutKeys] 26985 ), collapse = useMemo( 26986 () => ({ 26987 id: "collapse", 26988 title: "Collapse all", 26989 onClick: () => api.emit(STORIES_COLLAPSE_ALL), 26990 right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.collapseAll }) : null, 26991 icon: react_default.createElement(react_default.Fragment, null) 26992 }), 26993 [api, enableShortcuts, shortcutKeys] 26994 ), documentation = useMemo(() => ({ 26995 id: "documentation", 26996 title: "Documentation", 26997 closeOnClick: !0, 26998 href: api.getDocsUrl({ versioned: !0, renderer: !0 }), 26999 right: react_default.createElement(ActionList.Icon, null, react_default.createElement(ShareAltIcon, null)), 27000 icon: react_default.createElement(DocumentIcon, null) 27001 }), [api]), getAddonsShortcuts = useCallback(() => { 27002 let addonsShortcuts = api.getAddonsShortcuts(), keys = shortcutKeys; 27003 return Object.entries(addonsShortcuts).filter(([_2, { showInMenu }]) => showInMenu).map(([actionName, { label, action }]) => ({ 27004 id: actionName, 27005 title: label, 27006 onClick: () => action(), 27007 right: enableShortcuts && keys[actionName] ? react_default.createElement(Shortcut, { keys: keys[actionName] }) : null 27008 })); 27009 }, [api, enableShortcuts, shortcutKeys]); 27010 return useMemo( 27011 () => [ 27012 [ 27013 about, 27014 ...scope.CONFIG_TYPE === "DEVELOPMENT" && scope.FEATURES?.menuOnboardingChecklist !== !1 ? [guide] : [], 27015 ...enableShortcuts ? [shortcuts] : [] 27016 ], 27017 [sidebarToggle, toolbarToogle, addonsToggle, up, down, prev, next, collapse], 27018 getAddonsShortcuts(), 27019 [documentation] 27020 ], 27021 [ 27022 about, 27023 guide, 27024 documentation, 27025 shortcuts, 27026 sidebarToggle, 27027 toolbarToogle, 27028 addonsToggle, 27029 up, 27030 down, 27031 prev, 27032 next, 27033 collapse, 27034 getAddonsShortcuts, 27035 enableShortcuts 27036 ] 27037 ); 27038}; 27039 27040// src/manager/container/Sidebar.tsx 27041var Sidebar3 = react_default.memo(function({ onMenuClick }) { 27042 return react_default.createElement(Consumer, { filter: ({ state, api }) => { 27043 let { 27044 ui: { name, url, enableShortcuts }, 27045 viewMode, 27046 storyId, 27047 refId, 27048 l
vendor: 1,265 bytes, lines 27048-27089
27048ayout: { showToolbar }, 27049 // FIXME: This is the actual `index.json` index where the `index` below 27050 // is actually the stories hash. We should fix this up and make it consistent. 27051 internal_index, 27052 filteredIndex: index, 27053 indexError, 27054 previewInitialized, 27055 refs 27056 } = state, whatsNewNotificationsEnabled = state.whatsNewData?.status === "SUCCESS" && !state.disableWhatsNewNotifications; 27057 return { 27058 api, 27059 title: name, 27060 url, 27061 indexJson: internal_index, 27062 index, 27063 indexError, 27064 previewInitialized, 27065 refs, 27066 storyId, 27067 refId, 27068 viewMode, 27069 showToolbar, 27070 isPanelShown: api.getIsPanelShown(), 27071 isNavShown: api.getIsNavShown(), 27072 menuHighlighted: whatsNewNotificationsEnabled && api.isWhatsNewUnread(), 27073 enableShortcuts 27074 }; 27075 } }, ({ api, showToolbar, isPanelShown, isNavShown, enableShortcuts, ...state }) => { 27076 let menu = useMenu({ api, showToolbar, isPanelShown, isNavShown, enableShortcuts }), allStatuses = experimental_useStatusStore(); 27077 return react_default.createElement( 27078 Sidebar, 27079 { 27080 ...state, 27081 menu, 27082 onMenuClick, 27083 allStatuses, 27084 enableShortcuts 27085 } 27086 ); 27087 }); 27088}), Sidebar_default = Sidebar3; 27089
27090// src/manager/App.tsx 27091var MainPreview = () => { 27092 let { isSummaryVisible } = useReview(); 27093 return isSummaryVisible ? null : react_default.createElement(Preview_default, { id: "main", withLoader: !0 }); 27094}, App = ({ managerLayoutState, setManagerLayoutState, pages, hasTab }) => { 27095 let { setMobileAboutOpen } = useLayout(), { enableShortcuts = !0 } = addons.getConfig(); 27096 return useEffect(() => { 27097 document.body.setAttribute("data-shortcuts-enabled", enableShortcuts ? "true" : "false"); 27098 }, [enableShortcuts]), useEffect(() => { 27099 let rootElement = document.getElementById("root"); 27100 if (!rootElement) 27101 return; 27102 let observer = new MutationObserver(() => { 27103 let hasInert = rootElement.hasAttribute("inert"); 27104 addons.getChannel().emit(core_events_default.MANAGER_INERT_ATTRIBUTE_CHANGED, hasInert); 27105 }); 27106 return observer.observe(rootElement, { 27107 attributes: !0, 27108 attributeFilter: ["inert"] 27109 }), () => observer.disconnect(); 27110 }, []), react_default.createElement(react_default.Fragment, null, react_default.createElement(Global, { styles: createGlobal }), react_default.createElement(ManagerErrorBoundary, null, react_default.createElement( 27111 Layout, 27112 { 27113 hasTab, 27114 managerLayoutState, 27115 setManagerLayoutState, 27116 slotOverlay: isReviewFeatureEnabled(scope.FEATURES) ? react_default.createElement(ReviewPersistentLayer, null) : void 0, 27117 slotMain: react_default.createElement(MainPreview, null), 27118 slotSidebar: react_default.createElement(Sidebar_default, { onMenuClick: () => setMobileAboutOpen((state) => !state) }), 27119 slotPanel: react_default.createElement(Panel_default, null), 27120 slotPages: pages.map(({ id, render: Content6 }) => react_default.createElement(Content6, { key: id })) 27121 } 27122 )
vendor: 44,596 bytes, lines 27122-28253
27122)); 27123}; 27124 27125// src/manager/provider.ts 27126var Provider2 = class { 27127 getElements(_type) { 27128 throw new Error("Provider.getElements() is not implemented!"); 27129 } 27130 handleAPI(_api) { 27131 throw new Error("Provider.handleAPI() is not implemented!"); 27132 } 27133 getConfig() { 27134 return console.error("Provider.getConfig() is not implemented!"), {}; 27135 } 27136}; 27137 27138// src/manager/settings/index.tsx 27139init_react(); 27140 27141// src/manager/settings/AboutPage.tsx 27142init_react(); 27143 27144// src/manager/settings/About.tsx 27145init_react(); 27146var Container12 = styled.div({ 27147 display: "flex", 27148 alignItems: "center", 27149 flexDirection: "column", 27150 marginTop: 40 27151}), Header = styled.header({ 27152 marginBottom: 32, 27153 alignItems: "center", 27154 display: "flex", 27155 "> svg": { 27156 height: 48, 27157 width: "auto", 27158 marginRight: 8 27159 } 27160}), Footer2 = styled.div(({ theme }) => ({ 27161 marginBottom: 24, 27162 display: "flex", 27163 flexDirection: "column", 27164 alignItems: "center", 27165 color: theme.base === "light" ? theme.color.dark : theme.color.lightest, 27166 fontWeight: theme.typography.weight.regular, 27167 fontSize: theme.typography.size.s2 27168})), Actions3 = styled.div({ 27169 display: "flex", 27170 flexDirection: "row", 27171 alignItems: "center", 27172 marginBottom: 24, 27173 marginTop: 24, 27174 gap: 16 27175}), StyledLink = styled(Link)(({ theme }) => ({ 27176 "&&": { 27177 fontWeight: theme.typography.weight.bold, 27178 color: theme.base === "light" ? theme.color.dark : theme.color.light 27179 }, 27180 "&:hover": { 27181 color: theme.base === "light" ? theme.color.darkest : theme.color.lightest 27182 } 27183})), AboutScreen = ({ onNavigateToWhatsNew }) => react_default.createElement(Container12, null, react_default.createElement(Header, null, react_default.createElement(StorybookLogo, { alt: "Storybook" })), react_default.createElement(UpgradeBlock, { onNavigateToWhatsNew }), react_default.createElement(Footer2, null, react_default.createElement(Actions3, null, react_default.createElement(Button, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: "https://github.com/storybookjs/storybook" }, react_default.createElement(GithubIcon, null), "GitHub")), react_default.createElement(Button, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: "https://storybook.js.org/docs?ref=ui" }, react_default.createElement(DocumentIcon, { style: { display: "inline", marginRight: 5 } }), "Documentation"))), react_default.createElement("div", null, "Open source software maintained by", " ", react_default.createElement(StyledLink, { href: "https://www.chromatic.com/" }, "Chromatic"), " and the", " ", react_default.createElement(StyledLink, { href: "https://github.com/storybookjs/storybook/graphs/contributors" }, "Storybook Community")))); 27184 27185// src/manager/settings/AboutPage.tsx 27186var NotificationClearer = class extends Component { 27187 componentDidMount() { 27188 let { api, notificationId } = this.props; 27189 api.clearNotification(notificationId); 27190 } 27191 render() { 27192 let { children } = this.props; 27193 return children; 27194 } 27195}, AboutPage = () => { 27196 let api = useStorybookApi(), state = useStorybookState(), onNavigateToWhatsNew = useCallback(() => { 27197 api.changeSettingsTab("whats-new"); 27198 }, [api]); 27199 return react_default.createElement(NotificationClearer, { api, notificationId: "update" }, react_default.createElement( 27200 AboutScreen, 27201 { 27202 onNavigateToWhatsNew: state.whatsNewData?.status === "SUCCESS" ? onNavigateToWhatsNew : void 0 27203 } 27204 )); 27205}; 27206 27207// src/manager/settings/GuidePage.tsx 27208init_react(); 27209 27210// src/manager/settings/Checklist/Checklist.tsx 27211init_react(); 27212 27213// src/manager/components/Focus/Focus.tsx 27214init_react(); 27215var FocusOutline = styled.div( 27216 ({ theme, active = !1, outlineOffset = 0 }) => ({ 27217 width: "100%", 27218 borderRadius: "inherit", 27219 transition: "outline-color var(--transition-duration, 0.2s)", 27220 outline: `2px solid ${active ? theme.color.secondary : "transparent"}`, 27221 outlineOffset 27222 }) 27223), FocusProxy = styled(FocusOutline)(({ theme, targetId }) => ({ 27224 [`&:has([data-target-id="${targetId}"]:focus-visible)`]: { 27225 outlineColor: theme.color.secondary 27226 } 27227})), FocusRing = ({ 27228 active = !1, 27229 highlightDuration, 27230 nodeRef, 27231 ...props 27232}) => { 27233 let [visible, setVisible] = useState(active); 27234 return useEffect(() => { 27235 if (highlightDuration) { 27236 setVisible(active); 27237 let timeout = setTimeout(setVisible, highlightDuration, !1); 27238 return () => clearTimeout(timeout); 27239 } 27240 }, [active, highlightDuration]), react_default.createElement(FocusOutline, { ...props, active: highlightDuration ? visible : active, ref: nodeRef }); 27241}, FocusTarget = ({ 27242 targetHash, 27243 highlightDuration, 27244 ...props 27245}) => { 27246 let nodeRef = useRef(null), locationHash = useLocationHash(), [active, setActive] = useState(locationHash === targetHash); 27247 return useEffect(() => { 27248 let timeouts = []; 27249 return setActive(!1), locationHash === targetHash && (timeouts.push( 27250 setTimeout(() => { 27251 setActive(!0), nodeRef.current?.focus({ preventScroll: !0 }), nodeRef.current?.scrollIntoView({ behavior: "smooth", block: "center" }); 27252 }, 0) 27253 ), highlightDuration && timeouts.push(setTimeout(setActive, highlightDuration, !1))), () => timeouts.forEach(clearTimeout); 27254 }, [locationHash, targetHash, highlightDuration]), react_default.createElement(FocusRing, { ...props, active, nodeRef, tabIndex: -1 }); 27255}, Focus = { 27256 Outline: FocusOutline, 27257 Proxy: FocusProxy, 27258 Ring: FocusRing, 27259 Target: FocusTarget 27260}; 27261 27262// src/manager/settings/Checklist/Checklist.tsx 27263var Sections = styled.ol(({ theme }) => ({ 27264 listStyle: "none", 27265 display: "flex", 27266 flexDirection: "column", 27267 gap: 20, 27268 margin: 0, 27269 padding: 0, 27270 "& > li": { 27271 background: theme.background.content, 27272 border: `1px solid ${theme.base === "dark" ? theme.color.darker : theme.color.border}`, 27273 borderRadius: 8 27274 } 27275})), Items = styled.ol(({ theme }) => ({ 27276 listStyle: "none", 27277 display: "flex", 27278 flexDirection: "column", 27279 margin: 0, 27280 padding: 0, 27281 "& > li:not(:last-child)": { 27282 boxShadow: `inset 0 -1px 0 ${theme.base === "dark" ? theme.color.darker : theme.color.border}` 27283 }, 27284 "& > li:last-child": { 27285 borderBottomLeftRadius: 7, 27286 borderBottomRightRadius: 7 27287 } 27288})), SectionSummary = styled.div( 27289 ({ theme, progress, isCollapsed, onClick }) => ({ 27290 position: "relative", 27291 fontWeight: "bold", 27292 display: "flex", 27293 alignItems: "center", 27294 gap: 10, 27295 padding: "10px 10px 10px 15px", 27296 borderBottom: `5px solid ${theme.base === "dark" ? theme.color.darker : theme.color.light}`, 27297 borderBottomLeftRadius: isCollapsed ? 7 : 0, 27298 borderBottomRightRadius: isCollapsed ? 7 : 0, 27299 transition: "border-radius var(--transition-duration, 0.2s)", 27300 cursor: onClick ? "pointer" : "default", 27301 "--toggle-button-rotate": isCollapsed ? "0deg" : "180deg", 27302 "--toggle-button-opacity": 0, 27303 "&:hover, &:focus-visible": { 27304 outline: "none", 27305 "--toggle-button-opacity": 1 27306 }, 27307 "&::after": { 27308 pointerEvents: "none", 27309 position: "absolute", 27310 top: 0, 27311 bottom: -5, 27312 left: 0, 27313 right: 0, 27314 content: '""', 27315 display: "block", 27316 width: `${progress}%`, 27317 borderBottom: `5px solid ${theme.color.positive}`, 27318 borderBottomLeftRadius: "inherit", 27319 borderBottomRightRadius: progress === 100 ? "inherit" : 0, 27320 transition: "width var(--transition-duration, 0.2s)" 27321 } 27322 }) 27323), SectionHeading = styled.h2(({ theme }) => ({ 27324 flex: 1, 27325 margin: 0, 27326 fontSize: theme.typography.size.s3, 27327 fontWeight: theme.typography.weight.bold 27328})), ItemSummary = styled.div( 27329 ({ theme, isCollapsed, onClick }) => ({ 27330 fontWeight: theme.typography.weight.regular, 27331 fontSize: theme.typography.size.s2, 27332 display: "flex", 27333 alignItems: "center", 27334 minHeight: 40, 27335 gap: 10, 27336 padding: isCollapsed ? "6px 10px 6px 15px" : "10px 10px 10px 15px", 27337 transition: "padding var(--transition-duration, 0.2s)", 27338 cursor: onClick ? "pointer" : "default", 27339 "--toggle-button-rotate": isCollapsed ? "0deg" : "180deg", 27340 "&:focus-visible": { 27341 outline: "none" 27342 } 27343 }) 27344), ItemHeading = styled.h3(({ theme, skipped }) => ({ 27345 flex: 1, 27346 margin: 0, 27347 color: skipped ? theme.textMutedColor : theme.color.defaultText, 27348 overflow: "hidden", 27349 textOverflow: "ellipsis", 27350 whiteSpace: "nowrap", 27351 fontSize: theme.typography.size.s2, 27352 fontWeight: theme.typography.weight.bold 27353})), ItemContent2 = styled.div(({ theme }) => ({ 27354 display: "flex", 27355 flexDirection: "column", 27356 alignItems: "flex-start", 27357 gap: 8, 27358 padding: "0 15px 15px 41px", 27359 fontSize: theme.typography.size.s2, 27360 code: { 27361 fontSize: "0.9em", 27362 backgroundColor: theme.background.app, 27363 borderRadius: theme.appBorderRadius, 27364 padding: "1px 3px" 27365 }, 27366 img: { 27367 maxWidth: "100%", 27368 margin: "15px auto" 27369 }, 27370 p: { 27371 margin: 0, 27372 lineHeight: 1.4 27373 }, 27374 "ol, ul": { 27375 paddingLeft: 25, 27376 listStyleType: "disc", 27377 "li::marker": { 27378 color: theme.color.mediumdark 27379 } 27380 } 27381})), StatusIcon3 = styled.div(({ theme }) => ({ 27382 position: "relative", 27383 flex: "0 0 auto", 27384 minHeight: 16, 27385 minWidth: 16, 27386 margin: 0, 27387 background: theme.base === "dark" ? theme.color.darkest : theme.background.app, 27388 borderRadius: 9, 27389 outline: `1px solid ${theme.base === "dark" ? theme.color.darker : theme.color.border}`, 27390 outlineOffset: -1 27391})), Checked2 = styled(StatusPassIcon)( 27392 ({ theme, "data-visible": visible }) => ({ 27393 position: "absolute", 27394 width: "inherit", 27395 height: "inherit", 27396 top: 0, 27397 left: 0, 27398 bottom: 0, 27399 right: 0, 27400 padding: 1, 27401 borderRadius: "50%", 27402 background: theme.color.positive, 27403 color: theme.background.content, 27404 opacity: visible ? 1 : 0, 27405 transform: visible ? "scale(1)" : "scale(0.7)", 27406 transition: "all var(--transition-duration, 0.2s)" 27407 }) 27408), Skipped = styled.span(({ theme, visible }) => ({ 27409 display: "flex", 27410 alignItems: "center", 27411 color: theme.textMutedColor, 27412 fontSize: "12px", 27413 fontWeight: "bold", 27414 overflow: "hidden", 27415 padding: visible ? "0 10px" : 0, 27416 opacity: visible ? 1 : 0, 27417 width: visible ? "auto" : 0, 27418 height: visible ? 18 : 16, 27419 transition: "all var(--transition-duration, 0.2s)" 27420})), Actions4 = styled.div({ 27421 alignSelf: "flex-end", 27422 flexDirection: "row-reverse", 27423 display: "flex", 27424 gap: 4 27425}), ToggleButton2 = styled(Button)({ 27426 opacity: "var(--toggle-button-opacity)", 27427 transition: "opacity var(--transition-duration, 0.2s)", 27428 "&:hover, &:focus": { 27429 opacity: 1 27430 }, 27431 svg: { 27432 transform: "rotate(var(--toggle-button-rotate))", 27433 transition: "transform var(--transition-duration, 0.2s)" 27434 } 27435}), ChecklistCopyButton = ({ 27436 label, 27437 copyContent, 27438 onClick 27439}) => { 27440 let { children: copyChildren, buttonProps: copyButtonProps } = useCopyButton2({ 27441 children: label, 27442 onCopy: onClick, 27443 content: copyContent 27444 }); 27445 return react_default.createElement(Button, { variant: "solid", size: "small", ...copyButtonProps }, copyChildren); 27446}, Checklist = ({ 27447 availableItems, 27448 accept, 27449 skip, 27450 reset, 27451 forceCollapsed = !1 27452}) => { 27453 let api = useStorybookApi(), locationHash = useLocationHash(), { itemsById, sectionsById } = useMemo( 27454 () => availableItems.reduce( 27455 (acc, item) => { 27456 acc.itemsById[item.id] = item; 27457 let { sectionId: id, sectionTitle: title2 } = item; 27458 return acc.sectionsById[id] = acc.sectionsById[id] ?? { id, title: title2, itemIds: [] }, acc.sectionsById[id].itemIds.push(item.id), acc; 27459 }, 27460 { itemsById: {}, sectionsById: {} } 27461 ), 27462 [availableItems] 27463 ), sections = useMemo( 27464 () => Object.values(sectionsById).map(({ id, title: title2, itemIds }) => { 27465 let items = itemIds.map((id2) => itemsById[id2]).filter(({ showOnGuidePage }) => showOnGuidePage !== !1), progress = items.reduce((acc, item) => item.isOpen ? acc : acc + 1, 0) / items.length * 100; 27466 return { id, title: title2, items, progress }; 27467 }), 27468 [itemsById, sectionsById] 27469 ); 27470 return react_default.createElement(Sections, null, sections.map(({ id, title: title2, items, progress }) => { 27471 let collapsed = forceCollapsed || progress === 100 && items.every((item) => item.id !== locationHash); 27472 return react_default.createElement("li", { key: id }, react_default.createElement(Focus.Proxy, { targetId: `toggle-${id}` }, react_default.createElement( 27473 Collapsible, 27474 { 27475 collapsed, 27476 summary: ({ isCollapsed, toggleCollapsed, toggleProps }) => react_default.createElement( 27477 SectionSummary, 27478 { 27479 progress, 27480 isCollapsed, 27481 onClick: toggleCollapsed 27482 }, 27483 react_default.createElement(StatusIcon3, null, react_default.createElement(Checked2, { "data-visible": progress === 100 })), 27484 react_default.createElement(SectionHeading, null, title2), 27485 react_default.createElement(Actions4, null, react_default.createElement( 27486 ToggleButton2, 27487 { 27488 ...toggleProps, 27489 "data-target-id": `toggle-${id}`, 27490 variant: "ghost", 27491 padding: "small", 27492 "aria-label": title2 27493 }, 27494 react_default.createElement(ChevronSmallDownIcon, null) 27495 )) 27496 ) 27497 }, 27498 react_default.createElement(Items, null, items.map( 27499 ({ 27500 content, 27501 isOpen, 27502 isAccepted, 27503 isDone, 27504 isLockedBy, 27505 isImmutable, 27506 isSkipped, 27507 ...item 27508 }) => { 27509 let isChecked = isAccepted || isDone, isCollapsed = item.id !== locationHash, isLocked = !!isLockedBy, itemContent = content?.({ api }); 27510 return react_default.createElement(ActionList.Item, { key: item.id }, react_default.createElement( 27511 Focus.Target, 27512 { 27513 targetHash: item.id, 27514 highlightDuration: 2e3, 27515 outlineOffset: -2 27516 }, 27517 react_default.createElement(Focus.Proxy, { targetId: `toggle-${item.id}`, outlineOffset: -2 }, react_default.createElement( 27518 Collapsible, 27519 { 27520 collapsed: isCollapsed, 27521 summary: ({ isCollapsed: isCollapsed2, toggleCollapsed, toggleProps }) => react_default.createElement( 27522 ItemSummary, 27523 { 27524 isCollapsed: isCollapsed2 || !itemContent, 27525 onClick: itemContent ? toggleCollapsed : void 0 27526 }, 27527 react_default.createElement(StatusIcon3, null, react_default.createElement(Checked2, { "data-visible": isChecked }), react_default.createElement(Skipped, { visible: isSkipped }, "Skipped")), 27528 react_default.createElement(ItemHeading, { skipped: isSkipped }, item.label), 27529 react_default.createElement(Actions4, null, itemContent && react_default.createElement( 27530 ToggleButton2, 27531 { 27532 ...toggleProps, 27533 "data-target-id": `toggle-${item.id}`, 27534 variant: "ghost", 27535 padding: "small", 27536 ariaLabel: `${isCollapsed2 ? "Expand" : "Collapse"} ${item.label}` 27537 }, 27538 react_default.createElement(ChevronSmallDownIcon, null) 27539 ), isLocked && react_default.createElement( 27540 Button, 27541 { 27542 variant: "ghost", 27543 padding: "small", 27544 ariaLabel: "Locked", 27545 tooltip: `Complete \u201C${itemsById[isLockedBy].label}\u201D first`, 27546 disabled: !0, 27547 readOnly: !0 27548 }, 27549 react_default.createElement(LockIcon, null) 27550 ), isOpen && !isLocked && item.action && (item.action.copyContent ? react_default.createElement( 27551 ChecklistCopyButton, 27552 { 27553 label: item.action.label, 27554 copyContent: item.action.copyContent, 27555 onClick: () => item.action.onClick({ 27556 api, 27557 accept: () => accept(item.id) 27558 }) 27559 } 27560 ) : react_default.createElement( 27561 Button, 27562 { 27563 ariaLabel: !1, 27564 variant: "solid", 27565 size: "small", 27566 onClick: (e2) => { 27567 e2.stopPropagation(), item.action?.onClick({ 27568 api, 27569 accept: () => accept(item.id) 27570 }); 27571 } 27572 }, 27573 item.action.label 27574 )), isOpen && !isLocked && !item.action && !item.subscribe && react_default.createElement( 27575 Button, 27576 { 27577 ariaLabel: !1, 27578 variant: "outline", 27579 size: "small", 27580 onClick: (e2) => { 27581 e2.stopPropagation(), accept(item.id); 27582 } 27583 }, 27584 react_default.createElement(CheckIcon, null), 27585 "Mark as complete" 27586 ), isOpen && !isLocked && react_default.createElement( 27587 Button, 27588 { 27589 ariaLabel: !1, 27590 variant: "ghost", 27591 size: "small", 27592 onClick: (e2) => { 27593 e2.stopPropagation(), skip(item.id); 27594 } 27595 }, 27596 "Skip" 27597 ), (isAccepted && !isImmutable || isSkipped) && !isLocked && react_default.createElement( 27598 Button, 27599 { 27600 ariaLabel: "Undo", 27601 variant: "ghost", 27602 padding: "small", 27603 onClick: (e2) => { 27604 e2.stopPropagation(), reset(item.id); 27605 } 27606 }, 27607 react_default.createElement(UndoIcon, null) 27608 )) 27609 ) 27610 }, 27611 itemContent && react_default.createElement(ItemContent2, null, itemContent) 27612 )) 27613 )); 27614 } 27615 )) 27616 ))); 27617 })); 27618}; 27619 27620// src/manager/settings/Checklist/AiSetupBlock.tsx 27621init_react(); 27622var AiCtaCard = styled.div(({ theme }) => ({ 27623 display: "flex", 27624 flexDirection: "column", 27625 padding: "10px 10px 10px 15px", 27626 border: `1px solid ${theme.base === "dark" ? theme.color.darker : theme.color.border}`, 27627 borderRadius: 8, 27628 background: theme.background.content 27629})), AiCtaHeadingRow = styled.div({ 27630 display: "flex", 27631 alignItems: "center", 27632 gap: 10 27633}), AiCtaHeading = styled.h2(({ theme, $skipped }) => ({ 27634 flex: 1, 27635 margin: 0, 27636 color: $skipped ? theme.textMutedColor : theme.color.defaultText, 27637 fontSize: theme.typography.size.s2, 27638 fontWeight: theme.typography.weight.bold, 27639 textWrap: "pretty" 27640})), AiCtaDescription = styled.p(({ theme }) => ({ 27641 margin: 0, 27642 color: theme.color.defaultText, 27643 fontSize: theme.typography.size.s2, 27644 fontWeight: theme.typography.weight.regular, 27645 marginTop: 8 27646})), AiCtaActions = styled.div({ 27647 display: "flex", 27648 gap: 8, 27649 justifyContent: "flex-end", 27650 marginTop: 12 27651}), CopyButton3 = ({ api }) => { 27652 let { children: buttonChildren, buttonProps } = useCopyButton2({ 27653 children: "Copy prompt", 27654 childrenOnCopy: react_default.createElement(react_default.Fragment, null, react_default.createElement(CheckIcon, null), " Copied!"), 27655 content: getAiSetupPrompt(), 27656 onCopy: () => { 27657 api.emit(AI_PROMPT_NUDGE, { id: "setup", origin: "onboarding-guide-page" }); 27658 } 27659 }); 27660 return react_default.createElement(Button, { variant: "solid", size: "medium", ...buttonProps }, buttonChildren); 27661}, AiSetupBlock = ({ 27662 item, 27663 reset, 27664 skip 27665}) => { 27666 let api = useStorybookApi(); 27667 return !item.isDone && !item.isAccepted && !item.isCompleted ? react_default.createElement(AiCtaCard, null, react_default.createElement(AiCtaHeadingRow, null, item.isSkipped && react_default.createElement(StatusIcon3, null, react_default.createElement(Skipped, { visible: !0 }, "Skipped")), react_default.createElement(AiCtaHeading, { $skipped: item.isSkipped }, "Set up Storybook with AI"), item.isSkipped && react_default.createElement(Button, { ariaLabel: "Undo", variant: "ghost", padding: "small", onClick: () => reset(item.id) }, react_default.createElement(UndoIcon, null))), react_default.createElement(Collapsible.Content, { collapsed: item.isSkipped }, react_default.createElement(AiCtaDescription, null, "Run a prompt in your AI agent to analyze your codebase, configure decorators and mocks, write sample stories for your UI components, and verify everything works."), react_default.createElement(AiCtaActions, null, react_default.createElement(Button, { variant: "ghost", size: "medium", ariaLabel: !1, onClick: () => skip(item.id) }, "Skip"), react_default.createElement(CopyButton3, { api })))) : null; 27668}; 27669 27670// src/manager/settings/GuidePage.tsx 27671var Container13 = styled.div(({ theme }) => ({ 27672 display: "flex", 27673 flexDirection: "column", 27674 maxWidth: 600, 27675 margin: "0 auto", 27676 padding: "48px 20px", 27677 gap: 32, 27678 fontSize: theme.typography.size.s2, 27679 "--transition-duration": "0.2s" 27680})), Intro = styled.div(({ theme }) => ({ 27681 display: "flex", 27682 flexDirection: "column", 27683 gap: 8, 27684 "& h1": { 27685 fontSize: theme.typography.size.m3, 27686 fontWeight: theme.typography.weight.bold, 27687 margin: 0 27688 }, 27689 "& > p": { 27690 margin: 0 27691 } 27692})), GuidePage = () => { 27693 let checklist = useChecklist(), aiSetupItem = checklist.availableItems.find((item) => item.id === "aiSetup"); 27694 return react_default.createElement(Container13, null, react_default.createElement(Intro, null, react_default.createElement("h1", null, "Guide"), react_default.createElement("p", null, "Whether you're just getting started or looking for ways to level up, this checklist will help you make the most of your Storybook.")), aiSetupItem && react_default.createElement(AiSetupBlock, { item: aiSetupItem, reset: checklist.reset, skip: checklist.skip }), react_default.createElement(Checklist, { ...checklist, forceCollapsed: aiSetupItem?.isOpen }), scope.FEATURES?.sidebarOnboardingChecklist !== !1 && react_default.createElement(react_default.Fragment, null, checklist.openItems.length === 0 ? react_default.createElement("center", null, "Your work here is done!") : checklist.widget.disable || checklist.openItems.every((item) => item.isMuted) ? react_default.createElement("center", null, "Want to see this in the sidebar?", " ", react_default.createElement(Link, { onClick: () => checklist.disable(!1) }, "Show in sidebar")) : react_default.createElement("center", null, "Don't want to see this in the sidebar?", " ", react_default.createElement(Link, { onClick: () => checklist.mute(checklist.allItems.map(({ id }) => id)) }, "Remove from sidebar")))); 27695}; 27696 27697// src/manager/settings/ShortcutsPage.tsx 27698init_react(); 27699 27700// src/manager/settings/shortcuts.tsx 27701init_react(); 27702 27703// src/manager/settings/SettingsFooter.tsx 27704init_react(); 27705var Footer3 = styled.div(({ theme }) => ({ 27706 display: "flex", 27707 paddingTop: 20, 27708 marginTop: 20, 27709 borderTop: `1px solid ${theme.appBorderColor}`, 27710 fontWeight: theme.typography.weight.bold, 27711 "& > * + *": { 27712 marginLeft: 20 27713 } 27714})), SettingsFooter = (props) => react_default.createElement(Footer3, { ...props }, react_default.createElement(Link, { secondary: !0, href: "https://storybook.js.org?ref=ui", cancel: !1, target: "_blank" }, "Docs"), react_default.createElement(Link, { secondary: !0, href: "https://github.com/storybookjs/storybook", cancel: !1, target: "_blank" }, "GitHub"), react_default.createElement( 27715 Link, 27716 { 27717 secondary: !0, 27718 href: "https://storybook.js.org/community?ref=ui#support", 27719 cancel: !1, 27720 target: "_blank" 27721 }, 27722 "Support" 27723)), SettingsFooter_default = SettingsFooter; 27724 27725// src/manager/settings/shortcuts.tsx 27726var Header2 = styled.header(({ theme }) => ({ 27727 marginBottom: 20, 27728 fontSize: theme.typography.size.m3, 27729 fontWeight: theme.typography.weight.bold, 27730 alignItems: "center", 27731 display: "flex" 27732})), HeaderItem = styled.div(({ theme }) => ({ 27733 fontWeight: theme.typography.weight.bold 27734})), GridHeaderRow = styled.div({ 27735 alignSelf: "flex-end", 27736 display: "grid", 27737 margin: "10px 0", 27738 gridTemplateColumns: "1fr 1fr 12px", 27739 "& > *:last-of-type": { 27740 gridColumn: "2 / 2", 27741 justifySelf: "flex-end", 27742 gridRow: "1" 27743 } 27744}), Row = styled.div(({ theme }) => ({ 27745 padding: "6px 0", 27746 borderTop: `1px solid ${theme.appBorderColor}`, 27747 display: "grid", 27748 gridTemplateColumns: "1fr 1fr 0px" 27749})), GridWrapper = styled.div({ 27750 display: "grid", 27751 gridTemplateColumns: "1fr", 27752 gridAutoRows: "minmax(auto, auto)", 27753 marginBottom: 20 27754}), Description = styled.div({ 27755 alignSelf: "center" 27756}), TextInput = styled(Form.Input)( 27757 ({ valid, theme }) => valid === "error" ? { 27758 animation: `${theme.animation.jiggle} 700ms ease-out` 27759 } : {}, 27760 { 27761 display: "flex", 27762 width: 80, 27763 flexDirection: "column", 27764 justifySelf: "flex-end", 27765 paddingLeft: 4, 27766 paddingRight: 4, 27767 textAlign: "center" 27768 } 27769), Fade = keyframes` 277700%,100% { opacity: 0; } 27771 50% { opacity: 1; } 27772`, SuccessIcon = styled(CheckIcon)( 27773 ({ valid, theme }) => valid === "valid" ? { 27774 color: theme.color.positive, 27775 animation: `${Fade} 2s ease forwards` 27776 } : { 27777 opacity: 0 27778 }, 27779 { 27780 alignSelf: "center", 27781 display: "flex", 27782 marginLeft: 10, 27783 height: 14, 27784 width: 14 27785 } 27786), Container14 = styled.div(({ theme }) => ({ 27787 fontSize: theme.typography.size.s2, 27788 padding: "3rem 20px", 27789 maxWidth: 600, 27790 margin: "0 auto" 27791})), shortcutLabels = { 27792 fullScreen: "Go full screen", 27793 togglePanel: "Toggle addons", 27794 panelPosition: "Toggle addons orientation", 27795 toggleNav: "Toggle sidebar", 27796 toolbar: "Toggle toolbar", 27797 search: "Focus search", 27798 focusNav: "Focus sidebar", 27799 focusIframe: "Focus canvas", 27800 focusPanel: "Focus addons", 27801 prevComponent: "Previous component", 27802 nextComponent: "Next component", 27803 prevStory: "Previous story", 27804 nextStory: "Next story", 27805 shortcutsPage: "Go to shortcuts page", 27806 aboutPage: "Go to about page", 27807 collapseAll: "Collapse all items on sidebar", 27808 expandAll: "Expand all items on sidebar", 27809 remount: "Reload story", 27810 openInEditor: "Open story in editor", 27811 openInIsolation: "Open story in isolation", 27812 copyStoryLink: "Copy story link to clipboard", 27813 goToPreviousLandmark: "Go to previous landmark", 27814 goToNextLandmark: "Go to next landmark" 27815 // TODO: bring this back once we want to add shortcuts for this 27816 // copyStoryName: 'Copy story name to clipboard', 27817}, fixedShortcuts = ["escape"], hardcodedShortcuts = ["goToPreviousLandmark", "goToNextLandmark"]; 27818function toShortcutState(shortcutKeys) { 27819 let state = {}; 27820 for (let key of Object.keys(shortcutKeys).filter((k2) => !fixedShortcuts.includes(k2))) 27821 state[key] = { 27822 shortcut: shortcutKeys[key], 27823 error: !1, 27824 hardcoded: hardcodedShortcuts.includes(key) 27825 }; 27826 return state; 27827} 27828var ShortcutsScreen = class extends Component { 27829 constructor(props) { 27830 super(props); 27831 this.onKeyDown = (e2) => { 27832 let { activeFeature, shortcutKeys } = this.state; 27833 if (e2.key === "Backspace") 27834 return this.restoreDefault(); 27835 let shortcut = eventToShortcut(e2); 27836 if (!shortcut) 27837 return !1; 27838 let normalizedShortcut = shortcut.map( 27839 (key) => Array.isArray(key) ? key.at(-1) : key 27840 ), error = !!Object.entries(shortcutKeys).find( 27841 ([feature, { shortcut: existingShortcut }]) => feature !== activeFeature && existingShortcut && shortcutMatchesShortcut(normalizedShortcut, existingShortcut) 27842 ); 27843 return this.setState({ 27844 shortcutKeys: { ...shortcutKeys, [activeFeature]: { shortcut: normalizedShortcut, error } } 27845 }); 27846 }; 27847 this.onFocus = (focusedInput) => () => { 27848 let { shortcutKeys } = this.state; 27849 this.setState({ 27850 activeFeature: focusedInput, 27851 shortcutKeys: { 27852 ...shortcutKeys, 27853 [focusedInput]: { shortcut: null, error: !1 } 27854 } 27855 }); 27856 }; 27857 this.onBlur = async () => { 27858 let { shortcutKeys, activeFeature } = this.state; 27859 if (shortcutKeys[activeFeature]) { 27860 let { shortcut, error } = shortcutKeys[activeFeature]; 27861 return !shortcut || error ? this.restoreDefault() : this.saveShortcut(); 27862 } 27863 return !1; 27864 }; 27865 this.saveShortcut = async () => { 27866 let { activeFeature, shortcutKeys } = this.state, { setShortcut } = this.props; 27867 await setShortcut(activeFeature, shortcutKeys[activeFeature].shortcut), this.setState({ successField: activeFeature }); 27868 }; 27869 this.restoreDefaults = async () => { 27870 let { restoreAllDefaultShortcuts } = this.props, defaultShortcuts = await restoreAllDefaultShortcuts(); 27871 return this.setState({ shortcutKeys: toShortcutState(defaultShortcuts) }); 27872 }; 27873 this.restoreDefault = async () => { 27874 let { activeFeature, shortcutKeys } = this.state, { restoreDefaultShortcut } = this.props, defaultShortcut = await restoreDefaultShortcut(activeFeature); 27875 return this.setState({ 27876 shortcutKeys: { 27877 ...shortcutKeys, 27878 ...toShortcutState({ [activeFeature]: defaultShortcut }) 27879 } 27880 }); 27881 }; 27882 this.displaySuccessMessage = (activeElement) => { 27883 let { successField, shortcutKeys } = this.state; 27884 return activeElement === successField && shortcutKeys[activeElement].error === !1 ? "valid" : void 0; 27885 }; 27886 this.displayError = (activeElement) => { 27887 let { activeFeature, shortcutKeys } = this.state; 27888 return activeElement === activeFeature && shortcutKeys[activeElement].error === !0 ? "error" : void 0; 27889 }; 27890 this.renderKeyInput = () => { 27891 let { shortcutKeys, addonsShortcutLabels } = this.state; 27892 return Object.entries(shortcutKeys).filter( 27893 ([feature]) => shortcutLabels[feature] !== void 0 || addonsShortcutLabels && addonsShortcutLabels[feature] 27894 ).map( 27895 ([feature, { shortcut, hardcoded }]) => react_default.createElement(Row, { key: feature }, react_default.createElement(Description, null, shortcutLabels[feature] || addonsShortcutLabels[feature]), hardcoded ? react_default.createElement(react_default.Fragment, null, react_default.createElement( 27896 TooltipProvider, 27897 { 27898 tooltip: react_default.createElement(Tooltip, { hasChrome: !0 }, "This shortcut cannot be changed."), 27899 placement: "right" 27900 }, 27901 react_default.createElement( 27902 TextInput, 27903 { 27904 "aria-disabled": !0, 27905 readOnly: !0, 27906 valid: void 0, 27907 value: shortcut ? shortcutToHumanString(shortcut) : "" 27908 } 27909 ) 27910 )) : react_default.createElement( 27911 TextInput, 27912 { 27913 spellCheck: "false", 27914 valid: this.displayError(feature), 27915 className: "modalInput", 27916 onBlur: this.onBlur, 27917 onFocus: this.onFocus(feature), 27918 onKeyDown: this.onKeyDown, 27919 value: shortcut ? shortcutToHumanString(shortcut) : "", 27920 placeholder: "Type keys", 27921 readOnly: !0 27922 } 27923 ), react_default.createElement(SuccessIcon, { valid: this.displaySuccessMessage(feature) })) 27924 ); 27925 }; 27926 this.renderKeyForm = () => react_default.createElement(GridWrapper, null, react_default.createElement(GridHeaderRow, null, react_default.createElement(HeaderItem, null, "Commands"), react_default.createElement(HeaderItem, null, "Shortcut")), this.renderKeyInput()); 27927 this.state = { 27928 // @ts-expect-error (non strict) 27929 activeFeature: void 0, 27930 // @ts-expect-error (non strict) 27931 successField: void 0, 27932 // The initial shortcutKeys that come from props are the defaults/what was saved 27933 // As the user interacts with the page, the state stores the temporary, unsaved shortcuts 27934 // This object also includes the error attached to each shortcut 27935 shortcutKeys: toShortcutState(props.shortcutKeys), 27936 addonsShortcutLabels: props.addonsShortcutLabels 27937 }; 27938 } 27939 render() { 27940 let layout = this.renderKeyForm(); 27941 return react_default.createElement(Container14, null, react_default.createElement(Header2, null, "Keyboard shortcuts"), layout, react_default.createElement( 27942 Button, 27943 { 27944 ariaLabel: !1, 27945 variant: "outline", 27946 size: "small", 27947 id: "restoreDefaultsHotkeys", 27948 onClick: this.restoreDefaults 27949 }, 27950 "Restore defaults" 27951 ), react_default.createElement(SettingsFooter_default, null)); 27952 } 27953}; 27954 27955// src/manager/settings/ShortcutsPage.tsx 27956var ShortcutsPage = () => react_default.createElement(Consumer, null, ({ 27957 api: { 27958 getShortcutKeys, 27959 getAddonsShortcutLabels, 27960 setShortcut, 27961 restoreDefaultShortcut, 27962 restoreAllDefaultShortcuts 27963 } 27964}) => react_default.createElement( 27965 ShortcutsScreen, 27966 { 27967 shortcutKeys: getShortcutKeys(), 27968 addonsShortcutLabels: getAddonsShortcutLabels(), 27969 setShortcut, 27970 restoreDefaultShortcut, 27971 restoreAllDefaultShortcuts 27972 } 27973)); 27974 27975// src/manager/settings/whats_new_page.tsx 27976init_react(); 27977 27978// src/manager/settings/whats_new.tsx 27979init_react(); 27980var Centered = styled.div({ 27981 top: "50%", 27982 position: "absolute", 27983 transform: "translateY(-50%)", 27984 width: "100%", 27985 textAlign: "center" 27986}), LoaderWrapper2 = styled.div({ 27987 position: "relative", 27988 height: "32px" 27989}), Message3 = styled.div(({ theme }) => ({ 27990 paddingTop: "12px", 27991 color: theme.textMutedColor, 27992 maxWidth: "295px", 27993 margin: "0 auto", 27994 fontSize: `${theme.typography.size.s1}px`, 27995 lineHeight: "16px" 27996})), Container15 = styled.div(({ theme }) => ({ 27997 position: "absolute", 27998 width: "100%", 27999 height: 40, 28000 bottom: 0, 28001 background: theme.background.bar, 28002 fontSize: theme.typography.size.s2, 28003 borderTop: `1px solid ${theme.color.border}`, 28004 padding: "0 10px 0 15px", 28005 display: "flex", 28006 alignItems: "center", 28007 justifyContent: "space-between" 28008})), WhatsNewFooter = ({ 28009 isNotificationsEnabled, 28010 onToggleNotifications, 28011 copyContent 28012}) => { 28013 let theme = useTheme(), { children: copyText, buttonProps: copyButtonProps } = useCopyButton2({ 28014 children: "Copy Link", 28015 content: copyContent 28016 }); 28017 return react_default.createElement(Container15, null, react_default.createElement("div", { style: { display: "flex", alignItems: "center", gap: 10 } }, react_default.createElement(HeartIcon, { color: theme.color.mediumdark }), react_default.createElement("div", null, "Share this with your team."), react_default.createElement(Button, { size: "small", variant: "ghost", ...copyButtonProps }, copyText)), isNotificationsEnabled ? react_default.createElement(Button, { ariaLabel: !1, size: "small", variant: "ghost", onClick: onToggleNotifications }, react_default.createElement(EyeCloseIcon, null), "Hide notifications") : react_default.createElement(Button, { ariaLabel: !1, size: "small", variant: "ghost", onClick: onToggleNotifications }, react_default.createElement(EyeIcon, null), "Show notifications")); 28018}, Iframe = styled.iframe( 28019 { 28020 position: "absolute", 28021 top: 0, 28022 left: 0, 28023 right: 0, 28024 bottom: 0, 28025 border: 0, 28026 margin: 0, 28027 padding: 0, 28028 width: "100%", 28029 height: "calc(100% - 40px)", 28030 background: "white" 28031 }, 28032 ({ isLoaded }) => ({ visibility: isLoaded ? "visible" : "hidden" }) 28033), AlertIcon2 = styled(((props) => react_default.createElement(AlertIcon, { ...props })))(({ theme }) => ({ 28034 color: theme.textMutedColor, 28035 width: 32, 28036 height: 32, 28037 margin: "0 auto" 28038})), WhatsNewLoader = () => react_default.createElement(Centered, null, react_default.createElement(LoaderWrapper2, null, react_default.createElement(Loader, null)), react_default.createElement(Message3, null, "Loading...")), MaxWaitTimeMessaging = () => react_default.createElement(Centered, null, react_default.createElement(AlertIcon2, null), react_default.createElement(Message3, null, "The page couldn't be loaded. Check your internet connection and try again.")), PureWhatsNewScreen = ({ 28039 didHitMaxWaitTime, 28040 isLoaded, 28041 onLoad, 28042 url, 28043 copyContent, 28044 onToggleNotifications, 28045 isNotificationsEnabled 28046}) => react_default.createElement(Fragment, null, !isLoaded && !didHitMaxWaitTime && react_default.createElement(WhatsNewLoader, null), didHitMaxWaitTime ? react_default.createElement(MaxWaitTimeMessaging, null) : react_default.createElement(react_default.Fragment, null, react_default.createElement(Iframe, { isLoaded, onLoad, src: url, title: "What's new?" }), react_default.createElement( 28047 WhatsNewFooter, 28048 { 28049 isNotificationsEnabled, 28050 onToggleNotifications, 28051 copyContent 28052 } 28053))), MAX_WAIT_TIME = 1e4, WhatsNewScreen = () => { 28054 let api = useStorybookApi(), state = useStorybookState(), { whatsNewData } = state, [isLoaded, setLoaded] = useState(!1), [didHitMaxWaitTime, setDidHitMaxWaitTime] = useState(!1); 28055 if (useEffect(() => { 28056 let timer = setTimeout(() => !isLoaded && setDidHitMaxWaitTime(!0), MAX_WAIT_TIME); 28057 return () => clearTimeout(timer); 28058 }, [isLoaded]), whatsNewData?.status !== "SUCCESS") 28059 return null; 28060 let isNotificationsEnabled = !whatsNewData.disableWhatsNewNotifications; 28061 return react_default.createElement( 28062 PureWhatsNewScreen, 28063 { 28064 didHitMaxWaitTime, 28065 isLoaded, 28066 onLoad: () => { 28067 api.whatsNewHasBeenRead(), setLoaded(!0); 28068 }, 28069 url: whatsNewData.url, 28070 isNotificationsEnabled, 28071 copyContent: whatsNewData.blogUrl ?? whatsNewData.url, 28072 onToggleNotifications: () => { 28073 isNotificationsEnabled ? scope.confirm("All update notifications will no longer be shown. Are you sure?") && api.toggleWhatsNewNotifications() : api.toggleWhatsNewNotifications(); 28074 } 28075 } 28076 ); 28077}; 28078 28079// src/manager/settings/whats_new_page.tsx 28080var WhatsNewPage = () => react_default.createElement(WhatsNewScreen, null); 28081 28082// src/manager/settings/index.tsx 28083var { document: document9 } = scope, Content5 = styled(ScrollArea)(({ theme }) => ({ 28084 background: theme.background.content 28085})), SidebarToggle = styled.div({ 28086 // Extra specificity is necessary here 28087 "&&:has(*)": { 28088 order: 0, 28089 display: "flex", 28090 alignItems: "center", 28091 marginLeft: 10, 28092 marginRight: 6, 28093 gap: 6 28094 } 28095}), RouteWrapper = ({ children, path }) => react_default.createElement(Content5, { vertical: !0, horizontal: !1 }, react_default.createElement(Route, { path }, children)), Pages = ({ changeTab, onClose, enableShortcuts = !0, enableWhatsNew }) => { 28096 react_default.useEffect(() => { 28097 let handleEscape = (event) => { 28098 !enableShortcuts || event.repeat || matchesModifiers(!1, event) && matchesKeyCode("Escape", event) && (event.preventDefault(), onClose()); 28099 }; 28100 return document9.addEventListener("keydown", handleEscape), () => document9.removeEventListener("keydown", handleEscape); 28101 }, [enableShortcuts, onClose]); 28102 let api = useStorybookApi(), toolsExtra = Object.values(api.getElements(Addon_TypesEnum.TOOLEXTRA)), tabs = useMemo(() => { 28103 let tabsToInclude = [ 28104 { 28105 id: "about", 28106 title: "About", 28107 children: react_default.createElement(RouteWrapper, { path: "about" }, react_default.createElement(AboutPage, { key: "about" })) 28108 } 28109 ]; 28110 return scope.CONFIG_TYPE === "DEVELOPMENT" && scope.FEATURES?.menuOnboardingChecklist !== !1 && tabsToInclude.push({ 28111 id: "guide", 28112 title: "Guide", 28113 children: react_default.createElement(RouteWrapper, { path: "guide" }, react_default.createElement(GuidePage, { key: "guide" })) 28114 }), tabsToInclude.push({ 28115 id: "shortcuts", 28116 title: "Keyboard shortcuts", 28117 children: react_default.createElement(RouteWrapper, { path: "shortcuts" }, react_default.createElement(ShortcutsPage, { key: "shortcuts" })) 28118 }), enableWhatsNew && tabsToInclude.push({ 28119 id: "whats-new", 28120 title: "What's new?", 28121 children: react_default.createElement(RouteWrapper, { path: "whats-new" }, react_default.createElement(WhatsNewPage, { key: "whats-new" })) 28122 }), tabsToInclude; 28123 }, [enableWhatsNew]); 28124 return react_default.createElement(Location, null, ({ path }) => { 28125 let selected = tabs.find((tab) => path.includes(`settings/${tab.id}`))?.id; 28126 return react_default.createElement( 28127 TabsView, 28128 { 28129 tabs, 28130 tools: react_default.createElement(react_default.Fragment, null, react_default.createElement(SidebarToggle, null, menuTool.render({})), toolsExtra.map((item) => react_default.createElement(react_default.Fragment, { key: item.id }, item.render({}))), react_default.createElement( 28131 Button, 28132 { 28133 padding: "small", 28134 variant: "ghost", 28135 onClick: (e2) => (e2.preventDefault(), onClose()), 28136 ariaLabel: "Close settings page" 28137 }, 28138 react_default.createElement(CloseIcon, null) 28139 )), 28140 selected, 28141 onSelectionChange: changeTab 28142 } 28143 ); 28144 }); 28145}, SettingsPages = () => { 28146 let api = useStorybookApi(), state = useStorybookState(), changeTab = (tab) => api.changeSettingsTab(tab); 28147 return react_default.createElement( 28148 Pages, 28149 { 28150 enableWhatsNew: state.whatsNewData?.status === "SUCCESS", 28151 enableShortcuts: state.ui.enableShortcuts, 28152 changeTab, 28153 onClose: api.closeSettings 28154 } 28155 ); 28156}, settingsPageAddon = { 28157 id: "settings", 28158 url: "/settings/", 28159 title: "Settings", 28160 type: types.experimental_PAGE, 28161 render: () => react_default.createElement(Route, { path: "/settings/", startsWith: !0 }, react_default.createElement(SettingsPages, null)) 28162}; 28163 28164// src/manager/index.tsx 28165ThemeProvider.displayName = "ThemeProvider"; 28166q.displayName = "HelmetProvider"; 28167var Root5 = ({ provider }) => react_default.createElement(q, { key: "helmet.Provider" }, react_default.createElement(LocationProvider, { key: "location.provider" }, react_default.createElement(Main3, { provider }))), Main3 = ({ provider }) => { 28168 let navigate = useNavigate(); 28169 return react_default.createElement(Location, { key: "location.consumer" }, (locationData) => react_default.createElement( 28170 Provider, 28171 { 28172 key: "manager", 28173 provider, 28174 ...locationData, 28175 navigate, 28176 docsOptions: scope?.DOCS_OPTIONS || {} 28177 }, 28178 (combo) => { 28179 let { state, api } = combo, setManagerLayoutState = useCallback( 28180 (sizes) => { 28181 api.setSizes(sizes); 28182 }, 28183 [api] 28184 ), pages = useMemo( 28185 () => [settingsPageAddon, ...Object.values(api.getElements(types.experimental_PAGE))], 28186 [Object.keys(api.getElements(types.experimental_PAGE)).join()] 28187 ); 28188 return react_default.createElement(ThemeProvider, { key: "theme.provider", theme: ensure(state.theme) }, react_default.createElement(LayoutProvider, null, react_default.createElement( 28189 App, 28190 { 28191 key: "app", 28192 pages, 28193 managerLayoutState: { 28194 ...state.layout, 28195 viewMode: state.viewMode 28196 }, 28197 hasTab: !!api.getQueryParam("tab"), 28198 setManagerLayoutState 28199 } 28200 ))); 28201 } 28202 )); 28203}; 28204function renderStorybookUI(domNode, provider) { 28205 if (!(provider instanceof Provider2)) 28206 throw new ProviderDoesNotExtendBaseProviderError(); 28207 createRoot(domNode).render(react_default.createElement(Root5, { key: "root", provider })); 28208} 28209 28210// src/manager/runtime.tsx 28211var WS_DISCONNECTED_NOTIFICATION_ID = "CORE/WS_DISCONNECTED"; 28212addons.register( 28213 TOOLBAR_ID, 28214 () => addons.add(TOOLBAR_ID, { 28215 title: TOOLBAR_ID, 28216 type: types.TOOL, 28217 match: ({ tabId }) => !tabId, 28218 render: () => react_default.createElement(ToolbarManager, null) 28219 }) 28220); 28221var channel = createBrowserChannel({ page: "manager" }); 28222addons.setChannel(channel); 28223channel.emit(CHANNEL_CREATED); 28224var ReactProvider = class extends Provider2 { 28225 constructor() { 28226 super(...arguments); 28227 this.addons = addons; 28228 this.channel = channel; 28229 this.wsDisconnected = !1; 28230 } 28231 getElements(type) { 28232 return this.addons.getElements(type); 28233 } 28234 getConfig() { 28235 return this.addons.getConfig(); 28236 } 28237 handleAPI(api) { 28238 this.addons.loadAddons(api), this.channel.on(CHANNEL_WS_DISCONNECT, (ev) => { 28239 this.wsDisconnected = !0, api.addNotification({ 28240 id: WS_DISCONNECTED_NOTIFICATION_ID, 28241 content: { 28242 headline: ev.code === 3008 ? "Server timed out" : "Connection lost", 28243 subHeadline: "Please restart your Storybook server and reload the page" 28244 }, 28245 icon: react_default.createElement(FailedIcon, { color: color.negative }), 28246 link: void 0 28247 }); 28248 }); 28249 } 28250}, { document: document10 } = scope, rootEl = document10.getElementById("root"); 28251setTimeout(() => { 28252 renderStorybookUI(rootEl, new ReactProvider()); 28253}, 0);
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.