vendor: 4,561 bytes, lines 1-110
1var __defProp = Object.defineProperty; 2var __defProps = Object.defineProperties; 3var __getOwnPropDescs = Object.getOwnPropertyDescriptors; 4var __getOwnPropNames = Object.getOwnPropertyNames; 5var __getOwnPropSymbols = Object.getOwnPropertySymbols; 6var __hasOwnProp = Object.prototype.hasOwnProperty; 7var __propIsEnum = Object.prototype.propertyIsEnumerable; 8var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name); 9var __typeError = (msg) => { 10 throw TypeError(msg); 11}; 12var __pow = Math.pow; 13var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 14var __spreadValues = (a, b) => { 15 for (var prop in b || (b = {})) 16 if (__hasOwnProp.call(b, prop)) 17 __defNormalProp(a, prop, b[prop]); 18 if (__getOwnPropSymbols) 19 for (var prop of __getOwnPropSymbols(b)) { 20 if (__propIsEnum.call(b, prop)) 21 __defNormalProp(a, prop, b[prop]); 22 } 23 return a; 24}; 25var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); 26var __restKey = (key) => typeof key === "symbol" ? key : key + ""; 27var __objRest = (source, exclude) => { 28 var target = {}; 29 for (var prop in source) 30 if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) 31 target[prop] = source[prop]; 32 if (source != null && __getOwnPropSymbols) 33 for (var prop of __getOwnPropSymbols(source)) { 34 if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) 35 target[prop] = source[prop]; 36 } 37 return target; 38}; 39var __commonJS = (cb, mod) => function __require() { 40 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 41}; 42var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); 43var __async = (__this, __arguments, generator) => { 44 return new Promise((resolve, reject) => { 45 var fulfilled = (value) => { 46 try { 47 step(generator.next(value)); 48 } catch (e) { 49 reject(e); 50 } 51 }; 52 var rejected = (value) => { 53 try { 54 step(generator.throw(value)); 55 } catch (e) { 56 reject(e); 57 } 58 }; 59 var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); 60 step((generator = generator.apply(__this, __arguments)).next()); 61 }); 62}; 63var __await = function(promise, isYieldStar) { 64 this[0] = promise; 65 this[1] = isYieldStar; 66}; 67var __asyncGenerator = (__this, __arguments, generator) => { 68 var resume = (k, v, yes, no) => { 69 try { 70 var x = generator[k](v), isAwait = (v = x.value) instanceof __await, done = x.done; 71 Promise.resolve(isAwait ? v[0] : v).then((y) => isAwait ? resume(k === "return" ? k : "next", v[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e) => resume("throw", e, yes, no)); 72 } catch (e) { 73 no(e); 74 } 75 }, method = (k) => it[k] = (x) => new Promise((yes, no) => resume(k, x, yes, no)), it = {}; 76 return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it; 77}; 78var __yieldStar = (value) => { 79 var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {}; 80 if (obj == null) { 81 obj = value[__knownSymbol("iterator")](); 82 method = (k) => it[k] = (x) => obj[k](x); 83 } else { 84 obj = obj.call(value); 85 method = (k) => it[k] = (v) => { 86 if (isAwait) { 87 isAwait = false; 88 if (k === "throw") throw v; 89 return v; 90 } 91 isAwait = true; 92 return { 93 done: false, 94 value: new __await(new Promise((resolve) => { 95 var x = obj[k](v); 96 if (!(x instanceof Object)) __typeError("Object expected"); 97 resolve(x); 98 }), 1) 99 }; 100 }; 101 } 102 return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => { 103 throw x; 104 }, "return" in obj && method("return"), it; 105}; 106var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it); 107var require_index_001 = __commonJS({ 108 "assets/index-DIe8mhyr.js"(exports, module) { 109 ; 110 {
111 try { 112 let e2 = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n2 = new e2.Error().stack; 113 n2 && (e2._sentryDebugIds = e2._sentryDebugIds || {}, e2._sentryDebugIds[n2] = "1194f582-8209-4e1f-a426-3bef5e345d94", e2._sentryDebugIdIdentifier = "sentry-dbid-1194f582-8209-4e1f-a426-3bef5e345d94"); 114 } catch (e2) { 115 } 116 } 117 ; 118 function _mergeNamespaces(n2, m2) { 119 for (var i2 = 0; i2 < m2.length; i2++) { 120 const e2 = m2[i2]; 121 if (typeof e2 !== "string" && !Array.isArray(e2)) { 122 for (const k2 in e2) { 123 if (k2 !== "default" && !(k2 in n2)) { 124 const d2 = Object.getOwnPropertyDescriptor(e2, k2); 125 if (d2) { 126 Object.defineProperty(n2, k2, d2.get ? d2 : { 127 enumerable: true, 128 get: () => e2[k2] 129 }); 130 } 131 } 132 } 133 } 134 } 135 return Object.freeze(Object.defineProperty(n2, Symbol.toStringTag, { value: "Module" })); 136 } 137 (function polyfill() { 138 const relList = document.createElement("link").relList; 139 if (relList && relList.supports && relList.supports("modulepreload")) return; 140 for (const link of document.querySelectorAll('link[rel="modulepreload"]')) processPreload(link); 141 new MutationObserver((mutations) => { 142 for (const mutation of mutations) { 143 if (mutation.type !== "childList") continue; 144 for (const node2 of mutation.addedNodes) if (node2.tagName === "LINK" && node2.rel === "modulepreload") processPreload(node2); 145 } 146 }).observe(document, { 147 childList: true, 148 subtree: true 149 }); 150 function getFetchOpts(link) { 151 const fetchOpts = {}; 152 if (link.integrity) fetchOpts.integrity = link.integrity; 153 if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy; 154 if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include"; 155 else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; 156 else fetchOpts.credentials = "same-origin"; 157 return fetchOpts; 158 } 159 function processPreload(link) { 160 if (link.ep) return; 161 link.ep = true; 162 const fetchOpts = getFetchOpts(link); 163 fetch(link.href, fetchOpts); 164 } 165 })(); 166 if (typeof globalThis.__fw_env__ === "string") { 167 globalThis.__fw_env__ = { 168 FW_ENV: void 0, 169 FW_BASE_URL: void 0, 170 FW_BASE_API_URL: void 0, 171 FW_MEMBERSHIPS_API_URL: void 0, 172 FW_AUTH_URL: void 0, 173 FW_SHOP_RENDERER_API_URL: void 0, 174 FW_OMNI_URL: void 0 175 }; 176 } 177 function getDefaultExportFromCjs(x2) { 178 return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; 179 } 180 function getAugmentedNamespace(n2) { 181 if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2; 182 var f2 = n2.default; 183 if (typeof f2 == "function") { 184 var a2 = function a3() { 185 var isInstance = false; 186 try { 187 isInstance = this instanceof a3; 188 } catch (e2) { 189 } 190 if (isInstance) { 191 return Reflect.construct(f2, arguments, this.constructor); 192 } 193 return f2.apply(this, arguments); 194 }; 195 a2.prototype = f2.prototype; 196 } else a2 = {}; 197 Object.defineProperty(a2, "__esModule", { value: true }); 198 Object.keys(n2).forEach(function(k2) { 199 var d2 = Object.getOwnPropertyDescriptor(n2, k2); 200 Object.defineProperty(a2, k2, d2.get ? d2 : { 201 enumerable: true, 202 get: function() { 203 return n2[k2]; 204 } 205 }); 206 }); 207 return a2; 208 } 209 var jsxRuntime = { exports: {} }; 210 var reactJsxRuntime_production_min = {}; 211 var react = { exports: {} }; 212 var react_production_min = {}; 213 /** 214 * @license React 215 * react.production.min.js 216 * 217 * Copyright (c) Facebook, Inc. and its affiliates. 218 * 219 * This source code is licensed under the MIT license found in the 220 * LICENSE file in the root directory of this source tree. 221 */ 222 var hasRequiredReact_production_min; 223 function requireReact_production_min() { 224 if (hasRequiredReact_production_min) return react_production_min; 225 hasRequiredReact_production_min = 1; 226 var l2 = Symbol.for("react.element"), n2 = Symbol.for("react.portal"), p2 =
vendor: 11,706 bytes, lines 226-498
226Symbol.for("react.fragment"), q2 = Symbol.for("react.strict_mode"), r2 = Symbol.for("react.profiler"), t2 = Symbol.for("react.provider"), u2 = Symbol.for("react.context"), v2 = Symbol.for("react.forward_ref"), w2 = Symbol.for("react.suspense"), x2 = Symbol.for("react.memo"), y2 = Symbol.for("react.lazy"), z2 = Symbol.iterator; 227 function A2(a2) { 228 if (null === a2 || "object" !== typeof a2) return null; 229 a2 = z2 && a2[z2] || a2["@@iterator"]; 230 return "function" === typeof a2 ? a2 : null; 231 } 232 var B2 = { isMounted: function() { 233 return false; 234 }, enqueueForceUpdate: function() { 235 }, enqueueReplaceState: function() { 236 }, enqueueSetState: function() { 237 } }, C2 = Object.assign, D2 = {}; 238 function E2(a2, b2, e2) { 239 this.props = a2; 240 this.context = b2; 241 this.refs = D2; 242 this.updater = e2 || B2; 243 } 244 E2.prototype.isReactComponent = {}; 245 E2.prototype.setState = function(a2, b2) { 246 if ("object" !== typeof a2 && "function" !== typeof a2 && null != a2) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); 247 this.updater.enqueueSetState(this, a2, b2, "setState"); 248 }; 249 E2.prototype.forceUpdate = function(a2) { 250 this.updater.enqueueForceUpdate(this, a2, "forceUpdate"); 251 }; 252 function F2() { 253 } 254 F2.prototype = E2.prototype; 255 function G2(a2, b2, e2) { 256 this.props = a2; 257 this.context = b2; 258 this.refs = D2; 259 this.updater = e2 || B2; 260 } 261 var H2 = G2.prototype = new F2(); 262 H2.constructor = G2; 263 C2(H2, E2.prototype); 264 H2.isPureReactComponent = true; 265 var I2 = Array.isArray, J2 = Object.prototype.hasOwnProperty, K2 = { current: null }, L2 = { key: true, ref: true, __self: true, __source: true }; 266 function M2(a2, b2, e2) { 267 var d2, c2 = {}, k2 = null, h2 = null; 268 if (null != b2) for (d2 in void 0 !== b2.ref && (h2 = b2.ref), void 0 !== b2.key && (k2 = "" + b2.key), b2) J2.call(b2, d2) && !L2.hasOwnProperty(d2) && (c2[d2] = b2[d2]); 269 var g2 = arguments.length - 2; 270 if (1 === g2) c2.children = e2; 271 else if (1 < g2) { 272 for (var f2 = Array(g2), m2 = 0; m2 < g2; m2++) f2[m2] = arguments[m2 + 2]; 273 c2.children = f2; 274 } 275 if (a2 && a2.defaultProps) for (d2 in g2 = a2.defaultProps, g2) void 0 === c2[d2] && (c2[d2] = g2[d2]); 276 return { $$typeof: l2, type: a2, key: k2, ref: h2, props: c2, _owner: K2.current }; 277 } 278 function N2(a2, b2) { 279 return { $$typeof: l2, type: a2.type, key: b2, ref: a2.ref, props: a2.props, _owner: a2._owner }; 280 } 281 function O2(a2) { 282 return "object" === typeof a2 && null !== a2 && a2.$$typeof === l2; 283 } 284 function escape2(a2) { 285 var b2 = { "=": "=0", ":": "=2" }; 286 return "$" + a2.replace(/[=:]/g, function(a3) { 287 return b2[a3]; 288 }); 289 } 290 var P2 = /\/+/g; 291 function Q2(a2, b2) { 292 return "object" === typeof a2 && null !== a2 && null != a2.key ? escape2("" + a2.key) : b2.toString(36); 293 } 294 function R2(a2, b2, e2, d2, c2) { 295 var k2 = typeof a2; 296 if ("undefined" === k2 || "boolean" === k2) a2 = null; 297 var h2 = false; 298 if (null === a2) h2 = true; 299 else switch (k2) { 300 case "string": 301 case "number": 302 h2 = true; 303 break; 304 case "object": 305 switch (a2.$$typeof) { 306 case l2: 307 case n2: 308 h2 = true; 309 } 310 } 311 if (h2) return h2 = a2, c2 = c2(h2), a2 = "" === d2 ? "." + Q2(h2, 0) : d2, I2(c2) ? (e2 = "", null != a2 && (e2 = a2.replace(P2, "$&/") + "/"), R2(c2, b2, e2, "", function(a3) { 312 return a3; 313 })) : null != c2 && (O2(c2) && (c2 = N2(c2, e2 + (!c2.key || h2 && h2.key === c2.key ? "" : ("" + c2.key).replace(P2, "$&/") + "/") + a2)), b2.push(c2)), 1; 314 h2 = 0; 315 d2 = "" === d2 ? "." : d2 + ":"; 316 if (I2(a2)) for (var g2 = 0; g2 < a2.length; g2++) { 317 k2 = a2[g2]; 318 var f2 = d2 + Q2(k2, g2); 319 h2 += R2(k2, b2, e2, f2, c2); 320 } 321 else if (f2 = A2(a2), "function" === typeof f2) for (a2 = f2.call(a2), g2 = 0; !(k2 = a2.next()).done; ) k2 = k2.value, f2 = d2 + Q2(k2, g2++), h2 += R2(k2, b2, e2, f2, c2); 322 else if ("object" === k2) throw b2 = String(a2), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b2 ? "object with keys {" + Object.keys(a2).join(", ") + "}" : b2) + "). If you meant to render a collection of children, use an array instead."); 323 return h2; 324 } 325 function S2(a2, b2, e2) { 326 if (null == a2) return a2; 327 var d2 = [], c2 = 0; 328 R2(a2, d2, "", "", function(a3) { 329 return b2.call(e2, a3, c2++); 330 }); 331 return d2; 332 } 333 function T2(a2) { 334 if (-1 === a2._status) { 335 var b2 = a2._result; 336 b2 = b2(); 337 b2.then(function(b3) { 338 if (0 === a2._status || -1 === a2._status) a2._status = 1, a2._result = b3; 339 }, function(b3) { 340 if (0 === a2._status || -1 === a2._status) a2._status = 2, a2._result = b3; 341 }); 342 -1 === a2._status && (a2._status = 0, a2._result = b2); 343 } 344 if (1 === a2._status) return a2._result.default; 345 throw a2._result; 346 } 347 var U2 = { current: null }, V2 = { transition: null }, W2 = { ReactCurrentDispatcher: U2, ReactCurrentBatchConfig: V2, ReactCurrentOwner: K2 }; 348 function X2() { 349 throw Error("act(...) is not supported in production builds of React."); 350 } 351 react_production_min.Children = { map: S2, forEach: function(a2, b2, e2) { 352 S2(a2, function() { 353 b2.apply(this, arguments); 354 }, e2); 355 }, count: function(a2) { 356 var b2 = 0; 357 S2(a2, function() { 358 b2++; 359 }); 360 return b2; 361 }, toArray: function(a2) { 362 return S2(a2, function(a3) { 363 return a3; 364 }) || []; 365 }, only: function(a2) { 366 if (!O2(a2)) throw Error("React.Children.only expected to receive a single React element child."); 367 return a2; 368 } }; 369 react_production_min.Component = E2; 370 react_production_min.Fragment = p2; 371 react_production_min.Profiler = r2; 372 react_production_min.PureComponent = G2; 373 react_production_min.StrictMode = q2; 374 react_production_min.Suspense = w2; 375 react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W2; 376 react_production_min.act = X2; 377 react_production_min.cloneElement = function(a2, b2, e2) { 378 if (null === a2 || void 0 === a2) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a2 + "."); 379 var d2 = C2({}, a2.props), c2 = a2.key, k2 = a2.ref, h2 = a2._owner; 380 if (null != b2) { 381 void 0 !== b2.ref && (k2 = b2.ref, h2 = K2.current); 382 void 0 !== b2.key && (c2 = "" + b2.key); 383 if (a2.type && a2.type.defaultProps) var g2 = a2.type.defaultProps; 384 for (f2 in b2) J2.call(b2, f2) && !L2.hasOwnProperty(f2) && (d2[f2] = void 0 === b2[f2] && void 0 !== g2 ? g2[f2] : b2[f2]); 385 } 386 var f2 = arguments.length - 2; 387 if (1 === f2) d2.children = e2; 388 else if (1 < f2) { 389 g2 = Array(f2); 390 for (var m2 = 0; m2 < f2; m2++) g2[m2] = arguments[m2 + 2]; 391 d2.children = g2; 392 } 393 return { $$typeof: l2, type: a2.type, key: c2, ref: k2, props: d2, _owner: h2 }; 394 }; 395 react_production_min.createContext = function(a2) { 396 a2 = { $$typeof: u2, _currentValue: a2, _currentValue2: a2, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }; 397 a2.Provider = { $$typeof: t2, _context: a2 }; 398 return a2.Consumer = a2; 399 }; 400 react_production_min.createElement = M2; 401 react_production_min.createFactory = function(a2) { 402 var b2 = M2.bind(null, a2); 403 b2.type = a2; 404 return b2; 405 }; 406 react_production_min.createRef = function() { 407 return { current: null }; 408 }; 409 react_production_min.forwardRef = function(a2) { 410 return { $$typeof: v2, render: a2 }; 411 }; 412 react_production_min.isValidElement = O2; 413 react_production_min.lazy = function(a2) { 414 return { $$typeof: y2, _payload: { _status: -1, _result: a2 }, _init: T2 }; 415 }; 416 react_production_min.memo = function(a2, b2) { 417 return { $$typeof: x2, type: a2, compare: void 0 === b2 ? null : b2 }; 418 }; 419 react_production_min.startTransition = function(a2) { 420 var b2 = V2.transition; 421 V2.transition = {}; 422 try { 423 a2(); 424 } finally { 425 V2.transition = b2; 426 } 427 }; 428 react_production_min.unstable_act = X2; 429 react_production_min.useCallback = function(a2, b2) { 430 return U2.current.useCallback(a2, b2); 431 }; 432 react_production_min.useContext = function(a2) { 433 return U2.current.useContext(a2); 434 }; 435 react_production_min.useDebugValue = function() { 436 }; 437 react_production_min.useDeferredValue = function(a2) { 438 return U2.current.useDeferredValue(a2); 439 }; 440 react_production_min.useEffect = function(a2, b2) { 441 return U2.current.useEffect(a2, b2); 442 }; 443 react_production_min.useId = function() { 444 return U2.current.useId(); 445 }; 446 react_production_min.useImperativeHandle = function(a2, b2, e2) { 447 return U2.current.useImperativeHandle(a2, b2, e2); 448 }; 449 react_production_min.useInsertionEffect = function(a2, b2) { 450 return U2.current.useInsertionEffect(a2, b2); 451 }; 452 react_production_min.useLayoutEffect = function(a2, b2) { 453 return U2.current.useLayoutEffect(a2, b2); 454 }; 455 react_production_min.useMemo = function(a2, b2) { 456 return U2.current.useMemo(a2, b2); 457 }; 458 react_production_min.useReducer = function(a2, b2, e2) { 459 return U2.current.useReducer(a2, b2, e2); 460 }; 461 react_production_min.useRef = function(a2) { 462 return U2.current.useRef(a2); 463 }; 464 react_production_min.useState = function(a2) { 465 return U2.current.useState(a2); 466 }; 467 react_production_min.useSyncExternalStore = function(a2, b2, e2) { 468 return U2.current.useSyncExternalStore(a2, b2, e2); 469 }; 470 react_production_min.useTransition = function() { 471 return U2.current.useTransition(); 472 }; 473 react_production_min.version = "18.3.1"; 474 return react_production_min; 475 } 476 var hasRequiredReact; 477 function requireReact() { 478 if (hasRequiredReact) return react.exports; 479 hasRequiredReact = 1; 480 { 481 react.exports = requireReact_production_min(); 482 } 483 return react.exports; 484 } 485 /** 486 * @license React 487 * react-jsx-runtime.production.min.js 488 * 489 * Copyright (c) Facebook, Inc. and its affiliates. 490 * 491 * This source code is licensed under the MIT license found in the 492 * LICENSE file in the root directory of this source tree. 493 */ 494 var hasRequiredReactJsxRuntime_production_min; 495 function requireReactJsxRuntime_production_min() { 496 if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min; 497 hasRequiredReactJsxRuntime_production_min = 1; 498 var f2 = requireReact(), k2 = Symbol.for("react.element"), l2 = Symbol.for("react.fragment"), m2 = Object.prototype.hasOwnProperty, n2 = f2.__SECRET_INT
498ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p2 = { key: true, ref: true, __self: true, __source: true }; 499 function q2(c2, a2, g2) { 500 var b2, d2 = {}, e2 = null, h2 = null; 501 void 0 !== g2 && (e2 = "" + g2); 502 void 0 !== a2.key && (e2 = "" + a2.key); 503 void 0 !== a2.ref && (h2 = a2.ref); 504 for (b2 in a2) m2.call(a2, b2) && !p2.hasOwnProperty(b2) && (d2[b2] = a2[b2]); 505 if (c2 && c2.defaultProps) for (b2 in a2 = c2.defaultProps, a2) void 0 === d2[b2] && (d2[b2] = a2[b2]); 506 return { $$typeof: k2, type: c2, key: e2, ref: h2, props: d2, _owner: n2.current }; 507 } 508 reactJsxRuntime_production_min.Fragment = l2; 509 reactJsxRuntime_production_min.jsx = q2; 510 reactJsxRuntime_production_min.jsxs = q2; 511 return reactJsxRuntime_production_min; 512 } 513 var hasRequiredJsxRuntime; 514 function requireJsxRuntime() { 515 if (hasRequiredJsxRuntime) return jsxRuntime.exports; 516 hasRequiredJsxRuntime = 1; 517 { 518 jsxRuntime.exports = requireReactJsxRuntime_production_min(); 519 } 520 return jsxRuntime.exports; 521 } 522 var jsxRuntimeExports = requireJsxRuntime(); 523 const isString$4 = (obj) => typeof obj === "string"; 524 const defer = () => { 525 let res; 526 let rej; 527 const promise = new Promise((resolve, reject) => { 528 res = resolve; 529 rej = reject; 530 }); 531 promise.resolve = res; 532 promise.reject = rej; 533 return promise; 534 }; 535 const makeString = (object2) => { 536 if (object2 == null) return ""; 537 return "" + object2; 538 }; 539 const copy$1 = (a2, s2, t2) => { 540 a2.forEach((m2) => { 541 if (s2[m2]) t2[m2] = s2[m2]; 542 }); 543 }; 544 const lastOfPathSeparatorRegExp = /###/g; 545 const cleanKey = (key) => key && key.indexOf("###") > -1 ? key.replace(lastOfPathSeparatorRegExp, ".") : key; 546 const canNotTraverseDeeper = (object2) => !object2 || isString$4(object2); 547 const getLastOfPath = (object2, path, Empty) => { 548 const stack = !isString$4(path) ? path : path.split("."); 549 let stackIndex = 0; 550 while (stackIndex < stack.length - 1) { 551 if (canNotTraverseDeeper(object2)) return {}; 552 const key = cleanKey(stack[stackIndex]); 553 if (!object2[key] && Empty) object2[key] = new Empty(); 554 if (Object.prototype.hasOwnProperty.call(object2, key)) { 555 object2 = object2[key]; 556 } else { 557 object2 = {}; 558 } 559 ++stackIndex; 560 } 561 if (canNotTraverseDeeper(object2)) return {}; 562 return { 563 obj: object2, 564 k: cleanKey(stack[stackIndex]) 565 }; 566 }; 567 const setPath = (object2, path, newValue) => { 568 const { 569 obj, 570 k: k2 571 } = getLastOfPath(object2, path, Object); 572 if (obj !== void 0 || path.length === 1) { 573 obj[k2] = newValue; 574 return; 575 } 576 let e2 = path[path.length - 1]; 577 let p2 = path.slice(0, path.length - 1); 578 let last = getLastOfPath(object2, p2, Object); 579 while (last.obj === void 0 && p2.length) { 580 e2 = `${p2[p2.length - 1]}.${e2}`; 581 p2 = p2.slice(0, p2.length - 1); 582 last = getLastOfPath(object2, p2, Object); 583 if ((last == null ? void 0 : last.obj) && typeof last.obj[`${last.k}.${e2}`] !== "undefined") { 584 last.obj = void 0; 585 } 586 } 587 last.obj[`${last.k}.${e2}`] = newValue; 588 }; 589 const pushPath = (object2, path, newValue, concat) => { 590 const { 591 obj, 592 k: k2 593 } = getLastOfPath(object2, path, Object); 594 obj[k2] = obj[k2] || []; 595 obj[k2].push(newValue); 596 }; 597 const getPath = (object2, path) => { 598 const { 599 obj, 600 k: k2 601 } = getLastOfPath(object2, path); 602 if (!obj) return void 0; 603 if (!Object.prototype.hasOwnProperty.call(obj, k2)) return void 0; 604 return obj[k2]; 605 }; 606 const getPathWithDefaults = (data, defaultData, key) => { 607 const value = getPath(data, key); 608 if (value !== void 0) { 609 return value; 610 } 611 return getPath(defaultData, key); 612 }; 613 const deepExtend = (target, source, overwrite) => { 614 for (const prop in source) { 615 if (prop !== "__proto__" && prop !== "constructor") { 616 if (prop in target) { 617 if (isString$4(target[prop]) || target[prop] instanceof String || isString$4(source[prop]) || source[prop] instanceof String) { 618 if (overwrite) target[prop] = source[prop]; 619 } else { 620 deepExtend(target[prop], source[prop], overwrite); 621 } 622 } else { 623 target[prop] = source[prop]; 624 } 625 } 626 } 627 return target; 628 }; 629 const regexEscape = (str) => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); 630 var _entityMap = { 631 "&": "&", 632 "<": "<", 633 ">": ">", 634 '"': """, 635 "'": "'", 636 "/": "/" 637 }; 638 const escape$1 = (data) => { 639 if (isString$4(data)) { 640 return data.replace(/[&<>
640"'\/]/g, (s2) => _entityMap[s2]); 641 } 642 return data; 643 }; 644 class RegExpCache { 645 constructor(capacity) { 646 this.capacity = capacity; 647 this.regExpMap = /* @__PURE__ */ new Map(); 648 this.regExpQueue = []; 649 } 650 getRegExp(pattern) { 651 const regExpFromCache = this.regExpMap.get(pattern); 652 if (regExpFromCache !== void 0) { 653 return regExpFromCache; 654 } 655 const regExpNew = new RegExp(pattern); 656 if (this.regExpQueue.length === this.capacity) { 657 this.regExpMap.delete(this.regExpQueue.shift()); 658 } 659 this.regExpMap.set(pattern, regExpNew); 660 this.regExpQueue.push(pattern); 661 return regExpNew; 662 } 663 } 664 const chars = [" ", ",", "?", "!", ";"]; 665 const looksLikeObjectPathRegExpCache = new RegExpCache(20); 666 const looksLikeObjectPath = (key, nsSeparator, keySeparator) => { 667 nsSeparator = nsSeparator || ""; 668 keySeparator = keySeparator || ""; 669 const possibleChars = chars.filter((c2) => nsSeparator.indexOf(c2) < 0 && keySeparator.indexOf(c2) < 0); 670 if (possibleChars.length === 0) return true; 671 const r2 = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map((c2) => c2 === "?" ? "\\?" : c2).join("|")})`); 672 let matched = !r2.test(key); 673 if (!matched) {
674 const ki2 = key.indexOf(keySeparator); 675 if (ki2 > 0 && !r2.test(key.substring(0, ki2))) { 676 matched = true; 677 } 678 } 679 return matched; 680 }; 681 const deepFind = (obj, path, keySeparator = ".") => { 682 if (!obj) return void 0; 683 if (obj[path]) { 684 if (!Object.prototype.hasOwnProperty.call(obj, path)) return void 0; 685 return obj[path]; 686 } 687 const tokens = path.split(keySeparator); 688 let current = obj; 689 for (let i2 = 0; i2 < tokens.length; ) { 690 if (!current || typeof current !== "object") { 691 return void 0; 692 } 693 let next2; 694 let nextPath = ""; 695 for (let j2 = i2; j2 < tokens.length; ++j2) { 696 if (j2 !== i2) { 697 nextPath += keySeparator; 698 } 699 nextPath += tokens[j2]; 700 next2 = current[nextPath]; 701 if (next2 !== void 0) { 702 if (["string", "number", "boolean"].indexOf(typeof next2) > -1 && j2 < tokens.length - 1) { 703 continue; 704 } 705 i2 += j2 - i2 + 1; 706 break; 707 } 708 } 709 current = next2; 710 } 711 return current; 712 }; 713 const getCleanedCode = (code) => code == null ? void 0 : code.replace("_", "-"); 714 const consoleLogger = { 715 type: "logger", 716 log(args) { 717 this.output("log", args); 718 }, 719 warn(args) { 720 this.output("warn", args); 721 }, 722 error(args) { 723 this.output("error", args); 724 }, 725 output(type, args) { 726 var _a, _b; 727 (_b = (_a = console == null ? void 0 : console[type]) == null ? void 0 : _a.apply) == null ? void 0 : _b.call(_a, console, args); 728 } 729 }; 730 class Logger { 731 constructor(concreteLogger, options2 = {}) { 732 this.init(concreteLogger, options2); 733 } 734 init(concreteLogger, options2 = {}) { 735 this.prefix = options2.prefix || "i18next:"; 736 this.logger = concreteLogger || consoleLogger; 737 this.options = options2; 738 this.debug = options2.debug; 739 } 740 log(...args) { 741 return this.forward(args, "log", "", true); 742 } 743 warn(...args) { 744 return this.forward(args, "warn", "", true); 745 } 746 error(...args) { 747 return this.forward(args, "error", ""); 748 } 749 deprecate(...args) { 750 return this.forward(args, "warn", "WARNING DEPRECATED: ", true); 751 } 752 forward(args, lvl, prefix2, debugOnly) { 753 if (debugOnly && !this.debug) return null; 754 if (isString$4(args[0])) args[0] = `${prefix2}${this.prefix} ${args[0]}`; 755 return this.logger[lvl](args); 756 } 757 create(moduleName) { 758 return new Logger(this.logger, __spreadValues(__spreadValues({}, { 759 prefix: `${this.prefix}:${moduleName}:` 760 }), this.options)); 761 } 762 clone(options2) { 763 options2 = options2 || this.options; 764 options2.prefix = options2.prefix || this.prefix; 765 return new Logger(this.logger, options2); 766 } 767 } 768 var baseLogger = new Logger(); 769 class EventEmitter { 770 constructor() { 771 this.observers = {}; 772 } 773 on(events, listener) { 774 events.split(" ").forEach((event) => { 775 if (!this.observers[event]) this.observers[event] = /* @__PURE__ */ new Map(); 776 const numListeners = this.observers[event].get(listener) || 0; 777 this.observers[event].set(listener, numListeners + 1); 778 }); 779 return this; 780 } 781 off(event, listener) { 782 if (!this.observers[event]) return; 783 if (!listener) { 784 delete this.observers[event]; 785 return; 786 } 787 this.observers[event].delete(listener); 788 } 789 emit(event, ...args) { 790 if (this.observers[event]) { 791 const cloned = Array.from(this.observers[event].entries()); 792 cloned.forEach(([observer, numTimesAdded]) => { 793 for (let i2 = 0; i2 < numTimesAdded; i2++) { 794 observer(...args); 795 } 796 }); 797 } 798 if (this.observers["*"]) { 799 const cloned = Array.from(this.observers["*"].entries()); 800 cloned.forEach(([observer, numTimesAdded]) => { 801 for (let i2 = 0; i2 < numTimesAdded; i2++) { 802 observer.apply(observer, [event, ...args]); 803 } 804 }); 805 } 806 } 807 }
vendor: 4,673 bytes, lines 808-940
808 class ResourceStore extends EventEmitter { 809 constructor(data, options2 = { 810 ns: ["translation"], 811 defaultNS: "translation" 812 }) { 813 super(); 814 this.data = data || {}; 815 this.options = options2; 816 if (this.options.keySeparator === void 0) { 817 this.options.keySeparator = "."; 818 } 819 if (this.options.ignoreJSONStructure === void 0) { 820 this.options.ignoreJSONStructure = true; 821 } 822 } 823 addNamespaces(ns) { 824 if (this.options.ns.indexOf(ns) < 0) { 825 this.options.ns.push(ns); 826 } 827 } 828 removeNamespaces(ns) { 829 const index2 = this.options.ns.indexOf(ns); 830 if (index2 > -1) { 831 this.options.ns.splice(index2, 1); 832 } 833 } 834 getResource(lng, ns, key, options2 = {}) { 835 var _a, _b; 836 const keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator; 837 const ignoreJSONStructure = options2.ignoreJSONStructure !== void 0 ? options2.ignoreJSONStructure : this.options.ignoreJSONStructure; 838 let path; 839 if (lng.indexOf(".") > -1) { 840 path = lng.split("."); 841 } else { 842 path = [lng, ns]; 843 if (key) { 844 if (Array.isArray(key)) { 845 path.push(...key); 846 } else if (isString$4(key) && keySeparator) { 847 path.push(...key.split(keySeparator)); 848 } else { 849 path.push(key); 850 } 851 } 852 } 853 const result = getPath(this.data, path); 854 if (!result && !ns && !key && lng.indexOf(".") > -1) { 855 lng = path[0]; 856 ns = path[1]; 857 key = path.slice(2).join("."); 858 } 859 if (result || !ignoreJSONStructure || !isString$4(key)) return result; 860 return deepFind((_b = (_a = this.data) == null ? void 0 : _a[lng]) == null ? void 0 : _b[ns], key, keySeparator); 861 } 862 addResource(lng, ns, key, value, options2 = { 863 silent: false 864 }) { 865 const keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator; 866 let path = [lng, ns]; 867 if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); 868 if (lng.indexOf(".") > -1) { 869 path = lng.split("."); 870 value = ns; 871 ns = path[1]; 872 } 873 this.addNamespaces(ns); 874 setPath(this.data, path, value); 875 if (!options2.silent) this.emit("added", lng, ns, key, value); 876 } 877 addResources(lng, ns, resources, options2 = { 878 silent: false 879 }) { 880 for (const m2 in resources) { 881 if (isString$4(resources[m2]) || Array.isArray(resources[m2])) this.addResource(lng, ns, m2, resources[m2], { 882 silent: true 883 }); 884 } 885 if (!options2.silent) this.emit("added", lng, ns, resources); 886 } 887 addResourceBundle(lng, ns, resources, deep, overwrite, options2 = { 888 silent: false, 889 skipCopy: false 890 }) { 891 let path = [lng, ns]; 892 if (lng.indexOf(".") > -1) { 893 path = lng.split("."); 894 deep = resources; 895 resources = ns; 896 ns = path[1]; 897 } 898 this.addNamespaces(ns); 899 let pack = getPath(this.data, path) || {}; 900 if (!options2.skipCopy) resources = JSON.parse(JSON.stringify(resources)); 901 if (deep) { 902 deepExtend(pack, resources, overwrite); 903 } else { 904 pack = __spreadValues(__spreadValues({}, pack), resources); 905 } 906 setPath(this.data, path, pack); 907 if (!options2.silent) this.emit("added", lng, ns, resources); 908 } 909 removeResourceBundle(lng, ns) { 910 if (this.hasResourceBundle(lng, ns)) { 911 delete this.data[lng][ns]; 912 } 913 this.removeNamespaces(ns); 914 this.emit("removed", lng, ns); 915 } 916 hasResourceBundle(lng, ns) { 917 return this.getResource(lng, ns) !== void 0; 918 } 919 getResourceBundle(lng, ns) { 920 if (!ns) ns = this.options.defaultNS; 921 return this.getResource(lng, ns); 922 } 923 getDataByLanguage(lng) { 924 return this.data[lng]; 925 } 926 hasLanguageSomeTranslations(lng) { 927 const data = this.getDataByLanguage(lng); 928 const n2 = data && Object.keys(data) || []; 929 return !!n2.find((v2) => data[v2] && Object.keys(data[v2]).length > 0); 930 } 931 toJSON() { 932 return this.data; 933 } 934 } 935 var postProcessor = { 936 processors: {}, 937 addPostProcessor(module2) { 938 this.processors[module2.name] = module2; 939 }, 940 handle(processors, value, key, options2, translator) {
941 processors.forEach((processor) => { 942 var _a, _b; 943 value = (_b = (_a = this.processors[processor]) == null ? void 0 : _a.process(value, key, options2, translator)) != null ? _b : value; 944 }); 945 return value; 946 } 947 }; 948 const PATH_KEY = Symbol("i18next/PATH_KEY"); 949 function createProxy() { 950 const state = []; 951 const handler = /* @__PURE__ */ Object.create(null); 952 let proxy; 953 handler.get = (target, key) => { 954 var _a; 955 (_a = proxy == null ? void 0 : proxy.revoke) == null ? void 0 : _a.call(proxy); 956 if (key === PATH_KEY) return state; 957 state.push(key); 958 proxy = Proxy.revocable(target, handler); 959 return proxy.proxy; 960 }; 961 return Proxy.revocable(/* @__PURE__ */ Object.create(null), handler).proxy; 962 } 963 function keysFromSelector(selector, opts) { 964 var _a; 965 const { 966 [PATH_KEY]: path 967 } = selector(createProxy()); 968 return path.join((_a = opts == null ? void 0 : opts.keySeparator) != null ? _a : "."); 969 } 970 const checkedLoadedFor = {}; 971 const shouldHandleAsObject = (res) => !isString$4(res) && typeof res !== "boolean" && typeof res !== "number"; 972 class Translator extends EventEmitter { 973 constructor(services, options2 = {}) { 974 super(); 975 copy$1(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], services, this); 976 this.options = options2; 977 if (this.options.keySeparator === void 0) { 978 this.options.keySeparator = "."; 979 } 980 this.logger = baseLogger.create("translator"); 981 } 982 changeLanguage(lng) { 983 if (lng) this.language = lng; 984 } 985 exists(key, o2 = { 986 interpolation: {} 987 }) { 988 const opt = __spreadValues({}, o2); 989 if (key == null) return false; 990 const resolved = this.resolve(key, opt); 991 if ((resolved == null ? void 0 : resolved.res) === void 0) return false; 992 const isObject2 = shouldHandleAsObject(resolved.res); 993 if (opt.returnObjects === false && isObject2) { 994 return false; 995 } 996 return true; 997 } 998 extractFromKey(key, opt) { 999 let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator; 1000 if (nsSeparator === void 0) nsSeparator = ":"; 1001 const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator; 1002 let namespaces = opt.ns || this.options.defaultNS || []; 1003 const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1; 1004 const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator); 1005 if (wouldCheckForNsInKey && !seemsNaturalLanguage) { 1006 const m2 = key.match(this.interpolator.nestingRegexp); 1007 if (m2 && m2.length > 0) { 1008 return { 1009 key, 1010 namespaces: isString$4(namespaces) ? [namespaces] : namespaces 1011 }; 1012 } 1013 const parts = key.split(nsSeparator); 1014 if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift(); 1015 key = parts.join(keySeparator); 1016 } 1017 return { 1018 key, 1019 namespaces: isString$4(namespaces) ? [namespaces] : namespaces 1020 }; 1021 } 1022 translate(keys2, o2, lastKey) { 1023 let opt = typeof o2 === "object" ? __spreadValues({}, o2) : o2; 1024 if (typeof opt !== "object" && this.options.overloadTranslationOptionHandler) { 1025 opt = this.options.overloadTranslationOptionHandler(arguments); 1026 } 1027 if (typeof opt === "object") opt = __spreadValues({}, opt); 1028 if (!opt) opt = {}; 1029 if (keys2 == null) return ""; 1030 if (typeof keys2 === "function") keys2 = keysFromSelector(keys2, __spreadValues(__spreadValues({}, this.options), opt)); 1031 if (!Array.isArray(keys2)) keys2 = [String(keys2)]; 1032 const returnDetails = opt.returnDetails !== void 0 ? opt.returnDetails : this.options.returnDetails;
1033 const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator; 1034 const { 1035 key, 1036 namespaces 1037 } = this.extractFromKey(keys2[keys2.length - 1], opt); 1038 const namespace = namespaces[namespaces.length - 1]; 1039 let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator; 1040 if (nsSeparator === void 0) nsSeparator = ":"; 1041 const lng = opt.lng || this.language; 1042 const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; 1043 if ((lng == null ? void 0 : lng.toLowerCase()) === "cimode") { 1044 if (appendNamespaceToCIMode) { 1045 if (returnDetails) { 1046 return { 1047 res: `${namespace}${nsSeparator}${key}`, 1048 usedKey: key, 1049 exactUsedKey: key, 1050 usedLng: lng, 1051 usedNS: namespace, 1052 usedParams: this.getUsedParamsDetails(opt) 1053 }; 1054 } 1055 return `${namespace}${nsSeparator}${key}`; 1056 } 1057 if (returnDetails) { 1058 return { 1059 res: key, 1060 usedKey: key, 1061 exactUsedKey: key, 1062 usedLng: lng, 1063 usedNS: namespace, 1064 usedParams: this.getUsedParamsDetails(opt) 1065 }; 1066 } 1067 return key; 1068 } 1069 const resolved = this.resolve(keys2, opt); 1070 let res = resolved == null ? void 0 : resolved.res; 1071 const resUsedKey = (resolved == null ? void 0 : resolved.usedKey) || key; 1072 const resExactUsedKey = (resolved == null ? void 0 : resolved.exactUsedKey) || key; 1073 const noObject = ["[object Number]", "[object Function]", "[object RegExp]"]; 1074 const joinArrays = opt.joinArrays !== void 0 ? opt.joinArrays : this.options.joinArrays; 1075 const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject; 1076 const needsPluralHandling = opt.count !== void 0 && !isString$4(opt.count); 1077 const hasDefaultValue = Translator.hasDefaultValue(opt); 1078 const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : ""; 1079 const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, { 1080 ordinal: false 1081 }) : ""; 1082 const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0; 1083 const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue; 1084 let resForObjHndl = res; 1085 if (handleAsObjectInI18nFormat && !res && hasDefaultValue) { 1086 resForObjHndl = defaultValue; 1087 } 1088 const handleAsObject = shouldHandleAsObject(resForObjHndl); 1089 const resType = Object.prototype.toString.apply(resForObjHndl); 1090 if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString$4(joinArrays) && Array.isArray(resForObjHndl))) { 1091 if (!opt.returnObjects && !this.options.returnObjects) { 1092 if (!this.options.returnedObjectHandler) { 1093 this.logger.warn("accessing an object - but returnObjects options is not enabled!"); 1094 } 1095 const r2 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, __spreadProps(__spreadValues({}, opt), { 1096 ns: namespaces 1097 })) : `key '${key} (${this.language})' returned an object instead of string.`; 1098 if (returnDetails) { 1099 resolved.res = r2; 1100 resolved.usedParams = this.getUsedParamsDetails(opt); 1101 return resolved; 1102 } 1103 return r2; 1104 } 1105 if (keySeparator) { 1106 const resTypeIsArray = Array.isArray(resForObjHndl); 1107 const copy2 = resTypeIsArray ? [] : {}; 1108 const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey; 1109 for (const m2 in resForObjHndl) { 1110 if (Object.prototype.hasOwnProperty.call(resForObjHndl, m2)) { 1111 const deepKey = `${newKeyToUse}${keySeparator}${m2}`; 1112 if (hasDefaultValue && !res) { 1113 copy2[m2] = this.translate(deepKey, __spreadValues(__spreadProps(__spreadValues({}, opt), { 1114 defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m2] : void 0 1115 }), {
1116 joinArrays: false, 1117 ns: namespaces 1118 })); 1119 } else { 1120 copy2[m2] = this.translate(deepKey, __spreadValues(__spreadValues({}, opt), { 1121 joinArrays: false, 1122 ns: namespaces 1123 })); 1124 } 1125 if (copy2[m2] === deepKey) copy2[m2] = resForObjHndl[m2]; 1126 } 1127 } 1128 res = copy2; 1129 } 1130 } else if (handleAsObjectInI18nFormat && isString$4(joinArrays) && Array.isArray(res)) { 1131 res = res.join(joinArrays); 1132 if (res) res = this.extendTranslation(res, keys2, opt, lastKey); 1133 } else { 1134 let usedDefault = false; 1135 let usedKey = false; 1136 if (!this.isValidLookup(res) && hasDefaultValue) { 1137 usedDefault = true; 1138 res = defaultValue; 1139 } 1140 if (!this.isValidLookup(res)) { 1141 usedKey = true; 1142 res = key; 1143 } 1144 const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey; 1145 const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? void 0 : res; 1146 const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing; 1147 if (usedKey || usedDefault || updateMissing) { 1148 this.logger.log(updateMissing ? "updateKey" : "missingKey", lng, namespace, key, updateMissing ? defaultValue : res); 1149 if (keySeparator) { 1150 const fk = this.resolve(key, __spreadProps(__spreadValues({}, opt), { 1151 keySeparator: false 1152 })); 1153 if (fk && fk.res) this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format."); 1154 } 1155 let lngs = []; 1156 const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language); 1157 if (this.options.saveMissingTo === "fallback" && fallbackLngs && fallbackLngs[0]) { 1158 for (let i2 = 0; i2 < fallbackLngs.length; i2++) { 1159 lngs.push(fallbackLngs[i2]); 1160 } 1161 } else if (this.options.saveMissingTo === "all") { 1162 lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language); 1163 } else { 1164 lngs.push(opt.lng || this.language); 1165 } 1166 const send = (l2, k2, specificDefaultValue) => { 1167 var _a; 1168 const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing; 1169 if (this.options.missingKeyHandler) { 1170 this.options.missingKeyHandler(l2, namespace, k2, defaultForMissing, updateMissing, opt); 1171 } else if ((_a = this.backendConnector) == null ? void 0 : _a.saveMissing) { 1172 this.backendConnector.saveMissing(l2, namespace, k2, defaultForMissing, updateMissing, opt); 1173 } 1174 this.emit("missingKey", l2, namespace, k2, res); 1175 }; 1176 if (this.options.saveMissing) { 1177 if (this.options.saveMissingPlurals && needsPluralHandling) { 1178 lngs.forEach((language) => { 1179 const suffixes = this.pluralResolver.getSuffixes(language, opt); 1180 if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) { 1181 suffixes.push(`${this.options.pluralSeparator}zero`); 1182 } 1183 suffixes.forEach((suffix) => { 1184 send([language], key + suffix, opt[`defaultValue${suffix}`] || defaultValue); 1185 }); 1186 }); 1187 } else { 1188 send(lngs, key, defaultValue); 1189 } 1190 } 1191 } 1192 res = this.extendTranslation(res, keys2, opt, resolved, lastKey); 1193 if (usedKey && res === key && this.options.appendNamespaceToMissingKey) { 1194 res = `${namespace}${nsSeparator}${key}`; 1195 } 1196 if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) { 1197 res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : void 0, opt); 1198 } 1199 } 1200 if (returnDetails) { 1201 resolved.res = res; 1202 resolved.usedParams = this.getUsedParamsDetails(opt); 1203 return resolved; 1204 } 1205 return res; 1206 } 1207 extendTranslation(res, key, opt, resolved, lastKey) { 1208 var _a, _b; 1209 if ((_a = this.i18nFormat) == null ? void 0 : _a.parse) { 1210 res = this.i18nFormat.parse(res, __spreadValues(__spreadValues({}, this.options.interpolation.defaultVariables), opt), opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, { 1211 resolved 1212 }); 1213 } else if (!opt.skipInterpolation) { 1214 if (opt.interpolation) this.interpolator.init(__spreadValues(__spreadValues({}, opt), { 1215 interpolation: __spreadValues(__spreadValues({}, this.options.interpolation), opt.interpolation) 1216 })); 1217 const skipOnVariables = isString$4(res) && (((_b = opt == null ? void 0 : opt.interpolation) == null ? void 0 : _b.skipOnVariables) !== void 0 ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables); 1218 let nestBef; 1219 if (skipOnVariables) { 1220 const nb = res.match(this.interpolator.nestingRegexp); 1221 nestBef = nb && nb.length; 1222 } 1223 let data = opt.replace && !isString$4(opt.replace) ? opt.replace : opt; 1224 if (this.options.interpolation.defaultVariables) data = __spreadValues(__spreadValues({}, this.options.interpolation.defaultVariables), data); 1225 res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt); 1226 if (skipOnVariables) { 1227 const na2 = res.match(this.interpolator.nestingRegexp); 1228 const nestAft = na2 && na2.length; 1229 if (nestBef < nestAft) opt.nest = false;
1230 } 1231 if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng; 1232 if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => { 1233 if ((lastKey == null ? void 0 : lastKey[0]) === args[0] && !opt.context) { 1234 this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`); 1235 return null; 1236 } 1237 return this.translate(...args, key); 1238 }, opt); 1239 if (opt.interpolation) this.interpolator.reset(); 1240 } 1241 const postProcess = opt.postProcess || this.options.postProcess; 1242 const postProcessorNames = isString$4(postProcess) ? [postProcess] : postProcess; 1243 if (res != null && (postProcessorNames == null ? void 0 : postProcessorNames.length) && opt.applyPostProcessor !== false) { 1244 res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? __spreadValues({ 1245 i18nResolved: __spreadProps(__spreadValues({}, resolved), { 1246 usedParams: this.getUsedParamsDetails(opt) 1247 }) 1248 }, opt) : opt, this); 1249 } 1250 return res; 1251 } 1252 resolve(keys2, opt = {}) { 1253 let found; 1254 let usedKey; 1255 let exactUsedKey; 1256 let usedLng; 1257 let usedNS; 1258 if (isString$4(keys2)) keys2 = [keys2]; 1259 keys2.forEach((k2) => { 1260 if (this.isValidLookup(found)) return; 1261 const extracted = this.extractFromKey(k2, opt); 1262 const key = extracted.key; 1263 usedKey = key; 1264 let namespaces = extracted.namespaces; 1265 if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS); 1266 const needsPluralHandling = opt.count !== void 0 && !isString$4(opt.count); 1267 const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0; 1268 const needsContextHandling = opt.context !== void 0 && (isString$4(opt.context) || typeof opt.context === "number") && opt.context !== ""; 1269 const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng); 1270 namespaces.forEach((ns) => { 1271 var _a, _b; 1272 if (this.isValidLookup(found)) return; 1273 usedNS = ns; 1274 if (!checkedLoadedFor[`${codes[0]}-${ns}`] && ((_a = this.utils) == null ? void 0 : _a.hasLoadedNamespace) && !((_b = this.utils) == null ? void 0 : _b.hasLoadedNamespace(usedNS))) { 1275 checkedLoadedFor[`${codes[0]}-${ns}`] = true; 1276 this.logger.warn(`key "${usedKey}" for languages "${codes.join(", ")}" won't get resolved as namespace "${usedNS}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"); 1277 } 1278 codes.forEach((code) => { 1279 var _a2; 1280 if (this.isValidLookup(found)) return; 1281 usedLng = code; 1282 const finalKeys = [key]; 1283 if ((_a2 = this.i18nFormat) == null ? void 0 : _a2.addLookupKeys) { 1284 this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt); 1285 } else { 1286 let pluralSuffix; 1287 if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt); 1288 const zeroSuffix = `${this.options.pluralSeparator}zero`; 1289 const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`; 1290 if (needsPluralHandling) { 1291 if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) { 1292 finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator)); 1293 } 1294 finalKeys.push(key + pluralSuffix); 1295 if (needsZeroSuffixLookup) { 1296 finalKeys.push(key + zeroSuffix); 1297 } 1298 } 1299 if (needsContextHandling) { 1300 const contextKey = `${key}${this.options.contextSeparator || "_"}${opt.context}`; 1301 finalKeys.push(contextKey); 1302 if (needsPluralHandling) { 1303 if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) { 1304 finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator)); 1305 } 1306 finalKeys.push(contextKey + pluralSuffix); 1307 if (needsZeroSuffixLookup) { 1308 finalKeys.push(contextKey + zeroSuffix); 1309 } 1310 } 1311 } 1312 } 1313 let possibleKey; 1314 while (possibleKey = finalKeys.pop()) { 1315 if (!this.isValidLookup(found)) { 1316 exactUsedKey = possibleKey; 1317 found = this.getResource(code, ns, possibleKey, opt); 1318 } 1319 } 1320 }); 1321 }); 1322 }); 1323 return { 1324 res: found, 1325 usedKey, 1326 exactUsedKey, 1327 usedLng, 1328 usedNS 1329 }; 1330 } 1331 isValidLookup(res) { 1332 return res !== void 0 && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ""); 1333 } 1334 getResource(code, ns, key, options2 = {}) { 1335 var _a; 1336 if ((_a = this.i18nFormat) == null ? void 0 : _a.getResource) return this.i18nFormat.getResource(code, ns, key, options2); 1337 return this.resourceStore.getResource(code, ns, key, options2); 1338 } 1339 getUsedParamsDetails(options2 = {}) { 1340 const optionsKeys = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"]; 1341 const useOptionsReplaceForData = options2.replace && !isString$4(options2.replace); 1342 let data = useOptionsReplaceForData ? options2.replace : options2; 1343 if (useOptionsReplaceForData && typeof options2.count !== "undefined") { 1344 data.count = options2.count; 1345 } 1346 if (this.options.interpolation.defaultVariables) { 1347 data = __spreadValues(__spreadValues({}, this.options.interpolation.defaultVariables), data); 1348 } 1349 if (!useOptionsReplaceForData) { 1350 data = __spreadValues({}, data); 1351 for (const key of optionsKeys) { 1352 delete data[key]; 1353 } 1354 } 1355 return data; 1356 } 1357 static hasDefaultValue(options2) { 1358 const prefix2 = "defaultValue"; 1359 for (const option in options2) { 1360 if (Object.prototype.hasOwnProperty.call(options2, option) && prefix2 === option.substring(0, prefix2.length) && void 0 !== options2[option]) { 1361 return true; 1362 } 1363 } 1364 return false;
vendor: 4,750 bytes, lines 1365-1468
1365 } 1366 } 1367 class LanguageUtil { 1368 constructor(options2) { 1369 this.options = options2; 1370 this.supportedLngs = this.options.supportedLngs || false; 1371 this.logger = baseLogger.create("languageUtils"); 1372 } 1373 getScriptPartFromCode(code) { 1374 code = getCleanedCode(code); 1375 if (!code || code.indexOf("-") < 0) return null; 1376 const p2 = code.split("-"); 1377 if (p2.length === 2) return null; 1378 p2.pop(); 1379 if (p2[p2.length - 1].toLowerCase() === "x") return null; 1380 return this.formatLanguageCode(p2.join("-")); 1381 } 1382 getLanguagePartFromCode(code) { 1383 code = getCleanedCode(code); 1384 if (!code || code.indexOf("-") < 0) return code; 1385 const p2 = code.split("-"); 1386 return this.formatLanguageCode(p2[0]); 1387 } 1388 formatLanguageCode(code) { 1389 if (isString$4(code) && code.indexOf("-") > -1) { 1390 let formattedCode; 1391 try { 1392 formattedCode = Intl.getCanonicalLocales(code)[0]; 1393 } catch (e2) { 1394 } 1395 if (formattedCode && this.options.lowerCaseLng) { 1396 formattedCode = formattedCode.toLowerCase(); 1397 } 1398 if (formattedCode) return formattedCode; 1399 if (this.options.lowerCaseLng) { 1400 return code.toLowerCase(); 1401 } 1402 return code; 1403 } 1404 return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; 1405 } 1406 isSupportedCode(code) { 1407 if (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) { 1408 code = this.getLanguagePartFromCode(code); 1409 } 1410 return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1; 1411 } 1412 getBestMatchFromCodes(codes) { 1413 if (!codes) return null; 1414 let found; 1415 codes.forEach((code) => { 1416 if (found) return; 1417 const cleanedLng = this.formatLanguageCode(code); 1418 if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng; 1419 }); 1420 if (!found && this.options.supportedLngs) { 1421 codes.forEach((code) => { 1422 if (found) return; 1423 const lngScOnly = this.getScriptPartFromCode(code); 1424 if (this.isSupportedCode(lngScOnly)) return found = lngScOnly; 1425 const lngOnly = this.getLanguagePartFromCode(code); 1426 if (this.isSupportedCode(lngOnly)) return found = lngOnly; 1427 found = this.options.supportedLngs.find((supportedLng) => { 1428 if (supportedLng === lngOnly) return supportedLng; 1429 if (supportedLng.indexOf("-") < 0 && lngOnly.indexOf("-") < 0) return; 1430 if (supportedLng.indexOf("-") > 0 && lngOnly.indexOf("-") < 0 && supportedLng.substring(0, supportedLng.indexOf("-")) === lngOnly) return supportedLng; 1431 if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng; 1432 }); 1433 }); 1434 } 1435 if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0]; 1436 return found; 1437 } 1438 getFallbackCodes(fallbacks, code) { 1439 if (!fallbacks) return []; 1440 if (typeof fallbacks === "function") fallbacks = fallbacks(code); 1441 if (isString$4(fallbacks)) fallbacks = [fallbacks]; 1442 if (Array.isArray(fallbacks)) return fallbacks; 1443 if (!code) return fallbacks.default || []; 1444 let found = fallbacks[code]; 1445 if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; 1446 if (!found) found = fallbacks[this.formatLanguageCode(code)]; 1447 if (!found) found = fallbacks[this.getLanguagePartFromCode(code)]; 1448 if (!found) found = fallbacks.default; 1449 return found || []; 1450 } 1451 toResolveHierarchy(code, fallbackCode) { 1452 const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code); 1453 const codes = []; 1454 const addCode = (c2) => { 1455 if (!c2) return; 1456 if (this.isSupportedCode(c2)) { 1457 codes.push(c2); 1458 } else { 1459 this.logger.warn(`rejecting language code not found in supportedLngs: ${c2}`); 1460 } 1461 }; 1462 if (isString$4(code) && (code.indexOf("-") > -1 || code.indexOf("_") > -1)) { 1463 if (this.options.load !== "languageOnly") addCode(this.formatLanguageCode(code)); 1464 if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly") addCode(this.getScriptPartFromCode(code)); 1465 if (this.options.load !== "currentOnly") addCode(this.getLanguagePartFromCode(code)); 1466 } else if (isString$4(code)) { 1467 addCode(this.formatLanguageCode(code)); 1468 }
1469 fallbackCodes.forEach((fc) => { 1470 if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc)); 1471 }); 1472 return codes; 1473 } 1474 } 1475 const suffixesOrder = { 1476 zero: 0, 1477 one: 1, 1478 two: 2, 1479 few: 3, 1480 many: 4, 1481 other: 5 1482 }; 1483 const dummyRule = { 1484 select: (count2) => count2 === 1 ? "one" : "other", 1485 resolvedOptions: () => ({ 1486 pluralCategories: ["one", "other"] 1487 }) 1488 }; 1489 class PluralResolver { 1490 constructor(languageUtils, options2 = {}) { 1491 this.languageUtils = languageUtils; 1492 this.options = options2; 1493 this.logger = baseLogger.create("pluralResolver"); 1494 this.pluralRulesCache = {}; 1495 } 1496 addRule(lng, obj) { 1497 this.rules[lng] = obj; 1498 } 1499 clearCache() { 1500 this.pluralRulesCache = {}; 1501 } 1502 getRule(code, options2 = {}) { 1503 const cleanedCode = getCleanedCode(code === "dev" ? "en" : code); 1504 const type = options2.ordinal ? "ordinal" : "cardinal"; 1505 const cacheKey = JSON.stringify({ 1506 cleanedCode, 1507 type 1508 }); 1509 if (cacheKey in this.pluralRulesCache) { 1510 return this.pluralRulesCache[cacheKey]; 1511 } 1512 let rule; 1513 try { 1514 rule = new Intl.PluralRules(cleanedCode, { 1515 type 1516 }); 1517 } catch (err) { 1518 if (!Intl) { 1519 this.logger.error("No Intl support, please use an Intl polyfill!"); 1520 return dummyRule; 1521 } 1522 if (!code.match(/-|_/)) return dummyRule; 1523 const lngPart = this.languageUtils.getLanguagePartFromCode(code); 1524 rule = this.getRule(lngPart, options2); 1525 } 1526 this.pluralRulesCache[cacheKey] = rule; 1527 return rule; 1528 } 1529 needsPlural(code, options2 = {}) { 1530 let rule = this.getRule(code, options2); 1531 if (!rule) rule = this.getRule("dev", options2); 1532 return (rule == null ? void 0 : rule.resolvedOptions().pluralCategories.length) > 1; 1533 } 1534 getPluralFormsOfKey(code, key, options2 = {}) { 1535 return this.getSuffixes(code, options2).map((suffix) => `${key}${suffix}`); 1536 } 1537 getSuffixes(code, options2 = {}) { 1538 let rule = this.getRule(code, options2); 1539 if (!rule) rule = this.getRule("dev", options2); 1540 if (!rule) return []; 1541 return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory) => `${this.options.prepend}${options2.ordinal ? `ordinal${this.options.prepend}` : ""}${pluralCategory}`); 1542 } 1543 getSuffix(code, count2, options2 = {}) { 1544 const rule = this.getRule(code, options2); 1545 if (rule) { 1546 return `${this.options.prepend}${options2.ordinal ? `ordinal${this.options.prepend}` : ""}${rule.select(count2)}`; 1547 } 1548 this.logger.warn(`no plural rule found for: ${code}`); 1549 return this.getSuffix("dev", count2, options2); 1550 } 1551 } 1552 const deepFindWithDefaults = (data, defaultData, key, keySeparator = ".", ignoreJSONStructure = true) => { 1553 let path = getPathWithDefaults(data, defaultData, key); 1554 if (!path && ignoreJSONStructure && isString$4(key)) {
1555 path = deepFind(data, key, keySeparator); 1556 if (path === void 0) path = deepFind(defaultData, key, keySeparator); 1557 } 1558 return path; 1559 }; 1560 const regexSafe = (val) => val.replace(/\$/g, "$$$$"); 1561 class Interpolator { 1562 constructor(options2 = {}) { 1563 var _a; 1564 this.logger = baseLogger.create("interpolator"); 1565 this.options = options2; 1566 this.format = ((_a = options2 == null ? void 0 : options2.interpolation) == null ? void 0 : _a.format) || ((value) => value); 1567 this.init(options2); 1568 } 1569 init(options2 = {}) { 1570 if (!options2.interpolation) options2.interpolation = { 1571 escapeValue: true 1572 }; 1573 const { 1574 escape: escape$1$1, 1575 escapeValue, 1576 useRawValueToEscape, 1577 prefix: prefix2, 1578 prefixEscaped, 1579 suffix, 1580 suffixEscaped, 1581 formatSeparator, 1582 unescapeSuffix, 1583 unescapePrefix, 1584 nestingPrefix, 1585 nestingPrefixEscaped, 1586 nestingSuffix, 1587 nestingSuffixEscaped, 1588 nestingOptionsSeparator, 1589 maxReplaces, 1590 alwaysFormat 1591 } = options2.interpolation; 1592 this.escape = escape$1$1 !== void 0 ? escape$1$1 : escape$1; 1593 this.escapeValue = escapeValue !== void 0 ? escapeValue : true; 1594 this.useRawValueToEscape = useRawValueToEscape !== void 0 ? useRawValueToEscape : false;
1595 this.prefix = prefix2 ? regexEscape(prefix2) : prefixEscaped || "{{"; 1596 this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || "}}"; 1597 this.formatSeparator = formatSeparator || ","; 1598 this.unescapePrefix = unescapeSuffix ? "" : unescapePrefix || "-"; 1599 this.unescapeSuffix = this.unescapePrefix ? "" : unescapeSuffix || ""; 1600 this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape("$t("); 1601 this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(")"); 1602 this.nestingOptionsSeparator = nestingOptionsSeparator || ","; 1603 this.maxReplaces = maxReplaces || 1e3; 1604 this.alwaysFormat = alwaysFormat !== void 0 ? alwaysFormat : false; 1605 this.resetRegExp(); 1606 } 1607 reset() { 1608 if (this.options) this.init(this.options); 1609 } 1610 resetRegExp() { 1611 const getOrResetRegExp = (existingRegExp, pattern) => { 1612 if ((existingRegExp == null ? void 0 : existingRegExp.source) === pattern) { 1613 existingRegExp.lastIndex = 0; 1614 return existingRegExp; 1615 } 1616 return new RegExp(pattern, "g"); 1617 }; 1618 this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`); 1619 this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`); 1620 this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`); 1621 } 1622 interpolate(str, data, lng, options2) { 1623 var _a; 1624 let match2; 1625 let value; 1626 let replaces; 1627 const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}; 1628 const handleFormat = (key) => { 1629 if (key.indexOf(this.formatSeparator) < 0) { 1630 const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure); 1631 return this.alwaysFormat ? this.format(path, void 0, lng, __spreadProps(__spreadValues(__spreadValues({}, options2), data), { 1632 interpolationkey: key 1633 })) : path; 1634 } 1635 const p2 = key.split(this.formatSeparator); 1636 const k2 = p2.shift().trim(); 1637 const f2 = p2.join(this.formatSeparator).trim(); 1638 return this.format(deepFindWithDefaults(data, defaultData, k2, this.options.keySeparator, this.options.ignoreJSONStructure), f2, lng, __spreadProps(__spreadValues(__spreadValues({}, options2), data), { 1639 interpolationkey: k2 1640 })); 1641 }; 1642 this.resetRegExp(); 1643 const missingInterpolationHandler = (options2 == null ? void 0 : options2.missingInterpolationHandler) || this.options.missingInterpolationHandler; 1644 const skipOnVariables = ((_a = options2 == null ? void 0 : options2.interpolation) == null ? void 0 : _a.skipOnVariables) !== void 0 ? options2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables; 1645 const todos = [{ 1646 regex: this.regexpUnescape, 1647 safeValue: (val) => regexSafe(val) 1648 }, { 1649 regex: this.regexp, 1650 safeValue: (val) => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val) 1651 }]; 1652 todos.forEach((todo) => { 1653 replaces = 0; 1654 while (match2 = todo.regex.exec(str)) { 1655 const matchedVar = match2[1].trim(); 1656 value = handleFormat(matchedVar); 1657 if (value === void 0) { 1658 if (typeof missingInterpolationHandler === "function") { 1659 const temp = missingInterpolationHandler(str, match2, options2); 1660 value = isString$4(temp) ? temp : ""; 1661 } else if (options2 && Object.prototype.hasOwnProperty.call(options2, matchedVar)) { 1662 value = ""; 1663 } else if (skipOnVariables) { 1664 value = match2[0]; 1665 continue; 1666 } else { 1667 this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`); 1668 value = ""; 1669 } 1670 } else if (!isString$4(value) && !this.useRawValueToEscape) { 1671 value = makeString(value); 1672 } 1673 const safeValue = todo.safeValue(value); 1674 str = str.replace(match2[0], safeValue); 1675 if (skipOnVariables) { 1676 todo.regex.lastIndex += value.length; 1677 todo.regex.lastIndex -= match2[0].length; 1678 } else { 1679 todo.regex.lastIndex = 0; 1680 } 1681 replaces++; 1682 if (replaces >= this.maxReplaces) { 1683 break; 1684 } 1685 } 1686 }); 1687 return str; 1688 } 1689 nest(str, fc, options2 = {}) { 1690 let match2; 1691 let value; 1692 let clonedOptions; 1693 const handleHasOptions = (key, inheritedOptions) => { 1694 var _a; 1695 const sep = this.nestingOptionsSeparator; 1696 if (key.indexOf(sep) < 0) return key; 1697 const c2 = key.split(new RegExp(`${sep}[ ]*{`)); 1698 let optionsString = `{${c2[1]}`; 1699 key = c2[0]; 1700 optionsString = this.interpolate(optionsString, clonedOptions); 1701 const matchedSingleQuotes = optionsString.match(/'/g); 1702 const matchedDoubleQuotes = optionsString.match(/"/g); 1703 if (((_a = matchedSingleQuotes == null ? void 0 : matchedSingleQuotes.length) != null ? _a : 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) { 1704 optionsString = optionsString.replace(/'/g, '"'); 1705 } 1706 try { 1707 clonedOptions = JSON.parse(optionsString); 1708 if (inheritedOptions) clonedOptions = __spreadValues(__spreadValues({}, inheritedOptions), clonedOptions); 1709 } catch (e2) { 1710 this.logger.warn(`failed parsing options string in nesting for key ${key}`, e2); 1711 return `${key}${sep}${optionsString}`; 1712 } 1713 if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue; 1714 return key; 1715 }; 1716 while (match2 = this.nestingRegexp.exec(str)) { 1717 let formatters = []; 1718 clonedOptions = __spreadValues({}, options2); 1719 clonedOptions = clonedOptions.replace && !isString$4(clonedOptions.replace) ? clonedOptions.replace : clonedOptions; 1720 clonedOptions.applyPostProcessor = false;
1721 delete clonedOptions.defaultValue; 1722 const keyEndIndex = /{.*}/.test(match2[1]) ? match2[1].lastIndexOf("}") + 1 : match2[1].indexOf(this.formatSeparator); 1723 if (keyEndIndex !== -1) { 1724 formatters = match2[1].slice(keyEndIndex).split(this.formatSeparator).map((elem) => elem.trim()).filter(Boolean); 1725 match2[1] = match2[1].slice(0, keyEndIndex); 1726 } 1727 value = fc(handleHasOptions.call(this, match2[1].trim(), clonedOptions), clonedOptions); 1728 if (value && match2[0] === str && !isString$4(value)) return value; 1729 if (!isString$4(value)) value = makeString(value); 1730 if (!value) { 1731 this.logger.warn(`missed to resolve ${match2[1]} for nesting ${str}`); 1732 value = ""; 1733 } 1734 if (formatters.length) { 1735 value = formatters.reduce((v2, f2) => this.format(v2, f2, options2.lng, __spreadProps(__spreadValues({}, options2), { 1736 interpolationkey: match2[1].trim() 1737 })), value.trim()); 1738 } 1739 str = str.replace(match2[0], value); 1740 this.regexp.lastIndex = 0; 1741 } 1742 return str; 1743 } 1744 } 1745 const parseFormatStr = (formatStr) => { 1746 let formatName = formatStr.toLowerCase().trim(); 1747 const formatOptions = {}; 1748 if (formatStr.indexOf("(") > -1) { 1749 const p2 = formatStr.split("("); 1750 formatName = p2[0].toLowerCase().trim(); 1751 const optStr = p2[1].substring(0, p2[1].length - 1); 1752 if (formatName === "currency" && optStr.indexOf(":") < 0) { 1753 if (!formatOptions.currency) formatOptions.currency = optStr.trim(); 1754 } else if (formatName === "relativetime" && optStr.indexOf(":") < 0) { 1755 if (!formatOptions.range) formatOptions.range = optStr.trim(); 1756 } else { 1757 const opts = optStr.split(";"); 1758 opts.forEach((opt) => { 1759 if (opt) { 1760 const [key, ...rest] = opt.split(":"); 1761 const val = rest.join(":").trim().replace(/^'+|'+$/g, ""); 1762 const trimmedKey = key.trim(); 1763 if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val; 1764 if (val === "false") formatOptions[trimmedKey] = false; 1765 if (val === "true") formatOptions[trimmedKey] = true; 1766 if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10); 1767 } 1768 }); 1769 } 1770 } 1771 return { 1772 formatName, 1773 formatOptions 1774 }; 1775 }; 1776 const createCachedFormatter = (fn2) => { 1777 const cache = {}; 1778 return (v2, l2, o2) => { 1779 let optForCache = o2; 1780 if (o2 && o2.interpolationkey && o2.formatParams && o2.formatParams[o2.interpolationkey] && o2[o2.interpolationkey]) { 1781 optForCache = __spreadProps(__spreadValues({}, optForCache), { 1782 [o2.interpolationkey]: void 0 1783 }); 1784 } 1785 const key = l2 + JSON.stringify(optForCache); 1786 let frm = cache[key]; 1787 if (!frm) { 1788 frm = fn2(getCleanedCode(l2), o2); 1789 cache[key] = frm; 1790 } 1791 return frm(v2); 1792 }; 1793 }; 1794 const createNonCachedFormatter = (fn2) => (v2, l2, o2) => fn2(getCleanedCode(l2), o2)(v2); 1795 class Formatter { 1796 constructor(options2 = {}) { 1797 this.logger = baseLogger.create("formatter"); 1798 this.options = options2; 1799 this.init(options2); 1800 } 1801 init(services, options2 = { 1802 interpolation: {} 1803 }) { 1804 this.formatSeparator = options2.interpolation.formatSeparator || ","; 1805 const cf = options2.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter; 1806 this.formats = { 1807 number: cf((lng, opt) => { 1808 const formatter = new Intl.NumberFormat(lng, __spreadValues({}, opt)); 1809 return (val) => formatter.format(val); 1810 }), 1811 currency: cf((lng, opt) => { 1812 const formatter = new Intl.NumberFormat(lng, __spreadProps(__spreadValues({}, opt), { 1813 style: "currency" 1814 })); 1815 return (val) => formatter.format(val); 1816 }), 1817 datetime: cf((lng, opt) => { 1818 const formatter = new Intl.DateTimeFormat(lng, __spreadValues({}, opt)); 1819 return (val) => formatter.format(val); 1820 }), 1821 relativetime: cf((lng, opt) => { 1822 const formatter = new Intl.RelativeTimeFormat(lng, __spreadValues({}, opt)); 1823 return (val) => formatter.format(val, opt.range || "day"); 1824 }), 1825 list: cf((lng, opt) => { 1826 const formatter = new Intl.ListFormat(lng, __spreadValues({}, opt)); 1827 return (val) => formatter.format(val); 1828 }) 1829 }; 1830 } 1831 add(name, fc) { 1832 this.formats[name.toLowerCase().trim()] = fc; 1833 } 1834 addCached(name, fc) { 1835 this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc); 1836 } 1837 format(value, format, lng, options2 = {}) { 1838 const formats = format.split(this.formatSeparator); 1839 if (formats.length > 1 && formats[0].indexOf("(") > 1 && formats[0].indexOf(")") < 0 && formats.find((f2) => f2.indexOf(")") > -1)) { 1840 const lastIndex = formats.findIndex((f2) => f2.indexOf(")") > -1); 1841 formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator); 1842 } 1843 const result = formats.reduce((mem, f2) => { 1844 var _a; 1845 const { 1846 formatName, 1847 formatOptions 1848 } = parseFormatStr(f2); 1849 if (this.formats[formatName]) { 1850 let formatted = mem; 1851 try { 1852 const valOptions = ((_a = options2 == null ? void 0 : options2.formatParams) == null ? void 0 : _a[options2.interpolationkey]) || {}; 1853 const l2 = valOptions.locale || valOptions.lng || options2.locale || options2.lng || lng; 1854 formatted = this.formats[formatName](mem, l2, __spreadValues(__spreadValues(__spreadValues({}, formatOptions), options2), valOptions)); 1855 } catch (error) { 1856 this.logger.warn(error); 1857 } 1858 return formatted; 1859 } else { 1860 this.logger.warn(`there was no format function for ${formatName}`); 1861 } 1862 return mem; 1863 }, value); 1864 return result; 1865 } 1866 } 1867 const removePending = (q2, name) => { 1868 if (q2.pending[name] !== void 0) { 1869 delete q2.pending[name]; 1870 q2.pendingCount--; 1871 } 1872 };
1873 class Connector extends EventEmitter { 1874 constructor(backend, store, services, options2 = {}) { 1875 var _a, _b; 1876 super(); 1877 this.backend = backend; 1878 this.store = store; 1879 this.services = services; 1880 this.languageUtils = services.languageUtils; 1881 this.options = options2; 1882 this.logger = baseLogger.create("backendConnector"); 1883 this.waitingReads = []; 1884 this.maxParallelReads = options2.maxParallelReads || 10; 1885 this.readingCalls = 0; 1886 this.maxRetries = options2.maxRetries >= 0 ? options2.maxRetries : 5; 1887 this.retryTimeout = options2.retryTimeout >= 1 ? options2.retryTimeout : 350; 1888 this.state = {}; 1889 this.queue = []; 1890 (_b = (_a = this.backend) == null ? void 0 : _a.init) == null ? void 0 : _b.call(_a, services, options2.backend, options2); 1891 } 1892 queueLoad(languages, namespaces, options2, callback) { 1893 const toLoad = {}; 1894 const pending = {}; 1895 const toLoadLanguages = {}; 1896 const toLoadNamespaces = {};
1897 languages.forEach((lng) => { 1898 let hasAllNamespaces = true; 1899 namespaces.forEach((ns) => { 1900 const name = `${lng}|${ns}`; 1901 if (!options2.reload && this.store.hasResourceBundle(lng, ns)) { 1902 this.state[name] = 2; 1903 } else if (this.state[name] < 0) ; 1904 else if (this.state[name] === 1) { 1905 if (pending[name] === void 0) pending[name] = true; 1906 } else { 1907 this.state[name] = 1; 1908 hasAllNamespaces = false; 1909 if (pending[name] === void 0) pending[name] = true; 1910 if (toLoad[name] === void 0) toLoad[name] = true; 1911 if (toLoadNamespaces[ns] === void 0) toLoadNamespaces[ns] = true; 1912 } 1913 }); 1914 if (!hasAllNamespaces) toLoadLanguages[lng] = true; 1915 }); 1916 if (Object.keys(toLoad).length || Object.keys(pending).length) { 1917 this.queue.push({ 1918 pending, 1919 pendingCount: Object.keys(pending).length, 1920 loaded: {}, 1921 errors: [], 1922 callback 1923 }); 1924 } 1925 return { 1926 toLoad: Object.keys(toLoad), 1927 pending: Object.keys(pending), 1928 toLoadLanguages: Object.keys(toLoadLanguages), 1929 toLoadNamespaces: Object.keys(toLoadNamespaces) 1930 }; 1931 } 1932 loaded(name, err, data) { 1933 const s2 = name.split("|"); 1934 const lng = s2[0]; 1935 const ns = s2[1]; 1936 if (err) this.emit("failedLoading", lng, ns, err); 1937 if (!err && data) { 1938 this.store.addResourceBundle(lng, ns, data, void 0, void 0, { 1939 skipCopy: true 1940 }); 1941 } 1942 this.state[name] = err ? -1 : 2; 1943 if (err && data) this.state[name] = 0; 1944 const loaded = {}; 1945 this.queue.forEach((q2) => { 1946 pushPath(q2.loaded, [lng], ns); 1947 removePending(q2, name); 1948 if (err) q2.errors.push(err); 1949 if (q2.pendingCount === 0 && !q2.done) { 1950 Object.keys(q2.loaded).forEach((l2) => { 1951 if (!loaded[l2]) loaded[l2] = {}; 1952 const loadedKeys = q2.loaded[l2]; 1953 if (loadedKeys.length) { 1954 loadedKeys.forEach((n2) => { 1955 if (loaded[l2][n2] === void 0) loaded[l2][n2] = true; 1956 }); 1957 } 1958 }); 1959 q2.done = true; 1960 if (q2.errors.length) { 1961 q2.callback(q2.errors); 1962 } else { 1963 q2.callback(); 1964 } 1965 } 1966 }); 1967 this.emit("loaded", loaded); 1968 this.queue = this.queue.filter((q2) => !q2.done); 1969 } 1970 read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) { 1971 if (!lng.length) return callback(null, {}); 1972 if (this.readingCalls >= this.maxParallelReads) { 1973 this.waitingReads.push({ 1974 lng, 1975 ns, 1976 fcName, 1977 tried, 1978 wait, 1979 callback 1980 }); 1981 return; 1982 } 1983 this.readingCalls++; 1984 const resolver = (err, data) => { 1985 this.readingCalls--; 1986 if (this.waitingReads.length > 0) { 1987 const next2 = this.waitingReads.shift(); 1988 this.read(next2.lng, next2.ns, next2.fcName, next2.tried, next2.wait, next2.callback); 1989 } 1990 if (err && data && tried < this.maxRetries) { 1991 setTimeout(() => { 1992 this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback); 1993 }, wait); 1994 return; 1995 } 1996 callback(err, data); 1997 }; 1998 const fc = this.backend[fcName].bind(this.backend); 1999 if (fc.length === 2) { 2000 try { 2001 const r2 = fc(lng, ns); 2002 if (r2 && typeof r2.then === "function") { 2003 r2.then((data) => resolver(null, data)).catch(resolver); 2004 } else { 2005 resolver(null, r2); 2006 } 2007 } catch (err) { 2008 resolver(err); 2009 } 2010 return; 2011 } 2012 return fc(lng, ns, resolver); 2013 } 2014 prepareLoading(languages, namespaces, options2 = {}, callback) { 2015 if (!this.backend) { 2016 this.logger.warn("No backend was added via i18next.use. Will not load resources."); 2017 return callback && callback(); 2018 }
2019 if (isString$4(languages)) languages = this.languageUtils.toResolveHierarchy(languages); 2020 if (isString$4(namespaces)) namespaces = [namespaces]; 2021 const toLoad = this.queueLoad(languages, namespaces, options2, callback); 2022 if (!toLoad.toLoad.length) { 2023 if (!toLoad.pending.length) callback(); 2024 return null; 2025 } 2026 toLoad.toLoad.forEach((name) => { 2027 this.loadOne(name); 2028 }); 2029 } 2030 load(languages, namespaces, callback) { 2031 this.prepareLoading(languages, namespaces, {}, callback); 2032 } 2033 reload(languages, namespaces, callback) { 2034 this.prepareLoading(languages, namespaces, { 2035 reload: true 2036 }, callback); 2037 } 2038 loadOne(name, prefix2 = "") { 2039 const s2 = name.split("|"); 2040 const lng = s2[0]; 2041 const ns = s2[1]; 2042 this.read(lng, ns, "read", void 0, void 0, (err, data) => { 2043 if (err) this.logger.warn(`${prefix2}loading namespace ${ns} for language ${lng} failed`, err); 2044 if (!err && data) this.logger.log(`${prefix2}loaded namespace ${ns} for language ${lng}`, data); 2045 this.loaded(name, err, data); 2046 }); 2047 } 2048 saveMissing(languages, namespace, key, fallbackValue, isUpdate, options2 = {}, clb = () => { 2049 }) { 2050 var _a, _b, _c, _d, _e2; 2051 if (((_b = (_a = this.services) == null ? void 0 : _a.utils) == null ? void 0 : _b.hasLoadedNamespace) && !((_d = (_c = this.services) == null ? void 0 : _c.utils) == null ? void 0 : _d.hasLoadedNamespace(namespace))) { 2052 this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"); 2053 return; 2054 } 2055 if (key === void 0 || key === null || key === "") return; 2056 if ((_e2 = this.backend) == null ? void 0 : _e2.create) { 2057 const opts = __spreadProps(__spreadValues({}, options2), { 2058 isUpdate 2059 }); 2060 const fc = this.backend.create.bind(this.backend); 2061 if (fc.length < 6) { 2062 try { 2063 let r2; 2064 if (fc.length === 5) { 2065 r2 = fc(languages, namespace, key, fallbackValue, opts); 2066 } else { 2067 r2 = fc(languages, namespace, key, fallbackValue); 2068 } 2069 if (r2 && typeof r2.then === "function") { 2070 r2.then((data) => clb(null, data)).catch(clb); 2071 } else { 2072 clb(null, r2); 2073 } 2074 } catch (err) { 2075 clb(err); 2076 } 2077 } else { 2078 fc(languages, namespace, key, fallbackValue, clb, opts); 2079 } 2080 } 2081 if (!languages || !languages[0]) return; 2082 this.store.addResource(languages[0], namespace, key, fallbackValue); 2083 } 2084 } 2085 const get$1 = () => ({ 2086 debug: false, 2087 initAsync: true, 2088 ns: ["translation"], 2089 defaultNS: ["translation"], 2090 fallbackLng: ["dev"], 2091 fallbackNS: false, 2092 supportedLngs: false, 2093 nonExplicitSupportedLngs: false, 2094 load: "all", 2095 preload: false, 2096 simplifyPluralSuffix: true, 2097 keySeparator: ".", 2098 nsSeparator: ":", 2099 pluralSeparator: "_", 2100 contextSeparator: "_", 2101 partialBundledLanguages: false, 2102 saveMissing: false, 2103 updateMissing: false, 2104 saveMissingTo: "fallback", 2105 saveMissingPlurals: true, 2106 missingKeyHandler: false, 2107 missingInterpolationHandler: false, 2108 postProcess: false, 2109 postProcessPassResolved: false, 2110 returnNull: false, 2111 returnEmptyString: true, 2112 returnObjects: false, 2113 joinArrays: false, 2114 returnedObjectHandler: false, 2115 parseMissingKeyHandler: false, 2116 appendNamespaceToMissingKey: false, 2117 appendNamespaceToCIMode: false, 2118 overloadTranslationOptionHandler: (args) => { 2119 let ret = {}; 2120 if (typeof args[1] === "object") ret = args[1]; 2121 if (isString$4(args[1])) ret.defaultValue = args[1]; 2122 if (isString$4(args[2])) ret.tDescription = args[2]; 2123 if (typeof args[2] === "object" || typeof args[3] === "object") { 2124 const options2 = args[3] || args[2]; 2125 Object.keys(options2).forEach((key) => { 2126 ret[key] = options2[key]; 2127 }); 2128 } 2129 return ret; 2130 }, 2131 interpolation: { 2132 escapeValue: true, 2133 format: (value) => value, 2134 prefix: "{{", 2135 suffix: "}}", 2136 formatSeparator: ",", 2137 unescapePrefix: "-", 2138 nestingPrefix: "$t(", 2139 nestingSuffix: ")", 2140 nestingOptionsSeparator: ",", 2141 maxReplaces: 1e3, 2142 skipOnVariables: true 2143 }, 2144 cacheInBuiltFormats: true 2145 }); 2146 const transformOptions = (options2) => { 2147 var _a, _b; 2148 if (isString$4(options2.ns)) options2.ns = [options2.ns]; 2149 if (isString$4(options2.fallbackLng)) options2.fallbackLng = [options2.fallbackLng]; 2150 if (isString$4(options2.fallbackNS)) options2.fallbackNS = [options2.fallbackNS]; 2151 if (((_b = (_a = options2.supportedLngs) == null ? void 0 : _a.indexOf) == null ? void 0 : _b.call(_a, "cimode")) < 0) { 2152 options2.supportedLngs = options2.supportedLngs.concat(["cimode"]); 2153 } 2154 if (typeof options2.initImmediate === "boolean") options2.initAsync = options2.initImmediate; 2155 return options2; 2156 }; 2157 const noop$8 = () => { 2158 }; 2159 const bindMemberFunctions = (inst) => { 2160 const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
vendor: 4,151 bytes, lines 2161-2253
2161 mems.forEach((mem) => { 2162 if (typeof inst[mem] === "function") { 2163 inst[mem] = inst[mem].bind(inst); 2164 } 2165 }); 2166 }; 2167 class I18n extends EventEmitter { 2168 constructor(options2 = {}, callback) { 2169 super(); 2170 this.options = transformOptions(options2); 2171 this.services = {}; 2172 this.logger = baseLogger; 2173 this.modules = { 2174 external: [] 2175 }; 2176 bindMemberFunctions(this); 2177 if (callback && !this.isInitialized && !options2.isClone) { 2178 if (!this.options.initAsync) { 2179 this.init(options2, callback); 2180 return this; 2181 } 2182 setTimeout(() => { 2183 this.init(options2, callback); 2184 }, 0); 2185 } 2186 } 2187 init(options2 = {}, callback) { 2188 this.isInitializing = true; 2189 if (typeof options2 === "function") { 2190 callback = options2; 2191 options2 = {}; 2192 } 2193 if (options2.defaultNS == null && options2.ns) { 2194 if (isString$4(options2.ns)) { 2195 options2.defaultNS = options2.ns; 2196 } else if (options2.ns.indexOf("translation") < 0) { 2197 options2.defaultNS = options2.ns[0]; 2198 } 2199 } 2200 const defOpts = get$1(); 2201 this.options = __spreadValues(__spreadValues(__spreadValues({}, defOpts), this.options), transformOptions(options2)); 2202 this.options.interpolation = __spreadValues(__spreadValues({}, defOpts.interpolation), this.options.interpolation); 2203 if (options2.keySeparator !== void 0) { 2204 this.options.userDefinedKeySeparator = options2.keySeparator; 2205 } 2206 if (options2.nsSeparator !== void 0) { 2207 this.options.userDefinedNsSeparator = options2.nsSeparator; 2208 } 2209 if (typeof this.options.overloadTranslationOptionHandler !== "function") { 2210 this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler; 2211 } 2212 const createClassOnDemand = (ClassOrObject) => { 2213 if (!ClassOrObject) return null; 2214 if (typeof ClassOrObject === "function") return new ClassOrObject(); 2215 return ClassOrObject; 2216 }; 2217 if (!this.options.isClone) { 2218 if (this.modules.logger) { 2219 baseLogger.init(createClassOnDemand(this.modules.logger), this.options); 2220 } else { 2221 baseLogger.init(null, this.options); 2222 } 2223 let formatter; 2224 if (this.modules.formatter) { 2225 formatter = this.modules.formatter; 2226 } else { 2227 formatter = Formatter; 2228 } 2229 const lu = new LanguageUtil(this.options); 2230 this.store = new ResourceStore(this.options.resources, this.options); 2231 const s2 = this.services; 2232 s2.logger = baseLogger; 2233 s2.resourceStore = this.store; 2234 s2.languageUtils = lu; 2235 s2.pluralResolver = new PluralResolver(lu, { 2236 prepend: this.options.pluralSeparator, 2237 simplifyPluralSuffix: this.options.simplifyPluralSuffix 2238 }); 2239 const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format; 2240 if (usingLegacyFormatFunction) { 2241 this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`); 2242 } 2243 if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) { 2244 s2.formatter = createClassOnDemand(formatter); 2245 if (s2.formatter.init) s2.formatter.init(s2, this.options); 2246 this.options.interpolation.format = s2.formatter.format.bind(s2.formatter); 2247 } 2248 s2.interpolator = new Interpolator(this.options); 2249 s2.utils = { 2250 hasLoadedNamespace: this.hasLoadedNamespace.bind(this) 2251 }; 2252 s2.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s2.resourceStore, s2, this.options); 2253 s2.backendConnector.on("*", (event, ...args) => {
vendor: 6,720 bytes, lines 2254-2408
2254 this.emit(event, ...args); 2255 }); 2256 if (this.modules.languageDetector) { 2257 s2.languageDetector = createClassOnDemand(this.modules.languageDetector); 2258 if (s2.languageDetector.init) s2.languageDetector.init(s2, this.options.detection, this.options); 2259 } 2260 if (this.modules.i18nFormat) { 2261 s2.i18nFormat = createClassOnDemand(this.modules.i18nFormat); 2262 if (s2.i18nFormat.init) s2.i18nFormat.init(this); 2263 } 2264 this.translator = new Translator(this.services, this.options); 2265 this.translator.on("*", (event, ...args) => { 2266 this.emit(event, ...args); 2267 }); 2268 this.modules.external.forEach((m2) => { 2269 if (m2.init) m2.init(this); 2270 }); 2271 } 2272 this.format = this.options.interpolation.format; 2273 if (!callback) callback = noop$8; 2274 if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) { 2275 const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); 2276 if (codes.length > 0 && codes[0] !== "dev") this.options.lng = codes[0]; 2277 } 2278 if (!this.services.languageDetector && !this.options.lng) { 2279 this.logger.warn("init: no languageDetector is used and no lng is defined"); 2280 } 2281 const storeApi = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"]; 2282 storeApi.forEach((fcName) => { 2283 this[fcName] = (...args) => this.store[fcName](...args); 2284 }); 2285 const storeApiChained = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"]; 2286 storeApiChained.forEach((fcName) => { 2287 this[fcName] = (...args) => { 2288 this.store[fcName](...args); 2289 return this; 2290 }; 2291 }); 2292 const deferred = defer(); 2293 const load = () => { 2294 const finish = (err, t2) => { 2295 this.isInitializing = false; 2296 if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn("init: i18next is already initialized. You should call init just once!"); 2297 this.isInitialized = true; 2298 if (!this.options.isClone) this.logger.log("initialized", this.options); 2299 this.emit("initialized", this.options); 2300 deferred.resolve(t2); 2301 callback(err, t2); 2302 }; 2303 if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this)); 2304 this.changeLanguage(this.options.lng, finish); 2305 }; 2306 if (this.options.resources || !this.options.initAsync) { 2307 load(); 2308 } else { 2309 setTimeout(load, 0); 2310 } 2311 return deferred; 2312 } 2313 loadResources(language, callback = noop$8) { 2314 var _a, _b; 2315 let usedCallback = callback; 2316 const usedLng = isString$4(language) ? language : this.language; 2317 if (typeof language === "function") usedCallback = language; 2318 if (!this.options.resources || this.options.partialBundledLanguages) { 2319 if ((usedLng == null ? void 0 : usedLng.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback(); 2320 const toLoad = []; 2321 const append2 = (lng) => { 2322 if (!lng) return; 2323 if (lng === "cimode") return; 2324 const lngs = this.services.languageUtils.toResolveHierarchy(lng); 2325 lngs.forEach((l2) => { 2326 if (l2 === "cimode") return; 2327 if (toLoad.indexOf(l2) < 0) toLoad.push(l2); 2328 }); 2329 }; 2330 if (!usedLng) { 2331 const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); 2332 fallbacks.forEach((l2) => append2(l2)); 2333 } else { 2334 append2(usedLng); 2335 } 2336 (_b = (_a = this.options.preload) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (l2) => append2(l2)); 2337 this.services.backendConnector.load(toLoad, this.options.ns, (e2) => { 2338 if (!e2 && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language); 2339 usedCallback(e2); 2340 }); 2341 } else { 2342 usedCallback(null); 2343 } 2344 } 2345 reloadResources(lngs, ns, callback) { 2346 const deferred = defer(); 2347 if (typeof lngs === "function") { 2348 callback = lngs; 2349 lngs = void 0; 2350 } 2351 if (typeof ns === "function") { 2352 callback = ns; 2353 ns = void 0; 2354 } 2355 if (!lngs) lngs = this.languages; 2356 if (!ns) ns = this.options.ns; 2357 if (!callback) callback = noop$8; 2358 this.services.backendConnector.reload(lngs, ns, (err) => { 2359 deferred.resolve(); 2360 callback(err); 2361 }); 2362 return deferred; 2363 } 2364 use(module2) { 2365 if (!module2) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()"); 2366 if (!module2.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()"); 2367 if (module2.type === "backend") { 2368 this.modules.backend = module2; 2369 } 2370 if (module2.type === "logger" || module2.log && module2.warn && module2.error) { 2371 this.modules.logger = module2; 2372 } 2373 if (module2.type === "languageDetector") { 2374 this.modules.languageDetector = module2; 2375 } 2376 if (module2.type === "i18nFormat") { 2377 this.modules.i18nFormat = module2; 2378 } 2379 if (module2.type === "postProcessor") { 2380 postProcessor.addPostProcessor(module2); 2381 } 2382 if (module2.type === "formatter") { 2383 this.modules.formatter = module2; 2384 } 2385 if (module2.type === "3rdParty") { 2386 this.modules.external.push(module2); 2387 } 2388 return this; 2389 } 2390 setResolvedLanguage(l2) { 2391 if (!l2 || !this.languages) return; 2392 if (["cimode", "dev"].indexOf(l2) > -1) return; 2393 for (let li2 = 0; li2 < this.languages.length; li2++) { 2394 const lngInLngs = this.languages[li2]; 2395 if (["cimode", "dev"].indexOf(lngInLngs) > -1) continue; 2396 if (this.store.hasLanguageSomeTranslations(lngInLngs)) { 2397 this.resolvedLanguage = lngInLngs; 2398 break; 2399 } 2400 } 2401 if (!this.resolvedLanguage && this.languages.indexOf(l2) < 0 && this.store.hasLanguageSomeTranslations(l2)) { 2402 this.resolvedLanguage = l2; 2403 this.languages.unshift(l2); 2404 } 2405 } 2406 changeLanguage(lng, callback) { 2407 this.isLanguageChangingTo = lng; 2408 const deferred = defer();
2409 this.emit("languageChanging", lng); 2410 const setLngProps = (l2) => { 2411 this.language = l2; 2412 this.languages = this.services.languageUtils.toResolveHierarchy(l2); 2413 this.resolvedLanguage = void 0; 2414 this.setResolvedLanguage(l2); 2415 }; 2416 const done = (err, l2) => { 2417 if (l2) { 2418 if (this.isLanguageChangingTo === lng) { 2419 setLngProps(l2); 2420 this.translator.changeLanguage(l2); 2421 this.isLanguageChangingTo = void 0; 2422 this.emit("languageChanged", l2); 2423 this.logger.log("languageChanged", l2); 2424 } 2425 } else { 2426 this.isLanguageChangingTo = void 0; 2427 } 2428 deferred.resolve((...args) => this.t(...args)); 2429 if (callback) callback(err, (...args) => this.t(...args)); 2430 }; 2431 const setLng = (lngs) => { 2432 var _a, _b; 2433 if (!lng && !lngs && this.services.languageDetector) lngs = []; 2434 const fl = isString$4(lngs) ? lngs : lngs && lngs[0]; 2435 const l2 = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString$4(lngs) ? [lngs] : lngs); 2436 if (l2) { 2437 if (!this.language) { 2438 setLngProps(l2); 2439 } 2440 if (!this.translator.language) this.translator.changeLanguage(l2); 2441 (_b = (_a = this.services.languageDetector) == null ? void 0 : _a.cacheUserLanguage) == null ? void 0 : _b.call(_a, l2); 2442 } 2443 this.loadResources(l2, (err) => { 2444 done(err, l2); 2445 }); 2446 }; 2447 if (!lng && this.services.languageDetector && !this.services.languageDetector.async) { 2448 setLng(this.services.languageDetector.detect()); 2449 } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) { 2450 if (this.services.languageDetector.detect.length === 0) { 2451 this.services.languageDetector.detect().then(setLng); 2452 } else { 2453 this.services.languageDetector.detect(setLng); 2454 } 2455 } else { 2456 setLng(lng); 2457 } 2458 return deferred; 2459 } 2460 getFixedT(lng, ns, keyPrefix) { 2461 const fixedT = (key, opts, ...rest) => { 2462 let o2; 2463 if (typeof opts !== "object") { 2464 o2 = this.options.overloadTranslationOptionHandler([key, opts].concat(rest)); 2465 } else { 2466 o2 = __spreadValues({}, opts); 2467 } 2468 o2.lng = o2.lng || fixedT.lng; 2469 o2.lngs = o2.lngs || fixedT.lngs; 2470 o2.ns = o2.ns || fixedT.ns; 2471 if (o2.keyPrefix !== "") o2.keyPrefix = o2.keyPrefix || keyPrefix || fixedT.keyPrefix; 2472 const keySeparator = this.options.keySeparator || "."; 2473 let resultKey; 2474 if (o2.keyPrefix && Array.isArray(key)) { 2475 resultKey = key.map((k2) => { 2476 if (typeof k2 === "function") k2 = keysFromSelector(k2, __spreadValues(__spreadValues({}, this.options), opts)); 2477 return `${o2.keyPrefix}${keySeparator}${k2}`; 2478 }); 2479 } else { 2480 if (typeof key === "function") key = keysFromSelector(key, __spreadValues(__spreadValues({}, this.options), opts)); 2481 resultKey = o2.keyPrefix ? `${o2.keyPrefix}${keySeparator}${key}` : key; 2482 } 2483 return this.t(resultKey, o2); 2484 }; 2485 if (isString$4(lng)) { 2486 fixedT.lng = lng; 2487 } else { 2488 fixedT.lngs = lng; 2489 } 2490 fixedT.ns = ns; 2491 fixedT.keyPrefix = keyPrefix; 2492 return fixedT; 2493 } 2494 t(...args) { 2495 var _a; 2496 return (_a = this.translator) == null ? void 0 : _a.translate(...args); 2497 } 2498 exists(...args) { 2499 var _a; 2500 return (_a = this.translator) == null ? void 0 : _a.exists(...args); 2501 } 2502 setDefaultNamespace(ns) { 2503 this.options.defaultNS = ns; 2504 } 2505 hasLoadedNamespace(ns, options2 = {}) { 2506 if (!this.isInitialized) { 2507 this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages); 2508 return false;
2509 } 2510 if (!this.languages || !this.languages.length) { 2511 this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages); 2512 return false; 2513 } 2514 const lng = options2.lng || this.resolvedLanguage || this.languages[0]; 2515 const fallbackLng = this.options ? this.options.fallbackLng : false; 2516 const lastLng = this.languages[this.languages.length - 1]; 2517 if (lng.toLowerCase() === "cimode") return true; 2518 const loadNotPending = (l2, n2) => { 2519 const loadState = this.services.backendConnector.state[`${l2}|${n2}`]; 2520 return loadState === -1 || loadState === 0 || loadState === 2; 2521 }; 2522 if (options2.precheck) { 2523 const preResult = options2.precheck(this, loadNotPending); 2524 if (preResult !== void 0) return preResult; 2525 } 2526 if (this.hasResourceBundle(lng, ns)) return true; 2527 if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true; 2528 if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true; 2529 return false; 2530 } 2531 loadNamespaces(ns, callback) { 2532 const deferred = defer(); 2533 if (!this.options.ns) { 2534 if (callback) callback(); 2535 return Promise.resolve(); 2536 } 2537 if (isString$4(ns)) ns = [ns]; 2538 ns.forEach((n2) => { 2539 if (this.options.ns.indexOf(n2) < 0) this.options.ns.push(n2); 2540 }); 2541 this.loadResources((err) => { 2542 deferred.resolve(); 2543 if (callback) callback(err); 2544 }); 2545 return deferred; 2546 } 2547 loadLanguages(lngs, callback) { 2548 const deferred = defer(); 2549 if (isString$4(lngs)) lngs = [lngs]; 2550 const preloaded = this.options.preload || []; 2551 const newLngs = lngs.filter((lng) => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng)); 2552 if (!newLngs.length) { 2553 if (callback) callback(); 2554 return Promise.resolve(); 2555 } 2556 this.options.preload = preloaded.concat(newLngs); 2557 this.loadResources((err) => { 2558 deferred.resolve(); 2559 if (callback) callback(err); 2560 }); 2561 return deferred; 2562 } 2563 dir(lng) { 2564 var _a, _b; 2565 if (!lng) lng = this.resolvedLanguage || (((_a = this.languages) == null ? void 0 : _a.length) > 0 ? this.languages[0] : this.language); 2566 if (!lng) return "rtl"; 2567 try { 2568 const l2 = new Intl.Locale(lng); 2569 if (l2 && l2.getTextInfo) { 2570 const ti2 = l2.getTextInfo(); 2571 if (ti2 && ti2.direction) return ti2.direction; 2572 } 2573 } catch (e2) { 2574 } 2575 const rtlLngs = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"]; 2576 const languageUtils = ((_b = this.services) == null ? void 0 : _b.languageUtils) || new LanguageUtil(get$1()); 2577 if (lng.toLowerCase().indexOf("-latn") > 1) return "ltr"; 2578 return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr"; 2579 } 2580 static createInstance(options2 = {}, callback) { 2581 const instance2 = new I18n(options2, callback); 2582 instance2.createInstance = I18n.createInstance; 2583 return instance2; 2584 } 2585 cloneInstance(options2 = {}, callback = noop$8) { 2586 const forkResourceStore = options2.forkResourceStore; 2587 if (forkResourceStore) delete options2.forkResourceStore; 2588 const mergedOptions = __spreadValues(__spreadValues(__spreadValues({}, this.options), options2), { 2589 isClone: true 2590 }); 2591 const clone2 = new I18n(mergedOptions); 2592 if (options2.debug !== void 0 || options2.prefix !== void 0) { 2593 clone2.logger = clone2.logger.clone(options2); 2594 } 2595 const membersToCopy = ["store", "services", "language"]; 2596 membersToCopy.forEach((m2) => { 2597 clone2[m2] = this[m2]; 2598 }); 2599 clone2.services = __spreadValues({}, this.services); 2600 clone2.services.utils = { 2601 hasLoadedNamespace: clone2.hasLoadedNamespace.bind(clone2) 2602 }; 2603 if (forkResourceStore) { 2604 const clonedData = Object.keys(this.store.data).reduce((prev2, l2) => { 2605 prev2[l2] = __spreadValues({}, this.store.data[l2]); 2606 prev2[l2] = Object.keys(prev2[l2]).reduce((acc, n2) => { 2607 acc[n2] = __spreadValues({}, prev2[l2][n2]); 2608 return acc; 2609 }, prev2[l2]); 2610 return prev2; 2611 }, {}); 2612 clone2.store = new ResourceStore(clonedData, mergedOptions); 2613 clone2.services.resourceStore = clone2.store; 2614 } 2615 if (options2.interpolation) clone2.services.interpolator = new Interpolator(mergedOptions); 2616 clone2.translator = new Translator(clone2.services, mergedOptions); 2617 clone2.translator.on("*", (event, ...args) => { 2618 clone2.emit(event, ...args); 2619 }); 2620 clone2.init(mergedOptions, callback); 2621 clone2.translator.options = mergedOptions; 2622 clone2.translator.backendConnector.services.utils = { 2623 hasLoadedNamespace: clone2.hasLoadedNamespace.bind(clone2) 2624 }; 2625 return clone2; 2626 } 2627 toJSON() { 2628 return { 2629 options: this.options, 2630 store: this.store, 2631 language: this.language, 2632 languages: this.languages, 2633 resolvedLanguage: this.resolvedLanguage 2634 }; 2635 } 2636 } 2637 const instance = I18n.createInstance(); 2638 instance.createInstance; 2639 instance.dir; 2640 instance.init; 2641 instance.loadResources; 2642 instance.reloadResources; 2643 instance.use; 2644 instance.changeLanguage; 2645 instance.getFixedT; 2646 instance.t; 2647 instance.exists; 2648 instance.setDefaultNamespace; 2649 instance.hasLoadedNamespace; 2650 instance.loadNamespaces; 2651 instance.loadLanguages; 2652 var reactExports = requireReact(); 2653 const e$3 = /* @__PURE__ */ getDefaultExportFromCjs(reactExports); 2654 const React = /* @__PURE__ */ _mergeNamespaces({ 2655 __proto__: null, 2656 default: e$3 2657 }, [reactExports]); 2658 var voidElements; 2659 var hasRequiredVoidElements; 2660 function requireVoidElements() { 2661 if (hasRequiredVoidElements) return voidElements; 2662 hasRequiredVoidElements = 1; 2663 voidElements = { 2664 "area": true, 2665 "base": true, 2666 "br": true, 2667 "col": true, 2668 "embed": true, 2669 "hr": true, 2670 "img": true, 2671 "input": true, 2672 "link": true, 2673 "meta": true, 2674 "param": true, 2675 "source": true, 2676 "track": true, 2677 "wbr": true 2678 }; 2679 return voidElements; 2680 } 2681 var voidElementsExports = requireVoidElements(); 2682 const e$2 = /* @__PURE__ */ getDefaultExportFromCjs(voidElementsExports); 2683 var t$2 = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g; 2684 function n$2(n2) { 2685 var r2 = { type: "tag", name: "", voidElement: false, attrs: {}, children: [] }, i2 = n2.match(/<\/?([^\s]+?)[/\s>]/); 2686 if (i2 && (r2.name = i2[1], (e$2[i2[1]] || "/" === n2.charAt(n2.length - 2)) && (r2.voidElement = true), r2.name.startsWith("!--"))) { 2687 var s2 = n2.indexOf("-->"); 2688 return { type: "comment", comment: -1 !== s2 ? n2.slice(4, s2) : "" }; 2689 } 2690 for (var a2 = new RegExp(t$2), c2 = null; null !== (c2 = a2.exec(n2)); ) if (c2[0].trim()) if (c2[1]) { 2691 var o2 = c2[1].trim(), l2 = [o2, ""]; 2692 o2.indexOf("=") > -1 && (l2 = o2.split("=")), r2.attrs[l2[0]] = l2[1], a2.lastIndex--; 2693 } else c2[2] && (r2.attrs[c2[2]] = c2[3].trim().substring(1, c2[3].length - 1)); 2694 return r2; 2695 } 2696 var r$2 = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, i$2 = /^\s*$/, s$5 = /* @__PURE__ */ Object.create(null); 2697 function a$1(e2, t2) { 2698 switch (t2.type) { 2699 case "text": 2700 return e2 + t2.content; 2701 case "tag": 2702 return e2 += "<" + t2.name + (t2.attrs ? (function(e3) { 2703 var t3 = []; 2704 for (var n2 in e3) t3.push(n2 + '="' + e3[n2] + '"'); 2705 return t3.length ? " " + t3.join(" ") : ""; 2706 })(t2.attrs) : "") + (t2.voidElement ? "/>" : ">"), t2.voidElement ? e2 : e2 + t2.children.reduce(a$1, "") + "</" + t2.name + ">"; 2707 case "comment": 2708 return e2 + "<!--" + t2.comment + "-->"; 2709 } 2710 } 2711 var c$5 = { parse: function(e2, t2) { 2712 t2 || (t2 = {}), t2.components || (t2.components = s$5); 2713 var a2, c2 = [], o2 = [], l2 = -1, m2 = false;
2714 if (0 !== e2.indexOf("<")) { 2715 var u2 = e2.indexOf("<"); 2716 c2.push({ type: "text", content: -1 === u2 ? e2 : e2.substring(0, u2) }); 2717 } 2718 return e2.replace(r$2, function(r2, s2) { 2719 if (m2) { 2720 if (r2 !== "</" + a2.name + ">") return; 2721 m2 = false; 2722 } 2723 var u3, f2 = "/" !== r2.charAt(1), h2 = r2.startsWith("<!--"), p2 = s2 + r2.length, d2 = e2.charAt(p2); 2724 if (h2) { 2725 var v2 = n$2(r2); 2726 return l2 < 0 ? (c2.push(v2), c2) : ((u3 = o2[l2]).children.push(v2), c2); 2727 } 2728 if (f2 && (l2++, "tag" === (a2 = n$2(r2)).type && t2.components[a2.name] && (a2.type = "component", m2 = true), a2.voidElement || m2 || !d2 || "<" === d2 || a2.children.push({ type: "text", content: e2.slice(p2, e2.indexOf("<", p2)) }), 0 === l2 && c2.push(a2), (u3 = o2[l2 - 1]) && u3.children.push(a2), o2[l2] = a2), (!f2 || a2.voidElement) && (l2 > -1 && (a2.voidElement || a2.name === r2.slice(2, -1)) && (l2--, a2 = -1 === l2 ? c2 : o2[l2]), !m2 && "<" !== d2 && d2)) { 2729 u3 = -1 === l2 ? c2 : o2[l2].children; 2730 var x2 = e2.indexOf("<", p2), g2 = e2.slice(p2, -1 === x2 ? void 0 : x2); 2731 i$2.test(g2) && (g2 = " "), (x2 > -1 && l2 + u3.length >= 0 || " " !== g2) && u3.push({ type: "text", content: g2 }); 2732 } 2733 }), c2; 2734 }, stringify: function(e2) { 2735 return e2.reduce(function(e3, t2) { 2736 return e3 + a$1("", t2); 2737 }, ""); 2738 } }; 2739 const warn$2 = (i18n, code, msg, rest) => { 2740 var _a, _b, _c, _d; 2741 const args = [msg, __spreadValues({ 2742 code 2743 }, rest || {})]; 2744 if ((_b = (_a = i18n == null ? void 0 : i18n.services) == null ? void 0 : _a.logger) == null ? void 0 : _b.forward) { 2745 return i18n.services.logger.forward(args, "warn", "react-i18next::", true); 2746 } 2747 if (isString$3(args[0])) args[0] = `react-i18next:: ${args[0]}`; 2748 if ((_d = (_c = i18n == null ? void 0 : i18n.services) == null ? void 0 : _c.logger) == null ? void 0 : _d.warn) { 2749 i18n.services.logger.warn(...args); 2750 } else if (console == null ? void 0 : console.warn) { 2751 console.warn(...args); 2752 } 2753 }; 2754 const alreadyWarned = {}; 2755 const warnOnce = (i18n, code, msg, rest) => { 2756 if (isString$3(msg) && alreadyWarned[msg]) return; 2757 if (isString$3(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date(); 2758 warn$2(i18n, code, msg, rest); 2759 }; 2760 const loadedClb = (i18n, cb) => () => { 2761 if (i18n.isInitialized) { 2762 cb(); 2763 } else { 2764 const initialized = () => { 2765 setTimeout(() => { 2766 i18n.off("initialized", initialized); 2767 }, 0); 2768 cb(); 2769 }; 2770 i18n.on("initialized", initialized); 2771 } 2772 }; 2773 const loadNamespaces = (i18n, ns, cb) => { 2774 i18n.loadNamespaces(ns, loadedClb(i18n, cb)); 2775 }; 2776 const loadLanguages = (i18n, lng, ns, cb) => { 2777 if (isString$3(ns)) ns = [ns]; 2778 if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb); 2779 ns.forEach((n2) => { 2780 if (i18n.options.ns.indexOf(n2) < 0) i18n.options.ns.push(n2); 2781 }); 2782 i18n.loadLanguages(lng, loadedClb(i18n, cb)); 2783 }; 2784 const hasLoadedNamespace = (ns, i18n, options2 = {}) => { 2785 if (!i18n.languages || !i18n.languages.length) { 2786 warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", { 2787 languages: i18n.languages 2788 }); 2789 return true; 2790 } 2791 return i18n.hasLoadedNamespace(ns, { 2792 lng: options2.lng, 2793 precheck: (i18nInstance2, loadNotPending) => { 2794 if (options2.bindI18n && options2.bindI18n.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false; 2795 } 2796 }); 2797 }; 2798 const isString$3 = (obj) => typeof obj === "string"; 2799 const isObject$5 = (obj) => typeof obj === "object" && obj !== null; 2800 const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g; 2801 const htmlEntities = { 2802 "&": "&", 2803 "&": "&", 2804 "<": "<", 2805 "<": "<", 2806 ">": ">", 2807 ">": ">", 2808 "'": "'", 2809 "'": "'", 2810 """: '"', 2811 """: '"', 2812 " ": " ", 2813 " ": " ", 2814 "©": "©", 2815 "©": "©", 2816 "®": "®", 2817 "®": "®", 2818 "…": "â¦", 2819 "…": "â¦", 2820 "/": "/", 2821 "/": "/" 2822 }; 2823 const unescapeHtmlEntity = (m2) => htmlEntities[m2]; 2824 const unescape$1 = (text2) => text2.replace(matchHtmlEntity, unescapeHtmlEntity); 2825 let defaultOptions = { 2826 bindI18n: "languageChanged", 2827 bindI18nStore: "", 2828 transEmptyNodeValue: "", 2829 transSupportBasicHtmlNodes: true, 2830 transWrapTextNodes: "", 2831 transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"], 2832 useSuspense: true, 2833 unescape: unescape$1 2834 }; 2835 const setDefaults = (options2 = {}) => { 2836 defaultOptions = __spreadValues(__spreadValues({}, defaultOptions), options2); 2837 }; 2838 const getDefaults = () => defaultOptions; 2839 let i18nInstance; 2840 const setI18n = (instance2) => { 2841 i18nInstance = instance2; 2842 }; 2843 const getI18n = () => i18nInstance; 2844 const hasChildren = (node2, checkLength) => { 2845 var _a, _b; 2846 if (!node2) return false;
2847 const base = (_b = (_a = node2.props) == null ? void 0 : _a.children) != null ? _b : node2.children; 2848 if (checkLength) return base.length > 0; 2849 return !!base; 2850 }; 2851 const getChildren = (node2) => { 2852 var _a, _b, _c; 2853 if (!node2) return []; 2854 const children = (_b = (_a = node2.props) == null ? void 0 : _a.children) != null ? _b : node2.children; 2855 return ((_c = node2.props) == null ? void 0 : _c.i18nIsDynamicList) ? getAsArray(children) : children; 2856 }; 2857 const hasValidReactChildren = (children) => Array.isArray(children) && children.every(reactExports.isValidElement); 2858 const getAsArray = (data) => Array.isArray(data) ? data : [data]; 2859 const mergeProps$1 = (source, target) => { 2860 const newTarget = __spreadValues({}, target); 2861 newTarget.props = Object.assign(source.props, target.props); 2862 return newTarget; 2863 }; 2864 const getValuesFromChildren = (children) => { 2865 const values = {}; 2866 if (!children) return values; 2867 const getData = (childs) => { 2868 const childrenArray = getAsArray(childs); 2869 childrenArray.forEach((child) => { 2870 if (isString$3(child)) return; 2871 if (hasChildren(child)) getData(getChildren(child)); 2872 else if (isObject$5(child) && !reactExports.isValidElement(child)) Object.assign(values, child); 2873 }); 2874 }; 2875 getData(children); 2876 return values; 2877 }; 2878 const nodesToString = (children, i18nOptions, i18n, i18nKey) => { 2879 var _a; 2880 if (!children) return ""; 2881 let stringNode = ""; 2882 const childrenArray = getAsArray(children); 2883 const keepArray = (i18nOptions == null ? void 0 : i18nOptions.transSupportBasicHtmlNodes) ? (_a = i18nOptions.transKeepBasicHtmlNodesFor) != null ? _a : [] : []; 2884 childrenArray.forEach((child, childIndex) => { 2885 if (isString$3(child)) { 2886 stringNode += `${child}`; 2887 return; 2888 } 2889 if (reactExports.isValidElement(child)) { 2890 const { 2891 props, 2892 type 2893 } = child; 2894 const childPropsCount = Object.keys(props).length; 2895 const shouldKeepChild = keepArray.indexOf(type) > -1; 2896 const childChildren = props.children; 2897 if (!childChildren && shouldKeepChild && !childPropsCount) { 2898 stringNode += `<${type}/>`; 2899 return; 2900 } 2901 if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) { 2902 stringNode += `<${childIndex}></${childIndex}>`; 2903 return; 2904 } 2905 if (shouldKeepChild && childPropsCount === 1 && isString$3(childChildren)) { 2906 stringNode += `<${type}>${childChildren}</${type}>`; 2907 return; 2908 } 2909 const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey); 2910 stringNode += `<${childIndex}>${content}</${childIndex}>`; 2911 return; 2912 } 2913 if (child === null) { 2914 warn$2(i18n, "TRANS_NULL_VALUE", `Passed in a null value as child`, { 2915 i18nKey 2916 }); 2917 return; 2918 } 2919 if (isObject$5(child)) { 2920 const _a2 = child, { 2921 format 2922 } = _a2, clone2 = __objRest(_a2, [ 2923 "format" 2924 ]); 2925 const keys2 = Object.keys(clone2); 2926 if (keys2.length === 1) { 2927 const value = format ? `${keys2[0]}, ${format}` : keys2[0]; 2928 stringNode += `{{${value}}}`; 2929 return; 2930 } 2931 warn$2(i18n, "TRANS_INVALID_OBJ", `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, { 2932 i18nKey, 2933 child 2934 }); 2935 return; 2936 } 2937 warn$2(i18n, "TRANS_INVALID_VAR", `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, { 2938 i18nKey, 2939 child 2940 }); 2941 }); 2942 return stringNode; 2943 }; 2944 const escapeLiteralLessThan = (str, keepArray = [], knownComponentsMap = {}) => { 2945 if (!str) return str; 2946 const knownNames = Object.keys(knownComponentsMap); 2947 const allValidNames = [...keepArray, ...knownNames]; 2948 let result = ""; 2949 let i2 = 0; 2950 while (i2 < str.length) { 2951 if (str[i2] === "<") { 2952 let isValidTag = false;
2953 const closingMatch = str.slice(i2).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9-]*)>/); 2954 if (closingMatch) { 2955 const tagName = closingMatch[1]; 2956 if (/^\d+$/.test(tagName) || allValidNames.includes(tagName)) { 2957 isValidTag = true; 2958 result += closingMatch[0]; 2959 i2 += closingMatch[0].length; 2960 } 2961 } 2962 if (!isValidTag) { 2963 const openingMatch = str.slice(i2).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/); 2964 if (openingMatch) { 2965 const tagName = openingMatch[1]; 2966 if (/^\d+$/.test(tagName) || allValidNames.includes(tagName)) { 2967 isValidTag = true; 2968 result += openingMatch[0]; 2969 i2 += openingMatch[0].length; 2970 } 2971 } 2972 } 2973 if (!isValidTag) { 2974 result += "<"; 2975 i2 += 1; 2976 } 2977 } else { 2978 result += str[i2]; 2979 i2 += 1; 2980 } 2981 } 2982 return result; 2983 }; 2984 const renderNodes = (children, knownComponentsMap, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) => { 2985 if (targetString === "") return []; 2986 const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || []; 2987 const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map((keep) => `<${keep}
2987`).join("|")).test(targetString); 2988 if (!children && !knownComponentsMap && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString]; 2989 const data = knownComponentsMap != null ? knownComponentsMap : {}; 2990 const getData = (childs) => { 2991 const childrenArray = getAsArray(childs); 2992 childrenArray.forEach((child) => { 2993 if (isString$3(child)) return; 2994 if (hasChildren(child)) getData(getChildren(child)); 2995 else if (isObject$5(child) && !reactExports.isValidElement(child)) Object.assign(data, child); 2996 }); 2997 }; 2998 getData(children); 2999 const escapedString = escapeLiteralLessThan(targetString, keepArray, data); 3000 const ast = c$5.parse(`<0>${escapedString}</0>`); 3001 const opts = __spreadValues(__spreadValues({}, data), combinedTOpts); 3002 const renderInner = (child, node2, rootReactNode) => { 3003 var _a; 3004 const childs = getChildren(child); 3005 const mappedChildren = mapAST(childs, node2.children, rootReactNode); 3006 return hasValidReactChildren(childs) && mappedChildren.length === 0 || ((_a = child.props) == null ? void 0 : _a.i18nIsDynamicList) ? childs : mappedChildren; 3007 }; 3008 const pushTranslatedJSX = (child, inner, mem, i2, isVoid) => { 3009 if (child.dummy) { 3010 child.children = inner; 3011 mem.push(reactExports.cloneElement(child, { 3012 key: i2 3013 }, isVoid ? void 0 : inner)); 3014 } else { 3015 mem.push(...reactExports.Children.map([child], (c2) => { 3016 const INTERNAL_DYNAMIC_MARKER = "data-i18n-is-dynamic-list"; 3017 const override = { 3018 key: i2, 3019 [INTERNAL_DYNAMIC_MARKER]: void 0 3020 }; 3021 if (c2 && c2.props) { 3022 Object.keys(c2.props).forEach((k2) => { 3023 if (k2 === "ref" || k2 === "children" || k2 === "i18nIsDynamicList" || k2 === INTERNAL_DYNAMIC_MARKER) return; 3024 override[k2] = c2.props[k2]; 3025 }); 3026 } 3027 return reactExports.cloneElement(c2, override, isVoid ? null : inner); 3028 })); 3029 } 3030 }; 3031 const mapAST = (reactNode, astNode, rootReactNode) => { 3032 const reactNodes = getAsArray(reactNode); 3033 const astNodes = getAsArray(astNode); 3034 return astNodes.reduce((mem, node2, i2) => { 3035 var _a, _b; 3036 const translationContent = ((_b = (_a = node2.children) == null ? void 0 : _a[0]) == null ? void 0 : _b.content) && i18n.services.interpolator.interpolate(node2.children[0].content, opts, i18n.language); 3037 if (node2.type === "tag") { 3038 let tmp = reactNodes[parseInt(node2.name, 10)]; 3039 if (!tmp && knownComponentsMap) tmp = knownComponentsMap[node2.name]; 3040 if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node2.name]; 3041 if (!tmp) tmp = {}; 3042 const props = __spreadValues({}, node2.attrs); 3043 if (shouldUnescape) { 3044 Object.keys(props).forEach((p2) => { 3045 const val = props[p2]; 3046 if (isString$3(val)) { 3047 props[p2] = unescape$1(val); 3048 } 3049 }); 3050 } 3051 const child = Object.keys(props).length !== 0 ? mergeProps$1({ 3052 props 3053 }, tmp) : tmp; 3054 const isElement2 = reactExports.isValidElement(child); 3055 const isValidTranslationWithChildren = isElement2 && hasChildren(node2, true) && !node2.voidElement; 3056 const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && isObject$5(child) && child.dummy && !isElement2; 3057 const isKnownComponent = isObject$5(knownComponentsMap) && Object.hasOwnProperty.call(knownComponentsMap, node2.name); 3058 if (isString$3(child)) { 3059 const value = i18n.services.interpolator.interpolate(child, opts, i18n.language); 3060 mem.push(value); 3061 } else if (hasChildren(child) || isValidTranslationWithChildren) { 3062 const inner = renderInner(child, node2, rootReactNode); 3063 pushTranslatedJSX(child, inner, mem, i2); 3064 } else if (isEmptyTransWithHTML) { 3065 const inner = mapAST(reactNodes, node2.children, rootReactNode); 3066 pushTranslatedJSX(child, inner, mem, i2); 3067 } else if (Number.isNaN(parseFloat(node2.name))) { 3068 if (isKnownComponent) { 3069 const inner = renderInner(child, node2, rootReactNode); 3070 pushTranslatedJSX(child, inner, mem, i2, node2.voidElement); 3071 } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node2.name) > -1) { 3072 if (node2.voidElement) { 3073 mem.push(reactExports.createElement(node2.name, { 3074 key: `${node2.name}-${i2}` 3075 })); 3076 } else { 3077 const inner = mapAST(reactNodes, node2.children, rootReactNode); 3078 mem.push(reactExports.createElement(node2.name, { 3079 key: `${node2.name}-${i2}` 3080 }, inner)); 3081 } 3082 } else if (node2.voidElement) { 3083 mem.push(`<${node2.name} />`); 3084 } else { 3085 const inner = mapAST(reactNodes, node2.children, rootReactNode); 3086 mem.push(`<${node2.name}>${inner}</${node2.name}>`); 3087 } 3088 } else if (isObject$5(child) && !isElement2) { 3089 const content = node2.children[0] ? translationContent : null; 3090 if (content) mem.push(content); 3091 } else { 3092 pushTranslatedJSX(child, translationContent, mem, i2, node2.children.length !== 1 || !translationContent); 3093 } 3094 } else if (node2.type === "text") { 3095 const wrapTextNodes = i18nOptions.transWrapTextNodes; 3096 const unescapeFn = typeof i18nOptions.unescape === "function" ? i18nOptions.unescape : getDefaults().unescape;
3097 const content = shouldUnescape ? unescapeFn(i18n.services.interpolator.interpolate(node2.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node2.content, opts, i18n.language); 3098 if (wrapTextNodes) { 3099 mem.push(reactExports.createElement(wrapTextNodes, { 3100 key: `${node2.name}-${i2}` 3101 }, content)); 3102 } else { 3103 mem.push(content); 3104 } 3105 } 3106 return mem; 3107 }, []); 3108 }; 3109 const result = mapAST([{ 3110 dummy: true, 3111 children: children || [] 3112 }], ast, getAsArray(children || [])); 3113 return getChildren(result[0]); 3114 }; 3115 const fixComponentProps = (component, index2, translation) => { 3116 const componentKey = component.key || index2; 3117 const comp = reactExports.cloneElement(component, { 3118 key: componentKey 3119 }); 3120 if (!comp.props || !comp.props.children || translation.indexOf(`${index2}/>`) < 0 && translation.indexOf(`${index2} />`) < 0) { 3121 return comp; 3122 } 3123 function Componentized() { 3124 return reactExports.createElement(reactExports.Fragment, null, comp); 3125 } 3126 return reactExports.createElement(Componentized, { 3127 key: componentKey 3128 }); 3129 }; 3130 const generateArrayComponents = (components2, translation) => components2.map((c2, index2) => fixComponentProps(c2, index2, translation)); 3131 const generateObjectComponents = (components2, translation) => { 3132 const componentMap = {}; 3133 Object.keys(components2).forEach((c2) => { 3134 Object.assign(componentMap, { 3135 [c2]: fixComponentProps(components2[c2], c2, translation) 3136 }); 3137 }); 3138 return componentMap; 3139 }; 3140 const generateComponents = (components2, translation, i18n, i18nKey) => { 3141 if (!components2) return null; 3142 if (Array.isArray(components2)) { 3143 return generateArrayComponents(components2, translation); 3144 } 3145 if (isObject$5(components2)) { 3146 return generateObjectComponents(components2, translation); 3147 } 3148 warnOnce(i18n, "TRANS_INVALID_COMPONENTS", `<Trans /> "components" prop expects an object or array`, { 3149 i18nKey 3150 }); 3151 return null; 3152 }; 3153 const isComponentsMap = (object2) => { 3154 if (!isObject$5(object2)) return false; 3155 if (Array.isArray(object2)) return false; 3156 return Object.keys(object2).reduce((acc, key) => acc && Number.isNaN(Number.parseFloat(key)), true); 3157 }; 3158 function Trans$1(_a) { 3159 var _b = _a, { 3160 children, 3161 count: count2, 3162 parent, 3163 i18nKey, 3164 context, 3165 tOptions = {}, 3166 values, 3167 defaults: defaults2, 3168 components: components2, 3169 ns, 3170 i18n: i18nFromProps, 3171 t: tFromProps, 3172 shouldUnescape 3173 } = _b, additionalProps = __objRest(_b, [ 3174 "children", 3175 "count", 3176 "parent", 3177 "i18nKey", 3178 "context", 3179 "tOptions", 3180 "values", 3181 "defaults", 3182 "components", 3183 "ns", 3184 "i18n", 3185 "t", 3186 "shouldUnescape" 3187 ]); 3188 var _a2, _b2, _c, _d, _e2, _f; 3189 const i18n = i18nFromProps || getI18n(); 3190 if (!i18n) { 3191 warnOnce(i18n, "NO_I18NEXT_INSTANCE", `Trans: You need to pass in an i18next instance using i18nextReactModule`, { 3192 i18nKey 3193 }); 3194 return children; 3195 } 3196 const t2 = tFromProps || i18n.t.bind(i18n) || ((k2) => k2); 3197 const reactI18nextOptions = __spreadValues(__spreadValues({}, getDefaults()), (_a2 = i18n.options) == null ? void 0 : _a2.react); 3198 let namespaces = ns || t2.ns || ((_b2 = i18n.options) == null ? void 0 : _b2.defaultNS); 3199 namespaces = isString$3(namespaces) ? [namespaces] : namespaces || ["translation"]; 3200 const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey); 3201 const defaultValue = defaults2 || (tOptions == null ? void 0 : tOptions.defaultValue) || nodeAsString || reactI18nextOptions.transEmptyNodeValue || (typeof i18nKey === "function" ? keysFromSelector(i18nKey) : i18nKey); 3202 const { 3203 hashTransKey 3204 }
3204 = reactI18nextOptions; 3205 const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue); 3206 if ((_d = (_c = i18n.options) == null ? void 0 : _c.interpolation) == null ? void 0 : _d.defaultVariables) { 3207 values = values && Object.keys(values).length > 0 ? __spreadValues(__spreadValues({}, values), i18n.options.interpolation.defaultVariables) : __spreadValues({}, i18n.options.interpolation.defaultVariables); 3208 } 3209 const valuesFromChildren = getValuesFromChildren(children); 3210 if (valuesFromChildren && typeof valuesFromChildren.count === "number" && count2 === void 0) { 3211 count2 = valuesFromChildren.count; 3212 } 3213 const interpolationOverride = values || count2 !== void 0 && !((_f = (_e2 = i18n.options) == null ? void 0 : _e2.interpolation) == null ? void 0 : _f.alwaysFormat) || !children ? tOptions.interpolation : { 3214 interpolation: __spreadProps(__spreadValues({}, tOptions.interpolation), { 3215 prefix: "#$?", 3216 suffix: "?$#" 3217 }) 3218 }; 3219 const combinedTOpts = __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, tOptions), { 3220 context: context || tOptions.context, 3221 count: count2 3222 }), values), interpolationOverride), { 3223 defaultValue, 3224 ns: namespaces 3225 }); 3226 let translation = key ? t2(key, combinedTOpts) : defaultValue; 3227 if (translation === key && defaultValue) translation = defaultValue; 3228 const generatedComponents = generateComponents(components2, translation, i18n, i18nKey); 3229 let indexedChildren = generatedComponents || children; 3230 let componentsMap = null; 3231 if (isComponentsMap(generatedComponents)) { 3232 componentsMap = generatedComponents; 3233 indexedChildren = children; 3234 } 3235 const content = renderNodes(indexedChildren, componentsMap, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape); 3236 const useAsParent = parent != null ? parent : reactI18nextOptions.defaultTransParent; 3237 return useAsParent ? reactExports.createElement(useAsParent, additionalProps, content) : content; 3238 } 3239 const initReactI18next = { 3240 type: "3rdParty", 3241 init(instance2) { 3242 setDefaults(instance2.options.react); 3243 setI18n(instance2); 3244 } 3245 }; 3246 const I18nContext = reactExports.createContext(); 3247 class ReportNamespaces { 3248 constructor() { 3249 this.usedNamespaces = {}; 3250 } 3251 addUsedNamespaces(namespaces) { 3252 namespaces.forEach((ns) => { 3253 if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true; 3254 }); 3255 } 3256 getUsedNamespaces() { 3257 return Object.keys(this.usedNamespaces); 3258 } 3259 } 3260 function Trans(_c) { 3261 var _d = _c, { 3262 children, 3263 count: count2, 3264 parent, 3265 i18nKey, 3266 context, 3267 tOptions = {}, 3268 values, 3269 defaults: defaults2, 3270 components: components2, 3271 ns, 3272 i18n: i18nFromProps, 3273 t: tFromProps, 3274 shouldUnescape 3275 } = _d, additionalProps = __objRest(_d, [ 3276 "children", 3277 "count", 3278 "parent", 3279 "i18nKey", 3280 "context", 3281 "tOptions", 3282 "values", 3283 "defaults", 3284 "components", 3285 "ns", 3286 "i18n", 3287 "t", 3288 "shouldUnescape" 3289 ]); 3290 var _a; 3291 const { 3292 i18n: i18nFromContext, 3293 defaultNS: defaultNSFromContext 3294 } = reactExports.useContext(I18nContext) || {}; 3295 const i18n = i18nFromProps || i18nFromContext || getI18n(); 3296 const t2 = tFromProps || (i18n == null ? void 0 : i18n.t.bind(i18n)); 3297 return Trans$1(__spreadValues({ 3298 children, 3299 count: count2, 3300 parent, 3301 i18nKey, 3302 context, 3303 tOptions, 3304 values, 3305 defaults: defaults2, 3306 components: components2, 3307 ns: ns || (t2 == null ? void 0 : t2.ns) || defaultNSFromContext || ((_a = i18n == null ? void 0 : i18n.options) == null ? void 0 : _a.defaultNS), 3308 i18n, 3309 t: tFromProps, 3310 shouldUnescape 3311 }, additionalProps)); 3312 } 3313 var shim = { exports: {} }; 3314 var useSyncExternalStoreShim_production = {}; 3315 /** 3316 * @license React 3317 * use-sync-external-store-shim.production.js 3318 * 3319 * Copyright (c) Meta Platforms, Inc. and affiliates. 3320 * 3321 * This source code is licensed under the MIT license found in the 3322 * LICENSE file in the root directory of this source tree. 3323 */ 3324 var hasRequiredUseSyncExternalStoreShim_production; 3325 function requireUseSyncExternalStoreShim_production() { 3326 if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production; 3327 hasRequiredUseSyncExternalStoreShim_production = 1; 3328 var React2 = requireReact(); 3329 function is(x2, y2) { 3330 return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; 3331 } 3332 var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React2.useState, useEffect = React2.useEffect, useLayoutEffect = React2.useLayoutEffect, useDebugValue = React2.useDebugValue; 3333 function useSyncExternalStore$2(subscribe, getSnapshot) { 3334 var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1]; 3335 useLayoutEffect( 3336 function() { 3337 inst.value = value; 3338 inst.getSnapshot = getSnapshot;
3339 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 3340 }, 3341 [subscribe, value, getSnapshot] 3342 ); 3343 useEffect( 3344 function() { 3345 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 3346 return subscribe(function() { 3347 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 3348 }); 3349 }, 3350 [subscribe] 3351 ); 3352 useDebugValue(value); 3353 return value; 3354 } 3355 function checkIfSnapshotChanged(inst) { 3356 var latestGetSnapshot = inst.getSnapshot; 3357 inst = inst.value; 3358 try { 3359 var nextValue = latestGetSnapshot(); 3360 return !objectIs(inst, nextValue); 3361 } catch (error) { 3362 return true; 3363 } 3364 } 3365 function useSyncExternalStore$1(subscribe, getSnapshot) { 3366 return getSnapshot(); 3367 } 3368 var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; 3369 useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React2.useSyncExternalStore ? React2.useSyncExternalStore : shim2; 3370 return useSyncExternalStoreShim_production; 3371 } 3372 var hasRequiredShim; 3373 function requireShim() { 3374 if (hasRequiredShim) return shim.exports; 3375 hasRequiredShim = 1; 3376 { 3377 shim.exports = requireUseSyncExternalStoreShim_production(); 3378 } 3379 return shim.exports; 3380 } 3381 var shimExports = requireShim(); 3382 const notReadyT = (k2, optsOrDefaultValue) => { 3383 if (isString$3(optsOrDefaultValue)) return optsOrDefaultValue; 3384 if (isObject$5(optsOrDefaultValue) && isString$3(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue; 3385 return Array.isArray(k2) ? k2[k2.length - 1] : k2; 3386 }; 3387 const notReadySnapshot = { 3388 t: notReadyT, 3389 ready: false 3390 }; 3391 const dummySubscribe = () => () => { 3392 }; 3393 const useTranslation = (ns, props = {}) => { 3394 var _a, _b, _c; 3395 const { 3396 i18n: i18nFromProps 3397 } = props; 3398 const { 3399 i18n: i18nFromContext, 3400 defaultNS: defaultNSFromContext 3401 } = reactExports.useContext(I18nContext) || {}; 3402 const i18n = i18nFromProps || i18nFromContext || getI18n(); 3403 if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces(); 3404 if (!i18n) { 3405 warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next"); 3406 } 3407 const i18nOptions = reactExports.useMemo(() => { 3408 var _a2; 3409 return __spreadValues(__spreadValues(__spreadValues({}, getDefaults()), (_a2 = i18n == null ? void 0 : i18n.options) == null ? void 0 : _a2.react), props); 3410 }, [i18n, props]); 3411 const { 3412 useSuspense, 3413 keyPrefix 3414 } = i18nOptions; 3415 const nsOrContext = ns || defaultNSFromContext || ((_a = i18n == null ? void 0 : i18n.options) == null ? void 0 : _a.defaultNS); 3416 const unstableNamespaces = isString$3(nsOrContext) ? [nsOrContext] : nsOrContext || ["translation"]; 3417 const namespaces = reactExports.useMemo(() => unstableNamespaces, unstableNamespaces); 3418 (_c = (_b = i18n == null ? void 0 : i18n.reportNamespaces) == null ? void 0 : _b.addUsedNamespaces) == null ? void 0 : _c.call(_b, namespaces); 3419 const revisionRef = reactExports.useRef(0); 3420 const subscribe = reactExports.useCallback((callback) => { 3421 if (!i18n) return dummySubscribe; 3422 const { 3423 bindI18n, 3424 bindI18nStore 3425 } = i18nOptions; 3426 const wrappedCallback = () => { 3427 revisionRef.current += 1; 3428 callback(); 3429 }; 3430 if (bindI18n) i18n.on(bindI18n, wrappedCallback); 3431 if (bindI18nStore) i18n.store.on(bindI18nStore, wrappedCallback); 3432 return () => { 3433 if (bindI18n) bindI18n.split(" ").forEach((e2) => i18n.off(e2, wrappedCallback)); 3434 if (bindI18nStore) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, wrappedCallback)); 3435 }; 3436 }, [i18n, i18nOptions]); 3437 const snapshotRef = reactExports.useRef(); 3438 const getSnapshot = reactExports.useCallback(() => { 3439 if (!i18n) { 3440 return notReadySnapshot; 3441 } 3442 const calculatedReady = !!(i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n2) => hasLoadedNamespace(n2, i18n, i18nOptions)); 3443 const currentLng = props.lng || i18n.language; 3444 const currentRevision = revisionRef.current; 3445 const lastSnapshot = snapshotRef.current; 3446 if (lastSnapshot && lastSnapshot.ready === calculatedReady && lastSnapshot.lng === currentLng && lastSnapshot.keyPrefix === keyPrefix && lastSnapshot.revision === currentRevision) { 3447 return lastSnapshot; 3448 } 3449 const calculatedT = i18n.getFixedT(currentLng, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
3450 const newSnapshot = { 3451 t: calculatedT, 3452 ready: calculatedReady, 3453 lng: currentLng, 3454 keyPrefix, 3455 revision: currentRevision 3456 }; 3457 snapshotRef.current = newSnapshot; 3458 return newSnapshot; 3459 }, [i18n, namespaces, keyPrefix, i18nOptions, props.lng]); 3460 const [loadCount, setLoadCount] = reactExports.useState(0); 3461 const { 3462 t: t2, 3463 ready 3464 } = shimExports.useSyncExternalStore(subscribe, getSnapshot, getSnapshot); 3465 reactExports.useEffect(() => { 3466 if (i18n && !ready && !useSuspense) { 3467 const onLoaded = () => setLoadCount((c2) => c2 + 1); 3468 if (props.lng) { 3469 loadLanguages(i18n, props.lng, namespaces, onLoaded); 3470 } else { 3471 loadNamespaces(i18n, namespaces, onLoaded); 3472 } 3473 } 3474 }, [i18n, props.lng, namespaces, ready, useSuspense, loadCount]); 3475 const finalI18n = i18n || {}; 3476 const wrapperRef = reactExports.useRef(null); 3477 const wrapperLangRef = reactExports.useRef(); 3478 const createI18nWrapper = (original) => { 3479 const descriptors2 = Object.getOwnPropertyDescriptors(original); 3480 if (descriptors2.__original) delete descriptors2.__original; 3481 const wrapper = Object.create(Object.getPrototypeOf(original), descriptors2); 3482 if (!Object.prototype.hasOwnProperty.call(wrapper, "__original")) { 3483 try { 3484 Object.defineProperty(wrapper, "__original", { 3485 value: original, 3486 writable: false, 3487 enumerable: false, 3488 configurable: false 3489 }); 3490 } catch (_2) { 3491 } 3492 } 3493 return wrapper; 3494 }; 3495 const ret = reactExports.useMemo(() => { 3496 const original = finalI18n; 3497 const lang = original == null ? void 0 : original.language; 3498 let i18nWrapper = original; 3499 if (original) { 3500 if (wrapperRef.current && wrapperRef.current.__original === original) { 3501 if (wrapperLangRef.current !== lang) { 3502 i18nWrapper = createI18nWrapper(original); 3503 wrapperRef.current = i18nWrapper; 3504 wrapperLangRef.current = lang; 3505 } else { 3506 i18nWrapper = wrapperRef.current; 3507 } 3508 } else { 3509 i18nWrapper = createI18nWrapper(original); 3510 wrapperRef.current = i18nWrapper; 3511 wrapperLangRef.current = lang; 3512 } 3513 } 3514 const arr = [t2, i18nWrapper, ready]; 3515 arr.t = t2; 3516 arr.i18n = i18nWrapper; 3517 arr.ready = ready; 3518 return arr; 3519 }, [t2, finalI18n, ready, finalI18n.resolvedLanguage, finalI18n.language, finalI18n.languages]); 3520 if (i18n && useSuspense && !ready) { 3521 throw new Promise((resolve) => { 3522 const onLoaded = () => resolve(); 3523 if (props.lng) { 3524 loadLanguages(i18n, props.lng, namespaces, onLoaded); 3525 } else { 3526 loadNamespaces(i18n, namespaces, onLoaded); 3527 } 3528 }); 3529 } 3530 return ret; 3531 }; 3532 const components = { "layout": { "logo_title": "Back to store", "back_label": "Back" } }; 3533 const modules = { "contact": { "page_title": "Contact", "meta_description": "Contact {{shopName}} for help with an order you placed or any other question." }, "orderDetails": { "title": "Help with selected items" }, "orderLogin": { "title": "What can we help with?", "primary_tab_button_label": "Order I placed", "secondary_tab_button_label": "Something else", "instructions": "Please enter your order number and the email you used to place your order:", "friendly_id_label": "Your order number", "friendly_id_suggestion": "I canât find my order number", "friendly_id_required_error": "Order number is required", "friendly_id_invalid_error": "Order number is invalid", "email_label": "Email used when placing the order", "email_required_error": "Email is required", "email_invalid_error": "Email is invalid", "submit_label": "Continue", "invalid_order_error": "Invalid order number and/or email address", "order_number_suggestion_modal_title": "Can't find your order number?", "order_number_suggestion_modal_paragraph_1": 'Check your Inbox, Spam or Promotions folders. Look for an email with the subject: <strong>"Your order #... is confirmed"</strong>', "order_number_suggestion_modal_paragraph_2": "Your order number is the 8-digit code (e.g., #B2A99TF9) foun
3533d in that subject line or at the top of the message.", "order_number_suggestion_modal_support_button": "I still can't find it, let me talk to support", "order_number_suggestion_modal_close_button": "Close" }, "orderVariants": { "title": "Contact support", "primary_tab_button_label": "Help with selected items", "secondary_tab_button_label": "Something else", "submit_label_empty": "Select items you need help with", "submit_label": "Continue", "shipment_subheader": "Shipment {{current}} of {{total}}", "digital_shipment_title": "Digital files", "gift_cards_shipment_title": "Gift cards", "download_limit_exceeded_error": "Download limit has been exceeded and download is no longer available.", "download_expired_error": "This product was cancelled and download is no longer available.", "download_pending_info": "Your download is still being prepared. We will email you when it's ready", "view_gift_card": "View gift card", "digital_refund_banner": "Digital products cannot be refunded once downloaded.", "components": { "shipmentCarrier": { "shipped_via": "Shipped via {{carrier}}", "track_shipment": "Track shipment" }, "shipmentTitle": { "status_delivered_on": "Delivered on ", "status_estimated_delivery": "Estimated delivery ", "status_shipped_on": "Shipped on ", "status_arrives_on": "Arrives on ", "status_arrives": "Arrives ", "status_order_placed": "Order placed" }, "timelineEvents": { "order_placed": "Placed", "label_created": "Shipped", "delivered": "Delivered" } } }, "reportForm": { "email_label": "Your email address", "email_required_error": "Email is required", "email_invalid_error": "Email is invalid", "full_name_label": "Your name", "full_name_required_error": "Your name is required", "topic_label": "Select topic", "topic_required_error": "Please select a topic", "sub_topic_label": "Provide more context", "sub_topic_required_error": "Please select a topic", "message_label": "Add message", "message_required_error": "Message is required", "message_min_length_error": "Message must be at least {{count}} characters", "submit_label": "Submit message", "submit_error": "Something went wrong. Please try again or contact us at <emailLink />.", "submit_error_no_email": "Something went wrong. Please try again later.", "attachments": { "add_button_label": "Upload attachment (optional)", "remove_file_label": "Remove file" } }, "somethingElse": { "order_placed_title": "Contact support", "title": "What can we help with?", "order_placed_primary_tab_button_label": "Help with selected items", "primary_tab_button_label": "Order I placed", "secondary_tab_button_label": "Something else" }, "success": { "title": "Thank you for contacting us", "subtitle": "Weâre reviewing your email and will get back to you as soon as possible! You can expect a response within 2 to 3 business days.", "back_label": "Go to homepage" } }; 3534 const en$1 = { 3535 components, 3536 modules 3537 }; 3538 const defaultNS = "translation"; 3539 instance.use(initReactI18next).init({ 3540 debug: true, 3541 fallbackLng: "en", 3542 defaultNS, 3543 resources: { 3544 en: __spreadValues({}, en$1) 3545 } 3546 }); 3547 var client = {}; 3548 var reactDom = { exports: {} }; 3549 var reactDom_production_min = {}; 3550 var scheduler = { exports: {} }; 3551 var scheduler_production_min = {}; 3552 /** 3553 * @license React 3554 * scheduler.production.min.js 3555 * 3556 * Copyright (c) Facebook, Inc. and its affiliates. 3557 * 3558 * This source code is licensed under the MIT license found in the 3559 * LICENSE file in the root directory of this source tree. 3560 */ 3561 var hasRequiredScheduler_production_min; 3562 function requireScheduler_production_min() { 3563 if (hasRequiredScheduler_production_min) return scheduler_production_min; 3564 hasRequiredScheduler_production_min = 1; 3565 (function(exports$1) { 3566 function f2(a2, b2) { 3567 var c2 = a2.length; 3568 a2.push(b2); 3569 a: for (; 0 < c2; ) { 3570 var d2 = c2 - 1 >>> 1, e2 = a2[d2]; 3571 if (0 < g2(e2, b2)) a2[d2] = b2, a2[c2] = e2, c2 = d2; 3572 else break a; 3573 } 3574 } 3575 function h2(a2) { 3576 return 0 === a2.length ? null : a2[0]; 3577 } 3578 function k2(a2) { 3579 if (0 === a2.length) return null; 3580 var b2 = a2[0], c2 = a2.pop(); 3581 if (c2 !== b2) { 3582 a2[0] = c2; 3583 a: for (var d2 = 0, e2 = a2.length, w2 = e2 >>> 1; d2 < w2; ) { 3584 var m2 = 2 * (d2 + 1) - 1, C2 = a2[m2], n2 = m2 + 1, x2 = a2[n2]; 3585 if (0 > g2(C2, c2)) n2 < e2 && 0 > g2(x2, C2) ? (a2[d2] = x2, a2[n2] = c2, d2 = n2) : (a2[d2] = C2, a2[m2] = c2, d2 = m2); 3586 else if (n2 < e2 && 0 > g2(x2, c2)) a2[d2] = x2, a2[n2] = c2, d2 = n2; 3587 else break a; 3588 } 3589 } 3590 return b2; 3591 } 3592 function g2(a2, b2) { 3593 var c2 = a2.sortIndex - b2.sortIndex; 3594 return 0 !== c2 ? c2 : a2.id - b2.id; 3595 } 3596 if ("object" === typeof performance && "function" === typeof performance.now) { 3597 var l2 = performance; 3598 exports$1.unstable_now = function() { 3599 return l2.now(); 3600 }; 3601 } else { 3602 var p2 = Date, q2 = p2.now(); 3603 exports$1.unstable_now = function() { 3604 return p2.now() - q2; 3605 }; 3606 } 3607 var r2 = [], t2 = [], u2 = 1, v2 = null, y2 = 3, z2 = false, A2 = false, B2 = false, D2 = "function" === typeof setTimeout ? setTimeout : null, E2 = "function" === typeof clearTimeout ? clearTimeout : null, F2 = "undefined" !== typeof setImmediate ? setImmediate : null; 3608 "undefined" !== typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling); 3609 function G2(a2) { 3610 for (var b2 = h2(t2); null !== b2; ) { 3611 if (null === b2.callback) k2(t2); 3612 else if (b2.startTime <= a2) k2(t2), b2.sortIndex = b2.expirationTime, f2(r2, b2); 3613 else break; 3614 b2 = h2(t2); 3615 } 3616 } 3617 function H2(a2) { 3618 B2 = false;
vendor: 48,826 bytes, lines 3619-4964
3619 G2(a2); 3620 if (!A2) if (null !== h2(r2)) A2 = true, I2(J2); 3621 else { 3622 var b2 = h2(t2); 3623 null !== b2 && K2(H2, b2.startTime - a2); 3624 } 3625 } 3626 function J2(a2, b2) { 3627 A2 = false; 3628 B2 && (B2 = false, E2(L2), L2 = -1); 3629 z2 = true; 3630 var c2 = y2; 3631 try { 3632 G2(b2); 3633 for (v2 = h2(r2); null !== v2 && (!(v2.expirationTime > b2) || a2 && !M2()); ) { 3634 var d2 = v2.callback; 3635 if ("function" === typeof d2) { 3636 v2.callback = null; 3637 y2 = v2.priorityLevel; 3638 var e2 = d2(v2.expirationTime <= b2); 3639 b2 = exports$1.unstable_now(); 3640 "function" === typeof e2 ? v2.callback = e2 : v2 === h2(r2) && k2(r2); 3641 G2(b2); 3642 } else k2(r2); 3643 v2 = h2(r2); 3644 } 3645 if (null !== v2) var w2 = true; 3646 else { 3647 var m2 = h2(t2); 3648 null !== m2 && K2(H2, m2.startTime - b2); 3649 w2 = false; 3650 } 3651 return w2; 3652 } finally { 3653 v2 = null, y2 = c2, z2 = false; 3654 } 3655 } 3656 var N2 = false, O2 = null, L2 = -1, P2 = 5, Q2 = -1; 3657 function M2() { 3658 return exports$1.unstable_now() - Q2 < P2 ? false : true; 3659 } 3660 function R2() { 3661 if (null !== O2) { 3662 var a2 = exports$1.unstable_now(); 3663 Q2 = a2; 3664 var b2 = true; 3665 try { 3666 b2 = O2(true, a2); 3667 } finally { 3668 b2 ? S2() : (N2 = false, O2 = null); 3669 } 3670 } else N2 = false; 3671 } 3672 var S2; 3673 if ("function" === typeof F2) S2 = function() { 3674 F2(R2); 3675 }; 3676 else if ("undefined" !== typeof MessageChannel) { 3677 var T2 = new MessageChannel(), U2 = T2.port2; 3678 T2.port1.onmessage = R2; 3679 S2 = function() { 3680 U2.postMessage(null); 3681 }; 3682 } else S2 = function() { 3683 D2(R2, 0); 3684 }; 3685 function I2(a2) { 3686 O2 = a2; 3687 N2 || (N2 = true, S2()); 3688 } 3689 function K2(a2, b2) { 3690 L2 = D2(function() { 3691 a2(exports$1.unstable_now()); 3692 }, b2); 3693 } 3694 exports$1.unstable_IdlePriority = 5; 3695 exports$1.unstable_ImmediatePriority = 1; 3696 exports$1.unstable_LowPriority = 4; 3697 exports$1.unstable_NormalPriority = 3; 3698 exports$1.unstable_Profiling = null; 3699 exports$1.unstable_UserBlockingPriority = 2; 3700 exports$1.unstable_cancelCallback = function(a2) { 3701 a2.callback = null; 3702 }; 3703 exports$1.unstable_continueExecution = function() { 3704 A2 || z2 || (A2 = true, I2(J2)); 3705 }; 3706 exports$1.unstable_forceFrameRate = function(a2) { 3707 0 > a2 || 125 < a2 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a2 ? Math.floor(1e3 / a2) : 5; 3708 }; 3709 exports$1.unstable_getCurrentPriorityLevel = function() { 3710 return y2; 3711 }; 3712 exports$1.unstable_getFirstCallbackNode = function() { 3713 return h2(r2); 3714 }; 3715 exports$1.unstable_next = function(a2) { 3716 switch (y2) { 3717 case 1: 3718 case 2: 3719 case 3: 3720 var b2 = 3; 3721 break; 3722 default: 3723 b2 = y2; 3724 } 3725 var c2 = y2; 3726 y2 = b2; 3727 try { 3728 return a2(); 3729 } finally { 3730 y2 = c2; 3731 } 3732 }; 3733 exports$1.unstable_pauseExecution = function() { 3734 }; 3735 exports$1.unstable_requestPaint = function() { 3736 }; 3737 exports$1.unstable_runWithPriority = function(a2, b2) { 3738 switch (a2) { 3739 case 1: 3740 case 2: 3741 case 3: 3742 case 4: 3743 case 5: 3744 break; 3745 default: 3746 a2 = 3; 3747 } 3748 var c2 = y2; 3749 y2 = a2; 3750 try { 3751 return b2(); 3752 } finally { 3753 y2 = c2; 3754 } 3755 }; 3756 exports$1.unstable_scheduleCallback = function(a2, b2, c2) { 3757 var d2 = exports$1.unstable_now(); 3758 "object" === typeof c2 && null !== c2 ? (c2 = c2.delay, c2 = "number" === typeof c2 && 0 < c2 ? d2 + c2 : d2) : c2 = d2; 3759 switch (a2) { 3760 case 1: 3761 var e2 = -1; 3762 break; 3763 case 2: 3764 e2 = 250; 3765 break; 3766 case 5: 3767 e2 = 1073741823; 3768 break; 3769 case 4: 3770 e2 = 1e4; 3771 break; 3772 default: 3773 e2 = 5e3; 3774 } 3775 e2 = c2 + e2; 3776 a2 = { id: u2++, callback: b2, priorityLevel: a2, startTime: c2, expirationTime: e2, sortIndex: -1 }; 3777 c2 > d2 ? (a2.sortIndex = c2, f2(t2, a2), null === h2(r2) && a2 === h2(t2) && (B2 ? (E2(L2), L2 = -1) : B2 = true, K2(H2, c2 - d2))) : (a2.sortIndex = e2, f2(r2, a2), A2 || z2 || (A2 = true, I2(J2))); 3778 return a2; 3779 }; 3780 exports$1.unstable_shouldYield = M2; 3781 exports$1.unstable_wrapCallback = function(a2) { 3782 var b2 = y2; 3783 return function() { 3784 var c2 = y2; 3785 y2 = b2; 3786 try { 3787 return a2.apply(this, arguments); 3788 } finally { 3789 y2 = c2; 3790 } 3791 }; 3792 }; 3793 })(scheduler_production_min); 3794 return scheduler_production_min; 3795 } 3796 var hasRequiredScheduler; 3797 function requireScheduler() { 3798 if (hasRequiredScheduler) return scheduler.exports; 3799 hasRequiredScheduler = 1; 3800 { 3801 scheduler.exports = requireScheduler_production_min(); 3802 } 3803 return scheduler.exports; 3804 } 3805 /** 3806 * @license React 3807 * react-dom.production.min.js 3808 * 3809 * Copyright (c) Facebook, Inc. and its affiliates. 3810 * 3811 * This source code is licensed under the MIT license found in the 3812 * LICENSE file in the root directory of this source tree. 3813 */ 3814 var hasRequiredReactDom_production_min; 3815 function requireReactDom_production_min() { 3816 if (hasRequiredReactDom_production_min) return reactDom_production_min; 3817 hasRequiredReactDom_production_min = 1; 3818 var aa2 = requireReact(), ca2 = requireScheduler(); 3819 function p2(a2) { 3820 for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a2, c2 = 1; c2 < arguments.length; c2++) b2 += "&args[]=" + encodeURIComponent(arguments[c2]); 3821 return "Minified React error #" + a2 + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; 3822 } 3823 var da2 = /* @__PURE__ */ new Set(), ea2 = {}; 3824 function fa2(a2, b2) { 3825 ha2(a2, b2); 3826 ha2(a2 + "Capture", b2); 3827 } 3828 function ha2(a2, b2) { 3829 ea2[a2] = b2; 3830 for (a2 = 0; a2 < b2.length; a2++) da2.add(b2[a2]); 3831 } 3832 var ia = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), ja2 = Object.prototype.hasOwnProperty, ka2 = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, la2 = {}, ma2 = {}; 3833 function oa2(a2) { 3834 if (ja2.call(ma2, a2)) return true; 3835 if (ja2.call(la2, a2)) return false; 3836 if (ka2.test(a2)) return ma2[a2] = true; 3837 la2[a2] = true; 3838 return false; 3839 } 3840 function pa2(a2, b2, c2, d2) { 3841 if (null !== c2 && 0 === c2.type) return false; 3842 switch (typeof b2) { 3843 case "function": 3844 case "symbol": 3845 return true; 3846 case "boolean": 3847 if (d2) return false; 3848 if (null !== c2) return !c2.acceptsBooleans; 3849 a2 = a2.toLowerCase().slice(0, 5); 3850 return "data-" !== a2 && "aria-" !== a2; 3851 default: 3852 return false; 3853 } 3854 } 3855 function qa2(a2, b2, c2, d2) { 3856 if (null === b2 || "undefined" === typeof b2 || pa2(a2, b2, c2, d2)) return true; 3857 if (d2) return false; 3858 if (null !== c2) switch (c2.type) { 3859 case 3: 3860 return !b2; 3861 case 4: 3862 return false === b2; 3863 case 5: 3864 return isNaN(b2); 3865 case 6: 3866 return isNaN(b2) || 1 > b2; 3867 } 3868 return false; 3869 } 3870 function v2(a2, b2, c2, d2, e2, f2, g2) { 3871 this.acceptsBooleans = 2 === b2 || 3 === b2 || 4 === b2; 3872 this.attributeName = d2; 3873 this.attributeNamespace = e2; 3874 this.mustUseProperty = c2; 3875 this.propertyName = a2; 3876 this.type = b2; 3877 this.sanitizeURL = f2; 3878 this.removeEmptyString = g2; 3879 } 3880 var z2 = {}; 3881 "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a2) { 3882 z2[a2] = new v2(a2, 0, false, a2, null, false, false); 3883 }); 3884 [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a2) { 3885 var b2 = a2[0]; 3886 z2[b2] = new v2(b2, 1, false, a2[1], null, false, false); 3887 }); 3888 ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a2) { 3889 z2[a2] = new v2(a2, 2, false, a2.toLowerCase(), null, false, false); 3890 }); 3891 ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a2) { 3892 z2[a2] = new v2(a2, 2, false, a2, null, false, false); 3893 }); 3894 "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a2) { 3895 z2[a2] = new v2(a2, 3, false, a2.toLowerCase(), null, false, false); 3896 }); 3897 ["checked", "multiple", "muted", "selected"].forEach(function(a2) { 3898 z2[a2] = new v2(a2, 3, true, a2, null, false, false); 3899 }); 3900 ["capture", "download"].forEach(function(a2) { 3901 z2[a2] = new v2(a2, 4, false, a2, null, false, false); 3902 }); 3903 ["cols", "rows", "size", "span"].forEach(function(a2) { 3904 z2[a2] = new v2(a2, 6, false, a2, null, false, false); 3905 }); 3906 ["rowSpan", "start"].forEach(function(a2) { 3907 z2[a2] = new v2(a2, 5, false, a2.toLowerCase(), null, false, false); 3908 }); 3909 var ra2 = /[\-:]([a-z])/g; 3910 function sa2(a2) { 3911 return a2[1].toUpperCase(); 3912 } 3913 "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a2) { 3914 var b2 = a2.replace( 3915 ra2, 3916 sa2 3917 ); 3918 z2[b2] = new v2(b2, 1, false, a2, null, false, false); 3919 }); 3920 "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a2) { 3921 var b2 = a2.replace(ra2, sa2); 3922 z2[b2] = new v2(b2, 1, false, a2, "http://www.w3.org/1999/xlink", false, false); 3923 }); 3924 ["xml:base", "xml:lang", "xml:space"].forEach(function(a2) { 3925 var b2 = a2.replace(ra2, sa2); 3926 z2[b2] = new v2(b2, 1, false, a2, "http://www.w3.org/XML/1998/namespace", false, false); 3927 }); 3928 ["tabIndex", "crossOrigin"].forEach(function(a2) { 3929 z2[a2] = new v2(a2, 1, false, a2.toLowerCase(), null, false, false); 3930 }); 3931 z2.xlinkHref = new v2("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false); 3932 ["src", "href", "action", "formAction"].forEach(function(a2) { 3933 z2[a2] = new v2(a2, 1, false, a2.toLowerCase(), null, true, true); 3934 }); 3935 function ta(a2, b2, c2, d2) { 3936 var e2 = z2.hasOwnProperty(b2) ? z2[b2] : null; 3937 if (null !== e2 ? 0 !== e2.type : d2 || !(2 < b2.length) || "o" !== b2[0] && "O" !== b2[0] || "n" !== b2[1] && "N" !== b2[1]) qa2(b2, c2, e2, d2) && (c2 = null), d2 || null === e2 ? oa2(b2) && (null === c2 ? a2.removeAttribute(b2) : a2.setAttribute(b2, "" + c2)) : e2.mustUseProperty ? a2[e2.propertyName] = null === c2 ? 3 === e2.type ? false : "" : c2 : (b2 = e2.attributeName, d2 = e2.attributeNamespace, null === c2 ? a2.removeAttribute(b2) : (e2 = e2.type, c2 = 3 === e2 || 4 === e2 && true === c2 ? "" : "" + c2, d2 ? a2.setAttributeNS(d2, b2, c2) : a2.setAttribute(b2, c2))); 3938 } 3939 var ua2 = aa2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, va2 = Symbol.for("react.element"), wa2 = Symbol.for("react.portal"), ya2 = Symbol.for("react.fragment"), za2 = Symbol.for("react.strict_mode"), Aa2 = Symbol.for("react.profiler"), Ba2 = Symbol.for("react.provider"), Ca2 = Symbol.for("react.context"), Da2 = Symbol.for("react.forward_ref"), Ea2 = Symbol.for("react.suspense"), Fa2 = Symbol.for("react.suspense_list"), Ga2 = Symbol.for("react.memo"), Ha2 = Symbol.for("react.lazy"); 3940 var Ia2 = Symbol.for("react.offscreen"); 3941 var Ja2 = Symbol.iterator; 3942 function Ka2(a2) { 3943 if (null === a2 || "object" !== typeof a2) return null; 3944 a2 = Ja2 && a2[Ja2] || a2["@@iterator"]; 3945 return "function" === typeof a2 ? a2 : null; 3946 } 3947 var A2 = Object.assign, La2; 3948 function Ma2(a2) { 3949 if (void 0 === La2) try { 3950 throw Error(); 3951 } catch (c2) { 3952 var b2 = c2.stack.trim().match(/\n( *(at )?)/); 3953 La2 = b2 && b2[1] || ""; 3954 } 3955 return "\n" + La2 + a2; 3956 } 3957 var Na2 = false; 3958 function Oa2(a2, b2) { 3959 if (!a2 || Na2) return ""; 3960 Na2 = true; 3961 var c2 = Error.prepareStackTrace; 3962 Error.prepareStackTrace = void 0; 3963 try { 3964 if (b2) if (b2 = function() { 3965 throw Error(); 3966 }, Object.defineProperty(b2.prototype, "props", { set: function() { 3967 throw Error(); 3968 } }), "object" === typeof Reflect && Reflect.construct) { 3969 try { 3970 Reflect.construct(b2, []); 3971 } catch (l2) { 3972 var d2 = l2; 3973 } 3974 Reflect.construct(a2, [], b2); 3975 } else { 3976 try { 3977 b2.call(); 3978 } catch (l2) { 3979 d2 = l2; 3980 } 3981 a2.call(b2.prototype); 3982 } 3983 else { 3984 try { 3985 throw Error(); 3986 } catch (l2) { 3987 d2 = l2; 3988 } 3989 a2(); 3990 } 3991 } catch (l2) { 3992 if (l2 && d2 && "string" === typeof l2.stack) { 3993 for (var e2 = l2.stack.split("\n"), f2 = d2.stack.split("\n"), g2 = e2.length - 1, h2 = f2.length - 1; 1 <= g2 && 0 <= h2 && e2[g2] !== f2[h2]; ) h2--; 3994 for (; 1 <= g2 && 0 <= h2; g2--, h2--) if (e2[g2] !== f2[h2]) { 3995 if (1 !== g2 || 1 !== h2) { 3996 do 3997 if (g2--, h2--, 0 > h2 || e2[g2] !== f2[h2]) { 3998 var k2 = "\n" + e2[g2].replace(" at new ", " at "); 3999 a2.displayName && k2.includes("<anonymous>") && (k2 = k2.replace("<anonymous>", a2.displayName)); 4000 return k2; 4001 } 4002 while (1 <= g2 && 0 <= h2); 4003 } 4004 break; 4005 } 4006 } 4007 } finally { 4008 Na2 = false, Error.prepareStackTrace = c2; 4009 } 4010 return (a2 = a2 ? a2.displayName || a2.name : "") ? Ma2(a2) : ""; 4011 } 4012 function Pa2(a2) { 4013 switch (a2.tag) { 4014 case 5: 4015 return Ma2(a2.type); 4016 case 16: 4017 return Ma2("Lazy"); 4018 case 13: 4019 return Ma2("Suspense"); 4020 case 19: 4021 return Ma2("SuspenseList"); 4022 case 0: 4023 case 2: 4024 case 15: 4025 return a2 = Oa2(a2.type, false), a2; 4026 case 11: 4027 return a2 = Oa2(a2.type.render, false), a2; 4028 case 1: 4029 return a2 = Oa2(a2.type, true), a2; 4030 default: 4031 return ""; 4032 } 4033 } 4034 function Qa2(a2) { 4035 if (null == a2) return null; 4036 if ("function" === typeof a2) return a2.displayName || a2.name || null; 4037 if ("string" === typeof a2) return a2; 4038 switch (a2) { 4039 case ya2: 4040 return "Fragment"; 4041 case wa2: 4042 return "Portal"; 4043 case Aa2: 4044 return "Profiler"; 4045 case za2: 4046 return "StrictMode"; 4047 case Ea2: 4048 return "Suspense"; 4049 case Fa2: 4050 return "SuspenseList"; 4051 } 4052 if ("object" === typeof a2) switch (a2.$$typeof) { 4053 case Ca2: 4054 return (a2.displayName || "Context") + ".Consumer"; 4055 case Ba2: 4056 return (a2._context.displayName || "Context") + ".Provider"; 4057 case Da2: 4058 var b2 = a2.render; 4059 a2 = a2.displayName; 4060 a2 || (a2 = b2.displayName || b2.name || "", a2 = "" !== a2 ? "ForwardRef(" + a2 + ")" : "ForwardRef"); 4061 return a2; 4062 case Ga2: 4063 return b2 = a2.displayName || null, null !== b2 ? b2 : Qa2(a2.type) || "Memo"; 4064 case Ha2: 4065 b2 = a2._payload; 4066 a2 = a2._init; 4067 try { 4068 return Qa2(a2(b2)); 4069 } catch (c2) { 4070 } 4071 } 4072 return null; 4073 } 4074 function Ra2(a2) { 4075 var b2 = a2.type; 4076 switch (a2.tag) { 4077 case 24: 4078 return "Cache"; 4079 case 9: 4080 return (b2.displayName || "Context") + ".Consumer"; 4081 case 10: 4082 return (b2._context.displayName || "Context") + ".Provider"; 4083 case 18: 4084 return "DehydratedFragment"; 4085 case 11: 4086 return a2 = b2.render, a2 = a2.displayName || a2.name || "", b2.displayName || ("" !== a2 ? "ForwardRef(" + a2 + ")" : "ForwardRef"); 4087 case 7: 4088 return "Fragment"; 4089 case 5: 4090 return b2; 4091 case 4: 4092 return "Portal"; 4093 case 3: 4094 return "Root"; 4095 case 6: 4096 return "Text"; 4097 case 16: 4098 return Qa2(b2); 4099 case 8: 4100 return b2 === za2 ? "StrictMode" : "Mode"; 4101 case 22: 4102 return "Offscreen"; 4103 case 12: 4104 return "Profiler"; 4105 case 21: 4106 return "Scope"; 4107 case 13: 4108 return "Suspense"; 4109 case 19: 4110 return "SuspenseList"; 4111 case 25: 4112 return "TracingMarker"; 4113 case 1: 4114 case 0: 4115 case 17: 4116 case 2: 4117 case 14: 4118 case 15: 4119 if ("function" === typeof b2) return b2.displayName || b2.name || null; 4120 if ("string" === typeof b2) return b2; 4121 } 4122 return null; 4123 } 4124 function Sa2(a2) { 4125 switch (typeof a2) { 4126 case "boolean": 4127 case "number": 4128 case "string": 4129 case "undefined": 4130 return a2; 4131 case "object": 4132 return a2; 4133 default: 4134 return ""; 4135 } 4136 } 4137 function Ta2(a2) { 4138 var b2 = a2.type; 4139 return (a2 = a2.nodeName) && "input" === a2.toLowerCase() && ("checkbox" === b2 || "radio" === b2); 4140 } 4141 function Ua2(a2) { 4142 var b2 = Ta2(a2) ? "checked" : "value", c2 = Object.getOwnPropertyDescriptor(a2.constructor.prototype, b2), d2 = "" + a2[b2]; 4143 if (!a2.hasOwnProperty(b2) && "undefined" !== typeof c2 && "function" === typeof c2.get && "function" === typeof c2.set) { 4144 var e2 = c2.get, f2 = c2.set; 4145 Object.defineProperty(a2, b2, { configurable: true, get: function() { 4146 return e2.call(this); 4147 }, set: function(a3) { 4148 d2 = "" + a3; 4149 f2.call(this, a3); 4150 } }); 4151 Object.defineProperty(a2, b2, { enumerable: c2.enumerable }); 4152 return { getValue: function() { 4153 return d2; 4154 }, setValue: function(a3) { 4155 d2 = "" + a3; 4156 }, stopTracking: function() { 4157 a2._valueTracker = null; 4158 delete a2[b2]; 4159 } }; 4160 } 4161 } 4162 function Va2(a2) { 4163 a2._valueTracker || (a2._valueTracker = Ua2(a2)); 4164 } 4165 function Wa2(a2) { 4166 if (!a2) return false; 4167 var b2 = a2._valueTracker; 4168 if (!b2) return true; 4169 var c2 = b2.getValue(); 4170 var d2 = ""; 4171 a2 && (d2 = Ta2(a2) ? a2.checked ? "true" : "false" : a2.value); 4172 a2 = d2; 4173 return a2 !== c2 ? (b2.setValue(a2), true) : false; 4174 } 4175 function Xa2(a2) { 4176 a2 = a2 || ("undefined" !== typeof document ? document : void 0); 4177 if ("undefined" === typeof a2) return null; 4178 try { 4179 return a2.activeElement || a2.body; 4180 } catch (b2) { 4181 return a2.body; 4182 } 4183 } 4184 function Ya2(a2, b2) { 4185 var c2 = b2.checked; 4186 return A2({}, b2, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != c2 ? c2 : a2._wrapperState.initialChecked }); 4187 } 4188 function Za2(a2, b2) { 4189 var c2 = null == b2.defaultValue ? "" : b2.defaultValue, d2 = null != b2.checked ? b2.checked : b2.defaultChecked; 4190 c2 = Sa2(null != b2.value ? b2.value : c2); 4191 a2._wrapperState = { initialChecked: d2, initialValue: c2, controlled: "checkbox" === b2.type || "radio" === b2.type ? null != b2.checked : null != b2.value }; 4192 } 4193 function ab(a2, b2) { 4194 b2 = b2.checked; 4195 null != b2 && ta(a2, "checked", b2, false); 4196 } 4197 function bb(a2, b2) { 4198 ab(a2, b2); 4199 var c2 = Sa2(b2.value), d2 = b2.type; 4200 if (null != c2) if ("number" === d2) { 4201 if (0 === c2 && "" === a2.value || a2.value != c2) a2.value = "" + c2; 4202 } else a2.value !== "" + c2 && (a2.value = "" + c2); 4203 else if ("submit" === d2 || "reset" === d2) { 4204 a2.removeAttribute("value"); 4205 return; 4206 } 4207 b2.hasOwnProperty("value") ? cb(a2, b2.type, c2) : b2.hasOwnProperty("defaultValue") && cb(a2, b2.type, Sa2(b2.defaultValue)); 4208 null == b2.checked && null != b2.defaultChecked && (a2.defaultChecked = !!b2.defaultChecked); 4209 } 4210 function db(a2, b2, c2) { 4211 if (b2.hasOwnProperty("value") || b2.hasOwnProperty("defaultValue")) { 4212 var d2 = b2.type; 4213 if (!("submit" !== d2 && "reset" !== d2 || void 0 !== b2.value && null !== b2.value)) return; 4214 b2 = "" + a2._wrapperState.initialValue; 4215 c2 || b2 === a2.value || (a2.value = b2); 4216 a2.defaultValue = b2; 4217 } 4218 c2 = a2.name; 4219 "" !== c2 && (a2.name = ""); 4220 a2.defaultChecked = !!a2._wrapperState.initialChecked; 4221 "" !== c2 && (a2.name = c2); 4222 } 4223 function cb(a2, b2, c2) { 4224 if ("number" !== b2 || Xa2(a2.ownerDocument) !== a2) null == c2 ? a2.defaultValue = "" + a2._wrapperState.initialValue : a2.defaultValue !== "" + c2 && (a2.defaultValue = "" + c2); 4225 } 4226 var eb = Array.isArray; 4227 function fb(a2, b2, c2, d2) { 4228 a2 = a2.options; 4229 if (b2) { 4230 b2 = {}; 4231 for (var e2 = 0; e2 < c2.length; e2++) b2["$" + c2[e2]] = true; 4232 for (c2 = 0; c2 < a2.length; c2++) e2 = b2.hasOwnProperty("$" + a2[c2].value), a2[c2].selected !== e2 && (a2[c2].selected = e2), e2 && d2 && (a2[c2].defaultSelected = true); 4233 } else { 4234 c2 = "" + Sa2(c2); 4235 b2 = null; 4236 for (e2 = 0; e2 < a2.length; e2++) { 4237 if (a2[e2].value === c2) { 4238 a2[e2].selected = true; 4239 d2 && (a2[e2].defaultSelected = true); 4240 return; 4241 } 4242 null !== b2 || a2[e2].disabled || (b2 = a2[e2]); 4243 } 4244 null !== b2 && (b2.selected = true); 4245 } 4246 } 4247 function gb(a2, b2) { 4248 if (null != b2.dangerouslySetInnerHTML) throw Error(p2(91)); 4249 return A2({}, b2, { value: void 0, defaultValue: void 0, children: "" + a2._wrapperState.initialValue }); 4250 } 4251 function hb(a2, b2) { 4252 var c2 = b2.value; 4253 if (null == c2) { 4254 c2 = b2.children; 4255 b2 = b2.defaultValue; 4256 if (null != c2) { 4257 if (null != b2) throw Error(p2(92)); 4258 if (eb(c2)) { 4259 if (1 < c2.length) throw Error(p2(93)); 4260 c2 = c2[0]; 4261 } 4262 b2 = c2; 4263 } 4264 null == b2 && (b2 = ""); 4265 c2 = b2; 4266 } 4267 a2._wrapperState = { initialValue: Sa2(c2) }; 4268 } 4269 function ib(a2, b2) { 4270 var c2 = Sa2(b2.value), d2 = Sa2(b2.defaultValue); 4271 null != c2 && (c2 = "" + c2, c2 !== a2.value && (a2.value = c2), null == b2.defaultValue && a2.defaultValue !== c2 && (a2.defaultValue = c2)); 4272 null != d2 && (a2.defaultValue = "" + d2); 4273 } 4274 function jb(a2) { 4275 var b2 = a2.textContent; 4276 b2 === a2._wrapperState.initialValue && "" !== b2 && null !== b2 && (a2.value = b2); 4277 } 4278 function kb(a2) { 4279 switch (a2) { 4280 case "svg": 4281 return "http://www.w3.org/2000/svg"; 4282 case "math": 4283 return "http://www.w3.org/1998/Math/MathML"; 4284 default: 4285 return "http://www.w3.org/1999/xhtml"; 4286 } 4287 } 4288 function lb(a2, b2) { 4289 return null == a2 || "http://www.w3.org/1999/xhtml" === a2 ? kb(b2) : "http://www.w3.org/2000/svg" === a2 && "foreignObject" === b2 ? "http://www.w3.org/1999/xhtml" : a2; 4290 } 4291 var mb, nb = (function(a2) { 4292 return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b2, c2, d2, e2) { 4293 MSApp.execUnsafeLocalFunction(function() { 4294 return a2(b2, c2, d2, e2); 4295 }); 4296 } : a2; 4297 })(function(a2, b2) { 4298 if ("http://www.w3.org/2000/svg" !== a2.namespaceURI || "innerHTML" in a2) a2.innerHTML = b2; 4299 else { 4300 mb = mb || document.createElement("div"); 4301 mb.innerHTML = "<svg>" + b2.valueOf().toString() + "</svg>"; 4302 for (b2 = mb.firstChild; a2.firstChild; ) a2.removeChild(a2.firstChild); 4303 for (; b2.firstChild; ) a2.appendChild(b2.firstChild); 4304 } 4305 }); 4306 function ob(a2, b2) { 4307 if (b2) { 4308 var c2 = a2.firstChild; 4309 if (c2 && c2 === a2.lastChild && 3 === c2.nodeType) { 4310 c2.nodeValue = b2; 4311 return; 4312 } 4313 } 4314 a2.textContent = b2; 4315 } 4316 var pb = { 4317 animationIterationCount: true, 4318 aspectRatio: true, 4319 borderImageOutset: true, 4320 borderImageSlice: true, 4321 borderImageWidth: true, 4322 boxFlex: true, 4323 boxFlexGroup: true, 4324 boxOrdinalGroup: true, 4325 columnCount: true, 4326 columns: true, 4327 flex: true, 4328 flexGrow: true, 4329 flexPositive: true, 4330 flexShrink: true, 4331 flexNegative: true, 4332 flexOrder: true, 4333 gridArea: true, 4334 gridRow: true, 4335 gridRowEnd: true, 4336 gridRowSpan: true, 4337 gridRowStart: true, 4338 gridColumn: true, 4339 gridColumnEnd: true, 4340 gridColumnSpan: true, 4341 gridColumnStart: true, 4342 fontWeight: true, 4343 lineClamp: true, 4344 lineHeight: true, 4345 opacity: true, 4346 order: true, 4347 orphans: true, 4348 tabSize: true, 4349 widows: true, 4350 zIndex: true, 4351 zoom: true, 4352 fillOpacity: true, 4353 floodOpacity: true, 4354 stopOpacity: true, 4355 strokeDasharray: true, 4356 strokeDashoffset: true, 4357 strokeMiterlimit: true, 4358 strokeOpacity: true, 4359 strokeWidth: true 4360 }, qb = ["Webkit", "ms", "Moz", "O"]; 4361 Object.keys(pb).forEach(function(a2) { 4362 qb.forEach(function(b2) { 4363 b2 = b2 + a2.charAt(0).toUpperCase() + a2.substring(1); 4364 pb[b2] = pb[a2]; 4365 }); 4366 }); 4367 function rb(a2, b2, c2) { 4368 return null == b2 || "boolean" === typeof b2 || "" === b2 ? "" : c2 || "number" !== typeof b2 || 0 === b2 || pb.hasOwnProperty(a2) && pb[a2] ? ("" + b2).trim() : b2 + "px"; 4369 } 4370 function sb(a2, b2) { 4371 a2 = a2.style; 4372 for (var c2 in b2) if (b2.hasOwnProperty(c2)) { 4373 var d2 = 0 === c2.indexOf("--"), e2 = rb(c2, b2[c2], d2); 4374 "float" === c2 && (c2 = "cssFloat"); 4375 d2 ? a2.setProperty(c2, e2) : a2[c2] = e2; 4376 } 4377 } 4378 var tb = A2({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }); 4379 function ub(a2, b2) { 4380 if (b2) { 4381 if (tb[a2] && (null != b2.children || null != b2.dangerouslySetInnerHTML)) throw Error(p2(137, a2)); 4382 if (null != b2.dangerouslySetInnerHTML) { 4383 if (null != b2.children) throw Error(p2(60)); 4384 if ("object" !== typeof b2.dangerouslySetInnerHTML || !("__html" in b2.dangerouslySetInnerHTML)) throw Error(p2(61)); 4385 } 4386 if (null != b2.style && "object" !== typeof b2.style) throw Error(p2(62)); 4387 } 4388 } 4389 function vb(a2, b2) { 4390 if (-1 === a2.indexOf("-")) return "string" === typeof b2.is; 4391 switch (a2) { 4392 case "annotation-xml": 4393 case "color-profile": 4394 case "font-face": 4395 case "font-face-src": 4396 case "font-face-uri": 4397 case "font-face-format": 4398 case "font-face-name": 4399 case "missing-glyph": 4400 return false; 4401 default: 4402 return true; 4403 } 4404 } 4405 var wb = null; 4406 function xb(a2) { 4407 a2 = a2.target || a2.srcElement || window; 4408 a2.correspondingUseElement && (a2 = a2.correspondingUseElement); 4409 return 3 === a2.nodeType ? a2.parentNode : a2; 4410 } 4411 var yb = null, zb = null, Ab = null; 4412 function Bb(a2) { 4413 if (a2 = Cb(a2)) { 4414 if ("function" !== typeof yb) throw Error(p2(280)); 4415 var b2 = a2.stateNode; 4416 b2 && (b2 = Db(b2), yb(a2.stateNode, a2.type, b2)); 4417 } 4418 } 4419 function Eb(a2) { 4420 zb ? Ab ? Ab.push(a2) : Ab = [a2] : zb = a2; 4421 } 4422 function Fb() { 4423 if (zb) { 4424 var a2 = zb, b2 = Ab; 4425 Ab = zb = null; 4426 Bb(a2); 4427 if (b2) for (a2 = 0; a2 < b2.length; a2++) Bb(b2[a2]); 4428 } 4429 } 4430 function Gb(a2, b2) { 4431 return a2(b2); 4432 } 4433 function Hb() { 4434 } 4435 var Ib = false; 4436 function Jb(a2, b2, c2) { 4437 if (Ib) return a2(b2, c2); 4438 Ib = true; 4439 try { 4440 return Gb(a2, b2, c2); 4441 } finally { 4442 if (Ib = false, null !== zb || null !== Ab) Hb(), Fb(); 4443 } 4444 } 4445 function Kb(a2, b2) { 4446 var c2 = a2.stateNode; 4447 if (null === c2) return null; 4448 var d2 = Db(c2); 4449 if (null === d2) return null; 4450 c2 = d2[b2]; 4451 a: switch (b2) { 4452 case "onClick": 4453 case "onClickCapture": 4454 case "onDoubleClick": 4455 case "onDoubleClickCapture": 4456 case "onMouseDown": 4457 case "onMouseDownCapture": 4458 case "onMouseMove": 4459 case "onMouseMoveCapture": 4460 case "onMouseUp": 4461 case "onMouseUpCapture": 4462 case "onMouseEnter": 4463 (d2 = !d2.disabled) || (a2 = a2.type, d2 = !("button" === a2 || "input" === a2 || "select" === a2 || "textarea" === a2)); 4464 a2 = !d2; 4465 break a; 4466 default: 4467 a2 = false; 4468 } 4469 if (a2) return null; 4470 if (c2 && "function" !== typeof c2) throw Error(p2(231, b2, typeof c2)); 4471 return c2; 4472 } 4473 var Lb = false; 4474 if (ia) try { 4475 var Mb = {}; 4476 Object.defineProperty(Mb, "passive", { get: function() { 4477 Lb = true; 4478 } }); 4479 window.addEventListener("test", Mb, Mb); 4480 window.removeEventListener("test", Mb, Mb); 4481 } catch (a2) { 4482 Lb = false; 4483 } 4484 function Nb(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 4485 var l2 = Array.prototype.slice.call(arguments, 3); 4486 try { 4487 b2.apply(c2, l2); 4488 } catch (m2) { 4489 this.onError(m2); 4490 } 4491 } 4492 var Ob = false, Pb = null, Qb = false, Rb = null, Sb = { onError: function(a2) { 4493 Ob = true; 4494 Pb = a2; 4495 } }; 4496 function Tb(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 4497 Ob = false; 4498 Pb = null; 4499 Nb.apply(Sb, arguments); 4500 } 4501 function Ub(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 4502 Tb.apply(this, arguments); 4503 if (Ob) { 4504 if (Ob) { 4505 var l2 = Pb; 4506 Ob = false; 4507 Pb = null; 4508 } else throw Error(p2(198)); 4509 Qb || (Qb = true, Rb = l2); 4510 } 4511 } 4512 function Vb(a2) { 4513 var b2 = a2, c2 = a2; 4514 if (a2.alternate) for (; b2.return; ) b2 = b2.return; 4515 else { 4516 a2 = b2; 4517 do 4518 b2 = a2, 0 !== (b2.flags & 4098) && (c2 = b2.return), a2 = b2.return; 4519 while (a2); 4520 } 4521 return 3 === b2.tag ? c2 : null; 4522 } 4523 function Wb(a2) { 4524 if (13 === a2.tag) { 4525 var b2 = a2.memoizedState; 4526 null === b2 && (a2 = a2.alternate, null !== a2 && (b2 = a2.memoizedState)); 4527 if (null !== b2) return b2.dehydrated; 4528 } 4529 return null; 4530 } 4531 function Xb(a2) { 4532 if (Vb(a2) !== a2) throw Error(p2(188)); 4533 } 4534 function Yb(a2) { 4535 var b2 = a2.alternate; 4536 if (!b2) { 4537 b2 = Vb(a2); 4538 if (null === b2) throw Error(p2(188)); 4539 return b2 !== a2 ? null : a2; 4540 } 4541 for (var c2 = a2, d2 = b2; ; ) { 4542 var e2 = c2.return; 4543 if (null === e2) break; 4544 var f2 = e2.alternate; 4545 if (null === f2) { 4546 d2 = e2.return; 4547 if (null !== d2) { 4548 c2 = d2; 4549 continue; 4550 } 4551 break; 4552 } 4553 if (e2.child === f2.child) { 4554 for (f2 = e2.child; f2; ) { 4555 if (f2 === c2) return Xb(e2), a2; 4556 if (f2 === d2) return Xb(e2), b2; 4557 f2 = f2.sibling; 4558 } 4559 throw Error(p2(188)); 4560 } 4561 if (c2.return !== d2.return) c2 = e2, d2 = f2; 4562 else { 4563 for (var g2 = false, h2 = e2.child; h2; ) { 4564 if (h2 === c2) { 4565 g2 = true; 4566 c2 = e2; 4567 d2 = f2; 4568 break; 4569 } 4570 if (h2 === d2) { 4571 g2 = true; 4572 d2 = e2; 4573 c2 = f2; 4574 break; 4575 } 4576 h2 = h2.sibling; 4577 } 4578 if (!g2) { 4579 for (h2 = f2.child; h2; ) { 4580 if (h2 === c2) { 4581 g2 = true; 4582 c2 = f2; 4583 d2 = e2; 4584 break; 4585 } 4586 if (h2 === d2) { 4587 g2 = true; 4588 d2 = f2; 4589 c2 = e2; 4590 break; 4591 } 4592 h2 = h2.sibling; 4593 } 4594 if (!g2) throw Error(p2(189)); 4595 } 4596 } 4597 if (c2.alternate !== d2) throw Error(p2(190)); 4598 } 4599 if (3 !== c2.tag) throw Error(p2(188)); 4600 return c2.stateNode.current === c2 ? a2 : b2; 4601 } 4602 function Zb(a2) { 4603 a2 = Yb(a2); 4604 return null !== a2 ? $b(a2) : null; 4605 } 4606 function $b(a2) { 4607 if (5 === a2.tag || 6 === a2.tag) return a2; 4608 for (a2 = a2.child; null !== a2; ) { 4609 var b2 = $b(a2); 4610 if (null !== b2) return b2; 4611 a2 = a2.sibling; 4612 } 4613 return null; 4614 } 4615 var ac = ca2.unstable_scheduleCallback, bc = ca2.unstable_cancelCallback, cc = ca2.unstable_shouldYield, dc = ca2.unstable_requestPaint, B2 = ca2.unstable_now, ec = ca2.unstable_getCurrentPriorityLevel, fc = ca2.unstable_ImmediatePriority, gc = ca2.unstable_UserBlockingPriority, hc = ca2.unstable_NormalPriority, ic = ca2.unstable_LowPriority, jc = ca2.unstable_IdlePriority, kc = null, lc = null; 4616 function mc(a2) { 4617 if (lc && "function" === typeof lc.onCommitFiberRoot) try { 4618 lc.onCommitFiberRoot(kc, a2, void 0, 128 === (a2.current.flags & 128)); 4619 } catch (b2) { 4620 } 4621 } 4622 var oc = Math.clz32 ? Math.clz32 : nc, pc = Math.log, qc = Math.LN2; 4623 function nc(a2) { 4624 a2 >>>= 0; 4625 return 0 === a2 ? 32 : 31 - (pc(a2) / qc | 0) | 0; 4626 } 4627 var rc = 64, sc = 4194304; 4628 function tc(a2) { 4629 switch (a2 & -a2) { 4630 case 1: 4631 return 1; 4632 case 2: 4633 return 2; 4634 case 4: 4635 return 4; 4636 case 8: 4637 return 8; 4638 case 16: 4639 return 16; 4640 case 32: 4641 return 32; 4642 case 64: 4643 case 128: 4644 case 256: 4645 case 512: 4646 case 1024: 4647 case 2048: 4648 case 4096: 4649 case 8192: 4650 case 16384: 4651 case 32768: 4652 case 65536: 4653 case 131072: 4654 case 262144: 4655 case 524288: 4656 case 1048576: 4657 case 2097152: 4658 return a2 & 4194240; 4659 case 4194304: 4660 case 8388608: 4661 case 16777216: 4662 case 33554432: 4663 case 67108864: 4664 return a2 & 130023424; 4665 case 134217728: 4666 return 134217728; 4667 case 268435456: 4668 return 268435456; 4669 case 536870912: 4670 return 536870912; 4671 case 1073741824: 4672 return 1073741824; 4673 default: 4674 return a2; 4675 } 4676 } 4677 function uc(a2, b2) { 4678 var c2 = a2.pendingLanes; 4679 if (0 === c2) return 0; 4680 var d2 = 0, e2 = a2.suspendedLanes, f2 = a2.pingedLanes, g2 = c2 & 268435455; 4681 if (0 !== g2) { 4682 var h2 = g2 & ~e2; 4683 0 !== h2 ? d2 = tc(h2) : (f2 &= g2, 0 !== f2 && (d2 = tc(f2))); 4684 } else g2 = c2 & ~e2, 0 !== g2 ? d2 = tc(g2) : 0 !== f2 && (d2 = tc(f2)); 4685 if (0 === d2) return 0; 4686 if (0 !== b2 && b2 !== d2 && 0 === (b2 & e2) && (e2 = d2 & -d2, f2 = b2 & -b2, e2 >= f2 || 16 === e2 && 0 !== (f2 & 4194240))) return b2; 4687 0 !== (d2 & 4) && (d2 |= c2 & 16); 4688 b2 = a2.entangledLanes; 4689 if (0 !== b2) for (a2 = a2.entanglements, b2 &= d2; 0 < b2; ) c2 = 31 - oc(b2), e2 = 1 << c2, d2 |= a2[c2], b2 &= ~e2; 4690 return d2; 4691 } 4692 function vc(a2, b2) { 4693 switch (a2) { 4694 case 1: 4695 case 2: 4696 case 4: 4697 return b2 + 250; 4698 case 8: 4699 case 16: 4700 case 32: 4701 case 64: 4702 case 128: 4703 case 256: 4704 case 512: 4705 case 1024: 4706 case 2048: 4707 case 4096: 4708 case 8192: 4709 case 16384: 4710 case 32768: 4711 case 65536: 4712 case 131072: 4713 case 262144: 4714 case 524288: 4715 case 1048576: 4716 case 2097152: 4717 return b2 + 5e3; 4718 case 4194304: 4719 case 8388608: 4720 case 16777216: 4721 case 33554432: 4722 case 67108864: 4723 return -1; 4724 case 134217728: 4725 case 268435456: 4726 case 536870912: 4727 case 1073741824: 4728 return -1; 4729 default: 4730 return -1; 4731 } 4732 } 4733 function wc(a2, b2) { 4734 for (var c2 = a2.suspendedLanes, d2 = a2.pingedLanes, e2 = a2.expirationTimes, f2 = a2.pendingLanes; 0 < f2; ) { 4735 var g2 = 31 - oc(f2), h2 = 1 << g2, k2 = e2[g2]; 4736 if (-1 === k2) { 4737 if (0 === (h2 & c2) || 0 !== (h2 & d2)) e2[g2] = vc(h2, b2); 4738 } else k2 <= b2 && (a2.expiredLanes |= h2); 4739 f2 &= ~h2; 4740 } 4741 } 4742 function xc(a2) { 4743 a2 = a2.pendingLanes & -1073741825; 4744 return 0 !== a2 ? a2 : a2 & 1073741824 ? 1073741824 : 0; 4745 } 4746 function yc2() { 4747 var a2 = rc; 4748 rc <<= 1; 4749 0 === (rc & 4194240) && (rc = 64); 4750 return a2; 4751 } 4752 function zc(a2) { 4753 for (var b2 = [], c2 = 0; 31 > c2; c2++) b2.push(a2); 4754 return b2; 4755 } 4756 function Ac(a2, b2, c2) { 4757 a2.pendingLanes |= b2; 4758 536870912 !== b2 && (a2.suspendedLanes = 0, a2.pingedLanes = 0); 4759 a2 = a2.eventTimes; 4760 b2 = 31 - oc(b2); 4761 a2[b2] = c2; 4762 } 4763 function Bc2(a2, b2) { 4764 var c2 = a2.pendingLanes & ~b2; 4765 a2.pendingLanes = b2; 4766 a2.suspendedLanes = 0; 4767 a2.pingedLanes = 0; 4768 a2.expiredLanes &= b2; 4769 a2.mutableReadLanes &= b2; 4770 a2.entangledLanes &= b2; 4771 b2 = a2.entanglements; 4772 var d2 = a2.eventTimes; 4773 for (a2 = a2.expirationTimes; 0 < c2; ) { 4774 var e2 = 31 - oc(c2), f2 = 1 << e2; 4775 b2[e2] = 0; 4776 d2[e2] = -1; 4777 a2[e2] = -1; 4778 c2 &= ~f2; 4779 } 4780 } 4781 function Cc(a2, b2) { 4782 var c2 = a2.entangledLanes |= b2; 4783 for (a2 = a2.entanglements; c2; ) { 4784 var d2 = 31 - oc(c2), e2 = 1 << d2; 4785 e2 & b2 | a2[d2] & b2 && (a2[d2] |= b2); 4786 c2 &= ~e2; 4787 } 4788 } 4789 var C2 = 0; 4790 function Dc(a2) { 4791 a2 &= -a2; 4792 return 1 < a2 ? 4 < a2 ? 0 !== (a2 & 268435455) ? 16 : 536870912 : 4 : 1; 4793 } 4794 var Ec, Fc, Gc, Hc, Ic, Jc = false, Kc = [], Lc = null, Mc = null, Nc = null, Oc = /* @__PURE__ */ new Map(), Pc = /* @__PURE__ */ new Map(), Qc = [], Rc = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); 4795 function Sc(a2, b2) { 4796 switch (a2) { 4797 case "focusin": 4798 case "focusout": 4799 Lc = null; 4800 break; 4801 case "dragenter": 4802 case "dragleave": 4803 Mc = null; 4804 break; 4805 case "mouseover": 4806 case "mouseout": 4807 Nc = null; 4808 break; 4809 case "pointerover": 4810 case "pointerout": 4811 Oc.delete(b2.pointerId); 4812 break; 4813 case "gotpointercapture": 4814 case "lostpointercapture": 4815 Pc.delete(b2.pointerId); 4816 } 4817 } 4818 function Tc(a2, b2, c2, d2, e2, f2) { 4819 if (null === a2 || a2.nativeEvent !== f2) return a2 = { blockedOn: b2, domEventName: c2, eventSystemFlags: d2, nativeEvent: f2, targetContainers: [e2] }, null !== b2 && (b2 = Cb(b2), null !== b2 && Fc(b2)), a2; 4820 a2.eventSystemFlags |= d2; 4821 b2 = a2.targetContainers; 4822 null !== e2 && -1 === b2.indexOf(e2) && b2.push(e2); 4823 return a2; 4824 } 4825 function Uc(a2, b2, c2, d2, e2) { 4826 switch (b2) { 4827 case "focusin": 4828 return Lc = Tc(Lc, a2, b2, c2, d2, e2), true; 4829 case "dragenter": 4830 return Mc = Tc(Mc, a2, b2, c2, d2, e2), true; 4831 case "mouseover": 4832 return Nc = Tc(Nc, a2, b2, c2, d2, e2), true; 4833 case "pointerover": 4834 var f2 = e2.pointerId; 4835 Oc.set(f2, Tc(Oc.get(f2) || null, a2, b2, c2, d2, e2)); 4836 return true; 4837 case "gotpointercapture": 4838 return f2 = e2.pointerId, Pc.set(f2, Tc(Pc.get(f2) || null, a2, b2, c2, d2, e2)), true; 4839 } 4840 return false; 4841 } 4842 function Vc(a2) { 4843 var b2 = Wc(a2.target); 4844 if (null !== b2) { 4845 var c2 = Vb(b2); 4846 if (null !== c2) { 4847 if (b2 = c2.tag, 13 === b2) { 4848 if (b2 = Wb(c2), null !== b2) { 4849 a2.blockedOn = b2; 4850 Ic(a2.priority, function() { 4851 Gc(c2); 4852 }); 4853 return; 4854 } 4855 } else if (3 === b2 && c2.stateNode.current.memoizedState.isDehydrated) { 4856 a2.blockedOn = 3 === c2.tag ? c2.stateNode.containerInfo : null; 4857 return; 4858 } 4859 } 4860 } 4861 a2.blockedOn = null; 4862 } 4863 function Xc(a2) { 4864 if (null !== a2.blockedOn) return false; 4865 for (var b2 = a2.targetContainers; 0 < b2.length; ) { 4866 var c2 = Yc(a2.domEventName, a2.eventSystemFlags, b2[0], a2.nativeEvent); 4867 if (null === c2) { 4868 c2 = a2.nativeEvent; 4869 var d2 = new c2.constructor(c2.type, c2); 4870 wb = d2; 4871 c2.target.dispatchEvent(d2); 4872 wb = null; 4873 } else return b2 = Cb(c2), null !== b2 && Fc(b2), a2.blockedOn = c2, false; 4874 b2.shift(); 4875 } 4876 return true; 4877 } 4878 function Zc(a2, b2, c2) { 4879 Xc(a2) && c2.delete(b2); 4880 } 4881 function $c() { 4882 Jc = false; 4883 null !== Lc && Xc(Lc) && (Lc = null); 4884 null !== Mc && Xc(Mc) && (Mc = null); 4885 null !== Nc && Xc(Nc) && (Nc = null); 4886 Oc.forEach(Zc); 4887 Pc.forEach(Zc); 4888 } 4889 function ad(a2, b2) { 4890 a2.blockedOn === b2 && (a2.blockedOn = null, Jc || (Jc = true, ca2.unstable_scheduleCallback(ca2.unstable_NormalPriority, $c))); 4891 } 4892 function bd(a2) { 4893 function b2(b3) { 4894 return ad(b3, a2); 4895 } 4896 if (0 < Kc.length) { 4897 ad(Kc[0], a2); 4898 for (var c2 = 1; c2 < Kc.length; c2++) { 4899 var d2 = Kc[c2]; 4900 d2.blockedOn === a2 && (d2.blockedOn = null); 4901 } 4902 } 4903 null !== Lc && ad(Lc, a2); 4904 null !== Mc && ad(Mc, a2); 4905 null !== Nc && ad(Nc, a2); 4906 Oc.forEach(b2); 4907 Pc.forEach(b2); 4908 for (c2 = 0; c2 < Qc.length; c2++) d2 = Qc[c2], d2.blockedOn === a2 && (d2.blockedOn = null); 4909 for (; 0 < Qc.length && (c2 = Qc[0], null === c2.blockedOn); ) Vc(c2), null === c2.blockedOn && Qc.shift(); 4910 } 4911 var cd = ua2.ReactCurrentBatchConfig, dd = true; 4912 function ed(a2, b2, c2, d2) { 4913 var e2 = C2, f2 = cd.transition; 4914 cd.transition = null; 4915 try { 4916 C2 = 1, fd(a2, b2, c2, d2); 4917 } finally { 4918 C2 = e2, cd.transition = f2; 4919 } 4920 } 4921 function gd(a2, b2, c2, d2) { 4922 var e2 = C2, f2 = cd.transition; 4923 cd.transition = null; 4924 try { 4925 C2 = 4, fd(a2, b2, c2, d2); 4926 } finally { 4927 C2 = e2, cd.transition = f2; 4928 } 4929 } 4930 function fd(a2, b2, c2, d2) { 4931 if (dd) { 4932 var e2 = Yc(a2, b2, c2, d2); 4933 if (null === e2) hd(a2, b2, d2, id2, c2), Sc(a2, d2); 4934 else if (Uc(e2, a2, b2, c2, d2)) d2.stopPropagation(); 4935 else if (Sc(a2, d2), b2 & 4 && -1 < Rc.indexOf(a2)) { 4936 for (; null !== e2; ) { 4937 var f2 = Cb(e2); 4938 null !== f2 && Ec(f2); 4939 f2 = Yc(a2, b2, c2, d2); 4940 null === f2 && hd(a2, b2, d2, id2, c2); 4941 if (f2 === e2) break; 4942 e2 = f2; 4943 } 4944 null !== e2 && d2.stopPropagation(); 4945 } else hd(a2, b2, d2, null, c2); 4946 } 4947 } 4948 var id2 = null; 4949 function Yc(a2, b2, c2, d2) { 4950 id2 = null; 4951 a2 = xb(d2); 4952 a2 = Wc(a2); 4953 if (null !== a2) if (b2 = Vb(a2), null === b2) a2 = null; 4954 else if (c2 = b2.tag, 13 === c2) { 4955 a2 = Wb(b2); 4956 if (null !== a2) return a2; 4957 a2 = null; 4958 } else if (3 === c2) { 4959 if (b2.stateNode.current.memoizedState.isDehydrated) return 3 === b2.tag ? b2.stateNode.containerInfo : null; 4960 a2 = null; 4961 } else b2 !== a2 && (a2 = null); 4962 id2 = a2; 4963 return null; 4964 }
4965 function jd(a2) { 4966 switch (a2) { 4967 case "cancel": 4968 case "click": 4969 case "close": 4970 case "contextmenu": 4971 case "copy": 4972 case "cut": 4973 case "auxclick": 4974 case "dblclick": 4975 case "dragend": 4976 case "dragstart": 4977 case "drop": 4978 case "focusin": 4979 case "focusout": 4980 case "input": 4981 case "invalid": 4982 case "keydown": 4983 case "keypress": 4984 case "keyup": 4985 case "mousedown": 4986 case "mouseup": 4987 case "paste": 4988 case "pause": 4989 case "play": 4990 case "pointercancel": 4991 case "pointerdown": 4992 case "pointerup": 4993 case "ratechange": 4994 case "reset": 4995 case "resize": 4996 case "seeked": 4997 case "submit": 4998 case "touchcancel": 4999 case "touchend": 5000 case "touchstart": 5001 case "volumechange": 5002 case "change": 5003 case "selectionchange": 5004 case "textInput": 5005 case "compositionstart": 5006 case "compositionend": 5007 case "compositionupdate": 5008 case "beforeblur": 5009 case "afterblur": 5010 case "beforeinput": 5011 case "blur": 5012 case "fullscreenchange": 5013 case "focus": 5014 case "hashchange": 5015 case "popstate": 5016 case "select": 5017 case "selectstart": 5018 return 1; 5019 case "drag": 5020 case "dragenter": 5021 case "dragexit": 5022 case "dragleave": 5023 case "dragover": 5024 case "mousemove": 5025 case "mouseout": 5026 case "mouseover": 5027 case "pointermove": 5028 case "pointerout": 5029 case "pointerover": 5030 case "scroll": 5031 case "toggle": 5032 case "touchmove": 5033 case "wheel": 5034 case "mouseenter": 5035 case "mouseleave": 5036 case "pointerenter": 5037 case "pointerleave": 5038 return 4; 5039 case "message": 5040 switch (ec()) { 5041 case fc: 5042 return 1; 5043 case gc: 5044 return 4; 5045 case hc: 5046 case ic: 5047 return 16; 5048 case jc: 5049 return 536870912; 5050 default: 5051 return 16; 5052 } 5053 default: 5054 return 16; 5055 } 5056 } 5057 var kd = null, ld = null, md = null;
vendor: 113,308 bytes, lines 5058-7845
5058 function nd() { 5059 if (md) return md; 5060 var a2, b2 = ld, c2 = b2.length, d2, e2 = "value" in kd ? kd.value : kd.textContent, f2 = e2.length; 5061 for (a2 = 0; a2 < c2 && b2[a2] === e2[a2]; a2++) ; 5062 var g2 = c2 - a2; 5063 for (d2 = 1; d2 <= g2 && b2[c2 - d2] === e2[f2 - d2]; d2++) ; 5064 return md = e2.slice(a2, 1 < d2 ? 1 - d2 : void 0); 5065 } 5066 function od(a2) { 5067 var b2 = a2.keyCode; 5068 "charCode" in a2 ? (a2 = a2.charCode, 0 === a2 && 13 === b2 && (a2 = 13)) : a2 = b2; 5069 10 === a2 && (a2 = 13); 5070 return 32 <= a2 || 13 === a2 ? a2 : 0; 5071 } 5072 function pd() { 5073 return true; 5074 } 5075 function qd() { 5076 return false; 5077 } 5078 function rd(a2) { 5079 function b2(b3, d2, e2, f2, g2) { 5080 this._reactName = b3; 5081 this._targetInst = e2; 5082 this.type = d2; 5083 this.nativeEvent = f2; 5084 this.target = g2; 5085 this.currentTarget = null; 5086 for (var c2 in a2) a2.hasOwnProperty(c2) && (b3 = a2[c2], this[c2] = b3 ? b3(f2) : f2[c2]); 5087 this.isDefaultPrevented = (null != f2.defaultPrevented ? f2.defaultPrevented : false === f2.returnValue) ? pd : qd; 5088 this.isPropagationStopped = qd; 5089 return this; 5090 } 5091 A2(b2.prototype, { preventDefault: function() { 5092 this.defaultPrevented = true; 5093 var a3 = this.nativeEvent; 5094 a3 && (a3.preventDefault ? a3.preventDefault() : "unknown" !== typeof a3.returnValue && (a3.returnValue = false), this.isDefaultPrevented = pd); 5095 }, stopPropagation: function() { 5096 var a3 = this.nativeEvent; 5097 a3 && (a3.stopPropagation ? a3.stopPropagation() : "unknown" !== typeof a3.cancelBubble && (a3.cancelBubble = true), this.isPropagationStopped = pd); 5098 }, persist: function() { 5099 }, isPersistent: pd }); 5100 return b2; 5101 } 5102 var sd = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(a2) { 5103 return a2.timeStamp || Date.now(); 5104 }, defaultPrevented: 0, isTrusted: 0 }, td = rd(sd), ud = A2({}, sd, { view: 0, detail: 0 }), vd = rd(ud), wd, xd, yd, Ad = A2({}, ud, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: zd, button: 0, buttons: 0, relatedTarget: function(a2) { 5105 return void 0 === a2.relatedTarget ? a2.fromElement === a2.srcElement ? a2.toElement : a2.fromElement : a2.relatedTarget; 5106 }, movementX: function(a2) { 5107 if ("movementX" in a2) return a2.movementX; 5108 a2 !== yd && (yd && "mousemove" === a2.type ? (wd = a2.screenX - yd.screenX, xd = a2.screenY - yd.screenY) : xd = wd = 0, yd = a2); 5109 return wd; 5110 }, movementY: function(a2) { 5111 return "movementY" in a2 ? a2.movementY : xd; 5112 } }), Bd = rd(Ad), Cd = A2({}, Ad, { dataTransfer: 0 }), Dd = rd(Cd), Ed = A2({}, ud, { relatedTarget: 0 }), Fd = rd(Ed), Gd = A2({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Hd = rd(Gd), Id = A2({}, sd, { clipboardData: function(a2) { 5113 return "clipboardData" in a2 ? a2.clipboardData : window.clipboardData; 5114 } }), Jd = rd(Id), Kd = A2({}, sd, { data: 0 }), Ld = rd(Kd), Md = { 5115 Esc: "Escape", 5116 Spacebar: " ", 5117 Left: "ArrowLeft", 5118 Up: "ArrowUp", 5119 Right: "ArrowRight", 5120 Down: "ArrowDown", 5121 Del: "Delete", 5122 Win: "OS", 5123 Menu: "ContextMenu", 5124 Apps: "ContextMenu", 5125 Scroll: "ScrollLock", 5126 MozPrintableKey: "Unidentified" 5127 }, Nd = { 5128 8: "Backspace", 5129 9: "Tab", 5130 12: "Clear", 5131 13: "Enter", 5132 16: "Shift", 5133 17: "Control", 5134 18: "Alt", 5135 19: "Pause", 5136 20: "CapsLock", 5137 27: "Escape", 5138 32: " ", 5139 33: "PageUp", 5140 34: "PageDown", 5141 35: "End", 5142 36: "Home", 5143 37: "ArrowLeft", 5144 38: "ArrowUp", 5145 39: "ArrowRight", 5146 40: "ArrowDown", 5147 45: "Insert", 5148 46: "Delete", 5149 112: "F1", 5150 113: "F2", 5151 114: "F3", 5152 115: "F4", 5153 116: "F5", 5154 117: "F6", 5155 118: "F7", 5156 119: "F8", 5157 120: "F9", 5158 121: "F10", 5159 122: "F11", 5160 123: "F12", 5161 144: "NumLock", 5162 145: "ScrollLock", 5163 224: "Meta" 5164 }, Od = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; 5165 function Pd(a2) { 5166 var b2 = this.nativeEvent; 5167 return b2.getModifierState ? b2.getModifierState(a2) : (a2 = Od[a2]) ? !!b2[a2] : false; 5168 } 5169 function zd() { 5170 return Pd; 5171 } 5172 var Qd = A2({}, ud, { key: function(a2) { 5173 if (a2.key) { 5174 var b2 = Md[a2.key] || a2.key; 5175 if ("Unidentified" !== b2) return b2; 5176 } 5177 return "keypress" === a2.type ? (a2 = od(a2), 13 === a2 ? "Enter" : String.fromCharCode(a2)) : "keydown" === a2.type || "keyup" === a2.type ? Nd[a2.keyCode] || "Unidentified" : ""; 5178 }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: zd, charCode: function(a2) { 5179 return "keypress" === a2.type ? od(a2) : 0; 5180 }, keyCode: function(a2) { 5181 return "keydown" === a2.type || "keyup" === a2.type ? a2.keyCode : 0; 5182 }, which: function(a2) { 5183 return "keypress" === a2.type ? od(a2) : "keydown" === a2.type || "keyup" === a2.type ? a2.keyCode : 0; 5184 } }), Rd = rd(Qd), Sd = A2({}, Ad, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Td = rd(Sd), Ud = A2({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: zd }), Vd = rd(Ud), Wd = A2({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Xd = rd(Wd), Yd = A2({}, Ad, { 5185 deltaX: function(a2) { 5186 return "deltaX" in a2 ? a2.deltaX : "wheelDeltaX" in a2 ? -a2.wheelDeltaX : 0; 5187 }, 5188 deltaY: function(a2) { 5189 return "deltaY" in a2 ? a2.deltaY : "wheelDeltaY" in a2 ? -a2.wheelDeltaY : "wheelDelta" in a2 ? -a2.wheelDelta : 0; 5190 }, 5191 deltaZ: 0, 5192 deltaMode: 0 5193 }), Zd = rd(Yd), $d = [9, 13, 27, 32], ae2 = ia && "CompositionEvent" in window, be2 = null; 5194 ia && "documentMode" in document && (be2 = document.documentMode); 5195 var ce2 = ia && "TextEvent" in window && !be2, de2 = ia && (!ae2 || be2 && 8 < be2 && 11 >= be2), ee2 = String.fromCharCode(32), fe2 = false; 5196 function ge2(a2, b2) { 5197 switch (a2) { 5198 case "keyup": 5199 return -1 !== $d.indexOf(b2.keyCode); 5200 case "keydown": 5201 return 229 !== b2.keyCode; 5202 case "keypress": 5203 case "mousedown": 5204 case "focusout": 5205 return true; 5206 default: 5207 return false; 5208 } 5209 } 5210 function he2(a2) { 5211 a2 = a2.detail; 5212 return "object" === typeof a2 && "data" in a2 ? a2.data : null; 5213 } 5214 var ie2 = false; 5215 function je2(a2, b2) { 5216 switch (a2) { 5217 case "compositionend": 5218 return he2(b2); 5219 case "keypress": 5220 if (32 !== b2.which) return null; 5221 fe2 = true; 5222 return ee2; 5223 case "textInput": 5224 return a2 = b2.data, a2 === ee2 && fe2 ? null : a2; 5225 default: 5226 return null; 5227 } 5228 } 5229 function ke2(a2, b2) { 5230 if (ie2) return "compositionend" === a2 || !ae2 && ge2(a2, b2) ? (a2 = nd(), md = ld = kd = null, ie2 = false, a2) : null; 5231 switch (a2) { 5232 case "paste": 5233 return null; 5234 case "keypress": 5235 if (!(b2.ctrlKey || b2.altKey || b2.metaKey) || b2.ctrlKey && b2.altKey) { 5236 if (b2.char && 1 < b2.char.length) return b2.char; 5237 if (b2.which) return String.fromCharCode(b2.which); 5238 } 5239 return null; 5240 case "compositionend": 5241 return de2 && "ko" !== b2.locale ? null : b2.data; 5242 default: 5243 return null; 5244 } 5245 } 5246 var le2 = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; 5247 function me2(a2) { 5248 var b2 = a2 && a2.nodeName && a2.nodeName.toLowerCase(); 5249 return "input" === b2 ? !!le2[a2.type] : "textarea" === b2 ? true : false; 5250 } 5251 function ne2(a2, b2, c2, d2) { 5252 Eb(d2); 5253 b2 = oe2(b2, "onChange"); 5254 0 < b2.length && (c2 = new td("onChange", "change", null, c2, d2), a2.push({ event: c2, listeners: b2 })); 5255 } 5256 var pe2 = null, qe2 = null; 5257 function re2(a2) { 5258 se2(a2, 0); 5259 } 5260 function te2(a2) { 5261 var b2 = ue2(a2); 5262 if (Wa2(b2)) return a2; 5263 } 5264 function ve2(a2, b2) { 5265 if ("change" === a2) return b2; 5266 } 5267 var we2 = false; 5268 if (ia) { 5269 var xe2; 5270 if (ia) { 5271 var ye2 = "oninput" in document; 5272 if (!ye2) { 5273 var ze2 = document.createElement("div"); 5274 ze2.setAttribute("oninput", "return;"); 5275 ye2 = "function" === typeof ze2.oninput; 5276 } 5277 xe2 = ye2; 5278 } else xe2 = false; 5279 we2 = xe2 && (!document.documentMode || 9 < document.documentMode); 5280 } 5281 function Ae2() { 5282 pe2 && (pe2.detachEvent("onpropertychange", Be2), qe2 = pe2 = null); 5283 } 5284 function Be2(a2) { 5285 if ("value" === a2.propertyName && te2(qe2)) { 5286 var b2 = []; 5287 ne2(b2, qe2, a2, xb(a2)); 5288 Jb(re2, b2); 5289 } 5290 } 5291 function Ce2(a2, b2, c2) { 5292 "focusin" === a2 ? (Ae2(), pe2 = b2, qe2 = c2, pe2.attachEvent("onpropertychange", Be2)) : "focusout" === a2 && Ae2(); 5293 } 5294 function De2(a2) { 5295 if ("selectionchange" === a2 || "keyup" === a2 || "keydown" === a2) return te2(qe2); 5296 } 5297 function Ee2(a2, b2) { 5298 if ("click" === a2) return te2(b2); 5299 } 5300 function Fe2(a2, b2) { 5301 if ("input" === a2 || "change" === a2) return te2(b2); 5302 } 5303 function Ge2(a2, b2) { 5304 return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2; 5305 } 5306 var He2 = "function" === typeof Object.is ? Object.is : Ge2; 5307 function Ie2(a2, b2) { 5308 if (He2(a2, b2)) return true; 5309 if ("object" !== typeof a2 || null === a2 || "object" !== typeof b2 || null === b2) return false; 5310 var c2 = Object.keys(a2), d2 = Object.keys(b2); 5311 if (c2.length !== d2.length) return false; 5312 for (d2 = 0; d2 < c2.length; d2++) { 5313 var e2 = c2[d2]; 5314 if (!ja2.call(b2, e2) || !He2(a2[e2], b2[e2])) return false; 5315 } 5316 return true; 5317 } 5318 function Je2(a2) { 5319 for (; a2 && a2.firstChild; ) a2 = a2.firstChild; 5320 return a2; 5321 } 5322 function Ke2(a2, b2) { 5323 var c2 = Je2(a2); 5324 a2 = 0; 5325 for (var d2; c2; ) { 5326 if (3 === c2.nodeType) { 5327 d2 = a2 + c2.textContent.length; 5328 if (a2 <= b2 && d2 >= b2) return { node: c2, offset: b2 - a2 }; 5329 a2 = d2; 5330 } 5331 a: { 5332 for (; c2; ) { 5333 if (c2.nextSibling) { 5334 c2 = c2.nextSibling; 5335 break a; 5336 } 5337 c2 = c2.parentNode; 5338 } 5339 c2 = void 0; 5340 } 5341 c2 = Je2(c2); 5342 } 5343 } 5344 function Le2(a2, b2) { 5345 return a2 && b2 ? a2 === b2 ? true : a2 && 3 === a2.nodeType ? false : b2 && 3 === b2.nodeType ? Le2(a2, b2.parentNode) : "contains" in a2 ? a2.contains(b2) : a2.compareDocumentPosition ? !!(a2.compareDocumentPosition(b2) & 16) : false : false; 5346 } 5347 function Me2() { 5348 for (var a2 = window, b2 = Xa2(); b2 instanceof a2.HTMLIFrameElement; ) { 5349 try { 5350 var c2 = "string" === typeof b2.contentWindow.location.href; 5351 } catch (d2) { 5352 c2 = false; 5353 } 5354 if (c2) a2 = b2.contentWindow; 5355 else break; 5356 b2 = Xa2(a2.document); 5357 } 5358 return b2; 5359 } 5360 function Ne2(a2) { 5361 var b2 = a2 && a2.nodeName && a2.nodeName.toLowerCase(); 5362 return b2 && ("input" === b2 && ("text" === a2.type || "search" === a2.type || "tel" === a2.type || "url" === a2.type || "password" === a2.type) || "textarea" === b2 || "true" === a2.contentEditable); 5363 } 5364 function Oe2(a2) { 5365 var b2 = Me2(), c2 = a2.focusedElem, d2 = a2.selectionRange; 5366 if (b2 !== c2 && c2 && c2.ownerDocument && Le2(c2.ownerDocument.documentElement, c2)) { 5367 if (null !== d2 && Ne2(c2)) { 5368 if (b2 = d2.start, a2 = d2.end, void 0 === a2 && (a2 = b2), "selectionStart" in c2) c2.selectionStart = b2, c2.selectionEnd = Math.min(a2, c2.value.length); 5369 else if (a2 = (b2 = c2.ownerDocument || document) && b2.defaultView || window, a2.getSelection) { 5370 a2 = a2.getSelection(); 5371 var e2 = c2.textContent.length, f2 = Math.min(d2.start, e2); 5372 d2 = void 0 === d2.end ? f2 : Math.min(d2.end, e2); 5373 !a2.extend && f2 > d2 && (e2 = d2, d2 = f2, f2 = e2); 5374 e2 = Ke2(c2, f2); 5375 var g2 = Ke2( 5376 c2, 5377 d2 5378 ); 5379 e2 && g2 && (1 !== a2.rangeCount || a2.anchorNode !== e2.node || a2.anchorOffset !== e2.offset || a2.focusNode !== g2.node || a2.focusOffset !== g2.offset) && (b2 = b2.createRange(), b2.setStart(e2.node, e2.offset), a2.removeAllRanges(), f2 > d2 ? (a2.addRange(b2), a2.extend(g2.node, g2.offset)) : (b2.setEnd(g2.node, g2.offset), a2.addRange(b2))); 5380 } 5381 } 5382 b2 = []; 5383 for (a2 = c2; a2 = a2.parentNode; ) 1 === a2.nodeType && b2.push({ element: a2, left: a2.scrollLeft, top: a2.scrollTop }); 5384 "function" === typeof c2.focus && c2.focus(); 5385 for (c2 = 0; c2 < b2.length; c2++) a2 = b2[c2], a2.element.scrollLeft = a2.left, a2.element.scrollTop = a2.top; 5386 } 5387 } 5388 var Pe2 = ia && "documentMode" in document && 11 >= document.documentMode, Qe2 = null, Re2 = null, Se2 = null, Te2 = false; 5389 function Ue2(a2, b2, c2) { 5390 var d2 = c2.window === c2 ? c2.document : 9 === c2.nodeType ? c2 : c2.ownerDocument; 5391 Te2 || null == Qe2 || Qe2 !== Xa2(d2) || (d2 = Qe2, "selectionStart" in d2 && Ne2(d2) ? d2 = { start: d2.selectionStart, end: d2.selectionEnd } : (d2 = (d2.ownerDocument && d2.ownerDocument.defaultView || window).getSelection(), d2 = { anchorNode: d2.anchorNode, anchorOffset: d2.anchorOffset, focusNode: d2.focusNode, focusOffset: d2.focusOffset }), Se2 && Ie2(Se2, d2) || (Se2 = d2, d2 = oe2(Re2, "onSelect"), 0 < d2.length && (b2 = new td("onSelect", "select", null, b2, c2), a2.push({ event: b2, listeners: d2 }), b2.target = Qe2))); 5392 } 5393 function Ve2(a2, b2) { 5394 var c2 = {}; 5395 c2[a2.toLowerCase()] = b2.toLowerCase(); 5396 c2["Webkit" + a2] = "webkit" + b2; 5397 c2["Moz" + a2] = "moz" + b2; 5398 return c2; 5399 } 5400 var We2 = { animationend: Ve2("Animation", "AnimationEnd"), animationiteration: Ve2("Animation", "AnimationIteration"), animationstart: Ve2("Animation", "AnimationStart"), transitionend: Ve2("Transition", "TransitionEnd") }, Xe2 = {}, Ye2 = {}; 5401 ia && (Ye2 = document.createElement("div").style, "AnimationEvent" in window || (delete We2.animationend.animation, delete We2.animationiteration.animation, delete We2.animationstart.animation), "TransitionEvent" in window || delete We2.transitionend.transition); 5402 function Ze2(a2) { 5403 if (Xe2[a2]) return Xe2[a2]; 5404 if (!We2[a2]) return a2; 5405 var b2 = We2[a2], c2; 5406 for (c2 in b2) if (b2.hasOwnProperty(c2) && c2 in Ye2) return Xe2[a2] = b2[c2]; 5407 return a2; 5408 } 5409 var $e2 = Ze2("animationend"), af = Ze2("animationiteration"), bf = Ze2("animationstart"), cf = Ze2("transitionend"), df = /* @__PURE__ */ new Map(), ef = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); 5410 function ff(a2, b2) { 5411 df.set(a2, b2); 5412 fa2(b2, [a2]); 5413 } 5414 for (var gf = 0; gf < ef.length; gf++) { 5415 var hf = ef[gf], jf = hf.toLowerCase(), kf = hf[0].toUpperCase() + hf.slice(1); 5416 ff(jf, "on" + kf); 5417 } 5418 ff($e2, "onAnimationEnd"); 5419 ff(af, "onAnimationIteration"); 5420 ff(bf, "onAnimationStart"); 5421 ff("dblclick", "onDoubleClick"); 5422 ff("focusin", "onFocus"); 5423 ff("focusout", "onBlur"); 5424 ff(cf, "onTransitionEnd"); 5425 ha2("onMouseEnter", ["mouseout", "mouseover"]); 5426 ha2("onMouseLeave", ["mouseout", "mouseover"]); 5427 ha2("onPointerEnter", ["pointerout", "pointerover"]); 5428 ha2("onPointerLeave", ["pointerout", "pointerover"]); 5429 fa2("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")); 5430 fa2("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")); 5431 fa2("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]); 5432 fa2("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")); 5433 fa2("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")); 5434 fa2("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); 5435 var lf = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), mf = new Set("cancel close invalid load scroll toggle".split(" ").concat(lf)); 5436 function nf(a2, b2, c2) { 5437 var d2 = a2.type || "unknown-event"; 5438 a2.currentTarget = c2; 5439 Ub(d2, b2, void 0, a2); 5440 a2.currentTarget = null; 5441 } 5442 function se2(a2, b2) { 5443 b2 = 0 !== (b2 & 4); 5444 for (var c2 = 0; c2 < a2.length; c2++) { 5445 var d2 = a2[c2], e2 = d2.event; 5446 d2 = d2.listeners; 5447 a: { 5448 var f2 = void 0; 5449 if (b2) for (var g2 = d2.length - 1; 0 <= g2; g2--) { 5450 var h2 = d2[g2], k2 = h2.instance, l2 = h2.currentTarget; 5451 h2 = h2.listener; 5452 if (k2 !== f2 && e2.isPropagationStopped()) break a; 5453 nf(e2, h2, l2); 5454 f2 = k2; 5455 } 5456 else for (g2 = 0; g2 < d2.length; g2++) { 5457 h2 = d2[g2]; 5458 k2 = h2.instance; 5459 l2 = h2.currentTarget; 5460 h2 = h2.listener; 5461 if (k2 !== f2 && e2.isPropagationStopped()) break a; 5462 nf(e2, h2, l2); 5463 f2 = k2; 5464 } 5465 } 5466 } 5467 if (Qb) throw a2 = Rb, Qb = false, Rb = null, a2; 5468 } 5469 function D2(a2, b2) { 5470 var c2 = b2[of]; 5471 void 0 === c2 && (c2 = b2[of] = /* @__PURE__ */ new Set()); 5472 var d2 = a2 + "__bubble"; 5473 c2.has(d2) || (pf(b2, a2, 2, false), c2.add(d2)); 5474 } 5475 function qf(a2, b2, c2) { 5476 var d2 = 0; 5477 b2 && (d2 |= 4); 5478 pf(c2, a2, d2, b2); 5479 } 5480 var rf = "_reactListening" + Math.random().toString(36).slice(2); 5481 function sf(a2) { 5482 if (!a2[rf]) { 5483 a2[rf] = true; 5484 da2.forEach(function(b3) { 5485 "selectionchange" !== b3 && (mf.has(b3) || qf(b3, false, a2), qf(b3, true, a2)); 5486 }); 5487 var b2 = 9 === a2.nodeType ? a2 : a2.ownerDocument; 5488 null === b2 || b2[rf] || (b2[rf] = true, qf("selectionchange", false, b2)); 5489 } 5490 } 5491 function pf(a2, b2, c2, d2) { 5492 switch (jd(b2)) { 5493 case 1: 5494 var e2 = ed; 5495 break; 5496 case 4: 5497 e2 = gd; 5498 break; 5499 default: 5500 e2 = fd; 5501 } 5502 c2 = e2.bind(null, b2, c2, a2); 5503 e2 = void 0; 5504 !Lb || "touchstart" !== b2 && "touchmove" !== b2 && "wheel" !== b2 || (e2 = true); 5505 d2 ? void 0 !== e2 ? a2.addEventListener(b2, c2, { capture: true, passive: e2 }) : a2.addEventListener(b2, c2, true) : void 0 !== e2 ? a2.addEventListener(b2, c2, { passive: e2 }) : a2.addEventListener(b2, c2, false); 5506 } 5507 function hd(a2, b2, c2, d2, e2) { 5508 var f2 = d2; 5509 if (0 === (b2 & 1) && 0 === (b2 & 2) && null !== d2) a: for (; ; ) { 5510 if (null === d2) return; 5511 var g2 = d2.tag; 5512 if (3 === g2 || 4 === g2) { 5513 var h2 = d2.stateNode.containerInfo; 5514 if (h2 === e2 || 8 === h2.nodeType && h2.parentNode === e2) break; 5515 if (4 === g2) for (g2 = d2.return; null !== g2; ) { 5516 var k2 = g2.tag; 5517 if (3 === k2 || 4 === k2) { 5518 if (k2 = g2.stateNode.containerInfo, k2 === e2 || 8 === k2.nodeType && k2.parentNode === e2) return; 5519 } 5520 g2 = g2.return; 5521 } 5522 for (; null !== h2; ) { 5523 g2 = Wc(h2); 5524 if (null === g2) return; 5525 k2 = g2.tag; 5526 if (5 === k2 || 6 === k2) { 5527 d2 = f2 = g2; 5528 continue a; 5529 } 5530 h2 = h2.parentNode; 5531 } 5532 } 5533 d2 = d2.return; 5534 } 5535 Jb(function() { 5536 var d3 = f2, e3 = xb(c2), g3 = []; 5537 a: { 5538 var h3 = df.get(a2); 5539 if (void 0 !== h3) { 5540 var k3 = td, n2 = a2; 5541 switch (a2) { 5542 case "keypress": 5543 if (0 === od(c2)) break a; 5544 case "keydown": 5545 case "keyup": 5546 k3 = Rd; 5547 break; 5548 case "focusin": 5549 n2 = "focus"; 5550 k3 = Fd; 5551 break; 5552 case "focusout": 5553 n2 = "blur"; 5554 k3 = Fd; 5555 break; 5556 case "beforeblur": 5557 case "afterblur": 5558 k3 = Fd; 5559 break; 5560 case "click": 5561 if (2 === c2.button) break a; 5562 case "auxclick": 5563 case "dblclick": 5564 case "mousedown": 5565 case "mousemove": 5566 case "mouseup": 5567 case "mouseout": 5568 case "mouseover": 5569 case "contextmenu": 5570 k3 = Bd; 5571 break; 5572 case "drag": 5573 case "dragend": 5574 case "dragenter": 5575 case "dragexit": 5576 case "dragleave": 5577 case "dragover": 5578 case "dragstart": 5579 case "drop": 5580 k3 = Dd; 5581 break; 5582 case "touchcancel": 5583 case "touchend": 5584 case "touchmove": 5585 case "touchstart": 5586 k3 = Vd; 5587 break; 5588 case $e2: 5589 case af: 5590 case bf: 5591 k3 = Hd; 5592 break; 5593 case cf: 5594 k3 = Xd; 5595 break; 5596 case "scroll": 5597 k3 = vd; 5598 break; 5599 case "wheel": 5600 k3 = Zd; 5601 break; 5602 case "copy": 5603 case "cut": 5604 case "paste": 5605 k3 = Jd; 5606 break; 5607 case "gotpointercapture": 5608 case "lostpointercapture": 5609 case "pointercancel": 5610 case "pointerdown": 5611 case "pointermove": 5612 case "pointerout": 5613 case "pointerover": 5614 case "pointerup": 5615 k3 = Td; 5616 } 5617 var t2 = 0 !== (b2 & 4), J2 = !t2 && "scroll" === a2, x2 = t2 ? null !== h3 ? h3 + "Capture" : null : h3; 5618 t2 = []; 5619 for (var w2 = d3, u2; null !== w2; ) { 5620 u2 = w2; 5621 var F2 = u2.stateNode; 5622 5 === u2.tag && null !== F2 && (u2 = F2, null !== x2 && (F2 = Kb(w2, x2), null != F2 && t2.push(tf(w2, F2, u2)))); 5623 if (J2) break; 5624 w2 = w2.return; 5625 } 5626 0 < t2.length && (h3 = new k3(h3, n2, null, c2, e3), g3.push({ event: h3, listeners: t2 })); 5627 } 5628 } 5629 if (0 === (b2 & 7)) { 5630 a: { 5631 h3 = "mouseover" === a2 || "pointerover" === a2; 5632 k3 = "mouseout" === a2 || "pointerout" === a2; 5633 if (h3 && c2 !== wb && (n2 = c2.relatedTarget || c2.fromElement) && (Wc(n2) || n2[uf])) break a; 5634 if (k3 || h3) { 5635 h3 = e3.window === e3 ? e3 : (h3 = e3.ownerDocument) ? h3.defaultView || h3.parentWindow : window; 5636 if (k3) { 5637 if (n2 = c2.relatedTarget || c2.toElement, k3 = d3, n2 = n2 ? Wc(n2) : null, null !== n2 && (J2 = Vb(n2), n2 !== J2 || 5 !== n2.tag && 6 !== n2.tag)) n2 = null; 5638 } else k3 = null, n2 = d3; 5639 if (k3 !== n2) { 5640 t2 = Bd; 5641 F2 = "onMouseLeave"; 5642 x2 = "onMouseEnter"; 5643 w2 = "mouse"; 5644 if ("pointerout" === a2 || "pointerover" === a2) t2 = Td, F2 = "onPointerLeave", x2 = "onPointerEnter", w2 = "pointer"; 5645 J2 = null == k3 ? h3 : ue2(k3); 5646 u2 = null == n2 ? h3 : ue2(n2); 5647 h3 = new t2(F2, w2 + "leave", k3, c2, e3); 5648 h3.target = J2; 5649 h3.relatedTarget = u2; 5650 F2 = null; 5651 Wc(e3) === d3 && (t2 = new t2(x2, w2 + "enter", n2, c2, e3), t2.target = u2, t2.relatedTarget = J2, F2 = t2); 5652 J2 = F2; 5653 if (k3 && n2) b: { 5654 t2 = k3; 5655 x2 = n2; 5656 w2 = 0; 5657 for (u2 = t2; u2; u2 = vf(u2)) w2++; 5658 u2 = 0; 5659 for (F2 = x2; F2; F2 = vf(F2)) u2++; 5660 for (; 0 < w2 - u2; ) t2 = vf(t2), w2--; 5661 for (; 0 < u2 - w2; ) x2 = vf(x2), u2--; 5662 for (; w2--; ) { 5663 if (t2 === x2 || null !== x2 && t2 === x2.alternate) break b; 5664 t2 = vf(t2); 5665 x2 = vf(x2); 5666 } 5667 t2 = null; 5668 } 5669 else t2 = null; 5670 null !== k3 && wf(g3, h3, k3, t2, false); 5671 null !== n2 && null !== J2 && wf(g3, J2, n2, t2, true); 5672 } 5673 } 5674 } 5675 a: { 5676 h3 = d3 ? ue2(d3) : window; 5677 k3 = h3.nodeName && h3.nodeName.toLowerCase(); 5678 if ("select" === k3 || "input" === k3 && "file" === h3.type) var na2 = ve2; 5679 else if (me2(h3)) if (we2) na2 = Fe2; 5680 else { 5681 na2 = De2; 5682 var xa2 = Ce2; 5683 } 5684 else (k3 = h3.nodeName) && "input" === k3.toLowerCase() && ("checkbox" === h3.type || "radio" === h3.type) && (na2 = Ee2); 5685 if (na2 && (na2 = na2(a2, d3))) { 5686 ne2(g3, na2, c2, e3); 5687 break a; 5688 } 5689 xa2 && xa2(a2, h3, d3); 5690 "focusout" === a2 && (xa2 = h3._wrapperState) && xa2.controlled && "number" === h3.type && cb(h3, "number", h3.value); 5691 } 5692 xa2 = d3 ? ue2(d3) : window; 5693 switch (a2) { 5694 case "focusin": 5695 if (me2(xa2) || "true" === xa2.contentEditable) Qe2 = xa2, Re2 = d3, Se2 = null; 5696 break; 5697 case "focusout": 5698 Se2 = Re2 = Qe2 = null; 5699 break; 5700 case "mousedown": 5701 Te2 = true; 5702 break; 5703 case "contextmenu": 5704 case "mouseup": 5705 case "dragend": 5706 Te2 = false; 5707 Ue2(g3, c2, e3); 5708 break; 5709 case "selectionchange": 5710 if (Pe2) break; 5711 case "keydown": 5712 case "keyup": 5713 Ue2(g3, c2, e3); 5714 } 5715 var $a2; 5716 if (ae2) b: { 5717 switch (a2) { 5718 case "compositionstart": 5719 var ba2 = "onCompositionStart"; 5720 break b; 5721 case "compositionend": 5722 ba2 = "onCompositionEnd"; 5723 break b; 5724 case "compositionupdate": 5725 ba2 = "onCompositionUpdate"; 5726 break b; 5727 } 5728 ba2 = void 0; 5729 } 5730 else ie2 ? ge2(a2, c2) && (ba2 = "onCompositionEnd") : "keydown" === a2 && 229 === c2.keyCode && (ba2 = "onCompositionStart"); 5731 ba2 && (de2 && "ko" !== c2.locale && (ie2 || "onCompositionStart" !== ba2 ? "onCompositionEnd" === ba2 && ie2 && ($a2 = nd()) : (kd = e3, ld = "value" in kd ? kd.value : kd.textContent, ie2 = true)), xa2 = oe2(d3, ba2), 0 < xa2.length && (ba2 = new Ld(ba2, a2, null, c2, e3), g3.push({ event: ba2, listeners: xa2 }), $a2 ? ba2.data = $a2 : ($a2 = he2(c2), null !== $a2 && (ba2.data = $a2)))); 5732 if ($a2 = ce2 ? je2(a2, c2) : ke2(a2, c2)) d3 = oe2(d3, "onBeforeInput"), 0 < d3.length && (e3 = new Ld("onBeforeInput", "beforeinput", null, c2, e3), g3.push({ event: e3, listeners: d3 }), e3.data = $a2); 5733 } 5734 se2(g3, b2); 5735 }); 5736 } 5737 function tf(a2, b2, c2) { 5738 return { instance: a2, listener: b2, currentTarget: c2 }; 5739 } 5740 function oe2(a2, b2) { 5741 for (var c2 = b2 + "Capture", d2 = []; null !== a2; ) { 5742 var e2 = a2, f2 = e2.stateNode; 5743 5 === e2.tag && null !== f2 && (e2 = f2, f2 = Kb(a2, c2), null != f2 && d2.unshift(tf(a2, f2, e2)), f2 = Kb(a2, b2), null != f2 && d2.push(tf(a2, f2, e2))); 5744 a2 = a2.return; 5745 } 5746 return d2; 5747 } 5748 function vf(a2) { 5749 if (null === a2) return null; 5750 do 5751 a2 = a2.return; 5752 while (a2 && 5 !== a2.tag); 5753 return a2 ? a2 : null; 5754 } 5755 function wf(a2, b2, c2, d2, e2) { 5756 for (var f2 = b2._reactName, g2 = []; null !== c2 && c2 !== d2; ) { 5757 var h2 = c2, k2 = h2.alternate, l2 = h2.stateNode; 5758 if (null !== k2 && k2 === d2) break; 5759 5 === h2.tag && null !== l2 && (h2 = l2, e2 ? (k2 = Kb(c2, f2), null != k2 && g2.unshift(tf(c2, k2, h2))) : e2 || (k2 = Kb(c2, f2), null != k2 && g2.push(tf(c2, k2, h2)))); 5760 c2 = c2.return; 5761 } 5762 0 !== g2.length && a2.push({ event: b2, listeners: g2 }); 5763 } 5764 var xf = /\r\n?/g, yf = /\u0000|\uFFFD/g; 5765 function zf(a2) { 5766 return ("string" === typeof a2 ? a2 : "" + a2).replace(xf, "\n").replace(yf, ""); 5767 } 5768 function Af(a2, b2, c2) { 5769 b2 = zf(b2); 5770 if (zf(a2) !== b2 && c2) throw Error(p2(425)); 5771 } 5772 function Bf() { 5773 } 5774 var Cf = null, Df = null; 5775 function Ef(a2, b2) { 5776 return "textarea" === a2 || "noscript" === a2 || "string" === typeof b2.children || "number" === typeof b2.children || "object" === typeof b2.dangerouslySetInnerHTML && null !== b2.dangerouslySetInnerHTML && null != b2.dangerouslySetInnerHTML.__html; 5777 } 5778 var Ff = "function" === typeof setTimeout ? setTimeout : void 0, Gf = "function" === typeof clearTimeout ? clearTimeout : void 0, Hf = "function" === typeof Promise ? Promise : void 0, Jf = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof Hf ? function(a2) { 5779 return Hf.resolve(null).then(a2).catch(If); 5780 } : Ff; 5781 function If(a2) { 5782 setTimeout(function() { 5783 throw a2; 5784 }); 5785 } 5786 function Kf(a2, b2) { 5787 var c2 = b2, d2 = 0; 5788 do { 5789 var e2 = c2.nextSibling; 5790 a2.removeChild(c2); 5791 if (e2 && 8 === e2.nodeType) if (c2 = e2.data, "/$" === c2) { 5792 if (0 === d2) { 5793 a2.removeChild(e2); 5794 bd(b2); 5795 return; 5796 } 5797 d2--; 5798 } else "$" !== c2 && "$?" !== c2 && "$!" !== c2 || d2++; 5799 c2 = e2; 5800 } while (c2); 5801 bd(b2); 5802 } 5803 function Lf(a2) { 5804 for (; null != a2; a2 = a2.nextSibling) { 5805 var b2 = a2.nodeType; 5806 if (1 === b2 || 3 === b2) break; 5807 if (8 === b2) { 5808 b2 = a2.data; 5809 if ("$" === b2 || "$!" === b2 || "$?" === b2) break; 5810 if ("/$" === b2) return null; 5811 } 5812 } 5813 return a2; 5814 } 5815 function Mf(a2) { 5816 a2 = a2.previousSibling; 5817 for (var b2 = 0; a2; ) { 5818 if (8 === a2.nodeType) { 5819 var c2 = a2.data; 5820 if ("$" === c2 || "$!" === c2 || "$?" === c2) { 5821 if (0 === b2) return a2; 5822 b2--; 5823 } else "/$" === c2 && b2++; 5824 } 5825 a2 = a2.previousSibling; 5826 } 5827 return null; 5828 } 5829 var Nf = Math.random().toString(36).slice(2), Of = "__reactFiber$" + Nf, Pf = "__reactProps$" + Nf, uf = "__reactContainer$" + Nf, of = "__reactEvents$" + Nf, Qf = "__reactListeners$" + Nf, Rf = "__reactHandles$" + Nf; 5830 function Wc(a2) { 5831 var b2 = a2[Of]; 5832 if (b2) return b2; 5833 for (var c2 = a2.parentNode; c2; ) { 5834 if (b2 = c2[uf] || c2[Of]) { 5835 c2 = b2.alternate; 5836 if (null !== b2.child || null !== c2 && null !== c2.child) for (a2 = Mf(a2); null !== a2; ) { 5837 if (c2 = a2[Of]) return c2; 5838 a2 = Mf(a2); 5839 } 5840 return b2; 5841 } 5842 a2 = c2; 5843 c2 = a2.parentNode; 5844 } 5845 return null; 5846 } 5847 function Cb(a2) { 5848 a2 = a2[Of] || a2[uf]; 5849 return !a2 || 5 !== a2.tag && 6 !== a2.tag && 13 !== a2.tag && 3 !== a2.tag ? null : a2; 5850 } 5851 function ue2(a2) { 5852 if (5 === a2.tag || 6 === a2.tag) return a2.stateNode; 5853 throw Error(p2(33)); 5854 } 5855 function Db(a2) { 5856 return a2[Pf] || null; 5857 } 5858 var Sf = [], Tf = -1; 5859 function Uf(a2) { 5860 return { current: a2 }; 5861 } 5862 function E2(a2) { 5863 0 > Tf || (a2.current = Sf[Tf], Sf[Tf] = null, Tf--); 5864 } 5865 function G2(a2, b2) { 5866 Tf++; 5867 Sf[Tf] = a2.current; 5868 a2.current = b2; 5869 } 5870 var Vf = {}, H2 = Uf(Vf), Wf = Uf(false), Xf = Vf; 5871 function Yf(a2, b2) { 5872 var c2 = a2.type.contextTypes; 5873 if (!c2) return Vf; 5874 var d2 = a2.stateNode; 5875 if (d2 && d2.__reactInternalMemoizedUnmaskedChildContext === b2) return d2.__reactInternalMemoizedMaskedChildContext; 5876 var e2 = {}, f2; 5877 for (f2 in c2) e2[f2] = b2[f2]; 5878 d2 && (a2 = a2.stateNode, a2.__reactInternalMemoizedUnmaskedChildContext = b2, a2.__reactInternalMemoizedMaskedChildContext = e2); 5879 return e2; 5880 } 5881 function Zf(a2) { 5882 a2 = a2.childContextTypes; 5883 return null !== a2 && void 0 !== a2; 5884 } 5885 function $f() { 5886 E2(Wf); 5887 E2(H2); 5888 } 5889 function ag(a2, b2, c2) { 5890 if (H2.current !== Vf) throw Error(p2(168)); 5891 G2(H2, b2); 5892 G2(Wf, c2); 5893 } 5894 function bg(a2, b2, c2) { 5895 var d2 = a2.stateNode; 5896 b2 = b2.childContextTypes; 5897 if ("function" !== typeof d2.getChildContext) return c2; 5898 d2 = d2.getChildContext(); 5899 for (var e2 in d2) if (!(e2 in b2)) throw Error(p2(108, Ra2(a2) || "Unknown", e2)); 5900 return A2({}, c2, d2); 5901 } 5902 function cg(a2) { 5903 a2 = (a2 = a2.stateNode) && a2.__reactInternalMemoizedMergedChildContext || Vf; 5904 Xf = H2.current; 5905 G2(H2, a2); 5906 G2(Wf, Wf.current); 5907 return true; 5908 } 5909 function dg(a2, b2, c2) { 5910 var d2 = a2.stateNode; 5911 if (!d2) throw Error(p2(169)); 5912 c2 ? (a2 = bg(a2, b2, Xf), d2.__reactInternalMemoizedMergedChildContext = a2, E2(Wf), E2(H2), G2(H2, a2)) : E2(Wf); 5913 G2(Wf, c2); 5914 } 5915 var eg = null, fg = false, gg = false; 5916 function hg(a2) { 5917 null === eg ? eg = [a2] : eg.push(a2); 5918 } 5919 function ig(a2) { 5920 fg = true; 5921 hg(a2); 5922 } 5923 function jg() { 5924 if (!gg && null !== eg) { 5925 gg = true; 5926 var a2 = 0, b2 = C2; 5927 try { 5928 var c2 = eg; 5929 for (C2 = 1; a2 < c2.length; a2++) { 5930 var d2 = c2[a2]; 5931 do 5932 d2 = d2(true); 5933 while (null !== d2); 5934 } 5935 eg = null; 5936 fg = false; 5937 } catch (e2) { 5938 throw null !== eg && (eg = eg.slice(a2 + 1)), ac(fc, jg), e2; 5939 } finally { 5940 C2 = b2, gg = false; 5941 } 5942 } 5943 return null; 5944 } 5945 var kg = [], lg = 0, mg = null, ng = 0, og = [], pg = 0, qg = null, rg = 1, sg = ""; 5946 function tg(a2, b2) { 5947 kg[lg++] = ng; 5948 kg[lg++] = mg; 5949 mg = a2; 5950 ng = b2; 5951 } 5952 function ug(a2, b2, c2) { 5953 og[pg++] = rg; 5954 og[pg++] = sg; 5955 og[pg++] = qg; 5956 qg = a2; 5957 var d2 = rg; 5958 a2 = sg; 5959 var e2 = 32 - oc(d2) - 1; 5960 d2 &= ~(1 << e2); 5961 c2 += 1; 5962 var f2 = 32 - oc(b2) + e2; 5963 if (30 < f2) { 5964 var g2 = e2 - e2 % 5; 5965 f2 = (d2 & (1 << g2) - 1).toString(32); 5966 d2 >>= g2; 5967 e2 -= g2; 5968 rg = 1 << 32 - oc(b2) + e2 | c2 << e2 | d2; 5969 sg = f2 + a2; 5970 } else rg = 1 << f2 | c2 << e2 | d2, sg = a2; 5971 } 5972 function vg(a2) { 5973 null !== a2.return && (tg(a2, 1), ug(a2, 1, 0)); 5974 } 5975 function wg(a2) { 5976 for (; a2 === mg; ) mg = kg[--lg], kg[lg] = null, ng = kg[--lg], kg[lg] = null; 5977 for (; a2 === qg; ) qg = og[--pg], og[pg] = null, sg = og[--pg], og[pg] = null, rg = og[--pg], og[pg] = null; 5978 } 5979 var xg = null, yg = null, I2 = false, zg = null; 5980 function Ag(a2, b2) { 5981 var c2 = Bg(5, null, null, 0); 5982 c2.elementType = "DELETED"; 5983 c2.stateNode = b2; 5984 c2.return = a2; 5985 b2 = a2.deletions; 5986 null === b2 ? (a2.deletions = [c2], a2.flags |= 16) : b2.push(c2); 5987 } 5988 function Cg(a2, b2) { 5989 switch (a2.tag) { 5990 case 5: 5991 var c2 = a2.type; 5992 b2 = 1 !== b2.nodeType || c2.toLowerCase() !== b2.nodeName.toLowerCase() ? null : b2; 5993 return null !== b2 ? (a2.stateNode = b2, xg = a2, yg = Lf(b2.firstChild), true) : false; 5994 case 6: 5995 return b2 = "" === a2.pendingProps || 3 !== b2.nodeType ? null : b2, null !== b2 ? (a2.stateNode = b2, xg = a2, yg = null, true) : false; 5996 case 13: 5997 return b2 = 8 !== b2.nodeType ? null : b2, null !== b2 ? (c2 = null !== qg ? { id: rg, overflow: sg } : null, a2.memoizedState = { dehydrated: b2, treeContext: c2, retryLane: 1073741824 }, c2 = Bg(18, null, null, 0), c2.stateNode = b2, c2.return = a2, a2.child = c2, xg = a2, yg = null, true) : false; 5998 default: 5999 return false; 6000 } 6001 } 6002 function Dg(a2) { 6003 return 0 !== (a2.mode & 1) && 0 === (a2.flags & 128); 6004 } 6005 function Eg(a2) { 6006 if (I2) { 6007 var b2 = yg; 6008 if (b2) { 6009 var c2 = b2; 6010 if (!Cg(a2, b2)) { 6011 if (Dg(a2)) throw Error(p2(418)); 6012 b2 = Lf(c2.nextSibling); 6013 var d2 = xg; 6014 b2 && Cg(a2, b2) ? Ag(d2, c2) : (a2.flags = a2.flags & -4097 | 2, I2 = false, xg = a2); 6015 } 6016 } else { 6017 if (Dg(a2)) throw Error(p2(418)); 6018 a2.flags = a2.flags & -4097 | 2; 6019 I2 = false; 6020 xg = a2; 6021 } 6022 } 6023 } 6024 function Fg(a2) { 6025 for (a2 = a2.return; null !== a2 && 5 !== a2.tag && 3 !== a2.tag && 13 !== a2.tag; ) a2 = a2.return; 6026 xg = a2; 6027 } 6028 function Gg(a2) { 6029 if (a2 !== xg) return false; 6030 if (!I2) return Fg(a2), I2 = true, false; 6031 var b2; 6032 (b2 = 3 !== a2.tag) && !(b2 = 5 !== a2.tag) && (b2 = a2.type, b2 = "head" !== b2 && "body" !== b2 && !Ef(a2.type, a2.memoizedProps)); 6033 if (b2 && (b2 = yg)) { 6034 if (Dg(a2)) throw Hg(), Error(p2(418)); 6035 for (; b2; ) Ag(a2, b2), b2 = Lf(b2.nextSibling); 6036 } 6037 Fg(a2); 6038 if (13 === a2.tag) { 6039 a2 = a2.memoizedState; 6040 a2 = null !== a2 ? a2.dehydrated : null; 6041 if (!a2) throw Error(p2(317)); 6042 a: { 6043 a2 = a2.nextSibling; 6044 for (b2 = 0; a2; ) { 6045 if (8 === a2.nodeType) { 6046 var c2 = a2.data; 6047 if ("/$" === c2) { 6048 if (0 === b2) { 6049 yg = Lf(a2.nextSibling); 6050 break a; 6051 } 6052 b2--; 6053 } else "$" !== c2 && "$!" !== c2 && "$?" !== c2 || b2++; 6054 } 6055 a2 = a2.nextSibling; 6056 } 6057 yg = null; 6058 } 6059 } else yg = xg ? Lf(a2.stateNode.nextSibling) : null; 6060 return true; 6061 } 6062 function Hg() { 6063 for (var a2 = yg; a2; ) a2 = Lf(a2.nextSibling); 6064 } 6065 function Ig() { 6066 yg = xg = null; 6067 I2 = false; 6068 } 6069 function Jg(a2) { 6070 null === zg ? zg = [a2] : zg.push(a2); 6071 } 6072 var Kg = ua2.ReactCurrentBatchConfig; 6073 function Lg(a2, b2, c2) { 6074 a2 = c2.ref; 6075 if (null !== a2 && "function" !== typeof a2 && "object" !== typeof a2) { 6076 if (c2._owner) { 6077 c2 = c2._owner; 6078 if (c2) { 6079 if (1 !== c2.tag) throw Error(p2(309)); 6080 var d2 = c2.stateNode; 6081 } 6082 if (!d2) throw Error(p2(147, a2)); 6083 var e2 = d2, f2 = "" + a2; 6084 if (null !== b2 && null !== b2.ref && "function" === typeof b2.ref && b2.ref._stringRef === f2) return b2.ref; 6085 b2 = function(a3) { 6086 var b3 = e2.refs; 6087 null === a3 ? delete b3[f2] : b3[f2] = a3; 6088 }; 6089 b2._stringRef = f2; 6090 return b2; 6091 } 6092 if ("string" !== typeof a2) throw Error(p2(284)); 6093 if (!c2._owner) throw Error(p2(290, a2)); 6094 } 6095 return a2; 6096 } 6097 function Mg(a2, b2) { 6098 a2 = Object.prototype.toString.call(b2); 6099 throw Error(p2(31, "[object Object]" === a2 ? "object with keys {" + Object.keys(b2).join(", ") + "}" : a2)); 6100 } 6101 function Ng(a2) { 6102 var b2 = a2._init; 6103 return b2(a2._payload); 6104 } 6105 function Og(a2) { 6106 function b2(b3, c3) { 6107 if (a2) { 6108 var d3 = b3.deletions; 6109 null === d3 ? (b3.deletions = [c3], b3.flags |= 16) : d3.push(c3); 6110 } 6111 } 6112 function c2(c3, d3) { 6113 if (!a2) return null; 6114 for (; null !== d3; ) b2(c3, d3), d3 = d3.sibling; 6115 return null; 6116 } 6117 function d2(a3, b3) { 6118 for (a3 = /* @__PURE__ */ new Map(); null !== b3; ) null !== b3.key ? a3.set(b3.key, b3) : a3.set(b3.index, b3), b3 = b3.sibling; 6119 return a3; 6120 } 6121 function e2(a3, b3) { 6122 a3 = Pg(a3, b3); 6123 a3.index = 0; 6124 a3.sibling = null; 6125 return a3; 6126 } 6127 function f2(b3, c3, d3) { 6128 b3.index = d3; 6129 if (!a2) return b3.flags |= 1048576, c3; 6130 d3 = b3.alternate; 6131 if (null !== d3) return d3 = d3.index, d3 < c3 ? (b3.flags |= 2, c3) : d3; 6132 b3.flags |= 2; 6133 return c3; 6134 } 6135 function g2(b3) { 6136 a2 && null === b3.alternate && (b3.flags |= 2); 6137 return b3; 6138 } 6139 function h2(a3, b3, c3, d3) { 6140 if (null === b3 || 6 !== b3.tag) return b3 = Qg(c3, a3.mode, d3), b3.return = a3, b3; 6141 b3 = e2(b3, c3); 6142 b3.return = a3; 6143 return b3; 6144 } 6145 function k2(a3, b3, c3, d3) { 6146 var f3 = c3.type; 6147 if (f3 === ya2) return m2(a3, b3, c3.props.children, d3, c3.key); 6148 if (null !== b3 && (b3.elementType === f3 || "object" === typeof f3 && null !== f3 && f3.$$typeof === Ha2 && Ng(f3) === b3.type)) return d3 = e2(b3, c3.props), d3.ref = Lg(a3, b3, c3), d3.return = a3, d3; 6149 d3 = Rg(c3.type, c3.key, c3.props, null, a3.mode, d3); 6150 d3.ref = Lg(a3, b3, c3); 6151 d3.return = a3; 6152 return d3; 6153 } 6154 function l2(a3, b3, c3, d3) { 6155 if (null === b3 || 4 !== b3.tag || b3.stateNode.containerInfo !== c3.containerInfo || b3.stateNode.implementation !== c3.implementation) return b3 = Sg(c3, a3.mode, d3), b3.return = a3, b3; 6156 b3 = e2(b3, c3.children || []); 6157 b3.return = a3; 6158 return b3; 6159 } 6160 function m2(a3, b3, c3, d3, f3) { 6161 if (null === b3 || 7 !== b3.tag) return b3 = Tg(c3, a3.mode, d3, f3), b3.return = a3, b3; 6162 b3 = e2(b3, c3); 6163 b3.return = a3; 6164 return b3; 6165 } 6166 function q2(a3, b3, c3) { 6167 if ("string" === typeof b3 && "" !== b3 || "number" === typeof b3) return b3 = Qg("" + b3, a3.mode, c3), b3.return = a3, b3; 6168 if ("object" === typeof b3 && null !== b3) { 6169 switch (b3.$$typeof) { 6170 case va2: 6171 return c3 = Rg(b3.type, b3.key, b3.props, null, a3.mode, c3), c3.ref = Lg(a3, null, b3), c3.return = a3, c3; 6172 case wa2: 6173 return b3 = Sg(b3, a3.mode, c3), b3.return = a3, b3; 6174 case Ha2: 6175 var d3 = b3._init; 6176 return q2(a3, d3(b3._payload), c3); 6177 } 6178 if (eb(b3) || Ka2(b3)) return b3 = Tg(b3, a3.mode, c3, null), b3.return = a3, b3; 6179 Mg(a3, b3); 6180 } 6181 return null; 6182 } 6183 function r2(a3, b3, c3, d3) { 6184 var e3 = null !== b3 ? b3.key : null; 6185 if ("string" === typeof c3 && "" !== c3 || "number" === typeof c3) return null !== e3 ? null : h2(a3, b3, "" + c3, d3); 6186 if ("object" === typeof c3 && null !== c3) { 6187 switch (c3.$$typeof) { 6188 case va2: 6189 return c3.key === e3 ? k2(a3, b3, c3, d3) : null; 6190 case wa2: 6191 return c3.key === e3 ? l2(a3, b3, c3, d3) : null; 6192 case Ha2: 6193 return e3 = c3._init, r2( 6194 a3, 6195 b3, 6196 e3(c3._payload), 6197 d3 6198 ); 6199 } 6200 if (eb(c3) || Ka2(c3)) return null !== e3 ? null : m2(a3, b3, c3, d3, null); 6201 Mg(a3, c3); 6202 } 6203 return null; 6204 } 6205 function y2(a3, b3, c3, d3, e3) { 6206 if ("string" === typeof d3 && "" !== d3 || "number" === typeof d3) return a3 = a3.get(c3) || null, h2(b3, a3, "" + d3, e3); 6207 if ("object" === typeof d3 && null !== d3) { 6208 switch (d3.$$typeof) { 6209 case va2: 6210 return a3 = a3.get(null === d3.key ? c3 : d3.key) || null, k2(b3, a3, d3, e3); 6211 case wa2: 6212 return a3 = a3.get(null === d3.key ? c3 : d3.key) || null, l2(b3, a3, d3, e3); 6213 case Ha2: 6214 var f3 = d3._init; 6215 return y2(a3, b3, c3, f3(d3._payload), e3); 6216 } 6217 if (eb(d3) || Ka2(d3)) return a3 = a3.get(c3) || null, m2(b3, a3, d3, e3, null); 6218 Mg(b3, d3); 6219 } 6220 return null; 6221 } 6222 function n2(e3, g3, h3, k3) { 6223 for (var l3 = null, m3 = null, u2 = g3, w2 = g3 = 0, x2 = null; null !== u2 && w2 < h3.length; w2++) { 6224 u2.index > w2 ? (x2 = u2, u2 = null) : x2 = u2.sibling; 6225 var n3 = r2(e3, u2, h3[w2], k3); 6226 if (null === n3) { 6227 null === u2 && (u2 = x2); 6228 break; 6229 } 6230 a2 && u2 && null === n3.alternate && b2(e3, u2); 6231 g3 = f2(n3, g3, w2); 6232 null === m3 ? l3 = n3 : m3.sibling = n3; 6233 m3 = n3; 6234 u2 = x2; 6235 } 6236 if (w2 === h3.length) return c2(e3, u2), I2 && tg(e3, w2), l3; 6237 if (null === u2) { 6238 for (; w2 < h3.length; w2++) u2 = q2(e3, h3[w2], k3), null !== u2 && (g3 = f2(u2, g3, w2), null === m3 ? l3 = u2 : m3.sibling = u2, m3 = u2); 6239 I2 && tg(e3, w2); 6240 return l3; 6241 } 6242 for (u2 = d2(e3, u2); w2 < h3.length; w2++) x2 = y2(u2, e3, w2, h3[w2], k3), null !== x2 && (a2 && null !== x2.alternate && u2.delete(null === x2.key ? w2 : x2.key), g3 = f2(x2, g3, w2), null === m3 ? l3 = x2 : m3.sibling = x2, m3 = x2); 6243 a2 && u2.forEach(function(a3) { 6244 return b2(e3, a3); 6245 }); 6246 I2 && tg(e3, w2); 6247 return l3; 6248 } 6249 function t2(e3, g3, h3, k3) { 6250 var l3 = Ka2(h3); 6251 if ("function" !== typeof l3) throw Error(p2(150)); 6252 h3 = l3.call(h3); 6253 if (null == h3) throw Error(p2(151)); 6254 for (var u2 = l3 = null, m3 = g3, w2 = g3 = 0, x2 = null, n3 = h3.next(); null !== m3 && !n3.done; w2++, n3 = h3.next()) { 6255 m3.index > w2 ? (x2 = m3, m3 = null) : x2 = m3.sibling; 6256 var t3 = r2(e3, m3, n3.value, k3); 6257 if (null === t3) { 6258 null === m3 && (m3 = x2); 6259 break; 6260 } 6261 a2 && m3 && null === t3.alternate && b2(e3, m3); 6262 g3 = f2(t3, g3, w2); 6263 null === u2 ? l3 = t3 : u2.sibling = t3; 6264 u2 = t3; 6265 m3 = x2; 6266 } 6267 if (n3.done) return c2( 6268 e3, 6269 m3 6270 ), I2 && tg(e3, w2), l3; 6271 if (null === m3) { 6272 for (; !n3.done; w2++, n3 = h3.next()) n3 = q2(e3, n3.value, k3), null !== n3 && (g3 = f2(n3, g3, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3); 6273 I2 && tg(e3, w2); 6274 return l3; 6275 } 6276 for (m3 = d2(e3, m3); !n3.done; w2++, n3 = h3.next()) n3 = y2(m3, e3, w2, n3.value, k3), null !== n3 && (a2 && null !== n3.alternate && m3.delete(null === n3.key ? w2 : n3.key), g3 = f2(n3, g3, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3); 6277 a2 && m3.forEach(function(a3) { 6278 return b2(e3, a3); 6279 }); 6280 I2 && tg(e3, w2); 6281 return l3; 6282 } 6283 function J2(a3, d3, f3, h3) { 6284 "object" === typeof f3 && null !== f3 && f3.type === ya2 && null === f3.key && (f3 = f3.props.children); 6285 if ("object" === typeof f3 && null !== f3) { 6286 switch (f3.$$typeof) { 6287 case va2: 6288 a: { 6289 for (var k3 = f3.key, l3 = d3; null !== l3; ) { 6290 if (l3.key === k3) { 6291 k3 = f3.type; 6292 if (k3 === ya2) { 6293 if (7 === l3.tag) { 6294 c2(a3, l3.sibling); 6295 d3 = e2(l3, f3.props.children); 6296 d3.return = a3; 6297 a3 = d3; 6298 break a; 6299 } 6300 } else if (l3.elementType === k3 || "object" === typeof k3 && null !== k3 && k3.$$typeof === Ha2 && Ng(k3) === l3.type) { 6301 c2(a3, l3.sibling); 6302 d3 = e2(l3, f3.props); 6303 d3.ref = Lg(a3, l3, f3); 6304 d3.return = a3; 6305 a3 = d3; 6306 break a; 6307 } 6308 c2(a3, l3); 6309 break; 6310 } else b2(a3, l3); 6311 l3 = l3.sibling; 6312 } 6313 f3.type === ya2 ? (d3 = Tg(f3.props.children, a3.mode, h3, f3.key), d3.return = a3, a3 = d3) : (h3 = Rg(f3.type, f3.key, f3.props, null, a3.mode, h3), h3.ref = Lg(a3, d3, f3), h3.return = a3, a3 = h3); 6314 } 6315 return g2(a3); 6316 case wa2: 6317 a: { 6318 for (l3 = f3.key; null !== d3; ) { 6319 if (d3.key === l3) if (4 === d3.tag && d3.stateNode.containerInfo === f3.containerInfo && d3.stateNode.implementation === f3.implementation) { 6320 c2(a3, d3.sibling); 6321 d3 = e2(d3, f3.children || []); 6322 d3.return = a3; 6323 a3 = d3; 6324 break a; 6325 } else { 6326 c2(a3, d3); 6327 break; 6328 } 6329 else b2(a3, d3); 6330 d3 = d3.sibling; 6331 } 6332 d3 = Sg(f3, a3.mode, h3); 6333 d3.return = a3; 6334 a3 = d3; 6335 } 6336 return g2(a3); 6337 case Ha2: 6338 return l3 = f3._init, J2(a3, d3, l3(f3._payload), h3); 6339 } 6340 if (eb(f3)) return n2(a3, d3, f3, h3); 6341 if (Ka2(f3)) return t2(a3, d3, f3, h3); 6342 Mg(a3, f3); 6343 } 6344 return "string" === typeof f3 && "" !== f3 || "number" === typeof f3 ? (f3 = "" + f3, null !== d3 && 6 === d3.tag ? (c2(a3, d3.sibling), d3 = e2(d3, f3), d3.return = a3, a3 = d3) : (c2(a3, d3), d3 = Qg(f3, a3.mode, h3), d3.return = a3, a3 = d3), g2(a3)) : c2(a3, d3); 6345 } 6346 return J2; 6347 } 6348 var Ug = Og(true), Vg = Og(false), Wg = Uf(null), Xg = null, Yg = null, Zg = null; 6349 function $g() { 6350 Zg = Yg = Xg = null; 6351 } 6352 function ah(a2) { 6353 var b2 = Wg.current; 6354 E2(Wg); 6355 a2._currentValue = b2; 6356 } 6357 function bh(a2, b2, c2) { 6358 for (; null !== a2; ) { 6359 var d2 = a2.alternate; 6360 (a2.childLanes & b2) !== b2 ? (a2.childLanes |= b2, null !== d2 && (d2.childLanes |= b2)) : null !== d2 && (d2.childLanes & b2) !== b2 && (d2.childLanes |= b2); 6361 if (a2 === c2) break; 6362 a2 = a2.return; 6363 } 6364 } 6365 function ch(a2, b2) { 6366 Xg = a2; 6367 Zg = Yg = null; 6368 a2 = a2.dependencies; 6369 null !== a2 && null !== a2.firstContext && (0 !== (a2.lanes & b2) && (dh = true), a2.firstContext = null); 6370 } 6371 function eh(a2) { 6372 var b2 = a2._currentValue; 6373 if (Zg !== a2) if (a2 = { context: a2, memoizedValue: b2, next: null }, null === Yg) { 6374 if (null === Xg) throw Error(p2(308)); 6375 Yg = a2; 6376 Xg.dependencies = { lanes: 0, firstContext: a2 }; 6377 } else Yg = Yg.next = a2; 6378 return b2; 6379 } 6380 var fh = null; 6381 function gh(a2) { 6382 null === fh ? fh = [a2] : fh.push(a2); 6383 } 6384 function hh(a2, b2, c2, d2) { 6385 var e2 = b2.interleaved; 6386 null === e2 ? (c2.next = c2, gh(b2)) : (c2.next = e2.next, e2.next = c2); 6387 b2.interleaved = c2; 6388 return ih(a2, d2); 6389 } 6390 function ih(a2, b2) { 6391 a2.lanes |= b2; 6392 var c2 = a2.alternate; 6393 null !== c2 && (c2.lanes |= b2); 6394 c2 = a2; 6395 for (a2 = a2.return; null !== a2; ) a2.childLanes |= b2, c2 = a2.alternate, null !== c2 && (c2.childLanes |= b2), c2 = a2, a2 = a2.return; 6396 return 3 === c2.tag ? c2.stateNode : null; 6397 } 6398 var jh = false; 6399 function kh(a2) { 6400 a2.updateQueue = { baseState: a2.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; 6401 } 6402 function lh(a2, b2) { 6403 a2 = a2.updateQueue; 6404 b2.updateQueue === a2 && (b2.updateQueue = { baseState: a2.baseState, firstBaseUpdate: a2.firstBaseUpdate, lastBaseUpdate: a2.lastBaseUpdate, shared: a2.shared, effects: a2.effects }); 6405 } 6406 function mh(a2, b2) { 6407 return { eventTime: a2, lane: b2, tag: 0, payload: null, callback: null, next: null }; 6408 } 6409 function nh(a2, b2, c2) { 6410 var d2 = a2.updateQueue; 6411 if (null === d2) return null; 6412 d2 = d2.shared; 6413 if (0 !== (K2 & 2)) { 6414 var e2 = d2.pending; 6415 null === e2 ? b2.next = b2 : (b2.next = e2.next, e2.next = b2); 6416 d2.pending = b2; 6417 return ih(a2, c2); 6418 } 6419 e2 = d2.interleaved; 6420 null === e2 ? (b2.next = b2, gh(d2)) : (b2.next = e2.next, e2.next = b2); 6421 d2.interleaved = b2; 6422 return ih(a2, c2); 6423 } 6424 function oh(a2, b2, c2) { 6425 b2 = b2.updateQueue; 6426 if (null !== b2 && (b2 = b2.shared, 0 !== (c2 & 4194240))) { 6427 var d2 = b2.lanes; 6428 d2 &= a2.pendingLanes; 6429 c2 |= d2; 6430 b2.lanes = c2; 6431 Cc(a2, c2); 6432 } 6433 } 6434 function ph(a2, b2) { 6435 var c2 = a2.updateQueue, d2 = a2.alternate; 6436 if (null !== d2 && (d2 = d2.updateQueue, c2 === d2)) { 6437 var e2 = null, f2 = null; 6438 c2 = c2.firstBaseUpdate; 6439 if (null !== c2) { 6440 do { 6441 var g2 = { eventTime: c2.eventTime, lane: c2.lane, tag: c2.tag, payload: c2.payload, callback: c2.callback, next: null }; 6442 null === f2 ? e2 = f2 = g2 : f2 = f2.next = g2; 6443 c2 = c2.next; 6444 } while (null !== c2); 6445 null === f2 ? e2 = f2 = b2 : f2 = f2.next = b2; 6446 } else e2 = f2 = b2; 6447 c2 = { baseState: d2.baseState, firstBaseUpdate: e2, lastBaseUpdate: f2, shared: d2.shared, effects: d2.effects }; 6448 a2.updateQueue = c2; 6449 return; 6450 } 6451 a2 = c2.lastBaseUpdate; 6452 null === a2 ? c2.firstBaseUpdate = b2 : a2.next = b2; 6453 c2.lastBaseUpdate = b2; 6454 } 6455 function qh(a2, b2, c2, d2) { 6456 var e2 = a2.updateQueue; 6457 jh = false; 6458 var f2 = e2.firstBaseUpdate, g2 = e2.lastBaseUpdate, h2 = e2.shared.pending; 6459 if (null !== h2) { 6460 e2.shared.pending = null; 6461 var k2 = h2, l2 = k2.next; 6462 k2.next = null; 6463 null === g2 ? f2 = l2 : g2.next = l2; 6464 g2 = k2; 6465 var m2 = a2.alternate; 6466 null !== m2 && (m2 = m2.updateQueue, h2 = m2.lastBaseUpdate, h2 !== g2 && (null === h2 ? m2.firstBaseUpdate = l2 : h2.next = l2, m2.lastBaseUpdate = k2)); 6467 } 6468 if (null !== f2) { 6469 var q2 = e2.baseState; 6470 g2 = 0; 6471 m2 = l2 = k2 = null; 6472 h2 = f2; 6473 do { 6474 var r2 = h2.lane, y2 = h2.eventTime; 6475 if ((d2 & r2) === r2) { 6476 null !== m2 && (m2 = m2.next = { 6477 eventTime: y2, 6478 lane: 0, 6479 tag: h2.tag, 6480 payload: h2.payload, 6481 callback: h2.callback, 6482 next: null 6483 }); 6484 a: { 6485 var n2 = a2, t2 = h2; 6486 r2 = b2; 6487 y2 = c2; 6488 switch (t2.tag) { 6489 case 1: 6490 n2 = t2.payload; 6491 if ("function" === typeof n2) { 6492 q2 = n2.call(y2, q2, r2); 6493 break a; 6494 } 6495 q2 = n2; 6496 break a; 6497 case 3: 6498 n2.flags = n2.flags & -65537 | 128; 6499 case 0: 6500 n2 = t2.payload; 6501 r2 = "function" === typeof n2 ? n2.call(y2, q2, r2) : n2; 6502 if (null === r2 || void 0 === r2) break a; 6503 q2 = A2({}, q2, r2); 6504 break a; 6505 case 2: 6506 jh = true; 6507 } 6508 } 6509 null !== h2.callback && 0 !== h2.lane && (a2.flags |= 64, r2 = e2.effects, null === r2 ? e2.effects = [h2] : r2.push(h2)); 6510 } else y2 = { eventTime: y2, lane: r2, tag: h2.tag, payload: h2.payload, callback: h2.callback, next: null }, null === m2 ? (l2 = m2 = y2, k2 = q2) : m2 = m2.next = y2, g2 |= r2; 6511 h2 = h2.next; 6512 if (null === h2) if (h2 = e2.shared.pending, null === h2) break; 6513 else r2 = h2, h2 = r2.next, r2.next = null, e2.lastBaseUpdate = r2, e2.shared.pending = null; 6514 } while (1); 6515 null === m2 && (k2 = q2); 6516 e2.baseState = k2; 6517 e2.firstBaseUpdate = l2; 6518 e2.lastBaseUpdate = m2; 6519 b2 = e2.shared.interleaved; 6520 if (null !== b2) { 6521 e2 = b2; 6522 do 6523 g2 |= e2.lane, e2 = e2.next; 6524 while (e2 !== b2); 6525 } else null === f2 && (e2.shared.lanes = 0); 6526 rh |= g2; 6527 a2.lanes = g2; 6528 a2.memoizedState = q2; 6529 } 6530 } 6531 function sh(a2, b2, c2) { 6532 a2 = b2.effects; 6533 b2.effects = null; 6534 if (null !== a2) for (b2 = 0; b2 < a2.length; b2++) { 6535 var d2 = a2[b2], e2 = d2.callback; 6536 if (null !== e2) { 6537 d2.callback = null; 6538 d2 = c2; 6539 if ("function" !== typeof e2) throw Error(p2(191, e2)); 6540 e2.call(d2); 6541 } 6542 } 6543 } 6544 var th = {}, uh = Uf(th), vh2 = Uf(th), wh = Uf(th); 6545 function xh(a2) { 6546 if (a2 === th) throw Error(p2(174)); 6547 return a2; 6548 } 6549 function yh(a2, b2) { 6550 G2(wh, b2); 6551 G2(vh2, a2); 6552 G2(uh, th); 6553 a2 = b2.nodeType; 6554 switch (a2) { 6555 case 9: 6556 case 11: 6557 b2 = (b2 = b2.documentElement) ? b2.namespaceURI : lb(null, ""); 6558 break; 6559 default: 6560 a2 = 8 === a2 ? b2.parentNode : b2, b2 = a2.namespaceURI || null, a2 = a2.tagName, b2 = lb(b2, a2); 6561 } 6562 E2(uh); 6563 G2(uh, b2); 6564 } 6565 function zh() { 6566 E2(uh); 6567 E2(vh2); 6568 E2(wh); 6569 } 6570 function Ah(a2) { 6571 xh(wh.current); 6572 var b2 = xh(uh.current); 6573 var c2 = lb(b2, a2.type); 6574 b2 !== c2 && (G2(vh2, a2), G2(uh, c2)); 6575 } 6576 function Bh(a2) { 6577 vh2.current === a2 && (E2(uh), E2(vh2)); 6578 } 6579 var L2 = Uf(0); 6580 function Ch(a2) { 6581 for (var b2 = a2; null !== b2; ) { 6582 if (13 === b2.tag) { 6583 var c2 = b2.memoizedState; 6584 if (null !== c2 && (c2 = c2.dehydrated, null === c2 || "$?" === c2.data || "$!" === c2.data)) return b2; 6585 } else if (19 === b2.tag && void 0 !== b2.memoizedProps.revealOrder) { 6586 if (0 !== (b2.flags & 128)) return b2; 6587 } else if (null !== b2.child) { 6588 b2.child.return = b2; 6589 b2 = b2.child; 6590 continue; 6591 } 6592 if (b2 === a2) break; 6593 for (; null === b2.sibling; ) { 6594 if (null === b2.return || b2.return === a2) return null; 6595 b2 = b2.return; 6596 } 6597 b2.sibling.return = b2.return; 6598 b2 = b2.sibling; 6599 } 6600 return null; 6601 } 6602 var Dh = []; 6603 function Eh() { 6604 for (var a2 = 0; a2 < Dh.length; a2++) Dh[a2]._workInProgressVersionPrimary = null; 6605 Dh.length = 0; 6606 } 6607 var Fh = ua2.ReactCurrentDispatcher, Gh = ua2.ReactCurrentBatchConfig, Hh = 0, M2 = null, N2 = null, O2 = null, Ih = false, Jh = false, Kh = 0, Lh = 0; 6608 function P2() { 6609 throw Error(p2(321)); 6610 } 6611 function Mh(a2, b2) { 6612 if (null === b2) return false; 6613 for (var c2 = 0; c2 < b2.length && c2 < a2.length; c2++) if (!He2(a2[c2], b2[c2])) return false; 6614 return true; 6615 } 6616 function Nh(a2, b2, c2, d2, e2, f2) { 6617 Hh = f2; 6618 M2 = b2; 6619 b2.memoizedState = null; 6620 b2.updateQueue = null; 6621 b2.lanes = 0; 6622 Fh.current = null === a2 || null === a2.memoizedState ? Oh : Ph; 6623 a2 = c2(d2, e2); 6624 if (Jh) { 6625 f2 = 0; 6626 do { 6627 Jh = false; 6628 Kh = 0; 6629 if (25 <= f2) throw Error(p2(301)); 6630 f2 += 1; 6631 O2 = N2 = null; 6632 b2.updateQueue = null; 6633 Fh.current = Qh; 6634 a2 = c2(d2, e2); 6635 } while (Jh); 6636 } 6637 Fh.current = Rh; 6638 b2 = null !== N2 && null !== N2.next; 6639 Hh = 0; 6640 O2 = N2 = M2 = null; 6641 Ih = false; 6642 if (b2) throw Error(p2(300)); 6643 return a2; 6644 } 6645 function Sh() { 6646 var a2 = 0 !== Kh; 6647 Kh = 0; 6648 return a2; 6649 } 6650 function Th() { 6651 var a2 = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; 6652 null === O2 ? M2.memoizedState = O2 = a2 : O2 = O2.next = a2; 6653 return O2; 6654 } 6655 function Uh() { 6656 if (null === N2) { 6657 var a2 = M2.alternate; 6658 a2 = null !== a2 ? a2.memoizedState : null; 6659 } else a2 = N2.next; 6660 var b2 = null === O2 ? M2.memoizedState : O2.next; 6661 if (null !== b2) O2 = b2, N2 = a2; 6662 else { 6663 if (null === a2) throw Error(p2(310)); 6664 N2 = a2; 6665 a2 = { memoizedState: N2.memoizedState, baseState: N2.baseState, baseQueue: N2.baseQueue, queue: N2.queue, next: null }; 6666 null === O2 ? M2.memoizedState = O2 = a2 : O2 = O2.next = a2; 6667 } 6668 return O2; 6669 } 6670 function Vh(a2, b2) { 6671 return "function" === typeof b2 ? b2(a2) : b2; 6672 } 6673 function Wh(a2) { 6674 var b2 = Uh(), c2 = b2.queue; 6675 if (null === c2) throw Error(p2(311)); 6676 c2.lastRenderedReducer = a2; 6677 var d2 = N2, e2 = d2.baseQueue, f2 = c2.pending; 6678 if (null !== f2) { 6679 if (null !== e2) { 6680 var g2 = e2.next; 6681 e2.next = f2.next; 6682 f2.next = g2; 6683 } 6684 d2.baseQueue = e2 = f2; 6685 c2.pending = null; 6686 } 6687 if (null !== e2) { 6688 f2 = e2.next; 6689 d2 = d2.baseState; 6690 var h2 = g2 = null, k2 = null, l2 = f2; 6691 do { 6692 var m2 = l2.lane; 6693 if ((Hh & m2) === m2) null !== k2 && (k2 = k2.next = { lane: 0, action: l2.action, hasEagerState: l2.hasEagerState, eagerState: l2.eagerState, next: null }), d2 = l2.hasEagerState ? l2.eagerState : a2(d2, l2.action); 6694 else { 6695 var q2 = { 6696 lane: m2, 6697 action: l2.action, 6698 hasEagerState: l2.hasEagerState, 6699 eagerState: l2.eagerState, 6700 next: null 6701 }; 6702 null === k2 ? (h2 = k2 = q2, g2 = d2) : k2 = k2.next = q2; 6703 M2.lanes |= m2; 6704 rh |= m2; 6705 } 6706 l2 = l2.next; 6707 } while (null !== l2 && l2 !== f2); 6708 null === k2 ? g2 = d2 : k2.next = h2; 6709 He2(d2, b2.memoizedState) || (dh = true); 6710 b2.memoizedState = d2; 6711 b2.baseState = g2; 6712 b2.baseQueue = k2; 6713 c2.lastRenderedState = d2; 6714 } 6715 a2 = c2.interleaved; 6716 if (null !== a2) { 6717 e2 = a2; 6718 do 6719 f2 = e2.lane, M2.lanes |= f2, rh |= f2, e2 = e2.next; 6720 while (e2 !== a2); 6721 } else null === e2 && (c2.lanes = 0); 6722 return [b2.memoizedState, c2.dispatch]; 6723 } 6724 function Xh(a2) { 6725 var b2 = Uh(), c2 = b2.queue; 6726 if (null === c2) throw Error(p2(311)); 6727 c2.lastRenderedReducer = a2; 6728 var d2 = c2.dispatch, e2 = c2.pending, f2 = b2.memoizedState; 6729 if (null !== e2) { 6730 c2.pending = null; 6731 var g2 = e2 = e2.next; 6732 do 6733 f2 = a2(f2, g2.action), g2 = g2.next; 6734 while (g2 !== e2); 6735 He2(f2, b2.memoizedState) || (dh = true); 6736 b2.memoizedState = f2; 6737 null === b2.baseQueue && (b2.baseState = f2); 6738 c2.lastRenderedState = f2; 6739 } 6740 return [f2, d2]; 6741 } 6742 function Yh() { 6743 } 6744 function Zh(a2, b2) { 6745 var c2 = M2, d2 = Uh(), e2 = b2(), f2 = !He2(d2.memoizedState, e2); 6746 f2 && (d2.memoizedState = e2, dh = true); 6747 d2 = d2.queue; 6748 $h(ai2.bind(null, c2, d2, a2), [a2]); 6749 if (d2.getSnapshot !== b2 || f2 || null !== O2 && O2.memoizedState.tag & 1) { 6750 c2.flags |= 2048; 6751 bi2(9, ci2.bind(null, c2, d2, e2, b2), void 0, null); 6752 if (null === Q2) throw Error(p2(349)); 6753 0 !== (Hh & 30) || di2(c2, b2, e2); 6754 } 6755 return e2; 6756 } 6757 function di2(a2, b2, c2) { 6758 a2.flags |= 16384; 6759 a2 = { getSnapshot: b2, value: c2 }; 6760 b2 = M2.updateQueue; 6761 null === b2 ? (b2 = { lastEffect: null, stores: null }, M2.updateQueue = b2, b2.stores = [a2]) : (c2 = b2.stores, null === c2 ? b2.stores = [a2] : c2.push(a2)); 6762 } 6763 function ci2(a2, b2, c2, d2) { 6764 b2.value = c2; 6765 b2.getSnapshot = d2; 6766 ei2(b2) && fi2(a2); 6767 } 6768 function ai2(a2, b2, c2) { 6769 return c2(function() { 6770 ei2(b2) && fi2(a2); 6771 }); 6772 } 6773 function ei2(a2) { 6774 var b2 = a2.getSnapshot; 6775 a2 = a2.value; 6776 try { 6777 var c2 = b2(); 6778 return !He2(a2, c2); 6779 } catch (d2) { 6780 return true; 6781 } 6782 } 6783 function fi2(a2) { 6784 var b2 = ih(a2, 1); 6785 null !== b2 && gi2(b2, a2, 1, -1); 6786 } 6787 function hi(a2) { 6788 var b2 = Th(); 6789 "function" === typeof a2 && (a2 = a2()); 6790 b2.memoizedState = b2.baseState = a2; 6791 a2 = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Vh, lastRenderedState: a2 }; 6792 b2.queue = a2; 6793 a2 = a2.dispatch = ii2.bind(null, M2, a2); 6794 return [b2.memoizedState, a2]; 6795 } 6796 function bi2(a2, b2, c2, d2) { 6797 a2 = { tag: a2, create: b2, destroy: c2, deps: d2, next: null }; 6798 b2 = M2.updateQueue; 6799 null === b2 ? (b2 = { lastEffect: null, stores: null }, M2.updateQueue = b2, b2.lastEffect = a2.next = a2) : (c2 = b2.lastEffect, null === c2 ? b2.lastEffect = a2.next = a2 : (d2 = c2.next, c2.next = a2, a2.next = d2, b2.lastEffect = a2)); 6800 return a2; 6801 } 6802 function ji2() { 6803 return Uh().memoizedState; 6804 } 6805 function ki2(a2, b2, c2, d2) { 6806 var e2 = Th(); 6807 M2.flags |= a2; 6808 e2.memoizedState = bi2(1 | b2, c2, void 0, void 0 === d2 ? null : d2); 6809 } 6810 function li2(a2, b2, c2, d2) { 6811 var e2 = Uh(); 6812 d2 = void 0 === d2 ? null : d2; 6813 var f2 = void 0; 6814 if (null !== N2) { 6815 var g2 = N2.memoizedState; 6816 f2 = g2.destroy; 6817 if (null !== d2 && Mh(d2, g2.deps)) { 6818 e2.memoizedState = bi2(b2, c2, f2, d2); 6819 return; 6820 } 6821 } 6822 M2.flags |= a2; 6823 e2.memoizedState = bi2(1 | b2, c2, f2, d2); 6824 } 6825 function mi2(a2, b2) { 6826 return ki2(8390656, 8, a2, b2); 6827 } 6828 function $h(a2, b2) { 6829 return li2(2048, 8, a2, b2); 6830 } 6831 function ni2(a2, b2) { 6832 return li2(4, 2, a2, b2); 6833 } 6834 function oi2(a2, b2) { 6835 return li2(4, 4, a2, b2); 6836 } 6837 function pi2(a2, b2) { 6838 if ("function" === typeof b2) return a2 = a2(), b2(a2), function() { 6839 b2(null); 6840 }; 6841 if (null !== b2 && void 0 !== b2) return a2 = a2(), b2.current = a2, function() { 6842 b2.current = null; 6843 }; 6844 } 6845 function qi2(a2, b2, c2) { 6846 c2 = null !== c2 && void 0 !== c2 ? c2.concat([a2]) : null; 6847 return li2(4, 4, pi2.bind(null, b2, a2), c2); 6848 } 6849 function ri2() { 6850 } 6851 function si2(a2, b2) { 6852 var c2 = Uh(); 6853 b2 = void 0 === b2 ? null : b2; 6854 var d2 = c2.memoizedState; 6855 if (null !== d2 && null !== b2 && Mh(b2, d2[1])) return d2[0]; 6856 c2.memoizedState = [a2, b2]; 6857 return a2; 6858 } 6859 function ti2(a2, b2) { 6860 var c2 = Uh(); 6861 b2 = void 0 === b2 ? null : b2; 6862 var d2 = c2.memoizedState; 6863 if (null !== d2 && null !== b2 && Mh(b2, d2[1])) return d2[0]; 6864 a2 = a2(); 6865 c2.memoizedState = [a2, b2]; 6866 return a2; 6867 } 6868 function ui2(a2, b2, c2) { 6869 if (0 === (Hh & 21)) return a2.baseState && (a2.baseState = false, dh = true), a2.memoizedState = c2; 6870 He2(c2, b2) || (c2 = yc2(), M2.lanes |= c2, rh |= c2, a2.baseState = true); 6871 return b2; 6872 } 6873 function vi(a2, b2) { 6874 var c2 = C2; 6875 C2 = 0 !== c2 && 4 > c2 ? c2 : 4; 6876 a2(true); 6877 var d2 = Gh.transition; 6878 Gh.transition = {}; 6879 try { 6880 a2(false), b2(); 6881 } finally { 6882 C2 = c2, Gh.transition = d2; 6883 } 6884 } 6885 function wi2() { 6886 return Uh().memoizedState; 6887 } 6888 function xi2(a2, b2, c2) { 6889 var d2 = yi2(a2); 6890 c2 = { lane: d2, action: c2, hasEagerState: false, eagerState: null, next: null }; 6891 if (zi2(a2)) Ai2(b2, c2); 6892 else if (c2 = hh(a2, b2, c2, d2), null !== c2) { 6893 var e2 = R2(); 6894 gi2(c2, a2, d2, e2); 6895 Bi2(c2, b2, d2); 6896 } 6897 } 6898 function ii2(a2, b2, c2) { 6899 var d2 = yi2(a2), e2 = { lane: d2, action: c2, hasEagerState: false, eagerState: null, next: null }; 6900 if (zi2(a2)) Ai2(b2, e2); 6901 else { 6902 var f2 = a2.alternate; 6903 if (0 === a2.lanes && (null === f2 || 0 === f2.lanes) && (f2 = b2.lastRenderedReducer, null !== f2)) try { 6904 var g2 = b2.lastRenderedState, h2 = f2(g2, c2); 6905 e2.hasEagerState = true; 6906 e2.eagerState = h2; 6907 if (He2(h2, g2)) { 6908 var k2 = b2.interleaved; 6909 null === k2 ? (e2.next = e2, gh(b2)) : (e2.next = k2.next, k2.next = e2); 6910 b2.interleaved = e2; 6911 return; 6912 } 6913 } catch (l2) { 6914 } finally { 6915 } 6916 c2 = hh(a2, b2, e2, d2); 6917 null !== c2 && (e2 = R2(), gi2(c2, a2, d2, e2), Bi2(c2, b2, d2)); 6918 } 6919 } 6920 function zi2(a2) { 6921 var b2 = a2.alternate; 6922 return a2 === M2 || null !== b2 && b2 === M2; 6923 } 6924 function Ai2(a2, b2) { 6925 Jh = Ih = true; 6926 var c2 = a2.pending; 6927 null === c2 ? b2.next = b2 : (b2.next = c2.next, c2.next = b2); 6928 a2.pending = b2; 6929 } 6930 function Bi2(a2, b2, c2) { 6931 if (0 !== (c2 & 4194240)) { 6932 var d2 = b2.lanes; 6933 d2 &= a2.pendingLanes; 6934 c2 |= d2; 6935 b2.lanes = c2; 6936 Cc(a2, c2); 6937 } 6938 } 6939 var Rh = { readContext: eh, useCallback: P2, useContext: P2, useEffect: P2, useImperativeHandle: P2, useInsertionEffect: P2, useLayoutEffect: P2, useMemo: P2, useReducer: P2, useRef: P2, useState: P2, useDebugValue: P2, useDeferredValue: P2, useTransition: P2, useMutableSource: P2, useSyncExternalStore: P2, useId: P2, unstable_isNewReconciler: false }, Oh = { readContext: eh, useCallback: function(a2, b2) { 6940 Th().memoizedState = [a2, void 0 === b2 ? null : b2]; 6941 return a2; 6942 }, useContext: eh, useEffect: mi2, useImperativeHandle: function(a2, b2, c2) { 6943 c2 = null !== c2 && void 0 !== c2 ? c2.concat([a2]) : null; 6944 return ki2( 6945 4194308, 6946 4, 6947 pi2.bind(null, b2, a2), 6948 c2 6949 ); 6950 }, useLayoutEffect: function(a2, b2) { 6951 return ki2(4194308, 4, a2, b2); 6952 }, useInsertionEffect: function(a2, b2) { 6953 return ki2(4, 2, a2, b2); 6954 }, useMemo: function(a2, b2) { 6955 var c2 = Th(); 6956 b2 = void 0 === b2 ? null : b2; 6957 a2 = a2(); 6958 c2.memoizedState = [a2, b2]; 6959 return a2; 6960 }, useReducer: function(a2, b2, c2) { 6961 var d2 = Th(); 6962 b2 = void 0 !== c2 ? c2(b2) : b2; 6963 d2.memoizedState = d2.baseState = b2; 6964 a2 = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: a2, lastRenderedState: b2 }; 6965 d2.queue = a2; 6966 a2 = a2.dispatch = xi2.bind(null, M2, a2); 6967 return [d2.memoizedState, a2]; 6968 }, useRef: function(a2) { 6969 var b2 = Th(); 6970 a2 = { current: a2 }; 6971 return b2.memoizedState = a2; 6972 }, useState: hi, useDebugValue: ri2, useDeferredValue: function(a2) { 6973 return Th().memoizedState = a2; 6974 }, useTransition: function() { 6975 var a2 = hi(false), b2 = a2[0]; 6976 a2 = vi.bind(null, a2[1]); 6977 Th().memoizedState = a2; 6978 return [b2, a2]; 6979 }, useMutableSource: function() { 6980 }, useSyncExternalStore: function(a2, b2, c2) { 6981 var d2 = M2, e2 = Th(); 6982 if (I2) { 6983 if (void 0 === c2) throw Error(p2(407)); 6984 c2 = c2(); 6985 } else { 6986 c2 = b2(); 6987 if (null === Q2) throw Error(p2(349)); 6988 0 !== (Hh & 30) || di2(d2, b2, c2); 6989 } 6990 e2.memoizedState = c2; 6991 var f2 = { value: c2, getSnapshot: b2 }; 6992 e2.queue = f2; 6993 mi2(ai2.bind( 6994 null, 6995 d2, 6996 f2, 6997 a2 6998 ), [a2]); 6999 d2.flags |= 2048; 7000 bi2(9, ci2.bind(null, d2, f2, c2, b2), void 0, null); 7001 return c2; 7002 }, useId: function() { 7003 var a2 = Th(), b2 = Q2.identifierPrefix; 7004 if (I2) { 7005 var c2 = sg; 7006 var d2 = rg; 7007 c2 = (d2 & ~(1 << 32 - oc(d2) - 1)).toString(32) + c2; 7008 b2 = ":" + b2 + "R" + c2; 7009 c2 = Kh++; 7010 0 < c2 && (b2 += "H" + c2.toString(32)); 7011 b2 += ":"; 7012 } else c2 = Lh++, b2 = ":" + b2 + "r" + c2.toString(32) + ":"; 7013 return a2.memoizedState = b2; 7014 }, unstable_isNewReconciler: false }, Ph = { 7015 readContext: eh, 7016 useCallback: si2, 7017 useContext: eh, 7018 useEffect: $h, 7019 useImperativeHandle: qi2, 7020 useInsertionEffect: ni2, 7021 useLayoutEffect: oi2, 7022 useMemo: ti2, 7023 useReducer: Wh, 7024 useRef: ji2, 7025 useState: function() { 7026 return Wh(Vh); 7027 }, 7028 useDebugValue: ri2, 7029 useDeferredValue: function(a2) { 7030 var b2 = Uh(); 7031 return ui2(b2, N2.memoizedState, a2); 7032 }, 7033 useTransition: function() { 7034 var a2 = Wh(Vh)[0], b2 = Uh().memoizedState; 7035 return [a2, b2]; 7036 }, 7037 useMutableSource: Yh, 7038 useSyncExternalStore: Zh, 7039 useId: wi2, 7040 unstable_isNewReconciler: false 7041 }, Qh = { readContext: eh, useCallback: si2, useContext: eh, useEffect: $h, useImperativeHandle: qi2, useInsertionEffect: ni2, useLayoutEffect: oi2, useMemo: ti2, useReducer: Xh, useRef: ji2, useState: function() { 7042 return Xh(Vh); 7043 }, useDebugValue: ri2, useDeferredValue: function(a2) { 7044 var b2 = Uh(); 7045 return null === N2 ? b2.memoizedState = a2 : ui2(b2, N2.memoizedState, a2); 7046 }, useTransition: function() { 7047 var a2 = Xh(Vh)[0], b2 = Uh().memoizedState; 7048 return [a2, b2]; 7049 }, useMutableSource: Yh, useSyncExternalStore: Zh, useId: wi2, unstable_isNewReconciler: false }; 7050 function Ci2(a2, b2) { 7051 if (a2 && a2.defaultProps) { 7052 b2 = A2({}, b2); 7053 a2 = a2.defaultProps; 7054 for (var c2 in a2) void 0 === b2[c2] && (b2[c2] = a2[c2]); 7055 return b2; 7056 } 7057 return b2; 7058 } 7059 function Di2(a2, b2, c2, d2) { 7060 b2 = a2.memoizedState; 7061 c2 = c2(d2, b2); 7062 c2 = null === c2 || void 0 === c2 ? b2 : A2({}, b2, c2); 7063 a2.memoizedState = c2; 7064 0 === a2.lanes && (a2.updateQueue.baseState = c2); 7065 } 7066 var Ei2 = { isMounted: function(a2) { 7067 return (a2 = a2._reactInternals) ? Vb(a2) === a2 : false; 7068 }, enqueueSetState: function(a2, b2, c2) { 7069 a2 = a2._reactInternals; 7070 var d2 = R2(), e2 = yi2(a2), f2 = mh(d2, e2); 7071 f2.payload = b2; 7072 void 0 !== c2 && null !== c2 && (f2.callback = c2); 7073 b2 = nh(a2, f2, e2); 7074 null !== b2 && (gi2(b2, a2, e2, d2), oh(b2, a2, e2)); 7075 }, enqueueReplaceState: function(a2, b2, c2) { 7076 a2 = a2._reactInternals; 7077 var d2 = R2(), e2 = yi2(a2), f2 = mh(d2, e2); 7078 f2.tag = 1; 7079 f2.payload = b2; 7080 void 0 !== c2 && null !== c2 && (f2.callback = c2); 7081 b2 = nh(a2, f2, e2); 7082 null !== b2 && (gi2(b2, a2, e2, d2), oh(b2, a2, e2)); 7083 }, enqueueForceUpdate: function(a2, b2) { 7084 a2 = a2._reactInternals; 7085 var c2 = R2(), d2 = yi2(a2), e2 = mh(c2, d2); 7086 e2.tag = 2; 7087 void 0 !== b2 && null !== b2 && (e2.callback = b2); 7088 b2 = nh(a2, e2, d2); 7089 null !== b2 && (gi2(b2, a2, d2, c2), oh(b2, a2, d2)); 7090 } }; 7091 function Fi2(a2, b2, c2, d2, e2, f2, g2) { 7092 a2 = a2.stateNode; 7093 return "function" === typeof a2.shouldComponentUpdate ? a2.shouldComponentUpdate(d2, f2, g2) : b2.prototype && b2.prototype.isPureReactComponent ? !Ie2(c2, d2) || !Ie2(e2, f2) : true; 7094 } 7095 function Gi2(a2, b2, c2) { 7096 var d2 = false, e2 = Vf; 7097 var f2 = b2.contextType; 7098 "object" === typeof f2 && null !== f2 ? f2 = eh(f2) : (e2 = Zf(b2) ? Xf : H2.current, d2 = b2.contextTypes, f2 = (d2 = null !== d2 && void 0 !== d2) ? Yf(a2, e2) : Vf); 7099 b2 = new b2(c2, f2); 7100 a2.memoizedState = null !== b2.state && void 0 !== b2.state ? b2.state : null; 7101 b2.updater = Ei2; 7102 a2.stateNode = b2; 7103 b2._reactInternals = a2; 7104 d2 && (a2 = a2.stateNode, a2.__reactInternalMemoizedUnmaskedChildContext = e2, a2.__reactInternalMemoizedMaskedChildContext = f2); 7105 return b2; 7106 } 7107 function Hi2(a2, b2, c2, d2) { 7108 a2 = b2.state; 7109 "function" === typeof b2.componentWillReceiveProps && b2.componentWillReceiveProps(c2, d2); 7110 "function" === typeof b2.UNSAFE_componentWillReceiveProps && b2.UNSAFE_componentWillReceiveProps(c2, d2); 7111 b2.state !== a2 && Ei2.enqueueReplaceState(b2, b2.state, null); 7112 } 7113 function Ii2(a2, b2, c2, d2) { 7114 var e2 = a2.stateNode; 7115 e2.props = c2; 7116 e2.state = a2.memoizedState; 7117 e2.refs = {}; 7118 kh(a2); 7119 var f2 = b2.contextType; 7120 "object" === typeof f2 && null !== f2 ? e2.context = eh(f2) : (f2 = Zf(b2) ? Xf : H2.current, e2.context = Yf(a2, f2)); 7121 e2.state = a2.memoizedState; 7122 f2 = b2.getDerivedStateFromProps; 7123 "function" === typeof f2 && (Di2(a2, b2, f2, c2), e2.state = a2.memoizedState); 7124 "function" === typeof b2.getDerivedStateFromProps || "function" === typeof e2.getSnapshotBeforeUpdate || "function" !== typeof e2.UNSAFE_componentWillMount && "function" !== typeof e2.componentWillMount || (b2 = e2.state, "function" === typeof e2.componentWillMount && e2.componentWillMount(), "function" === typeof e2.UNSAFE_componentWillMount && e2.UNSAFE_componentWillMount(), b2 !== e2.state && Ei2.enqueueReplaceState(e2, e2.state, null), qh(a2, c2, e2, d2), e2.state = a2.memoizedState); 7125 "function" === typeof e2.componentDidMount && (a2.flags |= 4194308); 7126 } 7127 function Ji2(a2, b2) { 7128 try { 7129 var c2 = "", d2 = b2; 7130 do 7131 c2 += Pa2(d2), d2 = d2.return; 7132 while (d2); 7133 var e2 = c2; 7134 } catch (f2) { 7135 e2 = "\nError generating stack: " + f2.message + "\n" + f2.stack; 7136 } 7137 return { value: a2, source: b2, stack: e2, digest: null }; 7138 } 7139 function Ki2(a2, b2, c2) { 7140 return { value: a2, source: null, stack: null != c2 ? c2 : null, digest: null != b2 ? b2 : null }; 7141 } 7142 function Li2(a2, b2) { 7143 try { 7144 console.error(b2.value); 7145 } catch (c2) { 7146 setTimeout(function() { 7147 throw c2; 7148 }); 7149 } 7150 } 7151 var Mi2 = "function" === typeof WeakMap ? WeakMap : Map; 7152 function Ni2(a2, b2, c2) { 7153 c2 = mh(-1, c2); 7154 c2.tag = 3; 7155 c2.payload = { element: null }; 7156 var d2 = b2.value; 7157 c2.callback = function() { 7158 Oi2 || (Oi2 = true, Pi2 = d2); 7159 Li2(a2, b2); 7160 }; 7161 return c2; 7162 } 7163 function Qi2(a2, b2, c2) { 7164 c2 = mh(-1, c2); 7165 c2.tag = 3; 7166 var d2 = a2.type.getDerivedStateFromError; 7167 if ("function" === typeof d2) { 7168 var e2 = b2.value; 7169 c2.payload = function() { 7170 return d2(e2); 7171 }; 7172 c2.callback = function() { 7173 Li2(a2, b2); 7174 }; 7175 } 7176 var f2 = a2.stateNode; 7177 null !== f2 && "function" === typeof f2.componentDidCatch && (c2.callback = function() { 7178 Li2(a2, b2); 7179 "function" !== typeof d2 && (null === Ri2 ? Ri2 = /* @__PURE__ */ new Set([this]) : Ri2.add(this)); 7180 var c3 = b2.stack; 7181 this.componentDidCatch(b2.value, { componentStack: null !== c3 ? c3 : "" }); 7182 }); 7183 return c2; 7184 } 7185 function Si2(a2, b2, c2) { 7186 var d2 = a2.pingCache; 7187 if (null === d2) { 7188 d2 = a2.pingCache = new Mi2(); 7189 var e2 = /* @__PURE__ */ new Set(); 7190 d2.set(b2, e2); 7191 } else e2 = d2.get(b2), void 0 === e2 && (e2 = /* @__PURE__ */ new Set(), d2.set(b2, e2)); 7192 e2.has(c2) || (e2.add(c2), a2 = Ti2.bind(null, a2, b2, c2), b2.then(a2, a2)); 7193 } 7194 function Ui2(a2) { 7195 do { 7196 var b2; 7197 if (b2 = 13 === a2.tag) b2 = a2.memoizedState, b2 = null !== b2 ? null !== b2.dehydrated ? true : false : true; 7198 if (b2) return a2; 7199 a2 = a2.return; 7200 } while (null !== a2); 7201 return null; 7202 } 7203 function Vi2(a2, b2, c2, d2, e2) { 7204 if (0 === (a2.mode & 1)) return a2 === b2 ? a2.flags |= 65536 : (a2.flags |= 128, c2.flags |= 131072, c2.flags &= -52805, 1 === c2.tag && (null === c2.alternate ? c2.tag = 17 : (b2 = mh(-1, 1), b2.tag = 2, nh(c2, b2, 1))), c2.lanes |= 1), a2; 7205 a2.flags |= 65536; 7206 a2.lanes = e2; 7207 return a2; 7208 } 7209 var Wi2 = ua2.ReactCurrentOwner, dh = false; 7210 function Xi2(a2, b2, c2, d2) { 7211 b2.child = null === a2 ? Vg(b2, null, c2, d2) : Ug(b2, a2.child, c2, d2); 7212 } 7213 function Yi2(a2, b2, c2, d2, e2) { 7214 c2 = c2.render; 7215 var f2 = b2.ref; 7216 ch(b2, e2); 7217 d2 = Nh(a2, b2, c2, d2, f2, e2); 7218 c2 = Sh(); 7219 if (null !== a2 && !dh) return b2.updateQueue = a2.updateQueue, b2.flags &= -2053, a2.lanes &= ~e2, Zi2(a2, b2, e2); 7220 I2 && c2 && vg(b2); 7221 b2.flags |= 1; 7222 Xi2(a2, b2, d2, e2); 7223 return b2.child; 7224 } 7225 function $i2(a2, b2, c2, d2, e2) { 7226 if (null === a2) { 7227 var f2 = c2.type; 7228 if ("function" === typeof f2 && !aj(f2) && void 0 === f2.defaultProps && null === c2.compare && void 0 === c2.defaultProps) return b2.tag = 15, b2.type = f2, bj(a2, b2, f2, d2, e2); 7229 a2 = Rg(c2.type, null, d2, b2, b2.mode, e2); 7230 a2.ref = b2.ref; 7231 a2.return = b2; 7232 return b2.child = a2; 7233 } 7234 f2 = a2.child; 7235 if (0 === (a2.lanes & e2)) { 7236 var g2 = f2.memoizedProps; 7237 c2 = c2.compare; 7238 c2 = null !== c2 ? c2 : Ie2; 7239 if (c2(g2, d2) && a2.ref === b2.ref) return Zi2(a2, b2, e2); 7240 } 7241 b2.flags |= 1; 7242 a2 = Pg(f2, d2); 7243 a2.ref = b2.ref; 7244 a2.return = b2; 7245 return b2.child = a2; 7246 } 7247 function bj(a2, b2, c2, d2, e2) { 7248 if (null !== a2) { 7249 var f2 = a2.memoizedProps; 7250 if (Ie2(f2, d2) && a2.ref === b2.ref) if (dh = false, b2.pendingProps = d2 = f2, 0 !== (a2.lanes & e2)) 0 !== (a2.flags & 131072) && (dh = true); 7251 else return b2.lanes = a2.lanes, Zi2(a2, b2, e2); 7252 } 7253 return cj(a2, b2, c2, d2, e2); 7254 } 7255 function dj(a2, b2, c2) { 7256 var d2 = b2.pendingProps, e2 = d2.children, f2 = null !== a2 ? a2.memoizedState : null; 7257 if ("hidden" === d2.mode) if (0 === (b2.mode & 1)) b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, G2(ej, fj), fj |= c2; 7258 else { 7259 if (0 === (c2 & 1073741824)) return a2 = null !== f2 ? f2.baseLanes | c2 : c2, b2.lanes = b2.childLanes = 1073741824, b2.memoizedState = { baseLanes: a2, cachePool: null, transitions: null }, b2.updateQueue = null, G2(ej, fj), fj |= a2, null; 7260 b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }; 7261 d2 = null !== f2 ? f2.baseLanes : c2; 7262 G2(ej, fj); 7263 fj |= d2; 7264 } 7265 else null !== f2 ? (d2 = f2.baseLanes | c2, b2.memoizedState = null) : d2 = c2, G2(ej, fj), fj |= d2; 7266 Xi2(a2, b2, e2, c2); 7267 return b2.child; 7268 } 7269 function gj(a2, b2) { 7270 var c2 = b2.ref; 7271 if (null === a2 && null !== c2 || null !== a2 && a2.ref !== c2) b2.flags |= 512, b2.flags |= 2097152; 7272 } 7273 function cj(a2, b2, c2, d2, e2) { 7274 var f2 = Zf(c2) ? Xf : H2.current; 7275 f2 = Yf(b2, f2); 7276 ch(b2, e2); 7277 c2 = Nh(a2, b2, c2, d2, f2, e2); 7278 d2 = Sh(); 7279 if (null !== a2 && !dh) return b2.updateQueue = a2.updateQueue, b2.flags &= -2053, a2.lanes &= ~e2, Zi2(a2, b2, e2); 7280 I2 && d2 && vg(b2); 7281 b2.flags |= 1; 7282 Xi2(a2, b2, c2, e2); 7283 return b2.child; 7284 } 7285 function hj(a2, b2, c2, d2, e2) { 7286 if (Zf(c2)) { 7287 var f2 = true; 7288 cg(b2); 7289 } else f2 = false; 7290 ch(b2, e2); 7291 if (null === b2.stateNode) ij(a2, b2), Gi2(b2, c2, d2), Ii2(b2, c2, d2, e2), d2 = true; 7292 else if (null === a2) { 7293 var g2 = b2.stateNode, h2 = b2.memoizedProps; 7294 g2.props = h2; 7295 var k2 = g2.context, l2 = c2.contextType; 7296 "object" === typeof l2 && null !== l2 ? l2 = eh(l2) : (l2 = Zf(c2) ? Xf : H2.current, l2 = Yf(b2, l2)); 7297 var m2 = c2.getDerivedStateFromProps, q2 = "function" === typeof m2 || "function" === typeof g2.getSnapshotBeforeUpdate; 7298 q2 || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== d2 || k2 !== l2) && Hi2(b2, g2, d2, l2); 7299 jh = false; 7300 var r2 = b2.memoizedState; 7301 g2.state = r2; 7302 qh(b2, d2, g2, e2); 7303 k2 = b2.memoizedState; 7304 h2 !== d2 || r2 !== k2 || Wf.current || jh ? ("function" === typeof m2 && (Di2(b2, c2, m2, d2), k2 = b2.memoizedState), (h2 = jh || Fi2(b2, c2, h2, d2, r2, k2, l2)) ? (q2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b2.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), b2.memoizedProps = d2, b2.memoizedState = k2), g2.props = d2, g2.state = k2, g2.context = l2, d2 = h2) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), d2 = false); 7305 } else { 7306 g2 = b2.stateNode; 7307 lh(a2, b2); 7308 h2 = b2.memoizedProps; 7309 l2 = b2.type === b2.elementType ? h2 : Ci2(b2.type, h2); 7310 g2.props = l2; 7311 q2 = b2.pendingProps; 7312 r2 = g2.context; 7313 k2 = c2.contextType; 7314 "object" === typeof k2 && null !== k2 ? k2 = eh(k2) : (k2 = Zf(c2) ? Xf : H2.current, k2 = Yf(b2, k2)); 7315 var y2 = c2.getDerivedStateFromProps; 7316 (m2 = "function" === typeof y2 || "function" === typeof g2.getSnapshotBeforeUpdate) || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== q2 || r2 !== k2) && Hi2(b2, g2, d2, k2); 7317 jh = false; 7318 r2 = b2.memoizedState; 7319 g2.state = r2; 7320 qh(b2, d2, g2, e2); 7321 var n2 = b2.memoizedState; 7322 h2 !== q2 || r2 !== n2 || Wf.current || jh ? ("function" === typeof y2 && (Di2(b2, c2, y2, d2), n2 = b2.memoizedState), (l2 = jh || Fi2(b2, c2, l2, d2, r2, n2, k2) || false) ? (m2 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d2, n2, k2), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d2, n2, k2)), "function" === typeof g2.componentDidUpdate && (b2.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b2.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 1024), b2.memoizedProps = d2, b2.memoizedState = n2), g2.props = d2, g2.state = n2, g2.context = k2, d2 = l2) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 1024), d2 = false); 7323 } 7324 return jj(a2, b2, c2, d2, f2, e2); 7325 } 7326 function jj(a2, b2, c2, d2, e2, f2) { 7327 gj(a2, b2); 7328 var g2 = 0 !== (b2.flags & 128); 7329 if (!d2 && !g2) return e2 && dg(b2, c2, false), Zi2(a2, b2, f2); 7330 d2 = b2.stateNode; 7331 Wi2.current = b2; 7332 var h2 = g2 && "function" !== typeof c2.getDerivedStateFromError ? null : d2.render(); 7333 b2.flags |= 1; 7334 null !== a2 && g2 ? (b2.child = Ug(b2, a2.child, null, f2), b2.child = Ug(b2, null, h2, f2)) : Xi2(a2, b2, h2, f2); 7335 b2.memoizedState = d2.state; 7336 e2 && dg(b2, c2, true); 7337 return b2.child; 7338 } 7339 function kj(a2) { 7340 var b2 = a2.stateNode; 7341 b2.pendingContext ? ag(a2, b2.pendingContext, b2.pendingContext !== b2.context) : b2.context && ag(a2, b2.context, false); 7342 yh(a2, b2.containerInfo); 7343 } 7344 function lj(a2, b2, c2, d2, e2) { 7345 Ig(); 7346 Jg(e2); 7347 b2.flags |= 256; 7348 Xi2(a2, b2, c2, d2); 7349 return b2.child; 7350 } 7351 var mj = { dehydrated: null, treeContext: null, retryLane: 0 }; 7352 function nj(a2) { 7353 return { baseLanes: a2, cachePool: null, transitions: null }; 7354 } 7355 function oj(a2, b2, c2) { 7356 var d2 = b2.pendingProps, e2 = L2.current, f2 = false, g2 = 0 !== (b2.flags & 128), h2; 7357 (h2 = g2) || (h2 = null !== a2 && null === a2.memoizedState ? false : 0 !== (e2 & 2)); 7358 if (h2) f2 = true, b2.flags &= -129; 7359 else if (null === a2 || null !== a2.memoizedState) e2 |= 1; 7360 G2(L2, e2 & 1); 7361 if (null === a2) { 7362 Eg(b2); 7363 a2 = b2.memoizedState; 7364 if (null !== a2 && (a2 = a2.dehydrated, null !== a2)) return 0 === (b2.mode & 1) ? b2.lanes = 1 : "$!" === a2.data ? b2.lanes = 8 : b2.lanes = 1073741824, null; 7365 g2 = d2.children; 7366 a2 = d2.fallback; 7367 return f2 ? (d2 = b2.mode, f2 = b2.child, g2 = { mode: "hidden", children: g2 }, 0 === (d2 & 1) && null !== f2 ? (f2.childLanes = 0, f2.pendingProps = g2) : f2 = pj(g2, d2, 0, null), a2 = Tg(a2, d2, c2, null), f2.return = b2, a2.return = b2, f2.sibling = a2, b2.child = f2, b2.child.memoizedState = nj(c2), b2.memoizedState = mj, a2) : qj(b2, g2); 7368 } 7369 e2 = a2.memoizedState; 7370 if (null !== e2 && (h2 = e2.dehydrated, null !== h2)) return rj(a2, b2, g2, d2, h2, e2, c2); 7371 if (f2) { 7372 f2 = d2.fallback; 7373 g2 = b2.mode; 7374 e2 = a2.child; 7375 h2 = e2.sibling; 7376 var k2 = { mode: "hidden", children: d2.children }; 7377 0 === (g2 & 1) && b2.child !== e2 ? (d2 = b2.child, d2.childLanes = 0, d2.pendingProps = k2, b2.deletions = null) : (d2 = Pg(e2, k2), d2.subtreeFlags = e2.subtreeFlags & 14680064); 7378 null !== h2 ? f2 = Pg(h2, f2) : (f2 = Tg(f2, g2, c2, null), f2.flags |= 2); 7379 f2.return = b2; 7380 d2.return = b2; 7381 d2.sibling = f2; 7382 b2.child = d2; 7383 d2 = f2; 7384 f2 = b2.child; 7385 g2 = a2.child.memoizedState; 7386 g2 = null === g2 ? nj(c2) : { baseLanes: g2.baseLanes | c2, cachePool: null, transitions: g2.transitions }; 7387 f2.memoizedState = g2; 7388 f2.childLanes = a2.childLanes & ~c2; 7389 b2.memoizedState = mj; 7390 return d2; 7391 } 7392 f2 = a2.child; 7393 a2 = f2.sibling; 7394 d2 = Pg(f2, { mode: "visible", children: d2.children }); 7395 0 === (b2.mode & 1) && (d2.lanes = c2); 7396 d2.return = b2; 7397 d2.sibling = null; 7398 null !== a2 && (c2 = b2.deletions, null === c2 ? (b2.deletions = [a2], b2.flags |= 16) : c2.push(a2)); 7399 b2.child = d2; 7400 b2.memoizedState = null; 7401 return d2; 7402 } 7403 function qj(a2, b2) { 7404 b2 = pj({ mode: "visible", children: b2 }, a2.mode, 0, null); 7405 b2.return = a2; 7406 return a2.child = b2; 7407 } 7408 function sj(a2, b2, c2, d2) { 7409 null !== d2 && Jg(d2); 7410 Ug(b2, a2.child, null, c2); 7411 a2 = qj(b2, b2.pendingProps.children); 7412 a2.flags |= 2; 7413 b2.memoizedState = null; 7414 return a2; 7415 } 7416 function rj(a2, b2, c2, d2, e2, f2, g2) { 7417 if (c2) { 7418 if (b2.flags & 256) return b2.flags &= -257, d2 = Ki2(Error(p2(422))), sj(a2, b2, g2, d2); 7419 if (null !== b2.memoizedState) return b2.child = a2.child, b2.flags |= 128, null; 7420 f2 = d2.fallback; 7421 e2 = b2.mode; 7422 d2 = pj({ mode: "visible", children: d2.children }, e2, 0, null); 7423 f2 = Tg(f2, e2, g2, null); 7424 f2.flags |= 2; 7425 d2.return = b2; 7426 f2.return = b2; 7427 d2.sibling = f2; 7428 b2.child = d2; 7429 0 !== (b2.mode & 1) && Ug(b2, a2.child, null, g2); 7430 b2.child.memoizedState = nj(g2); 7431 b2.memoizedState = mj; 7432 return f2; 7433 } 7434 if (0 === (b2.mode & 1)) return sj(a2, b2, g2, null); 7435 if ("$!" === e2.data) { 7436 d2 = e2.nextSibling && e2.nextSibling.dataset; 7437 if (d2) var h2 = d2.dgst; 7438 d2 = h2; 7439 f2 = Error(p2(419)); 7440 d2 = Ki2(f2, d2, void 0); 7441 return sj(a2, b2, g2, d2); 7442 } 7443 h2 = 0 !== (g2 & a2.childLanes); 7444 if (dh || h2) { 7445 d2 = Q2; 7446 if (null !== d2) { 7447 switch (g2 & -g2) { 7448 case 4: 7449 e2 = 2; 7450 break; 7451 case 16: 7452 e2 = 8; 7453 break; 7454 case 64: 7455 case 128: 7456 case 256: 7457 case 512: 7458 case 1024: 7459 case 2048: 7460 case 4096: 7461 case 8192: 7462 case 16384: 7463 case 32768: 7464 case 65536: 7465 case 131072: 7466 case 262144: 7467 case 524288: 7468 case 1048576: 7469 case 2097152: 7470 case 4194304: 7471 case 8388608: 7472 case 16777216: 7473 case 33554432: 7474 case 67108864: 7475 e2 = 32; 7476 break; 7477 case 536870912: 7478 e2 = 268435456; 7479 break; 7480 default: 7481 e2 = 0; 7482 } 7483 e2 = 0 !== (e2 & (d2.suspendedLanes | g2)) ? 0 : e2; 7484 0 !== e2 && e2 !== f2.retryLane && (f2.retryLane = e2, ih(a2, e2), gi2(d2, a2, e2, -1)); 7485 } 7486 tj(); 7487 d2 = Ki2(Error(p2(421))); 7488 return sj(a2, b2, g2, d2); 7489 } 7490 if ("$?" === e2.data) return b2.flags |= 128, b2.child = a2.child, b2 = uj.bind(null, a2), e2._reactRetry = b2, null; 7491 a2 = f2.treeContext; 7492 yg = Lf(e2.nextSibling); 7493 xg = b2; 7494 I2 = true; 7495 zg = null; 7496 null !== a2 && (og[pg++] = rg, og[pg++] = sg, og[pg++] = qg, rg = a2.id, sg = a2.overflow, qg = b2); 7497 b2 = qj(b2, d2.children); 7498 b2.flags |= 4096; 7499 return b2; 7500 } 7501 function vj(a2, b2, c2) { 7502 a2.lanes |= b2; 7503 var d2 = a2.alternate; 7504 null !== d2 && (d2.lanes |= b2); 7505 bh(a2.return, b2, c2); 7506 } 7507 function wj(a2, b2, c2, d2, e2) { 7508 var f2 = a2.memoizedState; 7509 null === f2 ? a2.memoizedState = { isBackwards: b2, rendering: null, renderingStartTime: 0, last: d2, tail: c2, tailMode: e2 } : (f2.isBackwards = b2, f2.rendering = null, f2.renderingStartTime = 0, f2.last = d2, f2.tail = c2, f2.tailMode = e2); 7510 } 7511 function xj(a2, b2, c2) { 7512 var d2 = b2.pendingProps, e2 = d2.revealOrder, f2 = d2.tail; 7513 Xi2(a2, b2, d2.children, c2); 7514 d2 = L2.current; 7515 if (0 !== (d2 & 2)) d2 = d2 & 1 | 2, b2.flags |= 128; 7516 else { 7517 if (null !== a2 && 0 !== (a2.flags & 128)) a: for (a2 = b2.child; null !== a2; ) { 7518 if (13 === a2.tag) null !== a2.memoizedState && vj(a2, c2, b2); 7519 else if (19 === a2.tag) vj(a2, c2, b2); 7520 else if (null !== a2.child) { 7521 a2.child.return = a2; 7522 a2 = a2.child; 7523 continue; 7524 } 7525 if (a2 === b2) break a; 7526 for (; null === a2.sibling; ) { 7527 if (null === a2.return || a2.return === b2) break a; 7528 a2 = a2.return; 7529 } 7530 a2.sibling.return = a2.return; 7531 a2 = a2.sibling; 7532 } 7533 d2 &= 1; 7534 } 7535 G2(L2, d2); 7536 if (0 === (b2.mode & 1)) b2.memoizedState = null; 7537 else switch (e2) { 7538 case "forwards": 7539 c2 = b2.child; 7540 for (e2 = null; null !== c2; ) a2 = c2.alternate, null !== a2 && null === Ch(a2) && (e2 = c2), c2 = c2.sibling; 7541 c2 = e2; 7542 null === c2 ? (e2 = b2.child, b2.child = null) : (e2 = c2.sibling, c2.sibling = null); 7543 wj(b2, false, e2, c2, f2); 7544 break; 7545 case "backwards": 7546 c2 = null; 7547 e2 = b2.child; 7548 for (b2.child = null; null !== e2; ) { 7549 a2 = e2.alternate; 7550 if (null !== a2 && null === Ch(a2)) { 7551 b2.child = e2; 7552 break; 7553 } 7554 a2 = e2.sibling; 7555 e2.sibling = c2; 7556 c2 = e2; 7557 e2 = a2; 7558 } 7559 wj(b2, true, c2, null, f2); 7560 break; 7561 case "together": 7562 wj(b2, false, null, null, void 0); 7563 break; 7564 default: 7565 b2.memoizedState = null; 7566 } 7567 return b2.child; 7568 } 7569 function ij(a2, b2) { 7570 0 === (b2.mode & 1) && null !== a2 && (a2.alternate = null, b2.alternate = null, b2.flags |= 2); 7571 } 7572 function Zi2(a2, b2, c2) { 7573 null !== a2 && (b2.dependencies = a2.dependencies); 7574 rh |= b2.lanes; 7575 if (0 === (c2 & b2.childLanes)) return null; 7576 if (null !== a2 && b2.child !== a2.child) throw Error(p2(153)); 7577 if (null !== b2.child) { 7578 a2 = b2.child; 7579 c2 = Pg(a2, a2.pendingProps); 7580 b2.child = c2; 7581 for (c2.return = b2; null !== a2.sibling; ) a2 = a2.sibling, c2 = c2.sibling = Pg(a2, a2.pendingProps), c2.return = b2; 7582 c2.sibling = null; 7583 } 7584 return b2.child; 7585 } 7586 function yj(a2, b2, c2) { 7587 switch (b2.tag) { 7588 case 3: 7589 kj(b2); 7590 Ig(); 7591 break; 7592 case 5: 7593 Ah(b2); 7594 break; 7595 case 1: 7596 Zf(b2.type) && cg(b2); 7597 break; 7598 case 4: 7599 yh(b2, b2.stateNode.containerInfo); 7600 break; 7601 case 10: 7602 var d2 = b2.type._context, e2 = b2.memoizedProps.value; 7603 G2(Wg, d2._currentValue); 7604 d2._currentValue = e2; 7605 break; 7606 case 13: 7607 d2 = b2.memoizedState; 7608 if (null !== d2) { 7609 if (null !== d2.dehydrated) return G2(L2, L2.current & 1), b2.flags |= 128, null; 7610 if (0 !== (c2 & b2.child.childLanes)) return oj(a2, b2, c2); 7611 G2(L2, L2.current & 1); 7612 a2 = Zi2(a2, b2, c2); 7613 return null !== a2 ? a2.sibling : null; 7614 } 7615 G2(L2, L2.current & 1); 7616 break; 7617 case 19: 7618 d2 = 0 !== (c2 & b2.childLanes); 7619 if (0 !== (a2.flags & 128)) { 7620 if (d2) return xj(a2, b2, c2); 7621 b2.flags |= 128; 7622 } 7623 e2 = b2.memoizedState; 7624 null !== e2 && (e2.rendering = null, e2.tail = null, e2.lastEffect = null); 7625 G2(L2, L2.current); 7626 if (d2) break; 7627 else return null; 7628 case 22: 7629 case 23: 7630 return b2.lanes = 0, dj(a2, b2, c2); 7631 } 7632 return Zi2(a2, b2, c2); 7633 } 7634 var zj, Aj, Bj, Cj; 7635 zj = function(a2, b2) { 7636 for (var c2 = b2.child; null !== c2; ) { 7637 if (5 === c2.tag || 6 === c2.tag) a2.appendChild(c2.stateNode); 7638 else if (4 !== c2.tag && null !== c2.child) { 7639 c2.child.return = c2; 7640 c2 = c2.child; 7641 continue; 7642 } 7643 if (c2 === b2) break; 7644 for (; null === c2.sibling; ) { 7645 if (null === c2.return || c2.return === b2) return; 7646 c2 = c2.return; 7647 } 7648 c2.sibling.return = c2.return; 7649 c2 = c2.sibling; 7650 } 7651 }; 7652 Aj = function() { 7653 }; 7654 Bj = function(a2, b2, c2, d2) { 7655 var e2 = a2.memoizedProps; 7656 if (e2 !== d2) { 7657 a2 = b2.stateNode; 7658 xh(uh.current); 7659 var f2 = null; 7660 switch (c2) { 7661 case "input": 7662 e2 = Ya2(a2, e2); 7663 d2 = Ya2(a2, d2); 7664 f2 = []; 7665 break; 7666 case "select": 7667 e2 = A2({}, e2, { value: void 0 }); 7668 d2 = A2({}, d2, { value: void 0 }); 7669 f2 = []; 7670 break; 7671 case "textarea": 7672 e2 = gb(a2, e2); 7673 d2 = gb(a2, d2); 7674 f2 = []; 7675 break; 7676 default: 7677 "function" !== typeof e2.onClick && "function" === typeof d2.onClick && (a2.onclick = Bf); 7678 } 7679 ub(c2, d2); 7680 var g2; 7681 c2 = null; 7682 for (l2 in e2) if (!d2.hasOwnProperty(l2) && e2.hasOwnProperty(l2) && null != e2[l2]) if ("style" === l2) { 7683 var h2 = e2[l2]; 7684 for (g2 in h2) h2.hasOwnProperty(g2) && (c2 || (c2 = {}), c2[g2] = ""); 7685 } else "dangerouslySetInnerHTML" !== l2 && "children" !== l2 && "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && "autoFocus" !== l2 && (ea2.hasOwnProperty(l2) ? f2 || (f2 = []) : (f2 = f2 || []).push(l2, null)); 7686 for (l2 in d2) { 7687 var k2 = d2[l2]; 7688 h2 = null != e2 ? e2[l2] : void 0; 7689 if (d2.hasOwnProperty(l2) && k2 !== h2 && (null != k2 || null != h2)) if ("style" === l2) if (h2) { 7690 for (g2 in h2) !h2.hasOwnProperty(g2) || k2 && k2.hasOwnProperty(g2) || (c2 || (c2 = {}), c2[g2] = ""); 7691 for (g2 in k2) k2.hasOwnProperty(g2) && h2[g2] !== k2[g2] && (c2 || (c2 = {}), c2[g2] = k2[g2]); 7692 } else c2 || (f2 || (f2 = []), f2.push( 7693 l2, 7694 c2 7695 )), c2 = k2; 7696 else "dangerouslySetInnerHTML" === l2 ? (k2 = k2 ? k2.__html : void 0, h2 = h2 ? h2.__html : void 0, null != k2 && h2 !== k2 && (f2 = f2 || []).push(l2, k2)) : "children" === l2 ? "string" !== typeof k2 && "number" !== typeof k2 || (f2 = f2 || []).push(l2, "" + k2) : "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && (ea2.hasOwnProperty(l2) ? (null != k2 && "onScroll" === l2 && D2("scroll", a2), f2 || h2 === k2 || (f2 = [])) : (f2 = f2 || []).push(l2, k2)); 7697 } 7698 c2 && (f2 = f2 || []).push("style", c2); 7699 var l2 = f2; 7700 if (b2.updateQueue = l2) b2.flags |= 4; 7701 } 7702 }; 7703 Cj = function(a2, b2, c2, d2) { 7704 c2 !== d2 && (b2.flags |= 4); 7705 }; 7706 function Dj(a2, b2) { 7707 if (!I2) switch (a2.tailMode) { 7708 case "hidden": 7709 b2 = a2.tail; 7710 for (var c2 = null; null !== b2; ) null !== b2.alternate && (c2 = b2), b2 = b2.sibling; 7711 null === c2 ? a2.tail = null : c2.sibling = null; 7712 break; 7713 case "collapsed": 7714 c2 = a2.tail; 7715 for (var d2 = null; null !== c2; ) null !== c2.alternate && (d2 = c2), c2 = c2.sibling; 7716 null === d2 ? b2 || null === a2.tail ? a2.tail = null : a2.tail.sibling = null : d2.sibling = null; 7717 } 7718 } 7719 function S2(a2) { 7720 var b2 = null !== a2.alternate && a2.alternate.child === a2.child, c2 = 0, d2 = 0; 7721 if (b2) for (var e2 = a2.child; null !== e2; ) c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags & 14680064, d2 |= e2.flags & 14680064, e2.return = a2, e2 = e2.sibling; 7722 else for (e2 = a2.child; null !== e2; ) c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags, d2 |= e2.flags, e2.return = a2, e2 = e2.sibling; 7723 a2.subtreeFlags |= d2; 7724 a2.childLanes = c2; 7725 return b2; 7726 } 7727 function Ej(a2, b2, c2) { 7728 var d2 = b2.pendingProps; 7729 wg(b2); 7730 switch (b2.tag) { 7731 case 2: 7732 case 16: 7733 case 15: 7734 case 0: 7735 case 11: 7736 case 7: 7737 case 8: 7738 case 12: 7739 case 9: 7740 case 14: 7741 return S2(b2), null; 7742 case 1: 7743 return Zf(b2.type) && $f(), S2(b2), null; 7744 case 3: 7745 d2 = b2.stateNode; 7746 zh(); 7747 E2(Wf); 7748 E2(H2); 7749 Eh(); 7750 d2.pendingContext && (d2.context = d2.pendingContext, d2.pendingContext = null); 7751 if (null === a2 || null === a2.child) Gg(b2) ? b2.flags |= 4 : null === a2 || a2.memoizedState.isDehydrated && 0 === (b2.flags & 256) || (b2.flags |= 1024, null !== zg && (Fj(zg), zg = null)); 7752 Aj(a2, b2); 7753 S2(b2); 7754 return null; 7755 case 5: 7756 Bh(b2); 7757 var e2 = xh(wh.current); 7758 c2 = b2.type; 7759 if (null !== a2 && null != b2.stateNode) Bj(a2, b2, c2, d2, e2), a2.ref !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152); 7760 else { 7761 if (!d2) { 7762 if (null === b2.stateNode) throw Error(p2(166)); 7763 S2(b2); 7764 return null; 7765 } 7766 a2 = xh(uh.current); 7767 if (Gg(b2)) { 7768 d2 = b2.stateNode; 7769 c2 = b2.type; 7770 var f2 = b2.memoizedProps; 7771 d2[Of] = b2; 7772 d2[Pf] = f2; 7773 a2 = 0 !== (b2.mode & 1); 7774 switch (c2) { 7775 case "dialog": 7776 D2("cancel", d2); 7777 D2("close", d2); 7778 break; 7779 case "iframe": 7780 case "object": 7781 case "embed": 7782 D2("load", d2); 7783 break; 7784 case "video": 7785 case "audio": 7786 for (e2 = 0; e2 < lf.length; e2++) D2(lf[e2], d2); 7787 break; 7788 case "source": 7789 D2("error", d2); 7790 break; 7791 case "img": 7792 case "image": 7793 case "link": 7794 D2( 7795 "error", 7796 d2 7797 ); 7798 D2("load", d2); 7799 break; 7800 case "details": 7801 D2("toggle", d2); 7802 break; 7803 case "input": 7804 Za2(d2, f2); 7805 D2("invalid", d2); 7806 break; 7807 case "select": 7808 d2._wrapperState = { wasMultiple: !!f2.multiple }; 7809 D2("invalid", d2); 7810 break; 7811 case "textarea": 7812 hb(d2, f2), D2("invalid", d2); 7813 } 7814 ub(c2, f2); 7815 e2 = null; 7816 for (var g2 in f2) if (f2.hasOwnProperty(g2)) { 7817 var h2 = f2[g2]; 7818 "children" === g2 ? "string" === typeof h2 ? d2.textContent !== h2 && (true !== f2.suppressHydrationWarning && Af(d2.textContent, h2, a2), e2 = ["children", h2]) : "number" === typeof h2 && d2.textContent !== "" + h2 && (true !== f2.suppressHydrationWarning && Af( 7819 d2.textContent, 7820 h2, 7821 a2 7822 ), e2 = ["children", "" + h2]) : ea2.hasOwnProperty(g2) && null != h2 && "onScroll" === g2 && D2("scroll", d2); 7823 } 7824 switch (c2) { 7825 case "input": 7826 Va2(d2); 7827 db(d2, f2, true); 7828 break; 7829 case "textarea": 7830 Va2(d2); 7831 jb(d2); 7832 break; 7833 case "select": 7834 case "option": 7835 break; 7836 default: 7837 "function" === typeof f2.onClick && (d2.onclick = Bf); 7838 } 7839 d2 = e2; 7840 b2.updateQueue = d2; 7841 null !== d2 && (b2.flags |= 4); 7842 } else { 7843 g2 = 9 === e2.nodeType ? e2 : e2.ownerDocument; 7844 "http://www.w3.org/1999/xhtml" === a2 && (a2 = kb(c2)); 7845 "http://www.w3.org/1999/xhtml" === a2 ? "script" === c2 ? (a2 = g2.createElement("div"), a2.innerHTML = "<script><\/script>", a2 = a2.removeChild(a2.firstChild)) : "string" === typeof d2.
vendor: 4,424 bytes, lines 7845-7950
7845is ? a2 = g2.createElement(c2, { is: d2.is }) : (a2 = g2.createElement(c2), "select" === c2 && (g2 = a2, d2.multiple ? g2.multiple = true : d2.size && (g2.size = d2.size))) : a2 = g2.createElementNS(a2, c2); 7846 a2[Of] = b2; 7847 a2[Pf] = d2; 7848 zj(a2, b2, false, false); 7849 b2.stateNode = a2; 7850 a: { 7851 g2 = vb(c2, d2); 7852 switch (c2) { 7853 case "dialog": 7854 D2("cancel", a2); 7855 D2("close", a2); 7856 e2 = d2; 7857 break; 7858 case "iframe": 7859 case "object": 7860 case "embed": 7861 D2("load", a2); 7862 e2 = d2; 7863 break; 7864 case "video": 7865 case "audio": 7866 for (e2 = 0; e2 < lf.length; e2++) D2(lf[e2], a2); 7867 e2 = d2; 7868 break; 7869 case "source": 7870 D2("error", a2); 7871 e2 = d2; 7872 break; 7873 case "img": 7874 case "image": 7875 case "link": 7876 D2( 7877 "error", 7878 a2 7879 ); 7880 D2("load", a2); 7881 e2 = d2; 7882 break; 7883 case "details": 7884 D2("toggle", a2); 7885 e2 = d2; 7886 break; 7887 case "input": 7888 Za2(a2, d2); 7889 e2 = Ya2(a2, d2); 7890 D2("invalid", a2); 7891 break; 7892 case "option": 7893 e2 = d2; 7894 break; 7895 case "select": 7896 a2._wrapperState = { wasMultiple: !!d2.multiple }; 7897 e2 = A2({}, d2, { value: void 0 }); 7898 D2("invalid", a2); 7899 break; 7900 case "textarea": 7901 hb(a2, d2); 7902 e2 = gb(a2, d2); 7903 D2("invalid", a2); 7904 break; 7905 default: 7906 e2 = d2; 7907 } 7908 ub(c2, e2); 7909 h2 = e2; 7910 for (f2 in h2) if (h2.hasOwnProperty(f2)) { 7911 var k2 = h2[f2]; 7912 "style" === f2 ? sb(a2, k2) : "dangerouslySetInnerHTML" === f2 ? (k2 = k2 ? k2.__html : void 0, null != k2 && nb(a2, k2)) : "children" === f2 ? "string" === typeof k2 ? ("textarea" !== c2 || "" !== k2) && ob(a2, k2) : "number" === typeof k2 && ob(a2, "" + k2) : "suppressContentEditableWarning" !== f2 && "suppressHydrationWarning" !== f2 && "autoFocus" !== f2 && (ea2.hasOwnProperty(f2) ? null != k2 && "onScroll" === f2 && D2("scroll", a2) : null != k2 && ta(a2, f2, k2, g2)); 7913 } 7914 switch (c2) { 7915 case "input": 7916 Va2(a2); 7917 db(a2, d2, false); 7918 break; 7919 case "textarea": 7920 Va2(a2); 7921 jb(a2); 7922 break; 7923 case "option": 7924 null != d2.value && a2.setAttribute("value", "" + Sa2(d2.value)); 7925 break; 7926 case "select": 7927 a2.multiple = !!d2.multiple; 7928 f2 = d2.value; 7929 null != f2 ? fb(a2, !!d2.multiple, f2, false) : null != d2.defaultValue && fb( 7930 a2, 7931 !!d2.multiple, 7932 d2.defaultValue, 7933 true 7934 ); 7935 break; 7936 default: 7937 "function" === typeof e2.onClick && (a2.onclick = Bf); 7938 } 7939 switch (c2) { 7940 case "button": 7941 case "input": 7942 case "select": 7943 case "textarea": 7944 d2 = !!d2.autoFocus; 7945 break a; 7946 case "img": 7947 d2 = true; 7948 break a; 7949 default: 7950 d2 = false;
vendor: 81,012 bytes, lines 7951-10206
7951 } 7952 } 7953 d2 && (b2.flags |= 4); 7954 } 7955 null !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152); 7956 } 7957 S2(b2); 7958 return null; 7959 case 6: 7960 if (a2 && null != b2.stateNode) Cj(a2, b2, a2.memoizedProps, d2); 7961 else { 7962 if ("string" !== typeof d2 && null === b2.stateNode) throw Error(p2(166)); 7963 c2 = xh(wh.current); 7964 xh(uh.current); 7965 if (Gg(b2)) { 7966 d2 = b2.stateNode; 7967 c2 = b2.memoizedProps; 7968 d2[Of] = b2; 7969 if (f2 = d2.nodeValue !== c2) { 7970 if (a2 = xg, null !== a2) switch (a2.tag) { 7971 case 3: 7972 Af(d2.nodeValue, c2, 0 !== (a2.mode & 1)); 7973 break; 7974 case 5: 7975 true !== a2.memoizedProps.suppressHydrationWarning && Af(d2.nodeValue, c2, 0 !== (a2.mode & 1)); 7976 } 7977 } 7978 f2 && (b2.flags |= 4); 7979 } else d2 = (9 === c2.nodeType ? c2 : c2.ownerDocument).createTextNode(d2), d2[Of] = b2, b2.stateNode = d2; 7980 } 7981 S2(b2); 7982 return null; 7983 case 13: 7984 E2(L2); 7985 d2 = b2.memoizedState; 7986 if (null === a2 || null !== a2.memoizedState && null !== a2.memoizedState.dehydrated) { 7987 if (I2 && null !== yg && 0 !== (b2.mode & 1) && 0 === (b2.flags & 128)) Hg(), Ig(), b2.flags |= 98560, f2 = false; 7988 else if (f2 = Gg(b2), null !== d2 && null !== d2.dehydrated) { 7989 if (null === a2) { 7990 if (!f2) throw Error(p2(318)); 7991 f2 = b2.memoizedState; 7992 f2 = null !== f2 ? f2.dehydrated : null; 7993 if (!f2) throw Error(p2(317)); 7994 f2[Of] = b2; 7995 } else Ig(), 0 === (b2.flags & 128) && (b2.memoizedState = null), b2.flags |= 4; 7996 S2(b2); 7997 f2 = false; 7998 } else null !== zg && (Fj(zg), zg = null), f2 = true; 7999 if (!f2) return b2.flags & 65536 ? b2 : null; 8000 } 8001 if (0 !== (b2.flags & 128)) return b2.lanes = c2, b2; 8002 d2 = null !== d2; 8003 d2 !== (null !== a2 && null !== a2.memoizedState) && d2 && (b2.child.flags |= 8192, 0 !== (b2.mode & 1) && (null === a2 || 0 !== (L2.current & 1) ? 0 === T2 && (T2 = 3) : tj())); 8004 null !== b2.updateQueue && (b2.flags |= 4); 8005 S2(b2); 8006 return null; 8007 case 4: 8008 return zh(), Aj(a2, b2), null === a2 && sf(b2.stateNode.containerInfo), S2(b2), null; 8009 case 10: 8010 return ah(b2.type._context), S2(b2), null; 8011 case 17: 8012 return Zf(b2.type) && $f(), S2(b2), null; 8013 case 19: 8014 E2(L2); 8015 f2 = b2.memoizedState; 8016 if (null === f2) return S2(b2), null; 8017 d2 = 0 !== (b2.flags & 128); 8018 g2 = f2.rendering; 8019 if (null === g2) if (d2) Dj(f2, false); 8020 else { 8021 if (0 !== T2 || null !== a2 && 0 !== (a2.flags & 128)) for (a2 = b2.child; null !== a2; ) { 8022 g2 = Ch(a2); 8023 if (null !== g2) { 8024 b2.flags |= 128; 8025 Dj(f2, false); 8026 d2 = g2.updateQueue; 8027 null !== d2 && (b2.updateQueue = d2, b2.flags |= 4); 8028 b2.subtreeFlags = 0; 8029 d2 = c2; 8030 for (c2 = b2.child; null !== c2; ) f2 = c2, a2 = d2, f2.flags &= 14680066, g2 = f2.alternate, null === g2 ? (f2.childLanes = 0, f2.lanes = a2, f2.child = null, f2.subtreeFlags = 0, f2.memoizedProps = null, f2.memoizedState = null, f2.updateQueue = null, f2.dependencies = null, f2.stateNode = null) : (f2.childLanes = g2.childLanes, f2.lanes = g2.lanes, f2.child = g2.child, f2.subtreeFlags = 0, f2.deletions = null, f2.memoizedProps = g2.memoizedProps, f2.memoizedState = g2.memoizedState, f2.updateQueue = g2.updateQueue, f2.type = g2.type, a2 = g2.dependencies, f2.dependencies = null === a2 ? null : { lanes: a2.lanes, firstContext: a2.firstContext }), c2 = c2.sibling; 8031 G2(L2, L2.current & 1 | 2); 8032 return b2.child; 8033 } 8034 a2 = a2.sibling; 8035 } 8036 null !== f2.tail && B2() > Gj && (b2.flags |= 128, d2 = true, Dj(f2, false), b2.lanes = 4194304); 8037 } 8038 else { 8039 if (!d2) if (a2 = Ch(g2), null !== a2) { 8040 if (b2.flags |= 128, d2 = true, c2 = a2.updateQueue, null !== c2 && (b2.updateQueue = c2, b2.flags |= 4), Dj(f2, true), null === f2.tail && "hidden" === f2.tailMode && !g2.alternate && !I2) return S2(b2), null; 8041 } else 2 * B2() - f2.renderingStartTime > Gj && 1073741824 !== c2 && (b2.flags |= 128, d2 = true, Dj(f2, false), b2.lanes = 4194304); 8042 f2.isBackwards ? (g2.sibling = b2.child, b2.child = g2) : (c2 = f2.last, null !== c2 ? c2.sibling = g2 : b2.child = g2, f2.last = g2); 8043 } 8044 if (null !== f2.tail) return b2 = f2.tail, f2.rendering = b2, f2.tail = b2.sibling, f2.renderingStartTime = B2(), b2.sibling = null, c2 = L2.current, G2(L2, d2 ? c2 & 1 | 2 : c2 & 1), b2; 8045 S2(b2); 8046 return null; 8047 case 22: 8048 case 23: 8049 return Hj(), d2 = null !== b2.memoizedState, null !== a2 && null !== a2.memoizedState !== d2 && (b2.flags |= 8192), d2 && 0 !== (b2.mode & 1) ? 0 !== (fj & 1073741824) && (S2(b2), b2.subtreeFlags & 6 && (b2.flags |= 8192)) : S2(b2), null; 8050 case 24: 8051 return null; 8052 case 25: 8053 return null; 8054 } 8055 throw Error(p2(156, b2.tag)); 8056 } 8057 function Ij(a2, b2) { 8058 wg(b2); 8059 switch (b2.tag) { 8060 case 1: 8061 return Zf(b2.type) && $f(), a2 = b2.flags, a2 & 65536 ? (b2.flags = a2 & -65537 | 128, b2) : null; 8062 case 3: 8063 return zh(), E2(Wf), E2(H2), Eh(), a2 = b2.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b2.flags = a2 & -65537 | 128, b2) : null; 8064 case 5: 8065 return Bh(b2), null; 8066 case 13: 8067 E2(L2); 8068 a2 = b2.memoizedState; 8069 if (null !== a2 && null !== a2.dehydrated) { 8070 if (null === b2.alternate) throw Error(p2(340)); 8071 Ig(); 8072 } 8073 a2 = b2.flags; 8074 return a2 & 65536 ? (b2.flags = a2 & -65537 | 128, b2) : null; 8075 case 19: 8076 return E2(L2), null; 8077 case 4: 8078 return zh(), null; 8079 case 10: 8080 return ah(b2.type._context), null; 8081 case 22: 8082 case 23: 8083 return Hj(), null; 8084 case 24: 8085 return null; 8086 default: 8087 return null; 8088 } 8089 } 8090 var Jj = false, U2 = false, Kj = "function" === typeof WeakSet ? WeakSet : Set, V2 = null; 8091 function Lj(a2, b2) { 8092 var c2 = a2.ref; 8093 if (null !== c2) if ("function" === typeof c2) try { 8094 c2(null); 8095 } catch (d2) { 8096 W2(a2, b2, d2); 8097 } 8098 else c2.current = null; 8099 } 8100 function Mj(a2, b2, c2) { 8101 try { 8102 c2(); 8103 } catch (d2) { 8104 W2(a2, b2, d2); 8105 } 8106 } 8107 var Nj = false; 8108 function Oj(a2, b2) { 8109 Cf = dd; 8110 a2 = Me2(); 8111 if (Ne2(a2)) { 8112 if ("selectionStart" in a2) var c2 = { start: a2.selectionStart, end: a2.selectionEnd }; 8113 else a: { 8114 c2 = (c2 = a2.ownerDocument) && c2.defaultView || window; 8115 var d2 = c2.getSelection && c2.getSelection(); 8116 if (d2 && 0 !== d2.rangeCount) { 8117 c2 = d2.anchorNode; 8118 var e2 = d2.anchorOffset, f2 = d2.focusNode; 8119 d2 = d2.focusOffset; 8120 try { 8121 c2.nodeType, f2.nodeType; 8122 } catch (F2) { 8123 c2 = null; 8124 break a; 8125 } 8126 var g2 = 0, h2 = -1, k2 = -1, l2 = 0, m2 = 0, q2 = a2, r2 = null; 8127 b: for (; ; ) { 8128 for (var y2; ; ) { 8129 q2 !== c2 || 0 !== e2 && 3 !== q2.nodeType || (h2 = g2 + e2); 8130 q2 !== f2 || 0 !== d2 && 3 !== q2.nodeType || (k2 = g2 + d2); 8131 3 === q2.nodeType && (g2 += q2.nodeValue.length); 8132 if (null === (y2 = q2.firstChild)) break; 8133 r2 = q2; 8134 q2 = y2; 8135 } 8136 for (; ; ) { 8137 if (q2 === a2) break b; 8138 r2 === c2 && ++l2 === e2 && (h2 = g2); 8139 r2 === f2 && ++m2 === d2 && (k2 = g2); 8140 if (null !== (y2 = q2.nextSibling)) break; 8141 q2 = r2; 8142 r2 = q2.parentNode; 8143 } 8144 q2 = y2; 8145 } 8146 c2 = -1 === h2 || -1 === k2 ? null : { start: h2, end: k2 }; 8147 } else c2 = null; 8148 } 8149 c2 = c2 || { start: 0, end: 0 }; 8150 } else c2 = null; 8151 Df = { focusedElem: a2, selectionRange: c2 }; 8152 dd = false; 8153 for (V2 = b2; null !== V2; ) if (b2 = V2, a2 = b2.child, 0 !== (b2.subtreeFlags & 1028) && null !== a2) a2.return = b2, V2 = a2; 8154 else for (; null !== V2; ) { 8155 b2 = V2; 8156 try { 8157 var n2 = b2.alternate; 8158 if (0 !== (b2.flags & 1024)) switch (b2.tag) { 8159 case 0: 8160 case 11: 8161 case 15: 8162 break; 8163 case 1: 8164 if (null !== n2) { 8165 var t2 = n2.memoizedProps, J2 = n2.memoizedState, x2 = b2.stateNode, w2 = x2.getSnapshotBeforeUpdate(b2.elementType === b2.type ? t2 : Ci2(b2.type, t2), J2); 8166 x2.__reactInternalSnapshotBeforeUpdate = w2; 8167 } 8168 break; 8169 case 3: 8170 var u2 = b2.stateNode.containerInfo; 8171 1 === u2.nodeType ? u2.textContent = "" : 9 === u2.nodeType && u2.documentElement && u2.removeChild(u2.documentElement); 8172 break; 8173 case 5: 8174 case 6: 8175 case 4: 8176 case 17: 8177 break; 8178 default: 8179 throw Error(p2(163)); 8180 } 8181 } catch (F2) { 8182 W2(b2, b2.return, F2); 8183 } 8184 a2 = b2.sibling; 8185 if (null !== a2) { 8186 a2.return = b2.return; 8187 V2 = a2; 8188 break; 8189 } 8190 V2 = b2.return; 8191 } 8192 n2 = Nj; 8193 Nj = false; 8194 return n2; 8195 } 8196 function Pj(a2, b2, c2) { 8197 var d2 = b2.updateQueue; 8198 d2 = null !== d2 ? d2.lastEffect : null; 8199 if (null !== d2) { 8200 var e2 = d2 = d2.next; 8201 do { 8202 if ((e2.tag & a2) === a2) { 8203 var f2 = e2.destroy; 8204 e2.destroy = void 0; 8205 void 0 !== f2 && Mj(b2, c2, f2); 8206 } 8207 e2 = e2.next; 8208 } while (e2 !== d2); 8209 } 8210 } 8211 function Qj(a2, b2) { 8212 b2 = b2.updateQueue; 8213 b2 = null !== b2 ? b2.lastEffect : null; 8214 if (null !== b2) { 8215 var c2 = b2 = b2.next; 8216 do { 8217 if ((c2.tag & a2) === a2) { 8218 var d2 = c2.create; 8219 c2.destroy = d2(); 8220 } 8221 c2 = c2.next; 8222 } while (c2 !== b2); 8223 } 8224 } 8225 function Rj(a2) { 8226 var b2 = a2.ref; 8227 if (null !== b2) { 8228 var c2 = a2.stateNode; 8229 switch (a2.tag) { 8230 case 5: 8231 a2 = c2; 8232 break; 8233 default: 8234 a2 = c2; 8235 } 8236 "function" === typeof b2 ? b2(a2) : b2.current = a2; 8237 } 8238 } 8239 function Sj(a2) { 8240 var b2 = a2.alternate; 8241 null !== b2 && (a2.alternate = null, Sj(b2)); 8242 a2.child = null; 8243 a2.deletions = null; 8244 a2.sibling = null; 8245 5 === a2.tag && (b2 = a2.stateNode, null !== b2 && (delete b2[Of], delete b2[Pf], delete b2[of], delete b2[Qf], delete b2[Rf])); 8246 a2.stateNode = null; 8247 a2.return = null; 8248 a2.dependencies = null; 8249 a2.memoizedProps = null; 8250 a2.memoizedState = null; 8251 a2.pendingProps = null; 8252 a2.stateNode = null; 8253 a2.updateQueue = null; 8254 } 8255 function Tj(a2) { 8256 return 5 === a2.tag || 3 === a2.tag || 4 === a2.tag; 8257 } 8258 function Uj(a2) { 8259 a: for (; ; ) { 8260 for (; null === a2.sibling; ) { 8261 if (null === a2.return || Tj(a2.return)) return null; 8262 a2 = a2.return; 8263 } 8264 a2.sibling.return = a2.return; 8265 for (a2 = a2.sibling; 5 !== a2.tag && 6 !== a2.tag && 18 !== a2.tag; ) { 8266 if (a2.flags & 2) continue a; 8267 if (null === a2.child || 4 === a2.tag) continue a; 8268 else a2.child.return = a2, a2 = a2.child; 8269 } 8270 if (!(a2.flags & 2)) return a2.stateNode; 8271 } 8272 } 8273 function Vj(a2, b2, c2) { 8274 var d2 = a2.tag; 8275 if (5 === d2 || 6 === d2) a2 = a2.stateNode, b2 ? 8 === c2.nodeType ? c2.parentNode.insertBefore(a2, b2) : c2.insertBefore(a2, b2) : (8 === c2.nodeType ? (b2 = c2.parentNode, b2.insertBefore(a2, c2)) : (b2 = c2, b2.appendChild(a2)), c2 = c2._reactRootContainer, null !== c2 && void 0 !== c2 || null !== b2.onclick || (b2.onclick = Bf)); 8276 else if (4 !== d2 && (a2 = a2.child, null !== a2)) for (Vj(a2, b2, c2), a2 = a2.sibling; null !== a2; ) Vj(a2, b2, c2), a2 = a2.sibling; 8277 } 8278 function Wj(a2, b2, c2) { 8279 var d2 = a2.tag; 8280 if (5 === d2 || 6 === d2) a2 = a2.stateNode, b2 ? c2.insertBefore(a2, b2) : c2.appendChild(a2); 8281 else if (4 !== d2 && (a2 = a2.child, null !== a2)) for (Wj(a2, b2, c2), a2 = a2.sibling; null !== a2; ) Wj(a2, b2, c2), a2 = a2.sibling; 8282 } 8283 var X2 = null, Xj = false; 8284 function Yj(a2, b2, c2) { 8285 for (c2 = c2.child; null !== c2; ) Zj(a2, b2, c2), c2 = c2.sibling; 8286 } 8287 function Zj(a2, b2, c2) { 8288 if (lc && "function" === typeof lc.onCommitFiberUnmount) try { 8289 lc.onCommitFiberUnmount(kc, c2); 8290 } catch (h2) { 8291 } 8292 switch (c2.tag) { 8293 case 5: 8294 U2 || Lj(c2, b2); 8295 case 6: 8296 var d2 = X2, e2 = Xj; 8297 X2 = null; 8298 Yj(a2, b2, c2); 8299 X2 = d2; 8300 Xj = e2; 8301 null !== X2 && (Xj ? (a2 = X2, c2 = c2.stateNode, 8 === a2.nodeType ? a2.parentNode.removeChild(c2) : a2.removeChild(c2)) : X2.removeChild(c2.stateNode)); 8302 break; 8303 case 18: 8304 null !== X2 && (Xj ? (a2 = X2, c2 = c2.stateNode, 8 === a2.nodeType ? Kf(a2.parentNode, c2) : 1 === a2.nodeType && Kf(a2, c2), bd(a2)) : Kf(X2, c2.stateNode)); 8305 break; 8306 case 4: 8307 d2 = X2; 8308 e2 = Xj; 8309 X2 = c2.stateNode.containerInfo; 8310 Xj = true; 8311 Yj(a2, b2, c2); 8312 X2 = d2; 8313 Xj = e2; 8314 break; 8315 case 0: 8316 case 11: 8317 case 14: 8318 case 15: 8319 if (!U2 && (d2 = c2.updateQueue, null !== d2 && (d2 = d2.lastEffect, null !== d2))) { 8320 e2 = d2 = d2.next; 8321 do { 8322 var f2 = e2, g2 = f2.destroy; 8323 f2 = f2.tag; 8324 void 0 !== g2 && (0 !== (f2 & 2) ? Mj(c2, b2, g2) : 0 !== (f2 & 4) && Mj(c2, b2, g2)); 8325 e2 = e2.next; 8326 } while (e2 !== d2); 8327 } 8328 Yj(a2, b2, c2); 8329 break; 8330 case 1: 8331 if (!U2 && (Lj(c2, b2), d2 = c2.stateNode, "function" === typeof d2.componentWillUnmount)) try { 8332 d2.props = c2.memoizedProps, d2.state = c2.memoizedState, d2.componentWillUnmount(); 8333 } catch (h2) { 8334 W2(c2, b2, h2); 8335 } 8336 Yj(a2, b2, c2); 8337 break; 8338 case 21: 8339 Yj(a2, b2, c2); 8340 break; 8341 case 22: 8342 c2.mode & 1 ? (U2 = (d2 = U2) || null !== c2.memoizedState, Yj(a2, b2, c2), U2 = d2) : Yj(a2, b2, c2); 8343 break; 8344 default: 8345 Yj(a2, b2, c2); 8346 } 8347 } 8348 function ak(a2) { 8349 var b2 = a2.updateQueue; 8350 if (null !== b2) { 8351 a2.updateQueue = null; 8352 var c2 = a2.stateNode; 8353 null === c2 && (c2 = a2.stateNode = new Kj()); 8354 b2.forEach(function(b3) { 8355 var d2 = bk.bind(null, a2, b3); 8356 c2.has(b3) || (c2.add(b3), b3.then(d2, d2)); 8357 }); 8358 } 8359 } 8360 function ck(a2, b2) { 8361 var c2 = b2.deletions; 8362 if (null !== c2) for (var d2 = 0; d2 < c2.length; d2++) { 8363 var e2 = c2[d2]; 8364 try { 8365 var f2 = a2, g2 = b2, h2 = g2; 8366 a: for (; null !== h2; ) { 8367 switch (h2.tag) { 8368 case 5: 8369 X2 = h2.stateNode; 8370 Xj = false; 8371 break a; 8372 case 3: 8373 X2 = h2.stateNode.containerInfo; 8374 Xj = true; 8375 break a; 8376 case 4: 8377 X2 = h2.stateNode.containerInfo; 8378 Xj = true; 8379 break a; 8380 } 8381 h2 = h2.return; 8382 } 8383 if (null === X2) throw Error(p2(160)); 8384 Zj(f2, g2, e2); 8385 X2 = null; 8386 Xj = false; 8387 var k2 = e2.alternate; 8388 null !== k2 && (k2.return = null); 8389 e2.return = null; 8390 } catch (l2) { 8391 W2(e2, b2, l2); 8392 } 8393 } 8394 if (b2.subtreeFlags & 12854) for (b2 = b2.child; null !== b2; ) dk(b2, a2), b2 = b2.sibling; 8395 } 8396 function dk(a2, b2) { 8397 var c2 = a2.alternate, d2 = a2.flags; 8398 switch (a2.tag) { 8399 case 0: 8400 case 11: 8401 case 14: 8402 case 15: 8403 ck(b2, a2); 8404 ek(a2); 8405 if (d2 & 4) { 8406 try { 8407 Pj(3, a2, a2.return), Qj(3, a2); 8408 } catch (t2) { 8409 W2(a2, a2.return, t2); 8410 } 8411 try { 8412 Pj(5, a2, a2.return); 8413 } catch (t2) { 8414 W2(a2, a2.return, t2); 8415 } 8416 } 8417 break; 8418 case 1: 8419 ck(b2, a2); 8420 ek(a2); 8421 d2 & 512 && null !== c2 && Lj(c2, c2.return); 8422 break; 8423 case 5: 8424 ck(b2, a2); 8425 ek(a2); 8426 d2 & 512 && null !== c2 && Lj(c2, c2.return); 8427 if (a2.flags & 32) { 8428 var e2 = a2.stateNode; 8429 try { 8430 ob(e2, ""); 8431 } catch (t2) { 8432 W2(a2, a2.return, t2); 8433 } 8434 } 8435 if (d2 & 4 && (e2 = a2.stateNode, null != e2)) { 8436 var f2 = a2.memoizedProps, g2 = null !== c2 ? c2.memoizedProps : f2, h2 = a2.type, k2 = a2.updateQueue; 8437 a2.updateQueue = null; 8438 if (null !== k2) try { 8439 "input" === h2 && "radio" === f2.type && null != f2.name && ab(e2, f2); 8440 vb(h2, g2); 8441 var l2 = vb(h2, f2); 8442 for (g2 = 0; g2 < k2.length; g2 += 2) { 8443 var m2 = k2[g2], q2 = k2[g2 + 1]; 8444 "style" === m2 ? sb(e2, q2) : "dangerouslySetInnerHTML" === m2 ? nb(e2, q2) : "children" === m2 ? ob(e2, q2) : ta(e2, m2, q2, l2); 8445 } 8446 switch (h2) { 8447 case "input": 8448 bb(e2, f2); 8449 break; 8450 case "textarea": 8451 ib(e2, f2); 8452 break; 8453 case "select": 8454 var r2 = e2._wrapperState.wasMultiple; 8455 e2._wrapperState.wasMultiple = !!f2.multiple; 8456 var y2 = f2.value; 8457 null != y2 ? fb(e2, !!f2.multiple, y2, false) : r2 !== !!f2.multiple && (null != f2.defaultValue ? fb( 8458 e2, 8459 !!f2.multiple, 8460 f2.defaultValue, 8461 true 8462 ) : fb(e2, !!f2.multiple, f2.multiple ? [] : "", false)); 8463 } 8464 e2[Pf] = f2; 8465 } catch (t2) { 8466 W2(a2, a2.return, t2); 8467 } 8468 } 8469 break; 8470 case 6: 8471 ck(b2, a2); 8472 ek(a2); 8473 if (d2 & 4) { 8474 if (null === a2.stateNode) throw Error(p2(162)); 8475 e2 = a2.stateNode; 8476 f2 = a2.memoizedProps; 8477 try { 8478 e2.nodeValue = f2; 8479 } catch (t2) { 8480 W2(a2, a2.return, t2); 8481 } 8482 } 8483 break; 8484 case 3: 8485 ck(b2, a2); 8486 ek(a2); 8487 if (d2 & 4 && null !== c2 && c2.memoizedState.isDehydrated) try { 8488 bd(b2.containerInfo); 8489 } catch (t2) { 8490 W2(a2, a2.return, t2); 8491 } 8492 break; 8493 case 4: 8494 ck(b2, a2); 8495 ek(a2); 8496 break; 8497 case 13: 8498 ck(b2, a2); 8499 ek(a2); 8500 e2 = a2.child; 8501 e2.flags & 8192 && (f2 = null !== e2.memoizedState, e2.stateNode.isHidden = f2, !f2 || null !== e2.alternate && null !== e2.alternate.memoizedState || (fk = B2())); 8502 d2 & 4 && ak(a2); 8503 break; 8504 case 22: 8505 m2 = null !== c2 && null !== c2.memoizedState; 8506 a2.mode & 1 ? (U2 = (l2 = U2) || m2, ck(b2, a2), U2 = l2) : ck(b2, a2); 8507 ek(a2); 8508 if (d2 & 8192) { 8509 l2 = null !== a2.memoizedState; 8510 if ((a2.stateNode.isHidden = l2) && !m2 && 0 !== (a2.mode & 1)) for (V2 = a2, m2 = a2.child; null !== m2; ) { 8511 for (q2 = V2 = m2; null !== V2; ) { 8512 r2 = V2; 8513 y2 = r2.child; 8514 switch (r2.tag) { 8515 case 0: 8516 case 11: 8517 case 14: 8518 case 15: 8519 Pj(4, r2, r2.return); 8520 break; 8521 case 1: 8522 Lj(r2, r2.return); 8523 var n2 = r2.stateNode; 8524 if ("function" === typeof n2.componentWillUnmount) { 8525 d2 = r2; 8526 c2 = r2.return; 8527 try { 8528 b2 = d2, n2.props = b2.memoizedProps, n2.state = b2.memoizedState, n2.componentWillUnmount(); 8529 } catch (t2) { 8530 W2(d2, c2, t2); 8531 } 8532 } 8533 break; 8534 case 5: 8535 Lj(r2, r2.return); 8536 break; 8537 case 22: 8538 if (null !== r2.memoizedState) { 8539 gk(q2); 8540 continue; 8541 } 8542 } 8543 null !== y2 ? (y2.return = r2, V2 = y2) : gk(q2); 8544 } 8545 m2 = m2.sibling; 8546 } 8547 a: for (m2 = null, q2 = a2; ; ) { 8548 if (5 === q2.tag) { 8549 if (null === m2) { 8550 m2 = q2; 8551 try { 8552 e2 = q2.stateNode, l2 ? (f2 = e2.style, "function" === typeof f2.setProperty ? f2.setProperty("display", "none", "important") : f2.display = "none") : (h2 = q2.stateNode, k2 = q2.memoizedProps.style, g2 = void 0 !== k2 && null !== k2 && k2.hasOwnProperty("display") ? k2.display : null, h2.style.display = rb("display", g2)); 8553 } catch (t2) { 8554 W2(a2, a2.return, t2); 8555 } 8556 } 8557 } else if (6 === q2.tag) { 8558 if (null === m2) try { 8559 q2.stateNode.nodeValue = l2 ? "" : q2.memoizedProps; 8560 } catch (t2) { 8561 W2(a2, a2.return, t2); 8562 } 8563 } else if ((22 !== q2.tag && 23 !== q2.tag || null === q2.memoizedState || q2 === a2) && null !== q2.child) { 8564 q2.child.return = q2; 8565 q2 = q2.child; 8566 continue; 8567 } 8568 if (q2 === a2) break a; 8569 for (; null === q2.sibling; ) { 8570 if (null === q2.return || q2.return === a2) break a; 8571 m2 === q2 && (m2 = null); 8572 q2 = q2.return; 8573 } 8574 m2 === q2 && (m2 = null); 8575 q2.sibling.return = q2.return; 8576 q2 = q2.sibling; 8577 } 8578 } 8579 break; 8580 case 19: 8581 ck(b2, a2); 8582 ek(a2); 8583 d2 & 4 && ak(a2); 8584 break; 8585 case 21: 8586 break; 8587 default: 8588 ck( 8589 b2, 8590 a2 8591 ), ek(a2); 8592 } 8593 } 8594 function ek(a2) { 8595 var b2 = a2.flags; 8596 if (b2 & 2) { 8597 try { 8598 a: { 8599 for (var c2 = a2.return; null !== c2; ) { 8600 if (Tj(c2)) { 8601 var d2 = c2; 8602 break a; 8603 } 8604 c2 = c2.return; 8605 } 8606 throw Error(p2(160)); 8607 } 8608 switch (d2.tag) { 8609 case 5: 8610 var e2 = d2.stateNode; 8611 d2.flags & 32 && (ob(e2, ""), d2.flags &= -33); 8612 var f2 = Uj(a2); 8613 Wj(a2, f2, e2); 8614 break; 8615 case 3: 8616 case 4: 8617 var g2 = d2.stateNode.containerInfo, h2 = Uj(a2); 8618 Vj(a2, h2, g2); 8619 break; 8620 default: 8621 throw Error(p2(161)); 8622 } 8623 } catch (k2) { 8624 W2(a2, a2.return, k2); 8625 } 8626 a2.flags &= -3; 8627 } 8628 b2 & 4096 && (a2.flags &= -4097); 8629 } 8630 function hk(a2, b2, c2) { 8631 V2 = a2; 8632 ik(a2); 8633 } 8634 function ik(a2, b2, c2) { 8635 for (var d2 = 0 !== (a2.mode & 1); null !== V2; ) { 8636 var e2 = V2, f2 = e2.child; 8637 if (22 === e2.tag && d2) { 8638 var g2 = null !== e2.memoizedState || Jj; 8639 if (!g2) { 8640 var h2 = e2.alternate, k2 = null !== h2 && null !== h2.memoizedState || U2; 8641 h2 = Jj; 8642 var l2 = U2; 8643 Jj = g2; 8644 if ((U2 = k2) && !l2) for (V2 = e2; null !== V2; ) g2 = V2, k2 = g2.child, 22 === g2.tag && null !== g2.memoizedState ? jk(e2) : null !== k2 ? (k2.return = g2, V2 = k2) : jk(e2); 8645 for (; null !== f2; ) V2 = f2, ik(f2), f2 = f2.sibling; 8646 V2 = e2; 8647 Jj = h2; 8648 U2 = l2; 8649 } 8650 kk(a2); 8651 } else 0 !== (e2.subtreeFlags & 8772) && null !== f2 ? (f2.return = e2, V2 = f2) : kk(a2); 8652 } 8653 } 8654 function kk(a2) { 8655 for (; null !== V2; ) { 8656 var b2 = V2; 8657 if (0 !== (b2.flags & 8772)) { 8658 var c2 = b2.alternate; 8659 try { 8660 if (0 !== (b2.flags & 8772)) switch (b2.tag) { 8661 case 0: 8662 case 11: 8663 case 15: 8664 U2 || Qj(5, b2); 8665 break; 8666 case 1: 8667 var d2 = b2.stateNode; 8668 if (b2.flags & 4 && !U2) if (null === c2) d2.componentDidMount(); 8669 else { 8670 var e2 = b2.elementType === b2.type ? c2.memoizedProps : Ci2(b2.type, c2.memoizedProps); 8671 d2.componentDidUpdate(e2, c2.memoizedState, d2.__reactInternalSnapshotBeforeUpdate); 8672 } 8673 var f2 = b2.updateQueue; 8674 null !== f2 && sh(b2, f2, d2); 8675 break; 8676 case 3: 8677 var g2 = b2.updateQueue; 8678 if (null !== g2) { 8679 c2 = null; 8680 if (null !== b2.child) switch (b2.child.tag) { 8681 case 5: 8682 c2 = b2.child.stateNode; 8683 break; 8684 case 1: 8685 c2 = b2.child.stateNode; 8686 } 8687 sh(b2, g2, c2); 8688 } 8689 break; 8690 case 5: 8691 var h2 = b2.stateNode; 8692 if (null === c2 && b2.flags & 4) { 8693 c2 = h2; 8694 var k2 = b2.memoizedProps; 8695 switch (b2.type) { 8696 case "button": 8697 case "input": 8698 case "select": 8699 case "textarea": 8700 k2.autoFocus && c2.focus(); 8701 break; 8702 case "img": 8703 k2.src && (c2.src = k2.src); 8704 } 8705 } 8706 break; 8707 case 6: 8708 break; 8709 case 4: 8710 break; 8711 case 12: 8712 break; 8713 case 13: 8714 if (null === b2.memoizedState) { 8715 var l2 = b2.alternate; 8716 if (null !== l2) { 8717 var m2 = l2.memoizedState; 8718 if (null !== m2) { 8719 var q2 = m2.dehydrated; 8720 null !== q2 && bd(q2); 8721 } 8722 } 8723 } 8724 break; 8725 case 19: 8726 case 17: 8727 case 21: 8728 case 22: 8729 case 23: 8730 case 25: 8731 break; 8732 default: 8733 throw Error(p2(163)); 8734 } 8735 U2 || b2.flags & 512 && Rj(b2); 8736 } catch (r2) { 8737 W2(b2, b2.return, r2); 8738 } 8739 } 8740 if (b2 === a2) { 8741 V2 = null; 8742 break; 8743 } 8744 c2 = b2.sibling; 8745 if (null !== c2) { 8746 c2.return = b2.return; 8747 V2 = c2; 8748 break; 8749 } 8750 V2 = b2.return; 8751 } 8752 } 8753 function gk(a2) { 8754 for (; null !== V2; ) { 8755 var b2 = V2; 8756 if (b2 === a2) { 8757 V2 = null; 8758 break; 8759 } 8760 var c2 = b2.sibling; 8761 if (null !== c2) { 8762 c2.return = b2.return; 8763 V2 = c2; 8764 break; 8765 } 8766 V2 = b2.return; 8767 } 8768 } 8769 function jk(a2) { 8770 for (; null !== V2; ) { 8771 var b2 = V2; 8772 try { 8773 switch (b2.tag) { 8774 case 0: 8775 case 11: 8776 case 15: 8777 var c2 = b2.return; 8778 try { 8779 Qj(4, b2); 8780 } catch (k2) { 8781 W2(b2, c2, k2); 8782 } 8783 break; 8784 case 1: 8785 var d2 = b2.stateNode; 8786 if ("function" === typeof d2.componentDidMount) { 8787 var e2 = b2.return; 8788 try { 8789 d2.componentDidMount(); 8790 } catch (k2) { 8791 W2(b2, e2, k2); 8792 } 8793 } 8794 var f2 = b2.return; 8795 try { 8796 Rj(b2); 8797 } catch (k2) { 8798 W2(b2, f2, k2); 8799 } 8800 break; 8801 case 5: 8802 var g2 = b2.return; 8803 try { 8804 Rj(b2); 8805 } catch (k2) { 8806 W2(b2, g2, k2); 8807 } 8808 } 8809 } catch (k2) { 8810 W2(b2, b2.return, k2); 8811 } 8812 if (b2 === a2) { 8813 V2 = null; 8814 break; 8815 } 8816 var h2 = b2.sibling; 8817 if (null !== h2) { 8818 h2.return = b2.return; 8819 V2 = h2; 8820 break; 8821 } 8822 V2 = b2.return; 8823 } 8824 } 8825 var lk = Math.ceil, mk = ua2.ReactCurrentDispatcher, nk = ua2.ReactCurrentOwner, ok = ua2.ReactCurrentBatchConfig, K2 = 0, Q2 = null, Y2 = null, Z2 = 0, fj = 0, ej = Uf(0), T2 = 0, pk = null, rh = 0, qk = 0, rk = 0, sk = null, tk = null, fk = 0, Gj = Infinity, uk = null, Oi2 = false, Pi2 = null, Ri2 = null, vk = false, wk = null, xk = 0, yk = 0, zk = null, Ak = -1, Bk = 0; 8826 function R2() { 8827 return 0 !== (K2 & 6) ? B2() : -1 !== Ak ? Ak : Ak = B2(); 8828 } 8829 function yi2(a2) { 8830 if (0 === (a2.mode & 1)) return 1; 8831 if (0 !== (K2 & 2) && 0 !== Z2) return Z2 & -Z2; 8832 if (null !== Kg.transition) return 0 === Bk && (Bk = yc2()), Bk; 8833 a2 = C2; 8834 if (0 !== a2) return a2; 8835 a2 = window.event; 8836 a2 = void 0 === a2 ? 16 : jd(a2.type); 8837 return a2; 8838 } 8839 function gi2(a2, b2, c2, d2) { 8840 if (50 < yk) throw yk = 0, zk = null, Error(p2(185)); 8841 Ac(a2, c2, d2); 8842 if (0 === (K2 & 2) || a2 !== Q2) a2 === Q2 && (0 === (K2 & 2) && (qk |= c2), 4 === T2 && Ck(a2, Z2)), Dk(a2, d2), 1 === c2 && 0 === K2 && 0 === (b2.mode & 1) && (Gj = B2() + 500, fg && jg()); 8843 } 8844 function Dk(a2, b2) { 8845 var c2 = a2.callbackNode; 8846 wc(a2, b2); 8847 var d2 = uc(a2, a2 === Q2 ? Z2 : 0); 8848 if (0 === d2) null !== c2 && bc(c2), a2.callbackNode = null, a2.callbackPriority = 0; 8849 else if (b2 = d2 & -d2, a2.callbackPriority !== b2) { 8850 null != c2 && bc(c2); 8851 if (1 === b2) 0 === a2.tag ? ig(Ek.bind(null, a2)) : hg(Ek.bind(null, a2)), Jf(function() { 8852 0 === (K2 & 6) && jg(); 8853 }), c2 = null; 8854 else { 8855 switch (Dc(d2)) { 8856 case 1: 8857 c2 = fc; 8858 break; 8859 case 4: 8860 c2 = gc; 8861 break; 8862 case 16: 8863 c2 = hc; 8864 break; 8865 case 536870912: 8866 c2 = jc; 8867 break; 8868 default: 8869 c2 = hc; 8870 } 8871 c2 = Fk(c2, Gk.bind(null, a2)); 8872 } 8873 a2.callbackPriority = b2; 8874 a2.callbackNode = c2; 8875 } 8876 } 8877 function Gk(a2, b2) { 8878 Ak = -1; 8879 Bk = 0; 8880 if (0 !== (K2 & 6)) throw Error(p2(327)); 8881 var c2 = a2.callbackNode; 8882 if (Hk() && a2.callbackNode !== c2) return null; 8883 var d2 = uc(a2, a2 === Q2 ? Z2 : 0); 8884 if (0 === d2) return null; 8885 if (0 !== (d2 & 30) || 0 !== (d2 & a2.expiredLanes) || b2) b2 = Ik(a2, d2); 8886 else { 8887 b2 = d2; 8888 var e2 = K2; 8889 K2 |= 2; 8890 var f2 = Jk(); 8891 if (Q2 !== a2 || Z2 !== b2) uk = null, Gj = B2() + 500, Kk(a2, b2); 8892 do 8893 try { 8894 Lk(); 8895 break; 8896 } catch (h2) { 8897 Mk(a2, h2); 8898 } 8899 while (1); 8900 $g(); 8901 mk.current = f2; 8902 K2 = e2; 8903 null !== Y2 ? b2 = 0 : (Q2 = null, Z2 = 0, b2 = T2); 8904 } 8905 if (0 !== b2) { 8906 2 === b2 && (e2 = xc(a2), 0 !== e2 && (d2 = e2, b2 = Nk(a2, e2))); 8907 if (1 === b2) throw c2 = pk, Kk(a2, 0), Ck(a2, d2), Dk(a2, B2()), c2; 8908 if (6 === b2) Ck(a2, d2); 8909 else { 8910 e2 = a2.current.alternate; 8911 if (0 === (d2 & 30) && !Ok(e2) && (b2 = Ik(a2, d2), 2 === b2 && (f2 = xc(a2), 0 !== f2 && (d2 = f2, b2 = Nk(a2, f2))), 1 === b2)) throw c2 = pk, Kk(a2, 0), Ck(a2, d2), Dk(a2, B2()), c2; 8912 a2.finishedWork = e2; 8913 a2.finishedLanes = d2; 8914 switch (b2) { 8915 case 0: 8916 case 1: 8917 throw Error(p2(345)); 8918 case 2: 8919 Pk(a2, tk, uk); 8920 break; 8921 case 3: 8922 Ck(a2, d2); 8923 if ((d2 & 130023424) === d2 && (b2 = fk + 500 - B2(), 10 < b2)) { 8924 if (0 !== uc(a2, 0)) break; 8925 e2 = a2.suspendedLanes; 8926 if ((e2 & d2) !== d2) { 8927 R2(); 8928 a2.pingedLanes |= a2.suspendedLanes & e2; 8929 break; 8930 } 8931 a2.timeoutHandle = Ff(Pk.bind(null, a2, tk, uk), b2); 8932 break; 8933 } 8934 Pk(a2, tk, uk); 8935 break; 8936 case 4: 8937 Ck(a2, d2); 8938 if ((d2 & 4194240) === d2) break; 8939 b2 = a2.eventTimes; 8940 for (e2 = -1; 0 < d2; ) { 8941 var g2 = 31 - oc(d2); 8942 f2 = 1 << g2; 8943 g2 = b2[g2]; 8944 g2 > e2 && (e2 = g2); 8945 d2 &= ~f2; 8946 } 8947 d2 = e2; 8948 d2 = B2() - d2; 8949 d2 = (120 > d2 ? 120 : 480 > d2 ? 480 : 1080 > d2 ? 1080 : 1920 > d2 ? 1920 : 3e3 > d2 ? 3e3 : 4320 > d2 ? 4320 : 1960 * lk(d2 / 1960)) - d2; 8950 if (10 < d2) { 8951 a2.timeoutHandle = Ff(Pk.bind(null, a2, tk, uk), d2); 8952 break; 8953 } 8954 Pk(a2, tk, uk); 8955 break; 8956 case 5: 8957 Pk(a2, tk, uk); 8958 break; 8959 default: 8960 throw Error(p2(329)); 8961 } 8962 } 8963 } 8964 Dk(a2, B2()); 8965 return a2.callbackNode === c2 ? Gk.bind(null, a2) : null; 8966 } 8967 function Nk(a2, b2) { 8968 var c2 = sk; 8969 a2.current.memoizedState.isDehydrated && (Kk(a2, b2).flags |= 256); 8970 a2 = Ik(a2, b2); 8971 2 !== a2 && (b2 = tk, tk = c2, null !== b2 && Fj(b2)); 8972 return a2; 8973 } 8974 function Fj(a2) { 8975 null === tk ? tk = a2 : tk.push.apply(tk, a2); 8976 } 8977 function Ok(a2) { 8978 for (var b2 = a2; ; ) { 8979 if (b2.flags & 16384) { 8980 var c2 = b2.updateQueue; 8981 if (null !== c2 && (c2 = c2.stores, null !== c2)) for (var d2 = 0; d2 < c2.length; d2++) { 8982 var e2 = c2[d2], f2 = e2.getSnapshot; 8983 e2 = e2.value; 8984 try { 8985 if (!He2(f2(), e2)) return false; 8986 } catch (g2) { 8987 return false; 8988 } 8989 } 8990 } 8991 c2 = b2.child; 8992 if (b2.subtreeFlags & 16384 && null !== c2) c2.return = b2, b2 = c2; 8993 else { 8994 if (b2 === a2) break; 8995 for (; null === b2.sibling; ) { 8996 if (null === b2.return || b2.return === a2) return true; 8997 b2 = b2.return; 8998 } 8999 b2.sibling.return = b2.return; 9000 b2 = b2.sibling; 9001 } 9002 } 9003 return true; 9004 } 9005 function Ck(a2, b2) { 9006 b2 &= ~rk; 9007 b2 &= ~qk; 9008 a2.suspendedLanes |= b2; 9009 a2.pingedLanes &= ~b2; 9010 for (a2 = a2.expirationTimes; 0 < b2; ) { 9011 var c2 = 31 - oc(b2), d2 = 1 << c2; 9012 a2[c2] = -1; 9013 b2 &= ~d2; 9014 } 9015 } 9016 function Ek(a2) { 9017 if (0 !== (K2 & 6)) throw Error(p2(327)); 9018 Hk(); 9019 var b2 = uc(a2, 0); 9020 if (0 === (b2 & 1)) return Dk(a2, B2()), null; 9021 var c2 = Ik(a2, b2); 9022 if (0 !== a2.tag && 2 === c2) { 9023 var d2 = xc(a2); 9024 0 !== d2 && (b2 = d2, c2 = Nk(a2, d2)); 9025 } 9026 if (1 === c2) throw c2 = pk, Kk(a2, 0), Ck(a2, b2), Dk(a2, B2()), c2; 9027 if (6 === c2) throw Error(p2(345)); 9028 a2.finishedWork = a2.current.alternate; 9029 a2.finishedLanes = b2; 9030 Pk(a2, tk, uk); 9031 Dk(a2, B2()); 9032 return null; 9033 } 9034 function Qk(a2, b2) { 9035 var c2 = K2; 9036 K2 |= 1; 9037 try { 9038 return a2(b2); 9039 } finally { 9040 K2 = c2, 0 === K2 && (Gj = B2() + 500, fg && jg()); 9041 } 9042 } 9043 function Rk(a2) { 9044 null !== wk && 0 === wk.tag && 0 === (K2 & 6) && Hk(); 9045 var b2 = K2; 9046 K2 |= 1; 9047 var c2 = ok.transition, d2 = C2; 9048 try { 9049 if (ok.transition = null, C2 = 1, a2) return a2(); 9050 } finally { 9051 C2 = d2, ok.transition = c2, K2 = b2, 0 === (K2 & 6) && jg(); 9052 } 9053 } 9054 function Hj() { 9055 fj = ej.current; 9056 E2(ej); 9057 } 9058 function Kk(a2, b2) { 9059 a2.finishedWork = null; 9060 a2.finishedLanes = 0; 9061 var c2 = a2.timeoutHandle; 9062 -1 !== c2 && (a2.timeoutHandle = -1, Gf(c2)); 9063 if (null !== Y2) for (c2 = Y2.return; null !== c2; ) { 9064 var d2 = c2; 9065 wg(d2); 9066 switch (d2.tag) { 9067 case 1: 9068 d2 = d2.type.childContextTypes; 9069 null !== d2 && void 0 !== d2 && $f(); 9070 break; 9071 case 3: 9072 zh(); 9073 E2(Wf); 9074 E2(H2); 9075 Eh(); 9076 break; 9077 case 5: 9078 Bh(d2); 9079 break; 9080 case 4: 9081 zh(); 9082 break; 9083 case 13: 9084 E2(L2); 9085 break; 9086 case 19: 9087 E2(L2); 9088 break; 9089 case 10: 9090 ah(d2.type._context); 9091 break; 9092 case 22: 9093 case 23: 9094 Hj(); 9095 } 9096 c2 = c2.return; 9097 } 9098 Q2 = a2; 9099 Y2 = a2 = Pg(a2.current, null); 9100 Z2 = fj = b2; 9101 T2 = 0; 9102 pk = null; 9103 rk = qk = rh = 0; 9104 tk = sk = null; 9105 if (null !== fh) { 9106 for (b2 = 0; b2 < fh.length; b2++) if (c2 = fh[b2], d2 = c2.interleaved, null !== d2) { 9107 c2.interleaved = null; 9108 var e2 = d2.next, f2 = c2.pending; 9109 if (null !== f2) { 9110 var g2 = f2.next; 9111 f2.next = e2; 9112 d2.next = g2; 9113 } 9114 c2.pending = d2; 9115 } 9116 fh = null; 9117 } 9118 return a2; 9119 } 9120 function Mk(a2, b2) { 9121 do { 9122 var c2 = Y2; 9123 try { 9124 $g(); 9125 Fh.current = Rh; 9126 if (Ih) { 9127 for (var d2 = M2.memoizedState; null !== d2; ) { 9128 var e2 = d2.queue; 9129 null !== e2 && (e2.pending = null); 9130 d2 = d2.next; 9131 } 9132 Ih = false; 9133 } 9134 Hh = 0; 9135 O2 = N2 = M2 = null; 9136 Jh = false; 9137 Kh = 0; 9138 nk.current = null; 9139 if (null === c2 || null === c2.return) { 9140 T2 = 1; 9141 pk = b2; 9142 Y2 = null; 9143 break; 9144 } 9145 a: { 9146 var f2 = a2, g2 = c2.return, h2 = c2, k2 = b2; 9147 b2 = Z2; 9148 h2.flags |= 32768; 9149 if (null !== k2 && "object" === typeof k2 && "function" === typeof k2.then) { 9150 var l2 = k2, m2 = h2, q2 = m2.tag; 9151 if (0 === (m2.mode & 1) && (0 === q2 || 11 === q2 || 15 === q2)) { 9152 var r2 = m2.alternate; 9153 r2 ? (m2.updateQueue = r2.updateQueue, m2.memoizedState = r2.memoizedState, m2.lanes = r2.lanes) : (m2.updateQueue = null, m2.memoizedState = null); 9154 } 9155 var y2 = Ui2(g2); 9156 if (null !== y2) { 9157 y2.flags &= -257; 9158 Vi2(y2, g2, h2, f2, b2); 9159 y2.mode & 1 && Si2(f2, l2, b2); 9160 b2 = y2; 9161 k2 = l2; 9162 var n2 = b2.updateQueue; 9163 if (null === n2) { 9164 var t2 = /* @__PURE__ */ new Set(); 9165 t2.add(k2); 9166 b2.updateQueue = t2; 9167 } else n2.add(k2); 9168 break a; 9169 } else { 9170 if (0 === (b2 & 1)) { 9171 Si2(f2, l2, b2); 9172 tj(); 9173 break a; 9174 } 9175 k2 = Error(p2(426)); 9176 } 9177 } else if (I2 && h2.mode & 1) { 9178 var J2 = Ui2(g2); 9179 if (null !== J2) { 9180 0 === (J2.flags & 65536) && (J2.flags |= 256); 9181 Vi2(J2, g2, h2, f2, b2); 9182 Jg(Ji2(k2, h2)); 9183 break a; 9184 } 9185 } 9186 f2 = k2 = Ji2(k2, h2); 9187 4 !== T2 && (T2 = 2); 9188 null === sk ? sk = [f2] : sk.push(f2); 9189 f2 = g2; 9190 do { 9191 switch (f2.tag) { 9192 case 3: 9193 f2.flags |= 65536; 9194 b2 &= -b2; 9195 f2.lanes |= b2; 9196 var x2 = Ni2(f2, k2, b2); 9197 ph(f2, x2); 9198 break a; 9199 case 1: 9200 h2 = k2; 9201 var w2 = f2.type, u2 = f2.stateNode; 9202 if (0 === (f2.flags & 128) && ("function" === typeof w2.getDerivedStateFromError || null !== u2 && "function" === typeof u2.componentDidCatch && (null === Ri2 || !Ri2.has(u2)))) { 9203 f2.flags |= 65536; 9204 b2 &= -b2; 9205 f2.lanes |= b2; 9206 var F2 = Qi2(f2, h2, b2); 9207 ph(f2, F2); 9208 break a; 9209 } 9210 } 9211 f2 = f2.return; 9212 } while (null !== f2); 9213 } 9214 Sk(c2); 9215 } catch (na2) { 9216 b2 = na2; 9217 Y2 === c2 && null !== c2 && (Y2 = c2 = c2.return); 9218 continue; 9219 } 9220 break; 9221 } while (1); 9222 } 9223 function Jk() { 9224 var a2 = mk.current; 9225 mk.current = Rh; 9226 return null === a2 ? Rh : a2; 9227 } 9228 function tj() { 9229 if (0 === T2 || 3 === T2 || 2 === T2) T2 = 4; 9230 null === Q2 || 0 === (rh & 268435455) && 0 === (qk & 268435455) || Ck(Q2, Z2); 9231 } 9232 function Ik(a2, b2) { 9233 var c2 = K2; 9234 K2 |= 2; 9235 var d2 = Jk(); 9236 if (Q2 !== a2 || Z2 !== b2) uk = null, Kk(a2, b2); 9237 do 9238 try { 9239 Tk(); 9240 break; 9241 } catch (e2) { 9242 Mk(a2, e2); 9243 } 9244 while (1); 9245 $g(); 9246 K2 = c2; 9247 mk.current = d2; 9248 if (null !== Y2) throw Error(p2(261)); 9249 Q2 = null; 9250 Z2 = 0; 9251 return T2; 9252 } 9253 function Tk() { 9254 for (; null !== Y2; ) Uk(Y2); 9255 } 9256 function Lk() { 9257 for (; null !== Y2 && !cc(); ) Uk(Y2); 9258 } 9259 function Uk(a2) { 9260 var b2 = Vk(a2.alternate, a2, fj); 9261 a2.memoizedProps = a2.pendingProps; 9262 null === b2 ? Sk(a2) : Y2 = b2; 9263 nk.current = null; 9264 } 9265 function Sk(a2) { 9266 var b2 = a2; 9267 do { 9268 var c2 = b2.alternate; 9269 a2 = b2.return; 9270 if (0 === (b2.flags & 32768)) { 9271 if (c2 = Ej(c2, b2, fj), null !== c2) { 9272 Y2 = c2; 9273 return; 9274 } 9275 } else { 9276 c2 = Ij(c2, b2); 9277 if (null !== c2) { 9278 c2.flags &= 32767; 9279 Y2 = c2; 9280 return; 9281 } 9282 if (null !== a2) a2.flags |= 32768, a2.subtreeFlags = 0, a2.deletions = null; 9283 else { 9284 T2 = 6; 9285 Y2 = null; 9286 return; 9287 } 9288 } 9289 b2 = b2.sibling; 9290 if (null !== b2) { 9291 Y2 = b2; 9292 return; 9293 } 9294 Y2 = b2 = a2; 9295 } while (null !== b2); 9296 0 === T2 && (T2 = 5); 9297 } 9298 function Pk(a2, b2, c2) { 9299 var d2 = C2, e2 = ok.transition; 9300 try { 9301 ok.transition = null, C2 = 1, Wk(a2, b2, c2, d2); 9302 } finally { 9303 ok.transition = e2, C2 = d2; 9304 } 9305 return null; 9306 } 9307 function Wk(a2, b2, c2, d2) { 9308 do 9309 Hk(); 9310 while (null !== wk); 9311 if (0 !== (K2 & 6)) throw Error(p2(327)); 9312 c2 = a2.finishedWork; 9313 var e2 = a2.finishedLanes; 9314 if (null === c2) return null; 9315 a2.finishedWork = null; 9316 a2.finishedLanes = 0; 9317 if (c2 === a2.current) throw Error(p2(177)); 9318 a2.callbackNode = null; 9319 a2.callbackPriority = 0; 9320 var f2 = c2.lanes | c2.childLanes; 9321 Bc2(a2, f2); 9322 a2 === Q2 && (Y2 = Q2 = null, Z2 = 0); 9323 0 === (c2.subtreeFlags & 2064) && 0 === (c2.flags & 2064) || vk || (vk = true, Fk(hc, function() { 9324 Hk(); 9325 return null; 9326 })); 9327 f2 = 0 !== (c2.flags & 15990); 9328 if (0 !== (c2.subtreeFlags & 15990) || f2) { 9329 f2 = ok.transition; 9330 ok.transition = null; 9331 var g2 = C2; 9332 C2 = 1; 9333 var h2 = K2; 9334 K2 |= 4; 9335 nk.current = null; 9336 Oj(a2, c2); 9337 dk(c2, a2); 9338 Oe2(Df); 9339 dd = !!Cf; 9340 Df = Cf = null; 9341 a2.current = c2; 9342 hk(c2); 9343 dc(); 9344 K2 = h2; 9345 C2 = g2; 9346 ok.transition = f2; 9347 } else a2.current = c2; 9348 vk && (vk = false, wk = a2, xk = e2); 9349 f2 = a2.pendingLanes; 9350 0 === f2 && (Ri2 = null); 9351 mc(c2.stateNode); 9352 Dk(a2, B2()); 9353 if (null !== b2) for (d2 = a2.onRecoverableError, c2 = 0; c2 < b2.length; c2++) e2 = b2[c2], d2(e2.value, { componentStack: e2.stack, digest: e2.digest }); 9354 if (Oi2) throw Oi2 = false, a2 = Pi2, Pi2 = null, a2; 9355 0 !== (xk & 1) && 0 !== a2.tag && Hk(); 9356 f2 = a2.pendingLanes; 9357 0 !== (f2 & 1) ? a2 === zk ? yk++ : (yk = 0, zk = a2) : yk = 0; 9358 jg(); 9359 return null; 9360 } 9361 function Hk() { 9362 if (null !== wk) { 9363 var a2 = Dc(xk), b2 = ok.transition, c2 = C2; 9364 try { 9365 ok.transition = null; 9366 C2 = 16 > a2 ? 16 : a2; 9367 if (null === wk) var d2 = false; 9368 else { 9369 a2 = wk; 9370 wk = null; 9371 xk = 0; 9372 if (0 !== (K2 & 6)) throw Error(p2(331)); 9373 var e2 = K2; 9374 K2 |= 4; 9375 for (V2 = a2.current; null !== V2; ) { 9376 var f2 = V2, g2 = f2.child; 9377 if (0 !== (V2.flags & 16)) { 9378 var h2 = f2.deletions; 9379 if (null !== h2) { 9380 for (var k2 = 0; k2 < h2.length; k2++) { 9381 var l2 = h2[k2]; 9382 for (V2 = l2; null !== V2; ) { 9383 var m2 = V2; 9384 switch (m2.tag) { 9385 case 0: 9386 case 11: 9387 case 15: 9388 Pj(8, m2, f2); 9389 } 9390 var q2 = m2.child; 9391 if (null !== q2) q2.return = m2, V2 = q2; 9392 else for (; null !== V2; ) { 9393 m2 = V2; 9394 var r2 = m2.sibling, y2 = m2.return; 9395 Sj(m2); 9396 if (m2 === l2) { 9397 V2 = null; 9398 break; 9399 } 9400 if (null !== r2) { 9401 r2.return = y2; 9402 V2 = r2; 9403 break; 9404 } 9405 V2 = y2; 9406 } 9407 } 9408 } 9409 var n2 = f2.alternate; 9410 if (null !== n2) { 9411 var t2 = n2.child; 9412 if (null !== t2) { 9413 n2.child = null; 9414 do { 9415 var J2 = t2.sibling; 9416 t2.sibling = null; 9417 t2 = J2; 9418 } while (null !== t2); 9419 } 9420 } 9421 V2 = f2; 9422 } 9423 } 9424 if (0 !== (f2.subtreeFlags & 2064) && null !== g2) g2.return = f2, V2 = g2; 9425 else b: for (; null !== V2; ) { 9426 f2 = V2; 9427 if (0 !== (f2.flags & 2048)) switch (f2.tag) { 9428 case 0: 9429 case 11: 9430 case 15: 9431 Pj(9, f2, f2.return); 9432 } 9433 var x2 = f2.sibling; 9434 if (null !== x2) { 9435 x2.return = f2.return; 9436 V2 = x2; 9437 break b; 9438 } 9439 V2 = f2.return; 9440 } 9441 } 9442 var w2 = a2.current; 9443 for (V2 = w2; null !== V2; ) { 9444 g2 = V2; 9445 var u2 = g2.child; 9446 if (0 !== (g2.subtreeFlags & 2064) && null !== u2) u2.return = g2, V2 = u2; 9447 else b: for (g2 = w2; null !== V2; ) { 9448 h2 = V2; 9449 if (0 !== (h2.flags & 2048)) try { 9450 switch (h2.tag) { 9451 case 0: 9452 case 11: 9453 case 15: 9454 Qj(9, h2); 9455 } 9456 } catch (na2) { 9457 W2(h2, h2.return, na2); 9458 } 9459 if (h2 === g2) { 9460 V2 = null; 9461 break b; 9462 } 9463 var F2 = h2.sibling; 9464 if (null !== F2) { 9465 F2.return = h2.return; 9466 V2 = F2; 9467 break b; 9468 } 9469 V2 = h2.return; 9470 } 9471 } 9472 K2 = e2; 9473 jg(); 9474 if (lc && "function" === typeof lc.onPostCommitFiberRoot) try { 9475 lc.onPostCommitFiberRoot(kc, a2); 9476 } catch (na2) { 9477 } 9478 d2 = true; 9479 } 9480 return d2; 9481 } finally { 9482 C2 = c2, ok.transition = b2; 9483 } 9484 } 9485 return false; 9486 } 9487 function Xk(a2, b2, c2) { 9488 b2 = Ji2(c2, b2); 9489 b2 = Ni2(a2, b2, 1); 9490 a2 = nh(a2, b2, 1); 9491 b2 = R2(); 9492 null !== a2 && (Ac(a2, 1, b2), Dk(a2, b2)); 9493 } 9494 function W2(a2, b2, c2) { 9495 if (3 === a2.tag) Xk(a2, a2, c2); 9496 else for (; null !== b2; ) { 9497 if (3 === b2.tag) { 9498 Xk(b2, a2, c2); 9499 break; 9500 } else if (1 === b2.tag) { 9501 var d2 = b2.stateNode; 9502 if ("function" === typeof b2.type.getDerivedStateFromError || "function" === typeof d2.componentDidCatch && (null === Ri2 || !Ri2.has(d2))) { 9503 a2 = Ji2(c2, a2); 9504 a2 = Qi2(b2, a2, 1); 9505 b2 = nh(b2, a2, 1); 9506 a2 = R2(); 9507 null !== b2 && (Ac(b2, 1, a2), Dk(b2, a2)); 9508 break; 9509 } 9510 } 9511 b2 = b2.return; 9512 } 9513 } 9514 function Ti2(a2, b2, c2) { 9515 var d2 = a2.pingCache; 9516 null !== d2 && d2.delete(b2); 9517 b2 = R2(); 9518 a2.pingedLanes |= a2.suspendedLanes & c2; 9519 Q2 === a2 && (Z2 & c2) === c2 && (4 === T2 || 3 === T2 && (Z2 & 130023424) === Z2 && 500 > B2() - fk ? Kk(a2, 0) : rk |= c2); 9520 Dk(a2, b2); 9521 } 9522 function Yk(a2, b2) { 9523 0 === b2 && (0 === (a2.mode & 1) ? b2 = 1 : (b2 = sc, sc <<= 1, 0 === (sc & 130023424) && (sc = 4194304))); 9524 var c2 = R2(); 9525 a2 = ih(a2, b2); 9526 null !== a2 && (Ac(a2, b2, c2), Dk(a2, c2)); 9527 } 9528 function uj(a2) { 9529 var b2 = a2.memoizedState, c2 = 0; 9530 null !== b2 && (c2 = b2.retryLane); 9531 Yk(a2, c2); 9532 } 9533 function bk(a2, b2) { 9534 var c2 = 0; 9535 switch (a2.tag) { 9536 case 13: 9537 var d2 = a2.stateNode; 9538 var e2 = a2.memoizedState; 9539 null !== e2 && (c2 = e2.retryLane); 9540 break; 9541 case 19: 9542 d2 = a2.stateNode; 9543 break; 9544 default: 9545 throw Error(p2(314)); 9546 } 9547 null !== d2 && d2.delete(b2); 9548 Yk(a2, c2); 9549 } 9550 var Vk; 9551 Vk = function(a2, b2, c2) { 9552 if (null !== a2) if (a2.memoizedProps !== b2.pendingProps || Wf.current) dh = true; 9553 else { 9554 if (0 === (a2.lanes & c2) && 0 === (b2.flags & 128)) return dh = false, yj(a2, b2, c2); 9555 dh = 0 !== (a2.flags & 131072) ? true : false; 9556 } 9557 else dh = false, I2 && 0 !== (b2.flags & 1048576) && ug(b2, ng, b2.index); 9558 b2.lanes = 0; 9559 switch (b2.tag) { 9560 case 2: 9561 var d2 = b2.type; 9562 ij(a2, b2); 9563 a2 = b2.pendingProps; 9564 var e2 = Yf(b2, H2.current); 9565 ch(b2, c2); 9566 e2 = Nh(null, b2, d2, a2, e2, c2); 9567 var f2 = Sh(); 9568 b2.flags |= 1; 9569 "object" === typeof e2 && null !== e2 && "function" === typeof e2.render && void 0 === e2.$$typeof ? (b2.tag = 1, b2.memoizedState = null, b2.updateQueue = null, Zf(d2) ? (f2 = true, cg(b2)) : f2 = false, b2.memoizedState = null !== e2.state && void 0 !== e2.state ? e2.state : null, kh(b2), e2.updater = Ei2, b2.stateNode = e2, e2._reactInternals = b2, Ii2(b2, d2, a2, c2), b2 = jj(null, b2, d2, true, f2, c2)) : (b2.tag = 0, I2 && f2 && vg(b2), Xi2(null, b2, e2, c2), b2 = b2.child); 9570 return b2; 9571 case 16: 9572 d2 = b2.elementType; 9573 a: { 9574 ij(a2, b2); 9575 a2 = b2.pendingProps; 9576 e2 = d2._init; 9577 d2 = e2(d2._payload); 9578 b2.type = d2; 9579 e2 = b2.tag = Zk(d2); 9580 a2 = Ci2(d2, a2); 9581 switch (e2) { 9582 case 0: 9583 b2 = cj(null, b2, d2, a2, c2); 9584 break a; 9585 case 1: 9586 b2 = hj(null, b2, d2, a2, c2); 9587 break a; 9588 case 11: 9589 b2 = Yi2(null, b2, d2, a2, c2); 9590 break a; 9591 case 14: 9592 b2 = $i2(null, b2, d2, Ci2(d2.type, a2), c2); 9593 break a; 9594 } 9595 throw Error(p2( 9596 306, 9597 d2, 9598 "" 9599 )); 9600 } 9601 return b2; 9602 case 0: 9603 return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci2(d2, e2), cj(a2, b2, d2, e2, c2); 9604 case 1: 9605 return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci2(d2, e2), hj(a2, b2, d2, e2, c2); 9606 case 3: 9607 a: { 9608 kj(b2); 9609 if (null === a2) throw Error(p2(387)); 9610 d2 = b2.pendingProps; 9611 f2 = b2.memoizedState; 9612 e2 = f2.element; 9613 lh(a2, b2); 9614 qh(b2, d2, null, c2); 9615 var g2 = b2.memoizedState; 9616 d2 = g2.element; 9617 if (f2.isDehydrated) if (f2 = { element: d2, isDehydrated: false, cache: g2.cache, pendingSuspenseBoundaries: g2.pendingSuspenseBoundaries, transitions: g2.transitions }, b2.updateQueue.baseState = f2, b2.memoizedState = f2, b2.flags & 256) { 9618 e2 = Ji2(Error(p2(423)), b2); 9619 b2 = lj(a2, b2, d2, c2, e2); 9620 break a; 9621 } else if (d2 !== e2) { 9622 e2 = Ji2(Error(p2(424)), b2); 9623 b2 = lj(a2, b2, d2, c2, e2); 9624 break a; 9625 } else for (yg = Lf(b2.stateNode.containerInfo.firstChild), xg = b2, I2 = true, zg = null, c2 = Vg(b2, null, d2, c2), b2.child = c2; c2; ) c2.flags = c2.flags & -3 | 4096, c2 = c2.sibling; 9626 else { 9627 Ig(); 9628 if (d2 === e2) { 9629 b2 = Zi2(a2, b2, c2); 9630 break a; 9631 } 9632 Xi2(a2, b2, d2, c2); 9633 } 9634 b2 = b2.child; 9635 } 9636 return b2; 9637 case 5: 9638 return Ah(b2), null === a2 && Eg(b2), d2 = b2.type, e2 = b2.pendingProps, f2 = null !== a2 ? a2.memoizedProps : null, g2 = e2.children, Ef(d2, e2) ? g2 = null : null !== f2 && Ef(d2, f2) && (b2.flags |= 32), gj(a2, b2), Xi2(a2, b2, g2, c2), b2.child; 9639 case 6: 9640 return null === a2 && Eg(b2), null; 9641 case 13: 9642 return oj(a2, b2, c2); 9643 case 4: 9644 return yh(b2, b2.stateNode.containerInfo), d2 = b2.pendingProps, null === a2 ? b2.child = Ug(b2, null, d2, c2) : Xi2(a2, b2, d2, c2), b2.child; 9645 case 11: 9646 return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci2(d2, e2), Yi2(a2, b2, d2, e2, c2); 9647 case 7: 9648 return Xi2(a2, b2, b2.pendingProps, c2), b2.child; 9649 case 8: 9650 return Xi2(a2, b2, b2.pendingProps.children, c2), b2.child; 9651 case 12: 9652 return Xi2(a2, b2, b2.pendingProps.children, c2), b2.child; 9653 case 10: 9654 a: { 9655 d2 = b2.type._context; 9656 e2 = b2.pendingProps; 9657 f2 = b2.memoizedProps; 9658 g2 = e2.value; 9659 G2(Wg, d2._currentValue); 9660 d2._currentValue = g2; 9661 if (null !== f2) if (He2(f2.value, g2)) { 9662 if (f2.children === e2.children && !Wf.current) { 9663 b2 = Zi2(a2, b2, c2); 9664 break a; 9665 } 9666 } else for (f2 = b2.child, null !== f2 && (f2.return = b2); null !== f2; ) { 9667 var h2 = f2.dependencies; 9668 if (null !== h2) { 9669 g2 = f2.child; 9670 for (var k2 = h2.firstContext; null !== k2; ) { 9671 if (k2.context === d2) { 9672 if (1 === f2.tag) { 9673 k2 = mh(-1, c2 & -c2); 9674 k2.tag = 2; 9675 var l2 = f2.updateQueue; 9676 if (null !== l2) { 9677 l2 = l2.shared; 9678 var m2 = l2.pending; 9679 null === m2 ? k2.next = k2 : (k2.next = m2.next, m2.next = k2); 9680 l2.pending = k2; 9681 } 9682 } 9683 f2.lanes |= c2; 9684 k2 = f2.alternate; 9685 null !== k2 && (k2.lanes |= c2); 9686 bh( 9687 f2.return, 9688 c2, 9689 b2 9690 ); 9691 h2.lanes |= c2; 9692 break; 9693 } 9694 k2 = k2.next; 9695 } 9696 } else if (10 === f2.tag) g2 = f2.type === b2.type ? null : f2.child; 9697 else if (18 === f2.tag) { 9698 g2 = f2.return; 9699 if (null === g2) throw Error(p2(341)); 9700 g2.lanes |= c2; 9701 h2 = g2.alternate; 9702 null !== h2 && (h2.lanes |= c2); 9703 bh(g2, c2, b2); 9704 g2 = f2.sibling; 9705 } else g2 = f2.child; 9706 if (null !== g2) g2.return = f2; 9707 else for (g2 = f2; null !== g2; ) { 9708 if (g2 === b2) { 9709 g2 = null; 9710 break; 9711 } 9712 f2 = g2.sibling; 9713 if (null !== f2) { 9714 f2.return = g2.return; 9715 g2 = f2; 9716 break; 9717 } 9718 g2 = g2.return; 9719 } 9720 f2 = g2; 9721 } 9722 Xi2(a2, b2, e2.children, c2); 9723 b2 = b2.child; 9724 } 9725 return b2; 9726 case 9: 9727 return e2 = b2.type, d2 = b2.pendingProps.children, ch(b2, c2), e2 = eh(e2), d2 = d2(e2), b2.flags |= 1, Xi2(a2, b2, d2, c2), b2.child; 9728 case 14: 9729 return d2 = b2.type, e2 = Ci2(d2, b2.pendingProps), e2 = Ci2(d2.type, e2), $i2(a2, b2, d2, e2, c2); 9730 case 15: 9731 return bj(a2, b2, b2.type, b2.pendingProps, c2); 9732 case 17: 9733 return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci2(d2, e2), ij(a2, b2), b2.tag = 1, Zf(d2) ? (a2 = true, cg(b2)) : a2 = false, ch(b2, c2), Gi2(b2, d2, e2), Ii2(b2, d2, e2, c2), jj(null, b2, d2, true, a2, c2); 9734 case 19: 9735 return xj(a2, b2, c2); 9736 case 22: 9737 return dj(a2, b2, c2); 9738 } 9739 throw Error(p2(156, b2.tag)); 9740 }; 9741 function Fk(a2, b2) { 9742 return ac(a2, b2); 9743 } 9744 function $k(a2, b2, c2, d2) { 9745 this.tag = a2; 9746 this.key = c2; 9747 this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null; 9748 this.index = 0; 9749 this.ref = null; 9750 this.pendingProps = b2; 9751 this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null; 9752 this.mode = d2; 9753 this.subtreeFlags = this.flags = 0; 9754 this.deletions = null; 9755 this.childLanes = this.lanes = 0; 9756 this.alternate = null; 9757 } 9758 function Bg(a2, b2, c2, d2) { 9759 return new $k(a2, b2, c2, d2); 9760 } 9761 function aj(a2) { 9762 a2 = a2.prototype; 9763 return !(!a2 || !a2.isReactComponent); 9764 } 9765 function Zk(a2) { 9766 if ("function" === typeof a2) return aj(a2) ? 1 : 0; 9767 if (void 0 !== a2 && null !== a2) { 9768 a2 = a2.$$typeof; 9769 if (a2 === Da2) return 11; 9770 if (a2 === Ga2) return 14; 9771 } 9772 return 2; 9773 } 9774 function Pg(a2, b2) { 9775 var c2 = a2.alternate; 9776 null === c2 ? (c2 = Bg(a2.tag, b2, a2.key, a2.mode), c2.elementType = a2.elementType, c2.type = a2.type, c2.stateNode = a2.stateNode, c2.alternate = a2, a2.alternate = c2) : (c2.pendingProps = b2, c2.type = a2.type, c2.flags = 0, c2.subtreeFlags = 0, c2.deletions = null); 9777 c2.flags = a2.flags & 14680064; 9778 c2.childLanes = a2.childLanes; 9779 c2.lanes = a2.lanes; 9780 c2.child = a2.child; 9781 c2.memoizedProps = a2.memoizedProps; 9782 c2.memoizedState = a2.memoizedState; 9783 c2.updateQueue = a2.updateQueue; 9784 b2 = a2.dependencies; 9785 c2.dependencies = null === b2 ? null : { lanes: b2.lanes, firstContext: b2.firstContext }; 9786 c2.sibling = a2.sibling; 9787 c2.index = a2.index; 9788 c2.ref = a2.ref; 9789 return c2; 9790 } 9791 function Rg(a2, b2, c2, d2, e2, f2) { 9792 var g2 = 2; 9793 d2 = a2; 9794 if ("function" === typeof a2) aj(a2) && (g2 = 1); 9795 else if ("string" === typeof a2) g2 = 5; 9796 else a: switch (a2) { 9797 case ya2: 9798 return Tg(c2.children, e2, f2, b2); 9799 case za2: 9800 g2 = 8; 9801 e2 |= 8; 9802 break; 9803 case Aa2: 9804 return a2 = Bg(12, c2, b2, e2 | 2), a2.elementType = Aa2, a2.lanes = f2, a2; 9805 case Ea2: 9806 return a2 = Bg(13, c2, b2, e2), a2.elementType = Ea2, a2.lanes = f2, a2; 9807 case Fa2: 9808 return a2 = Bg(19, c2, b2, e2), a2.elementType = Fa2, a2.lanes = f2, a2; 9809 case Ia2: 9810 return pj(c2, e2, f2, b2); 9811 default: 9812 if ("object" === typeof a2 && null !== a2) switch (a2.$$typeof) { 9813 case Ba2: 9814 g2 = 10; 9815 break a; 9816 case Ca2: 9817 g2 = 9; 9818 break a; 9819 case Da2: 9820 g2 = 11; 9821 break a; 9822 case Ga2: 9823 g2 = 14; 9824 break a; 9825 case Ha2: 9826 g2 = 16; 9827 d2 = null; 9828 break a; 9829 } 9830 throw Error(p2(130, null == a2 ? a2 : typeof a2, "")); 9831 } 9832 b2 = Bg(g2, c2, b2, e2); 9833 b2.elementType = a2; 9834 b2.type = d2; 9835 b2.lanes = f2; 9836 return b2; 9837 } 9838 function Tg(a2, b2, c2, d2) { 9839 a2 = Bg(7, a2, d2, b2); 9840 a2.lanes = c2; 9841 return a2; 9842 } 9843 function pj(a2, b2, c2, d2) { 9844 a2 = Bg(22, a2, d2, b2); 9845 a2.elementType = Ia2; 9846 a2.lanes = c2; 9847 a2.stateNode = { isHidden: false }; 9848 return a2; 9849 } 9850 function Qg(a2, b2, c2) { 9851 a2 = Bg(6, a2, null, b2); 9852 a2.lanes = c2; 9853 return a2; 9854 } 9855 function Sg(a2, b2, c2) { 9856 b2 = Bg(4, null !== a2.children ? a2.children : [], a2.key, b2); 9857 b2.lanes = c2; 9858 b2.stateNode = { containerInfo: a2.containerInfo, pendingChildren: null, implementation: a2.implementation }; 9859 return b2; 9860 } 9861 function al(a2, b2, c2, d2, e2) { 9862 this.tag = b2; 9863 this.containerInfo = a2; 9864 this.finishedWork = this.pingCache = this.current = this.pendingChildren = null; 9865 this.timeoutHandle = -1; 9866 this.callbackNode = this.pendingContext = this.context = null; 9867 this.callbackPriority = 0; 9868 this.eventTimes = zc(0); 9869 this.expirationTimes = zc(-1); 9870 this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; 9871 this.entanglements = zc(0); 9872 this.identifierPrefix = d2; 9873 this.onRecoverableError = e2; 9874 this.mutableSourceEagerHydrationData = null; 9875 } 9876 function bl(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 9877 a2 = new al(a2, b2, c2, h2, k2); 9878 1 === b2 ? (b2 = 1, true === f2 && (b2 |= 8)) : b2 = 0; 9879 f2 = Bg(3, null, null, b2); 9880 a2.current = f2; 9881 f2.stateNode = a2; 9882 f2.memoizedState = { element: d2, isDehydrated: c2, cache: null, transitions: null, pendingSuspenseBoundaries: null }; 9883 kh(f2); 9884 return a2; 9885 } 9886 function cl(a2, b2, c2) { 9887 var d2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; 9888 return { $$typeof: wa2, key: null == d2 ? null : "" + d2, children: a2, containerInfo: b2, implementation: c2 }; 9889 } 9890 function dl(a2) { 9891 if (!a2) return Vf; 9892 a2 = a2._reactInternals; 9893 a: { 9894 if (Vb(a2) !== a2 || 1 !== a2.tag) throw Error(p2(170)); 9895 var b2 = a2; 9896 do { 9897 switch (b2.tag) { 9898 case 3: 9899 b2 = b2.stateNode.context; 9900 break a; 9901 case 1: 9902 if (Zf(b2.type)) { 9903 b2 = b2.stateNode.__reactInternalMemoizedMergedChildContext; 9904 break a; 9905 } 9906 } 9907 b2 = b2.return; 9908 } while (null !== b2); 9909 throw Error(p2(171)); 9910 } 9911 if (1 === a2.tag) { 9912 var c2 = a2.type; 9913 if (Zf(c2)) return bg(a2, c2, b2); 9914 } 9915 return b2; 9916 } 9917 function el(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 9918 a2 = bl(c2, d2, true, a2, e2, f2, g2, h2, k2); 9919 a2.context = dl(null); 9920 c2 = a2.current; 9921 d2 = R2(); 9922 e2 = yi2(c2); 9923 f2 = mh(d2, e2); 9924 f2.callback = void 0 !== b2 && null !== b2 ? b2 : null; 9925 nh(c2, f2, e2); 9926 a2.current.lanes = e2; 9927 Ac(a2, e2, d2); 9928 Dk(a2, d2); 9929 return a2; 9930 } 9931 function fl(a2, b2, c2, d2) { 9932 var e2 = b2.current, f2 = R2(), g2 = yi2(e2); 9933 c2 = dl(c2); 9934 null === b2.context ? b2.context = c2 : b2.pendingContext = c2; 9935 b2 = mh(f2, g2); 9936 b2.payload = { element: a2 }; 9937 d2 = void 0 === d2 ? null : d2; 9938 null !== d2 && (b2.callback = d2); 9939 a2 = nh(e2, b2, g2); 9940 null !== a2 && (gi2(a2, e2, g2, f2), oh(a2, e2, g2)); 9941 return g2; 9942 } 9943 function gl(a2) { 9944 a2 = a2.current; 9945 if (!a2.child) return null; 9946 switch (a2.child.tag) { 9947 case 5: 9948 return a2.child.stateNode; 9949 default: 9950 return a2.child.stateNode; 9951 } 9952 } 9953 function hl(a2, b2) { 9954 a2 = a2.memoizedState; 9955 if (null !== a2 && null !== a2.dehydrated) { 9956 var c2 = a2.retryLane; 9957 a2.retryLane = 0 !== c2 && c2 < b2 ? c2 : b2; 9958 } 9959 } 9960 function il(a2, b2) { 9961 hl(a2, b2); 9962 (a2 = a2.alternate) && hl(a2, b2); 9963 } 9964 function jl() { 9965 return null; 9966 } 9967 var kl = "function" === typeof reportError ? reportError : function(a2) { 9968 console.error(a2); 9969 }; 9970 function ll(a2) { 9971 this._internalRoot = a2; 9972 } 9973 ml.prototype.render = ll.prototype.render = function(a2) { 9974 var b2 = this._internalRoot; 9975 if (null === b2) throw Error(p2(409)); 9976 fl(a2, b2, null, null); 9977 }; 9978 ml.prototype.unmount = ll.prototype.unmount = function() { 9979 var a2 = this._internalRoot; 9980 if (null !== a2) { 9981 this._internalRoot = null; 9982 var b2 = a2.containerInfo; 9983 Rk(function() { 9984 fl(null, a2, null, null); 9985 }); 9986 b2[uf] = null; 9987 } 9988 }; 9989 function ml(a2) { 9990 this._internalRoot = a2; 9991 } 9992 ml.prototype.unstable_scheduleHydration = function(a2) { 9993 if (a2) { 9994 var b2 = Hc(); 9995 a2 = { blockedOn: null, target: a2, priority: b2 }; 9996 for (var c2 = 0; c2 < Qc.length && 0 !== b2 && b2 < Qc[c2].priority; c2++) ; 9997 Qc.splice(c2, 0, a2); 9998 0 === c2 && Vc(a2); 9999 } 10000 }; 10001 function nl(a2) { 10002 return !(!a2 || 1 !== a2.nodeType && 9 !== a2.nodeType && 11 !== a2.nodeType); 10003 } 10004 function ol(a2) { 10005 return !(!a2 || 1 !== a2.nodeType && 9 !== a2.nodeType && 11 !== a2.nodeType && (8 !== a2.nodeType || " react-mount-point-unstable " !== a2.nodeValue)); 10006 } 10007 function pl() { 10008 } 10009 function ql(a2, b2, c2, d2, e2) { 10010 if (e2) { 10011 if ("function" === typeof d2) { 10012 var f2 = d2; 10013 d2 = function() { 10014 var a3 = gl(g2); 10015 f2.call(a3); 10016 }; 10017 } 10018 var g2 = el(b2, d2, a2, 0, null, false, false, "", pl); 10019 a2._reactRootContainer = g2; 10020 a2[uf] = g2.current; 10021 sf(8 === a2.nodeType ? a2.parentNode : a2); 10022 Rk(); 10023 return g2; 10024 } 10025 for (; e2 = a2.lastChild; ) a2.removeChild(e2); 10026 if ("function" === typeof d2) { 10027 var h2 = d2; 10028 d2 = function() { 10029 var a3 = gl(k2); 10030 h2.call(a3); 10031 }; 10032 } 10033 var k2 = bl(a2, 0, false, null, null, false, false, "", pl); 10034 a2._reactRootContainer = k2; 10035 a2[uf] = k2.current; 10036 sf(8 === a2.nodeType ? a2.parentNode : a2); 10037 Rk(function() { 10038 fl(b2, k2, c2, d2); 10039 }); 10040 return k2; 10041 } 10042 function rl(a2, b2, c2, d2, e2) { 10043 var f2 = c2._reactRootContainer; 10044 if (f2) { 10045 var g2 = f2; 10046 if ("function" === typeof e2) { 10047 var h2 = e2; 10048 e2 = function() { 10049 var a3 = gl(g2); 10050 h2.call(a3); 10051 }; 10052 } 10053 fl(b2, g2, a2, e2); 10054 } else g2 = ql(c2, b2, a2, e2, d2); 10055 return gl(g2); 10056 } 10057 Ec = function(a2) { 10058 switch (a2.tag) { 10059 case 3: 10060 var b2 = a2.stateNode; 10061 if (b2.current.memoizedState.isDehydrated) { 10062 var c2 = tc(b2.pendingLanes); 10063 0 !== c2 && (Cc(b2, c2 | 1), Dk(b2, B2()), 0 === (K2 & 6) && (Gj = B2() + 500, jg())); 10064 } 10065 break; 10066 case 13: 10067 Rk(function() { 10068 var b3 = ih(a2, 1); 10069 if (null !== b3) { 10070 var c3 = R2(); 10071 gi2(b3, a2, 1, c3); 10072 } 10073 }), il(a2, 1); 10074 } 10075 }; 10076 Fc = function(a2) { 10077 if (13 === a2.tag) { 10078 var b2 = ih(a2, 134217728); 10079 if (null !== b2) { 10080 var c2 = R2(); 10081 gi2(b2, a2, 134217728, c2); 10082 } 10083 il(a2, 134217728); 10084 } 10085 }; 10086 Gc = function(a2) { 10087 if (13 === a2.tag) { 10088 var b2 = yi2(a2), c2 = ih(a2, b2); 10089 if (null !== c2) { 10090 var d2 = R2(); 10091 gi2(c2, a2, b2, d2); 10092 } 10093 il(a2, b2); 10094 } 10095 }; 10096 Hc = function() { 10097 return C2; 10098 }; 10099 Ic = function(a2, b2) { 10100 var c2 = C2; 10101 try { 10102 return C2 = a2, b2(); 10103 } finally { 10104 C2 = c2; 10105 } 10106 }; 10107 yb = function(a2, b2, c2) { 10108 switch (b2) { 10109 case "input": 10110 bb(a2, c2); 10111 b2 = c2.name; 10112 if ("radio" === c2.type && null != b2) { 10113 for (c2 = a2; c2.parentNode; ) c2 = c2.parentNode; 10114 c2 = c2.querySelectorAll("input[name=" + JSON.stringify("" + b2) + '][type="radio"]'); 10115 for (b2 = 0; b2 < c2.length; b2++) { 10116 var d2 = c2[b2]; 10117 if (d2 !== a2 && d2.form === a2.form) { 10118 var e2 = Db(d2); 10119 if (!e2) throw Error(p2(90)); 10120 Wa2(d2); 10121 bb(d2, e2); 10122 } 10123 } 10124 } 10125 break; 10126 case "textarea": 10127 ib(a2, c2); 10128 break; 10129 case "select": 10130 b2 = c2.value, null != b2 && fb(a2, !!c2.multiple, b2, false); 10131 } 10132 }; 10133 Gb = Qk; 10134 Hb = Rk; 10135 var sl = { usingClientEntryPoint: false, Events: [Cb, ue2, Db, Eb, Fb, Qk] }, tl = { findFiberByHostInstance: Wc, bundleType: 0, version: "18.3.1", rendererPackageName: "react-dom" }; 10136 var ul = { bundleType: tl.bundleType, version: tl.version, rendererPackageName: tl.rendererPackageName, rendererConfig: tl.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: ua2.ReactCurrentDispatcher, findHostInstanceByFiber: function(a2) { 10137 a2 = Zb(a2); 10138 return null === a2 ? null : a2.stateNode; 10139 }, findFiberByHostInstance: tl.findFiberByHostInstance || jl, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.3.1-next-f1338f8080-20240426" }; 10140 if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { 10141 var vl = __REACT_DEVTOOLS_GLOBAL_HOOK__; 10142 if (!vl.isDisabled && vl.supportsFiber) try { 10143 kc = vl.inject(ul), lc = vl; 10144 } catch (a2) { 10145 } 10146 } 10147 reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = sl; 10148 reactDom_production_min.createPortal = function(a2, b2) { 10149 var c2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; 10150 if (!nl(b2)) throw Error(p2(200)); 10151 return cl(a2, b2, null, c2); 10152 }; 10153 reactDom_production_min.createRoot = function(a2, b2) { 10154 if (!nl(a2)) throw Error(p2(299)); 10155 var c2 = false, d2 = "", e2 = kl; 10156 null !== b2 && void 0 !== b2 && (true === b2.unstable_strictMode && (c2 = true), void 0 !== b2.identifierPrefix && (d2 = b2.identifierPrefix), void 0 !== b2.onRecoverableError && (e2 = b2.onRecoverableError)); 10157 b2 = bl(a2, 1, false, null, null, c2, false, d2, e2); 10158 a2[uf] = b2.current; 10159 sf(8 === a2.nodeType ? a2.parentNode : a2); 10160 return new ll(b2); 10161 }; 10162 reactDom_production_min.findDOMNode = function(a2) { 10163 if (null == a2) return null; 10164 if (1 === a2.nodeType) return a2; 10165 var b2 = a2._reactInternals; 10166 if (void 0 === b2) { 10167 if ("function" === typeof a2.render) throw Error(p2(188)); 10168 a2 = Object.keys(a2).join(","); 10169 throw Error(p2(268, a2)); 10170 } 10171 a2 = Zb(b2); 10172 a2 = null === a2 ? null : a2.stateNode; 10173 return a2; 10174 }; 10175 reactDom_production_min.flushSync = function(a2) { 10176 return Rk(a2); 10177 }; 10178 reactDom_production_min.hydrate = function(a2, b2, c2) { 10179 if (!ol(b2)) throw Error(p2(200)); 10180 return rl(null, a2, b2, true, c2); 10181 }; 10182 reactDom_production_min.hydrateRoot = function(a2, b2, c2) { 10183 if (!nl(a2)) throw Error(p2(405)); 10184 var d2 = null != c2 && c2.hydratedSources || null, e2 = false, f2 = "", g2 = kl; 10185 null !== c2 && void 0 !== c2 && (true === c2.unstable_strictMode && (e2 = true), void 0 !== c2.identifierPrefix && (f2 = c2.identifierPrefix), void 0 !== c2.onRecoverableError && (g2 = c2.onRecoverableError)); 10186 b2 = el(b2, null, a2, 1, null != c2 ? c2 : null, e2, false, f2, g2); 10187 a2[uf] = b2.current; 10188 sf(a2); 10189 if (d2) for (a2 = 0; a2 < d2.length; a2++) c2 = d2[a2], e2 = c2._getVersion, e2 = e2(c2._source), null == b2.mutableSourceEagerHydrationData ? b2.mutableSourceEagerHydrationData = [c2, e2] : b2.mutableSourceEagerHydrationData.push( 10190 c2, 10191 e2 10192 ); 10193 return new ml(b2); 10194 }; 10195 reactDom_production_min.render = function(a2, b2, c2) { 10196 if (!ol(b2)) throw Error(p2(200)); 10197 return rl(null, a2, b2, false, c2); 10198 }; 10199 reactDom_production_min.unmountComponentAtNode = function(a2) { 10200 if (!ol(a2)) throw Error(p2(40)); 10201 return a2._reactRootContainer ? (Rk(function() { 10202 rl(null, null, a2, false, function() { 10203 a2._reactRootContainer = null; 10204 a2[uf] = null; 10205 }); 10206 }), true) : false;
10207 }; 10208 reactDom_production_min.unstable_batchedUpdates = Qk; 10209 reactDom_production_min.unstable_renderSubtreeIntoContainer = function(a2, b2, c2, d2) { 10210 if (!ol(c2)) throw Error(p2(200)); 10211 if (null == a2 || void 0 === a2._reactInternals) throw Error(p2(38)); 10212 return rl(a2, b2, c2, false, d2); 10213 }; 10214 reactDom_production_min.version = "18.3.1-next-f1338f8080-20240426"; 10215 return reactDom_production_min; 10216 } 10217 var hasRequiredReactDom; 10218 function requireReactDom() { 10219 if (hasRequiredReactDom) return reactDom.exports; 10220 hasRequiredReactDom = 1; 10221 function checkDCE() { 10222 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") { 10223 return; 10224 } 10225 try { 10226 __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); 10227 } catch (err) { 10228 console.error(err); 10229 } 10230 } 10231 { 10232 checkDCE(); 10233 reactDom.exports = requireReactDom_production_min(); 10234 } 10235 return reactDom.exports; 10236 } 10237 var hasRequiredClient; 10238 function requireClient() { 10239 if (hasRequiredClient) return client; 10240 hasRequiredClient = 1; 10241 var m2 = requireReactDom(); 10242 { 10243 client.createRoot = m2.createRoot; 10244 client.hydrateRoot = m2.hydrateRoot; 10245 } 10246 return client; 10247 } 10248 var clientExports = requireClient(); 10249 var reactDomExports = requireReactDom(); 10250 /** 10251 * @remix-run/router v1.22.0 10252 * 10253 * Copyright (c) Remix Software Inc. 10254 * 10255 * This source code is licensed under the MIT license found in the 10256 * LICENSE.md file in the root directory of this source tree. 10257 * 10258 * @license MIT 10259 */ 10260 function _extends$9() { 10261 _extends$9 = Object.assign ? Object.assign.bind() : function(target) { 10262 for (var i2 = 1; i2 < arguments.length; i2++) { 10263 var source = arguments[i2]; 10264 for (var key in source) { 10265 if (Object.prototype.hasOwnProperty.call(source, key)) { 10266 target[key] = source[key]; 10267 } 10268 } 10269 } 10270 return target; 10271 }; 10272 return _extends$9.apply(this, arguments); 10273 } 10274 var Action; 10275 (function(Action2) { 10276 Action2["Pop"] = "POP"; 10277 Action2["Push"] = "PUSH"; 10278 Action2["Replace"] = "REPLACE"; 10279 })(Action || (Action = {})); 10280 const PopStateEventType = "popstate"; 10281 function createBrowserHistory(options2) { 10282 if (options2 === void 0) { 10283 options2 = {}; 10284 } 10285 function createBrowserLocation(window2, globalHistory) { 10286 let { 10287 pathname, 10288 search, 10289 hash: hash2 10290 } = window2.location; 10291 return createLocation( 10292 "", 10293 { 10294 pathname, 10295 search, 10296 hash: hash2 10297 }, 10298 // state defaults to `null` because `window.history.state` does 10299 globalHistory.state && globalHistory.state.usr || null, 10300 globalHistory.state && globalHistory.state.key || "default" 10301 ); 10302 } 10303 function createBrowserHref(window2, to2) { 10304 return typeof to2 === "string" ? to2 : createPath(to2); 10305 } 10306 return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options2); 10307 } 10308 function invariant$1(value, message) { 10309 if (value === false || value === null || typeof value === "undefined") { 10310 throw new Error(message); 10311 } 10312 } 10313 function warning(cond, message) { 10314 if (!cond) { 10315 if (typeof console !== "undefined") console.warn(message); 10316 try { 10317 throw new Error(message); 10318 } catch (e2) { 10319 } 10320 } 10321 } 10322 function createKey() { 10323 return Math.random().toString(36).substr(2, 8); 10324 } 10325 function getHistoryState(location, index2) { 10326 return { 10327 usr: location.state, 10328 key: location.key, 10329 idx: index2 10330 }; 10331 } 10332 function createLocation(current, to2, state, key) { 10333 if (state === void 0) { 10334 state = null; 10335 } 10336 let location = _extends$9({ 10337 pathname: typeof current === "string" ? current : current.pathname, 10338 search: "", 10339 hash: "" 10340 }, typeof to2 === "string" ? parsePath(to2) : to2, { 10341 state, 10342 // TODO: This could be cleaned up. push/replace should probably just take 10343 // full Locations now and avoid the need to run through this flow at all 10344 // But that's a pretty big refactor to the current test suite so going to 10345 // keep as is for the time being and just let any incoming keys take precedence 10346 key: to2 && to2.key || key || createKey() 10347 }); 10348 return location; 10349 } 10350 function createPath(_ref2) { 10351 let { 10352 pathname = "/", 10353 search = "", 10354 hash: hash2 = "" 10355 } = _ref2; 10356 if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search; 10357 if (hash2 && hash2 !== "#") pathname += hash2.charAt(0) === "#" ? hash2 : "#" + hash2; 10358 return pathname; 10359 } 10360 function parsePath(path) { 10361 let parsedPath = {}; 10362 if (path) { 10363 let hashIndex = path.indexOf("#"); 10364 if (hashIndex >= 0) { 10365 parsedPath.hash = path.substr(hashIndex); 10366 path = path.substr(0, hashIndex); 10367 } 10368 let searchIndex = path.indexOf("?"); 10369 if (searchIndex >= 0) { 10370 parsedPath.search = path.substr(searchIndex); 10371 path = path.substr(0, searchIndex); 10372 } 10373 if (path) { 10374 parsedPath.pathname = path; 10375 } 10376 } 10377 return parsedPath; 10378 } 10379 function getUrlBasedHistory(getLocation, createHref, validateLocation, options2) { 10380 if (options2 === void 0) { 10381 options2 = {}; 10382 } 10383 let { 10384 window: window2 = document.defaultView, 10385 v5Compat = false 10386 } = options2; 10387 let globalHistory = window2.history; 10388 let action = Action.Pop; 10389 let listener = null; 10390 let index2 = getIndex(); 10391 if (index2 == null) { 10392 index2 = 0; 10393 globalHistory.replaceState(_extends$9({}, globalHistory.state, { 10394 idx: index2 10395 }), ""); 10396 } 10397 function getIndex() { 10398 let state = globalHistory.state || { 10399 idx: null 10400 }; 10401 return state.idx; 10402 } 10403 function handlePop() { 10404 action = Action.Pop; 10405 let nextIndex = getIndex(); 10406 let delta = nextIndex == null ? null : nextIndex - index2; 10407 index2 = nextIndex; 10408 if (listener) { 10409 listener({ 10410 action, 10411 location: history.location, 10412 delta 10413 }); 10414 } 10415 } 10416 function push(to2, state) { 10417 action = Action.Push; 10418 let location = createLocation(history.location, to2, state); 10419 index2 = getIndex() + 1; 10420 let historyState = getHistoryState(location, index2); 10421 let url = history.createHref(location); 10422 try { 10423 globalHistory.pushState(historyState, "", url); 10424 } catch (error) {
vendor: 5,773 bytes, lines 10425-10587
10425 if (error instanceof DOMException && error.name === "DataCloneError") { 10426 throw error; 10427 } 10428 window2.location.assign(url); 10429 } 10430 if (v5Compat && listener) { 10431 listener({ 10432 action, 10433 location: history.location, 10434 delta: 1 10435 }); 10436 } 10437 } 10438 function replace2(to2, state) { 10439 action = Action.Replace; 10440 let location = createLocation(history.location, to2, state); 10441 index2 = getIndex(); 10442 let historyState = getHistoryState(location, index2); 10443 let url = history.createHref(location); 10444 globalHistory.replaceState(historyState, "", url); 10445 if (v5Compat && listener) { 10446 listener({ 10447 action, 10448 location: history.location, 10449 delta: 0 10450 }); 10451 } 10452 } 10453 function createURL(to2) { 10454 let base = window2.location.origin !== "null" ? window2.location.origin : window2.location.href; 10455 let href = typeof to2 === "string" ? to2 : createPath(to2); 10456 href = href.replace(/ $/, "%20"); 10457 invariant$1(base, "No window.location.(origin|href) available to create URL for href: " + href); 10458 return new URL(href, base); 10459 } 10460 let history = { 10461 get action() { 10462 return action; 10463 }, 10464 get location() { 10465 return getLocation(window2, globalHistory); 10466 }, 10467 listen(fn2) { 10468 if (listener) { 10469 throw new Error("A history only accepts one active listener"); 10470 } 10471 window2.addEventListener(PopStateEventType, handlePop); 10472 listener = fn2; 10473 return () => { 10474 window2.removeEventListener(PopStateEventType, handlePop); 10475 listener = null; 10476 }; 10477 }, 10478 createHref(to2) { 10479 return createHref(window2, to2); 10480 }, 10481 createURL, 10482 encodeLocation(to2) { 10483 let url = createURL(to2); 10484 return { 10485 pathname: url.pathname, 10486 search: url.search, 10487 hash: url.hash 10488 }; 10489 }, 10490 push, 10491 replace: replace2, 10492 go(n2) { 10493 return globalHistory.go(n2); 10494 } 10495 }; 10496 return history; 10497 } 10498 var ResultType; 10499 (function(ResultType2) { 10500 ResultType2["data"] = "data"; 10501 ResultType2["deferred"] = "deferred"; 10502 ResultType2["redirect"] = "redirect"; 10503 ResultType2["error"] = "error"; 10504 })(ResultType || (ResultType = {})); 10505 function matchRoutes(routes2, locationArg, basename) { 10506 if (basename === void 0) { 10507 basename = "/"; 10508 } 10509 return matchRoutesImpl(routes2, locationArg, basename); 10510 } 10511 function matchRoutesImpl(routes2, locationArg, basename, allowPartial) { 10512 let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; 10513 let pathname = stripBasename(location.pathname || "/", basename); 10514 if (pathname == null) { 10515 return null; 10516 } 10517 let branches = flattenRoutes(routes2); 10518 rankRouteBranches(branches); 10519 let matches2 = null; 10520 for (let i2 = 0; matches2 == null && i2 < branches.length; ++i2) { 10521 let decoded = decodePath(pathname); 10522 matches2 = matchRouteBranch(branches[i2], decoded); 10523 } 10524 return matches2; 10525 } 10526 function flattenRoutes(routes2, branches, parentsMeta, parentPath) { 10527 if (branches === void 0) { 10528 branches = []; 10529 } 10530 if (parentsMeta === void 0) { 10531 parentsMeta = []; 10532 } 10533 if (parentPath === void 0) { 10534 parentPath = ""; 10535 } 10536 let flattenRoute = (route, index2, relativePath) => { 10537 let meta = { 10538 relativePath: relativePath === void 0 ? route.path || "" : relativePath, 10539 caseSensitive: route.caseSensitive === true, 10540 childrenIndex: index2, 10541 route 10542 }; 10543 if (meta.relativePath.startsWith("/")) { 10544 invariant$1(meta.relativePath.startsWith(parentPath), 'Absolute route path "' + meta.relativePath + '" nested under path ' + ('"' + parentPath + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes."); 10545 meta.relativePath = meta.relativePath.slice(parentPath.length); 10546 } 10547 let path = joinPaths([parentPath, meta.relativePath]); 10548 let routesMeta = parentsMeta.concat(meta); 10549 if (route.children && route.children.length > 0) { 10550 invariant$1( 10551 // Our types know better, but runtime JS may not! 10552 // @ts-expect-error 10553 route.index !== true, 10554 "Index routes must not have child routes. Please remove " + ('all child routes from route path "' + path + '".') 10555 ); 10556 flattenRoutes(route.children, branches, routesMeta, path); 10557 } 10558 if (route.path == null && !route.index) { 10559 return; 10560 } 10561 branches.push({ 10562 path, 10563 score: computeScore(path, route.index), 10564 routesMeta 10565 }); 10566 }; 10567 routes2.forEach((route, index2) => { 10568 var _route$path; 10569 if (route.path === "" || !((_route$path = route.path) != null && _route$path.includes("?"))) { 10570 flattenRoute(route, index2); 10571 } else { 10572 for (let exploded of explodeOptionalSegments(route.path)) { 10573 flattenRoute(route, index2, exploded); 10574 } 10575 } 10576 }); 10577 return branches; 10578 } 10579 function explodeOptionalSegments(path) { 10580 let segments = path.split("/"); 10581 if (segments.length === 0) return []; 10582 let [first, ...rest] = segments; 10583 let isOptional = first.endsWith("?"); 10584 let required = first.replace(/\?$/, ""); 10585 if (rest.length === 0) { 10586 return isOptional ? [required, ""] : [required]; 10587 }
10588 let restExploded = explodeOptionalSegments(rest.join("/")); 10589 let result = []; 10590 result.push(...restExploded.map((subpath) => subpath === "" ? required : [required, subpath].join("/"))); 10591 if (isOptional) { 10592 result.push(...restExploded); 10593 } 10594 return result.map((exploded) => path.startsWith("/") && exploded === "" ? "/" : exploded); 10595 } 10596 function rankRouteBranches(branches) { 10597 branches.sort((a2, b2) => a2.score !== b2.score ? b2.score - a2.score : compareIndexes(a2.routesMeta.map((meta) => meta.childrenIndex), b2.routesMeta.map((meta) => meta.childrenIndex))); 10598 } 10599 const paramRe = /^:[\w-]+$/; 10600 const dynamicSegmentValue = 3; 10601 const indexRouteValue = 2; 10602 const emptySegmentValue = 1; 10603 const staticSegmentValue = 10; 10604 const splatPenalty = -2; 10605 const isSplat = (s2) => s2 === "*"; 10606 function computeScore(path, index2) { 10607 let segments = path.split("/"); 10608 let initialScore = segments.length; 10609 if (segments.some(isSplat)) { 10610 initialScore += splatPenalty; 10611 } 10612 if (index2) { 10613 initialScore += indexRouteValue; 10614 } 10615 return segments.filter((s2) => !isSplat(s2)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore); 10616 } 10617 function compareIndexes(a2, b2) { 10618 let siblings = a2.length === b2.length && a2.slice(0, -1).every((n2, i2) => n2 === b2[i2]); 10619 return siblings ? ( 10620 // If two routes are siblings, we should try to match the earlier sibling 10621 // first. This allows people to have fine-grained control over the matching 10622 // behavior by simply putting routes with identical paths in the order they 10623 // want them tried. 10624 a2[a2.length - 1] - b2[b2.length - 1] 10625 ) : ( 10626 // Otherwise, it doesn't really make sense to rank non-siblings by index, 10627 // so they sort equally. 10628 0 10629 ); 10630 } 10631 function matchRouteBranch(branch, pathname, allowPartial) { 10632 let { 10633 routesMeta 10634 } = branch; 10635 let matchedParams = {}; 10636 let matchedPathname = "/"; 10637 let matches2 = []; 10638 for (let i2 = 0; i2 < routesMeta.length; ++i2) { 10639 let meta = routesMeta[i2]; 10640 let end = i2 === routesMeta.length - 1; 10641 let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/"; 10642 let match2 = matchPath({ 10643 path: meta.relativePath, 10644 caseSensitive: meta.caseSensitive, 10645 end 10646 }, remainingPathname); 10647 let route = meta.route; 10648 if (!match2) { 10649 return null; 10650 } 10651 Object.assign(matchedParams, match2.params); 10652 matches2.push({ 10653 // TODO: Can this as be avoided? 10654 params: matchedParams, 10655 pathname: joinPaths([matchedPathname, match2.pathname]), 10656 pathnameBase: normalizePathname(joinPaths([matchedPathname, match2.pathnameBase])), 10657 route 10658 }); 10659 if (match2.pathnameBase !== "/") { 10660 matchedPathname = joinPaths([matchedPathname, match2.pathnameBase]); 10661 } 10662 } 10663 return matches2; 10664 } 10665 function matchPath(pattern, pathname) { 10666 if (typeof pattern === "string") { 10667 pattern = { 10668 path: pattern, 10669 caseSensitive: false, 10670 end: true 10671 }; 10672 } 10673 let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end); 10674 let match2 = pathname.match(matcher); 10675 if (!match2) return null; 10676 let matchedPathname = match2[0]; 10677 let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1"); 10678 let captureGroups = match2.slice(1); 10679 let params = compiledParams.reduce((memo2, _ref2, index2) => { 10680 let { 10681 paramName, 10682 isOptional 10683 } = _ref2; 10684 if (paramName === "*") { 10685 let splatValue = captureGroups[index2] || ""; 10686 pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1"); 10687 } 10688 const value = captureGroups[index2]; 10689 if (isOptional && !value) { 10690 memo2[paramName] = void 0; 10691 } else { 10692 memo2[paramName] = (value || "").replace(/%2F/g, "/"); 10693 } 10694 return memo2; 10695 }, {}); 10696 return { 10697 params, 10698 pathname: matchedPathname, 10699 pathnameBase, 10700 pattern 10701 }; 10702 } 10703 function compilePath(path, caseSensitive, end) { 10704 if (caseSensitive === void 0) { 10705 caseSensitive = false;
10706 } 10707 if (end === void 0) { 10708 end = true; 10709 } 10710 warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), 'Route path "' + path + '" will be treated as if it were ' + ('"' + path.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + path.replace(/\*$/, "/*") + '".')); 10711 let params = []; 10712 let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (_2, paramName, isOptional) => { 10713 params.push({ 10714 paramName, 10715 isOptional: isOptional != null 10716 }); 10717 return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)"; 10718 }); 10719 if (path.endsWith("*")) { 10720 params.push({ 10721 paramName: "*" 10722 }); 10723 regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$"; 10724 } else if (end) { 10725 regexpSource += "\\/*$"; 10726 } else if (path !== "" && path !== "/") { 10727 regexpSource += "(?:(?=\\/|$))"; 10728 } else ; 10729 let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i"); 10730 return [matcher, params]; 10731 } 10732 function decodePath(value) { 10733 try { 10734 return value.split("/").map((v2) => decodeURIComponent(v2).replace(/\//g, "%2F")).join("/"); 10735 } catch (error) { 10736 warning(false, 'The URL path "' + value + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + error + ").")); 10737 return value; 10738 } 10739 } 10740 function stripBasename(pathname, basename) { 10741 if (basename === "/") return pathname; 10742 if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) { 10743 return null; 10744 } 10745 let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length; 10746 let nextChar = pathname.charAt(startIndex); 10747 if (nextChar && nextChar !== "/") { 10748 return null; 10749 } 10750 return pathname.slice(startIndex) || "/"; 10751 } 10752 function resolvePath(to2, fromPathname) { 10753 if (fromPathname === void 0) { 10754 fromPathname = "/"; 10755 } 10756 let { 10757 pathname: toPathname, 10758 search = "", 10759 hash: hash2 = "" 10760 } = typeof to2 === "string" ? parsePath(to2) : to2; 10761 let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname; 10762 return { 10763 pathname, 10764 search: normalizeSearch(search), 10765 hash: normalizeHash(hash2) 10766 }; 10767 } 10768 function resolvePathname(relativePath, fromPathname) { 10769 let segments = fromPathname.replace(/\/+$/, "").split("/"); 10770 let relativeSegments = relativePath.split("/"); 10771 relativeSegments.forEach((segment) => { 10772 if (segment === "..") { 10773 if (segments.length > 1) segments.pop(); 10774 } else if (segment !== ".") { 10775 segments.push(segment); 10776 } 10777 }); 10778 return segments.length > 1 ? segments.join("/") : "/"; 10779 } 10780 function getInvalidPathError(char2, field, dest, path) { 10781 return "Cannot include a '" + char2 + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.'; 10782 } 10783 function getPathContributingMatches(matches2) { 10784 return matches2.filter((match2, index2) => index2 === 0 || match2.route.path && match2.route.path.length > 0); 10785 } 10786 function getResolveToMatches(matches2, v7_relativeSplatPath) { 10787 let pathMatches = getPathContributingMatches(matches2); 10788 if (v7_relativeSplatPath) { 10789 return pathMatches.map((match2, idx) => idx === pathMatches.length - 1 ? match2.pathname : match2.pathnameBase); 10790 } 10791 return pathMatches.map((match2) => match2.pathnameBase); 10792 } 10793 function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) { 10794 if (isPathRelative === void 0) { 10795 isPathRelative = false;
10796 } 10797 let to2; 10798 if (typeof toArg === "string") { 10799 to2 = parsePath(toArg); 10800 } else { 10801 to2 = _extends$9({}, toArg); 10802 invariant$1(!to2.pathname || !to2.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to2)); 10803 invariant$1(!to2.pathname || !to2.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to2)); 10804 invariant$1(!to2.search || !to2.search.includes("#"), getInvalidPathError("#", "search", "hash", to2)); 10805 } 10806 let isEmptyPath = toArg === "" || to2.pathname === ""; 10807 let toPathname = isEmptyPath ? "/" : to2.pathname; 10808 let from2; 10809 if (toPathname == null) { 10810 from2 = locationPathname; 10811 } else { 10812 let routePathnameIndex = routePathnames.length - 1; 10813 if (!isPathRelative && toPathname.startsWith("..")) { 10814 let toSegments = toPathname.split("/"); 10815 while (toSegments[0] === "..") { 10816 toSegments.shift(); 10817 routePathnameIndex -= 1; 10818 } 10819 to2.pathname = toSegments.join("/"); 10820 } 10821 from2 = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/"; 10822 } 10823 let path = resolvePath(to2, from2); 10824 let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); 10825 let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/"); 10826 if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) { 10827 path.pathname += "/"; 10828 } 10829 return path; 10830 } 10831 const joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/"); 10832 const normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/"); 10833 const normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search; 10834 const normalizeHash = (hash2) => !hash2 || hash2 === "#" ? "" : hash2.startsWith("#") ? hash2 : "#" + hash2; 10835 function isRouteErrorResponse(error) { 10836 return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error; 10837 } 10838 const validMutationMethodsArr = ["post", "put", "patch", "delete"]; 10839 new Set(validMutationMethodsArr); 10840 const validRequestMethodsArr = ["get", ...validMutationMethodsArr]; 10841 new Set(validRequestMethodsArr); 10842 /** 10843 * React Router v6.29.0 10844 * 10845 * Copyright (c) Remix Software Inc. 10846 * 10847 * This source code is licensed under the MIT license found in the 10848 * LICENSE.md file in the root directory of this source tree. 10849 * 10850 * @license MIT 10851 */ 10852 function _extends$8() { 10853 _extends$8 = Object.assign ? Object.assign.bind() : function(target) { 10854 for (var i2 = 1; i2 < arguments.length; i2++) { 10855 var source = arguments[i2]; 10856 for (var key in source) { 10857 if (Object.prototype.hasOwnProperty.call(source, key)) { 10858 target[key] = source[key]; 10859 } 10860 } 10861 } 10862 return target; 10863 }; 10864 return _extends$8.apply(this, arguments); 10865 } 10866 const DataRouterContext = /* @__PURE__ */ reactExports.createContext(null); 10867 const DataRouterStateContext = /* @__PURE__ */ reactExports.createContext(null); 10868 const NavigationContext = /* @__PURE__ */ reactExports.createContext(null); 10869 const LocationContext = /* @__PURE__ */ reactExports.createContext(null); 10870 const RouteContext = /* @__PURE__ */ reactExports.createContext({ 10871 outlet: null, 10872 matches: [], 10873 isDataRoute: false 10874 }); 10875 const RouteErrorContext = /* @__PURE__ */ reactExports.createContext(null); 10876 function useHref(to2, _temp) { 10877 let { 10878 relative 10879 } = _temp === void 0 ? {} : _temp; 10880 !useInRouterContext() ? invariant$1(false) : void 0; 10881 let { 10882 basename, 10883 navigator: navigator2 10884 } = reactExports.useContext(NavigationContext); 10885 let { 10886 hash: hash2, 10887 pathname, 10888 search 10889 } = useResolvedPath(to2, { 10890 relative 10891 }); 10892 let joinedPathname = pathname; 10893 if (basename !== "/") { 10894 joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]); 10895 } 10896 return navigator2.createHref({ 10897 pathname: joinedPathname, 10898 search, 10899 hash: hash2 10900 }); 10901 } 10902 function useInRouterContext() { 10903 return reactExports.useContext(LocationContext) != null; 10904 } 10905 function useLocation() { 10906 !useInRouterContext() ? invariant$1(false) : void 0; 10907 return reactExports.useContext(LocationContext).location; 10908 } 10909 function useNavigationType() { 10910 return reactExports.useContext(LocationContext).navigationType; 10911 } 10912 function useIsomorphicLayoutEffect$4(cb) { 10913 let isStatic = reactExports.useContext(NavigationContext).static; 10914 if (!isStatic) { 10915 reactExports.useLayoutEffect(cb); 10916 } 10917 } 10918 function useNavigate() { 10919 let { 10920 isDataRoute 10921 } = reactExports.useContext(RouteContext); 10922 return isDataRoute ? useNavigateStable() : useNavigateUnstable(); 10923 } 10924 function useNavigateUnstable() { 10925 !useInRouterContext() ? invariant$1(false) : void 0; 10926 let dataRouterContext = reactExports.useContext(DataRouterContext); 10927 let { 10928 basename, 10929 future, 10930 navigator: navigator2 10931 } = reactExports.useContext(NavigationContext); 10932 let { 10933 matches: matches2 10934 } = reactExports.useContext(RouteContext); 10935 let { 10936 pathname: locationPathname 10937 } = useLocation(); 10938 let routePathnamesJson = JSON.stringify(getResolveToMatches(matches2, future.v7_relativeSplatPath)); 10939 let activeRef = reactExports.useRef(false); 10940 useIsomorphicLayoutEffect$4(() => { 10941 activeRef.current = true; 10942 }); 10943 let navigate = reactExports.useCallback(function(to2, options2) { 10944 if (options2 === void 0) { 10945 options2 = {}; 10946 } 10947 if (!activeRef.current) return; 10948 if (typeof to2 === "number") { 10949 navigator2.go(to2); 10950 return; 10951 } 10952 let path = resolveTo(to2, JSON.parse(routePathnamesJson), locationPathname, options2.relative === "path"); 10953 if (dataRouterContext == null && basename !== "/") { 10954 path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); 10955 } 10956 (!!options2.replace ? navigator2.replace : navigator2.push)(path, options2.state, options2); 10957 }, [basename, navigator2, routePathnamesJson, locationPathname, dataRouterContext]); 10958 return navigate; 10959 } 10960 const OutletContext = /* @__PURE__ */ reactExports.createContext(null); 10961 function useOutlet(context) { 10962 let outlet = reactExports.useContext(RouteContext).outlet; 10963 if (outlet) { 10964 return /* @__PURE__ */ reactExports.createElement(OutletContext.Provider, { 10965 value: context 10966 }, outlet); 10967 } 10968 return outlet; 10969 } 10970 function useResolvedPath(to2, _temp2) { 10971 let { 10972 relative 10973 } = _temp2 === void 0 ? {}
10973 : _temp2; 10974 let { 10975 future 10976 } = reactExports.useContext(NavigationContext); 10977 let { 10978 matches: matches2 10979 } = reactExports.useContext(RouteContext); 10980 let { 10981 pathname: locationPathname 10982 } = useLocation(); 10983 let routePathnamesJson = JSON.stringify(getResolveToMatches(matches2, future.v7_relativeSplatPath)); 10984 return reactExports.useMemo(() => resolveTo(to2, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to2, routePathnamesJson, locationPathname, relative]); 10985 } 10986 function useRoutes(routes2, locationArg) { 10987 return useRoutesImpl(routes2, locationArg); 10988 } 10989 function useRoutesImpl(routes2, locationArg, dataRouterState, future) { 10990 !useInRouterContext() ? invariant$1(false) : void 0; 10991 let { 10992 navigator: navigator2, 10993 static: isStatic 10994 } = reactExports.useContext(NavigationContext); 10995 let { 10996 matches: parentMatches 10997 } = reactExports.useContext(RouteContext); 10998 let routeMatch = parentMatches[parentMatches.length - 1]; 10999 let parentParams = routeMatch ? routeMatch.params : {}; 11000 routeMatch ? routeMatch.pathname : "/"; 11001 let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/"; 11002 routeMatch && routeMatch.route; 11003 let locationFromContext = useLocation(); 11004 let location; 11005 if (locationArg) { 11006 var _parsedLocationArg$pa; 11007 let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; 11008 !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? invariant$1(false) : void 0; 11009 location = parsedLocationArg; 11010 } else { 11011 location = locationFromContext; 11012 } 11013 let pathname = location.pathname || "/"; 11014 let remainingPathname = pathname; 11015 if (parentPathnameBase !== "/") { 11016 let parentSegments = parentPathnameBase.replace(/^\//, "").split("/"); 11017 let segments = pathname.replace(/^\//, "").split("/"); 11018 remainingPathname = "/" + segments.slice(parentSegments.length).join("/"); 11019 } 11020 let matches2 = matchRoutes(routes2, { 11021 pathname: remainingPathname 11022 }); 11023 let renderedMatches = _renderMatches(matches2 && matches2.map((match2) => Object.assign({}, match2, { 11024 params: Object.assign({}, parentParams, match2.params), 11025 pathname: joinPaths([ 11026 parentPathnameBase, 11027 // Re-encode pathnames that were decoded inside matchRoutes 11028 navigator2.encodeLocation ? navigator2.encodeLocation(match2.pathname).pathname : match2.pathname 11029 ]), 11030 pathnameBase: match2.pathnameBase === "/" ? parentPathnameBase : joinPaths([ 11031 parentPathnameBase, 11032 // Re-encode pathnames that were decoded inside matchRoutes 11033 navigator2.encodeLocation ? navigator2.encodeLocation(match2.pathnameBase).pathname : match2.pathnameBase 11034 ]) 11035 })), parentMatches, dataRouterState, future); 11036 if (locationArg && renderedMatches) { 11037 return /* @__PURE__ */ reactExports.createElement(LocationContext.Provider, { 11038 value: { 11039 location: _extends$8({ 11040 pathname: "/", 11041 search: "", 11042 hash: "", 11043 state: null, 11044 key: "default" 11045 }, location), 11046 navigationType: Action.Pop 11047 } 11048 }, renderedMatches); 11049 } 11050 return renderedMatches; 11051 } 11052 function DefaultErrorComponent() { 11053 let error = useRouteError(); 11054 let message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error); 11055 let stack = error instanceof Error ? error.stack : null; 11056 let lightgrey = "rgba(200,200,200, 0.5)"; 11057 let preStyles = { 11058 padding: "0.5rem", 11059 backgroundColor: lightgrey 11060 }; 11061 let devInfo = null; 11062 return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement("h2", null, "Unexpected Application
11062Error!"), /* @__PURE__ */ reactExports.createElement("h3", { 11063 style: { 11064 fontStyle: "italic" 11065 } 11066 }, message), stack ? /* @__PURE__ */ reactExports.createElement("pre", { 11067 style: preStyles 11068 }, stack) : null, devInfo); 11069 } 11070 const defaultErrorElement = /* @__PURE__ */ reactExports.createElement(DefaultErrorComponent, null); 11071 class RenderErrorBoundary extends reactExports.Component { 11072 constructor(props) { 11073 super(props); 11074 this.state = { 11075 location: props.location, 11076 revalidation: props.revalidation, 11077 error: props.error 11078 }; 11079 } 11080 static getDerivedStateFromError(error) { 11081 return { 11082 error 11083 }; 11084 } 11085 static getDerivedStateFromProps(props, state) { 11086 if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") { 11087 return { 11088 error: props.error, 11089 location: props.location, 11090 revalidation: props.revalidation 11091 }; 11092 } 11093 return { 11094 error: props.error !== void 0 ? props.error : state.error, 11095 location: state.location, 11096 revalidation: props.revalidation || state.revalidation 11097 }; 11098 } 11099 componentDidCatch(error, errorInfo) { 11100 console.error("React Router caught the following error during render", error, errorInfo); 11101 } 11102 render() { 11103 return this.state.error !== void 0 ? /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { 11104 value: this.props.routeContext 11105 }, /* @__PURE__ */ reactExports.createElement(RouteErrorContext.Provider, { 11106 value: this.state.error, 11107 children: this.props.component 11108 })) : this.props.children; 11109 } 11110 }
11111 function RenderedRoute(_ref2) { 11112 let { 11113 routeContext, 11114 match: match2, 11115 children 11116 } = _ref2; 11117 let dataRouterContext = reactExports.useContext(DataRouterContext); 11118 if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match2.route.errorElement || match2.route.ErrorBoundary)) { 11119 dataRouterContext.staticContext._deepestRenderedBoundaryId = match2.route.id; 11120 } 11121 return /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { 11122 value: routeContext 11123 }, children); 11124 } 11125 function _renderMatches(matches2, parentMatches, dataRouterState, future) { 11126 var _dataRouterState; 11127 if (parentMatches === void 0) { 11128 parentMatches = []; 11129 } 11130 if (dataRouterState === void 0) { 11131 dataRouterState = null; 11132 } 11133 if (future === void 0) { 11134 future = null; 11135 } 11136 if (matches2 == null) { 11137 var _future; 11138 if (!dataRouterState) { 11139 return null; 11140 } 11141 if (dataRouterState.errors) { 11142 matches2 = dataRouterState.matches; 11143 } else if ((_future = future) != null && _future.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) { 11144 matches2 = dataRouterState.matches; 11145 } else { 11146 return null; 11147 } 11148 } 11149 let renderedMatches = matches2; 11150 let errors = (_dataRouterState = dataRouterState) == null ? void 0 : _dataRouterState.errors; 11151 if (errors != null) { 11152 let errorIndex = renderedMatches.findIndex((m2) => m2.route.id && (errors == null ? void 0 : errors[m2.route.id]) !== void 0); 11153 !(errorIndex >= 0) ? invariant$1(false) : void 0; 11154 renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1)); 11155 } 11156 let renderFallback = false; 11157 let fallbackIndex = -1; 11158 if (dataRouterState && future && future.v7_partialHydration) { 11159 for (let i2 = 0; i2 < renderedMatches.length; i2++) { 11160 let match2 = renderedMatches[i2]; 11161 if (match2.route.HydrateFallback || match2.route.hydrateFallbackElement) { 11162 fallbackIndex = i2; 11163 } 11164 if (match2.route.id) { 11165 let { 11166 loaderData, 11167 errors: errors2 11168 } = dataRouterState; 11169 let needsToRunLoader = match2.route.loader && loaderData[match2.route.id] === void 0 && (!errors2 || errors2[match2.route.id] === void 0); 11170 if (match2.route.lazy || needsToRunLoader) { 11171 renderFallback = true; 11172 if (fallbackIndex >= 0) { 11173 renderedMatches = renderedMatches.slice(0, fallbackIndex + 1); 11174 } else { 11175 renderedMatches = [renderedMatches[0]]; 11176 } 11177 break; 11178 } 11179 } 11180 } 11181 } 11182 return renderedMatches.reduceRight((outlet, match2, index2) => { 11183 let error; 11184 let shouldRenderHydrateFallback = false; 11185 let errorElement = null; 11186 let hydrateFallbackElement = null; 11187 if (dataRouterState) { 11188 error = errors && match2.route.id ? errors[match2.route.id] : void 0; 11189 errorElement = match2.route.errorElement || defaultErrorElement; 11190 if (renderFallback) { 11191 if (fallbackIndex < 0 && index2 === 0) { 11192 warningOnce("route-fallback"); 11193 shouldRenderHydrateFallback = true; 11194 hydrateFallbackElement = null; 11195 } else if (fallbackIndex === index2) { 11196 shouldRenderHydrateFallback = true; 11197 hydrateFallbackElement = match2.route.hydrateFallbackElement || null; 11198 } 11199 } 11200 } 11201 let matches22 = parentMatches.concat(renderedMatches.slice(0, index2 + 1)); 11202 let getChildren2 = () => { 11203 let children; 11204 if (error) { 11205 children = errorElement; 11206 } else if (shouldRenderHydrateFallback) { 11207 children = hydrateFallbackElement; 11208 } else if (match2.route.Component) { 11209 children = /* @__PURE__ */ reactExports.createElement(match2.route.Component, null); 11210 } else if (match2.route.element) { 11211 children = match2.route.element; 11212 } else { 11213 children = outlet; 11214 } 11215 return /* @__PURE__ */ reactExports.createElement(RenderedRoute, { 11216 match: match2,
11217 routeContext: { 11218 outlet, 11219 matches: matches22, 11220 isDataRoute: dataRouterState != null 11221 }, 11222 children 11223 }); 11224 }; 11225 return dataRouterState && (match2.route.ErrorBoundary || match2.route.errorElement || index2 === 0) ? /* @__PURE__ */ reactExports.createElement(RenderErrorBoundary, { 11226 location: dataRouterState.location, 11227 revalidation: dataRouterState.revalidation, 11228 component: errorElement, 11229 error, 11230 children: getChildren2(), 11231 routeContext: { 11232 outlet: null, 11233 matches: matches22, 11234 isDataRoute: true 11235 } 11236 }) : getChildren2(); 11237 }, null); 11238 } 11239 var DataRouterHook$1 = /* @__PURE__ */ (function(DataRouterHook2) { 11240 DataRouterHook2["UseBlocker"] = "useBlocker"; 11241 DataRouterHook2["UseRevalidator"] = "useRevalidator"; 11242 DataRouterHook2["UseNavigateStable"] = "useNavigate"; 11243 return DataRouterHook2; 11244 })(DataRouterHook$1 || {}); 11245 var DataRouterStateHook$1 = /* @__PURE__ */ (function(DataRouterStateHook2) { 11246 DataRouterStateHook2["UseBlocker"] = "useBlocker"; 11247 DataRouterStateHook2["UseLoaderData"] = "useLoaderData"; 11248 DataRouterStateHook2["UseActionData"] = "useActionData"; 11249 DataRouterStateHook2["UseRouteError"] = "useRouteError"; 11250 DataRouterStateHook2["UseNavigation"] = "useNavigation"; 11251 DataRouterStateHook2["UseRouteLoaderData"] = "useRouteLoaderData"; 11252 DataRouterStateHook2["UseMatches"] = "useMatches"; 11253 DataRouterStateHook2["UseRevalidator"] = "useRevalidator"; 11254 DataRouterStateHook2["UseNavigateStable"] = "useNavigate"; 11255 DataRouterStateHook2["UseRouteId"] = "useRouteId"; 11256 return DataRouterStateHook2; 11257 })(DataRouterStateHook$1 || {}); 11258 function useDataRouterContext(hookName) { 11259 let ctx = reactExports.useContext(DataRouterContext); 11260 !ctx ? invariant$1(false) : void 0; 11261 return ctx; 11262 } 11263 function useDataRouterState(hookName) { 11264 let state = reactExports.useContext(DataRouterStateContext); 11265 !state ? invariant$1(false) : void 0; 11266 return state; 11267 } 11268 function useRouteContext(hookName) { 11269 let route = reactExports.useContext(RouteContext); 11270 !route ? invariant$1(false) : void 0; 11271 return route; 11272 } 11273 function useCurrentRouteId(hookName) { 11274 let route = useRouteContext(); 11275 let thisRoute = route.matches[route.matches.length - 1]; 11276 !thisRoute.route.id ? invariant$1(false) : void 0; 11277 return thisRoute.route.id; 11278 } 11279 function useRouteError() { 11280 var _state$errors; 11281 let error = reactExports.useContext(RouteErrorContext); 11282 let state = useDataRouterState(); 11283 let routeId = useCurrentRouteId(); 11284 if (error !== void 0) { 11285 return error; 11286 } 11287 return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId]; 11288 } 11289 function useNavigateStable() { 11290 let { 11291 router 11292 } = useDataRouterContext(DataRouterHook$1.UseNavigateStable); 11293 let id2 = useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable); 11294 let activeRef = reactExports.useRef(false); 11295 useIsomorphicLayoutEffect$4(() => { 11296 activeRef.current = true; 11297 }); 11298 let navigate = reactExports.useCallback(function(to2, options2) { 11299 if (options2 === void 0) { 11300 options2 = {}; 11301 } 11302 if (!activeRef.current) return; 11303 if (typeof to2 === "number") { 11304 router.navigate(to2); 11305 } else { 11306 router.navigate(to2, _extends$8({ 11307 fromRouteId: id2 11308 }, options2)); 11309 } 11310 }, [router, id2]); 11311 return navigate; 11312 } 11313 const alreadyWarned$1 = {}; 11314 function warningOnce(key, cond, message) { 11315 if (!alreadyWarned$1[key]) { 11316 alreadyWarned$1[key] = true; 11317 } 11318 } 11319 function logV6DeprecationWarnings(renderFuture, routerFuture) { 11320 if ((renderFuture == null ? void 0 : renderFuture.v7_startTransition) === void 0) ; 11321 if ((renderFuture == null ? void 0 : renderFuture.v7_relativeSplatPath) === void 0 && true) ; 11322 } 11323 function Navigate(_ref4) { 11324 let { 11325 to: to2, 11326 replace: replace2, 11327 state, 11328 relative 11329 } = _ref4; 11330 !useInRouterContext() ? invariant$1(false) : void 0; 11331 let { 11332 future, 11333 static: isStatic 11334 } = reactExports.useContext(NavigationContext); 11335 let { 11336 matches: matches2 11337 } = reactExports.useContext(RouteContext); 11338 let { 11339 pathname: locationPathname 11340 } = useLocation(); 11341 let navigate = useNavigate(); 11342 let path = resolveTo(to2, getResolveToMatches(matches2, future.v7_relativeSplatPath), locationPathname, relative === "path"); 11343 let jsonPath = JSON.stringify(path); 11344 reactExports.useEffect(() => navigate(JSON.parse(jsonPath), { 11345 replace: replace2, 11346 state, 11347 relative 11348 }), [navigate, jsonPath, relative, replace2, state]); 11349 return null; 11350 } 11351 function Outlet(props) { 11352 return useOutlet(props.context); 11353 } 11354 function Route(_props) { 11355 invariant$1(false); 11356 } 11357 function Router(_ref5) { 11358 let { 11359 basename: basenameProp = "/", 11360 children = null, 11361 location: locationProp, 11362 navigationType = Action.Pop, 11363 navigator: navigator2, 11364 static: staticProp = false, 11365 future 11366 } = _ref5; 11367 !!useInRouterContext() ? invariant$1(false) : void 0; 11368 let basename = basenameProp.replace(/^\/*/, "/"); 11369 let navigationContext = reactExports.useMemo(() => ({ 11370 basename, 11371 navigator: navigator2, 11372 static: staticProp, 11373 future: _extends$8({
11374 v7_relativeSplatPath: false 11375 }, future) 11376 }), [basename, future, navigator2, staticProp]); 11377 if (typeof locationProp === "string") { 11378 locationProp = parsePath(locationProp); 11379 } 11380 let { 11381 pathname = "/", 11382 search = "", 11383 hash: hash2 = "", 11384 state = null, 11385 key = "default" 11386 } = locationProp; 11387 let locationContext = reactExports.useMemo(() => { 11388 let trailingPathname = stripBasename(pathname, basename); 11389 if (trailingPathname == null) { 11390 return null; 11391 } 11392 return { 11393 location: { 11394 pathname: trailingPathname, 11395 search, 11396 hash: hash2, 11397 state, 11398 key 11399 }, 11400 navigationType 11401 }; 11402 }, [basename, pathname, search, hash2, state, key, navigationType]); 11403 if (locationContext == null) { 11404 return null; 11405 } 11406 return /* @__PURE__ */ reactExports.createElement(NavigationContext.Provider, { 11407 value: navigationContext 11408 }, /* @__PURE__ */ reactExports.createElement(LocationContext.Provider, { 11409 children, 11410 value: locationContext 11411 })); 11412 } 11413 function Routes(_ref6) { 11414 let { 11415 children, 11416 location 11417 } = _ref6; 11418 return useRoutes(createRoutesFromChildren(children), location); 11419 } 11420 new Promise(() => { 11421 }); 11422 function createRoutesFromChildren(children, parentPath) { 11423 if (parentPath === void 0) { 11424 parentPath = []; 11425 } 11426 let routes2 = []; 11427 reactExports.Children.forEach(children, (element, index2) => { 11428 if (!/* @__PURE__ */ reactExports.isValidElement(element)) { 11429 return; 11430 } 11431 let treePath = [...parentPath, index2]; 11432 if (element.type === reactExports.Fragment) { 11433 routes2.push.apply(routes2, createRoutesFromChildren(element.props.children, treePath)); 11434 return; 11435 } 11436 !(element.type === Route) ? invariant$1(false) : void 0; 11437 !(!element.props.index || !element.props.children) ? invariant$1(false) : void 0; 11438 let route = { 11439 id: element.props.id || treePath.join("-"), 11440 caseSensitive: element.props.caseSensitive, 11441 element: element.props.element, 11442 Component: element.props.Component, 11443 index: element.props.index, 11444 path: element.props.path, 11445 loader: element.props.loader, 11446 action: element.props.action, 11447 errorElement: element.props.errorElement, 11448 ErrorBoundary: element.props.ErrorBoundary, 11449 hasErrorBoundary: element.props.ErrorBoundary != null || element.props.errorElement != null, 11450 shouldRevalidate: element.props.shouldRevalidate, 11451 handle: element.props.handle, 11452 lazy: element.props.lazy 11453 }; 11454 if (element.props.children) { 11455 route.children = createRoutesFromChildren(element.props.children, treePath); 11456 } 11457 routes2.push(route); 11458 }); 11459 return routes2; 11460 } 11461 /** 11462 * React Router DOM v6.29.0 11463 * 11464 * Copyright (c) Remix Software Inc. 11465 * 11466 * This source code is licensed under the MIT license found in the 11467 * LICENSE.md file in the root directory of this source tree. 11468 * 11469 * @license MIT 11470 */ 11471 function _extends$7() { 11472 _extends$7 = Object.assign ? Object.assign.bind() : function(target) { 11473 for (var i2 = 1; i2 < arguments.length; i2++) { 11474 var source = arguments[i2]; 11475 for (var key in source) { 11476 if (Object.prototype.hasOwnProperty.call(source, key)) { 11477 target[key] = source[key]; 11478 } 11479 } 11480 } 11481 return target; 11482 }; 11483 return _extends$7.apply(this, arguments); 11484 } 11485 function _objectWithoutPropertiesLoose$3(source, excluded) { 11486 if (source == null) return {}; 11487 var target = {}; 11488 var sourceKeys = Object.keys(source); 11489 var key, i2; 11490 for (i2 = 0; i2 < sourceKeys.length; i2++) { 11491 key = sourceKeys[i2]; 11492 if (excluded.indexOf(key) >= 0) continue; 11493 target[key] = source[key]; 11494 } 11495 return target; 11496 } 11497 function isModifiedEvent(event) { 11498 return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); 11499 } 11500 function shouldProcessLinkClick(event, target) { 11501 return event.button === 0 && // Ignore everything but left clicks 11502 (!target || target === "_self") && // Let browser handle "target=_blank" etc. 11503 !isModifiedEvent(event); 11504 } 11505 function createSearchParams(init2) { 11506 if (init2 === void 0) { 11507 init2 = ""; 11508 } 11509 return new URLSearchParams(typeof init2 === "string" || Array.isArray(init2) || init2 instanceof URLSearchParams ? init2 : Object.keys(init2).reduce((memo2, key) => { 11510 let value = init2[key]; 11511 return memo2.concat(Array.isArray(value) ? value.map((v2) => [key, v2]) : [[key, value]]); 11512 }, [])); 11513 } 11514 function getSearchParamsForLocation(locationSearch, defaultSearchParams) { 11515 let searchParams = createSearchParams(locationSearch); 11516 if (defaultSearchParams) {
11517 defaultSearchParams.forEach((_2, key) => { 11518 if (!searchParams.has(key)) { 11519 defaultSearchParams.getAll(key).forEach((value) => { 11520 searchParams.append(key, value); 11521 }); 11522 } 11523 }); 11524 } 11525 return searchParams; 11526 } 11527 const _excluded$1 = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"]; 11528 const REACT_ROUTER_VERSION = "6"; 11529 try { 11530 window.__reactRouterVersion = REACT_ROUTER_VERSION; 11531 } catch (e2) { 11532 } 11533 const START_TRANSITION = "startTransition"; 11534 const startTransitionImpl = React[START_TRANSITION]; 11535 function BrowserRouter(_ref4) { 11536 let { 11537 basename, 11538 children, 11539 future, 11540 window: window2 11541 } = _ref4; 11542 let historyRef = reactExports.useRef(); 11543 if (historyRef.current == null) { 11544 historyRef.current = createBrowserHistory({ 11545 window: window2, 11546 v5Compat: true 11547 }); 11548 } 11549 let history = historyRef.current; 11550 let [state, setStateImpl] = reactExports.useState({ 11551 action: history.action, 11552 location: history.location 11553 }); 11554 let { 11555 v7_startTransition 11556 } = future || {}; 11557 let setState = reactExports.useCallback((newState) => { 11558 v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); 11559 }, [setStateImpl, v7_startTransition]); 11560 reactExports.useLayoutEffect(() => history.listen(setState), [history, setState]); 11561 reactExports.useEffect(() => logV6DeprecationWarnings(future), [future]); 11562 return /* @__PURE__ */ reactExports.createElement(Router, { 11563 basename, 11564 children, 11565 location: state.location, 11566 navigationType: state.action, 11567 navigator: history, 11568 future 11569 }); 11570 } 11571 const isBrowser$1 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; 11572 const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; 11573 const Link = /* @__PURE__ */ reactExports.forwardRef(function LinkWithRef(_ref7, ref) { 11574 let { 11575 onClick, 11576 relative, 11577 reloadDocument, 11578 replace: replace2, 11579 state, 11580 target, 11581 to: to2, 11582 preventScrollReset, 11583 viewTransition 11584 } = _ref7, rest = _objectWithoutPropertiesLoose$3(_ref7, _excluded$1); 11585 let { 11586 basename 11587 } = reactExports.useContext(NavigationContext); 11588 let absoluteHref; 11589 let isExternal = false; 11590 if (typeof to2 === "string" && ABSOLUTE_URL_REGEX.test(to2)) { 11591 absoluteHref = to2; 11592 if (isBrowser$1) { 11593 try { 11594 let currentUrl = new URL(window.location.href); 11595 let targetUrl = to2.startsWith("//") ? new URL(currentUrl.protocol + to2) : new URL(to2); 11596 let path = stripBasename(targetUrl.pathname, basename); 11597 if (targetUrl.origin === currentUrl.origin && path != null) { 11598 to2 = path + targetUrl.search + targetUrl.hash; 11599 } else { 11600 isExternal = true; 11601 } 11602 } catch (e2) { 11603 } 11604 } 11605 } 11606 let href = useHref(to2, { 11607 relative 11608 }); 11609 let internalOnClick = useLinkClickHandler(to2, { 11610 replace: replace2, 11611 state, 11612 target, 11613 preventScrollReset, 11614 relative, 11615 viewTransition 11616 }); 11617 function handleClick(event) { 11618 if (onClick) onClick(event); 11619 if (!event.defaultPrevented) { 11620 internalOnClick(event); 11621 } 11622 } 11623 return ( 11624 // eslint-disable-next-line jsx-a11y/anchor-has-content
11625 /* @__PURE__ */ reactExports.createElement("a", _extends$7({}, rest, { 11626 href: absoluteHref || href, 11627 onClick: isExternal || reloadDocument ? onClick : handleClick, 11628 ref, 11629 target 11630 })) 11631 ); 11632 }); 11633 var DataRouterHook; 11634 (function(DataRouterHook2) { 11635 DataRouterHook2["UseScrollRestoration"] = "useScrollRestoration"; 11636 DataRouterHook2["UseSubmit"] = "useSubmit"; 11637 DataRouterHook2["UseSubmitFetcher"] = "useSubmitFetcher"; 11638 DataRouterHook2["UseFetcher"] = "useFetcher"; 11639 DataRouterHook2["useViewTransitionState"] = "useViewTransitionState"; 11640 })(DataRouterHook || (DataRouterHook = {})); 11641 var DataRouterStateHook; 11642 (function(DataRouterStateHook2) { 11643 DataRouterStateHook2["UseFetcher"] = "useFetcher"; 11644 DataRouterStateHook2["UseFetchers"] = "useFetchers"; 11645 DataRouterStateHook2["UseScrollRestoration"] = "useScrollRestoration"; 11646 })(DataRouterStateHook || (DataRouterStateHook = {})); 11647 function useLinkClickHandler(to2, _temp) { 11648 let { 11649 target, 11650 replace: replaceProp, 11651 state, 11652 preventScrollReset, 11653 relative, 11654 viewTransition 11655 } = _temp === void 0 ? {} : _temp; 11656 let navigate = useNavigate(); 11657 let location = useLocation(); 11658 let path = useResolvedPath(to2, { 11659 relative 11660 }); 11661 return reactExports.useCallback((event) => { 11662 if (shouldProcessLinkClick(event, target)) { 11663 event.preventDefault(); 11664 let replace2 = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path); 11665 navigate(to2, { 11666 replace: replace2, 11667 state, 11668 preventScrollReset, 11669 relative, 11670 viewTransition 11671 }); 11672 } 11673 }, [location, navigate, path, replaceProp, state, target, to2, preventScrollReset, relative, viewTransition]); 11674 } 11675 function useSearchParams(defaultInit) { 11676 let defaultSearchParamsRef = reactExports.useRef(createSearchParams(defaultInit)); 11677 let hasSetSearchParamsRef = reactExports.useRef(false); 11678 let location = useLocation(); 11679 let searchParams = reactExports.useMemo(() => ( 11680 // Only merge in the defaults if we haven't yet called setSearchParams. 11681 // Once we call that we want those to take precedence, otherwise you can't 11682 // remove a param with setSearchParams({}) if it has an initial value 11683 getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current) 11684 ), [location.search]); 11685 let navigate = useNavigate(); 11686 let setSearchParams = reactExports.useCallback((nextInit, navigateOptions) => { 11687 const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit); 11688 hasSetSearchParamsRef.current = true; 11689 navigate("?" + newSearchParams, navigateOptions); 11690 }, [navigate, searchParams]); 11691 return [searchParams, setSearchParams]; 11692 } 11693 const isNode$1 = () => typeof process !== "undefined" && !!process.versions && !!process.versions.node; 11694 var define_process_env_default$2 = {}; 11695 const getAdminOrigin = () => { 11696 var _a; 11697 const adminOrigin = isNode$1() ? define_process_env_default$2 == null ? void 0 : define_process_env_default$2.FW_ADMIN_ORIGIN : (_a = globalThis.__fw_env__) == null ? void 0 : _a.FW_ADMIN_ORIGIN; 11698 return adminOrigin || void 0; 11699 }; 11700 const isServedFromAdminOrigin = () => { 11701 var _a; 11702 const adminOrigin = getAdminOrigin(); 11703 return adminOrigin !== void 0 && ((_a = globalThis.location) == null ? void 0 : _a.origin) === adminOrigin; 11704 }; 11705 const getStoreBasePath = () => { 11706 var _a, _b, _c, _d; 11707 return (_d = (_c = /^\/store\/[a-z0-9][a-z0-9-]{0,62}(?=\/|$)/.exec((_b = (_a = globalThis.location) == null ? void 0 : _a.pathname) != null ? _b : "")) == null ? void 0 : _c[0]) != null ? _d : ""; 11708 }; 11709 const isHeadlessRenderingSurface = () => { 11710 var _a, _b; 11711 return ((_b = (_a = globalThis.location) == null ? void 0 : _a.pathname) != null ? _b : "").startsWith("/admin/v3/designer/rendering/"); 11712 }; 11713 const withAdminOriginBase = (getter, adminBase) => (suffix) => { 11714 if (!isServedFromAdminOrigin() || isHeadlessRenderingSurface()) { 11715 return getter(suffix); 11716 } 11717 const base = adminBase(); 11718 return suffix ? `${base}/${suffix}` : base; 11719 }; 11720 var define_process_env_default$1 = {}; 11721 const createEnvGetter = (key, options2 = { 11722 suffixAble: true 11723 }) => { 11724 const getValue2 = () => { 11725 var _a; 11726 if (isNode$1()) { 11727 const serverEnv = define_process_env_default$1 == null ? void 0 : define_process_env_default$1[`SERVER_${key}`]; 11728 return serverEnv || (define_process_env_default$1 == null ? void 0 : define_process_env_default$1[key]); 11729 } 11730 return (_a = globalThis.__fw_env__) == null ? void 0 : _a[key]; 11731 }; 11732 if (options2.suffixAble) { 11733 return (suffix) => { 11734 const value = getValue2(); 11735 if (!value) { 11736 throw new Error(`Missing variable [${key}]`); 11737 } 11738 if (suffix) { 11739 return `${value}/${suffix}`; 11740 } 11741 return value; 11742 }; 11743 } 11744 return () => { 11745 const value = getValue2(); 11746 if (!value) { 11747 throw new Error(`Missing variable [${key}]`); 11748 } 11749 return value; 11750 }; 11751 }; 11752 const getCsrfCookieName = () => { 11753 var _a; 11754 return ((_a = globalThis.location) == null ? void 0 : _a.protocol) === "http:" ? "XSRF-TOKEN" : "__Host-XSRF-TOKEN"; 11755 }; 11756 createEnvGetter("FW_BASE_URL"); 11757 const getBaseApiUrl = withAdminOriginBase(createEnvGetter("FW_BASE_API_URL"), getStoreBasePath); 11758 withAdminOriginBase(createEnvGetter("FW_BASE_API_URL"), () => ""); 11759 createEnvGetter("FW_BASE_API_URL"); 11760 withAdminOriginBase(createEnvGetter("FW_MEMBERSHIPS_API_URL"), () => `${getStoreBasePath()}/membership`); 11761 withAdminOriginBase(createEnvGetter("FW_SHOP_RENDERER_API_URL"), () => `${getStoreBasePath()}/sr`); 11762 createEnvGetter("FW_AUTH_URL"); 11763 withAdminOriginBase(createEnvGetter("FW_CHATBOT_URL"), () => `${getStoreBasePath()}/chatbot`); 11764 withAdminOriginBase(createEnvGetter("FW_OMNI_URL"), () => `${getStoreBasePath()}/omni`); 11765 const getCurrentEnvironment = createEnvGetter("FW_ENV", { suffixAble: false }); 11766 const getSentryDsn = createEnvGetter("FW_SENTRY_DSN"); 11767 const getCommitHash = createEnvGetter("FW_COMMIT_HASH"); 11768 createEnvGetter("FW_REGISTER_URL"); 11769 createEnvGetter("FW_PRODUCT_CATALOG_URL"); 11770 const DEBUG_BUILD$3 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; 11771 const SDK_VERSION = "8.55.0"; 11772 const GLOBAL_OBJ = globalThis; 11773 function getGlobalSingleton(name, creator, obj) { 11774 const gbl = obj || GLOBAL_OBJ; 11775 const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {}; 11776 const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; 11777 return versionedCarrier[name] || (versionedCarrier[name] = creator()); 11778 } 11779 const DEBUG_BUILD$2 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; 11780 const PREFIX = "Sentry Logger "; 11781 const CONSOLE_LEVELS = [ 11782 "debug", 11783 "info", 11784 "warn", 11785 "error", 11786 "log", 11787 "assert", 11788 "trace" 11789 ]; 11790 const originalConsoleMethods = {}; 11791 function consoleSandbox(callback) { 11792 if (!("console" in GLOBAL_OBJ)) { 11793 return callback(); 11794 } 11795 const console2 = GLOBAL_OBJ.console; 11796 const wrappedFuncs = {}; 11797 const wrappedLevels = Object.keys(originalConsoleMethods);
11798 wrappedLevels.forEach((level) => { 11799 const originalConsoleMethod = originalConsoleMethods[level]; 11800 wrappedFuncs[level] = console2[level]; 11801 console2[level] = originalConsoleMethod; 11802 }); 11803 try { 11804 return callback(); 11805 } finally { 11806 wrappedLevels.forEach((level) => { 11807 console2[level] = wrappedFuncs[level]; 11808 }); 11809 } 11810 } 11811 function makeLogger() { 11812 let enabled = false; 11813 const logger2 = { 11814 enable: () => { 11815 enabled = true; 11816 }, 11817 disable: () => { 11818 enabled = false; 11819 }, 11820 isEnabled: () => enabled 11821 }; 11822 if (DEBUG_BUILD$2) { 11823 CONSOLE_LEVELS.forEach((name) => { 11824 logger2[name] = (...args) => { 11825 if (enabled) { 11826 consoleSandbox(() => { 11827 GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args); 11828 }); 11829 } 11830 }; 11831 }); 11832 } else { 11833 CONSOLE_LEVELS.forEach((name) => { 11834 logger2[name] = () => void 0; 11835 }); 11836 } 11837 return logger2; 11838 } 11839 const logger = getGlobalSingleton("logger", makeLogger); 11840 const STACKTRACE_FRAME_LIMIT = 50; 11841 const UNKNOWN_FUNCTION = "?"; 11842 const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; 11843 const STRIP_FRAME_REGEXP = /captureMessage|captureException/; 11844 function createStackParser(...parsers) { 11845 const sortedParsers = parsers.sort((a2, b2) => a2[0] - b2[0]).map((p2) => p2[1]); 11846 return (stack, skipFirstLines = 0, framesToPop = 0) => { 11847 const frames = []; 11848 const lines = stack.split("\n"); 11849 for (let i2 = skipFirstLines; i2 < lines.length; i2++) { 11850 const line2 = lines[i2]; 11851 if (line2.length > 1024) { 11852 continue; 11853 } 11854 const cleanedLine = WEBPACK_ERROR_REGEXP.test(line2) ? line2.replace(WEBPACK_ERROR_REGEXP, "$1") : line2; 11855 if (cleanedLine.match(/\S*Error: /)) { 11856 continue; 11857 } 11858 for (const parser of sortedParsers) { 11859 const frame2 = parser(cleanedLine); 11860 if (frame2) { 11861 frames.push(frame2); 11862 break; 11863 } 11864 } 11865 if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) { 11866 break; 11867 } 11868 } 11869 return stripSentryFramesAndReverse(frames.slice(framesToPop)); 11870 }; 11871 } 11872 function stackParserFromStackParserOptions(stackParser) { 11873 if (Array.isArray(stackParser)) { 11874 return createStackParser(...stackParser); 11875 } 11876 return stackParser; 11877 } 11878 function stripSentryFramesAndReverse(stack) { 11879 if (!stack.length) { 11880 return []; 11881 } 11882 const localStack = Array.from(stack); 11883 if (/sentryWrapped/.test(getLastStackFrame(localStack).function || "")) { 11884 localStack.pop(); 11885 } 11886 localStack.reverse(); 11887 if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { 11888 localStack.pop(); 11889 if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { 11890 localStack.pop(); 11891 } 11892 } 11893 return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame2) => __spreadProps(__spreadValues({}, frame2), { 11894 filename: frame2.filename || getLastStackFrame(localStack).filename, 11895 function: frame2.function || UNKNOWN_FUNCTION 11896 })); 11897 } 11898 function getLastStackFrame(arr) { 11899 return arr[arr.length - 1] || {}; 11900 } 11901 const defaultFunctionName = "<anonymous>"; 11902 function getFunctionName(fn2) { 11903 try { 11904 if (!fn2 || typeof fn2 !== "function") { 11905 return defaultFunctionName; 11906 } 11907 return fn2.name || defaultFunctionName; 11908 } catch (e2) { 11909 return defaultFunctionName; 11910 } 11911 } 11912 function getFramesFromEvent(event) { 11913 const exception = event.exception; 11914 if (exception) { 11915 const frames = []; 11916 try { 11917 exception.values.forEach((value) => { 11918 if (value.stacktrace.frames) { 11919 frames.push(...value.stacktrace.frames); 11920 } 11921 }); 11922 return frames; 11923 } catch (_oO) { 11924 return void 0; 11925 } 11926 } 11927 return void 0; 11928 } 11929 const handlers$1 = {}; 11930 const instrumented$1 = {}; 11931 function addHandler$1(type, handler) { 11932 handlers$1[type] = handlers$1[type] || []; 11933 handlers$1[type].push(handler); 11934 } 11935 function maybeInstrument(type, instrumentFn) { 11936 if (!instrumented$1[type]) { 11937 instrumented$1[type] = true; 11938 try { 11939 instrumentFn(); 11940 } catch (e2) { 11941 DEBUG_BUILD$2 && logger.error(`Error while instrumenting ${type}`, e2); 11942 } 11943 } 11944 } 11945 function triggerHandlers$1(type, data) { 11946 const typeHandlers = type && handlers$1[type]; 11947 if (!typeHandlers) { 11948 return; 11949 } 11950 for (const handler of typeHandlers) { 11951 try { 11952 handler(data); 11953 } catch (e2) { 11954 DEBUG_BUILD$2 && logger.error( 11955 `Error while triggering instrumentation handler. 11956Type: ${type} 11957Name: ${getFunctionName(handler)} 11958Error:`, 11959 e2 11960 ); 11961 } 11962 } 11963 } 11964 let _oldOnErrorHandler = null; 11965 function addGlobalErrorInstrumentationHandler(handler) { 11966 const type = "error"; 11967 addHandler$1(type, handler); 11968 maybeInstrument(type, instrumentError); 11969 } 11970 function instrumentError() { 11971 _oldOnErrorHandler = GLOBAL_OBJ.onerror;
11972 GLOBAL_OBJ.onerror = function(msg, url, line2, column2, error) { 11973 const handlerData = { 11974 column: column2, 11975 error, 11976 line: line2, 11977 msg, 11978 url 11979 }; 11980 triggerHandlers$1("error", handlerData); 11981 if (_oldOnErrorHandler) { 11982 return _oldOnErrorHandler.apply(this, arguments); 11983 } 11984 return false; 11985 }; 11986 GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; 11987 } 11988 let _oldOnUnhandledRejectionHandler = null; 11989 function addGlobalUnhandledRejectionInstrumentationHandler(handler) { 11990 const type = "unhandledrejection"; 11991 addHandler$1(type, handler); 11992 maybeInstrument(type, instrumentUnhandledRejection); 11993 } 11994 function instrumentUnhandledRejection() { 11995 _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection; 11996 GLOBAL_OBJ.onunhandledrejection = function(e2) { 11997 const handlerData = e2; 11998 triggerHandlers$1("unhandledrejection", handlerData); 11999 if (_oldOnUnhandledRejectionHandler) { 12000 return _oldOnUnhandledRejectionHandler.apply(this, arguments); 12001 } 12002 return true; 12003 }; 12004 GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; 12005 } 12006 function getMainCarrier() { 12007 getSentryCarrier(GLOBAL_OBJ); 12008 return GLOBAL_OBJ; 12009 } 12010 function getSentryCarrier(carrier) { 12011 const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {}; 12012 __SENTRY__.version = __SENTRY__.version || SDK_VERSION; 12013 return __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; 12014 } 12015 const objectToString$2 = Object.prototype.toString; 12016 function isError(wat) { 12017 switch (objectToString$2.call(wat)) { 12018 case "[object Error]":
12019 case "[object Exception]": 12020 case "[object DOMException]": 12021 case "[object WebAssembly.Exception]": 12022 return true; 12023 default: 12024 return isInstanceOf(wat, Error); 12025 } 12026 } 12027 function isBuiltin(wat, className) { 12028 return objectToString$2.call(wat) === `[object ${className}]`; 12029 } 12030 function isErrorEvent$1(wat) { 12031 return isBuiltin(wat, "ErrorEvent"); 12032 } 12033 function isDOMError(wat) { 12034 return isBuiltin(wat, "DOMError"); 12035 } 12036 function isDOMException(wat) { 12037 return isBuiltin(wat, "DOMException"); 12038 } 12039 function isString$2(wat) { 12040 return isBuiltin(wat, "String"); 12041 } 12042 function isParameterizedString(wat) { 12043 return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat; 12044 } 12045 function isPrimitive(wat) { 12046 return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function"; 12047 } 12048 function isPlainObject$3(wat) { 12049 return isBuiltin(wat, "Object"); 12050 } 12051 function isEvent(wat) { 12052 return typeof Event !== "undefined" && isInstanceOf(wat, Event); 12053 } 12054 function isElement$1(wat) { 12055 return typeof Element !== "undefined" && isInstanceOf(wat, Element); 12056 } 12057 function isRegExp$1(wat) { 12058 return isBuiltin(wat, "RegExp"); 12059 } 12060 function isThenable$1(wat) { 12061 return Boolean(wat && wat.then && typeof wat.then === "function"); 12062 } 12063 function isSyntheticEvent(wat) { 12064 return isPlainObject$3(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat; 12065 } 12066 function isInstanceOf(wat, base) { 12067 try { 12068 return wat instanceof base; 12069 } catch (_e2) { 12070 return false; 12071 } 12072 } 12073 function isVueViewModel(wat) { 12074 return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue)); 12075 } 12076 const WINDOW$4 = GLOBAL_OBJ; 12077 const DEFAULT_MAX_STRING_LENGTH = 80; 12078 function htmlTreeAsString(elem, options2 = {}) { 12079 if (!elem) { 12080 return "<unknown>"; 12081 } 12082 try { 12083 let currentElem = elem; 12084 const MAX_TRAVERSE_HEIGHT = 5; 12085 const out = []; 12086 let height = 0; 12087 let len = 0; 12088 const separator = " > "; 12089 const sepLength = separator.length; 12090 let nextStr; 12091 const keyAttrs = Array.isArray(options2) ? options2 : options2.keyAttrs; 12092 const maxStringLength = !Array.isArray(options2) && options2.maxStringLength || DEFAULT_MAX_STRING_LENGTH; 12093 while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { 12094 nextStr = _htmlElementAsString(currentElem, keyAttrs); 12095 if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) { 12096 break; 12097 } 12098 out.push(nextStr); 12099 len += nextStr.length; 12100 currentElem = currentElem.parentNode; 12101 } 12102 return out.reverse().join(separator); 12103 } catch (_oO) { 12104 return "<unknown>"; 12105 } 12106 } 12107 function _htmlElementAsString(el, keyAttrs) { 12108 const elem = el; 12109 const out = []; 12110 if (!elem || !elem.tagName) { 12111 return ""; 12112 } 12113 if (WINDOW$4.HTMLElement) { 12114 if (elem instanceof HTMLElement && elem.dataset) { 12115 if (elem.dataset["sentryComponent"]) { 12116 return elem.dataset["sentryComponent"]; 12117 } 12118 if (elem.dataset["sentryElement"]) { 12119 return elem.dataset["sentryElement"]; 12120 } 12121 } 12122 } 12123 out.push(elem.tagName.toLowerCase()); 12124 const keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null; 12125 if (keyAttrPairs && keyAttrPairs.length) { 12126 keyAttrPairs.forEach((keyAttrPair) => { 12127 out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); 12128 }); 12129 } else { 12130 if (elem.id) { 12131 out.push(`#${elem.id}`); 12132 } 12133 const className = elem.className; 12134 if (className && isString$2(className)) { 12135 const classes = className.split(/\s+/); 12136 for (const c2 of classes) { 12137 out.push(`.${c2}`); 12138 } 12139 } 12140 } 12141 const allowedAttrs = ["aria-label", "type", "name", "title", "alt"]; 12142 for (const k2 of allowedAttrs) { 12143 const attr2 = elem.getAttribute(k2); 12144 if (attr2) { 12145 out.push(`[${k2}="${attr2}"]`); 12146 } 12147 } 12148 return out.join(""); 12149 } 12150 function getLocationHref() {
12151 try { 12152 return WINDOW$4.document.location.href; 12153 } catch (oO) { 12154 return ""; 12155 } 12156 } 12157 function getDomElement(selector) { 12158 if (WINDOW$4.document && WINDOW$4.document.querySelector) { 12159 return WINDOW$4.document.querySelector(selector); 12160 } 12161 return null; 12162 } 12163 function getComponentName(elem) { 12164 if (!WINDOW$4.HTMLElement) { 12165 return null; 12166 } 12167 let currentElem = elem; 12168 const MAX_TRAVERSE_HEIGHT = 5; 12169 for (let i2 = 0; i2 < MAX_TRAVERSE_HEIGHT; i2++) { 12170 if (!currentElem) { 12171 return null; 12172 } 12173 if (currentElem instanceof HTMLElement) { 12174 if (currentElem.dataset["sentryComponent"]) { 12175 return currentElem.dataset["sentryComponent"]; 12176 } 12177 if (currentElem.dataset["sentryElement"]) { 12178 return currentElem.dataset["sentryElement"]; 12179 } 12180 } 12181 currentElem = currentElem.parentNode; 12182 } 12183 return null; 12184 } 12185 function truncate(str, max2 = 0) { 12186 if (typeof str !== "string" || max2 === 0) { 12187 return str; 12188 } 12189 return str.length <= max2 ? str : `${str.slice(0, max2)}...`; 12190 } 12191 function safeJoin(input, delimiter2) { 12192 if (!Array.isArray(input)) { 12193 return ""; 12194 } 12195 const output = []; 12196 for (let i2 = 0; i2 < input.length; i2++) { 12197 const value = input[i2]; 12198 try { 12199 if (isVueViewModel(value)) { 12200 output.push("[VueViewModel]"); 12201 } else { 12202 output.push(String(value)); 12203 } 12204 } catch (e2) { 12205 output.push("[value cannot be serialized]"); 12206 } 12207 } 12208 return output.join(delimiter2); 12209 } 12210 function isMatchingPattern(value, pattern, requireExactStringMatch = false) { 12211 if (!isString$2(value)) { 12212 return false; 12213 } 12214 if (isRegExp$1(pattern)) { 12215 return pattern.test(value); 12216 } 12217 if (isString$2(pattern)) { 12218 return requireExactStringMatch ? value === pattern : value.includes(pattern); 12219 } 12220 return false; 12221 } 12222 function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) { 12223 return patterns.some((pattern) => isMatchingPattern(testString, pattern, requireExactStringMatch)); 12224 } 12225 function fill(source, name, replacementFactory) { 12226 if (!(name in source)) { 12227 return; 12228 } 12229 const original = source[name]; 12230 const wrapped = replacementFactory(original); 12231 if (typeof wrapped === "function") { 12232 markFunctionWrapped(wrapped, original); 12233 } 12234 try { 12235 source[name] = wrapped; 12236 } catch (e2) { 12237 DEBUG_BUILD$2 && logger.log(`Failed to replace method "${name}" in object`, source); 12238 } 12239 } 12240 function addNonEnumerableProperty(obj, name, value) { 12241 try { 12242 Object.defineProperty(obj, name, { 12243 // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it 12244 value, 12245 writable: true, 12246 configurable: true 12247 }); 12248 } catch (o_O) { 12249 DEBUG_BUILD$2 && logger.log(`Failed to add non-enumerable property "${name}" to object`, obj); 12250 } 12251 } 12252 function markFunctionWrapped(wrapped, original) { 12253 try { 12254 const proto = original.prototype || {}; 12255 wrapped.prototype = original.prototype = proto; 12256 addNonEnumerableProperty(wrapped, "__sentry_original__", original); 12257 } catch (o_O) { 12258 } 12259 } 12260 function getOriginalFunction(func) { 12261 return func.__sentry_original__; 12262 } 12263 function convertToPlainObject(value) { 12264 if (isError(value)) { 12265 return __spreadValues({ 12266 message: value.message, 12267 name: value.name, 12268 stack: value.stack 12269 }, getOwnProperties(value)); 12270 } else if (isEvent(value)) { 12271 const newObj = __spreadValues({ 12272 type: value.type, 12273 target: serializeEventTarget(value.target), 12274 currentTarget: serializeEventTarget(value.currentTarget) 12275 }, getOwnProperties(value)); 12276 if (typeof CustomEvent !== "undefined" && isInstanceOf(value, CustomEvent)) { 12277 newObj.detail = value.detail; 12278 } 12279 return newObj; 12280 } else { 12281 return value; 12282 } 12283 } 12284 function serializeEventTarget(target) {
vendor: 4,719 bytes, lines 12285-12412
12285 try { 12286 return isElement$1(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target); 12287 } catch (_oO) { 12288 return "<unknown>"; 12289 } 12290 } 12291 function getOwnProperties(obj) { 12292 if (typeof obj === "object" && obj !== null) { 12293 const extractedProps = {}; 12294 for (const property2 in obj) { 12295 if (Object.prototype.hasOwnProperty.call(obj, property2)) { 12296 extractedProps[property2] = obj[property2]; 12297 } 12298 } 12299 return extractedProps; 12300 } else { 12301 return {}; 12302 } 12303 } 12304 function extractExceptionKeysForMessage(exception, maxLength = 40) { 12305 const keys2 = Object.keys(convertToPlainObject(exception)); 12306 keys2.sort(); 12307 const firstKey = keys2[0]; 12308 if (!firstKey) { 12309 return "[object has no keys]"; 12310 } 12311 if (firstKey.length >= maxLength) { 12312 return truncate(firstKey, maxLength); 12313 } 12314 for (let includedKeys = keys2.length; includedKeys > 0; includedKeys--) { 12315 const serialized = keys2.slice(0, includedKeys).join(", "); 12316 if (serialized.length > maxLength) { 12317 continue; 12318 } 12319 if (includedKeys === keys2.length) { 12320 return serialized; 12321 } 12322 return truncate(serialized, maxLength); 12323 } 12324 return ""; 12325 } 12326 function dropUndefinedKeys(inputValue) { 12327 const memoizationMap = /* @__PURE__ */ new Map(); 12328 return _dropUndefinedKeys(inputValue, memoizationMap); 12329 } 12330 function _dropUndefinedKeys(inputValue, memoizationMap) { 12331 if (isPojo(inputValue)) { 12332 const memoVal = memoizationMap.get(inputValue); 12333 if (memoVal !== void 0) { 12334 return memoVal; 12335 } 12336 const returnValue = {}; 12337 memoizationMap.set(inputValue, returnValue); 12338 for (const key of Object.getOwnPropertyNames(inputValue)) { 12339 if (typeof inputValue[key] !== "undefined") { 12340 returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); 12341 } 12342 } 12343 return returnValue; 12344 } 12345 if (Array.isArray(inputValue)) { 12346 const memoVal = memoizationMap.get(inputValue); 12347 if (memoVal !== void 0) { 12348 return memoVal; 12349 } 12350 const returnValue = []; 12351 memoizationMap.set(inputValue, returnValue); 12352 inputValue.forEach((item) => { 12353 returnValue.push(_dropUndefinedKeys(item, memoizationMap)); 12354 }); 12355 return returnValue; 12356 } 12357 return inputValue; 12358 } 12359 function isPojo(input) { 12360 if (!isPlainObject$3(input)) { 12361 return false; 12362 } 12363 try { 12364 const name = Object.getPrototypeOf(input).constructor.name; 12365 return !name || name === "Object"; 12366 } catch (e2) { 12367 return true; 12368 } 12369 } 12370 const ONE_SECOND_IN_MS = 1e3; 12371 function dateTimestampInSeconds() { 12372 return Date.now() / ONE_SECOND_IN_MS; 12373 } 12374 function createUnixTimestampInSecondsFunc() { 12375 const { performance: performance2 } = GLOBAL_OBJ; 12376 if (!performance2 || !performance2.now) { 12377 return dateTimestampInSeconds; 12378 } 12379 const approxStartingTimeOrigin = Date.now() - performance2.now(); 12380 const timeOrigin = performance2.timeOrigin == void 0 ? approxStartingTimeOrigin : performance2.timeOrigin; 12381 return () => { 12382 return (timeOrigin + performance2.now()) / ONE_SECOND_IN_MS; 12383 }; 12384 } 12385 const timestampInSeconds = createUnixTimestampInSecondsFunc(); 12386 const browserPerformanceTimeOrigin = (() => { 12387 const { performance: performance2 } = GLOBAL_OBJ; 12388 if (!performance2 || !performance2.now) { 12389 return void 0; 12390 } 12391 const threshold = 3600 * 1e3; 12392 const performanceNow = performance2.now(); 12393 const dateNow = Date.now(); 12394 const timeOriginDelta = performance2.timeOrigin ? Math.abs(performance2.timeOrigin + performanceNow - dateNow) : threshold; 12395 const timeOriginIsReliable = timeOriginDelta < threshold; 12396 const navigationStart = performance2.timing && performance2.timing.navigationStart; 12397 const hasNavigationStart = typeof navigationStart === "number"; 12398 const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; 12399 const navigationStartIsReliable = navigationStartDelta < threshold; 12400 if (timeOriginIsReliable || navigationStartIsReliable) { 12401 if (timeOriginDelta <= navigationStartDelta) { 12402 return performance2.timeOrigin; 12403 } else { 12404 return navigationStart; 12405 } 12406 } 12407 return dateNow; 12408 })(); 12409 function uuid4() { 12410 const gbl = GLOBAL_OBJ; 12411 const crypto2 = gbl.crypto || gbl.msCrypto; 12412 let getRandomByte = () => Math.random() * 16;
12413 try { 12414 if (crypto2 && crypto2.randomUUID) { 12415 return crypto2.randomUUID().replace(/-/g, ""); 12416 } 12417 if (crypto2 && crypto2.getRandomValues) { 12418 getRandomByte = () => { 12419 const typedArray = new Uint8Array(1); 12420 crypto2.getRandomValues(typedArray); 12421 return typedArray[0]; 12422 }; 12423 } 12424 } catch (_2) { 12425 } 12426 return ("10000000100040008000" + 1e11).replace( 12427 /[018]/g, 12428 (c2) => ( 12429 // eslint-disable-next-line no-bitwise 12430 (c2 ^ (getRandomByte() & 15) >> c2 / 4).toString(16) 12431 ) 12432 ); 12433 } 12434 function getFirstException(event) { 12435 return event.exception && event.exception.values ? event.exception.values[0] : void 0; 12436 } 12437 function getEventDescription(event) { 12438 const { message, event_id: eventId } = event; 12439 if (message) { 12440 return message; 12441 } 12442 const firstException = getFirstException(event); 12443 if (firstException) { 12444 if (firstException.type && firstException.value) { 12445 return `${firstException.type}: ${firstException.value}`; 12446 } 12447 return firstException.type || firstException.value || eventId || "<unknown>"; 12448 } 12449 return eventId || "<unknown>"; 12450 } 12451 function addExceptionTypeValue(event, value, type) { 12452 const exception = event.exception = event.exception || {}; 12453 const values = exception.values = exception.values || []; 12454 const firstException = values[0] = values[0] || {}; 12455 if (!firstException.value) { 12456 firstException.value = value || ""; 12457 } 12458 if (!firstException.type) { 12459 firstException.type = "Error"; 12460 } 12461 } 12462 function addExceptionMechanism(event, newMechanism) { 12463 const firstException = getFirstException(event); 12464 if (!firstException) { 12465 return; 12466 } 12467 const defaultMechanism = { type: "generic", handled: true }; 12468 const currentMechanism = firstException.mechanism; 12469 firstException.mechanism = __spreadValues(__spreadValues(__spreadValues({}, defaultMechanism), currentMechanism), newMechanism); 12470 if (newMechanism && "data" in newMechanism) { 12471 const mergedData = __spreadValues(__spreadValues({}, currentMechanism && currentMechanism.data), newMechanism.data); 12472 firstException.mechanism.data = mergedData; 12473 } 12474 } 12475 function checkOrSetAlreadyCaught(exception) { 12476 if (isAlreadyCaptured(exception)) { 12477 return true; 12478 } 12479 try { 12480 addNonEnumerableProperty(exception, "__sentry_captured__", true); 12481 } catch (err) { 12482 } 12483 return false; 12484 } 12485 function isAlreadyCaptured(exception) { 12486 try { 12487 return exception.__sentry_captured__; 12488 } catch (e2) { 12489 } 12490 } 12491 var States; 12492 (function(States2) { 12493 const PENDING = 0; 12494 States2[States2["PENDING"] = PENDING] = "PENDING"; 12495 const RESOLVED = 1; 12496 States2[States2["RESOLVED"] = RESOLVED] = "RESOLVED"; 12497 const REJECTED = 2; 12498 States2[States2["REJECTED"] = REJECTED] = "REJECTED"; 12499 })(States || (States = {})); 12500 function resolvedSyncPromise(value) { 12501 return new SyncPromise((resolve) => { 12502 resolve(value); 12503 }); 12504 } 12505 function rejectedSyncPromise(reason) { 12506 return new SyncPromise((_2, reject) => { 12507 reject(reason); 12508 }); 12509 } 12510 class SyncPromise { 12511 constructor(executor) { 12512 SyncPromise.prototype.__init.call(this); 12513 SyncPromise.prototype.__init2.call(this); 12514 SyncPromise.prototype.__init3.call(this); 12515 SyncPromise.prototype.__init4.call(this); 12516 this._state = States.PENDING; 12517 this._handlers = []; 12518 try { 12519 executor(this._resolve, this._reject); 12520 } catch (e2) { 12521 this._reject(e2); 12522 } 12523 } 12524 /** JSDoc */ 12525 then(onfulfilled, onrejected) { 12526 return new SyncPromise((resolve, reject) => { 12527 this._handlers.push([ 12528 false, 12529 (result) => { 12530 if (!onfulfilled) { 12531 resolve(result); 12532 } else { 12533 try { 12534 resolve(onfulfilled(result)); 12535 } catch (e2) { 12536 reject(e2); 12537 } 12538 } 12539 }, 12540 (reason) => { 12541 if (!onrejected) { 12542 reject(reason); 12543 } else { 12544 try { 12545 resolve(onrejected(reason)); 12546 } catch (e2) { 12547 reject(e2); 12548 } 12549 } 12550 } 12551 ]); 12552 this._executeHandlers(); 12553 }); 12554 } 12555 /** JSDoc */ 12556 catch(onrejected) { 12557 return this.then((val) => val, onrejected); 12558 } 12559 /** JSDoc */ 12560 finally(onfinally) { 12561 return new SyncPromise((resolve, reject) => { 12562 let val; 12563 let isRejected; 12564 return this.then( 12565 (value) => { 12566 isRejected = false;
vendor: 3,044 bytes, lines 12567-12675
12567 val = value; 12568 if (onfinally) { 12569 onfinally(); 12570 } 12571 }, 12572 (reason) => { 12573 isRejected = true; 12574 val = reason; 12575 if (onfinally) { 12576 onfinally(); 12577 } 12578 } 12579 ).then(() => { 12580 if (isRejected) { 12581 reject(val); 12582 return; 12583 } 12584 resolve(val); 12585 }); 12586 }); 12587 } 12588 /** JSDoc */ 12589 __init() { 12590 this._resolve = (value) => { 12591 this._setResult(States.RESOLVED, value); 12592 }; 12593 } 12594 /** JSDoc */ 12595 __init2() { 12596 this._reject = (reason) => { 12597 this._setResult(States.REJECTED, reason); 12598 }; 12599 } 12600 /** JSDoc */ 12601 __init3() { 12602 this._setResult = (state, value) => { 12603 if (this._state !== States.PENDING) { 12604 return; 12605 } 12606 if (isThenable$1(value)) { 12607 void value.then(this._resolve, this._reject); 12608 return; 12609 } 12610 this._state = state; 12611 this._value = value; 12612 this._executeHandlers(); 12613 }; 12614 } 12615 /** JSDoc */ 12616 __init4() { 12617 this._executeHandlers = () => { 12618 if (this._state === States.PENDING) { 12619 return; 12620 } 12621 const cachedHandlers = this._handlers.slice(); 12622 this._handlers = []; 12623 cachedHandlers.forEach((handler) => { 12624 if (handler[0]) { 12625 return; 12626 } 12627 if (this._state === States.RESOLVED) { 12628 handler[1](this._value); 12629 } 12630 if (this._state === States.REJECTED) { 12631 handler[2](this._value); 12632 } 12633 handler[0] = true; 12634 }); 12635 }; 12636 } 12637 } 12638 function makeSession(context) { 12639 const startingTime = timestampInSeconds(); 12640 const session = { 12641 sid: uuid4(), 12642 init: true, 12643 timestamp: startingTime, 12644 started: startingTime, 12645 duration: 0, 12646 status: "ok", 12647 errors: 0, 12648 ignoreDuration: false, 12649 toJSON: () => sessionToJSON(session) 12650 }; 12651 if (context) { 12652 updateSession(session, context); 12653 } 12654 return session; 12655 } 12656 function updateSession(session, context = {}) { 12657 if (context.user) { 12658 if (!session.ipAddress && context.user.ip_address) { 12659 session.ipAddress = context.user.ip_address; 12660 } 12661 if (!session.did && !context.did) { 12662 session.did = context.user.id || context.user.email || context.user.username; 12663 } 12664 } 12665 session.timestamp = context.timestamp || timestampInSeconds(); 12666 if (context.abnormal_mechanism) { 12667 session.abnormal_mechanism = context.abnormal_mechanism; 12668 } 12669 if (context.ignoreDuration) { 12670 session.ignoreDuration = context.ignoreDuration; 12671 } 12672 if (context.sid) { 12673 session.sid = context.sid.length === 32 ? context.sid : uuid4(); 12674 } 12675 if (context.init !== void 0) {
12676 session.init = context.init; 12677 } 12678 if (!session.did && context.did) { 12679 session.did = `${context.did}`; 12680 } 12681 if (typeof context.started === "number") { 12682 session.started = context.started; 12683 } 12684 if (session.ignoreDuration) { 12685 session.duration = void 0; 12686 } else if (typeof context.duration === "number") { 12687 session.duration = context.duration; 12688 } else { 12689 const duration = session.timestamp - session.started; 12690 session.duration = duration >= 0 ? duration : 0; 12691 } 12692 if (context.release) { 12693 session.release = context.release; 12694 } 12695 if (context.environment) { 12696 session.environment = context.environment; 12697 } 12698 if (!session.ipAddress && context.ipAddress) { 12699 session.ipAddress = context.ipAddress; 12700 } 12701 if (!session.userAgent && context.userAgent) { 12702 session.userAgent = context.userAgent; 12703 } 12704 if (typeof context.errors === "number") { 12705 session.errors = context.errors; 12706 } 12707 if (context.status) { 12708 session.status = context.status; 12709 } 12710 } 12711 function closeSession(session, status) { 12712 let context = {}; 12713 if (session.status === "ok") { 12714 context = { status: "exited" }; 12715 } 12716 updateSession(session, context); 12717 } 12718 function sessionToJSON(session) { 12719 return dropUndefinedKeys({ 12720 sid: `${session.sid}`, 12721 init: session.init, 12722 // Make sure that sec is converted to ms for date constructor 12723 started: new Date(session.started * 1e3).toISOString(), 12724 timestamp: new Date(session.timestamp * 1e3).toISOString(), 12725 status: session.status, 12726 errors: session.errors, 12727 did: typeof session.did === "number" || typeof session.did === "string" ? `${session.did}` : void 0, 12728 duration: session.duration, 12729 abnormal_mechanism: session.abnormal_mechanism, 12730 attrs: { 12731 release: session.release, 12732 environment: session.environment, 12733 ip_address: session.ipAddress, 12734 user_agent: session.userAgent 12735 } 12736 }); 12737 } 12738 function generateTraceId() { 12739 return uuid4(); 12740 } 12741 function generateSpanId() { 12742 return uuid4().substring(16); 12743 } 12744 function merge$2(initialObj, mergeObj, levels = 2) { 12745 if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) { 12746 return mergeObj; 12747 } 12748 if (initialObj && mergeObj && Object.keys(mergeObj).length === 0) { 12749 return initialObj; 12750 } 12751 const output = __spreadValues({}, initialObj); 12752 for (const key in mergeObj) { 12753 if (Object.prototype.hasOwnProperty.call(mergeObj, key)) { 12754 output[key] = merge$2(output[key], mergeObj[key], levels - 1); 12755 } 12756 } 12757 return output; 12758 } 12759 const SCOPE_SPAN_FIELD = "_sentrySpan"; 12760 function _setSpanForScope(scope, span) { 12761 if (span) { 12762 addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, span); 12763 } else { 12764 delete scope[SCOPE_SPAN_FIELD]; 12765 } 12766 } 12767 function _getSpanForScope(scope) { 12768 return scope[SCOPE_SPAN_FIELD]; 12769 } 12770 const DEFAULT_MAX_BREADCRUMBS = 100; 12771 class ScopeClass { 12772 /** Flag if notifying is happening. */ 12773 /** Callback for client to receive scope changes. */ 12774 /** Callback list that will be called during event processing. */ 12775 /** Array of breadcrumbs. */ 12776 /** User */ 12777 /** Tags */ 12778 /** Extra */ 12779 /** Contexts */ 12780 /** Attachments */ 12781 /** Propagation Context for distributed tracing */ 12782 /** 12783 * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get 12784 * sent to Sentry 12785 */ 12786 /** Fingerprint */ 12787 /** Severity */ 12788 /** 12789 * Transaction Name 12790 * 12791 * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects. 12792 * It's purpose is to assign a transaction to the scope that's added to non-transaction events. 12793 */ 12794 /** Session */ 12795 /** Request Mode Session Status */ 12796 // eslint-disable-next-line deprecation/deprecation 12797 /** The client on this scope */ 12798 /** Contains the last event id of a captured event. */ 12799 // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. 12800 constructor() { 12801 this._notifyingListeners = false;
12802 this._scopeListeners = []; 12803 this._eventProcessors = []; 12804 this._breadcrumbs = []; 12805 this._attachments = []; 12806 this._user = {}; 12807 this._tags = {}; 12808 this._extra = {}; 12809 this._contexts = {}; 12810 this._sdkProcessingMetadata = {}; 12811 this._propagationContext = { 12812 traceId: generateTraceId(), 12813 spanId: generateSpanId() 12814 }; 12815 } 12816 /** 12817 * @inheritDoc 12818 */ 12819 clone() { 12820 const newScope = new ScopeClass(); 12821 newScope._breadcrumbs = [...this._breadcrumbs]; 12822 newScope._tags = __spreadValues({}, this._tags); 12823 newScope._extra = __spreadValues({}, this._extra); 12824 newScope._contexts = __spreadValues({}, this._contexts); 12825 if (this._contexts.flags) { 12826 newScope._contexts.flags = { 12827 values: [...this._contexts.flags.values] 12828 }; 12829 } 12830 newScope._user = this._user; 12831 newScope._level = this._level; 12832 newScope._session = this._session; 12833 newScope._transactionName = this._transactionName; 12834 newScope._fingerprint = this._fingerprint; 12835 newScope._eventProcessors = [...this._eventProcessors]; 12836 newScope._requestSession = this._requestSession; 12837 newScope._attachments = [...this._attachments]; 12838 newScope._sdkProcessingMetadata = __spreadValues({}, this._sdkProcessingMetadata); 12839 newScope._propagationContext = __spreadValues({}, this._propagationContext); 12840 newScope._client = this._client; 12841 newScope._lastEventId = this._lastEventId; 12842 _setSpanForScope(newScope, _getSpanForScope(this)); 12843 return newScope; 12844 } 12845 /** 12846 * @inheritDoc 12847 */ 12848 setClient(client2) { 12849 this._client = client2; 12850 } 12851 /** 12852 * @inheritDoc 12853 */ 12854 setLastEventId(lastEventId) { 12855 this._lastEventId = lastEventId; 12856 } 12857 /** 12858 * @inheritDoc 12859 */ 12860 getClient() { 12861 return this._client; 12862 } 12863 /** 12864 * @inheritDoc 12865 */ 12866 lastEventId() { 12867 return this._lastEventId; 12868 } 12869 /** 12870 * @inheritDoc 12871 */ 12872 addScopeListener(callback) { 12873 this._scopeListeners.push(callback); 12874 } 12875 /** 12876 * @inheritDoc 12877 */ 12878 addEventProcessor(callback) { 12879 this._eventProcessors.push(callback); 12880 return this; 12881 } 12882 /** 12883 * @inheritDoc 12884 */ 12885 setUser(user) { 12886 this._user = user || { 12887 email: void 0, 12888 id: void 0, 12889 ip_address: void 0, 12890 username: void 0 12891 }; 12892 if (this._session) { 12893 updateSession(this._session, { user }); 12894 } 12895 this._notifyScopeListeners(); 12896 return this; 12897 } 12898 /** 12899 * @inheritDoc 12900 */ 12901 getUser() { 12902 return this._user; 12903 } 12904 /** 12905 * @inheritDoc 12906 */ 12907 // eslint-disable-next-line deprecation/deprecation 12908 getRequestSession() { 12909 return this._requestSession; 12910 } 12911 /** 12912 * @inheritDoc 12913 */ 12914 // eslint-disable-next-line deprecation/deprecation 12915 setRequestSession(requestSession) { 12916 this._requestSession = requestSession; 12917 return this; 12918 } 12919 /** 12920 * @inheritDoc 12921 */ 12922 setTags(tags) { 12923 this._tags = __spreadValues(__spreadValues({}, this._tags), tags); 12924 this._notifyScopeListeners(); 12925 return this; 12926 } 12927 /** 12928 * @inheritDoc 12929 */ 12930 setTag(key, value) { 12931 this._tags = __spreadProps(__spreadValues({}, this._tags), { [key]: value }); 12932 this._notifyScopeListeners(); 12933 return this; 12934 } 12935 /** 12936 * @inheritDoc 12937 */ 12938 setExtras(extras) { 12939 this._extra = __spreadValues(__spreadValues({}, this._extra), extras); 12940 this._notifyScopeListeners(); 12941 return this; 12942 } 12943 /** 12944 * @inheritDoc 12945 */ 12946 setExtra(key, extra) { 12947 this._extra = __spreadProps(__spreadValues({}, this._extra), { [key]: extra }); 12948 this._notifyScopeListeners(); 12949 return this; 12950 } 12951 /** 12952 * @inheritDoc 12953 */ 12954 setFingerprint(fingerprint) { 12955 this._fingerprint = fingerprint; 12956 this._notifyScopeListeners(); 12957 return this; 12958 } 12959 /** 12960 * @inheritDoc 12961 */ 12962 setLevel(level) { 12963 this._level = level; 12964 this._notifyScopeListeners(); 12965 return this; 12966 } 12967 /** 12968 * Sets the transaction name on the scope so that the name of e.g. taken server route or 12969 * the page location is attached to future events. 12970 *
12971 * IMPORTANT: Calling this function does NOT change the name of the currently active 12972 * root span. If you want to change the name of the active root span, use 12973 * `Sentry.updateSpanName(rootSpan, 'new name')` instead. 12974 * 12975 * By default, the SDK updates the scope's transaction name automatically on sensible 12976 * occasions, such as a page navigation or when handling a new request on the server. 12977 */ 12978 setTransactionName(name) { 12979 this._transactionName = name; 12980 this._notifyScopeListeners(); 12981 return this; 12982 } 12983 /** 12984 * @inheritDoc 12985 */ 12986 setContext(key, context) { 12987 if (context === null) { 12988 delete this._contexts[key]; 12989 } else { 12990 this._contexts[key] = context; 12991 } 12992 this._notifyScopeListeners(); 12993 return this; 12994 } 12995 /** 12996 * @inheritDoc 12997 */ 12998 setSession(session) { 12999 if (!session) { 13000 delete this._session; 13001 } else { 13002 this._session = session; 13003 } 13004 this._notifyScopeListeners(); 13005 return this; 13006 } 13007 /** 13008 * @inheritDoc 13009 */ 13010 getSession() { 13011 return this._session; 13012 } 13013 /** 13014 * @inheritDoc 13015 */ 13016 update(captureContext) { 13017 if (!captureContext) { 13018 return this; 13019 } 13020 const scopeToMerge = typeof captureContext === "function" ? captureContext(this) : captureContext; 13021 const [scopeInstance, requestSession] = scopeToMerge instanceof Scope ? ( 13022 // eslint-disable-next-line deprecation/deprecation 13023 [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] 13024 ) : isPlainObject$3(scopeToMerge) ? [captureContext, captureContext.requestSession] : []; 13025 const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {}; 13026 this._tags = __spreadValues(__spreadValues({}, this._tags), tags); 13027 this._extra = __spreadValues(__spreadValues({}, this._extra), extra); 13028 this._contexts = __spreadValues(__spreadValues({}, this._contexts), contexts); 13029 if (user && Object.keys(user).length) { 13030 this._user = user; 13031 } 13032 if (level) { 13033 this._level = level; 13034 } 13035 if (fingerprint.length) { 13036 this._fingerprint = fingerprint; 13037 } 13038 if (propagationContext) { 13039 this._propagationContext = propagationContext; 13040 } 13041 if (requestSession) { 13042 this._requestSession = requestSession; 13043 } 13044 return this; 13045 } 13046 /** 13047 * @inheritDoc 13048 */ 13049 clear() { 13050 this._breadcrumbs = []; 13051 this._tags = {}; 13052 this._extra = {}; 13053 this._user = {}; 13054 this._contexts = {}; 13055 this._level = void 0; 13056 this._transactionName = void 0; 13057 this._fingerprint = void 0; 13058 this._requestSession = void 0; 13059 this._session = void 0; 13060 _setSpanForScope(this, void 0); 13061 this._attachments = []; 13062 this.setPropagationContext({ traceId: generateTraceId() }); 13063 this._notifyScopeListeners(); 13064 return this; 13065 } 13066 /** 13067 * @inheritDoc 13068 */ 13069 addBreadcrumb(breadcrumb, maxBreadcrumbs) { 13070 const maxCrumbs = typeof maxBreadcrumbs === "number" ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; 13071 if (maxCrumbs <= 0) { 13072 return this; 13073 } 13074 const mergedBreadcrumb = __spreadValues({ 13075 timestamp: dateTimestampInSeconds() 13076 }, breadcrumb); 13077 this._breadcrumbs.push(mergedBreadcrumb); 13078 if (this._breadcrumbs.length > maxCrumbs) { 13079 this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs); 13080 if (this._client) { 13081 this._client.recordDroppedEvent("buffer_overflow", "log_item"); 13082 } 13083 } 13084 this._notifyScopeListeners(); 13085 return this; 13086 } 13087 /** 13088 * @inheritDoc 13089 */ 13090 getLastBreadcrumb() { 13091 return this._breadcrumbs[this._breadcrumbs.length - 1]; 13092 } 13093 /** 13094 * @inheritDoc 13095 */ 13096 clearBreadcrumbs() { 13097 this._breadcrumbs = []; 13098 this._notifyScopeListeners(); 13099 return this; 13100 } 13101 /** 13102 * @inheritDoc 13103 */ 13104 addAttachment(attachment) { 13105 this._attachments.push(attachment); 13106 return this; 13107 } 13108 /** 13109 * @inheritDoc 13110 */ 13111 clearAttachments() { 13112 this._attachments = []; 13113 return this; 13114 } 13115 /** @inheritDoc */ 13116 getScopeData() { 13117 return { 13118 breadcrumbs: this._breadcrumbs, 13119 attachments: this._attachments, 13120 contexts: this._contexts, 13121 tags: this._tags, 13122 extra: this._extra, 13123 user: this._user, 13124 level: this._level, 13125 fingerprint: this._fingerprint || [], 13126 eventProcessors: this._eventProcessors, 13127 propagationContext: this._propagationContext, 13128 sdkProcessingMetadata: this._sdkProcessingMetadata, 13129 transactionName: this._transactionName, 13130 span: _getSpanForScope(this) 13131 }; 13132 } 13133 /** 13134 * @inheritDoc 13135 */ 13136 setSDKProcessingMetadata(newData) { 13137 this._sdkProcessingMetadata = merge$2(this._sdkProcessingMetadata, newData, 2); 13138 return this; 13139 } 13140 /** 13141 * @inheritDoc 13142 */ 13143 setPropagationContext(context) { 13144 this._propagationContext = __spreadValues({ 13145 // eslint-disable-next-line deprecation/deprecation 13146 spanId: generateSpanId() 13147 }, context); 13148 return this; 13149 } 13150 /** 13151 * @inheritDoc 13152 */ 13153 getPropagationContext() { 13154 return this._propagationContext; 13155 } 13156 /** 13157 * @inheritDoc 13158 */ 13159 captureException(exception, hint) { 13160 const eventId = hint && hint.event_id ? hint.event_id : uuid4(); 13161 if (!this._client) { 13162 logger.warn("No client configured on scope - will not capture exception!"); 13163 return eventId; 13164 } 13165 const syntheticException = new Error("Sentry syntheticException"); 13166 this._client.captureException( 13167 exception, 13168 __spreadProps(__spreadValues({ 13169 originalException: exception, 13170 syntheticException 13171 }, hint), { 13172 event_id: eventId 13173 }), 13174 this 13175 ); 13176 return eventId; 13177 } 13178 /** 13179 * @inheritDoc 13180 */ 13181 captureMessage(message, level, hint) { 13182 const eventId = hint && hint.event_id ? hint.event_id : uuid4(); 13183 if (!this._client) { 13184 logger.warn("No client configured on scope - will not capture message!"); 13185 return eventId; 13186 } 13187 const syntheticException = new Error(message); 13188 this._client.captureMessage( 13189 message, 13190 level, 13191 __spreadProps(__spreadValues({ 13192 originalException: message, 13193 syntheticException 13194 }, hint), { 13195 event_id: eventId 13196 }), 13197 this 13198 ); 13199 return eventId; 13200 } 13201 /** 13202 * @inheritDoc 13203 */ 13204 captureEvent(event, hint) { 13205 const eventId = hint && hint.event_id ? hint.event_id : uuid4(); 13206 if (!this._client) { 13207 logger.warn("No client configured on scope - will not capture event!"); 13208 return eventId; 13209 } 13210 this._client.captureEvent(event, __spreadProps(__spreadValues({}, hint), { event_id: eventId }), this); 13211 return eventId; 13212 } 13213 /** 13214 * This will be called on every set call. 13215 */ 13216 _notifyScopeListeners() { 13217 if (!this._notifyingListeners) { 13218 this._notifyingListeners = true;
13219 this._scopeListeners.forEach((callback) => { 13220 callback(this); 13221 }); 13222 this._notifyingListeners = false; 13223 } 13224 } 13225 } 13226 const Scope = ScopeClass; 13227 function getDefaultCurrentScope() { 13228 return getGlobalSingleton("defaultCurrentScope", () => new Scope()); 13229 } 13230 function getDefaultIsolationScope() { 13231 return getGlobalSingleton("defaultIsolationScope", () => new Scope()); 13232 } 13233 class AsyncContextStack { 13234 constructor(scope, isolationScope) { 13235 let assignedScope; 13236 if (!scope) { 13237 assignedScope = new Scope(); 13238 } else { 13239 assignedScope = scope; 13240 } 13241 let assignedIsolationScope; 13242 if (!isolationScope) { 13243 assignedIsolationScope = new Scope(); 13244 } else { 13245 assignedIsolationScope = isolationScope; 13246 } 13247 this._stack = [{ scope: assignedScope }]; 13248 this._isolationScope = assignedIsolationScope; 13249 } 13250 /** 13251 * Fork a scope for the stack. 13252 */ 13253 withScope(callback) { 13254 const scope = this._pushScope(); 13255 let maybePromiseResult; 13256 try { 13257 maybePromiseResult = callback(scope); 13258 } catch (e2) { 13259 this._popScope(); 13260 throw e2; 13261 } 13262 if (isThenable$1(maybePromiseResult)) { 13263 return maybePromiseResult.then( 13264 (res) => { 13265 this._popScope(); 13266 return res; 13267 }, 13268 (e2) => { 13269 this._popScope(); 13270 throw e2; 13271 } 13272 ); 13273 } 13274 this._popScope(); 13275 return maybePromiseResult; 13276 } 13277 /** 13278 * Get the client of the stack. 13279 */ 13280 getClient() { 13281 return this.getStackTop().client; 13282 } 13283 /** 13284 * Returns the scope of the top stack. 13285 */ 13286 getScope() { 13287 return this.getStackTop().scope; 13288 } 13289 /** 13290 * Get the isolation scope for the stack. 13291 */ 13292 getIsolationScope() { 13293 return this._isolationScope; 13294 } 13295 /** 13296 * Returns the topmost scope layer in the order domain > local > process. 13297 */ 13298 getStackTop() { 13299 return this._stack[this._stack.length - 1]; 13300 } 13301 /** 13302 * Push a scope to the stack. 13303 */ 13304 _pushScope() { 13305 const scope = this.getScope().clone(); 13306 this._stack.push({ 13307 client: this.getClient(), 13308 scope 13309 }); 13310 return scope; 13311 } 13312 /** 13313 * Pop a scope from the stack. 13314 */ 13315 _popScope() { 13316 if (this._stack.length <= 1) return false; 13317 return !!this._stack.pop(); 13318 } 13319 } 13320 function getAsyncContextStack() { 13321 const registry = getMainCarrier(); 13322 const sentry = getSentryCarrier(registry); 13323 return sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope()); 13324 } 13325 function withScope$1(callback) { 13326 return getAsyncContextStack().withScope(callback); 13327 } 13328 function withSetScope(scope, callback) { 13329 const stack = getAsyncContextStack(); 13330 return stack.withScope(() => { 13331 stack.getStackTop().scope = scope; 13332 return callback(scope); 13333 }); 13334 } 13335 function withIsolationScope(callback) { 13336 return getAsyncContextStack().withScope(() => { 13337 return callback(getAsyncContextStack().getIsolationScope()); 13338 }); 13339 } 13340 function getStackAsyncContextStrategy() { 13341 return { 13342 withIsolationScope, 13343 withScope: withScope$1, 13344 withSetScope, 13345 withSetIsolationScope: (_isolationScope, callback) => { 13346 return withIsolationScope(callback); 13347 }, 13348 getCurrentScope: () => getAsyncContextStack().getScope(), 13349 getIsolationScope: () => getAsyncContextStack().getIsolationScope() 13350 }; 13351 } 13352 function getAsyncContextStrategy(carrier) { 13353 const sentry = getSentryCarrier(carrier); 13354 if (sentry.acs) { 13355 return sentry.acs; 13356 } 13357 return getStackAsyncContextStrategy(); 13358 } 13359 function getCurrentScope() { 13360 const carrier = getMainCarrier(); 13361 const acs = getAsyncContextStrategy(carrier); 13362 return acs.getCurrentScope(); 13363 } 13364 function getIsolationScope() { 13365 const carrier = getMainCarrier(); 13366 const acs = getAsyncContextStrategy(carrier); 13367 return acs.getIsolationScope(); 13368 } 13369 function getGlobalScope() { 13370 return getGlobalSingleton("globalScope", () => new Scope()); 13371 } 13372 function withScope(...rest) { 13373 const carrier = getMainCarrier(); 13374 const acs = getAsyncContextStrategy(carrier); 13375 if (rest.length === 2) { 13376 const [scope, callback] = rest; 13377 if (!scope) { 13378 return acs.withScope(callback); 13379 } 13380 return acs.withSetScope(scope, callback); 13381 } 13382 return acs.withScope(rest[0]); 13383 } 13384 function getClient() { 13385 return getCurrentScope().getClient(); 13386 } 13387 function getTraceContextFromScope(scope) { 13388 const propagationContext = scope.getPropagationContext(); 13389 const { traceId, spanId, parentSpanId } = propagationContext; 13390 const traceContext = dropUndefinedKeys({ 13391 trace_id: traceId, 13392 span_id: spanId, 13393 parent_span_id: parentSpanId 13394 }); 13395 return traceContext; 13396 } 13397 const METRICS_SPAN_FIELD = "_sentryMetrics"; 13398 function getMetricSummaryJsonForSpan(span) { 13399 const storage = span[METRICS_SPAN_FIELD]; 13400 if (!storage) { 13401 return void 0; 13402 } 13403 const output = {}; 13404 for (const [, [exportKey, summary]] of storage) { 13405 const arr = output[exportKey] || (output[exportKey] = []); 13406 arr.push(dropUndefinedKeys(summary)); 13407 } 13408 return output; 13409 } 13410 const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = "sentry.source"; 13411 const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = "sentry.sample_rate"; 13412 const SEMANTIC_ATTRIBUTE_SENTRY_OP = "sentry.op"; 13413 const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = "sentry.origin"; 13414 const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = "sentry.idle_span_finish_reason"; 13415 const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = "sentry.measurement_unit"; 13416 const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = "sentry.measurement_value"; 13417 const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = "sentry.custom_span_name"; 13418 const SEMANTIC_ATTRIBUTE_PROFILE_ID = "sentry.profile_id"; 13419 const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = "sentry.exclusive_time"; 13420 const SPAN_STATUS_UNSET = 0; 13421 const SPAN_STATUS_OK = 1; 13422 const SPAN_STATUS_ERROR = 2; 13423 function getSpanStatusFromHttpCode(httpStatus) { 13424 if (httpStatus < 400 && httpStatus >= 100) { 13425 return { code: SPAN_STATUS_OK }; 13426 } 13427 if (httpStatus >= 400 && httpStatus < 500) { 13428 switch (httpStatus) { 13429 case 401: 13430 return { code: SPAN_STATUS_ERROR, message: "unauthenticated" }; 13431 case 403: 13432 return { code: SPAN_STATUS_ERROR, message: "permission_denied" }; 13433 case 404: 13434 return { code: SPAN_STATUS_ERROR, message: "not_found" }; 13435 case 409: 13436 return { code: SPAN_STATUS_ERROR, message: "already_exists" }; 13437 case 413: 13438 return { code: SPAN_STATUS_ERROR, message: "failed_precondition" }; 13439 case 429: 13440 return { code: SPAN_STATUS_ERROR, message: "resource_exhausted" }; 13441 case 499: 13442 return { code: SPAN_STATUS_ERROR, message: "cancelled" }; 13443 default:
13444 return { code: SPAN_STATUS_ERROR, message: "invalid_argument" }; 13445 } 13446 } 13447 if (httpStatus >= 500 && httpStatus < 600) { 13448 switch (httpStatus) { 13449 case 501: 13450 return { code: SPAN_STATUS_ERROR, message: "unimplemented" }; 13451 case 503: 13452 return { code: SPAN_STATUS_ERROR, message: "unavailable" }; 13453 case 504: 13454 return { code: SPAN_STATUS_ERROR, message: "deadline_exceeded" }; 13455 default: 13456 return { code: SPAN_STATUS_ERROR, message: "internal_error" }; 13457 } 13458 } 13459 return { code: SPAN_STATUS_ERROR, message: "unknown_error" }; 13460 } 13461 function setHttpStatus(span, httpStatus) { 13462 span.setAttribute("http.response.status_code", httpStatus); 13463 const spanStatus = getSpanStatusFromHttpCode(httpStatus); 13464 if (spanStatus.message !== "unknown_error") { 13465 span.setStatus(spanStatus); 13466 } 13467 } 13468 const SENTRY_BAGGAGE_KEY_PREFIX = "sentry-"; 13469 const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; 13470 const MAX_BAGGAGE_STRING_LENGTH = 8192; 13471 function baggageHeaderToDynamicSamplingContext(baggageHeader) { 13472 const baggageObject = parseBaggageHeader(baggageHeader); 13473 if (!baggageObject) { 13474 return void 0; 13475 } 13476 const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { 13477 if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { 13478 const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); 13479 acc[nonPrefixedKey] = value; 13480 } 13481 return acc; 13482 }, {}); 13483 if (Object.keys(dynamicSamplingContext).length > 0) { 13484 return dynamicSamplingContext; 13485 } else { 13486 return void 0; 13487 } 13488 } 13489 function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) { 13490 if (!dynamicSamplingContext) { 13491 return void 0; 13492 } 13493 const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( 13494 (acc, [dscKey, dscValue]) => { 13495 if (dscValue) { 13496 acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; 13497 } 13498 return acc; 13499 }, 13500 {} 13501 ); 13502 return objectToBaggageHeader(sentryPrefixedDSC); 13503 } 13504 function parseBaggageHeader(baggageHeader) { 13505 if (!baggageHeader || !isString$2(baggageHeader) && !Array.isArray(baggageHeader)) { 13506 return void 0; 13507 } 13508 if (Array.isArray(baggageHeader)) { 13509 return baggageHeader.reduce((acc, curr) => { 13510 const currBaggageObject = baggageHeaderToObject(curr); 13511 Object.entries(currBaggageObject).forEach(([key, value]) => { 13512 acc[key] = value; 13513 }); 13514 return acc; 13515 }, {}); 13516 } 13517 return baggageHeaderToObject(baggageHeader); 13518 } 13519 function baggageHeaderToObject(baggageHeader) { 13520 return baggageHeader.split(",").map((baggageEntry) => baggageEntry.split("=").map((keyOrValue) => decodeURIComponent(keyOrValue.trim()))).reduce((acc, [key, value]) => { 13521 if (key && value) { 13522 acc[key] = value; 13523 } 13524 return acc; 13525 }, {}); 13526 } 13527 function objectToBaggageHeader(object2) { 13528 if (Object.keys(object2).length === 0) { 13529 return void 0; 13530 } 13531 return Object.entries(object2).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { 13532 const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; 13533 const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; 13534 if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { 13535 DEBUG_BUILD$2 && logger.warn( 13536 `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.` 13537 ); 13538 return baggageHeader; 13539 } else { 13540 return newBaggageHeader; 13541 } 13542 }, ""); 13543 } 13544 const TRACEPARENT_REGEXP = new RegExp( 13545 "^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$" 13546 // whitespace 13547 ); 13548 function extractTraceparentData(traceparent) { 13549 if (!traceparent) { 13550 return void 0; 13551 } 13552 const matches2 = traceparent.match(TRACEPARENT_REGEXP); 13553 if (!matches2) { 13554 return void 0; 13555 } 13556 let parentSampled; 13557 if (matches2[3] === "1") { 13558 parentSampled = true; 13559 } else if (matches2[3] === "0") { 13560 parentSampled = false;
13561 } 13562 return { 13563 traceId: matches2[1], 13564 parentSampled, 13565 parentSpanId: matches2[2] 13566 }; 13567 } 13568 function propagationContextFromHeaders(sentryTrace, baggage) { 13569 const traceparentData = extractTraceparentData(sentryTrace); 13570 const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage); 13571 if (!traceparentData || !traceparentData.traceId) { 13572 return { traceId: generateTraceId(), spanId: generateSpanId() }; 13573 } 13574 const { traceId, parentSpanId, parentSampled } = traceparentData; 13575 const virtualSpanId = generateSpanId(); 13576 return { 13577 traceId, 13578 parentSpanId, 13579 spanId: virtualSpanId, 13580 sampled: parentSampled, 13581 dsc: dynamicSamplingContext || {} 13582 // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it 13583 }; 13584 } 13585 function generateSentryTraceHeader(traceId = generateTraceId(), spanId = generateSpanId(), sampled) { 13586 let sampledString = ""; 13587 if (sampled !== void 0) { 13588 sampledString = sampled ? "-1" : "-0"; 13589 } 13590 return `${traceId}-${spanId}${sampledString}`; 13591 } 13592 const TRACE_FLAG_NONE = 0; 13593 const TRACE_FLAG_SAMPLED = 1; 13594 let hasShownSpanDropWarning = false; 13595 function spanToTransactionTraceContext(span) { 13596 const { spanId: span_id, traceId: trace_id } = span.spanContext(); 13597 const { data, op, parent_span_id, status, origin: origin2 } = spanToJSON(span); 13598 return dropUndefinedKeys({ 13599 parent_span_id, 13600 span_id, 13601 trace_id, 13602 data, 13603 op, 13604 status, 13605 origin: origin2 13606 }); 13607 } 13608 function spanToTraceContext(span) { 13609 const { spanId, traceId: trace_id, isRemote } = span.spanContext(); 13610 const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id; 13611 const span_id = isRemote ? generateSpanId() : spanId; 13612 return dropUndefinedKeys({ 13613 parent_span_id, 13614 span_id, 13615 trace_id 13616 }); 13617 } 13618 function spanToTraceHeader(span) { 13619 const { traceId, spanId } = span.spanContext(); 13620 const sampled = spanIsSampled(span); 13621 return generateSentryTraceHeader(traceId, spanId, sampled); 13622 } 13623 function spanTimeInputToSeconds(input) { 13624 if (typeof input === "number") { 13625 return ensureTimestampInSeconds(input); 13626 } 13627 if (Array.isArray(input)) { 13628 return input[0] + input[1] / 1e9; 13629 } 13630 if (input instanceof Date) { 13631 return ensureTimestampInSeconds(input.getTime()); 13632 } 13633 return timestampInSeconds(); 13634 } 13635 function ensureTimestampInSeconds(timestamp) { 13636 const isMs = timestamp > 9999999999; 13637 return isMs ? timestamp / 1e3 : timestamp; 13638 } 13639 function spanToJSON(span) { 13640 if (spanIsSentrySpan(span)) { 13641 return span.getSpanJSON(); 13642 } 13643 try { 13644 const { spanId: span_id, traceId: trace_id } = span.spanContext(); 13645 if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) { 13646 const { attributes, startTime, name, endTime, parentSpanId, status } = span; 13647 return dropUndefinedKeys({ 13648 span_id, 13649 trace_id, 13650 data: attributes, 13651 description: name, 13652 parent_span_id: parentSpanId, 13653 start_timestamp: spanTimeInputToSeconds(startTime), 13654 // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time 13655 timestamp: spanTimeInputToSeconds(endTime) || void 0, 13656 status: getStatusMessage(status), 13657 op: attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP], 13658 origin: attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN], 13659 _metrics_summary: getMetricSummaryJsonForSpan(span) 13660 }); 13661 } 13662 return { 13663 span_id, 13664 trace_id 13665 }; 13666 } catch (e2) { 13667 return {}; 13668 } 13669 } 13670 function spanIsOpenTelemetrySdkTraceBaseSpan(span) { 13671 const castSpan = span; 13672 return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status; 13673 } 13674 function spanIsSentrySpan(span) { 13675 return typeof span.getSpanJSON === "function"; 13676 } 13677 function spanIsSampled(span) { 13678 const { traceFlags } = span.spanContext(); 13679 return traceFlags === TRACE_FLAG_SAMPLED; 13680 } 13681 function getStatusMessage(status) { 13682 if (!status || status.code === SPAN_STATUS_UNSET) { 13683 return void 0; 13684 } 13685 if (status.code === SPAN_STATUS_OK) { 13686 return "ok"; 13687 } 13688 return status.message || "unknown_error"; 13689 } 13690 const CHILD_SPANS_FIELD = "_sentryChildSpans"; 13691 const ROOT_SPAN_FIELD = "_sentryRootSpan"; 13692 function addChildSpanToSpan(span, childSpan) { 13693 const rootSpan = span[ROOT_SPAN_FIELD] || span; 13694 addNonEnumerableProperty(childSpan, ROOT_SPAN_FIELD, rootSpan); 13695 if (span[CHILD_SPANS_FIELD]) { 13696 span[CHILD_SPANS_FIELD].add(childSpan); 13697 } else { 13698 addNonEnumerableProperty(span, CHILD_SPANS_FIELD, /* @__P
13698URE__ */ new Set([childSpan])); 13699 } 13700 } 13701 function removeChildSpanFromSpan(span, childSpan) { 13702 if (span[CHILD_SPANS_FIELD]) { 13703 span[CHILD_SPANS_FIELD].delete(childSpan); 13704 } 13705 } 13706 function getSpanDescendants(span) { 13707 const resultSet = /* @__PURE__ */ new Set(); 13708 function addSpanChildren(span2) { 13709 if (resultSet.has(span2)) { 13710 return; 13711 } else if (spanIsSampled(span2)) { 13712 resultSet.add(span2); 13713 const childSpans = span2[CHILD_SPANS_FIELD] ? Array.from(span2[CHILD_SPANS_FIELD]) : []; 13714 for (const childSpan of childSpans) { 13715 addSpanChildren(childSpan); 13716 } 13717 } 13718 } 13719 addSpanChildren(span); 13720 return Array.from(resultSet); 13721 } 13722 function getRootSpan(span) { 13723 return span[ROOT_SPAN_FIELD] || span; 13724 } 13725 function getActiveSpan() { 13726 const carrier = getMainCarrier(); 13727 const acs = getAsyncContextStrategy(carrier); 13728 if (acs.getActiveSpan) { 13729 return acs.getActiveSpan(); 13730 } 13731 return _getSpanForScope(getCurrentScope()); 13732 } 13733 function showSpanDropWarning() { 13734 if (!hasShownSpanDropWarning) { 13735 consoleSandbox(() => { 13736 console.warn( 13737 "[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly." 13738 ); 13739 }); 13740 hasShownSpanDropWarning = true; 13741 } 13742 } 13743 let errorsInstrumented = false; 13744 function registerSpanErrorInstrumentation() { 13745 if (errorsInstrumented) { 13746 return; 13747 } 13748 errorsInstrumented = true; 13749 addGlobalErrorInstrumentationHandler(errorCallback); 13750 addGlobalUnhandledRejectionInstrumentationHandler(errorCallback); 13751 } 13752 function errorCallback() { 13753 const activeSpan = getActiveSpan(); 13754 const rootSpan = activeSpan && getRootSpan(activeSpan); 13755 if (rootSpan) { 13756 const message = "internal_error"; 13757 DEBUG_BUILD$3 && logger.log(`[Tracing] Root span: ${message} -> Global error occurred`); 13758 rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message }); 13759 } 13760 } 13761 errorCallback.tag = "sentry_tracingErrorCallback"; 13762 const SCOPE_ON_START_SPAN_FIELD = "_sentryScope"; 13763 const ISOLATION_SCOPE_ON_START_SPAN_FIELD = "_sentryIsolationScope"; 13764 function setCapturedScopesOnSpan(span, scope, isolationScope) { 13765 if (span) { 13766 addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope); 13767 addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope); 13768 } 13769 } 13770 function getCapturedScopesOnSpan(span) { 13771 return { 13772 scope: span[SCOPE_ON_START_SPAN_FIELD], 13773 isolationScope: span[ISOLATION_SCOPE_ON_START_SPAN_FIELD] 13774 }; 13775 } 13776 function hasTracingEnabled(maybeOptions) { 13777 if (typeof __SENTRY_TRACING__ === "boolean" && !__SENTRY_TRACING__) { 13778 return false; 13779 } 13780 const client2 = getClient(); 13781 const options2 = maybeOptions || client2 && client2.getOptions(); 13782 return !!options2 && (options2.enableTracing || "tracesSampleRate" in options2 || "tracesSampler" in options2); 13783 } 13784 class SentryNonRecordingSpan { 13785 constructor(spanContext = {}) { 13786 this._traceId = spanContext.traceId || generateTraceId(); 13787 this._spanId = spanContext.spanId || generateSpanId(); 13788 } 13789 /** @inheritdoc */ 13790 spanContext() { 13791 return { 13792 spanId: this._spanId, 13793 traceId: this._traceId, 13794 traceFlags: TRACE_FLAG_NONE 13795 }; 13796 } 13797 /** @inheritdoc */ 13798 // eslint-disable-next-line @typescript-eslint/no-empty-function 13799 end(_timestamp) { 13800 } 13801 /** @inheritdoc */ 13802 setAttribute(_key, _value) { 13803 return this; 13804 } 13805 /** @inheritdoc */ 13806 setAttributes(_values) { 13807 return this; 13808 } 13809 /** @inheritdoc */ 13810 setStatus(_status) { 13811 return this; 13812 } 13813 /** @inheritdoc */ 13814 updateName(_name) { 13815 return this; 13816 } 13817 /** @inheritdoc */ 13818 isRecording() { 13819 return false;
13820 } 13821 /** @inheritdoc */ 13822 addEvent(_name, _attributesOrStartTime, _startTime) { 13823 return this; 13824 } 13825 /** 13826 * This should generally not be used, 13827 * but we need it for being compliant with the OTEL Span interface. 13828 * 13829 * @hidden 13830 * @internal 13831 */ 13832 addLink(_link) { 13833 return this; 13834 } 13835 /** 13836 * This should generally not be used, 13837 * but we need it for being compliant with the OTEL Span interface. 13838 * 13839 * @hidden 13840 * @internal 13841 */ 13842 addLinks(_links) { 13843 return this; 13844 } 13845 /** 13846 * This should generally not be used, 13847 * but we need it for being compliant with the OTEL Span interface. 13848 * 13849 * @hidden 13850 * @internal 13851 */ 13852 recordException(_exception, _time) { 13853 } 13854 } 13855 const DEFAULT_ENVIRONMENT = "production"; 13856 const FROZEN_DSC_FIELD = "_frozenDsc"; 13857 function freezeDscOnSpan(span, dsc) { 13858 const spanWithMaybeDsc = span; 13859 addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc); 13860 } 13861 function getDynamicSamplingContextFromClient(trace_id, client2) { 13862 const options2 = client2.getOptions(); 13863 const { publicKey: public_key } = client2.getDsn() || {}; 13864 const dsc = dropUndefinedKeys({ 13865 environment: options2.environment || DEFAULT_ENVIRONMENT, 13866 release: options2.release, 13867 public_key, 13868 trace_id 13869 }); 13870 client2.emit("createDsc", dsc); 13871 return dsc; 13872 } 13873 function getDynamicSamplingContextFromScope(client2, scope) { 13874 const propagationContext = scope.getPropagationContext(); 13875 return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client2); 13876 } 13877 function getDynamicSamplingContextFromSpan(span) { 13878 const client2 = getClient(); 13879 if (!client2) { 13880 return {}; 13881 } 13882 const rootSpan = getRootSpan(span); 13883 const frozenDsc = rootSpan[FROZEN_DSC_FIELD]; 13884 if (frozenDsc) { 13885 return frozenDsc; 13886 } 13887 const traceState = rootSpan.spanContext().traceState; 13888 const traceStateDsc = traceState && traceState.get("sentry.dsc"); 13889 const dscOnTraceState = traceStateDsc && baggageHeaderToDynamicSamplingContext(traceStateDsc); 13890 if (dscOnTraceState) { 13891 return dscOnTraceState; 13892 } 13893 const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client2); 13894 const jsonSpan = spanToJSON(rootSpan); 13895 const attributes = jsonSpan.data || {}; 13896 const maybeSampleRate = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; 13897 if (maybeSampleRate != null) { 13898 dsc.sample_rate = `${maybeSampleRate}`; 13899 } 13900 const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; 13901 const name = jsonSpan.description; 13902 if (source !== "url" && name) { 13903 dsc.transaction = name; 13904 } 13905 if (hasTracingEnabled()) { 13906 dsc.sampled = String(spanIsSampled(rootSpan)); 13907 } 13908 client2.emit("createDsc", dsc, rootSpan); 13909 return dsc; 13910 } 13911 function logSpanStart(span) { 13912 if (!DEBUG_BUILD$3) return; 13913 const { description = "< unknown name >", op = "< unknown op >", parent_span_id: parentSpanId } = spanToJSON(span); 13914 const { spanId } = span.spanContext(); 13915 const sampled = spanIsSampled(span); 13916 const rootSpan = getRootSpan(span); 13917 const isRootSpan = rootSpan === span; 13918 const header = `[Tracing] Starting ${sampled ? "sampled" : "unsampled"} ${isRootSpan ? "root " : ""}span`; 13919 const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`]; 13920 if (parentSpanId) { 13921 infoParts.push(`parent ID: ${parentSpanId}`); 13922 } 13923 if (!isRootSpan) { 13924 const { op: op2, description: description2 } = spanToJSON(rootSpan); 13925 infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`); 13926 if (op2) { 13927 infoParts.push(`root op: ${op2}`); 13928 } 13929 if (description2) { 13930 infoParts.push(`root description: ${description2}`); 13931 } 13932 } 13933 logger.log(`${header} 13934 ${infoParts.join("\n ")}`); 13935 } 13936 function logSpanEnd(span) { 13937 if (!DEBUG_BUILD$3) return; 13938 const { description = "< unknown name >", op = "< unknown op >" } = spanToJSON(span); 13939 const { spanId } = span.spanContext(); 13940 const rootSpan = getRootSpan(span); 13941 const isRootSpan = rootSpan === span; 13942 const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? "root " : ""}span "${description}" with ID ${spanId}`; 13943 logger.log(msg); 13944 } 13945 function parseSampleRate(sampleRate) { 13946 if (typeof sampleRate === "boolean") { 13947 return Number(sampleRate); 13948 } 13949 const rate = typeof sampleRate === "string" ? parseFloat(sampleRate) : sampleRate;
13950 if (typeof rate !== "number" || isNaN(rate) || rate < 0 || rate > 1) { 13951 DEBUG_BUILD$3 && logger.warn( 13952 `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( 13953 sampleRate 13954 )} of type ${JSON.stringify(typeof sampleRate)}.` 13955 ); 13956 return void 0; 13957 } 13958 return rate; 13959 } 13960 function sampleSpan(options2, samplingContext) { 13961 if (!hasTracingEnabled(options2)) { 13962 return [false]; 13963 } 13964 const normalizedRequest = getIsolationScope().getScopeData().sdkProcessingMetadata.normalizedRequest; 13965 const enhancedSamplingContext = __spreadProps(__spreadValues({}, samplingContext), { 13966 normalizedRequest: samplingContext.normalizedRequest || normalizedRequest 13967 }); 13968 let sampleRate; 13969 if (typeof options2.tracesSampler === "function") { 13970 sampleRate = options2.tracesSampler(enhancedSamplingContext); 13971 } else if (enhancedSamplingContext.parentSampled !== void 0) { 13972 sampleRate = enhancedSamplingContext.parentSampled; 13973 } else if (typeof options2.tracesSampleRate !== "undefined") { 13974 sampleRate = options2.tracesSampleRate; 13975 } else { 13976 sampleRate = 1; 13977 } 13978 const parsedSampleRate = parseSampleRate(sampleRate); 13979 if (parsedSampleRate === void 0) { 13980 DEBUG_BUILD$3 && logger.warn("[Tracing] Discarding transaction because of invalid sample rate."); 13981 return [false]; 13982 } 13983 if (!parsedSampleRate) { 13984 DEBUG_BUILD$3 && logger.log( 13985 `[Tracing] Discarding transaction because ${typeof options2.tracesSampler === "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}` 13986 ); 13987 return [false, parsedSampleRate]; 13988 } 13989 const shouldSample = Math.random() < parsedSampleRate; 13990 if (!shouldSample) { 13991 DEBUG_BUILD$3 && logger.log( 13992 `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( 13993 sampleRate 13994 )})` 13995 ); 13996 return [false, parsedSampleRate]; 13997 } 13998 return [true, parsedSampleRate]; 13999 } 14000 const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; 14001 function isValidProtocol(protocol) { 14002 return protocol === "http" || protocol === "https"; 14003 } 14004 function dsnToString(dsn, withPassword = false) { 14005 const { host, path, pass, port, projectId, protocol, publicKey } = dsn; 14006 return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${projectId}`; 14007 } 14008 function dsnFromString(str) { 14009 const match2 = DSN_REGEX.exec(str); 14010 if (!match2) { 14011 consoleSandbox(() => { 14012 console.error(`Invalid Sentry Dsn: ${str}`); 14013 }); 14014 return void 0; 14015 } 14016 const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match2.slice(1); 14017 let path = ""; 14018 let projectId = lastPath; 14019 const split = projectId.split("/"); 14020 if (split.length > 1) { 14021 path = split.slice(0, -1).join("/"); 14022 projectId = split.pop(); 14023 } 14024 if (projectId) { 14025 const projectMatch = projectId.match(/^\d+/); 14026 if (projectMatch) { 14027 projectId = projectMatch[0]; 14028 } 14029 } 14030 return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey }); 14031 } 14032 function dsnFromComponents(components2) { 14033 return { 14034 protocol: components2.protocol, 14035 publicKey: components2.publicKey || "", 14036 pass: components2.pass || "", 14037 host: components2.host, 14038 port: components2.port || "", 14039 path: components2.path || "", 14040 projectId: components2.projectId 14041 }; 14042 } 14043 function validateDsn(dsn) { 14044 if (!DEBUG_BUILD$2) { 14045 return true; 14046 } 14047 const { port, projectId, protocol } = dsn; 14048 const requiredComponents = ["protocol", "publicKey", "host", "projectId"]; 14049 const hasMissingRequiredComponent = requiredComponents.find((component) => { 14050 if (!dsn[component]) { 14051 logger.error(`Invalid Sentry Dsn: ${component} missing`); 14052 return true; 14053 } 14054 return false;
14055 }); 14056 if (hasMissingRequiredComponent) { 14057 return false; 14058 } 14059 if (!projectId.match(/^\d+$/)) { 14060 logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); 14061 return false; 14062 } 14063 if (!isValidProtocol(protocol)) { 14064 logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); 14065 return false; 14066 } 14067 if (port && isNaN(parseInt(port, 10))) { 14068 logger.error(`Invalid Sentry Dsn: Invalid port ${port}`); 14069 return false; 14070 } 14071 return true; 14072 } 14073 function makeDsn(from2) { 14074 const components2 = typeof from2 === "string" ? dsnFromString(from2) : dsnFromComponents(from2); 14075 if (!components2 || !validateDsn(components2)) { 14076 return void 0; 14077 } 14078 return components2; 14079 } 14080 function memoBuilder() { 14081 const hasWeakSet = typeof WeakSet === "function"; 14082 const inner = hasWeakSet ? /* @__PURE__ */ new WeakSet() : []; 14083 function memoize2(obj) { 14084 if (hasWeakSet) { 14085 if (inner.has(obj)) { 14086 return true; 14087 } 14088 inner.add(obj); 14089 return false; 14090 } 14091 for (let i2 = 0; i2 < inner.length; i2++) { 14092 const value = inner[i2]; 14093 if (value === obj) { 14094 return true; 14095 } 14096 } 14097 inner.push(obj); 14098 return false; 14099 } 14100 function unmemoize(obj) { 14101 if (hasWeakSet) { 14102 inner.delete(obj); 14103 } else { 14104 for (let i2 = 0; i2 < inner.length; i2++) { 14105 if (inner[i2] === obj) { 14106 inner.splice(i2, 1); 14107 break; 14108 } 14109 } 14110 } 14111 } 14112 return [memoize2, unmemoize]; 14113 } 14114 function normalize(input, depth = 100, maxProperties = Infinity) { 14115 try { 14116 return visit("", input, depth, maxProperties); 14117 } catch (err) { 14118 return { ERROR: `**non-serializable** (${err})` }; 14119 } 14120 } 14121 function normalizeToSize(object2, depth = 3, maxSize = 100 * 1024) { 14122 const normalized = normalize(object2, depth); 14123 if (jsonSize(normalized) > maxSize) { 14124 return normalizeToSize(object2, depth - 1, maxSize); 14125 } 14126 return normalized; 14127 } 14128 function visit(key, value, depth = Infinity, maxProperties = Infinity, memo2 = memoBuilder()) { 14129 const [memoize2, unmemoize] = memo2; 14130 if (value == null || // this matches null and undefined -> eqeq not eqeqeq 14131 ["boolean", "string"].includes(typeof value) || typeof value === "number" && Number.isFinite(value)) { 14132 return value; 14133 } 14134 const stringified = stringifyValue$1(key, value); 14135 if (!stringified.startsWith("[object ")) { 14136 return stringified; 14137 } 14138 if (value["__sentry_skip_normalization__"]) { 14139 return value; 14140 } 14141 const remainingDepth = typeof value["__sentry_override_normalization_depth__"] === "number" ? value["__sentry_override_normalization_depth__"] : depth; 14142 if (remainingDepth === 0) { 14143 return stringified.replace("object ", ""); 14144 } 14145 if (memoize2(value)) { 14146 return "[Circular ~]"; 14147 } 14148 const valueWithToJSON = value; 14149 if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") { 14150 try { 14151 const jsonValue = valueWithToJSON.toJSON(); 14152 return visit("", jsonValue, remainingDepth - 1, maxProperties, memo2); 14153 } catch (err) { 14154 } 14155 } 14156 const normalized = Array.isArray(value) ? [] : {}; 14157 let numAdded = 0; 14158 const visitable = convertToPlainObject(value); 14159 for (const visitKey in visitable) { 14160 if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { 14161 continue; 14162 } 14163 if (numAdded >= maxProperties) { 14164 normalized[visitKey] = "[MaxProperties ~]"; 14165 break; 14166 } 14167 const visitValue = visitable[visitKey]; 14168 normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo2); 14169 numAdded++; 14170 } 14171 unmemoize(value); 14172 return normalized; 14173 } 14174 function stringifyValue$1(key, value) { 14175 try { 14176 if (key === "domain" && value && typeof value === "object" && value._events) { 14177 return "[Domain]"; 14178 } 14179 if (key === "domainEmitter") { 14180 return "[DomainEmitter]"; 14181 } 14182 if (typeof global !== "undefined" && value === global) { 14183 return "[Global]"; 14184 } 14185 if (typeof window !== "undefined" && value === window) { 14186 return "[Window]"; 14187 } 14188 if (typeof document !== "undefined" && value === document) { 14189 return "[Document]"; 14190 } 14191 if (isVueViewModel(value)) { 14192 return "[VueViewModel]"; 14193 } 14194 if (isSyntheticEvent(value)) { 14195 return "[SyntheticEvent]"; 14196 } 14197 if (typeof value === "number" && !Number.isFinite(value)) { 14198 return `[${value}]`; 14199 } 14200 if (typeof value === "function") { 14201 return `[Function: ${getFunctionName(value)}]`; 14202 } 14203 if (typeof value === "symbol") { 14204 return `[${String(value)}]`; 14205 } 14206 if (typeof value === "bigint") { 14207 return `[BigInt: ${String(value)}]`; 14208 } 14209 const objName = getConstructorName(value); 14210 if (/^HTML(\w*)Element$/.test(objName)) { 14211 return `[HTMLElement: ${objName}]`; 14212 } 14213 return `[object ${objName}]`; 14214 } catch (err) { 14215 return `**non-serializable** (${err})`; 14216 } 14217 } 14218 function getConstructorName(value) { 14219 const prototype2 = Object.getPrototypeOf(value); 14220 return prototype2 ? prototype2.constructor.name : "null prototype"; 14221 } 14222 function utf8Length(value) { 14223 return ~-encodeURI(value).split(/%..|./).length; 14224 } 14225 function jsonSize(value) { 14226 return utf8Length(JSON.stringify(value)); 14227 } 14228 function createEnvelope(headers, items = []) { 14229 return [headers, items]; 14230 } 14231 function addItemToEnvelope(envelope, newItem) { 14232 const [headers, items] = envelope; 14233 return [headers, [...items, newItem]]; 14234 } 14235 function forEachEnvelopeItem(envelope, callback) { 14236 const envelopeItems = envelope[1]; 14237 for (const envelopeItem of envelopeItems) { 14238 const envelopeItemType = envelopeItem[0].type; 14239 const result = callback(envelopeItem, envelopeItemType); 14240 if (result) { 14241 return true; 14242 } 14243 } 14244 return false;
14245 } 14246 function encodeUTF8(input) { 14247 return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.encodePolyfill ? GLOBAL_OBJ.__SENTRY__.encodePolyfill(input) : new TextEncoder().encode(input); 14248 } 14249 function serializeEnvelope(envelope) { 14250 const [envHeaders, items] = envelope; 14251 let parts = JSON.stringify(envHeaders); 14252 function append2(next2) { 14253 if (typeof parts === "string") { 14254 parts = typeof next2 === "string" ? parts + next2 : [encodeUTF8(parts), next2]; 14255 } else { 14256 parts.push(typeof next2 === "string" ? encodeUTF8(next2) : next2); 14257 } 14258 } 14259 for (const item of items) { 14260 const [itemHeaders, payload] = item; 14261 append2(` 14262${JSON.stringify(itemHeaders)} 14263`); 14264 if (typeof payload === "string" || payload instanceof Uint8Array) { 14265 append2(payload); 14266 } else { 14267 let stringifiedPayload; 14268 try { 14269 stringifiedPayload = JSON.stringify(payload); 14270 } catch (e2) { 14271 stringifiedPayload = JSON.stringify(normalize(payload)); 14272 } 14273 append2(stringifiedPayload); 14274 } 14275 } 14276 return typeof parts === "string" ? parts : concatBuffers(parts); 14277 } 14278 function concatBuffers(buffers) { 14279 const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); 14280 const merged = new Uint8Array(totalLength); 14281 let offset2 = 0; 14282 for (const buffer of buffers) { 14283 merged.set(buffer, offset2); 14284 offset2 += buffer.length; 14285 } 14286 return merged; 14287 } 14288 function createSpanEnvelopeItem(spanJson) { 14289 const spanHeaders = { 14290 type: "span" 14291 }; 14292 return [spanHeaders, spanJson]; 14293 } 14294 function createAttachmentEnvelopeItem(attachment) { 14295 const buffer = typeof attachment.data === "string" ? encodeUTF8(attachment.data) : attachment.data; 14296 return [ 14297 dropUndefinedKeys({ 14298 type: "attachment", 14299 length: buffer.length, 14300 filename: attachment.filename, 14301 content_type: attachment.contentType, 14302 attachment_type: attachment.attachmentType 14303 }), 14304 buffer 14305 ]; 14306 } 14307 const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { 14308 session: "session", 14309 sessions: "session", 14310 attachment: "attachment", 14311 transaction: "transaction", 14312 event: "error", 14313 client_report: "internal", 14314 user_report: "default", 14315 profile: "profile", 14316 profile_chunk: "profile", 14317 replay_event: "replay", 14318 replay_recording: "replay", 14319 check_in: "monitor", 14320 feedback: "feedback", 14321 span: "span", 14322 statsd: "metric_bucket", 14323 raw_security: "security" 14324 }; 14325 function envelopeItemTypeToDataCategory(type) { 14326 return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; 14327 } 14328 function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { 14329 if (!metadataOrEvent || !metadataOrEvent.sdk) { 14330 return; 14331 } 14332 const { name, version } = metadataOrEvent.sdk; 14333 return { name, version }; 14334 } 14335 function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn) { 14336 const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; 14337 return __spreadValues(__spreadValues(__spreadValues({ 14338 event_id: event.event_id, 14339 sent_at: (/* @__PURE__ */ new Date()).toISOString() 14340 }, sdkInfo && { sdk: sdkInfo }), !!tunnel && dsn && { dsn: dsnToString(dsn) }), dynamicSamplingContext && { 14341 trace: dropUndefinedKeys(__spreadValues({}, dynamicSamplingContext)) 14342 }); 14343 } 14344 function enhanceEventWithSdkInfo(event, sdkInfo) { 14345 if (!sdkInfo) { 14346 return event; 14347 } 14348 event.sdk = event.sdk || {}; 14349 event.sdk.name = event.sdk.name || sdkInfo.name; 14350 event.sdk.version = event.sdk.version || sdkInfo.version; 14351 event.sdk.integrations = [...event.sdk.integrations || [], ...sdkInfo.integrations || []]; 14352 event.sdk.packages = [...event.sdk.packages || [], ...sdkInfo.packages || []]; 14353 return event; 14354 } 14355 function createSessionEnvelope(session, dsn, metadata, tunnel) { 14356 const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); 14357 const envelopeHeaders = __spreadValues(__spreadValues({ 14358 sent_at: (/* @__PURE__ */ new Date()).toISOString() 14359 }, sdkInfo && { sdk: sdkInfo }), !!tunnel && dsn && { dsn: dsnToString(dsn) }); 14360 const envelopeItem = "aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()]; 14361 return createEnvelope(envelopeHeaders, [envelopeItem]); 14362 } 14363 function createEventEnvelope(event, dsn, metadata, tunnel) { 14364 const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); 14365 const eventType = event.type && event.type !== "replay_event" ? event.type : "event";
14366 enhanceEventWithSdkInfo(event, metadata && metadata.sdk); 14367 const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn); 14368 delete event.sdkProcessingMetadata; 14369 const eventItem = [{ type: eventType }, event]; 14370 return createEnvelope(envelopeHeaders, [eventItem]); 14371 } 14372 function createSpanEnvelope(spans, client2) { 14373 function dscHasRequiredProps(dsc2) { 14374 return !!dsc2.trace_id && !!dsc2.public_key; 14375 } 14376 const dsc = getDynamicSamplingContextFromSpan(spans[0]); 14377 const dsn = client2 && client2.getDsn(); 14378 const tunnel = client2 && client2.getOptions().tunnel; 14379 const headers = __spreadValues(__spreadValues({ 14380 sent_at: (/* @__PURE__ */ new Date()).toISOString() 14381 }, dscHasRequiredProps(dsc) && { trace: dsc }), !!tunnel && dsn && { dsn: dsnToString(dsn) }); 14382 const beforeSendSpan = client2 && client2.getOptions().beforeSendSpan; 14383 const convertToSpanJSON = beforeSendSpan ? (span) => { 14384 const spanJson = beforeSendSpan(spanToJSON(span)); 14385 if (!spanJson) { 14386 showSpanDropWarning(); 14387 }
14388 return spanJson; 14389 } : (span) => spanToJSON(span); 14390 const items = []; 14391 for (const span of spans) { 14392 const spanJson = convertToSpanJSON(span); 14393 if (spanJson) { 14394 items.push(createSpanEnvelopeItem(spanJson)); 14395 } 14396 } 14397 return createEnvelope(headers, items); 14398 } 14399 function setMeasurement(name, value, unit, activeSpan = getActiveSpan()) { 14400 const rootSpan = activeSpan && getRootSpan(activeSpan); 14401 if (rootSpan) { 14402 DEBUG_BUILD$3 && logger.log(`[Measurement] Setting measurement on root span: ${name} = ${value} ${unit}`); 14403 rootSpan.addEvent(name, { 14404 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value, 14405 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit 14406 }); 14407 } 14408 } 14409 function timedEventsToMeasurements(events) { 14410 if (!events || events.length === 0) { 14411 return void 0; 14412 } 14413 const measurements = {}; 14414 events.forEach((event) => { 14415 const attributes = event.attributes || {}; 14416 const unit = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]; 14417 const value = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]; 14418 if (typeof unit === "string" && typeof value === "number") { 14419 measurements[event.name] = { value, unit }; 14420 } 14421 }); 14422 return measurements; 14423 } 14424 const MAX_SPAN_COUNT = 1e3; 14425 class SentrySpan { 14426 /** Epoch timestamp in seconds when the span started. */ 14427 /** Epoch timestamp in seconds when the span ended. */ 14428 /** Internal keeper of the status */ 14429 /** The timed events added to this span. */ 14430 /** if true, treat span as a standalone span (not part of a transaction) */ 14431 /** 14432 * You should never call the constructor manually, always use `Sentry.startSpan()` 14433 * or other span methods. 14434 * @internal 14435 * @hideconstructor 14436 * @hidden 14437 */ 14438 constructor(spanContext = {}) { 14439 this._traceId = spanContext.traceId || generateTraceId(); 14440 this._spanId = spanContext.spanId || generateSpanId(); 14441 this._startTime = spanContext.startTimestamp || timestampInSeconds(); 14442 this._attributes = {}; 14443 this.setAttributes(__spreadValues({ 14444 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "manual", 14445 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op 14446 }, spanContext.attributes)); 14447 this._name = spanContext.name; 14448 if (spanContext.parentSpanId) { 14449 this._parentSpanId = spanContext.parentSpanId; 14450 } 14451 if ("sampled" in spanContext) { 14452 this._sampled = spanContext.sampled; 14453 } 14454 if (spanContext.endTimestamp) { 14455 this._endTime = spanContext.endTimestamp; 14456 } 14457 this._events = []; 14458 this._isStandaloneSpan = spanContext.isStandalone; 14459 if (this._endTime) { 14460 this._onSpanEnded(); 14461 } 14462 } 14463 /** 14464 * This should generally not be used, 14465 * but it is needed for being compliant with the OTEL Span interface. 14466 * 14467 * @hidden 14468 * @internal 14469 */ 14470 addLink(_link) { 14471 return this; 14472 } 14473 /** 14474 * This should generally not be used, 14475 * but it is needed for being compliant with the OTEL Span interface. 14476 * 14477 * @hidden 14478 * @internal 14479 */ 14480 addLinks(_links) { 14481 return this; 14482 } 14483 /** 14484 * This should generally not be used, 14485 * but it is needed for being compliant with the OTEL Span interface. 14486 * 14487 * @hidden 14488 * @internal 14489 */ 14490 recordException(_exception, _time) { 14491 } 14492 /** @inheritdoc */ 14493 spanContext() { 14494 const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this; 14495 return { 14496 spanId, 14497 traceId, 14498 traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE 14499 }; 14500 } 14501 /** @inheritdoc */ 14502 setAttribute(key, value) { 14503 if (value === void 0) { 14504 delete this._attributes[key]; 14505 } else { 14506 this._attributes[key] = value; 14507 } 14508 return this; 14509 } 14510 /** @inheritdoc */ 14511 setAttributes(attributes) {
14512 Object.keys(attributes).forEach((key) => this.setAttribute(key, attributes[key])); 14513 return this; 14514 } 14515 /** 14516 * This should generally not be used, 14517 * but we need it for browser tracing where we want to adjust the start time afterwards. 14518 * USE THIS WITH CAUTION! 14519 * 14520 * @hidden 14521 * @internal 14522 */ 14523 updateStartTime(timeInput) { 14524 this._startTime = spanTimeInputToSeconds(timeInput); 14525 } 14526 /** 14527 * @inheritDoc 14528 */ 14529 setStatus(value) { 14530 this._status = value; 14531 return this; 14532 } 14533 /** 14534 * @inheritDoc 14535 */ 14536 updateName(name) { 14537 this._name = name; 14538 this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "custom"); 14539 return this; 14540 } 14541 /** @inheritdoc */ 14542 end(endTimestamp) { 14543 if (this._endTime) { 14544 return; 14545 } 14546 this._endTime = spanTimeInputToSeconds(endTimestamp); 14547 logSpanEnd(this); 14548 this._onSpanEnded(); 14549 } 14550 /** 14551 * Get JSON representation of this span. 14552 * 14553 * @hidden 14554 * @internal This method is purely for internal purposes and should not be used outside 14555 * of SDK code. If you need to get a JSON representation of a span, 14556 * use `spanToJSON(span)` instead. 14557 */ 14558 getSpanJSON() { 14559 return dropUndefinedKeys({ 14560 data: this._attributes, 14561 description: this._name, 14562 op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP], 14563 parent_span_id: this._parentSpanId, 14564 span_id: this._spanId, 14565 start_timestamp: this._startTime, 14566 status: getStatusMessage(this._status), 14567 timestamp: this._endTime, 14568 trace_id: this._traceId, 14569 origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN], 14570 _metrics_summary: getMetricSummaryJsonForSpan(this), 14571 profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID], 14572 exclusive_time: this._attributes[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME], 14573 measurements: timedEventsToMeasurements(this._events), 14574 is_segment: this._isStandaloneSpan && getRootSpan(this) === this || void 0, 14575 segment_id: this._isStandaloneSpan ? getRootSpan(this).spanContext().spanId : void 0 14576 }); 14577 } 14578 /** @inheritdoc */ 14579 isRecording() { 14580 return !this._endTime && !!this._sampled; 14581 } 14582 /** 14583 * @inheritdoc 14584 */ 14585 addEvent(name, attributesOrStartTime, startTime) { 14586 DEBUG_BUILD$3 && logger.log("[Tracing] Adding an event to span:", name); 14587 const time2 = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || timestampInSeconds(); 14588 const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {}; 14589 const event = { 14590 name, 14591 time: spanTimeInputToSeconds(time2), 14592 attributes 14593 }; 14594 this._events.push(event); 14595 return this; 14596 } 14597 /** 14598 * This method should generally not be used, 14599 * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set. 14600 * USE THIS WITH CAUTION! 14601 * @internal 14602 * @hidden 14603 * @experimental 14604 */ 14605 isStandaloneSpan() { 14606 return !!this._isStandaloneSpan; 14607 } 14608 /** Emit `spanEnd` when the span is ended. */ 14609 _onSpanEnded() { 14610 const client2 = getClient(); 14611 if (client2) { 14612 client2.emit("spanEnd", this); 14613 } 14614 const isSegmentSpan = this._isStandaloneSpan || this === getRootSpan(this); 14615 if (!isSegmentSpan) { 14616 return; 14617 } 14618 if (this._isStandaloneSpan) { 14619 if (this._sampled) { 14620 sendSpanEnvelope(createSpanEnvelope([this], client2)); 14621 } else { 14622 DEBUG_BUILD$3 && logger.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."); 14623 if (client2) { 14624 client2.recordDroppedEvent("sample_rate", "span"); 14625 } 14626 } 14627 return; 14628 } 14629 const transactionEvent = this._convertSpanToTransaction(); 14630 if (transactionEvent) { 14631 const scope = getCapturedScopesOnSpan(this).scope || getCurrentScope(); 14632 scope.captureEvent(transactionEvent); 14633 } 14634 } 14635 /** 14636 * Finish the transaction & prepare the event to send to Sentry. 14637 */ 14638 _convertSpanToTransaction() { 14639 if (!isFullFinishedSpan(spanToJSON(this))) { 14640 return void 0; 14641 } 14642 if (!this._name) { 14643 DEBUG_BUILD$3 && logger.warn("Transaction has no name, falling back to `<unlabeled transaction>`."); 14644 this._name = "<unlabeled transaction>"; 14645 } 14646 const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this); 14647 const scope = capturedSpanScope || getCurrentScope(); 14648 const client2 = scope.getClient() || getClient(); 14649 if (this._sampled !== true) { 14650 DEBUG_BUILD$3 && logger.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."); 14651 if (client2) { 14652 client2.recordDroppedEvent("sample_rate", "transaction"); 14653 } 14654 return void 0; 14655 } 14656 const finishedSpans = getSpanDescendants(this).filter((span) => span !== this && !isStandaloneSpan(span)); 14657 const spans = finishedSpans.map((span) => spanToJSON(span)).filter(isFullFinishedSpan); 14658 const source = this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; 14659 delete this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; 14660 spans.forEach((span) => { 14661 span.data && delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; 14662 }); 14663 const transaction = __spreadValues({ 14664 contexts: { 14665 trace: spanToTransactionTraceContext(this) 14666 }, 14667 spans: ( 14668 // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here 14669 // we do not use spans anymore after this point 14670 spans.length > MAX_SPAN_COUNT ? spans.sort((a2, b2) => a2.start_timestamp - b2.start_timestamp).slice(0, MAX_SPAN_COUNT) : spans 14671 ), 14672 start_timestamp: this._startTime, 14673 timestamp: this._endTime, 14674 transaction: this._name, 14675 type: "transaction", 14676 sdkProcessingMetadata: __spreadValues({ 14677 capturedSpanScope, 14678 capturedSpanIsolationScope 14679 }, dropUndefinedKeys({ 14680 dynamicSamplingContext: getDynamicSamplingContextFromSpan(this) 14681 })), 14682 _metrics_summary: getMetricSummaryJsonForSpan(this) 14683 }, source && { 14684 transaction_info: { 14685 source 14686 } 14687 }); 14688 const measurements = timedEventsToMeasurements(this._events); 14689 const hasMeasurements = measurements && Object.keys(measurements).length; 14690 if (hasMeasurements) { 14691 DEBUG_BUILD$3 && logger.log( 14692 "[Measurements] Adding measurements to transaction event", 14693 JSON.stringify(measurements, void 0, 2) 14694 ); 14695 transaction.measurements = measurements; 14696 } 14697 return transaction; 14698 } 14699 } 14700 function isSpanTimeInput(value) { 14701 return value && typeof value === "number" || value instanceof Date || Array.isArray(value); 14702 } 14703 function isFullFinishedSpan(input) { 14704 return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id; 14705 } 14706 function isStandaloneSpan(span) { 14707 return span instanceof SentrySpan && span.isStandaloneSpan(); 14708 } 14709 function sendSpanEnvelope(envelope) { 14710 const client2 = getClient(); 14711 if (!client2) { 14712 return; 14713 } 14714 const spanItems = envelope[1]; 14715 if (!spanItems || spanItems.length === 0) { 14716 client2.recordDroppedEvent("before_send", "span"); 14717 return; 14718 } 14719 client2.sendEnvelope(envelope); 14720 } 14721 const SUPPRESS_TRACING_KEY = "__SENTRY_SUPPRESS_TRACING__"; 14722 function startInactiveSpan(options2) { 14723 const acs = getAcs(); 14724 if (acs.startInactiveSpan) { 14725 return acs.startInactiveSpan(options2); 14726 } 14727 const spanArguments = parseSentrySpanArguments(options2); 14728 const { forceTransaction, parentSpan: customParentSpan } = options2; 14729 const wrapper = options2.scope ? (callback) => withScope(options2.scope, callback) : customParentSpan !== void 0 ? (callback) => withActiveSpan(customParentSpan, callback) : (callback) => callback(); 14730 return wrapper(() => { 14731 const scope = getCurrentScope(); 14732 const parentSpan = getParentSpan(scope); 14733 const shouldSkipSpan = options2.onlyIfParent && !parentSpan; 14734 if (shouldSkipSpan) { 14735 return new SentryNonRecordingSpan(); 14736 } 14737 return createChildOrRootSpan({ 14738 parentSpan, 14739 spanArguments, 14740 forceTransaction, 14741 scope 14742 }); 14743 }); 14744 } 14745 function withActiveSpan(span, callback) { 14746 const acs = getAcs(); 14747 if (acs.withActiveSpan) { 14748 return acs.withActiveSpan(span, callback); 14749 } 14750 return withScope((scope) => { 14751 _setSpanForScope(scope, span || void 0); 14752 return callback(scope); 14753 }); 14754 } 14755 function createChildOrRootSpan({ 14756 parentSpan, 14757 spanArguments, 14758 forceTransaction, 14759 scope 14760 }) { 14761 if (!hasTracingEnabled()) { 14762 return new SentryNonRecordingSpan(); 14763 } 14764 const isolationScope = getIsolationScope(); 14765 let span; 14766 if (parentSpan && !forceTransaction) { 14767 span = _startChildSpan(parentSpan, scope, spanArguments); 14768 addChildSpanToSpan(parentSpan, span); 14769 } else if (parentSpan) { 14770 const dsc = getDynamicSamplingContextFromSpan(parentSpan); 14771 const { traceId, spanId: parentSpanId } = parentSpan.spanContext(); 14772 const parentSampled = spanIsSampled(parentSpan); 14773 span = _startRootSpan( 14774 __spreadValues({ 14775 traceId, 14776 parentSpanId 14777 }, spanArguments), 14778 scope, 14779 parentSampled 14780 ); 14781 freezeDscOnSpan(span, dsc); 14782 } else { 14783 const { 14784 traceId, 14785 dsc, 14786 parentSpanId, 14787 sampled: parentSampled 14788 } = __spreadValues(__spreadValues({}, isolationScope.getPropagationContext()), scope.getPropagationContext()); 14789 span = _startRootSpan( 14790 __spreadValues({ 14791 traceId, 14792 parentSpanId 14793 }, spanArguments), 14794 scope, 14795 parentSampled 14796 ); 14797 if (dsc) { 14798 freezeDscOnSpan(span, dsc); 14799 } 14800 } 14801 logSpanStart(span); 14802 setCapturedScopesOnSpan(span, scope, isolationScope); 14803 return span; 14804 } 14805 function parseSentrySpanArguments(options2) { 14806 const exp = options2.experimental || {}; 14807 const initialCtx = __spreadValues({ 14808 isStandalone: exp.standalone 14809 }, options2); 14810 if (options2.startTime) { 14811 const ctx = __spreadValues({}, initialCtx); 14812 ctx.startTimestamp = spanTimeInputToSeconds(options2.startTime); 14813 delete ctx.startTime; 14814 return ctx; 14815 } 14816 return initialCtx; 14817 } 14818 function getAcs() { 14819 const carrier = getMainCarrier(); 14820 return getAsyncContextStrategy(carrier); 14821 } 14822 function _startRootSpan(spanArguments, scope, parentSampled) { 14823 const client2 = getClient(); 14824 const options2 = client2 && client2.getOptions() || {}; 14825 const { name = "", attributes } = spanArguments; 14826 const [sampled, sampleRate] = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? [false] : sampleSpan(options2, { 14827 name, 14828 parentSampled, 14829 attributes, 14830 transactionContext: { 14831 name, 14832 parentSampled 14833 } 14834 }); 14835 const rootSpan = new SentrySpan(__spreadProps(__spreadValues({}, spanArguments), { 14836 attributes: __spreadValues({ 14837 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom" 14838 }, spanArguments.attributes), 14839 sampled 14840 })); 14841 if (sampleRate !== void 0) { 14842 rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate); 14843 } 14844 if (client2) { 14845 client2.emit("spanStart", rootSpan); 14846 } 14847 return rootSpan; 14848 } 14849 function _startChildSpan(parentSpan, scope, spanArguments) { 14850 const { spanId, traceId } = parentSpan.spanContext(); 14851 const sampled = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? false : spanIsSampled(parentSpan); 14852 const childSpan = sampled ? new SentrySpan(__spreadProps(__spreadValues({}, spanArguments), { 14853 parentSpanId: spanId, 14854 traceId, 14855 sampled 14856 })) : new SentryNonRecordingSpan({ traceId }); 14857 addChildSpanToSpan(parentSpan, childSpan); 14858 const client2 = getClient(); 14859 if (client2) { 14860 client2.emit("spanStart", childSpan); 14861 if (spanArguments.endTimestamp) { 14862 client2.emit("spanEnd", childSpan); 14863 } 14864 } 14865 return childSpan; 14866 } 14867 function getParentSpan(scope) { 14868 const span = _getSpanForScope(scope); 14869 if (!span) { 14870 return void 0; 14871 } 14872 const client2 = getClient(); 14873 const options2 = client2 ? client2.getOptions() : {}; 14874 if (options2.parentSpanIsAlwaysRootSpan) { 14875 return getRootSpan(span); 14876 } 14877 return span; 14878 } 14879 const TRACING_DEFAULTS = { 14880 idleTimeout: 1e3, 14881 finalTimeout: 3e4, 14882 childSpanTimeout: 15e3 14883 }; 14884 const FINISH_REASON_HEARTBEAT_FAILED = "heartbeatFailed"; 14885 const FINISH_REASON_IDLE_TIMEOUT = "idleTimeout"; 14886 const FINISH_REASON_FINAL_TIMEOUT = "finalTimeout"; 14887 const FINISH_REASON_EXTERNAL_FINISH = "externalFinish";
14888 function startIdleSpan(startSpanOptions, options2 = {}) { 14889 const activities = /* @__PURE__ */ new Map(); 14890 let _finished = false; 14891 let _idleTimeoutID; 14892 let _finishReason = FINISH_REASON_EXTERNAL_FINISH; 14893 let _autoFinishAllowed = !options2.disableAutoFinish; 14894 const _cleanupHooks = []; 14895 const { 14896 idleTimeout = TRACING_DEFAULTS.idleTimeout, 14897 finalTimeout = TRACING_DEFAULTS.finalTimeout, 14898 childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout, 14899 beforeSpanEnd 14900 } = options2; 14901 const client2 = getClient(); 14902 if (!client2 || !hasTracingEnabled()) { 14903 return new SentryNonRecordingSpan(); 14904 } 14905 const scope = getCurrentScope(); 14906 const previousActiveSpan = getActiveSpan(); 14907 const span = _startIdleSpan(startSpanOptions); 14908 span.end = new Proxy(span.end, { 14909 apply(target, thisArg, args) { 14910 if (beforeSpanEnd) { 14911 beforeSpanEnd(span); 14912 } 14913 const [definedEndTimestamp, ...rest] = args; 14914 const timestamp = definedEndTimestamp || timestampInSeconds(); 14915 const spanEndTimestamp = spanTimeInputToSeconds(timestamp); 14916 const spans = getSpanDescendants(span).filter((child) => child !== span); 14917 if (!spans.length) { 14918 onIdleSpanEnded(spanEndTimestamp); 14919 return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]); 14920 } 14921 const childEndTimestamps = spans.map((span2) => spanToJSON(span2).timestamp).filter((timestamp2) => !!timestamp2); 14922 const latestSpanEndTimestamp = childEndTimestamps.length ? Math.max(...childEndTimestamps) : void 0; 14923 const spanStartTimestamp = spanToJSON(span).start_timestamp; 14924 const endTimestamp = Math.min( 14925 spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1e3 : Infinity, 14926 Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)) 14927 ); 14928 onIdleSpanEnded(endTimestamp); 14929 return Reflect.apply(target, thisArg, [endTimestamp, ...rest]); 14930 } 14931 }); 14932 function _cancelIdleTimeout() { 14933 if (_idleTimeoutID) { 14934 clearTimeout(_idleTimeoutID); 14935 _idleTimeoutID = void 0; 14936 } 14937 } 14938 function _restartIdleTimeout(endTimestamp) { 14939 _cancelIdleTimeout(); 14940 _idleTimeoutID = setTimeout(() => { 14941 if (!_finished && activities.size === 0 && _autoFinishAllowed) { 14942 _finishReason = FINISH_REASON_IDLE_TIMEOUT; 14943 span.end(endTimestamp); 14944 } 14945 }, idleTimeout); 14946 } 14947 function _restartChildSpanTimeout(endTimestamp) { 14948 _idleTimeoutID = setTimeout(() => { 14949 if (!_finished && _autoFinishAllowed) { 14950 _finishReason = FINISH_REASON_HEARTBEAT_FAILED; 14951 span.end(endTimestamp); 14952 } 14953 }, childSpanTimeout); 14954 } 14955 function _pushActivity(spanId) { 14956 _cancelIdleTimeout(); 14957 activities.set(spanId, true); 14958 const endTimestamp = timestampInSeconds(); 14959 _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1e3); 14960 } 14961 function _popActivity(spanId) { 14962 if (activities.has(spanId)) { 14963 activities.delete(spanId); 14964 } 14965 if (activities.size === 0) { 14966 const endTimestamp = timestampInSeconds(); 14967 _restartIdleTimeout(endTimestamp + idleTimeout / 1e3); 14968 } 14969 } 14970 function onIdleSpanEnded(endTimestamp) { 14971 _finished = true; 14972 activities.clear(); 14973 _cleanupHooks.forEach((cleanup) => cleanup()); 14974 _setSpanForScope(scope, previousActiveSpan); 14975 const spanJSON = spanToJSON(span); 14976 const { start_timestamp: startTimestamp } = spanJSON; 14977 if (!startTimestamp) { 14978 return; 14979 } 14980 const attributes = spanJSON.data || {}; 14981 if (!attributes[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) { 14982 span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason); 14983 } 14984 logger.log(`[Tracing] Idle span "${spanJSON.op}" finished`); 14985 const childSpans = getSpanDescendants(span).filter((child) => child !== span); 14986 let discardedSpans = 0; 14987 childSpans.forEach((childSpan) => { 14988 if (childSpan.isRecording()) { 14989 childSpan.setStatus({ code: SPAN_STATUS_ERROR, message: "cancelled" });
14990 childSpan.end(endTimestamp); 14991 DEBUG_BUILD$3 && logger.log("[Tracing] Cancelling span since span ended early", JSON.stringify(childSpan, void 0, 2)); 14992 } 14993 const childSpanJSON = spanToJSON(childSpan); 14994 const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON; 14995 const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp; 14996 const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1e3; 14997 const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError; 14998 if (DEBUG_BUILD$3) { 14999 const stringifiedSpan = JSON.stringify(childSpan, void 0, 2); 15000 if (!spanStartedBeforeIdleSpanEnd) { 15001 logger.log("[Tracing] Discarding span since it happened after idle span was finished", stringifiedSpan); 15002 } else if (!spanEndedBeforeFinalTimeout) { 15003 logger.log("[Tracing] Discarding span since it finished after idle span final timeout", stringifiedSpan); 15004 } 15005 } 15006 if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) { 15007 removeChildSpanFromSpan(span, childSpan); 15008 discardedSpans++; 15009 } 15010 }); 15011 if (discardedSpans > 0) { 15012 span.setAttribute("sentry.idle_span_discarded_spans", discardedSpans); 15013 } 15014 } 15015 _cleanupHooks.push( 15016 client2.on("spanStart", (startedSpan) => { 15017 if (_finished || startedSpan === span || !!spanToJSON(startedSpan).timestamp) { 15018 return; 15019 } 15020 const allSpans = getSpanDescendants(span); 15021 if (allSpans.includes(startedSpan)) { 15022 _pushActivity(startedSpan.spanContext().spanId); 15023 } 15024 }) 15025 ); 15026 _cleanupHooks.push( 15027 client2.on("spanEnd", (endedSpan) => { 15028 if (_finished) { 15029 return; 15030 } 15031 _popActivity(endedSpan.spanContext().spanId); 15032 }) 15033 ); 15034 _cleanupHooks.push( 15035 client2.on("idleSpanEnableAutoFinish", (spanToAllowAutoFinish) => { 15036 if (spanToAllowAutoFinish === span) { 15037 _autoFinishAllowed = true; 15038 _restartIdleTimeout(); 15039 if (activities.size) { 15040 _restartChildSpanTimeout(); 15041 } 15042 } 15043 }) 15044 ); 15045 if (!options2.disableAutoFinish) { 15046 _restartIdleTimeout(); 15047 } 15048 setTimeout(() => { 15049 if (!_finished) { 15050 span.setStatus({ code: SPAN_STATUS_ERROR, message: "deadline_exceeded" }); 15051 _finishReason = FINISH_REASON_FINAL_TIMEOUT; 15052 span.end(); 15053 } 15054 }, finalTimeout); 15055 return span; 15056 } 15057 function _startIdleSpan(options2) { 15058 const span = startInactiveSpan(options2); 15059 _setSpanForScope(getCurrentScope(), span); 15060 DEBUG_BUILD$3 && logger.log("[Tracing] Started span is an idle span"); 15061 return span; 15062 } 15063 function notifyEventProcessors(processors, event, hint, index2 = 0) { 15064 return new SyncPromise((resolve, reject) => { 15065 const processor = processors[index2]; 15066 if (event === null || typeof processor !== "function") { 15067 resolve(event); 15068 } else { 15069 const result = processor(__spreadValues({}, event), hint); 15070 DEBUG_BUILD$3 && processor.id && result === null && logger.log(`Event processor "${processor.id}" dropped event`); 15071 if (isThenable$1(result)) { 15072 void result.then((final) => notifyEventProcessors(processors, final, hint, index2 + 1).then(resolve)).then(null, reject); 15073 } else { 15074 void notifyEventProcessors(processors, result, hint, index2 + 1).then(resolve).then(null, reject); 15075 } 15076 } 15077 }); 15078 } 15079 let parsedStackResults; 15080 let lastKeysCount;
15081 let cachedFilenameDebugIds; 15082 function getFilenameToDebugIdMap(stackParser) { 15083 const debugIdMap = GLOBAL_OBJ._sentryDebugIds; 15084 if (!debugIdMap) { 15085 return {}; 15086 } 15087 const debugIdKeys = Object.keys(debugIdMap); 15088 if (cachedFilenameDebugIds && debugIdKeys.length === lastKeysCount) { 15089 return cachedFilenameDebugIds; 15090 } 15091 lastKeysCount = debugIdKeys.length; 15092 cachedFilenameDebugIds = debugIdKeys.reduce((acc, stackKey) => { 15093 if (!parsedStackResults) { 15094 parsedStackResults = {}; 15095 } 15096 const result = parsedStackResults[stackKey]; 15097 if (result) { 15098 acc[result[0]] = result[1]; 15099 } else { 15100 const parsedStack = stackParser(stackKey); 15101 for (let i2 = parsedStack.length - 1; i2 >= 0; i2--) { 15102 const stackFrame = parsedStack[i2]; 15103 const filename = stackFrame && stackFrame.filename; 15104 const debugId = debugIdMap[stackKey]; 15105 if (filename && debugId) { 15106 acc[filename] = debugId; 15107 parsedStackResults[stackKey] = [filename, debugId]; 15108 break; 15109 } 15110 } 15111 } 15112 return acc; 15113 }, {}); 15114 return cachedFilenameDebugIds; 15115 } 15116 function applyScopeDataToEvent(event, data) { 15117 const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data; 15118 applyDataToEvent(event, data); 15119 if (span) { 15120 applySpanToEvent(event, span); 15121 } 15122 applyFingerprintToEvent(event, fingerprint); 15123 applyBreadcrumbsToEvent(event, breadcrumbs); 15124 applySdkMetadataToEvent(event, sdkProcessingMetadata); 15125 } 15126 function mergeScopeData(data, mergeData) { 15127 const { 15128 extra, 15129 tags, 15130 user, 15131 contexts, 15132 level, 15133 sdkProcessingMetadata, 15134 breadcrumbs, 15135 fingerprint, 15136 eventProcessors, 15137 attachments, 15138 propagationContext, 15139 transactionName, 15140 span 15141 } = mergeData; 15142 mergeAndOverwriteScopeData(data, "extra", extra); 15143 mergeAndOverwriteScopeData(data, "tags", tags); 15144 mergeAndOverwriteScopeData(data, "user", user); 15145 mergeAndOverwriteScopeData(data, "contexts", contexts); 15146 data.sdkProcessingMetadata = merge$2(data.sdkProcessingMetadata, sdkProcessingMetadata, 2); 15147 if (level) { 15148 data.level = level; 15149 } 15150 if (transactionName) { 15151 data.transactionName = transactionName; 15152 } 15153 if (span) { 15154 data.span = span; 15155 } 15156 if (breadcrumbs.length) { 15157 data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs]; 15158 } 15159 if (fingerprint.length) { 15160 data.fingerprint = [...data.fingerprint, ...fingerprint]; 15161 } 15162 if (eventProcessors.length) { 15163 data.eventProcessors = [...data.eventProcessors, ...eventProcessors]; 15164 } 15165 if (attachments.length) { 15166 data.attachments = [...data.attachments, ...attachments]; 15167 } 15168 data.propagationContext = __spreadValues(__spreadValues({}, data.propagationContext), propagationContext); 15169 } 15170 function mergeAndOverwriteScopeData(data, prop, mergeVal) { 15171 data[prop] = merge$2(data[prop], mergeVal, 1); 15172 } 15173 function applyDataToEvent(event, data) { 15174 const { extra, tags, user, contexts, level, transactionName } = data; 15175 const cleanedExtra = dropUndefinedKeys(extra); 15176 if (cleanedExtra && Object.keys(cleanedExtra).length) { 15177 event.extra = __spreadValues(__spreadValues({}, cleanedExtra), event.extra); 15178 } 15179 const cleanedTags = dropUndefinedKeys(tags); 15180 if (cleanedTags && Object.keys(cleanedTags).length) { 15181 event.tags = __spreadValues(__spreadValues({}, cleanedTags), event.tags); 15182 } 15183 const cleanedUser = dropUndefinedKeys(user); 15184 if (cleanedUser && Object.keys(cleanedUser).length) { 15185 event.user = __spreadValues(__spreadValues({}, cleanedUser), event.user); 15186 } 15187 const cleanedContexts = dropUndefinedKeys(contexts); 15188 if (cleanedContexts && Object.keys(cleanedContexts).length) { 15189 event.contexts = __spreadValues(__spreadValues({}, cleanedContexts), event.contexts); 15190 } 15191 if (level) { 15192 event.level = level; 15193 } 15194 if (transactionName && event.type !== "transaction") { 15195 event.transaction = transactionName; 15196 } 15197 } 15198 function applyBreadcrumbsToEvent(event, breadcrumbs) { 15199 const mergedBreadcrumbs = [...event.breadcrumbs || [], ...breadcrumbs]; 15200 event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : void 0; 15201 } 15202 function applySdkMetadataToEvent(event, sdkProcessingMetadata) { 15203 event.sdkProcessingMetadata = __spreadValues(__spreadValues({}, event.sdkProcessingMetadata), sdkProcessingMetadata); 15204 } 15205 function applySpanToEvent(event, span) { 15206 event.contexts = __spreadValues({ 15207 trace: spanToTraceContext(span) 15208 }, event.contexts); 15209 event.sdkProcessingMetadata = __spreadValues({ 15210 dynamicSamplingContext: getDynamicSamplingContextFromSpan(span) 15211 }, event.sdkProcessingMetadata); 15212 const rootSpan = getRootSpan(span); 15213 const transactionName = spanToJSON(rootSpan).description; 15214 if (transactionName && !event.transaction && event.type === "transaction") { 15215 event.transaction = transactionName; 15216 } 15217 } 15218 function applyFingerprintToEvent(event, fingerprint) { 15219 event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint]
15219: []; 15220 if (fingerprint) { 15221 event.fingerprint = event.fingerprint.concat(fingerprint); 15222 } 15223 if (event.fingerprint && !event.fingerprint.length) { 15224 delete event.fingerprint; 15225 } 15226 } 15227 function prepareEvent(options2, event, hint, scope, client2, isolationScope) { 15228 const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = options2; 15229 const prepared = __spreadProps(__spreadValues({}, event), { 15230 event_id: event.event_id || hint.event_id || uuid4(), 15231 timestamp: event.timestamp || dateTimestampInSeconds() 15232 }); 15233 const integrations = hint.integrations || options2.integrations.map((i2) => i2.name); 15234 applyClientOptions(prepared, options2); 15235 applyIntegrationsMetadata(prepared, integrations); 15236 if (client2) { 15237 client2.emit("applyFrameMetadata", event); 15238 } 15239 if (event.type === void 0) { 15240 applyDebugIds(prepared, options2.stackParser); 15241 } 15242 const finalScope = getFinalScope(scope, hint.captureContext); 15243 if (hint.mechanism) { 15244 addExceptionMechanism(prepared, hint.mechanism); 15245 } 15246 const clientEventProcessors = client2 ? client2.getEventProcessors() : []; 15247 const data = getGlobalScope().getScopeData(); 15248 if (isolationScope) { 15249 const isolationData = isolationScope.getScopeData(); 15250 mergeScopeData(data, isolationData); 15251 } 15252 if (finalScope) { 15253 const finalScopeData = finalScope.getScopeData(); 15254 mergeScopeData(data, finalScopeData); 15255 } 15256 const attachments = [...hint.attachments || [], ...data.attachments]; 15257 if (attachments.length) { 15258 hint.attachments = attachments; 15259 } 15260 applyScopeDataToEvent(prepared, data); 15261 const eventProcessors = [ 15262 ...clientEventProcessors, 15263 // Run scope event processors _after_ all other processors 15264 ...data.eventProcessors 15265 ]; 15266 const result = notifyEventProcessors(eventProcessors, prepared, hint); 15267 return result.then((evt) => { 15268 if (evt) { 15269 applyDebugMeta(evt); 15270 } 15271 if (typeof normalizeDepth === "number" && normalizeDepth > 0) { 15272 return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); 15273 } 15274 return evt; 15275 }); 15276 } 15277 function applyClientOptions(event, options2) { 15278 const { environment, release, dist: dist2, maxValueLength = 250 } = options2; 15279 event.environment = event.environment || environment || DEFAULT_ENVIRONMENT; 15280 if (!event.release && release) { 15281 event.release = release; 15282 } 15283 if (!event.dist && dist2) { 15284 event.dist = dist2; 15285 } 15286 if (event.message) { 15287 event.message = truncate(event.message, maxValueLength); 15288 } 15289 const exception = event.exception && event.exception.values && event.exception.values[0]; 15290 if (exception && exception.value) { 15291 exception.value = truncate(exception.value, maxValueLength); 15292 } 15293 const request = event.request; 15294 if (request && request.url) { 15295 request.url = truncate(request.url, maxValueLength); 15296 } 15297 } 15298 function applyDebugIds(event, stackParser) { 15299 const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); 15300 try { 15301 event.exception.values.forEach((exception) => { 15302 exception.stacktrace.frames.forEach((frame2) => { 15303 if (filenameDebugIdMap && frame2.filename) { 15304 frame2.debug_id = filenameDebugIdMap[frame2.filename]; 15305 } 15306 }); 15307 }); 15308 } catch (e2) { 15309 } 15310 } 15311 function applyDebugMeta(event) { 15312 const filenameDebugIdMap = {}; 15313 try { 15314 event.exception.values.forEach((exception) => { 15315 exception.stacktrace.frames.forEach((frame2) => { 15316 if (frame2.debug_id) { 15317 if (frame2.abs_path) { 15318 filenameDebugIdMap[frame2.abs_path] = frame2.debug_id; 15319 } else if (frame2.filename) { 15320 filenameDebugIdMap[frame2.filename] = frame2.debug_id; 15321 } 15322 delete frame2.debug_id; 15323 } 15324 }); 15325 }); 15326 } catch (e2) { 15327 } 15328 if (Object.keys(filenameDebugIdMap).length === 0) { 15329 return; 15330 } 15331 event.debug_meta = event.debug_meta || {}; 15332 event.debug_meta.images = event.debug_meta.images || []; 15333 const images = event.debug_meta.images;
15334 Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => { 15335 images.push({ 15336 type: "sourcemap", 15337 code_file: filename, 15338 debug_id 15339 }); 15340 }); 15341 } 15342 function applyIntegrationsMetadata(event, integrationNames) { 15343 if (integrationNames.length > 0) { 15344 event.sdk = event.sdk || {}; 15345 event.sdk.integrations = [...event.sdk.integrations || [], ...integrationNames]; 15346 } 15347 } 15348 function normalizeEvent(event, depth, maxBreadth) { 15349 if (!event) { 15350 return null; 15351 } 15352 const normalized = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, event), event.breadcrumbs && { 15353 breadcrumbs: event.breadcrumbs.map((b2) => __spreadValues(__spreadValues({}, b2), b2.data && { 15354 data: normalize(b2.data, depth, maxBreadth) 15355 })) 15356 }), event.user && { 15357 user: normalize(event.user, depth, maxBreadth) 15358 }), event.contexts && { 15359 contexts: normalize(event.contexts, depth, maxBreadth) 15360 }), event.extra && { 15361 extra: normalize(event.extra, depth, maxBreadth) 15362 }); 15363 if (event.contexts && event.contexts.trace && normalized.contexts) { 15364 normalized.contexts.trace = event.contexts.trace; 15365 if (event.contexts.trace.data) { 15366 normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth); 15367 } 15368 } 15369 if (event.spans) { 15370 normalized.spans = event.spans.map((span) => { 15371 return __spreadValues(__spreadValues({}, span), span.data && { 15372 data: normalize(span.data, depth, maxBreadth) 15373 }); 15374 }); 15375 } 15376 if (event.contexts && event.contexts.flags && normalized.contexts) { 15377 normalized.contexts.flags = normalize(event.contexts.flags, 3, maxBreadth); 15378 } 15379 return normalized; 15380 } 15381 function getFinalScope(scope, captureContext) { 15382 if (!captureContext) { 15383 return scope; 15384 } 15385 const finalScope = scope ? scope.clone() : new Scope(); 15386 finalScope.update(captureContext); 15387 return finalScope; 15388 } 15389 function parseEventHintOrCaptureContext(hint) { 15390 if (!hint) { 15391 return void 0; 15392 } 15393 if (hintIsScopeOrFunction(hint)) { 15394 return { captureContext: hint }; 15395 } 15396 if (hintIsScopeContext(hint)) { 15397 return { 15398 captureContext: hint 15399 }; 15400 } 15401 return hint; 15402 } 15403 function hintIsScopeOrFunction(hint) { 15404 return hint instanceof Scope || typeof hint === "function"; 15405 } 15406 const captureContextKeys = [ 15407 "user", 15408 "level", 15409 "extra", 15410 "contexts", 15411 "tags", 15412 "fingerprint", 15413 "requestSession", 15414 "propagationContext" 15415 ]; 15416 function hintIsScopeContext(hint) { 15417 return Object.keys(hint).some((key) => captureContextKeys.includes(key)); 15418 } 15419 function captureException(exception, hint) { 15420 return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint)); 15421 } 15422 function captureEvent(event, hint) { 15423 return getCurrentScope().captureEvent(event, hint); 15424 } 15425 function setContext(name, context) { 15426 getIsolationScope().setContext(name, context); 15427 } 15428 function isEnabled() { 15429 const client2 = getClient(); 15430 return !!client2 && client2.getOptions().enabled !== false && !!client2.getTransport(); 15431 } 15432 function startSession(context) { 15433 const client2 = getClient(); 15434 const isolationScope = getIsolationScope(); 15435 const currentScope = getCurrentScope(); 15436 const { release, environment = DEFAULT_ENVIRONMENT } = client2 && client2.getOptions() || {}; 15437 const { userAgent } = GLOBAL_OBJ.navigator || {}; 15438 const session = makeSession(__spreadValues(__spreadValues({ 15439 release, 15440 environment, 15441 user: currentScope.getUser() || isolationScope.getUser() 15442 }, userAgent && { userAgent }), context)); 15443 const currentSession = isolationScope.getSession(); 15444 if (currentSession && currentSession.status === "ok") { 15445 updateSession(currentSession, { status: "exited" }); 15446 } 15447 endSession(); 15448 isolationScope.setSession(session); 15449 currentScope.setSession(session); 15450 return session; 15451 } 15452 function endSession() { 15453 const isolationScope = getIsolationScope(); 15454 const currentScope = getCurrentScope(); 15455 const session = currentScope.getSession() || isolationScope.getSession(); 15456 if (session) { 15457 closeSession(session); 15458 } 15459 _sendSessionUpdate(); 15460 isolationScope.setSession(); 15461 currentScope.setSession(); 15462 } 15463 function _sendSessionUpdate() { 15464 const isolationScope = getIsolationScope(); 15465 const currentScope = getCurrentScope(); 15466 const client2 = getClient(); 15467 const session = currentScope.getSession() || isolationScope.getSession(); 15468 if (session && client2) { 15469 client2.captureSession(session); 15470 } 15471 } 15472 function captureSession(end = false) { 15473 if (end) { 15474 endSession(); 15475 return; 15476 } 15477 _sendSessionUpdate(); 15478 } 15479 const SENTRY_API_VERSION = "7"; 15480 function getBaseApiEndpoint(dsn) { 15481 const protocol = dsn.protocol ? `${dsn.protocol}:` : ""; 15482 const port = dsn.port ? `:${dsn.port}` : ""; 15483 return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ""}/api/`; 15484 } 15485 function _getIngestEndpoint(dsn) { 15486 return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; 15487 } 15488 function _encodedAuth(dsn, sdkInfo) { 15489 const params = { 15490 sentry_version: SENTRY_API_VERSION 15491 }; 15492 if (dsn.publicKey) { 15493 params.sentry_key = dsn.publicKey; 15494 } 15495 if (sdkInfo) { 15496 params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`; 15497 } 15498 return new URLSearchParams(params).toString(); 15499 } 15500 function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) { 15501 return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; 15502 } 15503 const installedIntegrations = []; 15504 function filterDuplicates(integrations) { 15505 const integrationsByName = {}; 15506 integrations.forEach((currentInstance) => { 15507 const { name } = currentInstance; 15508 const existingInstance = integrationsByName[name]; 15509 if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { 15510 return; 15511 } 15512 integrationsByName[name] = currentInstance; 15513 }); 15514 return Object.values(integrationsByName); 15515 } 15516 function getIntegrationsToSetup(options2) { 15517 const defaultIntegrations = options2.defaultIntegrations || []; 15518 const userIntegrations = options2.integrations; 15519 defaultIntegrations.forEach((integration) => { 15520 integration.isDefaultInstance = true; 15521 }); 15522 let integrations; 15523 if (Array.isArray(userIntegrations)) { 15524 integrations = [...defaultIntegrations, ...userIntegrations]; 15525 } else if (typeof userIntegrations === "function") { 15526 const resolvedUserIntegrations = userIntegrations(defaultIntegrations); 15527 integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations]; 15528 } else { 15529 integrations = defaultIntegrations; 15530 } 15531 const finalIntegrations = filterDuplicates(integrations); 15532 const debugIndex = finalIntegrations.findIndex((integration) => integration.name === "Debug"); 15533 if (debugIndex > -1) { 15534 const [debugInstance] = finalIntegrations.splice(debugIndex, 1); 15535 finalIntegrations.push(debugInstance); 15536 } 15537 return finalIntegrations; 15538 } 15539 function setupIntegrations(client2, integrations) { 15540 const integrationIndex = {}; 15541 integrations.forEach((integration) => { 15542 if (integration) { 15543 setupIntegration(client2, integration, integrationIndex); 15544 } 15545 }); 15546 return integrationIndex; 15547 } 15548 function afterSetupIntegrations(client2, integrations) { 15549 for (const integration of integrations) { 15550 if (integration && integration.afterAllSetup) { 15551 integration.afterAllSetup(client2); 15552 } 15553 } 15554 } 15555 function setupIntegration(client2, integration, integrationIndex) { 15556 if (integrationIndex[integration.name]) { 15557 DEBUG_BUILD$3 && logger.log(`Integration skipped because it was already installed: ${integration.name}`); 15558 return; 15559 } 15560 integrationIndex[integration.name] = integration; 15561 if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === "function") { 15562 integration.setupOnce(); 15563 installedIntegrations.push(integration.name); 15564 } 15565 if (integration.setup && typeof integration.setup === "function") { 15566 integration.setup(client2); 15567 } 15568 if (typeof integration.preprocessEvent === "function") { 15569 const callback = integration.preprocessEvent.bind(integration); 15570 client2.on("preprocessEvent", (event, hint) => callback(event, hint, client2)); 15571 } 15572 if (typeof integration.processEvent === "function") { 15573 const callback = integration.processEvent.bind(integration); 15574 const processor = Object.assign((event, hint) => callback(event, hint, client2), { 15575 id: integration.name 15576 }); 15577 client2.addEventProcessor(processor); 15578 } 15579 DEBUG_BUILD$3 && logger.log(`Integration installed: ${integration.name}`); 15580 } 15581 function defineIntegration(fn2) { 15582 return fn2; 15583 } 15584 function createClientReportEnvelope(discarded_events, dsn, timestamp) { 15585 const clientReportItem = [ 15586 { type: "client_report" }, 15587 { 15588 timestamp: dateTimestampInSeconds(), 15589 discarded_events 15590 } 15591 ]; 15592 return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]); 15593 }
15594 class SentryError extends Error { 15595 constructor(message, logLevel = "warn") { 15596 super(message); 15597 this.message = message; 15598 this.logLevel = logLevel; 15599 } 15600 } 15601 const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; 15602 class BaseClient { 15603 /** Options passed to the SDK. */ 15604 /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ 15605 /** Array of set up integrations. */ 15606 /** Number of calls being processed */ 15607 /** Holds flushable */ 15608 // eslint-disable-next-line @typescript-eslint/ban-types 15609 /** 15610 * Initializes this client instance. 15611 * 15612 * @param options Options for the client. 15613 */ 15614 constructor(options2) { 15615 this._options = options2; 15616 this._integrations = {}; 15617 this._numProcessing = 0; 15618 this._outcomes = {}; 15619 this._hooks = {}; 15620 this._eventProcessors = []; 15621 if (options2.dsn) { 15622 this._dsn = makeDsn(options2.dsn); 15623 } else { 15624 DEBUG_BUILD$3 && logger.warn("No DSN provided, client will not send events."); 15625 } 15626 if (this._dsn) { 15627 const url = getEnvelopeEndpointWithUrlEncodedAuth( 15628 this._dsn, 15629 options2.tunnel, 15630 options2._metadata ? options2._metadata.sdk : void 0 15631 ); 15632 this._transport = options2.transport(__spreadProps(__spreadValues({ 15633 tunnel: this._options.tunnel, 15634 recordDroppedEvent: this.recordDroppedEvent.bind(this) 15635 }, options2.transportOptions), { 15636 url 15637 })); 15638 } 15639 const tracingOptions = ["enableTracing", "tracesSampleRate", "tracesSampler"]; 15640 const undefinedOption = tracingOptions.find((option) => option in options2 && options2[option] == void 0); 15641 if (undefinedOption) { 15642 consoleSandbox(() => { 15643 console.warn( 15644 `[Sentry] Deprecation warning: \`${undefinedOption}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.` 15645 ); 15646 }); 15647 } 15648 } 15649 /** 15650 * @inheritDoc 15651 */ 15652 captureException(exception, hint, scope) { 15653 const eventId = uuid4(); 15654 if (checkOrSetAlreadyCaught(exception)) { 15655 DEBUG_BUILD$3 && logger.log(ALREADY_SEEN_ERROR); 15656 return eventId; 15657 } 15658 const hintWithEventId = __spreadValues({ 15659 event_id: eventId 15660 }, hint); 15661 this._process( 15662 this.eventFromException(exception, hintWithEventId).then( 15663 (event) => this._captureEvent(event, hintWithEventId, scope) 15664 ) 15665 ); 15666 return hintWithEventId.event_id; 15667 } 15668 /** 15669 * @inheritDoc 15670 */ 15671 captureMessage(message, level, hint, currentScope) { 15672 const hintWithEventId = __spreadValues({ 15673 event_id: uuid4() 15674 }, hint); 15675 const eventMessage = isParameterizedString(message) ? message : String(message); 15676 const promisedEvent = isPrimitive(message) ? this.eventFromMessage(eventMessage, level, hintWithEventId) : this.eventFromException(message, hintWithEventId); 15677 this._process(promisedEvent.then((event) => this._captureEvent(event, hintWithEventId, currentScope))); 15678 return hintWithEventId.event_id; 15679 } 15680 /** 15681 * @inheritDoc 15682 */ 15683 captureEvent(event, hint, currentScope) { 15684 const eventId = uuid4(); 15685 if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) { 15686 DEBUG_BUILD$3 && logger.log(ALREADY_SEEN_ERROR); 15687 return eventId; 15688 } 15689 const hintWithEventId = __spreadValues({ 15690 event_id: eventId 15691 }, hint); 15692 const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; 15693 const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope; 15694 this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope)); 15695 return hintWithEventId.event_id; 15696 } 15697 /** 15698 * @inheritDoc 15699 */ 15700 captureSession(session) { 15701 if (!(typeof session.release === "string")) { 15702 DEBUG_BUILD$3 && logger.warn("Discarded session because of missing or non-string release"); 15703 } else { 15704 this.sendSession(session); 15705 updateSession(session, { init: false }); 15706 } 15707 } 15708 /** 15709 * @inheritDoc 15710 */ 15711 getDsn() { 15712 return this._dsn; 15713 } 15714 /** 15715 * @inheritDoc 15716 */ 15717 getOptions() { 15718 return this._options; 15719 } 15720 /** 15721 * @see SdkMetadata 15722 * 15723 * @return The metadata of the SDK 15724 */ 15725 getSdkMetadata() { 15726 return this._options._metadata; 15727 } 15728 /** 15729 * @inheritDoc 15730 */ 15731 getTransport() { 15732 return this._transport; 15733 } 15734 /** 15735 * @inheritDoc 15736 */ 15737 flush(timeout) { 15738 const transport = this._transport; 15739 if (transport) {
vendor: 3,087 bytes, lines 15740-15822
15740 this.emit("flush"); 15741 return this._isClientDoneProcessing(timeout).then((clientFinished) => { 15742 return transport.flush(timeout).then((transportFlushed) => clientFinished && transportFlushed); 15743 }); 15744 } else { 15745 return resolvedSyncPromise(true); 15746 } 15747 } 15748 /** 15749 * @inheritDoc 15750 */ 15751 close(timeout) { 15752 return this.flush(timeout).then((result) => { 15753 this.getOptions().enabled = false; 15754 this.emit("close"); 15755 return result; 15756 }); 15757 } 15758 /** Get all installed event processors. */ 15759 getEventProcessors() { 15760 return this._eventProcessors; 15761 } 15762 /** @inheritDoc */ 15763 addEventProcessor(eventProcessor) { 15764 this._eventProcessors.push(eventProcessor); 15765 } 15766 /** @inheritdoc */ 15767 init() { 15768 if (this._isEnabled() || // Force integrations to be setup even if no DSN was set when we have 15769 // Spotlight enabled. This is particularly important for browser as we 15770 // don't support the `spotlight` option there and rely on the users 15771 // adding the `spotlightBrowserIntegration()` to their integrations which 15772 // wouldn't get initialized with the check below when there's no DSN set. 15773 this._options.integrations.some(({ name }) => name.startsWith("Spotlight"))) { 15774 this._setupIntegrations(); 15775 } 15776 } 15777 /** 15778 * Gets an installed integration by its name. 15779 * 15780 * @returns The installed integration or `undefined` if no integration with that `name` was installed. 15781 */ 15782 getIntegrationByName(integrationName) { 15783 return this._integrations[integrationName]; 15784 } 15785 /** 15786 * @inheritDoc 15787 */ 15788 addIntegration(integration) { 15789 const isAlreadyInstalled = this._integrations[integration.name]; 15790 setupIntegration(this, integration, this._integrations); 15791 if (!isAlreadyInstalled) { 15792 afterSetupIntegrations(this, [integration]); 15793 } 15794 } 15795 /** 15796 * @inheritDoc 15797 */ 15798 sendEvent(event, hint = {}) { 15799 this.emit("beforeSendEvent", event, hint); 15800 let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel); 15801 for (const attachment of hint.attachments || []) { 15802 env = addItemToEnvelope(env, createAttachmentEnvelopeItem(attachment)); 15803 } 15804 const promise = this.sendEnvelope(env); 15805 if (promise) { 15806 promise.then((sendResponse) => this.emit("afterSendEvent", event, sendResponse), null); 15807 } 15808 } 15809 /** 15810 * @inheritDoc 15811 */ 15812 sendSession(session) { 15813 const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel); 15814 this.sendEnvelope(env); 15815 } 15816 /** 15817 * @inheritDoc 15818 */ 15819 recordDroppedEvent(reason, category, eventOrCount) { 15820 if (this._options.sendClientReports) { 15821 const count2 = typeof eventOrCount === "number" ? eventOrCount : 1; 15822 const key = `${reason}:${category}`;
15823 DEBUG_BUILD$3 && logger.log(`Recording outcome: "${key}"${count2 > 1 ? ` (${count2} times)` : ""}`); 15824 this._outcomes[key] = (this._outcomes[key] || 0) + count2; 15825 } 15826 } 15827 // Keep on() & emit() signatures in sync with types' client.ts interface 15828 /* eslint-disable @typescript-eslint/unified-signatures */ 15829 /** @inheritdoc */ 15830 /** @inheritdoc */ 15831 on(hook, callback) { 15832 const hooks = this._hooks[hook] = this._hooks[hook] || []; 15833 hooks.push(callback); 15834 return () => { 15835 const cbIndex = hooks.indexOf(callback); 15836 if (cbIndex > -1) { 15837 hooks.splice(cbIndex, 1); 15838 } 15839 }; 15840 } 15841 /** @inheritdoc */ 15842 /** @inheritdoc */ 15843 emit(hook, ...rest) { 15844 const callbacks = this._hooks[hook]; 15845 if (callbacks) { 15846 callbacks.forEach((callback) => callback(...rest)); 15847 } 15848 } 15849 /** 15850 * @inheritdoc 15851 */ 15852 sendEnvelope(envelope) { 15853 this.emit("beforeEnvelope", envelope); 15854 if (this._isEnabled() && this._transport) { 15855 return this._transport.send(envelope).then(null, (reason) => { 15856 DEBUG_BUILD$3 && logger.error("Error while sending envelope:", reason); 15857 return reason; 15858 }); 15859 } 15860 DEBUG_BUILD$3 && logger.error("Transport disabled"); 15861 return resolvedSyncPromise({}); 15862 } 15863 /* eslint-enable @typescript-eslint/unified-signatures */ 15864 /** Setup integrations for this client. */ 15865 _setupIntegrations() { 15866 const { integrations } = this._options; 15867 this._integrations = setupIntegrations(this, integrations); 15868 afterSetupIntegrations(this, integrations); 15869 } 15870 /** Updates existing session based on the provided event */ 15871 _updateSessionFromEvent(session, event) { 15872 let crashed = event.level === "fatal"; 15873 let errored = false; 15874 const exceptions = event.exception && event.exception.values; 15875 if (exceptions) { 15876 errored = true; 15877 for (const ex of exceptions) { 15878 const mechanism = ex.mechanism; 15879 if (mechanism && mechanism.handled === false) { 15880 crashed = true; 15881 break; 15882 } 15883 } 15884 } 15885 const sessionNonTerminal = session.status === "ok"; 15886 const shouldUpdateAndSend = sessionNonTerminal && session.errors === 0 || sessionNonTerminal && crashed; 15887 if (shouldUpdateAndSend) { 15888 updateSession(session, __spreadProps(__spreadValues({}, crashed && { status: "crashed" }), { 15889 errors: session.errors || Number(errored || crashed) 15890 })); 15891 this.captureSession(session); 15892 } 15893 } 15894 /** 15895 * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying 15896 * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. 15897 * 15898 * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not 15899 * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to 15900 * `true`. 15901 * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and 15902 * `false` otherwise 15903 */ 15904 _isClientDoneProcessing(timeout) { 15905 return new SyncPromise((resolve) => { 15906 let ticked = 0; 15907 const tick = 1; 15908 const interval = setInterval(() => { 15909 if (this._numProcessing == 0) { 15910 clearInterval(interval); 15911 resolve(true); 15912 } else { 15913 ticked += tick; 15914 if (timeout && ticked >= timeout) { 15915 clearInterval(interval); 15916 resolve(false); 15917 } 15918 } 15919 }, tick); 15920 }); 15921 } 15922 /** Determines whether this SDK is enabled and a transport is present. */ 15923 _isEnabled() { 15924 return this.getOptions().enabled !== false && this._transport !== void 0; 15925 } 15926 /** 15927 * Adds common information to events. 15928 * 15929 * The information includes release and environment from `options`, 15930 * breadcrumbs and context (extra, tags and user) from the scope. 15931 * 15932 * Information that is already present in the event is never overwritten. For 15933 * nested objects, such as the context, keys are merged. 15934 * 15935 * @param event The original event. 15936 * @param hint May contain additional information about the original exception. 15937 * @param currentScope A scope containing event metadata. 15938 * @returns A new event with more information. 15939 */ 15940 _prepareEvent(event, hint, currentScope = getCurrentScope(), isolationScope = getIsolationScope()) { 15941 const options2 = this.getOptions(); 15942 const integrations = Object.keys(this._integrations); 15943 if (!hint.integrations && integrations.length > 0) { 15944 hint.integrations = integrations; 15945 }
15946 this.emit("preprocessEvent", event, hint); 15947 if (!event.type) { 15948 isolationScope.setLastEventId(event.event_id || hint.event_id); 15949 } 15950 return prepareEvent(options2, event, hint, currentScope, this, isolationScope).then((evt) => { 15951 if (evt === null) { 15952 return evt; 15953 } 15954 evt.contexts = __spreadValues({ 15955 trace: getTraceContextFromScope(currentScope) 15956 }, evt.contexts); 15957 const dynamicSamplingContext = getDynamicSamplingContextFromScope(this, currentScope); 15958 evt.sdkProcessingMetadata = __spreadValues({ 15959 dynamicSamplingContext 15960 }, evt.sdkProcessingMetadata); 15961 return evt; 15962 }); 15963 } 15964 /** 15965 * Processes the event and logs an error in case of rejection 15966 * @param event 15967 * @param hint 15968 * @param scope 15969 */ 15970 _captureEvent(event, hint = {}, scope) { 15971 return this._processEvent(event, hint, scope).then( 15972 (finalEvent) => { 15973 return finalEvent.event_id; 15974 }, 15975 (reason) => { 15976 if (DEBUG_BUILD$3) { 15977 if (reason instanceof SentryError && reason.logLevel === "log") { 15978 logger.log(reason.message); 15979 } else { 15980 logger.warn(reason); 15981 } 15982 } 15983 return void 0; 15984 } 15985 ); 15986 } 15987 /** 15988 * Processes an event (either error or message) and sends it to Sentry. 15989 * 15990 * This also adds breadcrumbs and context information to the event. However, 15991 * platform specific meta data (such as the User's IP address) must be added 15992 * by the SDK implementor. 15993 * 15994 * 15995 * @param event The event to send to Sentry. 15996 * @param hint May contain additional information about the original exception. 15997 * @param currentScope A scope containing event metadata. 15998 * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. 15999 */ 16000 _processEvent(event, hint, currentScope) { 16001 const options2 = this.getOptions(); 16002 const { sampleRate } = options2; 16003 const isTransaction = isTransactionEvent(event); 16004 const isError2 = isErrorEvent(event); 16005 const eventType = event.type || "error"; 16006 const beforeSendLabel = `before send for type \`${eventType}\``; 16007 const parsedSampleRate = typeof sampleRate === "undefined" ? void 0 : parseSampleRate(sampleRate); 16008 if (isError2 && typeof parsedSampleRate === "number" && Math.random() > parsedSampleRate) { 16009 this.recordDroppedEvent("sample_rate", "error", event); 16010 return rejectedSyncPromise( 16011 new SentryError( 16012 `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, 16013 "log" 16014 ) 16015 ); 16016 } 16017 const dataCategory = eventType === "replay_event" ? "replay" : eventType; 16018 const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; 16019 const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope; 16020 return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope).then((prepared) => { 16021 if (prepared === null) { 16022 this.recordDroppedEvent("event_processor", dataCategory, event); 16023 throw new SentryError("An event processor returned `null`, will not send event.", "log"); 16024 } 16025 const isInternalException = hint.data && hint.data.__sentry__ === true; 16026 if (isInternalException) { 16027 return prepared; 16028 } 16029 const result = processBeforeSend(this, options2, prepared, hint); 16030 return _validateBeforeSendResult(result, beforeSendLabel); 16031 }).then((processedEvent) => { 16032 if (processedEvent === null) { 16033 this.recordDroppedEvent("before_send", dataCategory, event); 16034 if (isTransaction) { 16035 const spans = event.spans || []; 16036 const spanCount = 1 + spans.length; 16037 this.recordDroppedEvent("before_send", "span", spanCount); 16038 } 16039 throw new SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, "log"); 16040 } 16041 const session = currentScope && currentScope.getSession(); 16042 if (!isTransaction && session) { 16043 this._updateSessionFromEvent(session, processedEvent); 16044 } 16045 if (isTransaction) { 16046 const spanCountBefore = processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing || 0; 16047 const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; 16048 const droppedSpanCount = spanCountBefore - spanCountAfter; 16049 if (droppedSpanCount > 0) { 16050 this.recordDroppedEvent("before_send", "span", droppedSpanCount); 16051 } 16052 } 16053 const transactionInfo = processedEvent.transaction_info; 16054 if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { 16055 const source = "custom"; 16056 processedEvent.transaction_info = __spreadProps(__spreadValues({}, transactionInfo), { 16057 source 16058 }); 16059 } 16060 this.sendEvent(processedEvent, hint); 16061 return processedEvent; 16062 }).then(null, (reason) => { 16063 if (reason instanceof SentryError) { 16064 throw reason; 16065 } 16066 this.captureException(reason, { 16067 data: { 16068 __sentry__: true 16069 }, 16070 originalException: reason 16071 }); 16072 throw new SentryError( 16073 `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. 16074Reason: ${reason}` 16075 ); 16076 }); 16077 } 16078 /** 16079 * Occupies the client with processing and event 16080 */ 16081 _process(promise) { 16082 this._numProcessing++; 16083 void promise.then( 16084 (value) => { 16085 this._numProcessing--; 16086 return value; 16087 }, 16088 (reason) => { 16089 this._numProcessing--; 16090 return reason; 16091 } 16092 ); 16093 } 16094 /** 16095 * Clears outcomes on this client and returns them. 16096 */ 16097 _clearOutcomes() { 16098 const outcomes = this._outcomes; 16099 this._outcomes = {}; 16100 return Object.entries(outcomes).map(([key, quantity]) => { 16101 const [reason, category] = key.split(":"); 16102 return { 16103 reason, 16104 category, 16105 quantity 16106 }; 16107 }); 16108 } 16109 /** 16110 * Sends client reports as an envelope. 16111 */ 16112 _flushOutcomes() { 16113 DEBUG_BUILD$3 && logger.log("Flushing outcomes..."); 16114 const outcomes = this._clearOutcomes(); 16115 if (outcomes.length === 0) { 16116 DEBUG_BUILD$3 && logger.log("No outcomes to send"); 16117 return; 16118 } 16119 if (!this._dsn) { 16120 DEBUG_BUILD$3 && logger.log("No dsn provided, will not send outcomes"); 16121 return; 16122 } 16123 DEBUG_BUILD$3 && logger.log("Sending outcomes:", outcomes); 16124 const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn)); 16125 this.sendEnvelope(envelope); 16126 } 16127 /** 16128 * @inheritDoc 16129 */ 16130 } 16131 function _validateBeforeSendResult(beforeSendResult, beforeSendLabel) { 16132 const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`; 16133 if (isThenable$1(beforeSendResult)) { 16134 return beforeSendResult.then( 16135 (event) => { 16136 if (!isPlainObject$3(event) && event !== null) { 16137 throw new SentryError(invalidValueError); 16138 } 16139 return event; 16140 }, 16141 (e2) => { 16142 throw new SentryError(`${beforeSendLabel} rejected with ${e2}`); 16143 } 16144 ); 16145 } else if (!isPlainObject$3(beforeSendResult) && beforeSendResult !== null) { 16146 throw new SentryError(invalidValueError); 16147 } 16148 return beforeSendResult; 16149 } 16150 function processBeforeSend(client2, options2, event, hint) { 16151 const { beforeSend, beforeSendTransaction, beforeSendSpan } = options2; 16152 if (isErrorEvent(event) && beforeSend) { 16153 return beforeSend(event, hint); 16154 } 16155 if (isTransactionEvent(event)) { 16156 if (event.spans && beforeSendSpan) { 16157 const processedSpans = []; 16158 for (const span of event.spans) { 16159 const processedSpan = beforeSendSpan(span); 16160 if (processedSpan) { 16161 processedSpans.push(processedSpan); 16162 } else { 16163 showSpanDropWarning(); 16164 client2.recordDroppedEvent("before_send", "span"); 16165 } 16166 } 16167 event.spans = processedSpans; 16168 } 16169 if (beforeSendTransaction) { 16170 if (event.spans) { 16171 const spanCountBefore = event.spans.length; 16172 event.sdkProcessingMetadata = __spreadProps(__spreadValues({}, event.sdkProcessingMetadata), { 16173 spanCountBeforeProcessing: spanCountBefore 16174 }); 16175 } 16176 return beforeSendTransaction(event, hint); 16177 } 16178 } 16179 return event; 16180 } 16181 function isErrorEvent(event) { 16182 return event.type === void 0; 16183 } 16184 function isTransactionEvent(event) { 16185 return event.type === "transaction"; 16186 } 16187 function initAndBind(clientClass, options2) { 16188 if (options2.debug === true) { 16189 if (DEBUG_BUILD$3) { 16190 logger.enable(); 16191 } else { 16192 consoleSandbox(() => { 16193 console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."); 16194 }); 16195 } 16196 } 16197 const scope = getCurrentScope(); 16198 scope.update(options2.initialScope); 16199 const client2 = new clientClass(options2); 16200 setCurrentClient(client2); 16201 client2.init(); 16202 return client2; 16203 } 16204 function setCurrentClient(client2) { 16205 getCurrentScope().setClient(client2); 16206 } 16207 function makePromiseBuffer(limit) { 16208 const buffer = []; 16209 function isReady() { 16210 return limit === void 0 || buffer.length < limit; 16211 } 16212 function remove(task) { 16213 return buffer.splice(buffer.indexOf(task), 1)[0] || Promise.resolve(void 0); 16214 } 16215 function add(taskProducer) { 16216 if (!isReady()) { 16217 return rejectedSyncPromise(new SentryError("Not adding Promise because buffer limit was reached.")); 16218 } 16219 const task = taskProducer(); 16220 if (buffer.indexOf(task) === -1) { 16221 buffer.push(task); 16222 } 16223 void task.then(() => remove(task)).then( 16224 null, 16225 () => remove(task).then(null, () => { 16226 }) 16227 ); 16228 return task; 16229 } 16230 function drain(timeout) { 16231 return new SyncPromise((resolve, reject) => { 16232 let counter = buffer.length; 16233 if (!counter) { 16234 return resolve(true); 16235 } 16236 const capturedSetTimeout = setTimeout(() => { 16237 if (timeout && timeout > 0) { 16238 resolve(false); 16239 } 16240 }, timeout); 16241 buffer.forEach((item) => { 16242 void resolvedSyncPromise(item).then(() => { 16243 if (!--counter) { 16244 clearTimeout(capturedSetTimeout); 16245 resolve(true); 16246 } 16247 }, reject); 16248 }); 16249 }); 16250 } 16251 return { 16252 $: buffer, 16253 add, 16254 drain 16255 }; 16256 } 16257 const DEFAULT_RETRY_AFTER = 60 * 1e3; 16258 function parseRetryAfterHeader(header, now2 = Date.now()) { 16259 const headerDelay = parseInt(`${header}`, 10); 16260 if (!isNaN(headerDelay)) { 16261 return headerDelay * 1e3; 16262 } 16263 const headerDate = Date.parse(`${header}`); 16264 if (!isNaN(headerDate)) { 16265 return headerDate - now2; 16266 } 16267 return DEFAULT_RETRY_AFTER; 16268 } 16269 function disabledUntil(limits, dataCategory) { 16270 return limits[dataCategory] || limits.all || 0; 16271 } 16272 function isRateLimited(limits, dataCategory, now2 = Date.now()) { 16273 return disabledUntil(limits, dataCategory) > now2; 16274 } 16275 function updateRateLimits(limits, { statusCode, headers }, now2 = Date.now()) { 16276 const updatedRateLimits = __spreadValues({}, limits);
16277 const rateLimitHeader = headers && headers["x-sentry-rate-limits"]; 16278 const retryAfterHeader = headers && headers["retry-after"]; 16279 if (rateLimitHeader) { 16280 for (const limit of rateLimitHeader.trim().split(",")) { 16281 const [retryAfter, categories, , , namespaces] = limit.split(":", 5); 16282 const headerDelay = parseInt(retryAfter, 10); 16283 const delay2 = (!isNaN(headerDelay) ? headerDelay : 60) * 1e3; 16284 if (!categories) { 16285 updatedRateLimits.all = now2 + delay2; 16286 } else { 16287 for (const category of categories.split(";")) { 16288 if (category === "metric_bucket") { 16289 if (!namespaces || namespaces.split(";").includes("custom")) { 16290 updatedRateLimits[category] = now2 + delay2; 16291 } 16292 } else { 16293 updatedRateLimits[category] = now2 + delay2; 16294 } 16295 } 16296 } 16297 } 16298 } else if (retryAfterHeader) { 16299 updatedRateLimits.all = now2 + parseRetryAfterHeader(retryAfterHeader, now2); 16300 } else if (statusCode === 429) { 16301 updatedRateLimits.all = now2 + 60 * 1e3; 16302 } 16303 return updatedRateLimits; 16304 } 16305 const DEFAULT_TRANSPORT_BUFFER_SIZE = 64; 16306 function createTransport(options2, makeRequest, buffer = makePromiseBuffer( 16307 options2.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE 16308 )) { 16309 let rateLimits = {}; 16310 const flush = (timeout) => buffer.drain(timeout); 16311 function send(envelope) { 16312 const filteredEnvelopeItems = []; 16313 forEachEnvelopeItem(envelope, (item, type) => { 16314 const dataCategory = envelopeItemTypeToDataCategory(type); 16315 if (isRateLimited(rateLimits, dataCategory)) { 16316 const event = getEventForEnvelopeItem(item, type); 16317 options2.recordDroppedEvent("ratelimit_backoff", dataCategory, event); 16318 } else { 16319 filteredEnvelopeItems.push(item); 16320 } 16321 }); 16322 if (filteredEnvelopeItems.length === 0) { 16323 return resolvedSyncPromise({}); 16324 } 16325 const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems); 16326 const recordEnvelopeLoss = (reason) => { 16327 forEachEnvelopeItem(filteredEnvelope, (item, type) => { 16328 const event = getEventForEnvelopeItem(item, type); 16329 options2.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event); 16330 }); 16331 }; 16332 const requestTask = () => makeRequest({ body: serializeEnvelope(filteredEnvelope) }).then( 16333 (response) => { 16334 if (response.statusCode !== void 0 && (response.statusCode < 200 || response.statusCode >= 300)) { 16335 DEBUG_BUILD$3 && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); 16336 } 16337 rateLimits = updateRateLimits(rateLimits, response); 16338 return response; 16339 }, 16340 (error) => { 16341 recordEnvelopeLoss("network_error"); 16342 throw error; 16343 } 16344 ); 16345 return buffer.add(requestTask).then( 16346 (result) => result, 16347 (error) => { 16348 if (error instanceof SentryError) { 16349 DEBUG_BUILD$3 && logger.error("Skipped sending event because buffer is full."); 16350 recordEnvelopeLoss("queue_overflow"); 16351 return resolvedSyncPromise({}); 16352 } else { 16353 throw error; 16354 } 16355 } 16356 ); 16357 } 16358 return { 16359 send, 16360 flush 16361 }; 16362 } 16363 function getEventForEnvelopeItem(item, type) { 16364 if (type !== "event" && type !== "transaction") { 16365 return void 0; 16366 } 16367 return Array.isArray(item) ? item[1] : void 0; 16368 } 16369 function applySdkMetadata(options2, name, names2 = [name], source = "npm") { 16370 const metadata = options2._metadata || {}; 16371 if (!metadata.sdk) { 16372 metadata.sdk = { 16373 name: `sentry.javascript.${name}`, 16374 packages: names2.map((name2) => ({ 16375 name: `${source}:@sentry/${name2}`, 16376 version: SDK_VERSION 16377 })), 16378 version: SDK_VERSION 16379 }; 16380 } 16381 options2._metadata = metadata; 16382 } 16383 function getTraceData(options2 = {}) { 16384 const client2 = getClient(); 16385 if (!isEnabled() || !client2) { 16386 return {}; 16387 } 16388 const carrier = getMainCarrier(); 16389 const acs = getAsyncContextStrategy(carrier); 16390 if (acs.getTraceData) { 16391 return acs.getTraceData(options2); 16392 } 16393 const scope = getCurrentScope(); 16394 const span = options2.span || getActiveSpan(); 16395 const sentryTrace = span ? spanToTraceHeader(span) : scopeToTraceHeader(scope); 16396 const dsc = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client2, scope); 16397 const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc); 16398 const isValidSentryTraceHeader = TRACEPARENT_REGEXP.test(sentryTrace); 16399 if (!isValidSentryTraceHeader) { 16400 logger.warn("Invalid sentry-trace data. Cannot generate trace data"); 16401 return {}; 16402 } 16403 return { 16404 "sentry-trace": sentryTrace, 16405 baggage 16406 }; 16407 } 16408 function scopeToTraceHeader(scope) { 16409 const { traceId, sampled, spanId } = scope.getPropagationContext(); 16410 return generateSentryTraceHeader(traceId, spanId, sampled); 16411 } 16412 const DEFAULT_BREADCRUMBS = 100; 16413 function addBreadcrumb(breadcrumb, hint) { 16414 const client2 = getClient(); 16415 const isolationScope = getIsolationScope(); 16416 if (!client2) return; 16417 const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client2.getOptions(); 16418 if (maxBreadcrumbs <= 0) return; 16419 const timestamp = dateTimestampInSeconds(); 16420 const mergedBreadcrumb = __spreadValues({ timestamp }, breadcrumb); 16421 const finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) : mergedBreadcrumb; 16422 if (finalBreadcrumb === null) return; 16423 if (client2.emit) { 16424 client2.emit("beforeAddBreadcrumb", finalBreadcrumb, hint); 16425 } 16426 isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); 16427 } 16428 let originalFunctionToString; 16429 const INTEGRATION_NAME$6 = "FunctionToString"; 16430 const SETUP_CLIENTS = /* @__PURE__ */ new WeakMap(); 16431 const _functionToStringIntegration = (() => { 16432 return { 16433 name: INTEGRATION_NAME$6, 16434 setupOnce() { 16435 originalFunctionToString = Function.prototype.toString; 16436 try { 16437 Function.prototype.toString = function(...args) { 16438 const originalFunction = getOriginalFunction(this); 16439 const context = SETUP_CLIENTS.has(getClient()) && originalFunction !== void 0 ? originalFunction : this; 16440 return originalFunctionToString.apply(context, args
16440); 16441 }; 16442 } catch (e2) { 16443 } 16444 }, 16445 setup(client2) { 16446 SETUP_CLIENTS.set(client2, true); 16447 } 16448 }; 16449 }); 16450 const functionToStringIntegration = defineIntegration(_functionToStringIntegration); 16451 const DEFAULT_IGNORE_ERRORS = [ 16452 /^Script error\.?$/, 16453 /^Javascript error: Script error\.? on line 0$/, 16454 /^ResizeObserver loop completed with undelivered notifications.$/, 16455 // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness. 16456 /^Cannot redefine property: googletag$/, 16457 // This is thrown when google tag manager is used in combination with an ad blocker 16458 "undefined is not an object (evaluating 'a.L')", 16459 // Random error that happens but not actionable or noticeable to end-users. 16460 `can't redefine non-configurable property "solana"`, 16461 // Probably a browser extension or custom browser (Brave) throwing this error 16462 "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", 16463 // Error thrown by GTM, seemingly not affecting end-users 16464 "Can't find variable: _AutofillCallbackHandler", 16465 // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ 16466 /^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/ 16467 // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps 16468 ]; 16469 const INTEGRATION_NAME$5 = "InboundFilters"; 16470 const _inboundFiltersIntegration = ((options2 = {}) => { 16471 return { 16472 name: INTEGRATION_NAME$5, 16473 processEvent(event, _hint, client2) { 16474 const clientOptions = client2.getOptions(); 16475 const mergedOptions = _mergeOptions(options2, clientOptions); 16476 return _shouldDropEvent$1(event, mergedOptions) ? null : event; 16477 } 16478 }; 16479 }); 16480 const inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration); 16481 function _mergeOptions(internalOptions = {}, clientOptions = {}) { 16482 return { 16483 allowUrls: [...internalOptions.allowUrls || [], ...clientOptions.allowUrls || []], 16484 denyUrls: [...internalOptions.denyUrls || [], ...clientOptions.denyUrls || []], 16485 ignoreErrors: [ 16486 ...internalOptions.ignoreErrors || [], 16487 ...clientOptions.ignoreErrors || [], 16488 ...internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS 16489 ], 16490 ignoreTransactions: [...internalOptions.ignoreTransactions || [], ...clientOptions.ignoreTransactions || []], 16491 ignoreInternal: internalOptions.ignoreInternal !== void 0 ? internalOptions.ignoreInternal : true 16492 }; 16493 } 16494 function _shouldDropEvent$1(event, options2) { 16495 if (options2.ignoreInternal && _isSentryError(event)) { 16496 DEBUG_BUILD$3 && logger.warn(`Event dropped due to being internal Sentry Error. 16497Event: ${getEventDescription(event)}`); 16498 return true; 16499 } 16500 if (_isIgnoredError(event, options2.ignoreErrors)) { 16501 DEBUG_BUILD$3 && logger.warn( 16502 `Event dropped due to being matched by \`ignoreErrors\` option. 16503Event: ${getEventDescription(event)}` 16504 ); 16505 return true; 16506 } 16507 if (_isUselessError(event)) { 16508 DEBUG_BUILD$3 && logger.warn( 16509 `Event dropped due to not having an error message, error type or stacktrace. 16510Event: ${getEventDescription( 16511 event 16512 )}` 16513 ); 16514 return true; 16515 } 16516 if (_isIgnoredTransaction(event, options2.ignoreTransactions)) { 16517 DEBUG_BUILD$3 && logger.warn( 16518 `Event dropped due to being matched by \`ignoreTransactions\` option. 16519Event: ${getEventDescription(event)}` 16520 ); 16521 return true; 16522 } 16523 if (_isDeniedUrl(event, options2.denyUrls)) { 16524 DEBUG_BUILD$3 && logger.warn( 16525 `Event dropped due to being matched by \`denyUrls\` option. 16526Event: ${getEventDescription( 16527 event 16528 )}. 16529Url: ${_getEventFilterUrl(event)}` 16530 ); 16531 return true; 16532 } 16533 if (!_isAllowedUrl(event, options2.allowUrls)) { 16534 DEBUG_BUILD$3 && logger.warn( 16535 `Event dropped due to not being matched by \`allowUrls\` option. 16536Event: ${getEventDescription( 16537 event 16538 )}. 16539Url: ${_getEventFilterUrl(event)}` 16540 ); 16541 return true; 16542 } 16543 return false;
vendor: 7,074 bytes, lines 16544-16732
16544 } 16545 function _isIgnoredError(event, ignoreErrors) { 16546 if (event.type || !ignoreErrors || !ignoreErrors.length) { 16547 return false; 16548 } 16549 return _getPossibleEventMessages(event).some((message) => stringMatchesSomePattern(message, ignoreErrors)); 16550 } 16551 function _isIgnoredTransaction(event, ignoreTransactions) { 16552 if (event.type !== "transaction" || !ignoreTransactions || !ignoreTransactions.length) { 16553 return false; 16554 } 16555 const name = event.transaction; 16556 return name ? stringMatchesSomePattern(name, ignoreTransactions) : false; 16557 } 16558 function _isDeniedUrl(event, denyUrls) { 16559 if (!denyUrls || !denyUrls.length) { 16560 return false; 16561 } 16562 const url = _getEventFilterUrl(event); 16563 return !url ? false : stringMatchesSomePattern(url, denyUrls); 16564 } 16565 function _isAllowedUrl(event, allowUrls) { 16566 if (!allowUrls || !allowUrls.length) { 16567 return true; 16568 } 16569 const url = _getEventFilterUrl(event); 16570 return !url ? true : stringMatchesSomePattern(url, allowUrls); 16571 } 16572 function _getPossibleEventMessages(event) { 16573 const possibleMessages = []; 16574 if (event.message) { 16575 possibleMessages.push(event.message); 16576 } 16577 let lastException; 16578 try { 16579 lastException = event.exception.values[event.exception.values.length - 1]; 16580 } catch (e2) { 16581 } 16582 if (lastException) { 16583 if (lastException.value) { 16584 possibleMessages.push(lastException.value); 16585 if (lastException.type) { 16586 possibleMessages.push(`${lastException.type}: ${lastException.value}`); 16587 } 16588 } 16589 } 16590 return possibleMessages; 16591 } 16592 function _isSentryError(event) { 16593 try { 16594 return event.exception.values[0].type === "SentryError"; 16595 } catch (e2) { 16596 } 16597 return false; 16598 } 16599 function _getLastValidUrl(frames = []) { 16600 for (let i2 = frames.length - 1; i2 >= 0; i2--) { 16601 const frame2 = frames[i2]; 16602 if (frame2 && frame2.filename !== "<anonymous>" && frame2.filename !== "[native code]") { 16603 return frame2.filename || null; 16604 } 16605 } 16606 return null; 16607 } 16608 function _getEventFilterUrl(event) { 16609 try { 16610 let frames; 16611 try { 16612 frames = event.exception.values[0].stacktrace.frames; 16613 } catch (e2) { 16614 } 16615 return frames ? _getLastValidUrl(frames) : null; 16616 } catch (oO) { 16617 DEBUG_BUILD$3 && logger.error(`Cannot extract url for event ${getEventDescription(event)}`); 16618 return null; 16619 } 16620 } 16621 function _isUselessError(event) { 16622 if (event.type) { 16623 return false; 16624 } 16625 if (!event.exception || !event.exception.values || event.exception.values.length === 0) { 16626 return false; 16627 } 16628 return ( 16629 // No top-level message 16630 !event.message && // There are no exception values that have a stacktrace, a non-generic-Error type or value 16631 !event.exception.values.some((value) => value.stacktrace || value.type && value.type !== "Error" || value.value) 16632 ); 16633 } 16634 function applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser, maxValueLimit = 250, key, limit, event, hint) { 16635 if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) { 16636 return; 16637 } 16638 const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0; 16639 if (originalException) { 16640 event.exception.values = truncateAggregateExceptions( 16641 aggregateExceptionsFromError( 16642 exceptionFromErrorImplementation, 16643 parser, 16644 limit, 16645 hint.originalException, 16646 key, 16647 event.exception.values, 16648 originalException, 16649 0 16650 ), 16651 maxValueLimit 16652 ); 16653 } 16654 } 16655 function aggregateExceptionsFromError(exceptionFromErrorImplementation, parser, limit, error, key, prevExceptions, exception, exceptionId) { 16656 if (prevExceptions.length >= limit + 1) { 16657 return prevExceptions; 16658 } 16659 let newExceptions = [...prevExceptions]; 16660 if (isInstanceOf(error[key], Error)) { 16661 applyExceptionGroupFieldsForParentException(exception, exceptionId); 16662 const newException = exceptionFromErrorImplementation(parser, error[key]); 16663 const newExceptionId = newExceptions.length; 16664 applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); 16665 newExceptions = aggregateExceptionsFromError( 16666 exceptionFromErrorImplementation, 16667 parser, 16668 limit, 16669 error[key], 16670 key, 16671 [newException, ...newExceptions], 16672 newException, 16673 newExceptionId 16674 ); 16675 } 16676 if (Array.isArray(error.errors)) { 16677 error.errors.forEach((childError, i2) => { 16678 if (isInstanceOf(childError, Error)) { 16679 applyExceptionGroupFieldsForParentException(exception, exceptionId); 16680 const newException = exceptionFromErrorImplementation(parser, childError); 16681 const newExceptionId = newExceptions.length; 16682 applyExceptionGroupFieldsForChildException(newException, `errors[${i2}]`, newExceptionId, exceptionId); 16683 newExceptions = aggregateExceptionsFromError( 16684 exceptionFromErrorImplementation, 16685 parser, 16686 limit, 16687 childError, 16688 key, 16689 [newException, ...newExceptions], 16690 newException, 16691 newExceptionId 16692 ); 16693 } 16694 }); 16695 } 16696 return newExceptions; 16697 } 16698 function applyExceptionGroupFieldsForParentException(exception, exceptionId) { 16699 exception.mechanism = exception.mechanism || { type: "generic", handled: true }; 16700 exception.mechanism = __spreadProps(__spreadValues(__spreadValues({}, exception.mechanism), exception.type === "AggregateError" && { is_exception_group: true }), { 16701 exception_id: exceptionId 16702 }); 16703 } 16704 function applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) { 16705 exception.mechanism = exception.mechanism || { type: "generic", handled: true }; 16706 exception.mechanism = __spreadProps(__spreadValues({}, exception.mechanism), { 16707 type: "chained", 16708 source, 16709 exception_id: exceptionId, 16710 parent_id: parentId 16711 }); 16712 } 16713 function truncateAggregateExceptions(exceptions, maxValueLength) { 16714 return exceptions.map((exception) => { 16715 if (exception.value) { 16716 exception.value = truncate(exception.value, maxValueLength); 16717 } 16718 return exception; 16719 }); 16720 } 16721 function parseUrl$1(url) { 16722 if (!url) { 16723 return {}; 16724 } 16725 const match2 = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); 16726 if (!match2) { 16727 return {}; 16728 } 16729 const query = match2[6] || ""; 16730 const fragment = match2[8] || ""; 16731 return { 16732 host: match2[4],
16733 path: match2[5], 16734 protocol: match2[2], 16735 search: query, 16736 hash: fragment, 16737 relative: match2[5] + query + fragment 16738 // everything minus origin 16739 }; 16740 } 16741 function addConsoleInstrumentationHandler(handler) { 16742 const type = "console"; 16743 addHandler$1(type, handler); 16744 maybeInstrument(type, instrumentConsole); 16745 } 16746 function instrumentConsole() { 16747 if (!("console" in GLOBAL_OBJ)) { 16748 return; 16749 } 16750 CONSOLE_LEVELS.forEach(function(level) { 16751 if (!(level in GLOBAL_OBJ.console)) { 16752 return; 16753 } 16754 fill(GLOBAL_OBJ.console, level, function(originalConsoleMethod) { 16755 originalConsoleMethods[level] = originalConsoleMethod; 16756 return function(...args) { 16757 const handlerData = { args, level }; 16758 triggerHandlers$1("console", handlerData); 16759 const log = originalConsoleMethods[level]; 16760 log && log.apply(GLOBAL_OBJ.console, args); 16761 }; 16762 }); 16763 }); 16764 } 16765 function severityLevelFromString(level) { 16766 return level === "warn" ? "warning" : ["fatal", "error", "warning", "log", "info", "debug"].includes(level) ? level : "log"; 16767 } 16768 const INTEGRATION_NAME$4 = "Dedupe"; 16769 const _dedupeIntegration = (() => { 16770 let previousEvent; 16771 return { 16772 name: INTEGRATION_NAME$4, 16773 processEvent(currentEvent) { 16774 if (currentEvent.type) { 16775 return currentEvent; 16776 } 16777 try { 16778 if (_shouldDropEvent(currentEvent, previousEvent)) { 16779 DEBUG_BUILD$3 && logger.warn("Event dropped due to being a duplicate of previously captured event."); 16780 return null; 16781 } 16782 } catch (_oO) { 16783 } 16784 return previousEvent = currentEvent; 16785 } 16786 }; 16787 }); 16788 const dedupeIntegration = defineIntegration(_dedupeIntegration); 16789 function _shouldDropEvent(currentEvent, previousEvent) { 16790 if (!previousEvent) { 16791 return false; 16792 } 16793 if (_isSameMessageEvent(currentEvent, previousEvent)) { 16794 return true; 16795 } 16796 if (_isSameExceptionEvent(currentEvent, previousEvent)) { 16797 return true; 16798 } 16799 return false; 16800 } 16801 function _isSameMessageEvent(currentEvent, previousEvent) { 16802 const currentMessage = currentEvent.message; 16803 const previousMessage = previousEvent.message; 16804 if (!currentMessage && !previousMessage) { 16805 return false; 16806 } 16807 if (currentMessage && !previousMessage || !currentMessage && previousMessage) { 16808 return false; 16809 } 16810 if (currentMessage !== previousMessage) { 16811 return false; 16812 } 16813 if (!_isSameFingerprint(currentEvent, previousEvent)) { 16814 return false; 16815 } 16816 if (!_isSameStacktrace(currentEvent, previousEvent)) { 16817 return false; 16818 } 16819 return true; 16820 } 16821 function _isSameExceptionEvent(currentEvent, previousEvent) { 16822 const previousException = _getExceptionFromEvent(previousEvent); 16823 const currentException = _getExceptionFromEvent(currentEvent); 16824 if (!previousException || !currentException) { 16825 return false; 16826 } 16827 if (previousException.type !== currentException.type || previousException.value !== currentException.value) { 16828 return false; 16829 } 16830 if (!_isSameFingerprint(currentEvent, previousEvent)) { 16831 return false; 16832 } 16833 if (!_isSameStacktrace(currentEvent, previousEvent)) { 16834 return false; 16835 } 16836 return true; 16837 } 16838 function _isSameStacktrace(currentEvent, previousEvent) { 16839 let currentFrames = getFramesFromEvent(currentEvent); 16840 let previousFrames = getFramesFromEvent(previousEvent); 16841 if (!currentFrames && !previousFrames) { 16842 return true; 16843 } 16844 if (currentFrames && !previousFrames || !currentFrames && previousFrames) { 16845 return false; 16846 } 16847 currentFrames = currentFrames; 16848 previousFrames = previousFrames; 16849 if (previousFrames.length !== currentFrames.length) { 16850 return false; 16851 } 16852 for (let i2 = 0; i2 < previousFrames.length; i2++) { 16853 const frameA = previousFrames[i2]; 16854 const frameB = currentFrames[i2]; 16855 if (frameA.filename !== frameB.filename || frameA.lineno !== frameB.lineno || frameA.colno !== frameB.colno || frameA.function !== frameB.function) { 16856 return false;
16857 } 16858 } 16859 return true; 16860 } 16861 function _isSameFingerprint(currentEvent, previousEvent) { 16862 let currentFingerprint = currentEvent.fingerprint; 16863 let previousFingerprint = previousEvent.fingerprint; 16864 if (!currentFingerprint && !previousFingerprint) { 16865 return true; 16866 } 16867 if (currentFingerprint && !previousFingerprint || !currentFingerprint && previousFingerprint) { 16868 return false; 16869 } 16870 currentFingerprint = currentFingerprint; 16871 previousFingerprint = previousFingerprint; 16872 try { 16873 return !!(currentFingerprint.join("") === previousFingerprint.join("")); 16874 } catch (_oO) { 16875 return false; 16876 } 16877 } 16878 function _getExceptionFromEvent(event) { 16879 return event.exception && event.exception.values && event.exception.values[0]; 16880 } 16881 function instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeaders2, spans, spanOrigin = "auto.http.browser") { 16882 if (!handlerData.fetchData) { 16883 return void 0; 16884 } 16885 const shouldCreateSpanResult = hasTracingEnabled() && shouldCreateSpan(handlerData.fetchData.url); 16886 if (handlerData.endTimestamp && shouldCreateSpanResult) { 16887 const spanId = handlerData.fetchData.__span; 16888 if (!spanId) return; 16889 const span2 = spans[spanId]; 16890 if (span2) { 16891 endSpan(span2, handlerData); 16892 delete spans[spanId]; 16893 } 16894 return void 0; 16895 } 16896 const { method, url } = handlerData.fetchData; 16897 const fullUrl = getFullURL$1(url); 16898 const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; 16899 const hasParent = !!getActiveSpan(); 16900 const span = shouldCreateSpanResult && hasParent ? startInactiveSpan({ 16901 name: `${method} ${url}`, 16902 attributes: { 16903 url, 16904 type: "fetch", 16905 "http.method": method, 16906 "http.url": fullUrl, 16907 "server.address": host, 16908 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, 16909 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client" 16910 } 16911 }) : new SentryNonRecordingSpan(); 16912 handlerData.fetchData.__span = span.spanContext().spanId; 16913 spans[span.spanContext().spanId] = span; 16914 if (shouldAttachHeaders2(handlerData.fetchData.url)) { 16915 const request = handlerData.args[0]; 16916 const options2 = handlerData.args[1] || {}; 16917 const headers = _addTracingHeadersToFetchRequest( 16918 request, 16919 options2, 16920 // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), 16921 // we do not want to use the span as base for the trace headers, 16922 // which means that the headers will be generated from the scope and the sampling decision is deferred 16923 hasTracingEnabled() && hasParent ? span : void 0 16924 ); 16925 if (headers) { 16926 handlerData.args[1] = options2; 16927 options2.headers = headers; 16928 } 16929 } 16930 return span; 16931 } 16932 function _addTracingHeadersToFetchRequest(request, fetchOptionsObj, span) { 16933 const traceHeaders = getTraceData({ span }); 16934 const sentryTrace = traceHeaders["sentry-trace"]; 16935 const baggage = traceHeaders.baggage; 16936 if (!sentryTrace) { 16937 return void 0; 16938 } 16939 const headers = fetchOptionsObj.headers || (isRequest$1(request) ? request.headers : void 0); 16940 if (!headers) { 16941 return __spreadValues({}, traceHeaders); 16942 } else if (isHeaders$1(headers)) { 16943 const newHeaders = new Headers(headers); 16944 newHeaders.set("sentry-trace", sentryTrace); 16945 if (baggage) { 16946 const prevBaggageHeader = newHeaders.get("baggage"); 16947 if (prevBaggageHeader) { 16948 const prevHeaderStrippedFromSentryBaggage = stripBaggageHeaderOfSentryBaggageValues(prevBaggageHeader); 16949 newHeaders.set( 16950 "baggage", 16951 // If there are non-sentry entries (i.e. if the stripped string is non-empty/truthy) combine the stripped header and sentry baggage header 16952 // otherwise just set the sentry baggage header 16953 prevHeaderStrippedFromSentryBaggage ? `${prevHeaderStrippedFromSentryBaggage},${baggage}` : baggage 16954 ); 16955 } else { 16956 newHeaders.set("baggage", baggage); 16957 } 16958 } 16959 return newHeaders; 16960 } else if (Array.isArray(headers)) { 16961 const newHeaders = [ 16962 ...headers.filter((header) => { 16963 return !(Array.isArray(header) && header[0] === "sentry-trace"); 16964 }).map((header) => { 16965 if (Array.isArray(header) && header[0] === "baggage" && typeof header[1] === "string") { 16966 const [headerName, headerValue, ...rest] = header; 16967 return [headerName, stripBaggageHeaderOfSentryBaggageValues(headerValue), ...rest]; 16968 } else { 16969 return header; 16970 } 16971 }), 16972 // Attach the new sentry-trace header 16973 ["sentry-trace", sentryTrace] 16974 ]; 16975 if (baggage) { 16976 newHeaders.push(["baggage", baggage]); 16977 } 16978 return newHeaders; 16979 } else { 16980 const existingBaggageHeader = "baggage" in headers ? headers.baggage : void 0; 16981 let newBaggageHeaders = []; 16982 if (Array.isArray(existingBaggageHeader)) { 16983 newBaggageHeaders = existingBaggageHeader.map( 16984 (headerItem) => typeof headerItem === "string" ? stripBaggageHeaderOfSentryBaggageValues(headerItem) : headerItem 16985 ).filter((headerItem) => headerItem === ""); 16986 } else if (existingBaggageHeader) { 16987 newBaggageHeaders.push(stripBaggageHeaderOfSentryBaggageValues(existingBaggageHeader)); 16988 } 16989 if (baggage) { 16990 newBaggageHeaders.push(baggage); 16991 } 16992 return __spreadProps(__spreadValues({}, headers), { 16993 "sentry-trace": sentryTrace, 16994 baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(",") : void 0 16995 }); 16996 } 16997 } 16998 function getFullURL$1(url) {
16999 try { 17000 const parsed = new URL(url); 17001 return parsed.href; 17002 } catch (e2) { 17003 return void 0; 17004 } 17005 } 17006 function endSpan(span, handlerData) { 17007 if (handlerData.response) { 17008 setHttpStatus(span, handlerData.response.status); 17009 const contentLength = handlerData.response && handlerData.response.headers && handlerData.response.headers.get("content-length"); 17010 if (contentLength) { 17011 const contentLengthNum = parseInt(contentLength); 17012 if (contentLengthNum > 0) { 17013 span.setAttribute("http.response_content_length", contentLengthNum); 17014 } 17015 } 17016 } else if (handlerData.error) { 17017 span.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" }); 17018 } 17019 span.end(); 17020 } 17021 function stripBaggageHeaderOfSentryBaggageValues(baggageHeader) { 17022 return baggageHeader.split(",").filter((baggageEntry) => !baggageEntry.split("=")[0].startsWith(SENTRY_BAGGAGE_KEY_PREFIX)).join(","); 17023 } 17024 function isRequest$1(request) { 17025 return typeof Request !== "undefined" && isInstanceOf(request, Request); 17026 } 17027 function isHeaders$1(headers) { 17028 return typeof Headers !== "undefined" && isInstanceOf(headers, Headers); 17029 } 17030 function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) { 17031 if (statusCode === void 0) { 17032 return void 0; 17033 } else if (statusCode >= 400 && statusCode < 500) { 17034 return "warning"; 17035 } else if (statusCode >= 500) { 17036 return "error"; 17037 } else { 17038 return void 0; 17039 } 17040 } 17041 const WINDOW$3 = GLOBAL_OBJ; 17042 function supportsFetch() { 17043 if (!("fetch" in WINDOW$3)) { 17044 return false; 17045 } 17046 try { 17047 new Headers(); 17048 new Request("http://www.example.com"); 17049 new Response(); 17050 return true; 17051 } catch (e2) { 17052 return false; 17053 } 17054 } 17055 function isNativeFunction(func) { 17056 return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); 17057 } 17058 function supportsNativeFetch() { 17059 if (typeof EdgeRuntime === "string") { 17060 return true; 17061 } 17062 if (!supportsFetch()) { 17063 return false; 17064 } 17065 if (isNativeFunction(WINDOW$3.fetch)) { 17066 return true; 17067 } 17068 let result = false;
17069 const doc = WINDOW$3.document; 17070 if (doc && typeof doc.createElement === "function") { 17071 try { 17072 const sandbox = doc.createElement("iframe"); 17073 sandbox.hidden = true; 17074 doc.head.appendChild(sandbox); 17075 if (sandbox.contentWindow && sandbox.contentWindow.fetch) { 17076 result = isNativeFunction(sandbox.contentWindow.fetch); 17077 } 17078 doc.head.removeChild(sandbox); 17079 } catch (err) { 17080 DEBUG_BUILD$2 && logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ", err); 17081 } 17082 } 17083 return result; 17084 } 17085 function addFetchInstrumentationHandler(handler, skipNativeFetchCheck) { 17086 const type = "fetch"; 17087 addHandler$1(type, handler); 17088 maybeInstrument(type, () => instrumentFetch(void 0, skipNativeFetchCheck)); 17089 } 17090 function addFetchEndInstrumentationHandler(handler) { 17091 const type = "fetch-body-resolved"; 17092 addHandler$1(type, handler); 17093 maybeInstrument(type, () => instrumentFetch(streamHandler)); 17094 } 17095 function instrumentFetch(onFetchResolved, skipNativeFetchCheck = false) { 17096 if (skipNativeFetchCheck && !supportsNativeFetch()) { 17097 return; 17098 } 17099 fill(GLOBAL_OBJ, "fetch", function(originalFetch) { 17100 return function(...args) { 17101 const virtualError = new Error(); 17102 const { method, url } = parseFetchArgs(args); 17103 const handlerData = { 17104 args, 17105 fetchData: { 17106 method, 17107 url 17108 }, 17109 startTimestamp: timestampInSeconds() * 1e3, 17110 // // Adding the error to be able to fingerprint the failed fetch event in HttpClient instrumentation 17111 virtualError 17112 }; 17113 if (!onFetchResolved) { 17114 triggerHandlers$1("fetch", __spreadValues({}, handlerData)); 17115 } 17116 return originalFetch.apply(GLOBAL_OBJ, args).then( 17117 (response) => __async(null, null, function* () { 17118 if (onFetchResolved) { 17119 onFetchResolved(response); 17120 } else { 17121 triggerHandlers$1("fetch", __spreadProps(__spreadValues({}, handlerData), { 17122 endTimestamp: timestampInSeconds() * 1e3, 17123 response 17124 })); 17125 } 17126 return response; 17127 }), 17128 (error) => { 17129 triggerHandlers$1("fetch", __spreadProps(__spreadValues({}, handlerData), { 17130 endTimestamp: timestampInSeconds() * 1e3, 17131 error 17132 })); 17133 if (isError(error) && error.stack === void 0) { 17134 error.stack = virtualError.stack; 17135 addNonEnumerableProperty(error, "framesToPop", 1); 17136 } 17137 throw error; 17138 } 17139 ); 17140 }; 17141 }); 17142 } 17143 function resolveResponse(res, onFinishedResolving) { 17144 return __async(this, null, function* () { 17145 if (res && res.body) { 17146 const body = res.body; 17147 const responseReader = body.getReader(); 17148 const maxFetchDurationTimeout = setTimeout( 17149 () => { 17150 body.cancel().then(null, () => { 17151 }); 17152 }, 17153 90 * 1e3 17154 // 90s 17155 ); 17156 let readingActive = true; 17157 while (readingActive) { 17158 let chunkTimeout; 17159 try { 17160 chunkTimeout = setTimeout(() => { 17161 body.cancel().then(null, () => { 17162 }); 17163 }, 5e3); 17164 const { done } = yield responseReader.read(); 17165 clearTimeout(chunkTimeout); 17166 if (done) { 17167 onFinishedResolving(); 17168 readingActive = false; 17169 } 17170 } catch (error) { 17171 readingActive = false; 17172 } finally { 17173 clearTimeout(chunkTimeout); 17174 } 17175 } 17176 clearTimeout(maxFetchDurationTimeout); 17177 responseReader.releaseLock(); 17178 body.cancel().then(null, () => { 17179 }); 17180 } 17181 }); 17182 } 17183 function streamHandler(response) { 17184 let clonedResponseForResolving;
17185 try { 17186 clonedResponseForResolving = response.clone(); 17187 } catch (e2) { 17188 return; 17189 } 17190 resolveResponse(clonedResponseForResolving, () => { 17191 triggerHandlers$1("fetch-body-resolved", { 17192 endTimestamp: timestampInSeconds() * 1e3, 17193 response 17194 }); 17195 }); 17196 } 17197 function hasProp(obj, prop) { 17198 return !!obj && typeof obj === "object" && !!obj[prop]; 17199 } 17200 function getUrlFromResource(resource) { 17201 if (typeof resource === "string") { 17202 return resource; 17203 } 17204 if (!resource) { 17205 return ""; 17206 } 17207 if (hasProp(resource, "url")) { 17208 return resource.url; 17209 } 17210 if (resource.toString) { 17211 return resource.toString(); 17212 } 17213 return ""; 17214 } 17215 function parseFetchArgs(fetchArgs) { 17216 if (fetchArgs.length === 0) { 17217 return { method: "GET", url: "" }; 17218 } 17219 if (fetchArgs.length === 2) { 17220 const [url, options2] = fetchArgs; 17221 return { 17222 url: getUrlFromResource(url), 17223 method: hasProp(options2, "method") ? String(options2.method).toUpperCase() : "GET" 17224 }; 17225 } 17226 const arg = fetchArgs[0]; 17227 return { 17228 url: getUrlFromResource(arg), 17229 method: hasProp(arg, "method") ? String(arg.method).toUpperCase() : "GET" 17230 }; 17231 } 17232 function getSDKSource() { 17233 return "npm"; 17234 } 17235 const WINDOW$2 = GLOBAL_OBJ; 17236 function supportsHistory() { 17237 const chromeVar = WINDOW$2.chrome; 17238 const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime; 17239 const hasHistoryApi = "history" in WINDOW$2 && !!WINDOW$2.history.pushState && !!WINDOW$2.history.replaceState; 17240 return !isChromePackagedApp && hasHistoryApi; 17241 } 17242 const WINDOW$1 = GLOBAL_OBJ; 17243 let ignoreOnError = 0; 17244 function shouldIgnoreOnError() { 17245 return ignoreOnError > 0; 17246 } 17247 function ignoreNextOnError() { 17248 ignoreOnError++; 17249 setTimeout(() => { 17250 ignoreOnError--; 17251 }); 17252 } 17253 function wrap(fn2, options2 = {}) { 17254 function isFunction2(fn3) { 17255 return typeof fn3 === "function"; 17256 } 17257 if (!isFunction2(fn2)) { 17258 return fn2; 17259 } 17260 try { 17261 const wrapper = fn2.__sentry_wrapped__; 17262 if (wrapper) { 17263 if (typeof wrapper === "function") { 17264 return wrapper; 17265 } else { 17266 return fn2; 17267 } 17268 } 17269 if (getOriginalFunction(fn2)) { 17270 return fn2; 17271 } 17272 } catch (e2) { 17273 return fn2; 17274 } 17275 const sentryWrapped = function(...args) { 17276 try { 17277 const wrappedArguments = args.map((arg) => wrap(arg, options2)); 17278 return fn2.apply(this, wrappedArguments); 17279 } catch (ex) { 17280 ignoreNextOnError(); 17281 withScope((scope) => { 17282 scope.addEventProcessor((event) => { 17283 if (options2.mechanism) { 17284 addExceptionTypeValue(event, void 0); 17285 addExceptionMechanism(event, options2.mechanism); 17286 } 17287 event.extra = __spreadProps(__spreadValues({}, event.extra), { 17288 arguments: args 17289 }); 17290 return event; 17291 }); 17292 captureException(ex); 17293 }); 17294 throw ex; 17295 } 17296 }; 17297 try { 17298 for (const property2 in fn2) { 17299 if (Object.prototype.hasOwnProperty.call(fn2, property2)) { 17300 sentryWrapped[property2] = fn2[property2]; 17301 } 17302 } 17303 } catch (e2) { 17304 } 17305 markFunctionWrapped(sentryWrapped, fn2); 17306 addNonEnumerableProperty(fn2, "__sentry_wrapped__", sentryWrapped); 17307 try { 17308 const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, "name"); 17309 if (descriptor.configurable) { 17310 Object.defineProperty(sentryWrapped, "name", { 17311 get() { 17312 return fn2.name; 17313 } 17314 }); 17315 } 17316 } catch (e3) { 17317 } 17318 return sentryWrapped; 17319 } 17320 const DEBUG_BUILD$1 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; 17321 function exceptionFromError(stackParser, ex) { 17322 const frames = parseStackFrames(stackParser, ex); 17323 const exception = { 17324 type: extractType(ex), 17325 value: extractMessage(ex) 17326 }; 17327 if (frames.length) { 17328 exception.stacktrace = { frames }; 17329 } 17330 if (exception.type === void 0 && exception.value === "") { 17331 exception.value = "Unrecoverable error caught"; 17332 } 17333 return exception; 17334 } 17335 function eventFromPlainObject(stackParser, exception, syntheticException, isUnhandledRejection) { 17336 const client2 = getClient(); 17337 const normalizeDepth = client2 && client2.getOptions().normalizeDepth; 17338 const errorFromProp = getErrorPropertyFromObject(exception); 17339 const extra = { 17340 __serialized__: normalizeToSize(exception, normalizeDepth) 17341 }; 17342 if (errorFromProp) { 17343 return { 17344 exception: { 17345 values: [exceptionFromError(stackParser, errorFromProp)] 17346 }, 17347 extra 17348 }; 17349 } 17350 const event = { 17351 exception: { 17352 values: [ 17353 { 17354 type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? "UnhandledRejection" : "Error", 17355 value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }) 17356 } 17357 ] 17358 }, 17359 extra 17360 }; 17361 if (syntheticException) { 17362 const frames = parseStackFrames(stackParser, syntheticException); 17363 if (frames.length) { 17364 event.exception.values[0].stacktrace = { frames }; 17365 } 17366 } 17367 return event; 17368 } 17369 function eventFromError(stackParser, ex) { 17370 return { 17371 exception: { 17372 values: [exceptionFromError(stackParser, ex)] 17373 } 17374 }; 17375 } 17376 function parseStackFrames(stackParser, ex) { 17377 const stacktrace = ex.stacktrace || ex.stack || ""; 17378 const skipLines = getSkipFirstStackStringLines(ex); 17379 const framesToPop = getPopFirstTopFrames(ex);
17380 try { 17381 return stackParser(stacktrace, skipLines, framesToPop); 17382 } catch (e2) { 17383 } 17384 return []; 17385 } 17386 const reactMinifiedRegexp = /Minified React error #\d+;/i; 17387 function getSkipFirstStackStringLines(ex) { 17388 if (ex && reactMinifiedRegexp.test(ex.message)) { 17389 return 1; 17390 } 17391 return 0; 17392 } 17393 function getPopFirstTopFrames(ex) { 17394 if (typeof ex.framesToPop === "number") { 17395 return ex.framesToPop; 17396 } 17397 return 0; 17398 } 17399 function isWebAssemblyException(exception) { 17400 if (typeof WebAssembly !== "undefined" && typeof WebAssembly.Exception !== "undefined") { 17401 return exception instanceof WebAssembly.Exception; 17402 } else { 17403 return false; 17404 } 17405 } 17406 function extractType(ex) { 17407 const name = ex && ex.name; 17408 if (!name && isWebAssemblyException(ex)) { 17409 const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2; 17410 return hasTypeInMessage ? ex.message[0] : "WebAssembly.Exception"; 17411 } 17412 return name; 17413 } 17414 function extractMessage(ex) { 17415 const message = ex && ex.message; 17416 if (!message) { 17417 return "No error message"; 17418 } 17419 if (message.error && typeof message.error.message === "string") { 17420 return message.error.message; 17421 } 17422 if (isWebAssemblyException(ex) && Array.isArray(ex.message) && ex.message.length == 2) { 17423 return ex.message[1]; 17424 } 17425 return message; 17426 } 17427 function eventFromException(stackParser, exception, hint, attachStacktrace) { 17428 const syntheticException = hint && hint.syntheticException || void 0; 17429 const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace); 17430 addExceptionMechanism(event); 17431 event.level = "error"; 17432 if (hint && hint.event_id) { 17433 event.event_id = hint.event_id; 17434 } 17435 return resolvedSyncPromise(event); 17436 } 17437 function eventFromMessage(stackParser, message, level = "info", hint, attachStacktrace) { 17438 const syntheticException = hint && hint.syntheticException || void 0; 17439 const event = eventFromString(stackParser, message, syntheticException, attachStacktrace); 17440 event.level = level; 17441 if (hint && hint.event_id) { 17442 event.event_id = hint.event_id; 17443 } 17444 return resolvedSyncPromise(event); 17445 } 17446 function eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace, isUnhandledRejection) { 17447 let event; 17448 if (isErrorEvent$1(exception) && exception.error) { 17449 const errorEvent = exception; 17450 return eventFromError(stackParser, errorEvent.error); 17451 } 17452 if (isDOMError(exception) || isDOMException(exception)) { 17453 const domException = exception; 17454 if ("stack" in exception) { 17455 event = eventFromError(stackParser, exception); 17456 } else { 17457 const name = domException.name || (isDOMError(domException) ? "DOMError" : "DOMException"); 17458 const message = domException.message ? `${name}: ${domException.message}` : name; 17459 event = eventFromString(stackParser, message, syntheticException, attachStacktrace); 17460 addExceptionTypeValue(event, message); 17461 } 17462 if ("code" in domException) { 17463 event.tags = __spreadProps(__spreadValues({}, event.tags), { "DOMException.code": `${domException.code}` }); 17464 } 17465 return event; 17466 } 17467 if (isError(exception)) { 17468 return eventFromError(stackParser, exception); 17469 } 17470 if (isPlainObject$3(exception) || isEvent(exception)) { 17471 const objectException = exception; 17472 event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection); 17473 addExceptionMechanism(event, { 17474 synthetic: true 17475 }); 17476 return event; 17477 } 17478 event = eventFromString(stackParser, exception, syntheticException, attachStacktrace); 17479 addExceptionTypeValue(event, `${exception}`); 17480 addExceptionMechanism(event, { 17481 synthetic: true 17482 }); 17483 return event; 17484 } 17485 function eventFromString(stackParser, message, syntheticException, attachStacktrace) { 17486 const event = {}; 17487 if (attachStacktrace && syntheticException) { 17488 const frames = parseStackFrames(stackParser, syntheticException); 17489 if (frames.length) { 17490 event.exception = { 17491 values: [{ value: message, stacktrace: { frames } }] 17492 }; 17493 } 17494 addExceptionMechanism(event, { synthetic: true }); 17495 } 17496 if (isParameterizedString(message)) {
17497 const { __sentry_template_string__, __sentry_template_values__ } = message; 17498 event.logentry = { 17499 message: __sentry_template_string__, 17500 params: __sentry_template_values__ 17501 }; 17502 return event; 17503 } 17504 event.message = message; 17505 return event; 17506 } 17507 function getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }) { 17508 const keys2 = extractExceptionKeysForMessage(exception); 17509 const captureType = isUnhandledRejection ? "promise rejection" : "exception"; 17510 if (isErrorEvent$1(exception)) { 17511 return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``; 17512 } 17513 if (isEvent(exception)) { 17514 const className = getObjectClassName(exception); 17515 return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`; 17516 } 17517 return `Object captured as ${captureType} with keys: ${keys2}`; 17518 } 17519 function getObjectClassName(obj) { 17520 try { 17521 const prototype2 = Object.getPrototypeOf(obj); 17522 return prototype2 ? prototype2.constructor.name : void 0; 17523 } catch (e2) { 17524 } 17525 } 17526 function getErrorPropertyFromObject(obj) { 17527 for (const prop in obj) { 17528 if (Object.prototype.hasOwnProperty.call(obj, prop)) { 17529 const value = obj[prop]; 17530 if (value instanceof Error) { 17531 return value; 17532 } 17533 } 17534 } 17535 return void 0; 17536 } 17537 function createUserFeedbackEnvelope(feedback, { 17538 metadata, 17539 tunnel, 17540 dsn 17541 }) { 17542 const headers = __spreadValues(__spreadValues({ 17543 event_id: feedback.event_id, 17544 sent_at: (/* @__PURE__ */ new Date()).toISOString() 17545 }, metadata && metadata.sdk && { 17546 sdk: { 17547 name: metadata.sdk.name, 17548 version: metadata.sdk.version 17549 } 17550 }), !!tunnel && !!dsn && { dsn: dsnToString(dsn) }); 17551 const item = createUserFeedbackEnvelopeItem(feedback); 17552 return createEnvelope(headers, [item]); 17553 } 17554 function createUserFeedbackEnvelopeItem(feedback) { 17555 const feedbackHeaders = { 17556 type: "user_report" 17557 }; 17558 return [feedbackHeaders, feedback]; 17559 } 17560 class BrowserClient extends BaseClient { 17561 /** 17562 * Creates a new Browser SDK instance. 17563 * 17564 * @param options Configuration options for this SDK. 17565 */ 17566 constructor(options2) { 17567 const opts = __spreadValues({ 17568 // We default this to true, as it is the safer scenario 17569 parentSpanIsAlwaysRootSpan: true 17570 }, options2); 17571 const sdkSource = WINDOW$1.SENTRY_SDK_SOURCE || getSDKSource(); 17572 applySdkMetadata(opts, "browser", ["browser"], sdkSource); 17573 super(opts); 17574 if (opts.sendClientReports && WINDOW$1.document) { 17575 WINDOW$1.document.addEventListener("visibilitychange", () => { 17576 if (WINDOW$1.document.visibilityState === "hidden") { 17577 this._flushOutcomes(); 17578 } 17579 }); 17580 } 17581 } 17582 /** 17583 * @inheritDoc 17584 */ 17585 eventFromException(exception, hint) { 17586 return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace); 17587 } 17588 /** 17589 * @inheritDoc 17590 */ 17591 eventFromMessage(message, level = "info", hint) { 17592 return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace); 17593 } 17594 /** 17595 * Sends user feedback to Sentry. 17596 * 17597 * @deprecated Use `captureFeedback` instead. 17598 */ 17599 captureUserFeedback(feedback) { 17600 if (!this._isEnabled()) { 17601 DEBUG_BUILD$1 && logger.warn("SDK not enabled, will not capture user feedback."); 17602 return; 17603 } 17604 const envelope = createUserFeedbackEnvelope(feedback, { 17605 metadata: this.getSdkMetadata(), 17606 dsn: this.getDsn(), 17607 tunnel: this.getOptions().tunnel 17608 }); 17609 this.sendEnvelope(envelope); 17610 } 17611 /** 17612 * @inheritDoc 17613 */ 17614 _prepareEvent(event, hint, scope) { 17615 event.platform = event.platform || "javascript"; 17616 return super._prepareEvent(event, hint, scope); 17617 } 17618 } 17619 const DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; 17620 const getRating = (value, thresholds) => { 17621 if (value > thresholds[1]) { 17622 return "poor"; 17623 } 17624 if (value > thresholds[0]) { 17625 return "needs-improvement"; 17626 } 17627 return "good"; 17628 }; 17629 const bindReporter = (callback, metric, thresholds, reportAllChanges) => { 17630 let prevValue; 17631 let delta; 17632 return (forceReport) => { 17633 if (metric.value >= 0) { 17634 if (forceReport || reportAllChanges) {
17635 delta = metric.value - (prevValue || 0); 17636 if (delta || prevValue === void 0) { 17637 prevValue = metric.value; 17638 metric.delta = delta; 17639 metric.rating = getRating(metric.value, thresholds); 17640 callback(metric); 17641 } 17642 } 17643 } 17644 }; 17645 }; 17646 const WINDOW = GLOBAL_OBJ; 17647 const generateUniqueID = () => { 17648 return `v4-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`; 17649 }; 17650 const getNavigationEntry = (checkResponseStart = true) => { 17651 const navigationEntry = WINDOW.performance && WINDOW.performance.getEntriesByType && WINDOW.performance.getEntriesByType("navigation")[0]; 17652 if ( 17653 // sentry-specific change: 17654 // We don't want to check for responseStart for our own use of `getNavigationEntry` 17655 !checkResponseStart || navigationEntry && navigationEntry.responseStart > 0 && navigationEntry.responseStart < performance.now() 17656 ) { 17657 return navigationEntry; 17658 } 17659 }; 17660 const getActivationStart = () => { 17661 const navEntry = getNavigationEntry(); 17662 return navEntry && navEntry.activationStart || 0; 17663 }; 17664 const initMetric = (name, value) => { 17665 const navEntry = getNavigationEntry(); 17666 let navigationType = "navigate"; 17667 if (navEntry) { 17668 if (WINDOW.document && WINDOW.document.prerendering || getActivationStart() > 0) { 17669 navigationType = "prerender"; 17670 } else if (WINDOW.document && WINDOW.document.wasDiscarded) { 17671 navigationType = "restore"; 17672 } else if (navEntry.type) { 17673 navigationType = navEntry.type.replace(/_/g, "-"); 17674 } 17675 } 17676 const entries2 = []; 17677 return { 17678 name, 17679 value: typeof value === "undefined" ? -1 : value, 17680 rating: "good", 17681 // If needed, will be updated when reported. `const` to keep the type from widening to `string`. 17682 delta: 0, 17683 entries: entries2, 17684 id: generateUniqueID(), 17685 navigationType 17686 }; 17687 }; 17688 const observe = (type, callback, opts) => { 17689 try { 17690 if (PerformanceObserver.supportedEntryTypes.includes(type)) { 17691 const po2 = new PerformanceObserver((list) => { 17692 Promise.resolve().then(() => { 17693 callback(list.getEntries()); 17694 }); 17695 }); 17696 po2.observe( 17697 Object.assign( 17698 { 17699 type, 17700 buffered: true 17701 }, 17702 opts || {} 17703 ) 17704 ); 17705 return po2; 17706 } 17707 } catch (e2) { 17708 } 17709 return; 17710 }; 17711 const onHidden = (cb) => { 17712 const onHiddenOrPageHide = (event) => { 17713 if (event.type === "pagehide" || WINDOW.document && WINDOW.document.visibilityState === "hidden") { 17714 cb(event); 17715 } 17716 }; 17717 if (WINDOW.document) { 17718 addEventListener("visibilitychange", onHiddenOrPageHide, true); 17719 addEventListener("pagehide", onHiddenOrPageHide, true); 17720 } 17721 }; 17722 const runOnce = (cb) => { 17723 let called = false; 17724 return () => { 17725 if (!called) { 17726 cb(); 17727 called = true; 17728 } 17729 }; 17730 }; 17731 let firstHiddenTime = -1; 17732 const initHiddenTime = () => { 17733 return WINDOW.document.visibilityState === "hidden" && !WINDOW.document.prerendering ? 0 : Infinity; 17734 }; 17735 const onVisibilityUpdate = (event) => { 17736 if (WINDOW.document.visibilityState === "hidden" && firstHiddenTime > -1) { 17737 firstHiddenTime = event.type === "visibilitychange" ? event.timeStamp : 0; 17738 removeChangeListeners(); 17739 } 17740 }; 17741 const addChangeListeners = () => { 17742 addEventListener("visibilitychange", onVisibilityUpdate, true); 17743 addEventListener("prerenderingchange", onVisibilityUpdate, true); 17744 }; 17745 const removeChangeListeners = () => { 17746 removeEventListener("visibilitychange", onVisibilityUpdate, true); 17747 removeEventListener("prerenderingchange", onVisibilityUpdate, true); 17748 }; 17749 const getVisibilityWatcher = () => { 17750 if (WINDOW.document && firstHiddenTime < 0) { 17751 firstHiddenTime = initHiddenTime(); 17752 addChangeListeners(); 17753 } 17754 return { 17755 get firstHiddenTime() { 17756 return firstHiddenTime; 17757 } 17758 }; 17759 }; 17760 const whenActivated = (callback) => { 17761 if (WINDOW.document && WINDOW.document.prerendering) { 17762 addEventListener("prerenderingchange", () => callback(), true); 17763 } else { 17764 callback(); 17765 } 17766 }; 17767 const FCPThresholds = [1800, 3e3]; 17768 const onFCP = (onReport, opts = {}) => { 17769 whenActivated(() => { 17770 const visibilityWatcher = getVisibilityWatcher(); 17771 const metric = initMetric("FCP"); 17772 let report; 17773 const handleEntries = (entries2) => {
17774 entries2.forEach((entry) => { 17775 if (entry.name === "first-contentful-paint") { 17776 po2.disconnect(); 17777 if (entry.startTime < visibilityWatcher.firstHiddenTime) { 17778 metric.value = Math.max(entry.startTime - getActivationStart(), 0); 17779 metric.entries.push(entry); 17780 report(true); 17781 } 17782 } 17783 }); 17784 }; 17785 const po2 = observe("paint", handleEntries); 17786 if (po2) { 17787 report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges); 17788 } 17789 }); 17790 }; 17791 const CLSThresholds = [0.1, 0.25]; 17792 const onCLS = (onReport, opts = {}) => { 17793 onFCP( 17794 runOnce(() => { 17795 const metric = initMetric("CLS", 0); 17796 let report; 17797 let sessionValue = 0; 17798 let sessionEntries = []; 17799 const handleEntries = (entries2) => { 17800 entries2.forEach((entry) => { 17801 if (!entry.hadRecentInput) { 17802 const firstSessionEntry = sessionEntries[0]; 17803 const lastSessionEntry = sessionEntries[sessionEntries.length - 1]; 17804 if (sessionValue && firstSessionEntry && lastSessionEntry && entry.startTime - lastSessionEntry.startTime < 1e3 && entry.startTime - firstSessionEntry.startTime < 5e3) { 17805 sessionValue += entry.value; 17806 sessionEntries.push(entry); 17807 } else { 17808 sessionValue = entry.value; 17809 sessionEntries = [entry]; 17810 } 17811 } 17812 }); 17813 if (sessionValue > metric.value) { 17814 metric.value = sessionValue; 17815 metric.entries = sessionEntries; 17816 report(); 17817 } 17818 }; 17819 const po2 = observe("layout-shift", handleEntries); 17820 if (po2) { 17821 report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges); 17822 onHidden(() => { 17823 handleEntries(po2.takeRecords()); 17824 report(true); 17825 }); 17826 setTimeout(report, 0); 17827 } 17828 }) 17829 ); 17830 }; 17831 const FIDThresholds = [100, 300]; 17832 const onFID = (onReport, opts = {}) => { 17833 whenActivated(() => { 17834 const visibilityWatcher = getVisibilityWatcher(); 17835 const metric = initMetric("FID"); 17836 let report; 17837 const handleEntry = (entry) => { 17838 if (entry.startTime < visibilityWatcher.firstHiddenTime) { 17839 metric.value = entry.processingStart - entry.startTime; 17840 metric.entries.push(entry); 17841 report(true); 17842 } 17843 }; 17844 const handleEntries = (entries2) => { 17845 entries2.forEach(handleEntry); 17846 }; 17847 const po2 = observe("first-input", handleEntries); 17848 report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges); 17849 if (po2) { 17850 onHidden( 17851 runOnce(() => { 17852 handleEntries(po2.takeRecords()); 17853 po2.disconnect(); 17854 }) 17855 ); 17856 } 17857 }); 17858 }; 17859 let interactionCountEstimate = 0; 17860 let minKnownInteractionId = Infinity; 17861 let maxKnownInteractionId = 0; 17862 const updateEstimate = (entries2) => { 17863 entries2.forEach((e2) => { 17864 if (e2.interactionId) { 17865 minKnownInteractionId = Math.min(minKnownInteractionId, e2.interactionId); 17866 maxKnownInteractionId = Math.max(maxKnownInteractionId, e2.interactionId); 17867 interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0; 17868 } 17869 }); 17870 }; 17871 let po$1; 17872 const getInteractionCount = () => { 17873 return po$1 ? interactionCountEstimate : performance.interactionCount || 0; 17874 }; 17875 const initInteractionCountPolyfill = () => { 17876 if ("interactionCount" in performance || po$1) return; 17877 po$1 = observe("event", updateEstimate, { 17878 type: "event", 17879 buffered: true, 17880 durationThreshold: 0 17881 }); 17882 }; 17883 const longestInteractionList = []; 17884 const longestInteractionMap = /* @__PURE__ */ new Map(); 17885 const DEFAULT_DURATION_THRESHOLD = 40; 17886 let prevInteractionCount = 0; 17887 const getInteractionCountForNavigation = () => { 17888 return getInteractionCount() - prevInteractionCount; 17889 }; 17890 const estimateP98LongestInteraction = () => { 17891 const candidateInteractionIndex = Math.min( 17892 longestInteractionList.length - 1, 17893 Math.floor(getInteractionCountForNavigation() / 50) 17894 ); 17895 return longestInteractionList[candidateInteractionIndex]; 17896 }; 17897 const MAX_INTERACTIONS_TO_CONSIDER = 10; 17898 const entryPreProcessingCallbacks = []; 17899 const processInteractionEntry = (entry) => { 17900 entryPreProcessingCallbacks.forEach((cb) => cb(entry)); 17901 if (!(entry.interactionId || entry.entryType === "first-input")) return; 17902 const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1]; 17903 const existingInteraction = longestInteractionMap.get(entry.interactionId); 17904 if (existingInteraction || longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER || minLongestInteraction && entry.duration > minLongestInteraction.latency) { 17905 if (existingInteraction) { 17906 if (entry.duration > existingInteraction.latency) { 17907 existingInteraction.entries = [entry]; 17908 existingInteraction.latency = entry.duration; 17909 } else if (entry.duration === existingInteraction.latency && entry.startTime === (existingInteraction.entries[0] && existingInteraction.entries[0].startTime)) { 17910 existingInteraction.entries.push(entry); 17911 } 17912 } else { 17913 const interaction = { 17914 id: entry.interactionId, 17915 latency: entry.duration,
17916 entries: [entry] 17917 }; 17918 longestInteractionMap.set(interaction.id, interaction); 17919 longestInteractionList.push(interaction); 17920 } 17921 longestInteractionList.sort((a2, b2) => b2.latency - a2.latency); 17922 if (longestInteractionList.length > MAX_INTERACTIONS_TO_CONSIDER) { 17923 longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach((i2) => longestInteractionMap.delete(i2.id)); 17924 } 17925 } 17926 }; 17927 const whenIdle = (cb) => { 17928 const rIC = WINDOW.requestIdleCallback || WINDOW.setTimeout; 17929 let handle = -1; 17930 cb = runOnce(cb); 17931 if (WINDOW.document && WINDOW.document.visibilityState === "hidden") { 17932 cb(); 17933 } else { 17934 handle = rIC(cb); 17935 onHidden(cb); 17936 } 17937 return handle; 17938 }; 17939 const INPThresholds = [200, 500]; 17940 const onINP = (onReport, opts = {}) => { 17941 if (!("PerformanceEventTiming" in WINDOW && "interactionId" in PerformanceEventTiming.prototype)) { 17942 return; 17943 } 17944 whenActivated(() => { 17945 initInteractionCountPolyfill(); 17946 const metric = initMetric("INP"); 17947 let report; 17948 const handleEntries = (entries2) => { 17949 whenIdle(() => { 17950 entries2.forEach(processInteractionEntry); 17951 const inp = estimateP98LongestInteraction(); 17952 if (inp && inp.latency !== metric.value) { 17953 metric.value = inp.latency; 17954 metric.entries = inp.entries; 17955 report(); 17956 } 17957 }); 17958 }; 17959 const po2 = observe("event", handleEntries, { 17960 // Event Timing entries have their durations rounded to the nearest 8ms, 17961 // so a duration of 40ms would be any event that spans 2.5 or more frames 17962 // at 60Hz. This threshold is chosen to strike a balance between usefulness 17963 // and performance. Running this callback for any interaction that spans 17964 // just one or two frames is likely not worth the insight that could be 17965 // gained. 17966 durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : DEFAULT_DURATION_THRESHOLD 17967 }); 17968 report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges); 17969 if (po2) { 17970 po2.observe({ type: "first-input", buffered: true }); 17971 onHidden(() => { 17972 handleEntries(po2.takeRecords()); 17973 report(true); 17974 }); 17975 } 17976 }); 17977 }; 17978 const LCPThresholds = [2500, 4e3]; 17979 const reportedMetricIDs = {}; 17980 const onLCP = (onReport, opts = {}) => { 17981 whenActivated(() => { 17982 const visibilityWatcher = getVisibilityWatcher(); 17983 const metric = initMetric("LCP"); 17984 let report; 17985 const handleEntries = (entries2) => { 17986 if (!opts.reportAllChanges) { 17987 entries2 = entries2.slice(-1); 17988 } 17989 entries2.forEach((entry) => { 17990 if (entry.startTime < visibilityWatcher.firstHiddenTime) { 17991 metric.value = Math.max(entry.startTime - getActivationStart(), 0); 17992 metric.entries = [entry]; 17993 report(); 17994 } 17995 }); 17996 }; 17997 const po2 = observe("largest-contentful-paint", handleEntries); 17998 if (po2) { 17999 report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges); 18000 const stopListening = runOnce(() => { 18001 if (!reportedMetricIDs[metric.id]) { 18002 handleEntries(po2.takeRecords()); 18003 po2.disconnect(); 18004 reportedMetricIDs[metric.id] = true; 18005 report(true); 18006 } 18007 }); 18008 ["keydown", "click"].forEach((type) => { 18009 if (WINDOW.document) { 18010 addEventListener(type, () => whenIdle(stopListening), { 18011 once: true, 18012 capture: true 18013 }); 18014 } 18015 }); 18016 onHidden(stopListening); 18017 } 18018 }); 18019 }; 18020 const TTFBThresholds = [800, 1800]; 18021 const whenReady = (callback) => { 18022 if (WINDOW.document && WINDOW.document.prerendering) { 18023 whenActivated(() => whenReady(callback)); 18024 } else if (WINDOW.document && WINDOW.document.readyState !== "complete") { 18025 addEventListener("load", () => whenReady(callback), true); 18026 } else { 18027 setTimeout(callback, 0); 18028 } 18029 }; 18030 const onTTFB = (onReport, opts = {}) => { 18031 const metric = initMetric("TTFB"); 18032 const report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges); 18033 whenReady(() => { 18034 const navigationEntry = getNavigationEntry(); 18035 if (navigationEntry) { 18036 metric.value = Math.max(navigationEntry.responseStart - getActivationStart(), 0); 18037 metric.entries = [navigationEntry]; 18038 report(true); 18039 } 18040 }); 18041 }; 18042 const handlers = {}; 18043 const instrumented = {}; 18044 let _previousCls; 18045 let _previousFid; 18046 let _previousLcp; 18047 let _previousTtfb; 18048 let _previousInp; 18049 function addClsInstrumentationHandler(callback, stopOnCallback = false) { 18050 return addMetricObserver("cls", callback, instrumentCls, _previousCls, stopOnCallback); 18051 } 18052 function addLcpInstrumentationHandler(callback, stopOnCallback = false) { 18053 return addMetricObserver("lcp", callback, instrumentLcp, _previousLcp, stopOnCallback); 18054 } 18055 function addFidInstrumentationHandler(callback) { 18056 return addMetricObserver("fid", callback, instrumentFid, _previousFid); 18057 } 18058 function addTtfbInstrumentationHandler(callback) { 18059 return addMetricObserver("ttfb", callback, instrumentTtfb, _previousTtfb); 18060 } 18061 function addInpInstrumentationHandler(callback) { 18062 return addMetricObserver("inp", callback, instrumentInp, _previousInp); 18063 } 18064 function addPerformanceInstrumentationHandler(type, callback) { 18065 addHandler(type, callback); 18066 if (!instrumented[type]) { 18067 instrumentPerformanceObserver(type); 18068 instrumented[type] = true; 18069 } 18070 return getCleanupCallback(type, callback); 18071 } 18072 function triggerHandlers(type, data) { 18073 const typeHandlers = handlers[type]; 18074 if (!typeHandlers || !typeHandlers.length) { 18075 return; 18076 } 18077 for (const handler of typeHandlers) { 18078 try { 18079 handler(data); 18080 } catch (e2) { 18081 DEBUG_BUILD && logger.error( 18082 `Error while triggering instrumentation handler. 18083Type: ${type} 18084Name: ${getFunctionName(handler)} 18085Error:`, 18086 e2 18087 ); 18088 } 18089 } 18090 } 18091 function instrumentCls() { 18092 return onCLS( 18093 (metric) => { 18094 triggerHandlers("cls", { 18095 metric 18096 }); 18097 _previousCls = metric; 18098 }, 18099 // We want the callback to be called whenever the CLS value updates. 18100 // By default, the callback is only called when the tab goes to the background. 18101 { reportAllChanges: true } 18102 ); 18103 } 18104 function instrumentFid() { 18105 return onFID((metric) => { 18106 triggerHandlers("fid", { 18107 metric 18108 }); 18109 _previousFid = metric; 18110 }); 18111 } 18112 function instrumentLcp() { 18113 return onLCP( 18114 (metric) => { 18115 triggerHandlers("lcp", { 18116 metric 18117 }); 18118 _previousLcp = metric; 18119 }, 18120 // We want the callback to be called whenever the LCP value updates. 18121 // By default, the callback is only called when the tab goes to the background. 18122 { reportAllChanges: true } 18123 ); 18124 } 18125 function instrumentTtfb() { 18126 return onTTFB((metric) => { 18127 triggerHandlers("ttfb", { 18128 metric 18129 }); 18130 _previousTtfb = metric; 18131 }); 18132 } 18133 function instrumentInp() { 18134 return onINP((metric) => { 18135 triggerHandlers("inp", { 18136 metric 18137 }); 18138 _previousInp = metric; 18139 }); 18140 } 18141 function addMetricObserver(type, callback, instrumentFn, previousValue, stopOnCallback = false) { 18142 addHandler(type, callback); 18143 let stopListening; 18144 if (!instrumented[type]) { 18145 stopListening = instrumentFn(); 18146 instrumented[type] = true; 18147 } 18148 if (previousValue) { 18149 callback({ metric: previousValue }); 18150 } 18151 return getCleanupCallback(type, callback, stopOnCallback ? stopListening : void 0); 18152 } 18153 function instrumentPerformanceObserver(type) { 18154 const options2 = {}; 18155 if (type === "event") { 18156 options2.durationThreshold = 0; 18157 } 18158 observe( 18159 type, 18160 (entries2) => { 18161 triggerHandlers(type, { entries: entries2 }); 18162 }, 18163 options2 18164 ); 18165 } 18166 function addHandler(type, handler) { 18167 handlers[type] = handlers[type] || []; 18168 handlers[type].push(handler); 18169 } 18170 function getCleanupCallback(type, callback, stopListening) { 18171 return () => { 18172 if (stopListening) { 18173 stopListening(); 18174 } 18175 const typeHandlers = handlers[type]; 18176 if (!typeHandlers) { 18177 return; 18178 } 18179 const index2 = typeHandlers.indexOf(callback); 18180 if (index2 !== -1) { 18181 typeHandlers.splice(index2, 1); 18182 } 18183 }; 18184 } 18185 function isPerformanceEventTiming(entry) { 18186 return "duration" in entry; 18187 } 18188 function isMeasurementValue(value) { 18189 return typeof value === "number" && isFinite(value); 18190 } 18191 function startAndEndSpan(parentSpan, startTimeInSeconds, endTime, _e2) { 18192 var ctx = __objRest(_e2, []); 18193 const parentStartTime = spanToJSON(parentSpan).start_timestamp; 18194 if (parentStartTime && parentStartTime > startTimeInSeconds) { 18195 if (typeof parentSpan.updateStartTime === "function") { 18196 parentSpan.updateStartTime(startTimeInSeconds); 18197 } 18198 } 18199 return withActiveSpan(parentSpan, () => { 18200 const span = startInactiveSpan(__spreadValues({ 18201 startTime: startTimeInSeconds 18202 }, ctx)); 18203 if (span) {
18204 span.end(endTime); 18205 } 18206 return span; 18207 }); 18208 } 18209 function startStandaloneWebVitalSpan(options2) { 18210 const client2 = getClient(); 18211 if (!client2) { 18212 return; 18213 } 18214 const { name, transaction, attributes: passedAttributes, startTime } = options2; 18215 const { release, environment } = client2.getOptions(); 18216 const replay = client2.getIntegrationByName("Replay"); 18217 const replayId = replay && replay.getReplayId(); 18218 const scope = getCurrentScope(); 18219 const user = scope.getUser(); 18220 const userDisplay = user !== void 0 ? user.email || user.id || user.ip_address : void 0; 18221 let profileId; 18222 try { 18223 profileId = scope.getScopeData().contexts.profile.profile_id; 18224 } catch (e2) { 18225 } 18226 const attributes = __spreadValues({ 18227 release, 18228 environment, 18229 user: userDisplay || void 0, 18230 profile_id: profileId || void 0, 18231 replay_id: replayId || void 0, 18232 transaction, 18233 // Web vital score calculation relies on the user agent to account for different 18234 // browsers setting different thresholds for what is considered a good/meh/bad value. 18235 // For example: Chrome vs. Chrome Mobile 18236 "user_agent.original": WINDOW.navigator && WINDOW.navigator.userAgent 18237 }, passedAttributes); 18238 return startInactiveSpan({ 18239 name, 18240 attributes, 18241 startTime, 18242 experimental: { 18243 standalone: true 18244 } 18245 }); 18246 } 18247 function getBrowserPerformanceAPI() { 18248 return WINDOW && WINDOW.addEventListener && WINDOW.performance; 18249 } 18250 function msToSec(time2) { 18251 return time2 / 1e3; 18252 } 18253 function extractNetworkProtocol(nextHopProtocol) { 18254 let name = "unknown"; 18255 let version = "unknown"; 18256 let _name = ""; 18257 for (const char2 of nextHopProtocol) { 18258 if (char2 === "/") { 18259 [name, version] = nextHopProtocol.split("/"); 18260 break; 18261 } 18262 if (!isNaN(Number(char2))) { 18263 name = _name === "h" ? "http" : _name; 18264 version = nextHopProtocol.split(_name)[1]; 18265 break; 18266 } 18267 _name += char2; 18268 } 18269 if (_name === nextHopProtocol) { 18270 name = _name; 18271 } 18272 return { name, version }; 18273 } 18274 function trackClsAsStandaloneSpan() { 18275 let standaloneCLsValue = 0; 18276 let standaloneClsEntry; 18277 let pageloadSpanId; 18278 if (!supportsLayoutShift()) { 18279 return; 18280 } 18281 let sentSpan = false; 18282 function _collectClsOnce() { 18283 if (sentSpan) { 18284 return; 18285 } 18286 sentSpan = true; 18287 if (pageloadSpanId) { 18288 sendStandaloneClsSpan(standaloneCLsValue, standaloneClsEntry, pageloadSpanId); 18289 } 18290 cleanupClsHandler(); 18291 } 18292 const cleanupClsHandler = addClsInstrumentationHandler(({ metric }) => { 18293 const entry = metric.entries[metric.entries.length - 1]; 18294 if (!entry) { 18295 return; 18296 } 18297 standaloneCLsValue = metric.value; 18298 standaloneClsEntry = entry; 18299 }, true); 18300 onHidden(() => { 18301 _collectClsOnce(); 18302 }); 18303 setTimeout(() => { 18304 const client2 = getClient(); 18305 if (!client2) { 18306 return; 18307 } 18308 const unsubscribeStartNavigation = client2.on("startNavigationSpan", () => { 18309 _collectClsOnce(); 18310 unsubscribeStartNavigation && unsubscribeStartNavigation(); 18311 }); 18312 const activeSpan = getActiveSpan(); 18313 const rootSpan = activeSpan && getRootSpan(activeSpan); 18314 const spanJSON = rootSpan && spanToJSON(rootSpan); 18315 if (spanJSON && spanJSON.op === "pageload") { 18316 pageloadSpanId = rootSpan.spanContext().spanId; 18317 } 18318 }, 0); 18319 } 18320 function sendStandaloneClsSpan(clsValue, entry, pageloadSpanId) { 18321 DEBUG_BUILD && logger.log(`Sending CLS span (${clsValue})`); 18322 const startTime = msToSec((browserPerformanceTimeOrigin || 0) + (entry && entry.startTime || 0)); 18323 const routeName = getCurrentScope().getScopeData().transactionName; 18324 const name = entry ? htmlTreeAsString(entry.sources[0] && entry.sources[0].node) : "Layout shift"; 18325 const attributes = dropUndefinedKeys({ 18326 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser.cls", 18327 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "ui.webvital.cls", 18328 [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry && entry.duration || 0, 18329 // attach the pageload span id to the CLS span so that we can link them in the UI 18330 "sentry.pageload.span_id": pageloadSpanId 18331 }); 18332 const span = startStandaloneWebVitalSpan({ 18333 name, 18334 transaction: routeName, 18335 attributes, 18336 startTime 18337 }); 18338 if (span) { 18339 span.addEvent("cls", { 18340 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: "", 18341 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: clsValue 18342 }); 18343 span.end(startTime); 18344 } 18345 } 18346 function supportsLayoutShift() {
18347 try { 18348 return PerformanceObserver.supportedEntryTypes.includes("layout-shift"); 18349 } catch (e2) { 18350 return false; 18351 } 18352 } 18353 const MAX_INT_AS_BYTES = 2147483647; 18354 let _performanceCursor = 0; 18355 let _measurements = {}; 18356 let _lcpEntry; 18357 let _clsEntry; 18358 function startTrackingWebVitals({ recordClsStandaloneSpans }) { 18359 const performance2 = getBrowserPerformanceAPI(); 18360 if (performance2 && browserPerformanceTimeOrigin) { 18361 if (performance2.mark) { 18362 WINDOW.performance.mark("sentry-tracing-init"); 18363 } 18364 const fidCleanupCallback = _trackFID(); 18365 const lcpCleanupCallback = _trackLCP(); 18366 const ttfbCleanupCallback = _trackTtfb(); 18367 const clsCleanupCallback = recordClsStandaloneSpans ? trackClsAsStandaloneSpan() : _trackCLS(); 18368 return () => { 18369 fidCleanupCallback(); 18370 lcpCleanupCallback(); 18371 ttfbCleanupCallback(); 18372 clsCleanupCallback && clsCleanupCallback(); 18373 }; 18374 } 18375 return () => void 0; 18376 } 18377 function startTrackingLongTasks() { 18378 addPerformanceInstrumentationHandler("longtask", ({ entries: entries2 }) => { 18379 const parent = getActiveSpan(); 18380 if (!parent) { 18381 return; 18382 } 18383 const { op: parentOp, start_timestamp: parentStartTimestamp } = spanToJSON(parent); 18384 for (const entry of entries2) { 18385 const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); 18386 const duration = msToSec(entry.duration); 18387 if (parentOp === "navigation" && parentStartTimestamp && startTime < parentStartTimestamp) { 18388 continue; 18389 } 18390 startAndEndSpan(parent, startTime, startTime + duration, { 18391 name: "Main UI thread blocked", 18392 op: "ui.long-task", 18393 attributes: { 18394 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18395 } 18396 }); 18397 } 18398 }); 18399 } 18400 function startTrackingLongAnimationFrames() { 18401 const observer = new PerformanceObserver((list) => { 18402 const parent = getActiveSpan(); 18403 if (!parent) { 18404 return; 18405 } 18406 for (const entry of list.getEntries()) { 18407 if (!entry.scripts[0]) { 18408 continue; 18409 } 18410 const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); 18411 const { start_timestamp: parentStartTimestamp, op: parentOp } = spanToJSON(parent); 18412 if (parentOp === "navigation" && parentStartTimestamp && startTime < parentStartTimestamp) { 18413 continue; 18414 } 18415 const duration = msToSec(entry.duration); 18416 const attributes = { 18417 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18418 }; 18419 const initialScript = entry.scripts[0]; 18420 const { invoker, invokerType, sourceURL, sourceFunctionName, sourceCharPosition } = initialScript; 18421 attributes["browser.script.invoker"] = invoker; 18422 attributes["browser.script.invoker_type"] = invokerType; 18423 if (sourceURL) { 18424 attributes["code.filepath"] = sourceURL; 18425 } 18426 if (sourceFunctionName) { 18427 attributes["code.function"] = sourceFunctionName; 18428 } 18429 if (sourceCharPosition !== -1) { 18430 attributes["browser.script.source_char_position"] = sourceCharPosition; 18431 } 18432 startAndEndSpan(parent, startTime, startTime + duration, { 18433 name: "Main UI thread blocked", 18434 op: "ui.long-animation-frame", 18435 attributes 18436 }); 18437 } 18438 }); 18439 observer.observe({ type: "long-animation-frame", buffered: true }); 18440 } 18441 function startTrackingInteractions() { 18442 addPerformanceInstrumentationHandler("event", ({ entries: entries2 }) => { 18443 const parent = getActiveSpan(); 18444 if (!parent) { 18445 return; 18446 } 18447 for (const entry of entries2) { 18448 if (entry.name === "click") { 18449 const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); 18450 const duration = msToSec(entry.duration); 18451 const spanOptions = { 18452 name: htmlTreeAsString(entry.target), 18453 op: `ui.interaction.${entry.name}`, 18454 startTime, 18455 attributes: { 18456 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18457 } 18458 }; 18459 const componentName = getComponentName(entry.target); 18460 if (componentName) { 18461 spanOptions.attributes["ui.component_name"] = componentName; 18462 } 18463 startAndEndSpan(parent, startTime, startTime + duration, spanOptions); 18464 } 18465 } 18466 }); 18467 } 18468 function _trackCLS() { 18469 return addClsInstrumentationHandler(({ metric }) => { 18470 const entry = metric.entries[metric.entries.length - 1]; 18471 if (!entry) { 18472 return; 18473 } 18474 _measurements["cls"] = { value: metric.value, unit: "" }; 18475 _clsEntry = entry; 18476 }, true); 18477 } 18478 function _trackLCP() { 18479 return addLcpInstrumentationHandler(({ metric }) => { 18480 const entry = metric.entries[metric.entries.length - 1]; 18481 if (!entry) { 18482 return; 18483 } 18484 _measurements["lcp"] = { value: metric.value, unit: "millisecond" }; 18485 _lcpEntry = entry; 18486 }, true); 18487 } 18488 function _trackFID() { 18489 return addFidInstrumentationHandler(({ metric }) => { 18490 const entry = metric.entries[metric.entries.length - 1]; 18491 if (!entry) { 18492 return; 18493 } 18494 const timeOrigin = msToSec(browserPerformanceTimeOrigin); 18495 const startTime = msToSec(entry.startTime); 18496 _measurements["fid"] = { value: metric.value, unit: "millisecond" }; 18497 _measurements["mark.fid"] = { value: timeOrigin + startTime, unit: "second" }; 18498 }); 18499 } 18500 function _trackTtfb() { 18501 return addTtfbInstrumentationHandler(({ metric }) => { 18502 const entry = metric.entries[metric.entries.length - 1]; 18503 if (!entry) { 18504 return; 18505 } 18506 _measurements["ttfb"] = { value: metric.value, unit: "millisecond" }; 18507 }); 18508 } 18509 function addPerformanceEntries(span, options2) { 18510 const performance2 = getBrowserPerformanceAPI(); 18511 if (!performance2 || !performance2.getEntries || !browserPerformanceTimeOrigin) { 18512 return; 18513 } 18514 const timeOrigin = msToSec(browserPerformanceTimeOrigin); 18515 const performanceEntries = performance2.getEntries(); 18516 const { op, start_timestamp: transactionStartTime } = spanToJSON(span); 18517 performanceEntries.slice(_performanceCursor).forEach((entry) => { 18518 const startTime = msToSec(entry.startTime); 18519 const duration = msToSec( 18520 // Inexplicably, Chrome sometimes emits a negative duration. We need to work around this. 18521 // There is a SO post attempting to explain this, but it leaves one with open questions: https://stackoverflow.com/questions/23191918/peformance-getentries-and-negative-duration-display
18522 // The way we clamp the value is probably not accurate, since we have observed this happen for things that may take a while to load, like for example the replay worker. 18523 // TODO: Investigate why this happens and how to properly mitigate. For now, this is a workaround to prevent transactions being dropped due to negative duration spans. 18524 Math.max(0, entry.duration) 18525 ); 18526 if (op === "navigation" && transactionStartTime && timeOrigin + startTime < transactionStartTime) { 18527 return; 18528 } 18529 switch (entry.entryType) { 18530 case "navigation": { 18531 _addNavigationSpans(span, entry, timeOrigin); 18532 break; 18533 } 18534 case "mark": 18535 case "paint": 18536 case "measure": { 18537 _addMeasureSpans(span, entry, startTime, duration, timeOrigin); 18538 const firstHidden = getVisibilityWatcher(); 18539 const shouldRecord = entry.startTime < firstHidden.firstHiddenTime; 18540 if (entry.name === "first-paint" && shouldRecord) { 18541 _measurements["fp"] = { value: entry.startTime, unit: "millisecond" }; 18542 } 18543 if (entry.name === "first-contentful-paint" && shouldRecord) { 18544 _measurements["fcp"] = { value: entry.startTime, unit: "millisecond" }; 18545 } 18546 break; 18547 } 18548 case "resource": { 18549 _addResourceSpans(span, entry, entry.name, startTime, duration, timeOrigin); 18550 break; 18551 } 18552 } 18553 }); 18554 _performanceCursor = Math.max(performanceEntries.length - 1, 0); 18555 _trackNavigator(span); 18556 if (op === "pageload") { 18557 _addTtfbRequestTimeToMeasurements(_measurements); 18558 const fidMark = _measurements["mark.fid"]; 18559 if (fidMark && _measurements["fid"]) { 18560 startAndEndSpan(span, fidMark.value, fidMark.value + msToSec(_measurements["fid"].value), { 18561 name: "first input delay", 18562 op: "ui.action", 18563 attributes: { 18564 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18565 } 18566 }); 18567 delete _measurements["mark.fid"]; 18568 } 18569 if (!("fcp" in _measurements) || !options2.recordClsOnPageloadSpan) { 18570 delete _measurements.cls; 18571 } 18572 Object.entries(_measurements).forEach(([measurementName, measurement]) => { 18573 setMeasurement(measurementName, measurement.value, measurement.unit); 18574 }); 18575 span.setAttribute("performance.timeOrigin", timeOrigin); 18576 span.setAttribute("performance.activationStart", getActivationStart()); 18577 _setWebVitalAttributes(span); 18578 } 18579 _lcpEntry = void 0; 18580 _clsEntry = void 0; 18581 _measurements = {}; 18582 } 18583 function _addMeasureSpans(span, entry, startTime, duration, timeOrigin) { 18584 const navEntry = getNavigationEntry(false); 18585 const requestTime = msToSec(navEntry ? navEntry.requestStart : 0); 18586 const measureStartTimestamp = timeOrigin + Math.max(startTime, requestTime); 18587 const startTimeStamp = timeOrigin + startTime; 18588 const measureEndTimestamp = startTimeStamp + duration; 18589 const attributes = { 18590 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.resource.browser.metrics" 18591 }; 18592 if (measureStartTimestamp !== startTimeStamp) { 18593 attributes["sentry.browser.measure_happened_before_request"] = true; 18594 attributes["sentry.browser.measure_start_time"] = measureStartTimestamp; 18595 } 18596 startAndEndSpan(span, measureStartTimestamp, measureEndTimestamp, { 18597 name: entry.name, 18598 op: entry.entryType, 18599 attributes 18600 }); 18601 return measureStartTimestamp; 18602 } 18603 function _addNavigationSpans(span, entry, timeOrigin) { 18604 ["unloadEvent", "redirect", "domContentLoadedEvent", "loadEvent", "connect"].forEach((event) => { 18605 _addPerformanceNavigationTiming(span, entry, event, timeOrigin); 18606 }); 18607 _addPerformanceNavigationTiming(span, entry, "secureConnection", timeOrigin, "TLS/SSL"); 18608 _addPerformanceNavigationTiming(span, entry, "fetch", timeOrigin, "cache"); 18609 _addPerformanceNavigationTiming(span, entry, "domainLookup", timeOrigin, "DNS"); 18610 _addRequest(span, entry, timeOrigin); 18611 } 18612 function _addPerformanceNavigationTiming(span, entry, event, timeOrigin, name = event) { 18613 const eventEnd = _getEndPropertyNameForNavigationTiming(event); 18614 const end = entry[eventEnd]; 18615 const start = entry[`${event}Start`]; 18616 if (!start || !end) { 18617 return; 18618 } 18619 startAndEndSpan(span, timeOrigin + msToSec(start), timeOrigin + msToSec(end), { 18620 op: `browser.${name}`, 18621 name: entry.name, 18622 attributes: { 18623 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18624 } 18625 }); 18626 } 18627 function _getEndPropertyNameForNavigationTiming(event) { 18628 if (event === "secureConnection") { 18629 return "connectEnd"; 18630 } 18631 if (event === "fetch") { 18632 return "domainLookupStart"; 18633 } 18634 return `${event}End`; 18635 } 18636 function _addRequest(span, entry, timeOrigin) { 18637 const requestStartTimestamp = timeOrigin + msToSec(entry.requestStart); 18638 const responseEndTimestamp = timeOrigin + msToSec(entry.responseEnd); 18639 const responseStartTimestamp = timeOrigin + msToSec(entry.responseStart); 18640 if (entry.responseEnd) { 18641 startAndEndSpan(span, requestStartTimestamp, responseEndTimestamp, { 18642 op: "browser.request", 18643 name: entry.name, 18644 attributes: { 18645 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18646 } 18647 }); 18648 startAndEndSpan(span, responseStartTimestamp, responseEndTimestamp, { 18649 op: "browser.response", 18650 name: entry.name, 18651 attributes: { 18652 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18653 } 18654 }); 18655 } 18656 } 18657 function _addResourceSpans(span, entry, resourceUrl, startTime, duration, timeOrigin) { 18658 if (entry.initiatorType === "xmlhttprequest" || entry.initiatorType === "fetch") { 18659 return; 18660 } 18661 const parsedUrl = parseUrl$1(resourceUrl); 18662 const attributes = { 18663 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.resource.browser.metrics" 18664 }; 18665 setResourceEntrySizeData(attributes, entry, "transferSize", "http.response_transfer_size"); 18666 setResourceEntrySizeData(attributes, entry, "encodedBodySize", "http.response_content_length"); 18667 setResourceEntrySizeData(attributes, entry, "decodedBodySize", "http.decoded_response_content_length"); 18668 const deliveryType = entry.deliveryType; 18669 if (deliveryType != null) { 18670 attributes["http.response_delivery_type"] = deliveryType; 18671 } 18672 const renderBlockingStatus = entry.renderBlockingStatus; 18673 if (renderBlockingStatus) { 18674 attributes["resource.render_blocking_status"] = renderBlockingStatus; 18675 } 18676 if (parsedUrl.protocol) { 18677 attributes["url.scheme"] = parsedUrl.protocol.split(":").pop(); 18678 } 18679 if (parsedUrl.host) { 18680 attributes["server.address"] = parsedUrl.host; 18681 } 18682 attributes["url.same_origin"] = resourceUrl.includes(WINDOW.location.origin); 18683 const { name, version } = extractNetworkProtocol(entry.nextHopProtocol); 18684 attributes["network.protocol.name"] = name; 18685 attributes["network.protocol.version"] = version; 18686 const startTimestamp = timeOrigin + startTime; 18687 const endTimestamp = startTimestamp + duration; 18688 startAndEndSpan(span, startTimestamp, endTimestamp, { 18689 name: resourceUrl.replace(WINDOW.location.origin, ""), 18690 op: entry.initiatorType ? `resource.${entry.initiatorType}` : "resource.other", 18691 attributes 18692 }); 18693 } 18694 function _trackNavigator(span) { 18695 const navigator2 = WINDOW.navigator; 18696 if (!navigator2) { 18697 return; 18698 } 18699 const connection = navigator2.connection; 18700 if (connection) { 18701 if (connection.effectiveType) { 18702 span.setAttribute("effectiveConnectionType", connection.effectiveType); 18703 } 18704 if (connection.type) { 18705 span.setAttribute("connectionType", connection.type); 18706 } 18707 if (isMeasurementValue(connection.rtt)) { 18708 _measurements["connection.rtt"] = { value: connection.rtt, unit: "millisecond" }; 18709 } 18710 } 18711 if (isMeasurementValue(navigator2.deviceMemory)) { 18712 span.setAttribute("deviceMemory", `${navigator2.deviceMemory} GB`); 18713 } 18714 if (isMeasurementValue(navigator2.hardwareConcurrency)) { 18715 span.setAttribute("hardwareConcurrency", String(navigator2.hardwareConcurrency)); 18716 } 18717 } 18718 function _setWebVitalAttributes(span) { 18719 if (_lcpEntry) { 18720 if (_lcpEntry.element) { 18721 span.setAttribute("lcp.element", htmlTreeAsString(_lcpEntry.element)); 18722 } 18723 if (_lcpEntry.id) { 18724 span.setAttribute("lcp.id", _lcpEntry.id); 18725 } 18726 if (_lcpEntry.url) { 18727 span.setAttribute("lcp.url", _lcpEntry.url.trim().slice(0, 200)); 18728 } 18729 if (_lcpEntry.loadTime != null) { 18730 span.setAttribute("lcp.loadTime", _lcpEntry.loadTime); 18731 } 18732 if (_lcpEntry.renderTime != null) { 18733 span.setAttribute("lcp.renderTime", _lcpEntry.renderTime); 18734 } 18735 span.setAttribute("lcp.size", _lcpEntry.size); 18736 } 18737 if (_clsEntry && _clsEntry.sources) {
18738 _clsEntry.sources.forEach( 18739 (source, index2) => span.setAttribute(`cls.source.${index2 + 1}`, htmlTreeAsString(source.node)) 18740 ); 18741 } 18742 } 18743 function setResourceEntrySizeData(attributes, entry, key, dataKey) { 18744 const entryVal = entry[key]; 18745 if (entryVal != null && entryVal < MAX_INT_AS_BYTES) { 18746 attributes[dataKey] = entryVal; 18747 } 18748 } 18749 function _addTtfbRequestTimeToMeasurements(_measurements2) { 18750 const navEntry = getNavigationEntry(false); 18751 if (!navEntry) { 18752 return; 18753 } 18754 const { responseStart, requestStart } = navEntry; 18755 if (requestStart <= responseStart) { 18756 _measurements2["ttfb.requestTime"] = { 18757 value: responseStart - requestStart, 18758 unit: "millisecond" 18759 }; 18760 } 18761 } 18762 const DEBOUNCE_DURATION = 1e3; 18763 let debounceTimerID; 18764 let lastCapturedEventType; 18765 let lastCapturedEventTargetId; 18766 function addClickKeypressInstrumentationHandler(handler) { 18767 const type = "dom"; 18768 addHandler$1(type, handler); 18769 maybeInstrument(type, instrumentDOM); 18770 } 18771 function instrumentDOM() { 18772 if (!WINDOW.document) { 18773 return; 18774 } 18775 const triggerDOMHandler = triggerHandlers$1.bind(null, "dom"); 18776 const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); 18777 WINDOW.document.addEventListener("click", globalDOMEventHandler, false); 18778 WINDOW.document.addEventListener("keypress", globalDOMEventHandler, false); 18779 ["EventTarget", "Node"].forEach((target) => { 18780 const globalObject = WINDOW; 18781 const targetObj = globalObject[target]; 18782 const proto = targetObj && targetObj.prototype; 18783 if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty("addEventListener")) { 18784 return; 18785 } 18786 fill(proto, "addEventListener", function(originalAddEventListener) { 18787 return function(type, listener, options2) { 18788 if (type === "click" || type == "keypress") { 18789 try { 18790 const handlers2 = this.__sentry_instrumentation_handlers__ = this.__sentry_instrumentation_handlers__ || {}; 18791 const handlerForType = handlers2[type] = handlers2[type] || { refCount: 0 }; 18792 if (!handlerForType.handler) { 18793 const handler = makeDOMEventHandler(triggerDOMHandler); 18794 handlerForType.handler = handler; 18795 originalAddEventListener.call(this, type, handler, options2); 18796 } 18797 handlerForType.refCount++; 18798 } catch (e2) { 18799 } 18800 } 18801 return originalAddEventListener.call(this, type, listener, options2); 18802 }; 18803 }); 18804 fill( 18805 proto, 18806 "removeEventListener", 18807 function(originalRemoveEventListener) { 18808 return function(type, listener, options2) { 18809 if (type === "click" || type == "keypress") { 18810 try { 18811 const handlers2 = this.__sentry_instrumentation_handlers__ || {}; 18812 const handlerForType = handlers2[type]; 18813 if (handlerForType) { 18814 handlerForType.refCount--; 18815 if (handlerForType.refCount <= 0) { 18816 originalRemoveEventListener.call(this, type, handlerForType.handler, options2); 18817 handlerForType.handler = void 0; 18818 delete handlers2[type]; 18819 } 18820 if (Object.keys(handlers2).length === 0) { 18821 delete this.__sentry_instrumentation_handlers__; 18822 } 18823 } 18824 } catch (e2) { 18825 } 18826 } 18827 return originalRemoveEventListener.call(this, type, listener, options2); 18828 }; 18829 } 18830 ); 18831 }); 18832 } 18833 function isSimilarToLastCapturedEvent(event) { 18834 if (event.type !== lastCapturedEventType) { 18835 return false; 18836 } 18837 try { 18838 if (!event.target || event.target._sentryId !== lastCapturedEventTargetId) { 18839 return false;
18840 } 18841 } catch (e2) { 18842 } 18843 return true; 18844 } 18845 function shouldSkipDOMEvent(eventType, target) { 18846 if (eventType !== "keypress") { 18847 return false; 18848 } 18849 if (!target || !target.tagName) { 18850 return true; 18851 } 18852 if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) { 18853 return false; 18854 } 18855 return true; 18856 } 18857 function makeDOMEventHandler(handler, globalListener = false) { 18858 return (event) => { 18859 if (!event || event["_sentryCaptured"]) { 18860 return; 18861 } 18862 const target = getEventTarget(event); 18863 if (shouldSkipDOMEvent(event.type, target)) { 18864 return; 18865 } 18866 addNonEnumerableProperty(event, "_sentryCaptured", true); 18867 if (target && !target._sentryId) { 18868 addNonEnumerableProperty(target, "_sentryId", uuid4()); 18869 } 18870 const name = event.type === "keypress" ? "input" : event.type; 18871 if (!isSimilarToLastCapturedEvent(event)) { 18872 const handlerData = { event, name, global: globalListener }; 18873 handler(handlerData); 18874 lastCapturedEventType = event.type; 18875 lastCapturedEventTargetId = target ? target._sentryId : void 0; 18876 } 18877 clearTimeout(debounceTimerID); 18878 debounceTimerID = WINDOW.setTimeout(() => { 18879 lastCapturedEventTargetId = void 0; 18880 lastCapturedEventType = void 0; 18881 }, DEBOUNCE_DURATION); 18882 }; 18883 } 18884 function getEventTarget(event) { 18885 try { 18886 return event.target; 18887 } catch (e2) { 18888 return null; 18889 } 18890 } 18891 let lastHref; 18892 function addHistoryInstrumentationHandler(handler) { 18893 const type = "history"; 18894 addHandler$1(type, handler); 18895 maybeInstrument(type, instrumentHistory); 18896 } 18897 function instrumentHistory() { 18898 if (!supportsHistory()) { 18899 return; 18900 } 18901 const oldOnPopState = WINDOW.onpopstate; 18902 WINDOW.onpopstate = function(...args) { 18903 const to2 = WINDOW.location.href; 18904 const from2 = lastHref; 18905 lastHref = to2; 18906 const handlerData = { from: from2, to: to2 }; 18907 triggerHandlers$1("history", handlerData); 18908 if (oldOnPopState) { 18909 try { 18910 return oldOnPopState.apply(this, args); 18911 } catch (_oO) { 18912 } 18913 } 18914 }; 18915 function historyReplacementFunction(originalHistoryFunction) { 18916 return function(...args) { 18917 const url = args.length > 2 ? args[2] : void 0; 18918 if (url) { 18919 const from2 = lastHref; 18920 const to2 = String(url); 18921 lastHref = to2; 18922 const handlerData = { from: from2, to: to2 }; 18923 triggerHandlers$1("history", handlerData); 18924 } 18925 return originalHistoryFunction.apply(this, args); 18926 }; 18927 } 18928 fill(WINDOW.history, "pushState", historyReplacementFunction); 18929 fill(WINDOW.history, "replaceState", historyReplacementFunction); 18930 } 18931 const cachedImplementations = {}; 18932 function getNativeImplementation(name) { 18933 const cached = cachedImplementations[name]; 18934 if (cached) { 18935 return cached; 18936 } 18937 let impl = WINDOW[name]; 18938 if (isNativeFunction(impl)) { 18939 return cachedImplementations[name] = impl.bind(WINDOW); 18940 } 18941 const document2 = WINDOW.document; 18942 if (document2 && typeof document2.createElement === "function") { 18943 try { 18944 const sandbox = document2.createElement("iframe"); 18945 sandbox.hidden = true; 18946 document2.head.appendChild(sandbox); 18947 const contentWindow = sandbox.contentWindow; 18948 if (contentWindow && contentWindow[name]) { 18949 impl = contentWindow[name]; 18950 } 18951 document2.head.removeChild(sandbox); 18952 } catch (e2) { 18953 DEBUG_BUILD && logger.warn(`Could not create sandbox iframe for ${name} check, bailing to window.${name}: `, e2); 18954 } 18955 } 18956 if (!impl) { 18957 return impl; 18958 } 18959 return cachedImplementations[name] = impl.bind(WINDOW); 18960 } 18961 function clearCachedImplementation(name) { 18962 cachedImplementations[name] = void 0; 18963 } 18964 const SENTRY_XHR_DATA_KEY = "__sentry_xhr_v3__"; 18965 function addXhrInstrumentationHandler(handler) { 18966 const type = "xhr"; 18967 addHandler$1(type, handler); 18968 maybeInstrument(type, instrumentXHR); 18969 } 18970 function instrumentXHR() { 18971 if (!WINDOW.XMLHttpRequest) { 18972 return; 18973 } 18974 const xhrproto = XMLHttpRequest.prototype; 18975 xhrproto.open = new Proxy(xhrproto.open, { 18976 apply(originalOpen, xhrOpenThisArg, xhrOpenArgArray) { 18977 const virtualError = new Error(); 18978 const startTimestamp = timestampInSeconds() * 1e3; 18979 const method = isString$2(xhrOpenArgArray[0]) ? xhrOpenArgArray[0].toUpperCase() : void 0; 18980 const url = parseUrl(xhrOpenArgArray[1]); 18981 if (!method || !url) { 18982 return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray); 18983 } 18984 xhrOpenThisArg[SENTRY_XHR_DATA_KEY] = { 18985 method, 18986 url, 18987 request_headers: {} 18988 };
18989 if (method === "POST" && url.match(/sentry_key/)) { 18990 xhrOpenThisArg.__sentry_own_request__ = true; 18991 } 18992 const onreadystatechangeHandler = () => { 18993 const xhrInfo = xhrOpenThisArg[SENTRY_XHR_DATA_KEY]; 18994 if (!xhrInfo) { 18995 return; 18996 } 18997 if (xhrOpenThisArg.readyState === 4) { 18998 try { 18999 xhrInfo.status_code = xhrOpenThisArg.status; 19000 } catch (e2) { 19001 } 19002 const handlerData = { 19003 endTimestamp: timestampInSeconds() * 1e3, 19004 startTimestamp, 19005 xhr: xhrOpenThisArg, 19006 virtualError 19007 }; 19008 triggerHandlers$1("xhr", handlerData); 19009 } 19010 }; 19011 if ("onreadystatechange" in xhrOpenThisArg && typeof xhrOpenThisArg.onreadystatechange === "function") { 19012 xhrOpenThisArg.onreadystatechange = new Proxy(xhrOpenThisArg.onreadystatechange, { 19013 apply(originalOnreadystatechange, onreadystatechangeThisArg, onreadystatechangeArgArray) { 19014 onreadystatechangeHandler(); 19015 return originalOnreadystatechange.apply(onreadystatechangeThisArg, onreadystatechangeArgArray); 19016 } 19017 }); 19018 } else { 19019 xhrOpenThisArg.addEventListener("readystatechange", onreadystatechangeHandler); 19020 } 19021 xhrOpenThisArg.setRequestHeader = new Proxy(xhrOpenThisArg.setRequestHeader, { 19022 apply(originalSetRequestHeader, setRequestHeaderThisArg, setRequestHeaderArgArray) { 19023 const [header, value] = setRequestHeaderArgArray; 19024 const xhrInfo = setRequestHeaderThisArg[SENTRY_XHR_DATA_KEY]; 19025 if (xhrInfo && isString$2(header) && isString$2(value)) { 19026 xhrInfo.request_headers[header.toLowerCase()] = value; 19027 } 19028 return originalSetRequestHeader.apply(setRequestHeaderThisArg, setRequestHeaderArgArray); 19029 } 19030 }); 19031 return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray); 19032 } 19033 }); 19034 xhrproto.send = new Proxy(xhrproto.send, { 19035 apply(originalSend, sendThisArg, sendArgArray) { 19036 const sentryXhrData = sendThisArg[SENTRY_XHR_DATA_KEY]; 19037 if (!sentryXhrData) { 19038 return originalSend.apply(sendThisArg, sendArgArray); 19039 } 19040 if (sendArgArray[0] !== void 0) { 19041 sentryXhrData.body = sendArgArray[0]; 19042 } 19043 const handlerData = { 19044 startTimestamp: timestampInSeconds() * 1e3, 19045 xhr: sendThisArg 19046 }; 19047 triggerHandlers$1("xhr", handlerData); 19048 return originalSend.apply(sendThisArg, sendArgArray); 19049 } 19050 }); 19051 } 19052 function parseUrl(url) { 19053 if (isString$2(url)) { 19054 return url; 19055 } 19056 try { 19057 return url.toString(); 19058 } catch (e2) { 19059 } 19060 return void 0; 19061 } 19062 const LAST_INTERACTIONS = []; 19063 const INTERACTIONS_SPAN_MAP = /* @__PURE__ */ new Map(); 19064 function startTrackingINP() { 19065 const performance2 = getBrowserPerformanceAPI(); 19066 if (performance2 && browserPerformanceTimeOrigin) { 19067 const inpCallback = _trackINP(); 19068 return () => { 19069 inpCallback(); 19070 }; 19071 } 19072 return () => void 0; 19073 } 19074 const INP_ENTRY_MAP = { 19075 click: "click", 19076 pointerdown: "click", 19077 pointerup: "click", 19078 mousedown: "click", 19079 mouseup: "click", 19080 touchstart: "click", 19081 touchend: "click", 19082 mouseover: "hover", 19083 mouseout: "hover", 19084 mouseenter: "hover", 19085 mouseleave: "hover", 19086 pointerover: "hover", 19087 pointerout: "hover", 19088 pointerenter: "hover", 19089 pointerleave: "hover", 19090 dragstart: "drag", 19091 dragend: "drag", 19092 drag: "drag", 19093 dragenter: "drag", 19094 dragleave: "drag", 19095 dragover: "drag", 19096 drop: "drag", 19097 keydown: "press", 19098 keyup: "press", 19099 keypress: "press", 19100 input: "press" 19101 }; 19102 function _trackINP() { 19103 return addInpInstrumentationHandler(({ metric }) => { 19104 if (metric.value == void 0) { 19105 return; 19106 } 19107 const entry = metric.entries.find((entry2) => entry2.duration === metric.value && INP_ENTRY_MAP[entry2.name]); 19108 if (!entry) { 19109 return; 19110 } 19111 const { interactionId } = entry; 19112 const interactionType = INP_ENTRY_MAP[entry.name]; 19113 const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); 19114 const duration = msToSec(metric.value); 19115 const activeSpan = getActiveSpan(); 19116 const rootSpan = activeSpan ? getRootSpan(activeSpan) : void 0; 19117 const cachedSpan = interactionId != null ? INTERACTIONS_SPAN_MAP.get(interactionId) : void 0; 19118 const spanToUse = cachedSpan || rootSpan; 19119 const routeName = spanToUse ? spanToJSON(spanToUse).description : getCurrentScope().getScopeData().transactionName; 19120 const name = htmlTreeAsString(entry.target); 19121 const attributes = dropUndefinedKeys({ 19122 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser.inp", 19123 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `ui.interaction.${interactionType}`, 19124 [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry.duration 19125 }); 19126 const span = startStandaloneWebVitalSpan({ 19127 name, 19128 transaction: routeName, 19129 attributes, 19130 startTime 19131 }); 19132 if (span) { 19133 span.addEvent("inp", { 19134 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: "millisecond", 19135 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: metric.value 19136 }); 19137 span.end(startTime + duration); 19138 } 19139 }); 19140 } 19141 function registerInpInteractionListener(_latestRoute) { 19142 const handleEntries = ({ entries: entries2 }) => { 19143 const activeSpan = getActiveSpan(); 19144 const activeRootSpan = activeSpan && getRootSpan(activeSpan);
19145 entries2.forEach((entry) => { 19146 if (!isPerformanceEventTiming(entry) || !activeRootSpan) { 19147 return; 19148 } 19149 const interactionId = entry.interactionId; 19150 if (interactionId == null) { 19151 return; 19152 } 19153 if (INTERACTIONS_SPAN_MAP.has(interactionId)) { 19154 return; 19155 } 19156 if (LAST_INTERACTIONS.length > 10) { 19157 const last = LAST_INTERACTIONS.shift(); 19158 INTERACTIONS_SPAN_MAP.delete(last); 19159 } 19160 LAST_INTERACTIONS.push(interactionId); 19161 INTERACTIONS_SPAN_MAP.set(interactionId, activeRootSpan); 19162 }); 19163 }; 19164 addPerformanceInstrumentationHandler("event", handleEntries); 19165 addPerformanceInstrumentationHandler("first-input", handleEntries); 19166 } 19167 function makeFetchTransport(options2, nativeFetch = getNativeImplementation("fetch")) { 19168 let pendingBodySize = 0; 19169 let pendingCount = 0; 19170 function makeRequest(request) { 19171 const requestSize = request.body.length; 19172 pendingBodySize += requestSize; 19173 pendingCount++; 19174 const requestOptions = __spreadValues({ 19175 body: request.body, 19176 method: "POST", 19177 referrerPolicy: "origin", 19178 headers: options2.headers, 19179 // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to 19180 // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)". 19181 // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're 19182 // frequently sending events right before the user is switching pages (eg. when finishing navigation transactions). 19183 // Gotchas: 19184 // - `keepalive` isn't supported by Firefox 19185 // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch): 19186 // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error. 19187 // We will therefore only activate the flag when we're below that limit. 19188 // There is also a limit of requests that can be open at the same time, so we also limit this to 15 19189 // See https://github.com/getsentry/sentry-javascript/pull/7553 for details 19190 keepalive: pendingBodySize <= 6e4 && pendingCount < 15 19191 }, options2.fetchOptions); 19192 if (!nativeFetch) { 19193 clearCachedImplementation("fetch"); 19194 return rejectedSyncPromise("No fetch implementation available"); 19195 } 19196 try { 19197 return nativeFetch(options2.url, requestOptions).then((response) => { 19198 pendingBodySize -= requestSize; 19199 pendingCount--; 19200 return { 19201 statusCode: response.status, 19202 headers: { 19203 "x-sentry-rate-limits": response.headers.get("X-Sentry-Rate-Limits"), 19204 "retry-after": response.headers.get("Retry-After") 19205 } 19206 }; 19207 }); 19208 } catch (e2) { 19209 clearCachedImplementation("fetch"); 19210 pendingBodySize -= requestSize; 19211 pendingCount--; 19212 return rejectedSyncPromise(e2); 19213 } 19214 } 19215 return createTransport(options2, makeRequest); 19216 } 19217 const CHROME_PRIORITY = 30; 19218 const GECKO_PRIORITY = 50; 19219 function createFrame(filename, func, lineno, colno) { 19220 const frame2 = { 19221 filename, 19222 function: func === "<anonymous>" ? UNKNOWN_FUNCTION : func, 19223 in_app: true 19224 // All browser frames are considered in_app 19225 }; 19226 if (lineno !== void 0) { 19227 frame2.lineno = lineno; 19228 } 19229 if (colno !== void 0) { 19230 frame2.colno = colno; 19231 } 19232 return frame2; 19233 } 19234 const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i; 19235 const chromeRegex = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; 19236 const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; 19237 const chromeStackParserFn = (line2) => { 19238 const noFnParts = chromeRegexNoFnName.exec(line2); 19239 if (noFnParts) { 19240 const [, filename, line3, col] = noFnParts; 19241 return createFrame(filename, UNKNOWN_FUNCTION, +line3, +col); 19242 } 19243 const parts = chromeRegex.exec(line2); 19244 if (parts) { 19245 const isEval = parts[2] && parts[2].indexOf("eval") === 0; 19246 if (isEval) { 19247 const subMatch = chromeEvalRegex.exec(parts[2]); 19248 if (subMatch) { 19249 parts[2] = subMatch[1]; 19250 parts[3] = subMatch[2]; 19251 parts[4] = subMatch[3]; 19252 } 19253 }
19254 const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]); 19255 return createFrame(filename, func, parts[3] ? +parts[3] : void 0, parts[4] ? +parts[4] : void 0); 19256 } 19257 return; 19258 }; 19259 const chromeStackLineParser = [CHROME_PRIORITY, chromeStackParserFn]; 19260 const geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; 19261 const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; 19262 const gecko = (line2) => { 19263 const parts = geckoREgex.exec(line2); 19264 if (parts) { 19265 const isEval = parts[3] && parts[3].indexOf(" > eval") > -1; 19266 if (isEval) { 19267 const subMatch = geckoEvalRegex.exec(parts[3]); 19268 if (subMatch) { 19269 parts[1] = parts[1] || "eval"; 19270 parts[3] = subMatch[1]; 19271 parts[4] = subMatch[2]; 19272 parts[5] = ""; 19273 } 19274 } 19275 let filename = parts[3]; 19276 let func = parts[1] || UNKNOWN_FUNCTION; 19277 [func, filename] = extractSafariExtensionDetails(func, filename); 19278 return createFrame(filename, func, parts[4] ? +parts[4] : void 0, parts[5] ? +parts[5] : void 0); 19279 } 19280 return; 19281 }; 19282 const geckoStackLineParser = [GECKO_PRIORITY, gecko]; 19283 const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser]; 19284 const defaultStackParser = createStackParser(...defaultStackLineParsers); 19285 const extractSafariExtensionDetails = (func, filename) => { 19286 const isSafariExtension = func.indexOf("safari-extension") !== -1; 19287 const isSafariWebExtension = func.indexOf("safari-web-extension") !== -1; 19288 return isSafariExtension || isSafariWebExtension ? [ 19289 func.indexOf("@") !== -1 ? func.split("@")[0] : UNKNOWN_FUNCTION, 19290 isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}` 19291 ] : [func, filename]; 19292 }; 19293 const MAX_ALLOWED_STRING_LENGTH = 1024; 19294 const INTEGRATION_NAME$3 = "Breadcrumbs"; 19295 const _breadcrumbsIntegration = ((options2 = {}) => { 19296 const _options = __spreadValues({ 19297 console: true, 19298 dom: true, 19299 fetch: true, 19300 history: true, 19301 sentry: true, 19302 xhr: true 19303 }, options2); 19304 return { 19305 name: INTEGRATION_NAME$3, 19306 setup(client2) { 19307 if (_options.console) { 19308 addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client2)); 19309 } 19310 if (_options.dom) { 19311 addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client2, _options.dom)); 19312 } 19313 if (_options.xhr) { 19314 addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client2)); 19315 } 19316 if (_options.fetch) { 19317 addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client2)); 19318 } 19319 if (_options.history) { 19320 addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client2)); 19321 } 19322 if (_options.sentry) { 19323 client2.on("beforeSendEvent", _getSentryBreadcrumbHandler(client2)); 19324 } 19325 } 19326 }; 19327 }); 19328 const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration); 19329 function _getSentryBreadcrumbHandler(client2) { 19330 return function addSentryBreadcrumb(event) { 19331 if (getClient() !== client2) { 19332 return; 19333 } 19334 addBreadcrumb( 19335 { 19336 category: `sentry.${event.type === "transaction" ? "transaction" : "event"}`, 19337 event_id: event.event_id, 19338 level: event.level, 19339 message: getEventDescription(event) 19340 }, 19341 { 19342 event 19343 } 19344 ); 19345 }; 19346 } 19347 function _getDomBreadcrumbHandler(client2, dom) { 19348 return function _innerDomBreadcrumb(handlerData) { 19349 if (getClient() !== client2) { 19350 return; 19351 } 19352 let target; 19353 let componentName; 19354 let keyAttrs = typeof dom === "object" ? dom.serializeAttribute : void 0; 19355 let maxStringLength = typeof dom === "object" && typeof dom.maxStringLength === "number" ? dom.maxStringLength : void 0; 19356 if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) { 19357 DEBUG_BUILD$1 && logger.warn( 19358 `\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.` 19359 ); 19360 maxStringLength = MAX_ALLOWED_STRING_LENGTH; 19361 } 19362 if (typeof keyAttrs === "string") { 19363 keyAttrs = [keyAttrs]; 19364 } 19365 try { 19366 const event = handlerData.event; 19367 const element = _isEvent(event) ? event.target : event; 19368 target = htmlTreeAsString(element, { keyAttrs, maxStringLength }); 19369 componentName = getComponentName(element); 19370 } catch (e2) { 19371 target = "<unknown>"; 19372 } 19373 if (target.length === 0) { 19374 return; 19375 } 19376 const breadcrumb = { 19377 category: `ui.${handlerData.name}`, 19378 message: target 19379 }; 19380 if (componentName) {
19381 breadcrumb.data = { "ui.component_name": componentName }; 19382 } 19383 addBreadcrumb(breadcrumb, { 19384 event: handlerData.event, 19385 name: handlerData.name, 19386 global: handlerData.global 19387 }); 19388 }; 19389 } 19390 function _getConsoleBreadcrumbHandler(client2) { 19391 return function _consoleBreadcrumb(handlerData) { 19392 if (getClient() !== client2) { 19393 return; 19394 } 19395 const breadcrumb = { 19396 category: "console", 19397 data: { 19398 arguments: handlerData.args, 19399 logger: "console" 19400 }, 19401 level: severityLevelFromString(handlerData.level), 19402 message: safeJoin(handlerData.args, " ") 19403 }; 19404 if (handlerData.level === "assert") { 19405 if (handlerData.args[0] === false) { 19406 breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), " ") || "console.assert"}`; 19407 breadcrumb.data.arguments = handlerData.args.slice(1); 19408 } else { 19409 return; 19410 } 19411 } 19412 addBreadcrumb(breadcrumb, { 19413 input: handlerData.args, 19414 level: handlerData.level 19415 }); 19416 }; 19417 } 19418 function _getXhrBreadcrumbHandler(client2) { 19419 return function _xhrBreadcrumb(handlerData) { 19420 if (getClient() !== client2) { 19421 return; 19422 } 19423 const { startTimestamp, endTimestamp } = handlerData; 19424 const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY]; 19425 if (!startTimestamp || !endTimestamp || !sentryXhrData) { 19426 return; 19427 } 19428 const { method, url, status_code, body } = sentryXhrData; 19429 const data = { 19430 method, 19431 url, 19432 status_code 19433 }; 19434 const hint = { 19435 xhr: handlerData.xhr, 19436 input: body, 19437 startTimestamp, 19438 endTimestamp 19439 }; 19440 const level = getBreadcrumbLogLevelFromHttpStatusCode(status_code); 19441 addBreadcrumb( 19442 { 19443 category: "xhr", 19444 data, 19445 type: "http", 19446 level 19447 }, 19448 hint 19449 ); 19450 }; 19451 } 19452 function _getFetchBreadcrumbHandler(client2) { 19453 return function _fetchBreadcrumb(handlerData) { 19454 if (getClient() !== client2) { 19455 return; 19456 } 19457 const { startTimestamp, endTimestamp } = handlerData; 19458 if (!endTimestamp) { 19459 return; 19460 } 19461 if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === "POST") { 19462 return; 19463 } 19464 if (handlerData.error) { 19465 const data = handlerData.fetchData; 19466 const hint = { 19467 data: handlerData.error, 19468 input: handlerData.args, 19469 startTimestamp, 19470 endTimestamp 19471 }; 19472 addBreadcrumb( 19473 { 19474 category: "fetch", 19475 data, 19476 level: "error", 19477 type: "http" 19478 }, 19479 hint 19480 ); 19481 } else { 19482 const response = handlerData.response; 19483 const data = __spreadProps(__spreadValues({}, handlerData.fetchData), { 19484 status_code: response && response.status 19485 }); 19486 const hint = { 19487 input: handlerData.args, 19488 response, 19489 startTimestamp, 19490 endTimestamp 19491 }; 19492 const level = getBreadcrumbLogLevelFromHttpStatusCode(data.status_code); 19493 addBreadcrumb( 19494 { 19495 category: "fetch", 19496 data, 19497 type: "http", 19498 level 19499 }, 19500 hint 19501 ); 19502 } 19503 }; 19504 } 19505 function _getHistoryBreadcrumbHandler(client2) { 19506 return function _historyBreadcrumb(handlerData) { 19507 if (getClient() !== client2) { 19508 return; 19509 } 19510 let from2 = handlerData.from; 19511 let to2 = handlerData.to; 19512 const parsedLoc = parseUrl$1(WINDOW$1.location.href); 19513 let parsedFrom = from2 ? parseUrl$1(from2) : void 0; 19514 const parsedTo = parseUrl$1(to2); 19515 if (!parsedFrom || !parsedFrom.path) { 19516 parsedFrom = parsedLoc; 19517 } 19518 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { 19519 to2 = parsedTo.relative; 19520 } 19521 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { 19522 from2 = parsedFrom.relative; 19523 } 19524 addBreadcrumb({ 19525 category: "navigation", 19526 data: { 19527 from: from2, 19528 to: to2 19529 } 19530 }); 19531 }; 19532 } 19533 function _isEvent(event) { 19534 return !!event && !!event.target; 19535 } 19536 const DEFAULT_EVENT_TARGET = [ 19537 "EventTarget", 19538 "Window", 19539 "Node", 19540 "ApplicationCache", 19541 "AudioTrackList", 19542 "BroadcastChannel", 19543 "ChannelMergerNode", 19544 "CryptoOperation", 19545 "EventSource", 19546 "FileReader", 19547 "HTMLUnknownElement", 19548 "IDBDatabase", 19549 "IDBRequest", 19550 "IDBTransaction", 19551 "KeyOperation", 19552 "MediaController", 19553 "MessagePort", 19554 "ModalWindow", 19555 "Notification", 19556 "SVGElementInstance", 19557 "Screen", 19558 "SharedWorker", 19559 "TextTrack", 19560 "TextTrackCue", 19561 "TextTrackList", 19562 "WebSocket", 19563 "WebSocketWorker", 19564 "Worker", 19565 "XMLHttpRequest", 19566 "XMLHttpRequestEventTarget", 19567 "XMLHttpRequestUpload" 19568 ]; 19569 const INTEGRATION_NAME$2 = "BrowserApiErrors"; 19570 const _browserApiErrorsIntegration = ((options2 = {}) => { 19571 const _options = __spreadValues({ 19572 XMLHttpRequest: true, 19573 eventTarget: true, 19574 requestAnimationFrame: true, 19575 setInterval: true, 19576 setTimeout: true 19577 }, options2); 19578 return { 19579 name: INTEGRATION_NAME$2,
19580 // TODO: This currently only works for the first client this is setup 19581 // We may want to adjust this to check for client etc. 19582 setupOnce() { 19583 if (_options.setTimeout) { 19584 fill(WINDOW$1, "setTimeout", _wrapTimeFunction); 19585 } 19586 if (_options.setInterval) { 19587 fill(WINDOW$1, "setInterval", _wrapTimeFunction); 19588 } 19589 if (_options.requestAnimationFrame) { 19590 fill(WINDOW$1, "requestAnimationFrame", _wrapRAF); 19591 } 19592 if (_options.XMLHttpRequest && "XMLHttpRequest" in WINDOW$1) { 19593 fill(XMLHttpRequest.prototype, "send", _wrapXHR); 19594 } 19595 const eventTargetOption = _options.eventTarget; 19596 if (eventTargetOption) { 19597 const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET; 19598 eventTarget.forEach(_wrapEventTarget); 19599 } 19600 } 19601 }; 19602 }); 19603 const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration); 19604 function _wrapTimeFunction(original) { 19605 return function(...args) { 19606 const originalCallback = args[0]; 19607 args[0] = wrap(originalCallback, { 19608 mechanism: { 19609 data: { function: getFunctionName(original) }, 19610 handled: false, 19611 type: "instrument" 19612 } 19613 }); 19614 return original.apply(this, args); 19615 }; 19616 } 19617 function _wrapRAF(original) { 19618 return function(callback) { 19619 return original.apply(this, [ 19620 wrap(callback, { 19621 mechanism: { 19622 data: { 19623 function: "requestAnimationFrame", 19624 handler: getFunctionName(original) 19625 }, 19626 handled: false, 19627 type: "instrument" 19628 } 19629 }) 19630 ]); 19631 }; 19632 } 19633 function _wrapXHR(originalSend) { 19634 return function(...args) { 19635 const xhr = this; 19636 const xmlHttpRequestProps = ["onload", "onerror", "onprogress", "onreadystatechange"]; 19637 xmlHttpRequestProps.forEach((prop) => { 19638 if (prop in xhr && typeof xhr[prop] === "function") { 19639 fill(xhr, prop, function(original) { 19640 const wrapOptions = { 19641 mechanism: { 19642 data: { 19643 function: prop, 19644 handler: getFunctionName(original) 19645 }, 19646 handled: false, 19647 type: "instrument" 19648 } 19649 }; 19650 const originalFunction = getOriginalFunction(original); 19651 if (originalFunction) { 19652 wrapOptions.mechanism.data.handler = getFunctionName(originalFunction); 19653 } 19654 return wrap(original, wrapOptions); 19655 }); 19656 } 19657 }); 19658 return originalSend.apply(this, args); 19659 }; 19660 } 19661 function _wrapEventTarget(target) { 19662 const globalObject = WINDOW$1; 19663 const targetObj = globalObject[target]; 19664 const proto = targetObj && targetObj.prototype; 19665 if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty("addEventListener")) { 19666 return; 19667 } 19668 fill(proto, "addEventListener", function(original) { 19669 return function(eventName, fn2, options2) { 19670 try { 19671 if (isEventListenerObject(fn2)) { 19672 fn2.handleEvent = wrap(fn2.handleEvent, { 19673 mechanism: { 19674 data: { 19675 function: "handleEvent", 19676 handler: getFunctionName(fn2), 19677 target 19678 }, 19679 handled: false, 19680 type: "instrument" 19681 } 19682 }); 19683 } 19684 } catch (e2) { 19685 } 19686 return original.apply(this, [ 19687 eventName, 19688 wrap(fn2, { 19689 mechanism: { 19690 data: { 19691 function: "addEventListener", 19692 handler: getFunctionName(fn2), 19693 target 19694 }, 19695 handled: false, 19696 type: "instrument" 19697 } 19698 }), 19699 options2 19700 ]); 19701 }; 19702 }); 19703 fill(proto, "removeEventListener", function(originalRemoveEventListener) { 19704 return function(eventName, fn2, options2) { 19705 try { 19706 const originalEventHandler = fn2.__sentry_wrapped__; 19707 if (originalEventHandler) { 19708 originalRemoveEventListener.call(this, eventName, originalEventHandler, options2); 19709 } 19710 } catch (e2) { 19711 } 19712 return originalRemoveEventListener.call(this, eventName, fn2, options2); 19713 }; 19714 }); 19715 } 19716 function isEventListenerObject(obj) { 19717 return typeof obj.handleEvent === "function"; 19718 } 19719 const browserSessionIntegration = defineIntegration(() => { 19720 return { 19721 name: "BrowserSession", 19722 setupOnce() { 19723 if (typeof WINDOW$1.document === "undefined") { 19724 DEBUG_BUILD$1 && logger.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."); 19725 return; 19726 } 19727 startSession({ ignoreDuration: true }); 19728 captureSession(); 19729 addHistoryInstrumentationHandler(({ from: from2, to: to2 }) => { 19730 if (from2 !== void 0 && from2 !== to2) { 19731 startSession({ ignoreDuration: true }); 19732 captureSession(); 19733 } 19734 }); 19735 } 19736 }; 19737 }); 19738 const INTEGRATION_NAME$1 = "GlobalHandlers"; 19739 const _globalHandlersIntegration = ((options2 = {}) => { 19740 const _options = __spreadValues({ 19741 onerror: true, 19742 onunhandledrejection: true 19743 }, options2); 19744 return { 19745 name: INTEGRATION_NAME$1, 19746 setupOnce() { 19747 Error.stackTraceLimit = 50; 19748 }, 19749 setup(client2) { 19750 if (_options.onerror) { 19751 _installGlobalOnErrorHandler(client2); 19752 globalHandlerLog("onerror"); 19753 } 19754 if (_options.onunhandledrejection) { 19755 _installGlobalOnUnhandledRejectionHandler(client2); 19756 globalHandlerLog("onunhandledrejection"); 19757 } 19758 } 19759 }; 19760 }); 19761 const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration); 19762 function _installGlobalOnErrorHandler(client2) { 19763 addGlobalErrorInstrumentationHandler((data) => { 19764 const { stackParser, attachStacktrace } = getOptions(); 19765 if (getClient() !== client2 || shouldIgnoreOnError()) { 19766 return; 19767 } 19768 const { msg, url, line: line2, column: column2, error } = data; 19769 const event = _enhanceEventWithInitialFrame( 19770 eventFromUnknownInput(stackParser, error || msg, void 0, attachStacktrace, false), 19771 url, 19772 line2, 19773 column2 19774 ); 19775 event.level = "error"; 19776 captureEvent(event, { 19777 originalException: error, 19778 mechanism: { 19779 handled: false, 19780 type: "onerror" 19781 } 19782 }); 19783 }); 19784 } 19785 function _installGlobalOnUnhandledRejectionHandler(client2) { 19786 addGlobalUnhandledRejectionInstrumentationHandler((e2) => { 19787 const { stackParser, attachStacktrace } = getOptions(); 19788 if (getClient() !== client2 || shouldIgnoreOnError()) { 19789 return; 19790 } 19791 const error = _getUnhandledRejectionError(e2); 19792 const event = isPrimitive(error) ? _eventFromRejectionWithPrimitive(error) : eventFromUnknownInput(stackParser, error, void 0, attachStacktrace, true); 19793 event.level = "error"; 19794 captureEvent(event, { 19795 originalException: error, 19796 mechanism: { 19797 handled: false, 19798 type: "onunhandledrejection" 19799 } 19800 }); 19801 }); 19802 } 19803 function _getUnhandledRejectionError(error) { 19804 if (isPrimitive(error)) { 19805 return error; 19806 }
19807 try { 19808 if ("reason" in error) { 19809 return error.reason; 19810 } 19811 if ("detail" in error && "reason" in error.detail) { 19812 return error.detail.reason; 19813 } 19814 } catch (e2) { 19815 } 19816 return error; 19817 } 19818 function _eventFromRejectionWithPrimitive(reason) { 19819 return { 19820 exception: { 19821 values: [ 19822 { 19823 type: "UnhandledRejection", 19824 // String() is needed because the Primitive type includes symbols (which can't be automatically stringified) 19825 value: `Non-Error promise rejection captured with value: ${String(reason)}` 19826 } 19827 ] 19828 } 19829 }; 19830 } 19831 function _enhanceEventWithInitialFrame(event, url, line2, column2) { 19832 const e2 = event.exception = event.exception || {}; 19833 const ev = e2.values = e2.values || []; 19834 const ev0 = ev[0] = ev[0] || {}; 19835 const ev0s = ev0.stacktrace = ev0.stacktrace || {}; 19836 const ev0sf = ev0s.frames = ev0s.frames || []; 19837 const colno = column2; 19838 const lineno = line2; 19839 const filename = isString$2(url) && url.length > 0 ? url : getLocationHref(); 19840 if (ev0sf.length === 0) { 19841 ev0sf.push({ 19842 colno, 19843 filename, 19844 function: UNKNOWN_FUNCTION, 19845 in_app: true, 19846 lineno 19847 }); 19848 } 19849 return event; 19850 } 19851 function globalHandlerLog(type) { 19852 DEBUG_BUILD$1 && logger.log(`Global Handler attached: ${type}`); 19853 } 19854 function getOptions() { 19855 const client2 = getClient(); 19856 const options2 = client2 && client2.getOptions() || { 19857 stackParser: () => [], 19858 attachStacktrace: false 19859 }; 19860 return options2; 19861 } 19862 const httpContextIntegration = defineIntegration(() => { 19863 return { 19864 name: "HttpContext", 19865 preprocessEvent(event) { 19866 if (!WINDOW$1.navigator && !WINDOW$1.location && !WINDOW$1.document) { 19867 return; 19868 } 19869 const url = event.request && event.request.url || WINDOW$1.location && WINDOW$1.location.href; 19870 const { referrer } = WINDOW$1.document || {}; 19871 const { userAgent } = WINDOW$1.navigator || {}; 19872 const headers = __spreadValues(__spreadValues(__spreadValues({}, event.request && event.request.headers), referrer && { Referer: referrer }), userAgent && { "User-Agent": userAgent }); 19873 const request = __spreadProps(__spreadValues(__spreadValues({}, event.request), url && { url }), { headers }); 19874 event.request = request; 19875 } 19876 }; 19877 }); 19878 const DEFAULT_KEY = "cause"; 19879 const DEFAULT_LIMIT = 5; 19880 const INTEGRATION_NAME = "LinkedErrors"; 19881 const _linkedErrorsIntegration = ((options2 = {}) => { 19882 const limit = options2.limit || DEFAULT_LIMIT; 19883 const key = options2.key || DEFAULT_KEY; 19884 return { 19885 name: INTEGRATION_NAME, 19886 preprocessEvent(event, hint, client2) { 19887 const options3 = client2.getOptions(); 19888 applyAggregateErrorsToEvent( 19889 // This differs from the LinkedErrors integration in core by using a different exceptionFromError function 19890 exceptionFromError, 19891 options3.stackParser, 19892 options3.maxValueLength, 19893 key, 19894 limit, 19895 event, 19896 hint 19897 ); 19898 } 19899 }; 19900 }); 19901 const linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration); 19902 function getDefaultIntegrations(options2) { 19903 const integrations = [ 19904 inboundFiltersIntegration(), 19905 functionToStringIntegration(), 19906 browserApiErrorsIntegration(), 19907 breadcrumbsIntegration(), 19908 globalHandlersIntegration(), 19909 linkedErrorsIntegration(), 19910 dedupeIntegration(), 19911 httpContextIntegration() 19912 ]; 19913 if (options2.autoSessionTracking !== false) { 19914 integrations.push(browserSessionIntegration()); 19915 } 19916 return integrations; 19917 } 19918 function applyDefaultOptions(optionsArg = {}) { 19919 const defaultOptions2 = { 19920 defaultIntegrations: getDefaultIntegrations(optionsArg), 19921 release: typeof __SENTRY_RELEASE__ === "string" ? __SENTRY_RELEASE__ : WINDOW$1.SENTRY_RELEASE && WINDOW$1.SENTRY_RELEASE.id ? WINDOW$1.SENTRY_RELEASE.id : void 0, 19922 autoSessionTracking: true, 19923 sendClientReports: true 19924 }; 19925 if (optionsArg.defaultIntegrations == null) { 19926 delete optionsArg.defaultIntegrations; 19927 } 19928 return __spreadValues(__spreadValues({}, defaultOptions2), optionsArg); 19929 } 19930 function shouldShowBrowserExtensionError() { 19931 const windowWithMaybeExtension = typeof WINDOW$1.window !== "undefined" && WINDOW$1; 19932 if (!windowWithMaybeExtension) { 19933 return false;
19934 } 19935 const extensionKey = windowWithMaybeExtension.chrome ? "chrome" : "browser"; 19936 const extensionObject = windowWithMaybeExtension[extensionKey]; 19937 const runtimeId = extensionObject && extensionObject.runtime && extensionObject.runtime.id; 19938 const href = WINDOW$1.location && WINDOW$1.location.href || ""; 19939 const extensionProtocols = ["chrome-extension:", "moz-extension:", "ms-browser-extension:", "safari-web-extension:"]; 19940 const isDedicatedExtensionPage = !!runtimeId && WINDOW$1 === WINDOW$1.top && extensionProtocols.some((protocol) => href.startsWith(`${protocol}//`)); 19941 const isNWjs = typeof windowWithMaybeExtension.nw !== "undefined"; 19942 return !!runtimeId && !isDedicatedExtensionPage && !isNWjs; 19943 } 19944 function init$2(browserOptions = {}) { 19945 const options2 = applyDefaultOptions(browserOptions); 19946 if (!options2.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) { 19947 consoleSandbox(() => { 19948 console.error( 19949 "[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/" 19950 ); 19951 }); 19952 return; 19953 } 19954 if (DEBUG_BUILD$1) { 19955 if (!supportsFetch()) { 19956 logger.warn( 19957 "No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill." 19958 ); 19959 } 19960 } 19961 const clientOptions = __spreadProps(__spreadValues({}, options2), { 19962 stackParser: stackParserFromStackParserOptions(options2.stackParser || defaultStackParser), 19963 integrations: getIntegrationsToSetup(options2), 19964 transport: options2.transport || makeFetchTransport 19965 }); 19966 return initAndBind(BrowserClient, clientOptions); 19967 } 19968 const responseToSpanId = /* @__PURE__ */ new WeakMap(); 19969 const spanIdToEndTimestamp = /* @__PURE__ */ new Map(); 19970 const defaultRequestInstrumentationOptions = { 19971 traceFetch: true, 19972 traceXHR: true, 19973 enableHTTPTimings: true, 19974 trackFetchStreamPerformance: false 19975 }; 19976 function instrumentOutgoingRequests(client2, _options) { 19977 const { 19978 traceFetch, 19979 traceXHR, 19980 trackFetchStreamPerformance, 19981 shouldCreateSpanForRequest, 19982 enableHTTPTimings, 19983 tracePropagationTargets 19984 } = __spreadValues({ 19985 traceFetch: defaultRequestInstrumentationOptions.traceFetch, 19986 traceXHR: defaultRequestInstrumentationOptions.traceXHR, 19987 trackFetchStreamPerformance: defaultRequestInstrumentationOptions.trackFetchStreamPerformance 19988 }, _options); 19989 const shouldCreateSpan = typeof shouldCreateSpanForRequest === "function" ? shouldCreateSpanForRequest : (_2) => true; 19990 const shouldAttachHeadersWithTargets = (url) => shouldAttachHeaders(url, tracePropagationTargets); 19991 const spans = {}; 19992 if (traceFetch) { 19993 client2.addEventProcessor((event) => { 19994 if (event.type === "transaction" && event.spans) { 19995 event.spans.forEach((span) => { 19996 if (span.op === "http.client") { 19997 const updatedTimestamp = spanIdToEndTimestamp.get(span.span_id); 19998 if (updatedTimestamp) { 19999 span.timestamp = updatedTimestamp / 1e3; 20000 spanIdToEndTimestamp.delete(span.span_id); 20001 } 20002 } 20003 }); 20004 } 20005 return event; 20006 }); 20007 if (trackFetchStreamPerformance) { 20008 addFetchEndInstrumentationHandler((handlerData) => { 20009 if (handlerData.response) { 20010 const span = responseToSpanId.get(handlerData.response); 20011 if (span && handlerData.endTimestamp) { 20012 spanIdToEndTimestamp.set(span, handlerData.endTimestamp); 20013 } 20014 } 20015 }); 20016 } 20017 addFetchInstrumentationHandler((handlerData) => { 20018 const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); 20019 if (handlerData.response && handlerData.fetchData.__span) { 20020 responseToSpanId.set(handlerData.response, handlerData.fetchData.__span); 20021 } 20022 if (createdSpan) { 20023 const fullUrl = getFullURL(handlerData.fetchData.url); 20024 const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; 20025 createdSpan.setAttributes({ 20026 "http.url": fullUrl, 20027 "server.address": host 20028 }); 20029 } 20030 if (enableHTTPTimings && createdSpan) { 20031 addHTTPTimings(createdSpan); 20032 } 20033 }); 20034 } 20035 if (traceXHR) { 20036 addXhrInstrumentationHandler((handlerData) => { 20037 const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); 20038 if (enableHTTPTimings && createdSpan) { 20039 addHTTPTimings(createdSpan); 20040 } 20041 }); 20042 } 20043 } 20044 function isPerformanceResourceTiming(entry) { 20045 return entry.entryType === "resource" && "initiatorType" in entry && typeof entry.nextHopProtocol === "string" && (entry.initiatorType === "fetch" || entry.initiatorType === "xmlhttprequest"); 20046 } 20047 function addHTTPTimings(span) { 20048 const { url } = spanToJSON(span).data || {}; 20049 if (!url || typeof url !== "string") { 20050 return; 20051 } 20052 const cleanup = addPerformanceInstrumentationHandler("resource", ({ entries: entries2 }) => {
20053 entries2.forEach((entry) => { 20054 if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) { 20055 const spanData = resourceTimingEntryToSpanData(entry); 20056 spanData.forEach((data) => span.setAttribute(...data)); 20057 setTimeout(cleanup); 20058 } 20059 }); 20060 }); 20061 } 20062 function getAbsoluteTime(time2 = 0) { 20063 return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time2) / 1e3; 20064 } 20065 function resourceTimingEntryToSpanData(resourceTiming) { 20066 const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol); 20067 const timingSpanData = []; 20068 timingSpanData.push(["network.protocol.version", version], ["network.protocol.name", name]); 20069 if (!browserPerformanceTimeOrigin) { 20070 return timingSpanData; 20071 } 20072 return [ 20073 ...timingSpanData, 20074 ["http.request.redirect_start", getAbsoluteTime(resourceTiming.redirectStart)], 20075 ["http.request.fetch_start", getAbsoluteTime(resourceTiming.fetchStart)], 20076 ["http.request.domain_lookup_start", getAbsoluteTime(resourceTiming.domainLookupStart)], 20077 ["http.request.domain_lookup_end", getAbsoluteTime(resourceTiming.domainLookupEnd)], 20078 ["http.request.connect_start", getAbsoluteTime(resourceTiming.connectStart)], 20079 ["http.request.secure_connection_start", getAbsoluteTime(resourceTiming.secureConnectionStart)], 20080 ["http.request.connection_end", getAbsoluteTime(resourceTiming.connectEnd)], 20081 ["http.request.request_start", getAbsoluteTime(resourceTiming.requestStart)], 20082 ["http.request.response_start", getAbsoluteTime(resourceTiming.responseStart)], 20083 ["http.request.response_end", getAbsoluteTime(resourceTiming.responseEnd)] 20084 ]; 20085 } 20086 function shouldAttachHeaders(targetUrl, tracePropagationTargets) { 20087 const href = WINDOW$1.location && WINDOW$1.location.href; 20088 if (!href) { 20089 const isRelativeSameOriginRequest = !!targetUrl.match(/^\/(?!\/)/); 20090 if (!tracePropagationTargets) { 20091 return isRelativeSameOriginRequest; 20092 } else { 20093 return stringMatchesSomePattern(targetUrl, tracePropagationTargets); 20094 } 20095 } else { 20096 let resolvedUrl; 20097 let currentOrigin; 20098 try { 20099 resolvedUrl = new URL(targetUrl, href); 20100 currentOrigin = new URL(href).origin; 20101 } catch (e2) { 20102 return false; 20103 } 20104 const isSameOriginRequest = resolvedUrl.origin === currentOrigin; 20105 if (!tracePropagationTargets) { 20106 return isSameOriginRequest; 20107 } else { 20108 return stringMatchesSomePattern(resolvedUrl.toString(), tracePropagationTargets) || isSameOriginRequest && stringMatchesSomePattern(resolvedUrl.pathname, tracePropagationTargets); 20109 } 20110 } 20111 }
20112 function xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeaders2, spans) { 20113 const xhr = handlerData.xhr; 20114 const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY]; 20115 if (!xhr || xhr.__sentry_own_request__ || !sentryXhrData) { 20116 return void 0; 20117 } 20118 const shouldCreateSpanResult = hasTracingEnabled() && shouldCreateSpan(sentryXhrData.url); 20119 if (handlerData.endTimestamp && shouldCreateSpanResult) { 20120 const spanId = xhr.__sentry_xhr_span_id__; 20121 if (!spanId) return; 20122 const span2 = spans[spanId]; 20123 if (span2 && sentryXhrData.status_code !== void 0) { 20124 setHttpStatus(span2, sentryXhrData.status_code); 20125 span2.end(); 20126 delete spans[spanId]; 20127 } 20128 return void 0; 20129 } 20130 const fullUrl = getFullURL(sentryXhrData.url); 20131 const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; 20132 const hasParent = !!getActiveSpan(); 20133 const span = shouldCreateSpanResult && hasParent ? startInactiveSpan({ 20134 name: `${sentryXhrData.method} ${sentryXhrData.url}`, 20135 attributes: { 20136 type: "xhr", 20137 "http.method": sentryXhrData.method, 20138 "http.url": fullUrl, 20139 url: sentryXhrData.url, 20140 "server.address": host, 20141 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser", 20142 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client" 20143 } 20144 }) : new SentryNonRecordingSpan(); 20145 xhr.__sentry_xhr_span_id__ = span.spanContext().spanId; 20146 spans[xhr.__sentry_xhr_span_id__] = span; 20147 if (shouldAttachHeaders2(sentryXhrData.url)) { 20148 addTracingHeadersToXhrRequest( 20149 xhr, 20150 // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), 20151 // we do not want to use the span as base for the trace headers, 20152 // which means that the headers will be generated from the scope and the sampling decision is deferred 20153 hasTracingEnabled() && hasParent ? span : void 0 20154 ); 20155 } 20156 return span; 20157 } 20158 function addTracingHeadersToXhrRequest(xhr, span) { 20159 const { "sentry-trace": sentryTrace, baggage } = getTraceData({ span }); 20160 if (sentryTrace) { 20161 setHeaderOnXhr(xhr, sentryTrace, baggage); 20162 } 20163 } 20164 function setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader) { 20165 try { 20166 xhr.setRequestHeader("sentry-trace", sentryTraceHeader); 20167 if (sentryBaggageHeader) { 20168 xhr.setRequestHeader("baggage", sentryBaggageHeader); 20169 } 20170 } catch (_2) { 20171 } 20172 } 20173 function getFullURL(url) { 20174 try { 20175 const parsed = new URL(url, WINDOW$1.location.origin); 20176 return parsed.href; 20177 } catch (e2) { 20178 return void 0; 20179 } 20180 } 20181 function registerBackgroundTabDetection() { 20182 if (WINDOW$1 && WINDOW$1.document) { 20183 WINDOW$1.document.addEventListener("visibilitychange", () => { 20184 const activeSpan = getActiveSpan(); 20185 if (!activeSpan) { 20186 return; 20187 } 20188 const rootSpan = getRootSpan(activeSpan); 20189 if (WINDOW$1.document.hidden && rootSpan) { 20190 const cancelledStatus = "cancelled"; 20191 const { op, status } = spanToJSON(rootSpan); 20192 if (DEBUG_BUILD$1) { 20193 logger.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`); 20194 } 20195 if (!status) { 20196 rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: cancelledStatus }); 20197 } 20198 rootSpan.setAttribute("sentry.cancellation_reason", "document.hidden"); 20199 rootSpan.end(); 20200 } 20201 }); 20202 } else { 20203 DEBUG_BUILD$1 && logger.warn("[Tracing] Could not set up background tab detection due to lack of global document"); 20204 } 20205 } 20206 const BROWSER_TRACING_INTEGRATION_ID = "BrowserTracing"; 20207 const DEFAULT_BROWSER_TRACING_OPTIONS = __spreadValues(__spreadProps(__spreadValues({}, TRACING_DEFAULTS), { 20208 instrumentNavigation: true, 20209 instrumentPageLoad: true,
20210 markBackgroundSpan: true, 20211 enableLongTask: true, 20212 enableLongAnimationFrame: true, 20213 enableInp: true, 20214 _experiments: {} 20215 }), defaultRequestInstrumentationOptions); 20216 const browserTracingIntegration = ((_options = {}) => { 20217 registerSpanErrorInstrumentation(); 20218 const { 20219 enableInp, 20220 enableLongTask, 20221 enableLongAnimationFrame, 20222 _experiments: { enableInteractions, enableStandaloneClsSpans }, 20223 beforeStartSpan, 20224 idleTimeout, 20225 finalTimeout, 20226 childSpanTimeout, 20227 markBackgroundSpan, 20228 traceFetch, 20229 traceXHR, 20230 trackFetchStreamPerformance, 20231 shouldCreateSpanForRequest, 20232 enableHTTPTimings, 20233 instrumentPageLoad, 20234 instrumentNavigation 20235 } = __spreadValues(__spreadValues({}, DEFAULT_BROWSER_TRACING_OPTIONS), _options); 20236 const _collectWebVitals = startTrackingWebVitals({ recordClsStandaloneSpans: enableStandaloneClsSpans || false }); 20237 if (enableInp) { 20238 startTrackingINP(); 20239 } 20240 if (enableLongAnimationFrame && GLOBAL_OBJ.PerformanceObserver && PerformanceObserver.supportedEntryTypes && PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")) { 20241 startTrackingLongAnimationFrames(); 20242 } else if (enableLongTask) { 20243 startTrackingLongTasks(); 20244 } 20245 if (enableInteractions) { 20246 startTrackingInteractions(); 20247 } 20248 const latestRoute = { 20249 name: void 0, 20250 source: void 0 20251 }; 20252 function _createRouteSpan(client2, startSpanOptions) { 20253 const isPageloadTransaction = startSpanOptions.op === "pageload"; 20254 const finalStartSpanOptions = beforeStartSpan ? beforeStartSpan(startSpanOptions) : startSpanOptions; 20255 const attributes = finalStartSpanOptions.attributes || {}; 20256 if (startSpanOptions.name !== finalStartSpanOptions.name) { 20257 attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = "custom"; 20258 finalStartSpanOptions.attributes = attributes; 20259 } 20260 latestRoute.name = finalStartSpanOptions.name; 20261 latestRoute.source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; 20262 const idleSpan = startIdleSpan(finalStartSpanOptions, { 20263 idleTimeout, 20264 finalTimeout, 20265 childSpanTimeout, 20266 // should wait for finish signal if it's a pageload transaction 20267 disableAutoFinish: isPageloadTransaction, 20268 beforeSpanEnd: (span) => { 20269 _collectWebVitals(); 20270 addPerformanceEntries(span, { recordClsOnPageloadSpan: !enableStandaloneClsSpans }); 20271 } 20272 }); 20273 function emitFinish() { 20274 if (["interactive", "complete"].includes(WINDOW$1.document.readyState)) { 20275 client2.emit("idleSpanEnableAutoFinish", idleSpan); 20276 } 20277 } 20278 if (isPageloadTransaction && WINDOW$1.document) { 20279 WINDOW$1.document.addEventListener("readystatechange", () => { 20280 emitFinish(); 20281 }); 20282 emitFinish(); 20283 } 20284 return idleSpan; 20285 } 20286 return { 20287 name: BROWSER_TRACING_INTEGRATION_ID, 20288 afterAllSetup(client2) { 20289 let activeSpan; 20290 let startingUrl = WINDOW$1.location && WINDOW$1.location.href; 20291 function maybeEndActiveSpan() { 20292 if (activeSpan && !spanToJSON(activeSpan).timestamp) { 20293 DEBUG_BUILD$1 && logger.log(`[Tracing] Finishing current active span with op: ${spanToJSON(activeSpan).op}`); 20294 activeSpan.end(); 20295 } 20296 } 20297 client2.on("startNavigationSpan", (startSpanOptions) => { 20298 if (getClient() !== client2) { 20299 return; 20300 } 20301 maybeEndActiveSpan(); 20302 activeSpan = _createRouteSpan(client2, __spreadValues({ 20303 op: "navigation" 20304 }, startSpanOptions)); 20305 }); 20306 client2.on("startPageLoadSpan", (startSpanOptions, traceOptions = {}) => { 20307 if (getClient() !== client2) { 20308 return; 20309 } 20310 maybeEndActiveSpan(); 20311 const sentryTrace = traceOptions.sentryTrace || getMetaContent("sentry-trace"); 20312 const baggage = traceOptions.baggage || getMetaContent("baggage"); 20313 const propagationContext = propagationContextFromHeaders(sentryTrace, baggage); 20314 getCurrentScope().setPropagationContext(propagationContext); 20315 activeSpan = _createRouteSpan(client2, __spreadValues({ 20316 op: "pageload" 20317 }, startSpanOptions)); 20318 }); 20319 client2.on("spanEnd", (span) => { 20320 const op = spanToJSON(span).op; 20321 if (span !== getRootSpan(span) || op !== "navigation" && op !== "pageload") { 20322 return; 20323 } 20324 const scope = getCurrentScope(); 20325 const oldPropagationContext = scope.getPropagationContext(); 20326 scope.setPropagationContext(__spreadProps(__spreadValues({}, oldPropagationContext), { 20327 sampled: oldPropagationContext.sampled !== void 0 ? oldPropagationContext.sampled : spanIsSampled(span), 20328 dsc: oldPropagationContext.dsc || getDynamicSamplingContextFromSpan(span) 20329 })); 20330 }); 20331 if (WINDOW$1.location) { 20332 if (instrumentPageLoad) { 20333 startBrowserTracingPageLoadSpan(client2, { 20334 name: WINDOW$1.location.pathname, 20335 // pageload should always start at timeOrigin (and needs to be in s, not ms) 20336 startTime: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1e3 : void 0, 20337 attributes: { 20338 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", 20339 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.pageload.browser" 20340 } 20341 }); 20342 } 20343 if (instrumentNavigation) { 20344 addHistoryInstrumentationHandler(({ to: to2, from: from2 }) => { 20345 if (from2 === void 0 && startingUrl && startingUrl.indexOf(to2) !== -1) { 20346 startingUrl = void 0; 20347 return; 20348 } 20349 if (from2 !== to2) { 20350 startingUrl = void 0; 20351 startBrowserTracingNavigationSpan(client2, { 20352 name: WINDOW$1.location.pathname, 20353 attributes: { 20354 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", 20355 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.navigation.browser" 20356 } 20357 }); 20358 } 20359 }); 20360 } 20361 }
20362 if (markBackgroundSpan) { 20363 registerBackgroundTabDetection(); 20364 } 20365 if (enableInteractions) { 20366 registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute); 20367 } 20368 if (enableInp) { 20369 registerInpInteractionListener(); 20370 } 20371 instrumentOutgoingRequests(client2, { 20372 traceFetch, 20373 traceXHR, 20374 trackFetchStreamPerformance, 20375 tracePropagationTargets: client2.getOptions().tracePropagationTargets, 20376 shouldCreateSpanForRequest, 20377 enableHTTPTimings 20378 }); 20379 } 20380 }; 20381 }); 20382 function startBrowserTracingPageLoadSpan(client2, spanOptions, traceOptions) { 20383 client2.emit("startPageLoadSpan", spanOptions, traceOptions); 20384 getCurrentScope().setTransactionName(spanOptions.name); 20385 const span = getActiveSpan(); 20386 const op = span && spanToJSON(span).op; 20387 return op === "pageload" ? span : void 0; 20388 } 20389 function startBrowserTracingNavigationSpan(client2, spanOptions) { 20390 getIsolationScope().setPropagationContext({ traceId: generateTraceId() }); 20391 getCurrentScope().setPropagationContext({ traceId: generateTraceId() }); 20392 client2.emit("startNavigationSpan", spanOptions); 20393 getCurrentScope().setTransactionName(spanOptions.name); 20394 const span = getActiveSpan(); 20395 const op = span && spanToJSON(span).op; 20396 return op === "navigation" ? span : void 0; 20397 } 20398 function getMetaContent(metaName) { 20399 const metaTag = getDomElement(`meta[name=${metaName}]`); 20400 return metaTag ? metaTag.getAttribute("content") : void 0; 20401 } 20402 function registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute) { 20403 let inflightInteractionSpan; 20404 const registerInteractionTransaction = () => { 20405 const op = "ui.action.click"; 20406 const activeSpan = getActiveSpan(); 20407 const rootSpan = activeSpan && getRootSpan(activeSpan); 20408 if (rootSpan) { 20409 const currentRootSpanOp = spanToJSON(rootSpan).op; 20410 if (["navigation", "pageload"].includes(currentRootSpanOp)) { 20411 DEBUG_BUILD$1 && logger.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`); 20412 return void 0; 20413 } 20414 } 20415 if (inflightInteractionSpan) { 20416 inflightInteractionSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "interactionInterrupted"); 20417 inflightInteractionSpan.end(); 20418 inflightInteractionSpan = void 0; 20419 } 20420 if (!latestRoute.name) { 20421 DEBUG_BUILD$1 && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`); 20422 return void 0; 20423 } 20424 inflightInteractionSpan = startIdleSpan( 20425 { 20426 name: latestRoute.name, 20427 op, 20428 attributes: { 20429 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || "url" 20430 } 20431 }, 20432 { 20433 idleTimeout, 20434 finalTimeout, 20435 childSpanTimeout 20436 } 20437 ); 20438 }; 20439 if (WINDOW$1.document) { 20440 addEventListener("click", registerInteractionTransaction, { once: false, capture: true }); 20441 } 20442 } 20443 function init$1(options2) { 20444 const opts = __spreadValues({}, options2); 20445 applySdkMetadata(opts, "react"); 20446 setContext("react", { version: reactExports.version }); 20447 return init$2(opts); 20448 } 20449 var reactIs = { exports: {} }; 20450 var reactIs_production_min = {}; 20451 /** @license React v16.13.1 20452 * react-is.production.min.js 20453 * 20454 * Copyright (c) Facebook, Inc. and its affiliates. 20455 * 20456 * This source code is licensed under the MIT license found in the 20457 * LICENSE file in the root directory of this source tree. 20458 */ 20459 var hasRequiredReactIs_production_min; 20460 function requireReactIs_production_min() { 20461 if (hasRequiredReactIs_production_min) return reactIs_production_min; 20462 hasRequiredReactIs_production_min = 1; 20463 var b2 = "function" === typeof Symbol && Symbol.for, c2 = b2 ? Symbol.for("react.element") : 60103, d2 = b2 ? Symbol.for("react.portal") : 60106, e2 = b2 ? Symbol.for("react.fragment") : 60107, f2 = b2 ? Symbol.for("react.strict_mode") : 60108, g2 = b2 ? Symbol.for("react.profiler")
vendor: 6,121 bytes, lines 20463-20620
20463: 60114, h2 = b2 ? Symbol.for("react.provider") : 60109, k2 = b2 ? Symbol.for("react.context") : 60110, l2 = b2 ? Symbol.for("react.async_mode") : 60111, m2 = b2 ? Symbol.for("react.concurrent_mode") : 60111, n2 = b2 ? Symbol.for("react.forward_ref") : 60112, p2 = b2 ? Symbol.for("react.suspense") : 60113, q2 = b2 ? Symbol.for("react.suspense_list") : 60120, r2 = b2 ? Symbol.for("react.memo") : 60115, t2 = b2 ? Symbol.for("react.lazy") : 60116, v2 = b2 ? Symbol.for("react.block") : 60121, w2 = b2 ? Symbol.for("react.fundamental") : 60117, x2 = b2 ? Symbol.for("react.responder") : 60118, y2 = b2 ? Symbol.for("react.scope") : 60119; 20464 function z2(a2) { 20465 if ("object" === typeof a2 && null !== a2) { 20466 var u2 = a2.$$typeof; 20467 switch (u2) { 20468 case c2: 20469 switch (a2 = a2.type, a2) { 20470 case l2: 20471 case m2: 20472 case e2: 20473 case g2: 20474 case f2: 20475 case p2: 20476 return a2; 20477 default: 20478 switch (a2 = a2 && a2.$$typeof, a2) { 20479 case k2: 20480 case n2: 20481 case t2: 20482 case r2: 20483 case h2: 20484 return a2; 20485 default: 20486 return u2; 20487 } 20488 } 20489 case d2: 20490 return u2; 20491 } 20492 } 20493 } 20494 function A2(a2) { 20495 return z2(a2) === m2; 20496 } 20497 reactIs_production_min.AsyncMode = l2; 20498 reactIs_production_min.ConcurrentMode = m2; 20499 reactIs_production_min.ContextConsumer = k2; 20500 reactIs_production_min.ContextProvider = h2; 20501 reactIs_production_min.Element = c2; 20502 reactIs_production_min.ForwardRef = n2; 20503 reactIs_production_min.Fragment = e2; 20504 reactIs_production_min.Lazy = t2; 20505 reactIs_production_min.Memo = r2; 20506 reactIs_production_min.Portal = d2; 20507 reactIs_production_min.Profiler = g2; 20508 reactIs_production_min.StrictMode = f2; 20509 reactIs_production_min.Suspense = p2; 20510 reactIs_production_min.isAsyncMode = function(a2) { 20511 return A2(a2) || z2(a2) === l2; 20512 }; 20513 reactIs_production_min.isConcurrentMode = A2; 20514 reactIs_production_min.isContextConsumer = function(a2) { 20515 return z2(a2) === k2; 20516 }; 20517 reactIs_production_min.isContextProvider = function(a2) { 20518 return z2(a2) === h2; 20519 }; 20520 reactIs_production_min.isElement = function(a2) { 20521 return "object" === typeof a2 && null !== a2 && a2.$$typeof === c2; 20522 }; 20523 reactIs_production_min.isForwardRef = function(a2) { 20524 return z2(a2) === n2; 20525 }; 20526 reactIs_production_min.isFragment = function(a2) { 20527 return z2(a2) === e2; 20528 }; 20529 reactIs_production_min.isLazy = function(a2) { 20530 return z2(a2) === t2; 20531 }; 20532 reactIs_production_min.isMemo = function(a2) { 20533 return z2(a2) === r2; 20534 }; 20535 reactIs_production_min.isPortal = function(a2) { 20536 return z2(a2) === d2; 20537 }; 20538 reactIs_production_min.isProfiler = function(a2) { 20539 return z2(a2) === g2; 20540 }; 20541 reactIs_production_min.isStrictMode = function(a2) { 20542 return z2(a2) === f2; 20543 }; 20544 reactIs_production_min.isSuspense = function(a2) { 20545 return z2(a2) === p2; 20546 }; 20547 reactIs_production_min.isValidElementType = function(a2) { 20548 return "string" === typeof a2 || "function" === typeof a2 || a2 === e2 || a2 === m2 || a2 === g2 || a2 === f2 || a2 === p2 || a2 === q2 || "object" === typeof a2 && null !== a2 && (a2.$$typeof === t2 || a2.$$typeof === r2 || a2.$$typeof === h2 || a2.$$typeof === k2 || a2.$$typeof === n2 || a2.$$typeof === w2 || a2.$$typeof === x2 || a2.$$typeof === y2 || a2.$$typeof === v2); 20549 }; 20550 reactIs_production_min.typeOf = z2; 20551 return reactIs_production_min; 20552 } 20553 var hasRequiredReactIs; 20554 function requireReactIs() { 20555 if (hasRequiredReactIs) return reactIs.exports; 20556 hasRequiredReactIs = 1; 20557 { 20558 reactIs.exports = requireReactIs_production_min(); 20559 } 20560 return reactIs.exports; 20561 } 20562 var hoistNonReactStatics_cjs; 20563 var hasRequiredHoistNonReactStatics_cjs; 20564 function requireHoistNonReactStatics_cjs() { 20565 if (hasRequiredHoistNonReactStatics_cjs) return hoistNonReactStatics_cjs; 20566 hasRequiredHoistNonReactStatics_cjs = 1; 20567 var reactIs2 = requireReactIs(); 20568 var REACT_STATICS = { 20569 childContextTypes: true, 20570 contextType: true, 20571 contextTypes: true, 20572 defaultProps: true, 20573 displayName: true, 20574 getDefaultProps: true, 20575 getDerivedStateFromError: true, 20576 getDerivedStateFromProps: true, 20577 mixins: true, 20578 propTypes: true, 20579 type: true 20580 }; 20581 var KNOWN_STATICS = { 20582 name: true, 20583 length: true, 20584 prototype: true, 20585 caller: true, 20586 callee: true, 20587 arguments: true, 20588 arity: true 20589 }; 20590 var FORWARD_REF_STATICS = { 20591 "$$typeof": true, 20592 render: true, 20593 defaultProps: true, 20594 displayName: true, 20595 propTypes: true 20596 }; 20597 var MEMO_STATICS = { 20598 "$$typeof": true, 20599 compare: true, 20600 defaultProps: true, 20601 displayName: true, 20602 propTypes: true, 20603 type: true 20604 }; 20605 var TYPE_STATICS = {}; 20606 TYPE_STATICS[reactIs2.ForwardRef] = FORWARD_REF_STATICS; 20607 TYPE_STATICS[reactIs2.Memo] = MEMO_STATICS; 20608 function getStatics(component) { 20609 if (reactIs2.isMemo(component)) { 20610 return MEMO_STATICS; 20611 } 20612 return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS; 20613 } 20614 var defineProperty2 = Object.defineProperty; 20615 var getOwnPropertyNames = Object.getOwnPropertyNames; 20616 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 20617 var getOwnPropertyDescriptor2 = Object.getOwnPropertyDescriptor; 20618 var getPrototypeOf2 = Object.getPrototypeOf; 20619 var objectPrototype = Object.prototype; 20620 function hoistNonReactStatics(targetComponent, sourceComponent, blackl
20620ist) { 20621 if (typeof sourceComponent !== "string") { 20622 if (objectPrototype) { 20623 var inheritedComponent = getPrototypeOf2(sourceComponent); 20624 if (inheritedComponent && inheritedComponent !== objectPrototype) { 20625 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); 20626 } 20627 } 20628 var keys2 = getOwnPropertyNames(sourceComponent); 20629 if (getOwnPropertySymbols) { 20630 keys2 = keys2.concat(getOwnPropertySymbols(sourceComponent)); 20631 } 20632 var targetStatics = getStatics(targetComponent); 20633 var sourceStatics = getStatics(sourceComponent); 20634 for (var i2 = 0; i2 < keys2.length; ++i2) { 20635 var key = keys2[i2]; 20636 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { 20637 var descriptor = getOwnPropertyDescriptor2(sourceComponent, key); 20638 try { 20639 defineProperty2(targetComponent, key, descriptor); 20640 } catch (e2) { 20641 } 20642 } 20643 } 20644 } 20645 return targetComponent; 20646 } 20647 hoistNonReactStatics_cjs = hoistNonReactStatics; 20648 return hoistNonReactStatics_cjs; 20649 } 20650 requireHoistNonReactStatics_cjs(); 20651 const CLIENTS_WITH_INSTRUMENT_NAVIGATION = /* @__PURE__ */ new WeakSet(); 20652 function createReactRouterV6CompatibleTracingIntegration(options2, version) { 20653 const integration = browserTracingIntegration(__spreadProps(__spreadValues({}, options2), { 20654 instrumentPageLoad: false, 20655 instrumentNavigation: false 20656 })); 20657 const { 20658 useEffect, 20659 useLocation: useLocation2, 20660 useNavigationType: useNavigationType2, 20661 createRoutesFromChildren: createRoutesFromChildren2, 20662 matchRoutes: matchRoutes2, 20663 stripBasename: stripBasename2, 20664 instrumentPageLoad = true, 20665 instrumentNavigation = true 20666 } = options2; 20667 return __spreadProps(__spreadValues({}, integration), { 20668 setup() { 20669 }, 20670 afterAllSetup(client2) { 20671 integration.afterAllSetup(client2); 20672 const initPathName = WINDOW$1 && WINDOW$1.location && WINDOW$1.location.pathname; 20673 if (instrumentPageLoad && initPathName) { 20674 startBrowserTracingPageLoadSpan(client2, { 20675 name: initPathName, 20676 attributes: { 20677 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", 20678 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "pageload", 20679 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.pageload.react.reactrouter_v${version}` 20680 } 20681 }); 20682 } 20683 if (instrumentNavigation) { 20684 CLIENTS_WITH_INSTRUMENT_NAVIGATION.add(client2); 20685 } 20686 } 20687 }); 20688 } 20689 function reactRouterV6BrowserTracingIntegration(options2) { 20690 return createReactRouterV6CompatibleTracingIntegration(options2, "6"); 20691 } 20692 var s$4 = (r2, t2) => { 20693 if (getCurrentEnvironment() === "development") { 20694 console.error(r2, t2); 20695 return; 20696 } 20697 return captureException(r2, t2); 20698 }; 20699 var c$4 = [/Cannot read properties of null \(reading 'sessionId'\)/, /null is not an object \(evaluating 'Qr\.sessionId'\)/, /Cannot read properties of null \(reading 'version'\)/, /null is not an object \(evaluating 'yi\.version'\)/], u$5 = []; 20700 var R$6 = (r2) => { 20701 let _a = r2 != null ? r2 : {}, { denyUrls: t2, ignoreErrors: o2, integrations: n2 } = _a, a2 = __objRest(_a, ["denyUrls", "ignoreErrors", "integrations"]); 20702 return __spreadValues({ dsn: getSentryDsn(), release: getCommitHash(), environment: getCurrentEnvironment(), integrations: [browserTracingIntegration(), breadcrumbsIntegration({ console: true, dom: true, fetch: true, history: true, xhr: true }), ...Array.isArray(n2) ? n2 : []], tracesSampleRate: 0, beforeBreadcrumb: (p2) => { 20703 var _a2; 20704 return typeof ((_a2 = p2.data) == null ? void 0 : _a2.url) == "string" && p2.data.url.includes("base64") && (p2.data.url = "__base64__"), p2; 20705 }, ignoreErrors: [...c$4, ...o2 != null ? o2 : []], denyUrls: [...u$5, ...t2 != null ? t2 : []] }, a2); 20706 }, b$5 = ({ appName: r2, options: t2 }) => { 20707 let o2 = getCurrentEnvironment(); 20708 o2 !== "production" && o2 !== "staging" || (init$1(R$6(t2)), getCurrentScope().setTag("app", r2)); 20709 }; 20710 const errorLoggerInterceptor = (logger2) => (error) => { 20711 var _a, _b, _c; 20712 if (((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) && ((_b = error == null ? void 0 : error.response) == null ? void 0 : _b.status) >= 500 || !((_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status)) { 20713 logger2(error); 20714 } 20715 return Promise.reject(error); 20716 }; 20717 function bind(fn2, thisArg) { 20718 return function wrap2() { 20719 return fn2.apply(thisArg, arguments); 20720 }; 20721 } 20722 const { toString: toString$2 } = Object.prototype; 20723 const { getPrototypeOf: getPrototypeOf$1 } = Object;
vendor: 8,656 bytes, lines 20724-20946
20724 const kindOf = /* @__PURE__ */ ((cache) => (thing) => { 20725 const str = toString$2.call(thing); 20726 return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); 20727 })(/* @__PURE__ */ Object.create(null)); 20728 const kindOfTest = (type) => { 20729 type = type.toLowerCase(); 20730 return (thing) => kindOf(thing) === type; 20731 }; 20732 const typeOfTest = (type) => (thing) => typeof thing === type; 20733 const { isArray: isArray$1 } = Array; 20734 const isUndefined$1 = typeOfTest("undefined"); 20735 function isBuffer$1(val) { 20736 return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$2(val.constructor.isBuffer) && val.constructor.isBuffer(val); 20737 } 20738 const isArrayBuffer = kindOfTest("ArrayBuffer"); 20739 function isArrayBufferView(val) { 20740 let result; 20741 if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { 20742 result = ArrayBuffer.isView(val); 20743 } else { 20744 result = val && val.buffer && isArrayBuffer(val.buffer); 20745 } 20746 return result; 20747 } 20748 const isString$1 = typeOfTest("string"); 20749 const isFunction$2 = typeOfTest("function"); 20750 const isNumber = typeOfTest("number"); 20751 const isObject$4 = (thing) => thing !== null && typeof thing === "object"; 20752 const isBoolean = (thing) => thing === true || thing === false; 20753 const isPlainObject$2 = (val) => { 20754 if (kindOf(val) !== "object") { 20755 return false; 20756 } 20757 const prototype2 = getPrototypeOf$1(val); 20758 return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); 20759 }; 20760 const isDate$1 = kindOfTest("Date"); 20761 const isFile = kindOfTest("File"); 20762 const isBlob = kindOfTest("Blob"); 20763 const isFileList = kindOfTest("FileList"); 20764 const isStream = (val) => isObject$4(val) && isFunction$2(val.pipe); 20765 const isFormData = (thing) => { 20766 let kind; 20767 return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$2(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance 20768 kind === "object" && isFunction$2(thing.toString) && thing.toString() === "[object FormData]")); 20769 }; 20770 const isURLSearchParams = kindOfTest("URLSearchParams"); 20771 const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); 20772 const trim$2 = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); 20773 function forEach(obj, fn2, { allOwnKeys = false } = {}) { 20774 if (obj === null || typeof obj === "undefined") { 20775 return; 20776 } 20777 let i2; 20778 let l2; 20779 if (typeof obj !== "object") { 20780 obj = [obj]; 20781 } 20782 if (isArray$1(obj)) { 20783 for (i2 = 0, l2 = obj.length; i2 < l2; i2++) { 20784 fn2.call(null, obj[i2], i2, obj); 20785 } 20786 } else { 20787 const keys2 = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); 20788 const len = keys2.length; 20789 let key; 20790 for (i2 = 0; i2 < len; i2++) { 20791 key = keys2[i2]; 20792 fn2.call(null, obj[key], key, obj); 20793 } 20794 } 20795 } 20796 function findKey(obj, key) { 20797 key = key.toLowerCase(); 20798 const keys2 = Object.keys(obj); 20799 let i2 = keys2.length; 20800 let _key; 20801 while (i2-- > 0) { 20802 _key = keys2[i2]; 20803 if (key === _key.toLowerCase()) { 20804 return _key; 20805 } 20806 } 20807 return null; 20808 } 20809 const _global = (() => { 20810 if (typeof globalThis !== "undefined") return globalThis; 20811 return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; 20812 })(); 20813 const isContextDefined = (context) => !isUndefined$1(context) && context !== _global; 20814 function merge$1() { 20815 const { caseless } = isContextDefined(this) && this || {}; 20816 const result = {}; 20817 const assignValue2 = (val, key) => { 20818 const targetKey = caseless && findKey(result, key) || key; 20819 if (isPlainObject$2(result[targetKey]) && isPlainObject$2(val)) { 20820 result[targetKey] = merge$1(result[targetKey], val); 20821 } else if (isPlainObject$2(val)) { 20822 result[targetKey] = merge$1({}, val); 20823 } else if (isArray$1(val)) { 20824 result[targetKey] = val.slice(); 20825 } else { 20826 result[targetKey] = val; 20827 } 20828 }; 20829 for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) { 20830 arguments[i2] && forEach(arguments[i2], assignValue2); 20831 } 20832 return result; 20833 } 20834 const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => { 20835 forEach(b2, (val, key) => { 20836 if (thisArg && isFunction$2(val)) { 20837 a2[key] = bind(val, thisArg); 20838 } else { 20839 a2[key] = val; 20840 } 20841 }, { allOwnKeys }); 20842 return a2; 20843 }; 20844 const stripBOM = (content) => { 20845 if (content.charCodeAt(0) === 65279) { 20846 content = content.slice(1); 20847 } 20848 return content; 20849 }; 20850 const inherits$1 = (constructor, superConstructor, props, descriptors2) => { 20851 constructor.prototype = Object.create(superConstructor.prototype, descriptors2); 20852 constructor.prototype.constructor = constructor; 20853 Object.defineProperty(constructor, "super", { 20854 value: superConstructor.prototype 20855 }); 20856 props && Object.assign(constructor.prototype, props); 20857 }; 20858 const toFlatObject = (sourceObj, destObj, filter2, propFilter) => { 20859 let props; 20860 let i2; 20861 let prop; 20862 const merged = {}; 20863 destObj = destObj || {}; 20864 if (sourceObj == null) return destObj; 20865 do { 20866 props = Object.getOwnPropertyNames(sourceObj); 20867 i2 = props.length; 20868 while (i2-- > 0) { 20869 prop = props[i2]; 20870 if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { 20871 destObj[prop] = sourceObj[prop]; 20872 merged[prop] = true; 20873 } 20874 } 20875 sourceObj = filter2 !== false && getPrototypeOf$1(sourceObj); 20876 } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype); 20877 return destObj; 20878 }; 20879 const endsWith = (str, searchString, position2) => { 20880 str = String(str); 20881 if (position2 === void 0 || position2 > str.length) { 20882 position2 = str.length; 20883 } 20884 position2 -= searchString.length; 20885 const lastIndex = str.indexOf(searchString, position2); 20886 return lastIndex !== -1 && lastIndex === position2; 20887 }; 20888 const toArray$1 = (thing) => { 20889 if (!thing) return null; 20890 if (isArray$1(thing)) return thing; 20891 let i2 = thing.length; 20892 if (!isNumber(i2)) return null; 20893 const arr = new Array(i2); 20894 while (i2-- > 0) { 20895 arr[i2] = thing[i2]; 20896 } 20897 return arr; 20898 }; 20899 const isTypedArray$1 = /* @__PURE__ */ ((TypedArray) => { 20900 return (thing) => { 20901 return TypedArray && thing instanceof TypedArray; 20902 }; 20903 })(typeof Uint8Array !== "undefined" && getPrototypeOf$1(Uint8Array)); 20904 const forEachEntry = (obj, fn2) => { 20905 const generator = obj && obj[Symbol.iterator]; 20906 const iterator = generator.call(obj); 20907 let result; 20908 while ((result = iterator.next()) && !result.done) { 20909 const pair = result.value; 20910 fn2.call(obj, pair[0], pair[1]); 20911 } 20912 }; 20913 const matchAll = (regExp, str) => { 20914 let matches2; 20915 const arr = []; 20916 while ((matches2 = regExp.exec(str)) !== null) { 20917 arr.push(matches2); 20918 } 20919 return arr; 20920 }; 20921 const isHTMLForm = kindOfTest("HTMLFormElement"); 20922 const toCamelCase = (str) => { 20923 return str.toLowerCase().replace( 20924 /[-_\s]([a-z\d])(\w*)/g, 20925 function replacer(m2, p1, p2) { 20926 return p1.toUpperCase() + p2; 20927 } 20928 ); 20929 }; 20930 const hasOwnProperty$f = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); 20931 const isRegExp = kindOfTest("RegExp"); 20932 const reduceDescriptors = (obj, reducer2) => { 20933 const descriptors2 = Object.getOwnPropertyDescriptors(obj); 20934 const reducedDescriptors = {}; 20935 forEach(descriptors2, (descriptor, name) => { 20936 let ret; 20937 if ((ret = reducer2(descriptor, name, obj)) !== false) { 20938 reducedDescriptors[name] = ret || descriptor; 20939 } 20940 }); 20941 Object.defineProperties(obj, reducedDescriptors); 20942 }; 20943 const freezeMethods = (obj) => { 20944 reduceDescriptors(obj, (descriptor, name) => { 20945 if (isFunction$2(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { 20946 return false;
vendor: 5,681 bytes, lines 20947-21131
20947 } 20948 const value = obj[name]; 20949 if (!isFunction$2(value)) return; 20950 descriptor.enumerable = false; 20951 if ("writable" in descriptor) { 20952 descriptor.writable = false; 20953 return; 20954 } 20955 if (!descriptor.set) { 20956 descriptor.set = () => { 20957 throw Error("Can not rewrite read-only method '" + name + "'"); 20958 }; 20959 } 20960 }); 20961 }; 20962 const toObjectSet = (arrayOrString, delimiter2) => { 20963 const obj = {}; 20964 const define = (arr) => { 20965 arr.forEach((value) => { 20966 obj[value] = true; 20967 }); 20968 }; 20969 isArray$1(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter2)); 20970 return obj; 20971 }; 20972 const noop$7 = () => { 20973 }; 20974 const toFiniteNumber = (value, defaultValue) => { 20975 return value != null && Number.isFinite(value = +value) ? value : defaultValue; 20976 }; 20977 const ALPHA = "abcdefghijklmnopqrstuvwxyz"; 20978 const DIGIT = "0123456789"; 20979 const ALPHABET = { 20980 DIGIT, 20981 ALPHA, 20982 ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT 20983 }; 20984 const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { 20985 let str = ""; 20986 const { length: length2 } = alphabet; 20987 while (size--) { 20988 str += alphabet[Math.random() * length2 | 0]; 20989 } 20990 return str; 20991 }; 20992 function isSpecCompliantForm(thing) { 20993 return !!(thing && isFunction$2(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]); 20994 } 20995 const toJSONObject = (obj) => { 20996 const stack = new Array(10); 20997 const visit2 = (source, i2) => { 20998 if (isObject$4(source)) { 20999 if (stack.indexOf(source) >= 0) { 21000 return; 21001 } 21002 if (!("toJSON" in source)) { 21003 stack[i2] = source; 21004 const target = isArray$1(source) ? [] : {}; 21005 forEach(source, (value, key) => { 21006 const reducedValue = visit2(value, i2 + 1); 21007 !isUndefined$1(reducedValue) && (target[key] = reducedValue); 21008 }); 21009 stack[i2] = void 0; 21010 return target; 21011 } 21012 } 21013 return source; 21014 }; 21015 return visit2(obj, 0); 21016 }; 21017 const isAsyncFn = kindOfTest("AsyncFunction"); 21018 const isThenable = (thing) => thing && (isObject$4(thing) || isFunction$2(thing)) && isFunction$2(thing.then) && isFunction$2(thing.catch); 21019 const _setImmediate = ((setImmediateSupported, postMessageSupported) => { 21020 if (setImmediateSupported) { 21021 return setImmediate; 21022 } 21023 return postMessageSupported ? ((token2, callbacks) => { 21024 _global.addEventListener("message", ({ source, data }) => { 21025 if (source === _global && data === token2) { 21026 callbacks.length && callbacks.shift()(); 21027 } 21028 }, false); 21029 return (cb) => { 21030 callbacks.push(cb); 21031 _global.postMessage(token2, "*"); 21032 }; 21033 })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); 21034 })( 21035 typeof setImmediate === "function", 21036 isFunction$2(_global.postMessage) 21037 ); 21038 const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; 21039 const utils$1 = { 21040 isArray: isArray$1, 21041 isArrayBuffer, 21042 isBuffer: isBuffer$1, 21043 isFormData, 21044 isArrayBufferView, 21045 isString: isString$1, 21046 isNumber, 21047 isBoolean, 21048 isObject: isObject$4, 21049 isPlainObject: isPlainObject$2, 21050 isReadableStream, 21051 isRequest, 21052 isResponse, 21053 isHeaders, 21054 isUndefined: isUndefined$1, 21055 isDate: isDate$1, 21056 isFile, 21057 isBlob, 21058 isRegExp, 21059 isFunction: isFunction$2, 21060 isStream, 21061 isURLSearchParams, 21062 isTypedArray: isTypedArray$1, 21063 isFileList, 21064 forEach, 21065 merge: merge$1, 21066 extend, 21067 trim: trim$2, 21068 stripBOM, 21069 inherits: inherits$1, 21070 toFlatObject, 21071 kindOf, 21072 kindOfTest, 21073 endsWith, 21074 toArray: toArray$1, 21075 forEachEntry, 21076 matchAll, 21077 isHTMLForm, 21078 hasOwnProperty: hasOwnProperty$f, 21079 hasOwnProp: hasOwnProperty$f, 21080 // an alias to avoid ESLint no-prototype-builtins detection 21081 reduceDescriptors, 21082 freezeMethods, 21083 toObjectSet, 21084 toCamelCase, 21085 noop: noop$7, 21086 toFiniteNumber, 21087 findKey, 21088 global: _global, 21089 isContextDefined, 21090 ALPHABET, 21091 generateString, 21092 isSpecCompliantForm, 21093 toJSONObject, 21094 isAsyncFn, 21095 isThenable, 21096 setImmediate: _setImmediate, 21097 asap 21098 }; 21099 function AxiosError$1(message, code, config, request, response) { 21100 Error.call(this); 21101 if (Error.captureStackTrace) { 21102 Error.captureStackTrace(this, this.constructor); 21103 } else { 21104 this.stack = new Error().stack; 21105 } 21106 this.message = message; 21107 this.name = "AxiosError"; 21108 code && (this.code = code); 21109 config && (this.config = config); 21110 request && (this.request = request); 21111 if (response) { 21112 this.response = response; 21113 this.status = response.status ? response.status : null; 21114 } 21115 } 21116 utils$1.inherits(AxiosError$1, Error, { 21117 toJSON: function toJSON() { 21118 return { 21119 // Standard 21120 message: this.message, 21121 name: this.name, 21122 // Microsoft 21123 description: this.description, 21124 number: this.number, 21125 // Mozilla 21126 fileName: this.fileName, 21127 lineNumber: this.lineNumber, 21128 columnNumber: this.columnNumber, 21129 stack: this.stack, 21130 // Axios 21131 config: utils$1.toJSONObject(this.config),
vendor: 4,271 bytes, lines 21132-21240
21132 code: this.code, 21133 status: this.status 21134 }; 21135 } 21136 }); 21137 const prototype$1 = AxiosError$1.prototype; 21138 const descriptors = {}; 21139 [ 21140 "ERR_BAD_OPTION_VALUE", 21141 "ERR_BAD_OPTION", 21142 "ECONNABORTED", 21143 "ETIMEDOUT", 21144 "ERR_NETWORK", 21145 "ERR_FR_TOO_MANY_REDIRECTS", 21146 "ERR_DEPRECATED", 21147 "ERR_BAD_RESPONSE", 21148 "ERR_BAD_REQUEST", 21149 "ERR_CANCELED", 21150 "ERR_NOT_SUPPORT", 21151 "ERR_INVALID_URL" 21152 // eslint-disable-next-line func-names 21153 ].forEach((code) => { 21154 descriptors[code] = { value: code }; 21155 }); 21156 Object.defineProperties(AxiosError$1, descriptors); 21157 Object.defineProperty(prototype$1, "isAxiosError", { value: true }); 21158 AxiosError$1.from = (error, code, config, request, response, customProps) => { 21159 const axiosError = Object.create(prototype$1); 21160 utils$1.toFlatObject(error, axiosError, function filter2(obj) { 21161 return obj !== Error.prototype; 21162 }, (prop) => { 21163 return prop !== "isAxiosError"; 21164 }); 21165 AxiosError$1.call(axiosError, error.message, code, config, request, response); 21166 axiosError.cause = error; 21167 axiosError.name = error.name; 21168 customProps && Object.assign(axiosError, customProps); 21169 return axiosError; 21170 }; 21171 const httpAdapter = null; 21172 function isVisitable(thing) { 21173 return utils$1.isPlainObject(thing) || utils$1.isArray(thing); 21174 } 21175 function removeBrackets(key) { 21176 return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key; 21177 } 21178 function renderKey(path, key, dots) { 21179 if (!path) return key; 21180 return path.concat(key).map(function each(token2, i2) { 21181 token2 = removeBrackets(token2); 21182 return !dots && i2 ? "[" + token2 + "]" : token2; 21183 }).join(dots ? "." : ""); 21184 } 21185 function isFlatArray(arr) { 21186 return utils$1.isArray(arr) && !arr.some(isVisitable); 21187 } 21188 const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter2(prop) { 21189 return /^is[A-Z]/.test(prop); 21190 }); 21191 function toFormData$1(obj, formData, options2) { 21192 if (!utils$1.isObject(obj)) { 21193 throw new TypeError("target must be an object"); 21194 } 21195 formData = formData || new FormData(); 21196 options2 = utils$1.toFlatObject(options2, { 21197 metaTokens: true, 21198 dots: false, 21199 indexes: false 21200 }, false, function defined(option, source) { 21201 return !utils$1.isUndefined(source[option]); 21202 }); 21203 const metaTokens = options2.metaTokens; 21204 const visitor = options2.visitor || defaultVisitor; 21205 const dots = options2.dots; 21206 const indexes = options2.indexes; 21207 const _Blob = options2.Blob || typeof Blob !== "undefined" && Blob; 21208 const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); 21209 if (!utils$1.isFunction(visitor)) { 21210 throw new TypeError("visitor must be a function"); 21211 } 21212 function convertValue(value) { 21213 if (value === null) return ""; 21214 if (utils$1.isDate(value)) { 21215 return value.toISOString(); 21216 } 21217 if (!useBlob && utils$1.isBlob(value)) { 21218 throw new AxiosError$1("Blob is not supported. Use a Buffer instead."); 21219 } 21220 if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { 21221 return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); 21222 } 21223 return value; 21224 } 21225 function defaultVisitor(value, key, path) { 21226 let arr = value; 21227 if (value && !path && typeof value === "object") { 21228 if (utils$1.endsWith(key, "{}")) { 21229 key = metaTokens ? key : key.slice(0, -2); 21230 value = JSON.stringify(value); 21231 } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) { 21232 key = removeBrackets(key); 21233 arr.forEach(function each(el, index2) { 21234 !(utils$1.isUndefined(el) || el === null) && formData.append( 21235 // eslint-disable-next-line no-nested-ternary 21236 indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]", 21237 convertValue(el) 21238 ); 21239 }); 21240 return false;
vendor: 4,760 bytes, lines 21241-21392
21241 } 21242 } 21243 if (isVisitable(value)) { 21244 return true; 21245 } 21246 formData.append(renderKey(path, key, dots), convertValue(value)); 21247 return false; 21248 } 21249 const stack = []; 21250 const exposedHelpers = Object.assign(predicates, { 21251 defaultVisitor, 21252 convertValue, 21253 isVisitable 21254 }); 21255 function build(value, path) { 21256 if (utils$1.isUndefined(value)) return; 21257 if (stack.indexOf(value) !== -1) { 21258 throw Error("Circular reference detected in " + path.join(".")); 21259 } 21260 stack.push(value); 21261 utils$1.forEach(value, function each(el, key) { 21262 const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( 21263 formData, 21264 el, 21265 utils$1.isString(key) ? key.trim() : key, 21266 path, 21267 exposedHelpers 21268 ); 21269 if (result === true) { 21270 build(el, path ? path.concat(key) : [key]); 21271 } 21272 }); 21273 stack.pop(); 21274 } 21275 if (!utils$1.isObject(obj)) { 21276 throw new TypeError("data must be an object"); 21277 } 21278 build(obj); 21279 return formData; 21280 } 21281 function encode$1(str) { 21282 const charMap = { 21283 "!": "%21", 21284 "'": "%27", 21285 "(": "%28", 21286 ")": "%29", 21287 "~": "%7E", 21288 "%20": "+", 21289 "%00": "\0" 21290 }; 21291 return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match2) { 21292 return charMap[match2]; 21293 }); 21294 } 21295 function AxiosURLSearchParams(params, options2) { 21296 this._pairs = []; 21297 params && toFormData$1(params, this, options2); 21298 } 21299 const prototype = AxiosURLSearchParams.prototype; 21300 prototype.append = function append2(name, value) { 21301 this._pairs.push([name, value]); 21302 }; 21303 prototype.toString = function toString2(encoder) { 21304 const _encode = encoder ? function(value) { 21305 return encoder.call(this, value, encode$1); 21306 } : encode$1; 21307 return this._pairs.map(function each(pair) { 21308 return _encode(pair[0]) + "=" + _encode(pair[1]); 21309 }, "").join("&"); 21310 }; 21311 function encode(val) { 21312 return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); 21313 } 21314 function buildURL(url, params, options2) { 21315 if (!params) { 21316 return url; 21317 } 21318 const _encode = options2 && options2.encode || encode; 21319 if (utils$1.isFunction(options2)) { 21320 options2 = { 21321 serialize: options2 21322 }; 21323 } 21324 const serializeFn = options2 && options2.serialize; 21325 let serializedParams; 21326 if (serializeFn) { 21327 serializedParams = serializeFn(params, options2); 21328 } else { 21329 serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options2).toString(_encode); 21330 } 21331 if (serializedParams) { 21332 const hashmarkIndex = url.indexOf("#"); 21333 if (hashmarkIndex !== -1) { 21334 url = url.slice(0, hashmarkIndex); 21335 } 21336 url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; 21337 } 21338 return url; 21339 } 21340 class InterceptorManager { 21341 constructor() { 21342 this.handlers = []; 21343 } 21344 /** 21345 * Add a new interceptor to the stack 21346 * 21347 * @param {Function} fulfilled The function to handle `then` for a `Promise` 21348 * @param {Function} rejected The function to handle `reject` for a `Promise` 21349 * 21350 * @return {Number} An ID used to remove interceptor later 21351 */ 21352 use(fulfilled, rejected, options2) { 21353 this.handlers.push({ 21354 fulfilled, 21355 rejected, 21356 synchronous: options2 ? options2.synchronous : false, 21357 runWhen: options2 ? options2.runWhen : null 21358 }); 21359 return this.handlers.length - 1; 21360 } 21361 /** 21362 * Remove an interceptor from the stack 21363 * 21364 * @param {Number} id The ID that was returned by `use` 21365 * 21366 * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise 21367 */ 21368 eject(id2) { 21369 if (this.handlers[id2]) { 21370 this.handlers[id2] = null; 21371 } 21372 } 21373 /** 21374 * Clear all interceptors from the stack 21375 * 21376 * @returns {void} 21377 */ 21378 clear() { 21379 if (this.handlers) { 21380 this.handlers = []; 21381 } 21382 } 21383 /** 21384 * Iterate over all the registered interceptors 21385 * 21386 * This method is particularly useful for skipping over any 21387 * interceptors that may have become `null` calling `eject`. 21388 * 21389 * @param {Function} fn The function to call for each interceptor 21390 * 21391 * @returns {void} 21392 */
vendor: 5,549 bytes, lines 21393-21535
21393 forEach(fn2) { 21394 utils$1.forEach(this.handlers, function forEachHandler(h2) { 21395 if (h2 !== null) { 21396 fn2(h2); 21397 } 21398 }); 21399 } 21400 } 21401 const transitionalDefaults = { 21402 silentJSONParsing: true, 21403 forcedJSONParsing: true, 21404 clarifyTimeoutError: false 21405 }; 21406 const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams; 21407 const FormData$1 = typeof FormData !== "undefined" ? FormData : null; 21408 const Blob$1 = typeof Blob !== "undefined" ? Blob : null; 21409 const platform$2 = { 21410 isBrowser: true, 21411 classes: { 21412 URLSearchParams: URLSearchParams$1, 21413 FormData: FormData$1, 21414 Blob: Blob$1 21415 }, 21416 protocols: ["http", "https", "file", "blob", "url", "data"] 21417 }; 21418 const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; 21419 const _navigator = typeof navigator === "object" && navigator || void 0; 21420 const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); 21421 const hasStandardBrowserWebWorkerEnv = (() => { 21422 return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef 21423 self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; 21424 })(); 21425 const origin = hasBrowserEnv && window.location.href || "http://localhost"; 21426 const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 21427 __proto__: null, 21428 hasBrowserEnv, 21429 hasStandardBrowserEnv, 21430 hasStandardBrowserWebWorkerEnv, 21431 navigator: _navigator, 21432 origin 21433 }, Symbol.toStringTag, { value: "Module" })); 21434 const platform$1 = __spreadValues(__spreadValues({}, utils), platform$2); 21435 function toURLEncodedForm(data, options2) { 21436 return toFormData$1(data, new platform$1.classes.URLSearchParams(), Object.assign({ 21437 visitor: function(value, key, path, helpers) { 21438 if (platform$1.isNode && utils$1.isBuffer(value)) { 21439 this.append(key, value.toString("base64")); 21440 return false; 21441 } 21442 return helpers.defaultVisitor.apply(this, arguments); 21443 } 21444 }, options2)); 21445 } 21446 function parsePropPath(name) { 21447 return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => { 21448 return match2[0] === "[]" ? "" : match2[1] || match2[0]; 21449 }); 21450 } 21451 function arrayToObject(arr) { 21452 const obj = {}; 21453 const keys2 = Object.keys(arr); 21454 let i2; 21455 const len = keys2.length; 21456 let key; 21457 for (i2 = 0; i2 < len; i2++) { 21458 key = keys2[i2]; 21459 obj[key] = arr[key]; 21460 } 21461 return obj; 21462 } 21463 function formDataToJSON(formData) { 21464 function buildPath(path, value, target, index2) { 21465 let name = path[index2++]; 21466 if (name === "__proto__") return true; 21467 const isNumericKey = Number.isFinite(+name); 21468 const isLast = index2 >= path.length; 21469 name = !name && utils$1.isArray(target) ? target.length : name; 21470 if (isLast) { 21471 if (utils$1.hasOwnProp(target, name)) { 21472 target[name] = [target[name], value]; 21473 } else { 21474 target[name] = value; 21475 } 21476 return !isNumericKey; 21477 } 21478 if (!target[name] || !utils$1.isObject(target[name])) { 21479 target[name] = []; 21480 } 21481 const result = buildPath(path, value, target[name], index2); 21482 if (result && utils$1.isArray(target[name])) { 21483 target[name] = arrayToObject(target[name]); 21484 } 21485 return !isNumericKey; 21486 } 21487 if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { 21488 const obj = {}; 21489 utils$1.forEachEntry(formData, (name, value) => { 21490 buildPath(parsePropPath(name), value, obj, 0); 21491 }); 21492 return obj; 21493 } 21494 return null; 21495 } 21496 function stringifySafely(rawValue, parser, encoder) { 21497 if (utils$1.isString(rawValue)) { 21498 try { 21499 (parser || JSON.parse)(rawValue); 21500 return utils$1.trim(rawValue); 21501 } catch (e2) { 21502 if (e2.name !== "SyntaxError") { 21503 throw e2; 21504 } 21505 } 21506 } 21507 return (encoder || JSON.stringify)(rawValue); 21508 } 21509 const defaults = { 21510 transitional: transitionalDefaults, 21511 adapter: ["xhr", "http", "fetch"], 21512 transformRequest: [function transformRequest(data, headers) { 21513 const contentType = headers.getContentType() || ""; 21514 const hasJSONContentType = contentType.indexOf("application/json") > -1; 21515 const isObjectPayload = utils$1.isObject(data); 21516 if (isObjectPayload && utils$1.isHTMLForm(data)) { 21517 data = new FormData(data); 21518 } 21519 const isFormData2 = utils$1.isFormData(data); 21520 if (isFormData2) { 21521 return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; 21522 } 21523 if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { 21524 return data; 21525 } 21526 if (utils$1.isArrayBufferView(data)) { 21527 return data.buffer; 21528 } 21529 if (utils$1.isURLSearchParams(data)) { 21530 headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); 21531 return data.toString(); 21532 } 21533 let isFileList2; 21534 if (isObjectPayload) { 21535 if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
vendor: 10,225 bytes, lines 21536-21831
21536 return toURLEncodedForm(data, this.formSerializer).toString(); 21537 } 21538 if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { 21539 const _FormData = this.env && this.env.FormData; 21540 return toFormData$1( 21541 isFileList2 ? { "files[]": data } : data, 21542 _FormData && new _FormData(), 21543 this.formSerializer 21544 ); 21545 } 21546 } 21547 if (isObjectPayload || hasJSONContentType) { 21548 headers.setContentType("application/json", false); 21549 return stringifySafely(data); 21550 } 21551 return data; 21552 }], 21553 transformResponse: [function transformResponse(data) { 21554 const transitional = this.transitional || defaults.transitional; 21555 const forcedJSONParsing = transitional && transitional.forcedJSONParsing; 21556 const JSONRequested = this.responseType === "json"; 21557 if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { 21558 return data; 21559 } 21560 if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { 21561 const silentJSONParsing = transitional && transitional.silentJSONParsing; 21562 const strictJSONParsing = !silentJSONParsing && JSONRequested; 21563 try { 21564 return JSON.parse(data); 21565 } catch (e2) { 21566 if (strictJSONParsing) { 21567 if (e2.name === "SyntaxError") { 21568 throw AxiosError$1.from(e2, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response); 21569 } 21570 throw e2; 21571 } 21572 } 21573 } 21574 return data; 21575 }], 21576 /** 21577 * A timeout in milliseconds to abort a request. If set to 0 (default) a 21578 * timeout is not created. 21579 */ 21580 timeout: 0, 21581 xsrfCookieName: "XSRF-TOKEN", 21582 xsrfHeaderName: "X-XSRF-TOKEN", 21583 maxContentLength: -1, 21584 maxBodyLength: -1, 21585 env: { 21586 FormData: platform$1.classes.FormData, 21587 Blob: platform$1.classes.Blob 21588 }, 21589 validateStatus: function validateStatus(status) { 21590 return status >= 200 && status < 300; 21591 }, 21592 headers: { 21593 common: { 21594 "Accept": "application/json, text/plain, */*", 21595 "Content-Type": void 0 21596 } 21597 } 21598 }; 21599 utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { 21600 defaults.headers[method] = {}; 21601 }); 21602 const ignoreDuplicateOf = utils$1.toObjectSet([ 21603 "age", 21604 "authorization", 21605 "content-length", 21606 "content-type", 21607 "etag", 21608 "expires", 21609 "from", 21610 "host", 21611 "if-modified-since", 21612 "if-unmodified-since", 21613 "last-modified", 21614 "location", 21615 "max-forwards", 21616 "proxy-authorization", 21617 "referer", 21618 "retry-after", 21619 "user-agent" 21620 ]); 21621 const parseHeaders = (rawHeaders) => { 21622 const parsed = {}; 21623 let key; 21624 let val; 21625 let i2; 21626 rawHeaders && rawHeaders.split("\n").forEach(function parser(line2) { 21627 i2 = line2.indexOf(":"); 21628 key = line2.substring(0, i2).trim().toLowerCase(); 21629 val = line2.substring(i2 + 1).trim(); 21630 if (!key || parsed[key] && ignoreDuplicateOf[key]) { 21631 return; 21632 } 21633 if (key === "set-cookie") { 21634 if (parsed[key]) { 21635 parsed[key].push(val); 21636 } else { 21637 parsed[key] = [val]; 21638 } 21639 } else { 21640 parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; 21641 } 21642 }); 21643 return parsed; 21644 }; 21645 const $internals = Symbol("internals"); 21646 function normalizeHeader(header) { 21647 return header && String(header).trim().toLowerCase(); 21648 } 21649 function normalizeValue(value) { 21650 if (value === false || value == null) { 21651 return value; 21652 } 21653 return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); 21654 } 21655 function parseTokens(str) { 21656 const tokens = /* @__PURE__ */ Object.create(null); 21657 const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; 21658 let match2; 21659 while (match2 = tokensRE.exec(str)) { 21660 tokens[match2[1]] = match2[2]; 21661 } 21662 return tokens; 21663 } 21664 const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); 21665 function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) { 21666 if (utils$1.isFunction(filter2)) { 21667 return filter2.call(this, value, header); 21668 } 21669 if (isHeaderNameFilter) { 21670 value = header; 21671 } 21672 if (!utils$1.isString(value)) return; 21673 if (utils$1.isString(filter2)) { 21674 return value.indexOf(filter2) !== -1; 21675 } 21676 if (utils$1.isRegExp(filter2)) { 21677 return filter2.test(value); 21678 } 21679 } 21680 function formatHeader(header) { 21681 return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char2, str) => { 21682 return char2.toUpperCase() + str; 21683 }); 21684 } 21685 function buildAccessors(obj, header) { 21686 const accessorName = utils$1.toCamelCase(" " + header); 21687 ["get", "set", "has"].forEach((methodName) => { 21688 Object.defineProperty(obj, methodName + accessorName, { 21689 value: function(arg1, arg2, arg3) { 21690 return this[methodName].call(this, header, arg1, arg2, arg3); 21691 }, 21692 configurable: true 21693 }); 21694 }); 21695 } 21696 let AxiosHeaders$1 = class AxiosHeaders { 21697 constructor(headers) { 21698 headers && this.set(headers); 21699 } 21700 set(header, valueOrRewrite, rewrite) { 21701 const self2 = this; 21702 function setHeader(_value, _header, _rewrite) { 21703 const lHeader = normalizeHeader(_header); 21704 if (!lHeader) { 21705 throw new Error("header name must be a non-empty string"); 21706 } 21707 const key = utils$1.findKey(self2, lHeader); 21708 if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { 21709 self2[key || _header] = normalizeValue(_value); 21710 } 21711 } 21712 const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); 21713 if (utils$1.isPlainObject(header) || header instanceof this.constructor) { 21714 setHeaders(header, valueOrRewrite); 21715 } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { 21716 setHeaders(parseHeaders(header), valueOrRewrite); 21717 } else if (utils$1.isHeaders(header)) { 21718 for (const [key, value] of header.entries()) { 21719 setHeader(value, key, rewrite); 21720 } 21721 } else { 21722 header != null && setHeader(valueOrRewrite, header, rewrite); 21723 } 21724 return this; 21725 } 21726 get(header, parser) { 21727 header = normalizeHeader(header); 21728 if (header) { 21729 const key = utils$1.findKey(this, header); 21730 if (key) { 21731 const value = this[key]; 21732 if (!parser) { 21733 return value; 21734 } 21735 if (parser === true) { 21736 return parseTokens(value); 21737 } 21738 if (utils$1.isFunction(parser)) { 21739 return parser.call(this, value, key); 21740 } 21741 if (utils$1.isRegExp(parser)) { 21742 return parser.exec(value); 21743 } 21744 throw new TypeError("parser must be boolean|regexp|function"); 21745 } 21746 } 21747 } 21748 has(header, matcher) { 21749 header = normalizeHeader(header); 21750 if (header) { 21751 const key = utils$1.findKey(this, header); 21752 return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); 21753 } 21754 return false; 21755 } 21756 delete(header, matcher) { 21757 const self2 = this; 21758 let deleted = false; 21759 function deleteHeader(_header) { 21760 _header = normalizeHeader(_header); 21761 if (_header) { 21762 const key = utils$1.findKey(self2, _header); 21763 if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { 21764 delete self2[key]; 21765 deleted = true; 21766 } 21767 } 21768 } 21769 if (utils$1.isArray(header)) { 21770 header.forEach(deleteHeader); 21771 } else { 21772 deleteHeader(header); 21773 } 21774 return deleted; 21775 } 21776 clear(matcher) { 21777 const keys2 = Object.keys(this); 21778 let i2 = keys2.length; 21779 let deleted = false; 21780 while (i2--) { 21781 const key = keys2[i2]; 21782 if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { 21783 delete this[key]; 21784 deleted = true; 21785 } 21786 } 21787 return deleted; 21788 } 21789 normalize(format) { 21790 const self2 = this; 21791 const headers = {}; 21792 utils$1.forEach(this, (value, header) => { 21793 const key = utils$1.findKey(headers, header); 21794 if (key) { 21795 self2[key] = normalizeValue(value); 21796 delete self2[header]; 21797 return; 21798 } 21799 const normalized = format ? formatHeader(header) : String(header).trim(); 21800 if (normalized !== header) { 21801 delete self2[header]; 21802 } 21803 self2[normalized] = normalizeValue(value); 21804 headers[normalized] = true; 21805 }); 21806 return this; 21807 } 21808 concat(...targets) { 21809 return this.constructor.concat(this, ...targets); 21810 } 21811 toJSON(asStrings) { 21812 const obj = /* @__PURE__ */ Object.create(null); 21813 utils$1.forEach(this, (value, header) => { 21814 value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value); 21815 }); 21816 return obj; 21817 } 21818 [Symbol.iterator]() { 21819 return Object.entries(this.toJSON())[Symbol.iterator](); 21820 } 21821 toString() { 21822 return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); 21823 } 21824 get [Symbol.toStringTag]() { 21825 return "AxiosHeaders"; 21826 } 21827 static from(thing) { 21828 return thing instanceof this ? thing : new this(thing); 21829 } 21830 static concat(first, ...targets) { 21831 const computed = new this(first);
vendor: 4,336 bytes, lines 21832-21958
21832 targets.forEach((target) => computed.set(target)); 21833 return computed; 21834 } 21835 static accessor(header) { 21836 const internals = this[$internals] = this[$internals] = { 21837 accessors: {} 21838 }; 21839 const accessors = internals.accessors; 21840 const prototype2 = this.prototype; 21841 function defineAccessor(_header) { 21842 const lHeader = normalizeHeader(_header); 21843 if (!accessors[lHeader]) { 21844 buildAccessors(prototype2, _header); 21845 accessors[lHeader] = true; 21846 } 21847 } 21848 utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); 21849 return this; 21850 } 21851 }; 21852 AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); 21853 utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => { 21854 let mapped = key[0].toUpperCase() + key.slice(1); 21855 return { 21856 get: () => value, 21857 set(headerValue) { 21858 this[mapped] = headerValue; 21859 } 21860 }; 21861 }); 21862 utils$1.freezeMethods(AxiosHeaders$1); 21863 function transformData(fns, response) { 21864 const config = this || defaults; 21865 const context = response || config; 21866 const headers = AxiosHeaders$1.from(context.headers); 21867 let data = context.data; 21868 utils$1.forEach(fns, function transform2(fn2) { 21869 data = fn2.call(config, data, headers.normalize(), response ? response.status : void 0); 21870 }); 21871 headers.normalize(); 21872 return data; 21873 } 21874 function isCancel$1(value) { 21875 return !!(value && value.__CANCEL__); 21876 } 21877 function CanceledError$1(message, config, request) { 21878 AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request); 21879 this.name = "CanceledError"; 21880 } 21881 utils$1.inherits(CanceledError$1, AxiosError$1, { 21882 __CANCEL__: true 21883 }); 21884 function settle(resolve, reject, response) { 21885 const validateStatus = response.config.validateStatus; 21886 if (!response.status || !validateStatus || validateStatus(response.status)) { 21887 resolve(response); 21888 } else { 21889 reject(new AxiosError$1( 21890 "Request failed with status code " + response.status, 21891 [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], 21892 response.config, 21893 response.request, 21894 response 21895 )); 21896 } 21897 } 21898 function parseProtocol(url) { 21899 const match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); 21900 return match2 && match2[1] || ""; 21901 } 21902 function speedometer(samplesCount, min2) { 21903 samplesCount = samplesCount || 10; 21904 const bytes = new Array(samplesCount); 21905 const timestamps = new Array(samplesCount); 21906 let head = 0; 21907 let tail = 0; 21908 let firstSampleTS; 21909 min2 = min2 !== void 0 ? min2 : 1e3; 21910 return function push(chunkLength) { 21911 const now2 = Date.now(); 21912 const startedAt = timestamps[tail]; 21913 if (!firstSampleTS) { 21914 firstSampleTS = now2; 21915 } 21916 bytes[head] = chunkLength; 21917 timestamps[head] = now2; 21918 let i2 = tail; 21919 let bytesCount = 0; 21920 while (i2 !== head) { 21921 bytesCount += bytes[i2++]; 21922 i2 = i2 % samplesCount; 21923 } 21924 head = (head + 1) % samplesCount; 21925 if (head === tail) { 21926 tail = (tail + 1) % samplesCount; 21927 } 21928 if (now2 - firstSampleTS < min2) { 21929 return; 21930 } 21931 const passed = startedAt && now2 - startedAt; 21932 return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; 21933 }; 21934 } 21935 function throttle(fn2, freq) { 21936 let timestamp = 0; 21937 let threshold = 1e3 / freq; 21938 let lastArgs; 21939 let timer; 21940 const invoke = (args, now2 = Date.now()) => { 21941 timestamp = now2; 21942 lastArgs = null; 21943 if (timer) { 21944 clearTimeout(timer); 21945 timer = null; 21946 } 21947 fn2.apply(null, args); 21948 }; 21949 const throttled = (...args) => { 21950 const now2 = Date.now(); 21951 const passed = now2 - timestamp; 21952 if (passed >= threshold) { 21953 invoke(args, now2); 21954 } else { 21955 lastArgs = args; 21956 if (!timer) { 21957 timer = setTimeout(() => { 21958 timer = null;
vendor: 5,696 bytes, lines 21959-22109
21959 invoke(lastArgs); 21960 }, threshold - passed); 21961 } 21962 } 21963 }; 21964 const flush = () => lastArgs && invoke(lastArgs); 21965 return [throttled, flush]; 21966 } 21967 const progressEventReducer = (listener, isDownloadStream, freq = 3) => { 21968 let bytesNotified = 0; 21969 const _speedometer = speedometer(50, 250); 21970 return throttle((e2) => { 21971 const loaded = e2.loaded; 21972 const total = e2.lengthComputable ? e2.total : void 0; 21973 const progressBytes = loaded - bytesNotified; 21974 const rate = _speedometer(progressBytes); 21975 const inRange = loaded <= total; 21976 bytesNotified = loaded; 21977 const data = { 21978 loaded, 21979 total, 21980 progress: total ? loaded / total : void 0, 21981 bytes: progressBytes, 21982 rate: rate ? rate : void 0, 21983 estimated: rate && total && inRange ? (total - loaded) / rate : void 0, 21984 event: e2, 21985 lengthComputable: total != null, 21986 [isDownloadStream ? "download" : "upload"]: true 21987 }; 21988 listener(data); 21989 }, freq); 21990 }; 21991 const progressEventDecorator = (total, throttled) => { 21992 const lengthComputable = total != null; 21993 return [(loaded) => throttled[0]({ 21994 lengthComputable, 21995 total, 21996 loaded 21997 }), throttled[1]]; 21998 }; 21999 const asyncDecorator = (fn2) => (...args) => utils$1.asap(() => fn2(...args)); 22000 const isURLSameOrigin = platform$1.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => { 22001 url = new URL(url, platform$1.origin); 22002 return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port); 22003 })( 22004 new URL(platform$1.origin), 22005 platform$1.navigator && /(msie|trident)/i.test(platform$1.navigator.userAgent) 22006 ) : () => true; 22007 const cookies = platform$1.hasStandardBrowserEnv ? ( 22008 // Standard browser envs support document.cookie 22009 { 22010 write(name, value, expires, path, domain, secure) { 22011 const cookie = [name + "=" + encodeURIComponent(value)]; 22012 utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString()); 22013 utils$1.isString(path) && cookie.push("path=" + path); 22014 utils$1.isString(domain) && cookie.push("domain=" + domain); 22015 secure === true && cookie.push("secure"); 22016 document.cookie = cookie.join("; "); 22017 }, 22018 read(name) { 22019 const match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); 22020 return match2 ? decodeURIComponent(match2[3]) : null; 22021 }, 22022 remove(name) { 22023 this.write(name, "", Date.now() - 864e5); 22024 } 22025 } 22026 ) : ( 22027 // Non-standard browser env (web workers, react-native) lack needed support. 22028 { 22029 write() { 22030 }, 22031 read() { 22032 return null; 22033 }, 22034 remove() { 22035 } 22036 } 22037 ); 22038 function isAbsoluteURL(url) { 22039 return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); 22040 } 22041 function combineURLs(baseURL, relativeURL) { 22042 return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; 22043 } 22044 function buildFullPath(baseURL, requestedURL) { 22045 if (baseURL && !isAbsoluteURL(requestedURL)) { 22046 return combineURLs(baseURL, requestedURL); 22047 } 22048 return requestedURL; 22049 } 22050 const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? __spreadValues({}, thing) : thing; 22051 function mergeConfig$1(config1, config2) { 22052 config2 = config2 || {}; 22053 const config = {}; 22054 function getMergedValue(target, source, prop, caseless) { 22055 if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { 22056 return utils$1.merge.call({ caseless }, target, source); 22057 } else if (utils$1.isPlainObject(source)) { 22058 return utils$1.merge({}, source); 22059 } else if (utils$1.isArray(source)) { 22060 return source.slice(); 22061 } 22062 return source; 22063 } 22064 function mergeDeepProperties(a2, b2, prop, caseless) { 22065 if (!utils$1.isUndefined(b2)) { 22066 return getMergedValue(a2, b2, prop, caseless); 22067 } else if (!utils$1.isUndefined(a2)) { 22068 return getMergedValue(void 0, a2, prop, caseless); 22069 } 22070 } 22071 function valueFromConfig2(a2, b2) { 22072 if (!utils$1.isUndefined(b2)) { 22073 return getMergedValue(void 0, b2); 22074 } 22075 } 22076 function defaultToConfig2(a2, b2) { 22077 if (!utils$1.isUndefined(b2)) { 22078 return getMergedValue(void 0, b2); 22079 } else if (!utils$1.isUndefined(a2)) { 22080 return getMergedValue(void 0, a2); 22081 } 22082 } 22083 function mergeDirectKeys(a2, b2, prop) { 22084 if (prop in config2) { 22085 return getMergedValue(a2, b2); 22086 } else if (prop in config1) { 22087 return getMergedValue(void 0, a2); 22088 } 22089 } 22090 const mergeMap = { 22091 url: valueFromConfig2, 22092 method: valueFromConfig2, 22093 data: valueFromConfig2, 22094 baseURL: defaultToConfig2, 22095 transformRequest: defaultToConfig2, 22096 transformResponse: defaultToConfig2, 22097 paramsSerializer: defaultToConfig2, 22098 timeout: defaultToConfig2, 22099 timeoutMessage: defaultToConfig2, 22100 withCredentials: defaultToConfig2, 22101 withXSRFToken: defaultToConfig2, 22102 adapter: defaultToConfig2, 22103 responseType: defaultToConfig2, 22104 xsrfCookieName: defaultToConfig2, 22105 xsrfHeaderName: defaultToConfig2, 22106 onUploadProgress: defaultToConfig2, 22107 onDownloadProgress: defaultToConfig2, 22108 decompress: defaultToConfig2, 22109 maxContentLength: defaultToConfig2,
vendor: 5,911 bytes, lines 22110-22242
22110 maxBodyLength: defaultToConfig2, 22111 beforeRedirect: defaultToConfig2, 22112 transport: defaultToConfig2, 22113 httpAgent: defaultToConfig2, 22114 httpsAgent: defaultToConfig2, 22115 cancelToken: defaultToConfig2, 22116 socketPath: defaultToConfig2, 22117 responseEncoding: defaultToConfig2, 22118 validateStatus: mergeDirectKeys, 22119 headers: (a2, b2, prop) => mergeDeepProperties(headersToObject(a2), headersToObject(b2), prop, true) 22120 }; 22121 utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { 22122 const merge2 = mergeMap[prop] || mergeDeepProperties; 22123 const configValue = merge2(config1[prop], config2[prop], prop); 22124 utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); 22125 }); 22126 return config; 22127 } 22128 const resolveConfig = (config) => { 22129 const newConfig = mergeConfig$1({}, config); 22130 let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; 22131 newConfig.headers = headers = AxiosHeaders$1.from(headers); 22132 newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer); 22133 if (auth) { 22134 headers.set( 22135 "Authorization", 22136 "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) 22137 ); 22138 } 22139 let contentType; 22140 if (utils$1.isFormData(data)) { 22141 if (platform$1.hasStandardBrowserEnv || platform$1.hasStandardBrowserWebWorkerEnv) { 22142 headers.setContentType(void 0); 22143 } else if ((contentType = headers.getContentType()) !== false) { 22144 const [type, ...tokens] = contentType ? contentType.split(";").map((token2) => token2.trim()).filter(Boolean) : []; 22145 headers.setContentType([type || "multipart/form-data", ...tokens].join("; ")); 22146 } 22147 } 22148 if (platform$1.hasStandardBrowserEnv) { 22149 withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); 22150 if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { 22151 const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); 22152 if (xsrfValue) { 22153 headers.set(xsrfHeaderName, xsrfValue); 22154 } 22155 } 22156 } 22157 return newConfig; 22158 }; 22159 const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; 22160 const xhrAdapter = isXHRAdapterSupported && function(config) { 22161 return new Promise(function dispatchXhrRequest(resolve, reject) { 22162 const _config = resolveConfig(config); 22163 let requestData = _config.data; 22164 const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); 22165 let { responseType, onUploadProgress, onDownloadProgress } = _config; 22166 let onCanceled; 22167 let uploadThrottled, downloadThrottled; 22168 let flushUpload, flushDownload; 22169 function done() { 22170 flushUpload && flushUpload(); 22171 flushDownload && flushDownload(); 22172 _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); 22173 _config.signal && _config.signal.removeEventListener("abort", onCanceled); 22174 } 22175 let request = new XMLHttpRequest(); 22176 request.open(_config.method.toUpperCase(), _config.url, true); 22177 request.timeout = _config.timeout; 22178 function onloadend() { 22179 if (!request) { 22180 return; 22181 } 22182 const responseHeaders = AxiosHeaders$1.from( 22183 "getAllResponseHeaders" in request && request.getAllResponseHeaders() 22184 ); 22185 const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; 22186 const response = { 22187 data: responseData, 22188 status: request.status, 22189 statusText: request.statusText, 22190 headers: responseHeaders, 22191 config, 22192 request 22193 }; 22194 settle(function _resolve(value) { 22195 resolve(value); 22196 done(); 22197 }, function _reject(err) { 22198 reject(err); 22199 done(); 22200 }, response); 22201 request = null; 22202 } 22203 if ("onloadend" in request) { 22204 request.onloadend = onloadend; 22205 } else { 22206 request.onreadystatechange = function handleLoad() { 22207 if (!request || request.readyState !== 4) { 22208 return; 22209 } 22210 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { 22211 return; 22212 } 22213 setTimeout(onloadend); 22214 }; 22215 } 22216 request.onabort = function handleAbort() { 22217 if (!request) { 22218 return; 22219 } 22220 reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request)); 22221 request = null; 22222 }; 22223 request.onerror = function handleError() { 22224 reject(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request)); 22225 request = null; 22226 }; 22227 request.ontimeout = function handleTimeout() { 22228 let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; 22229 const transitional = _config.transitional || transitionalDefaults; 22230 if (_config.timeoutErrorMessage) { 22231 timeoutErrorMessage = _config.timeoutErrorMessage; 22232 } 22233 reject(new AxiosError$1( 22234 timeoutErrorMessage, 22235 transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, 22236 config, 22237 request 22238 )); 22239 request = null; 22240 }; 22241 requestData === void 0 && requestHeaders.setContentType(null); 22242 if ("setRequestHeader" in request) {
vendor: 6,127 bytes, lines 22243-22412
22243 utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { 22244 request.setRequestHeader(key, val); 22245 }); 22246 } 22247 if (!utils$1.isUndefined(_config.withCredentials)) { 22248 request.withCredentials = !!_config.withCredentials; 22249 } 22250 if (responseType && responseType !== "json") { 22251 request.responseType = _config.responseType; 22252 } 22253 if (onDownloadProgress) { 22254 [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); 22255 request.addEventListener("progress", downloadThrottled); 22256 } 22257 if (onUploadProgress && request.upload) { 22258 [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); 22259 request.upload.addEventListener("progress", uploadThrottled); 22260 request.upload.addEventListener("loadend", flushUpload); 22261 } 22262 if (_config.cancelToken || _config.signal) { 22263 onCanceled = (cancel) => { 22264 if (!request) { 22265 return; 22266 } 22267 reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel); 22268 request.abort(); 22269 request = null; 22270 }; 22271 _config.cancelToken && _config.cancelToken.subscribe(onCanceled); 22272 if (_config.signal) { 22273 _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); 22274 } 22275 } 22276 const protocol = parseProtocol(_config.url); 22277 if (protocol && platform$1.protocols.indexOf(protocol) === -1) { 22278 reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config)); 22279 return; 22280 } 22281 request.send(requestData || null); 22282 }); 22283 }; 22284 const composeSignals = (signals, timeout) => { 22285 const { length: length2 } = signals = signals ? signals.filter(Boolean) : []; 22286 if (timeout || length2) { 22287 let controller = new AbortController(); 22288 let aborted; 22289 const onabort = function(reason) { 22290 if (!aborted) { 22291 aborted = true; 22292 unsubscribe(); 22293 const err = reason instanceof Error ? reason : this.reason; 22294 controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)); 22295 } 22296 }; 22297 let timer = timeout && setTimeout(() => { 22298 timer = null; 22299 onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT)); 22300 }, timeout); 22301 const unsubscribe = () => { 22302 if (signals) { 22303 timer && clearTimeout(timer); 22304 timer = null; 22305 signals.forEach((signal2) => { 22306 signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); 22307 }); 22308 signals = null; 22309 } 22310 }; 22311 signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); 22312 const { signal } = controller; 22313 signal.unsubscribe = () => utils$1.asap(unsubscribe); 22314 return signal; 22315 } 22316 }; 22317 const streamChunk = function* (chunk, chunkSize) { 22318 let len = chunk.byteLength; 22319 if (len < chunkSize) { 22320 yield chunk; 22321 return; 22322 } 22323 let pos = 0; 22324 let end; 22325 while (pos < len) { 22326 end = pos + chunkSize; 22327 yield chunk.slice(pos, end); 22328 pos = end; 22329 } 22330 }; 22331 const readBytes = function(iterable, chunkSize) { 22332 return __asyncGenerator(this, null, function* () { 22333 try { 22334 for (var iter = __forAwait(readStream(iterable)), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 22335 const chunk = temp.value; 22336 yield* __yieldStar(streamChunk(chunk, chunkSize)); 22337 } 22338 } catch (temp) { 22339 error = [temp]; 22340 } finally { 22341 try { 22342 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 22343 } finally { 22344 if (error) 22345 throw error[0]; 22346 } 22347 } 22348 }); 22349 }; 22350 const readStream = function(stream) { 22351 return __asyncGenerator(this, null, function* () { 22352 if (stream[Symbol.asyncIterator]) { 22353 yield* __yieldStar(stream); 22354 return; 22355 } 22356 const reader = stream.getReader(); 22357 try { 22358 for (; ; ) { 22359 const { done, value } = yield new __await(reader.read()); 22360 if (done) { 22361 break; 22362 } 22363 yield value; 22364 } 22365 } finally { 22366 yield new __await(reader.cancel()); 22367 } 22368 }); 22369 }; 22370 const trackStream = (stream, chunkSize, onProgress, onFinish) => { 22371 const iterator = readBytes(stream, chunkSize); 22372 let bytes = 0; 22373 let done; 22374 let _onFinish = (e2) => { 22375 if (!done) { 22376 done = true; 22377 onFinish && onFinish(e2); 22378 } 22379 }; 22380 return new ReadableStream({ 22381 pull(controller) { 22382 return __async(this, null, function* () { 22383 try { 22384 const { done: done2, value } = yield iterator.next(); 22385 if (done2) { 22386 _onFinish(); 22387 controller.close(); 22388 return; 22389 } 22390 let len = value.byteLength; 22391 if (onProgress) { 22392 let loadedBytes = bytes += len; 22393 onProgress(loadedBytes); 22394 } 22395 controller.enqueue(new Uint8Array(value)); 22396 } catch (err) { 22397 _onFinish(err); 22398 throw err; 22399 } 22400 }); 22401 }, 22402 cancel(reason) { 22403 _onFinish(reason); 22404 return iterator.return(); 22405 } 22406 }, { 22407 highWaterMark: 2 22408 }); 22409 }; 22410 const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function"; 22411 const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function"; 22412 const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__P
22412URE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : (str) => __async(null, null, function* () { 22413 return new Uint8Array(yield new Response(str).arrayBuffer()); 22414 })); 22415 const test$1 = (fn2, ...args) => { 22416 try { 22417 return !!fn2(...args); 22418 } catch (e2) { 22419 return false; 22420 } 22421 }; 22422 const supportsRequestStream = isReadableStreamSupported && test$1(() => { 22423 let duplexAccessed = false; 22424 const hasContentType = new Request(platform$1.origin, { 22425 body: new ReadableStream(), 22426 method: "POST", 22427 get duplex() { 22428 duplexAccessed = true; 22429 return "half"; 22430 } 22431 }).headers.has("Content-Type"); 22432 return duplexAccessed && !hasContentType; 22433 }); 22434 const DEFAULT_CHUNK_SIZE = 64 * 1024; 22435 const supportsResponseStream = isReadableStreamSupported && test$1(() => utils$1.isReadableStream(new Response("").body)); 22436 const resolvers = { 22437 stream: supportsResponseStream && ((res) => res.body) 22438 }; 22439 isFetchSupported && ((res) => { 22440 ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { 22441 !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_2, config) => { 22442 throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config); 22443 }); 22444 }); 22445 })(new Response()); 22446 const getBodyLength = (body) => __async(null, null, function* () { 22447 if (body == null) { 22448 return 0; 22449 } 22450 if (utils$1.isBlob(body)) { 22451 return body.size; 22452 } 22453 if (utils$1.isSpecCompliantForm(body)) { 22454 const _request = new Request(platform$1.origin, { 22455 method: "POST", 22456 body 22457 }); 22458 return (yield _request.arrayBuffer()).byteLength; 22459 } 22460 if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { 22461 return body.byteLength; 22462 } 22463 if (utils$1.isURLSearchParams(body)) { 22464 body = body + ""; 22465 } 22466 if (utils$1.isString(body)) { 22467 return (yield encodeText(body)).byteLength; 22468 } 22469 }); 22470 const resolveBodyLength = (headers, body) => __async(null, null, function* () { 22471 const length2 = utils$1.toFiniteNumber(headers.getContentLength()); 22472 return length2 == null ? getBodyLength(body) : length2; 22473 }); 22474 const fetchAdapter = isFetchSupported && ((config) => __async(null, null, function* () { 22475 let { 22476 url, 22477 method, 22478 data, 22479 signal, 22480 cancelToken, 22481 timeout, 22482 onDownloadProgress, 22483 onUploadProgress, 22484 responseType, 22485 headers, 22486 withCredentials = "same-origin", 22487 fetchOptions 22488 } = resolveConfig(config); 22489 responseType = responseType ? (responseType + "").toLowerCase() : "text"; 22490 let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); 22491 let request; 22492 const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { 22493 composedSignal.unsubscribe(); 22494 }); 22495 let requestContentLength;
vendor: 18,793 bytes, lines 22496-23010
22496 try { 22497 if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = yield resolveBodyLength(headers, data)) !== 0) { 22498 let _request = new Request(url, { 22499 method: "POST", 22500 body: data, 22501 duplex: "half" 22502 }); 22503 let contentTypeHeader; 22504 if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { 22505 headers.setContentType(contentTypeHeader); 22506 } 22507 if (_request.body) { 22508 const [onProgress, flush] = progressEventDecorator( 22509 requestContentLength, 22510 progressEventReducer(asyncDecorator(onUploadProgress)) 22511 ); 22512 data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); 22513 } 22514 } 22515 if (!utils$1.isString(withCredentials)) { 22516 withCredentials = withCredentials ? "include" : "omit"; 22517 } 22518 const isCredentialsSupported = "credentials" in Request.prototype; 22519 request = new Request(url, __spreadProps(__spreadValues({}, fetchOptions), { 22520 signal: composedSignal, 22521 method: method.toUpperCase(), 22522 headers: headers.normalize().toJSON(), 22523 body: data, 22524 duplex: "half", 22525 credentials: isCredentialsSupported ? withCredentials : void 0 22526 })); 22527 let response = yield fetch(request); 22528 const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); 22529 if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { 22530 const options2 = {}; 22531 ["status", "statusText", "headers"].forEach((prop) => { 22532 options2[prop] = response[prop]; 22533 }); 22534 const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length")); 22535 const [onProgress, flush] = onDownloadProgress && progressEventDecorator( 22536 responseContentLength, 22537 progressEventReducer(asyncDecorator(onDownloadProgress), true) 22538 ) || []; 22539 response = new Response( 22540 trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { 22541 flush && flush(); 22542 unsubscribe && unsubscribe(); 22543 }), 22544 options2 22545 ); 22546 } 22547 responseType = responseType || "text"; 22548 let responseData = yield resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config); 22549 !isStreamResponse && unsubscribe && unsubscribe(); 22550 return yield new Promise((resolve, reject) => { 22551 settle(resolve, reject, { 22552 data: responseData, 22553 headers: AxiosHeaders$1.from(response.headers), 22554 status: response.status, 22555 statusText: response.statusText, 22556 config, 22557 request 22558 }); 22559 }); 22560 } catch (err) { 22561 unsubscribe && unsubscribe(); 22562 if (err && err.name === "TypeError" && /fetch/i.test(err.message)) { 22563 throw Object.assign( 22564 new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request), 22565 { 22566 cause: err.cause || err 22567 } 22568 ); 22569 } 22570 throw AxiosError$1.from(err, err && err.code, config, request); 22571 } 22572 })); 22573 const knownAdapters = { 22574 http: httpAdapter, 22575 xhr: xhrAdapter, 22576 fetch: fetchAdapter 22577 }; 22578 utils$1.forEach(knownAdapters, (fn2, value) => { 22579 if (fn2) { 22580 try { 22581 Object.defineProperty(fn2, "name", { value }); 22582 } catch (e2) { 22583 } 22584 Object.defineProperty(fn2, "adapterName", { value }); 22585 } 22586 }); 22587 const renderReason = (reason) => `- ${reason}`; 22588 const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; 22589 const adapters = { 22590 getAdapter: (adapters2) => { 22591 adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2]; 22592 const { length: length2 } = adapters2; 22593 let nameOrAdapter; 22594 let adapter; 22595 const rejectedReasons = {}; 22596 for (let i2 = 0; i2 < length2; i2++) { 22597 nameOrAdapter = adapters2[i2]; 22598 let id2; 22599 adapter = nameOrAdapter; 22600 if (!isResolvedHandle(nameOrAdapter)) { 22601 adapter = knownAdapters[(id2 = String(nameOrAdapter)).toLowerCase()]; 22602 if (adapter === void 0) { 22603 throw new AxiosError$1(`Unknown adapter '${id2}'`); 22604 } 22605 } 22606 if (adapter) { 22607 break; 22608 } 22609 rejectedReasons[id2 || "#" + i2] = adapter; 22610 } 22611 if (!adapter) { 22612 const reasons = Object.entries(rejectedReasons).map( 22613 ([id2, state]) => `adapter ${id2} ` + (state === false ? "is not supported by the environment" : "is not available in the build") 22614 ); 22615 let s2 = length2 ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; 22616 throw new AxiosError$1( 22617 `There is no suitable adapter to dispatch the request ` + s2, 22618 "ERR_NOT_SUPPORT" 22619 ); 22620 } 22621 return adapter; 22622 }, 22623 adapters: knownAdapters 22624 }; 22625 function throwIfCancellationRequested(config) { 22626 if (config.cancelToken) { 22627 config.cancelToken.throwIfRequested(); 22628 } 22629 if (config.signal && config.signal.aborted) { 22630 throw new CanceledError$1(null, config); 22631 } 22632 } 22633 function dispatchRequest(config) { 22634 throwIfCancellationRequested(config); 22635 config.headers = AxiosHeaders$1.from(config.headers); 22636 config.data = transformData.call( 22637 config, 22638 config.transformRequest 22639 ); 22640 if (["post", "put", "patch"].indexOf(config.method) !== -1) { 22641 config.headers.setContentType("application/x-www-form-urlencoded", false); 22642 } 22643 const adapter = adapters.getAdapter(config.adapter || defaults.adapter); 22644 return adapter(config).then(function onAdapterResolution(response) { 22645 throwIfCancellationRequested(config); 22646 response.data = transformData.call( 22647 config, 22648 config.transformResponse, 22649 response 22650 ); 22651 response.headers = AxiosHeaders$1.from(response.headers); 22652 return response; 22653 }, function onAdapterRejection(reason) { 22654 if (!isCancel$1(reason)) { 22655 throwIfCancellationRequested(config); 22656 if (reason && reason.response) { 22657 reason.response.data = transformData.call( 22658 config, 22659 config.transformResponse, 22660 reason.response 22661 ); 22662 reason.response.headers = AxiosHeaders$1.from(reason.response.headers); 22663 } 22664 } 22665 return Promise.reject(reason); 22666 }); 22667 } 22668 const VERSION$1 = "1.7.9"; 22669 const validators$1 = {}; 22670 ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i2) => { 22671 validators$1[type] = function validator2(thing) { 22672 return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type; 22673 }; 22674 }); 22675 const deprecatedWarnings = {}; 22676 validators$1.transitional = function transitional(validator2, version, message) { 22677 function formatMessage(opt, desc) { 22678 return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); 22679 } 22680 return (value, opt, opts) => { 22681 if (validator2 === false) { 22682 throw new AxiosError$1( 22683 formatMessage(opt, " has been removed" + (version ? " in " + version : "")), 22684 AxiosError$1.ERR_DEPRECATED 22685 ); 22686 } 22687 if (version && !deprecatedWarnings[opt]) { 22688 deprecatedWarnings[opt] = true; 22689 console.warn( 22690 formatMessage( 22691 opt, 22692 " has been deprecated since v" + version + " and will be removed in the near future" 22693 ) 22694 ); 22695 } 22696 return validator2 ? validator2(value, opt, opts) : true; 22697 }; 22698 }; 22699 validators$1.spelling = function spelling(correctSpelling) { 22700 return (value, opt) => { 22701 console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); 22702 return true; 22703 }; 22704 }; 22705 function assertOptions(options2, schema, allowUnknown) { 22706 if (typeof options2 !== "object") { 22707 throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE); 22708 } 22709 const keys2 = Object.keys(options2); 22710 let i2 = keys2.length; 22711 while (i2-- > 0) { 22712 const opt = keys2[i2]; 22713 const validator2 = schema[opt]; 22714 if (validator2) { 22715 const value = options2[opt]; 22716 const result = value === void 0 || validator2(value, opt, options2); 22717 if (result !== true) { 22718 throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE); 22719 } 22720 continue; 22721 } 22722 if (allowUnknown !== true) { 22723 throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION); 22724 } 22725 } 22726 } 22727 const validator = { 22728 assertOptions, 22729 validators: validators$1 22730 }; 22731 const validators = validator.validators; 22732 let Axios$1 = class Axios { 22733 constructor(instanceConfig) { 22734 this.defaults = instanceConfig; 22735 this.interceptors = { 22736 request: new InterceptorManager(), 22737 response: new InterceptorManager() 22738 }; 22739 } 22740 /** 22741 * Dispatch a request 22742 * 22743 * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) 22744 * @param {?Object} config 22745 * 22746 * @returns {Promise} The Promise to be fulfilled 22747 */ 22748 request(configOrUrl, config) { 22749 return __async(this, null, function* () { 22750 try { 22751 return yield this._request(configOrUrl, config); 22752 } catch (err) { 22753 if (err instanceof Error) { 22754 let dummy = {}; 22755 Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); 22756 const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; 22757 try { 22758 if (!err.stack) { 22759 err.stack = stack; 22760 } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { 22761 err.stack += "\n" + stack; 22762 } 22763 } catch (e2) { 22764 } 22765 } 22766 throw err; 22767 } 22768 }); 22769 } 22770 _request(configOrUrl, config) { 22771 if (typeof configOrUrl === "string") { 22772 config = config || {}; 22773 config.url = configOrUrl; 22774 } else { 22775 config = configOrUrl || {}; 22776 } 22777 config = mergeConfig$1(this.defaults, config); 22778 const { transitional, paramsSerializer, headers } = config; 22779 if (transitional !== void 0) { 22780 validator.assertOptions(transitional, { 22781 silentJSONParsing: validators.transitional(validators.boolean), 22782 forcedJSONParsing: validators.transitional(validators.boolean), 22783 clarifyTimeoutError: validators.transitional(validators.boolean) 22784 }, false); 22785 } 22786 if (paramsSerializer != null) { 22787 if (utils$1.isFunction(paramsSerializer)) { 22788 config.paramsSerializer = { 22789 serialize: paramsSerializer 22790 }; 22791 } else { 22792 validator.assertOptions(paramsSerializer, { 22793 encode: validators.function, 22794 serialize: validators.function 22795 }, true); 22796 } 22797 } 22798 validator.assertOptions(config, { 22799 baseUrl: validators.spelling("baseURL"), 22800 withXsrfToken: validators.spelling("withXSRFToken") 22801 }, true); 22802 config.method = (config.method || this.defaults.method || "get").toLowerCase(); 22803 let contextHeaders = headers && utils$1.merge( 22804 headers.common, 22805 headers[config.method] 22806 ); 22807 headers && utils$1.forEach( 22808 ["delete", "get", "head", "post", "put", "patch", "common"], 22809 (method) => { 22810 delete headers[method]; 22811 } 22812 ); 22813 config.headers = AxiosHeaders$1.concat(contextHeaders, headers); 22814 const requestInterceptorChain = []; 22815 let synchronousRequestInterceptors = true; 22816 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 22817 if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { 22818 return; 22819 } 22820 synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; 22821 requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); 22822 }); 22823 const responseInterceptorChain = []; 22824 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 22825 responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); 22826 }); 22827 let promise; 22828 let i2 = 0; 22829 let len; 22830 if (!synchronousRequestInterceptors) { 22831 const chain = [dispatchRequest.bind(this), void 0]; 22832 chain.unshift.apply(chain, requestInterceptorChain); 22833 chain.push.apply(chain, responseInterceptorChain); 22834 len = chain.length; 22835 promise = Promise.resolve(config); 22836 while (i2 < len) { 22837 promise = promise.then(chain[i2++], chain[i2++]); 22838 } 22839 return promise; 22840 } 22841 len = requestInterceptorChain.length; 22842 let newConfig = config; 22843 i2 = 0; 22844 while (i2 < len) { 22845 const onFulfilled = requestInterceptorChain[i2++]; 22846 const onRejected = requestInterceptorChain[i2++]; 22847 try { 22848 newConfig = onFulfilled(newConfig); 22849 } catch (error) { 22850 onRejected.call(this, error); 22851 break; 22852 } 22853 } 22854 try { 22855 promise = dispatchRequest.call(this, newConfig); 22856 } catch (error) { 22857 return Promise.reject(error); 22858 } 22859 i2 = 0; 22860 len = responseInterceptorChain.length; 22861 while (i2 < len) { 22862 promise = promise.then(responseInterceptorChain[i2++], responseInterceptorChain[i2++]); 22863 } 22864 return promise; 22865 } 22866 getUri(config) { 22867 config = mergeConfig$1(this.defaults, config); 22868 const fullPath = buildFullPath(config.baseURL, config.url); 22869 return buildURL(fullPath, config.params, config.paramsSerializer); 22870 } 22871 }; 22872 utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { 22873 Axios$1.prototype[method] = function(url, config) { 22874 return this.request(mergeConfig$1(config || {}, { 22875 method, 22876 url, 22877 data: (config || {}).data 22878 })); 22879 }; 22880 }); 22881 utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { 22882 function generateHTTPMethod(isForm) { 22883 return function httpMethod(url, data, config) { 22884 return this.request(mergeConfig$1(config || {}, { 22885 method, 22886 headers: isForm ? { 22887 "Content-Type": "multipart/form-data" 22888 } : {}, 22889 url, 22890 data 22891 })); 22892 }; 22893 } 22894 Axios$1.prototype[method] = generateHTTPMethod(); 22895 Axios$1.prototype[method + "Form"] = generateHTTPMethod(true); 22896 }); 22897 let CancelToken$1 = class CancelToken2 { 22898 constructor(executor) { 22899 if (typeof executor !== "function") { 22900 throw new TypeError("executor must be a function."); 22901 } 22902 let resolvePromise; 22903 this.promise = new Promise(function promiseExecutor(resolve) { 22904 resolvePromise = resolve; 22905 }); 22906 const token2 = this; 22907 this.promise.then((cancel) => { 22908 if (!token2._listeners) return; 22909 let i2 = token2._listeners.length; 22910 while (i2-- > 0) { 22911 token2._listeners[i2](cancel); 22912 } 22913 token2._listeners = null; 22914 }); 22915 this.promise.then = (onfulfilled) => { 22916 let _resolve; 22917 const promise = new Promise((resolve) => { 22918 token2.subscribe(resolve); 22919 _resolve = resolve; 22920 }).then(onfulfilled); 22921 promise.cancel = function reject() { 22922 token2.unsubscribe(_resolve); 22923 }; 22924 return promise; 22925 }; 22926 executor(function cancel(message, config, request) { 22927 if (token2.reason) { 22928 return; 22929 } 22930 token2.reason = new CanceledError$1(message, config, request); 22931 resolvePromise(token2.reason); 22932 }); 22933 } 22934 /** 22935 * Throws a `CanceledError` if cancellation has been requested. 22936 */ 22937 throwIfRequested() { 22938 if (this.reason) { 22939 throw this.reason; 22940 } 22941 } 22942 /** 22943 * Subscribe to the cancel signal 22944 */ 22945 subscribe(listener) { 22946 if (this.reason) { 22947 listener(this.reason); 22948 return; 22949 } 22950 if (this._listeners) { 22951 this._listeners.push(listener); 22952 } else { 22953 this._listeners = [listener]; 22954 } 22955 } 22956 /** 22957 * Unsubscribe from the cancel signal 22958 */ 22959 unsubscribe(listener) { 22960 if (!this._listeners) { 22961 return; 22962 } 22963 const index2 = this._listeners.indexOf(listener); 22964 if (index2 !== -1) { 22965 this._listeners.splice(index2, 1); 22966 } 22967 } 22968 toAbortSignal() { 22969 const controller = new AbortController(); 22970 const abort = (err) => { 22971 controller.abort(err); 22972 }; 22973 this.subscribe(abort); 22974 controller.signal.unsubscribe = () => this.unsubscribe(abort); 22975 return controller.signal; 22976 } 22977 /** 22978 * Returns an object that contains a new `CancelToken` and a function that, when called, 22979 * cancels the `CancelToken`. 22980 */ 22981 static source() { 22982 let cancel; 22983 const token2 = new CancelToken2(function executor(c2) { 22984 cancel = c2; 22985 }); 22986 return { 22987 token: token2, 22988 cancel 22989 }; 22990 } 22991 }; 22992 function spread$1(callback) { 22993 return function wrap2(arr) { 22994 return callback.apply(null, arr); 22995 }; 22996 } 22997 function isAxiosError$1(payload) { 22998 return utils$1.isObject(payload) && payload.isAxiosError === true; 22999 } 23000 const HttpStatusCode$1 = { 23001 Continue: 100, 23002 SwitchingProtocols: 101, 23003 Processing: 102, 23004 EarlyHints: 103, 23005 Ok: 200, 23006 Created: 201, 23007 Accepted: 202, 23008 NonAuthoritativeInformation: 203, 23009 NoContent: 204, 23010 ResetContent: 205,
23011 PartialContent: 206, 23012 MultiStatus: 207, 23013 AlreadyReported: 208, 23014 ImUsed: 226, 23015 MultipleChoices: 300, 23016 MovedPermanently: 301, 23017 Found: 302, 23018 SeeOther: 303, 23019 NotModified: 304, 23020 UseProxy: 305, 23021 Unused: 306, 23022 TemporaryRedirect: 307, 23023 PermanentRedirect: 308, 23024 BadRequest: 400, 23025 Unauthorized: 401, 23026 PaymentRequired: 402, 23027 Forbidden: 403, 23028 NotFound: 404, 23029 MethodNotAllowed: 405, 23030 NotAcceptable: 406, 23031 ProxyAuthenticationRequired: 407, 23032 RequestTimeout: 408, 23033 Conflict: 409, 23034 Gone: 410, 23035 LengthRequired: 411, 23036 PreconditionFailed: 412, 23037 PayloadTooLarge: 413, 23038 UriTooLong: 414, 23039 UnsupportedMediaType: 415, 23040 RangeNotSatisfiable: 416, 23041 ExpectationFailed: 417, 23042 ImATeapot: 418, 23043 MisdirectedRequest: 421, 23044 UnprocessableEntity: 422, 23045 Locked: 423, 23046 FailedDependency: 424, 23047 TooEarly: 425, 23048 UpgradeRequired: 426, 23049 PreconditionRequired: 428, 23050 TooManyRequests: 429, 23051 RequestHeaderFieldsTooLarge: 431, 23052 UnavailableForLegalReasons: 451, 23053 InternalServerError: 500, 23054 NotImplemented: 501, 23055 BadGateway: 502, 23056 ServiceUnavailable: 503, 23057 GatewayTimeout: 504, 23058 HttpVersionNotSupported: 505, 23059 VariantAlsoNegotiates: 506, 23060 InsufficientStorage: 507, 23061 LoopDetected: 508, 23062 NotExtended: 510, 23063 NetworkAuthenticationRequired: 511 23064 }; 23065 Object.entries(HttpStatusCode$1).forEach(([key, value]) => { 23066 HttpStatusCode$1[value] = key; 23067 }); 23068 function createInstance(defaultConfig) { 23069 const context = new Axios$1(defaultConfig); 23070 const instance2 = bind(Axios$1.prototype.request, context); 23071 utils$1.extend(instance2, Axios$1.prototype, context, { allOwnKeys: true }); 23072 utils$1.extend(instance2, context, null, { allOwnKeys: true }); 23073 instance2.create = function create2(instanceConfig) { 23074 return createInstance(mergeConfig$1(defaultConfig, instanceConfig)); 23075 }; 23076 return instance2; 23077 } 23078 const axios = createInstance(defaults); 23079 axios.Axios = Axios$1; 23080 axios.CanceledError = CanceledError$1; 23081 axios.CancelToken = CancelToken$1; 23082 axios.isCancel = isCancel$1; 23083 axios.VERSION = VERSION$1; 23084 axios.toFormData = toFormData$1; 23085 axios.AxiosError = AxiosError$1; 23086 axios.Cancel = axios.CanceledError; 23087 axios.all = function all2(promises) { 23088 return Promise.all(promises); 23089 }; 23090 axios.spread = spread$1; 23091 axios.isAxiosError = isAxiosError$1; 23092 axios.mergeConfig = mergeConfig$1; 23093 axios.AxiosHeaders = AxiosHeaders$1; 23094 axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); 23095 axios.getAdapter = adapters.getAdapter; 23096 axios.HttpStatusCode = HttpStatusCode$1; 23097 axios.default = axios; 23098 const { 23099 Axios, 23100 AxiosError, 23101 CanceledError, 23102 isCancel, 23103 CancelToken, 23104 VERSION, 23105 all, 23106 Cancel, 23107 isAxiosError, 23108 spread, 23109 toFormData, 23110 AxiosHeaders, 23111 HttpStatusCode, 23112 formToJSON, 23113 getAdapter, 23114 mergeConfig 23115 } = axios; 23116 class ApiBase { 23117 constructor(customUrl) { 23118 __publicField(this, "instance"); 23119 __publicField(this, "customUrl"); 23120 __publicField(this, "getUrl", (customUrl) => { 23121 if (customUrl) { 23122 return customUrl; 23123 } 23124 return getBaseApiUrl("api"); 23125 }); 23126 __publicField(this, "setMaxRequestsCount", (maxRequestsCount = 5) => { 23127 const MAX_REQUESTS_COUNT = maxRequestsCount; 23128 const INTERVAL_MS = 10; 23129 let PENDING_REQUESTS = 0; 23130 this.instance.interceptors.request.use((config) => { 23131 return new Promise((resolve) => { 23132 const interval = setInterval(() => { 23133 if (PENDING_REQUESTS < MAX_REQUESTS_COUNT) { 23134 PENDING_REQUESTS++; 23135 clearInterval(interval); 23136 resolve(config); 23137 } 23138 }, INTERVAL_MS); 23139 }); 23140 }); 23141 this.instance.interceptors.response.use((response) => { 23142 PENDING_REQUESTS = Math.max(0, PENDING_REQUESTS - 1); 23143 return Promise.resolve(response); 23144 }, (error) => { 23145 PENDING_REQUESTS = Math.max(0, PENDING_REQUESTS - 1); 23146 return Promise.reject(error); 23147 }); 23148 }); 23149 __publicField(this, "getCancelTokenSource", () => { 23150 return axios.CancelToken.source(); 23151 }); 23152 __publicField(this, "getUnsafe", (path, params, headers) => { 23153 return this.instance.get(path, { params, headers }); 23154 }); 23155 __publicField(this, "get", (path, params, headers, config) => { 23156 return this.instance.get(path, __spreadValues({ params, headers }, config)); 23157 }); 23158 __publicField(this, "getBlob", (path, params, headers) => { 23159 return this.instance.get(path, { params, headers, responseType: "blob" }); 23160 }); 23161 __publicField(this, "post", (path, payload, params, config) => { 23162 return this.instance.post(path, payload, __spreadValues({ params }, config)); 23163 }); 23164 __publicField(this, "put", (path, payload, params, config) => { 23165 return this.instance.put(path, payload, __spreadValues({ params }, config)); 23166 }); 23167 __publicField(this, "patch", (path, payload, params, config) => { 23168 return this.instance.patch(path, payload, __spreadValues({ params }, config)); 23169 }); 23170 __publicField(this, "delete", (path, payload, params) => { 23171 return this.instance.delete(path, { data: payload, params }); 23172 }); 23173 __publicField(this, "getLink", (path) => { 23174 return `${this.getUrl(this.customUrl)}${path}`;
23175 }); 23176 __publicField(this, "setAuthorizationHeader", (token2) => { 23177 this.setHeader("Authorization", `Bearer ${token2}`); 23178 }); 23179 __publicField(this, "removeAuthorizationHeader", () => { 23180 this.removeHeader("Authorization"); 23181 }); 23182 __publicField(this, "setHeader", (key, value) => { 23183 this.instance.defaults.headers.common[key] = value; 23184 }); 23185 __publicField(this, "removeHeader", (key) => { 23186 delete this.instance.defaults.headers.common[key]; 23187 }); 23188 __publicField(this, "addErrorResponseInterceptor", (errorInterceptor) => { 23189 this.instance.interceptors.response.use((success) => success, errorInterceptor); 23190 }); 23191 __publicField(this, "addRequestInterceptor", (interceptor) => { 23192 return this.instance.interceptors.request.use(interceptor); 23193 }); 23194 __publicField(this, "removeRequestInterceptor", (interceptorId) => { 23195 this.instance.interceptors.request.eject(interceptorId); 23196 }); 23197 this.customUrl = customUrl; 23198 this.instance = axios.create({ 23199 xsrfCookieName: getCsrfCookieName(), 23200 xsrfHeaderName: "X-XSRF-TOKEN", 23201 paramsSerializer: { 23202 serialize: (params) => { 23203 const searchParams = new URLSearchParams(); 23204 for (const [key, value] of Object.entries(params)) { 23205 if (params[key] !== void 0) { 23206 if (Array.isArray(value)) { 23207 value.forEach((val) => searchParams.append(key, val)); 23208 } else { 23209 searchParams.set(key, value); 23210 } 23211 } 23212 } 23213 return searchParams.toString(); 23214 } 23215 } 23216 }); 23217 this.instance.interceptors.request.use((config) => { 23218 return __spreadValues({ 23219 baseURL: this.getUrl(this.customUrl) 23220 }, config); 23221 }); 23222 this.instance.interceptors.response.use((response) => response, (error) => __async(this, null, function* () { 23223 const response = error == null ? void 0 : error.response; 23224 const data = response == null ? void 0 : response.data; 23225 if (response && data instanceof Blob && data.type.includes("json")) { 23226 try { 23227 response.data = JSON.parse(yield data.text()); 23228 } catch (e2) { 23229 } 23230 } 23231 return Promise.reject(error); 23232 })); 23233 } 23234 } 23235 class OrderStatusClientModel extends ApiBase { 23236 constructor() { 23237 super(...arguments); 23238 __publicField(this, "getBasicOrderStatus", (orderId) => { 23239 return this.get("/features/order-status/basic", { orderId }); 23240 }); 23241 __publicField(this, "getFullOrderStatus", (orderId, email, orderFriendlyId) => { 23242 const params = { orderId, email, orderFriendlyId }; 23243 return this.get("/features/order-status/full", params); 23244 }); 23245 __publicField(this, "getGiftCardsOrderStatus", (orderId) => { 23246 return this.get("/features/order-status/gift-cards", { 23247 orderId 23248 }); 23249 }); 23250 __publicField(this, "getBasicGiveawayStatus", (giveawayId) => { 23251 return this.get("/features/giveaway-status/basic", { 23252 giveawayId 23253 }); 23254 }); 23255 __publicField(this, "getFullGiveawayStatus", (giveawayId, email, giveawayFriendlyId) => { 23256 const params = { giveawayId, email, giveawayFriendlyId }; 23257 return this.get("/features/giveaway-status/full", params); 23258 }); 23259 __publicField(this, "getBasicMembershipGiftStatus", (checkoutId) => { 23260 return this.get("/features/membership-gift-status/basic", { 23261 checkoutId 23262 }); 23263 }); 23264 __publicField(this, "getFullMembershipGiftStatus", (checkoutId, email) => { 23265 const params = { checkoutId, email }; 23266 return this.get("/features/membership-gift-status/full", params); 23267 }); 23268 __publicField(this, "cancelOrder", (orderId, friendlyId, email, reason) => { 23269 return this.post(`/orders/${orderId}/cancel`, { reason }, { friendlyId, email }); 23270 }); 23271 __publicField(this, "getBasicOrderShipment", (params) => { 23272 return this.get(`/order/${params.orderId}/shipment/${params.shipmentTrackerId}/basic`); 23273 }); 23274 __publicField(this, "getFullOrderShipment", (params, queryParams) => { 23275 return this.get(`/order/${params.orderId}/shipment/${params.shipmentTrackerId}/full`, queryParams); 23276 }); 23277 __publicField(this, "updateEmail", (pathParams, payload, queryParams) => { 23278 return this.put(`/orders/${pathParams.orderId}/email`, payload, queryParams); 23279 }); 23280 } 23281 } 23282 const OrderStatusClient = new OrderStatusClientModel(); 23283 var O4 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 12 12", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M4.683 8.634.186 3.494l1.128-.988 4.498 5.14a.25.25 0 0 0 .376 0l4.498-5.14 1.128.988-4.497 5.14a1.75 1.75 0 0 1-2.634 0", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), Z4 = O4; 23284 var U4 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "m4.366 6.683 7.14-6.247.988 1.128-7.14 6.248a.25.25 0 0 0 0 .376l7.14 6.247-.988 1.13
23284-7.14-6.248a1.75 1.75 0 0 1 0-2.634", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), X4 = U4; 23285 var W4 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 12 12", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M4.683 3.366.186 8.506l1.128.988 4.498-5.14a.25.25 0 0 1 .376 0l4.498 5.14 1.128-.988-4.497-5.14a1.75 1.75 0 0 0-2.634 0", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), K4 = W4; 23286 var Y4 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "m8 9.06-6.72 6.72-1.06-1.06L6.94 8 .22 1.28 1.28.22 8 6.94 14.72.22l1.06 1.06L9.06 8l6.72 6.72-1.06 1.06z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), $4 = Y4; 23287 var ze$3 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M7.25 9.121 3.12 4.934 2.054 5.987 6.996 11a1.41 1.41 0 0 0 2.008 0l4.943-5.013-1.068-1.053L8.75 9.12V0h-1.5zM1.5 11.108v3.143c0 .138.111.249.249.249h12.504a.247.247 0 0 0 .247-.25v-3.142H16v3.143c0 .963-.777 1.749-1.747 1.749H1.75A1.75 1.75 0 0 1 0 14.25v-3.142z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), Me$3 = ze$3; 23288 var $e$3 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8m8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13m-.92 2.875h1.5v4.63h-1.5zm0 7.15v-1.47h1.5v1.47z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), je$3 = $e$3; 23289 var G8 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 32 32", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", d: "m11.947 6-.682 3.151H9.983c-1.61 0-1.964.081-2.237 1.195l-.136.733h3.246l-.683 3.178H6.928L4.5 25.692H0l2.428-11.435H.409l.682-3.178h1.991l.219-.923C4.01 6.706 5.7 6 9.628 6zm3.525 5.08 1.936 9.913 1.718-9.914h4.637l1.69 9.914 1.938-9.914H32l-3.382 14.613h-5.21L21.446 14.91 19.48 25.692h-5.237L10.862 11.08z", vectorEffect: "non-scaling-stroke" }) })), u8 = G8; 23290 var C8 = (o2) => jsxRuntimeExports.jsxs("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 113 20", overflow: "visible", role: "img" }, o2), { children: [jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M11.85.016H9.545L9.559 0C5.655 0 3.972.705 3.273 4.14l-.214.93H1.083L.407 8.237H2.41L0 19.644h4.465L6.872 8.237h2.226C7.952 9.936 7.45 11.969 7.45 13.679c0 4.275 2.984 6.305 6.881 6.305 3.879 0 6.254-2.043 7.493-4.484l-.008.263c0 2.868 1.539 4.22 4.19 4.22V20c2.489 0 3.993-1.055 4.924-2.219l-.405 1.863h4.356l3.091-14.557h-4.465l-1.63 7.631c-.542 2.598-1.813 3.895-3.599 3.895-1.243 0-1.839-.715-1.839-2.095a8 8 0 0 1 .245-1.812l1.63-7.63h-4.466l-1.011 4.819c-.47-3.52-3.231-5.197-6.774-5.197-2.444 0-4.297.809-5.645 2.017l.351-1.64H7.55l.136-.729c.27-1.11.621-1.192 2.218-1.192h1.271zm3.887 8.146c-2.435 0-3.68 2.514-3.68 5.3 0 2.031.894 3.058 2.56 3.058 2.436 0 3.681-2.515 3.681-5.304 0-2.027-.894-3.054-2.56-3.054", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { fill: "currentColor", d: "M102.552.019h4.463v19.613h-4.463z", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M94.525 7.648c-1.434 0-2.435.728-2.598 2.137h-4.065l
23290-2.27 9.847h-5.196L78.45 8.891 76.5 19.632h-5.166L67.981 5.075h4.572l1.92 9.875 1.677-9.875h4.6l1.704 9.875 1.92-9.875h4.573l-.662 2.872c.993-1.9 3.32-3.33 6.617-3.33 4.167 0 6.577 1.676 6.493 6.115l-.054 3.164c-.025 1.895.054 4.49.324 5.736h-4.381l-.054-1.76c-1.082 1.544-2.815 2.112-4.889 2.112-2.758 0-5.03-1.63-5.03-4.275 0-3.57 4.031-4.763 9.684-5.168v-.568c0-1.704-.866-2.328-2.46-2.328zm-.559 9.31c1.784 0 3.138-.757 3.138-3.435v-.358c-3.112.27-5.196.677-5.196 2.219 0 .947.894 1.569 2.058 1.569z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { fill: "currentColor", d: "M112.69.019h-4.465v19.613h4.465z", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M59.92 7.024c.974-1.218 2.38-2.245 4.815-2.245 2.652 0 4.19 1.353 4.19 4.247-.014.82-.113 1.635-.295 2.435l-1.73 8.183h-4.465l1.63-7.576a8 8 0 0 0 .232-1.813c0-1.353-.595-2.028-1.839-2.028-1.757 0-3.056 1.243-3.599 3.841l-1.63 7.576h-4.45l.002-.012h-2.787c-2.866 0-4.139-.433-4.139-2.41q.026-.848.217-1.676l1.275-5.966a8 8 0 0 0-1.54-.135c-1.894 0-3.22.647-3.654 2.814l-1.569 7.385h-4.463l3.083-14.567h4.33l-.561 2.673c1.022-1.57 2.67-2.84 4.889-2.84h.48l.814-3.816h4.463l-.864 3.979h3.115L56.943.016h4.465zM55.2 8.237h-3.121l-1.38 6.513q-.075.363-.082.731c0 .769.46.932 1.65.932h1.198z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" })] })), P8 = C8; 23291 var mt$3 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M0 7.25h16v1.5H0z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), wt$2 = mt$3; 23292 var F9 = (o2) => jsxRuntimeExports.jsxs("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 32 32", overflow: "visible", role: "img" }, o2), { children: [jsxRuntimeExports.jsxs("g", { fill: "currentColor", clipPath: "url(#PlaceholderPhotoIcon_svg__a)", children: [jsxRuntimeExports.jsx("path", { d: "M9.96 12.141a3.304 3.304 0 1 0 0-6.607 3.304 3.304 0 0 0 0 6.607m8.972-1.062-4.315 7.094-3.146-2.655-5.93 6.551h21.277z", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { d: "M32 0H0v32h32zm-3.31 24.276H3.31V3.31h25.38z", vectorEffect: "non-scaling-stroke" })] }), jsxRuntimeExports.jsx("defs", { children: jsxRuntimeExports.jsx("clipPath", { id: "PlaceholderPhotoIcon_svg__a", children: jsxRuntimeExports.jsx("path", { fill: "#fff", d: "M0 0h32v32H0z", vectorEffect: "non-scaling-stroke" }) }) })] })), D9 = F9; 23293 var _9 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M7.25 7.25V0h1.5v7.25H16v1.5H8.75V16h-1.5V8.75H0v-1.5z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), W9 = _9; 23294 var ar$2 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8m8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13m-.555 4.021a.79.79 0 0 0-.79.79h-1.5a2.29 2.29 0 0 1 2.29-2.29h.77a2.29 2.29 0 0 1 .365 4.551v.434h-1.5v-.77c0-.627.508-1.135 1.135-1.135a.79.79 0 1 0 0-1.58zm-.365 6.004v-1.47h1.5v1.47z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), fr$2 = ar$2; 23295 var Bc = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.857 2.44 7.796 13.56a1.75 1.75 0 0 1-2.56.298L.26 9.568l.98-1.136 4.976 4.29a.25.25 0 0 0 .365-.043l8.062-11.12z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), yc = Bc; 23296 var fs = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M6.996.471a1.41 1.41 0 0 1 2.008 0l4.943 5.013-1.
23296068 1.053L8.75 2.35v9.121h-1.5V2.35L3.12 6.537 2.054 5.484zM1.5 11.11v3.142c0 .138.111.249.249.249H14.25c.138 0 .249-.11.249-.25v-3.142H16v3.143c0 .965-.781 1.749-1.749 1.749H1.75A1.75 1.75 0 0 1 0 14.25v-3.142z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), ps = fs; 23297 var __assign$3 = function() { 23298 __assign$3 = Object.assign || function __assign2(t2) { 23299 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 23300 s2 = arguments[i2]; 23301 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; 23302 } 23303 return t2; 23304 }; 23305 return __assign$3.apply(this, arguments); 23306 }; 23307 function __spreadArray$1(to2, from2, pack) { 23308 if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) { 23309 if (ar2 || !(i2 in from2)) { 23310 if (!ar2) ar2 = Array.prototype.slice.call(from2, 0, i2); 23311 ar2[i2] = from2[i2]; 23312 } 23313 } 23314 return to2.concat(ar2 || Array.prototype.slice.call(from2)); 23315 } 23316 typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { 23317 var e2 = new Error(message); 23318 return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2; 23319 }; 23320 var MS = "-ms-"; 23321 var MOZ = "-moz-"; 23322 var WEBKIT = "-webkit-"; 23323 var COMMENT = "comm"; 23324 var RULESET = "rule"; 23325 var DECLARATION = "decl"; 23326 var IMPORT = "@import"; 23327 var KEYFRAMES = "@keyframes"; 23328 var LAYER = "@layer"; 23329 var abs = Math.abs; 23330 var from = String.fromCharCode; 23331 var assign$1 = Object.assign; 23332 function hash(value, length2) { 23333 return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0; 23334 } 23335 function trim$1(value) { 23336 return value.trim(); 23337 } 23338 function match$1(value, pattern) { 23339 return (value = pattern.exec(value)) ? value[0] : value; 23340 } 23341 function replace(value, pattern, replacement) { 23342 return value.replace(pattern, replacement); 23343 } 23344 function indexof(value, search, position2) { 23345 return value.indexOf(search, position2); 23346 } 23347 function charat(value, index2) { 23348 return value.charCodeAt(index2) | 0; 23349 } 23350 function substr(value, begin, end) { 23351 return value.slice(begin, end); 23352 } 23353 function strlen(value) { 23354 return value.length; 23355 } 23356 function sizeof(value) { 23357 return value.length; 23358 } 23359 function append(value, array2) { 23360 return array2.push(value), value; 23361 } 23362 function combine(array2, callback) { 23363 return array2.map(callback).join(""); 23364 } 23365 function filter$1(array2, pattern) { 23366 return array2.filter(function(value) { 23367 return !match$1(value, pattern); 23368 }); 23369 } 23370 var line = 1; 23371 var column = 1; 23372 var length = 0; 23373 var position = 0; 23374 var character = 0; 23375 var characters = ""; 23376 function node(value, root2, parent, type, props, children, length2, siblings) { 23377 return { value, root: root2, parent, type, props, children, line, column, length: length2, return: "", siblings }; 23378 } 23379 function copy(root2, props) { 23380 return assign$1(node("", null, null, "", null, null, 0, root2.siblings), root2, { length: -root2.length }, props); 23381 } 23382 function lift(root2) { 23383 while (root2.root) 23384 root2 = copy(root2.root, { children: [root2] }); 23385 append(root2, root2.siblings); 23386 } 23387 function char() { 23388 return character; 23389 } 23390 function prev() { 23391 character = position > 0 ? charat(characters, --position) : 0; 23392 if (column--, character === 10) 23393 column = 1, line--; 23394 return character; 23395 } 23396 function next() { 23397 character = position < length ? charat(characters, position++) : 0; 23398 if (column++, character === 10) 23399 column = 1, line++; 23400 return character; 23401 } 23402 function peek() { 23403 return charat(characters, position); 23404 } 23405 function caret() { 23406 return position; 23407 } 23408 function slice(begin, end) { 23409 return substr(characters, begin, end); 23410 } 23411 function token(type) { 23412 switch (type) { 23413 // \0 \t \n \r \s whitespace token 23414 case 0: 23415 case 9: 23416 case 10: 23417 case 13: 23418 case 32: 23419 return 5; 23420 // ! + , / > @ ~ isolate token 23421 case 33: 23422 case 43: 23423 case 44: 23424 case 47: 23425 case 62: 23426 case 64: 23427 case 126: 23428 // ; { } breakpoint token 23429 case 59: 23430 case 123: 23431 case 125: 23432 return 4; 23433 // : accompanied token 23434 case 58: 23435 return 3; 23436 // " ' ( [ opening delimit token 23437 case 34: 23438 case 39: 23439 case 40: 23440 case 91: 23441 return 2; 23442 // ) ] closing delimit token 23443 case 41: 23444 case 93: 23445 return 1; 23446 } 23447 return 0; 23448 } 23449 function alloc(value) { 23450 return line = column = 1, length = strlen(characters = value), position = 0, []; 23451 } 23452 function dealloc(value) { 23453 return characters = "", value; 23454 } 23455 function delimit(type) { 23456 return trim$1(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))); 23457 } 23458 function whitespace(type) { 23459 while (character = peek()) 23460 if (character < 33) 23461 next(); 23462 else 23463 break; 23464 return token(type) > 2 || token(character) > 3 ? "" : " "; 23465 } 23466 function escaping(index2, count2) { 23467 while (--count2 && next()) 23468 if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) 23469 break; 23470 return slice(index2, caret() + (count2 < 6 && peek() == 32 && next() == 32)); 23471 } 23472 function delimiter(type) { 23473 while (next()) 23474 switch (character) { 23475 // ] ) " ' 23476 case type: 23477 return position; 23478 // " ' 23479 case 34: 23480 case 39: 23481 if (type !== 34 && type !== 39) 23482 delimiter(character); 23483 break; 23484 // ( 23485 case 40: 23486 if (type === 41) 23487 delimiter(type); 23488 break; 23489 // \ 23490 case 92: 23491 next(); 23492 break; 23493 } 23494 return position; 23495 } 23496 function commenter(type, index2) { 23497 while (next()) 23498 if (type + character === 47 + 10) 23499 break; 23500 else if (type + character === 42 + 42 && peek() === 47) 23501 break; 23502 return "/*" + slice(index2, position - 1) + "*" + from(type === 47 ? type : next()); 23503 } 23504 function identifier(index2) { 23505 while (!token(peek())) 23506 next(); 23507 return slice(index2, position); 23508 } 23509 function compile$1(value) { 23510 return dealloc(parse$2("", null, null, null, [""], value = alloc(value), 0, [0], value)); 23511 } 23512 function parse$2(value, root2, parent, rule, rules, rulesets, pseudo, points, declarations) { 23513 var index2 = 0; 23514 var offset2 = 0; 23515 var length2 = pseudo; 23516 var atrule = 0; 23517 var property2 = 0; 23518 var previous = 0; 23519 var variable = 1; 23520 var scanning = 1; 23521 var ampersand = 1; 23522 var character2 = 0; 23523 var type = ""; 23524 var props = rules; 23525 var children = rulesets; 23526 var reference = rule; 23527 var characters2 = type; 23528 while (scanning) 23529 switch (previous = character2, character2 = next()) { 23530 // ( 23531 case 40: 23532 if (previous != 108 && charat(characters2, length2 - 1) == 58) { 23533 if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index2 ? points[index2 - 1] : 0)) != -1) 23534 ampersand = -1; 23535 break; 23536 } 23537 // " ' [ 23538 case 34: 23539 case 39: 23540 case 91: 23541 characters2 += delimit(character2); 23542 break; 23543 // \t \n \r \s 23544 case 9: 23545 case 10: 23546 case 13: 23547 case 32: 23548 characters2 += whitespace(previous); 23549 break; 23550 // \ 23551 case 92: 23552 characters2 += escaping(caret() - 1, 7); 23553 continue; 23554 // / 23555 case 47: 23556 switch (peek()) { 23557 case 42: 23558 case 47: 23559 append(comment(commenter(next(), caret()), root2, parent, declarations), declarations); 23560 break; 23561 default: 23562 characters2 += "/"; 23563 } 23564 break; 23565 // { 23566 case 123 * variable: 23567 points[index2++] = strlen(characters2) * ampersand; 23568 // } ; \0 23569 case 125 * variable: 23570 case 59: 23571 case 0: 23572 switch (character2) { 23573 // \0 } 23574 case 0: 23575 case 125: 23576 scanning = 0; 23577 // ; 23578 case 59 + offset2: 23579 if (ampersand == -1) characters2 = replace(characters2, /\f/g, ""); 23580 if (property2 > 0 && strlen(characters2) - length2) 23581 append(property2 >
vendor: 10,273 bytes, lines 23581-23813
23581 32 ? declaration(characters2 + ";", rule, parent, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2, declarations), declarations); 23582 break; 23583 // @ ; 23584 case 59: 23585 characters2 += ";"; 23586 // { rule/at-rule 23587 default: 23588 append(reference = ruleset(characters2, root2, parent, index2, offset2, rules, points, type, props = [], children = [], length2, rulesets), rulesets); 23589 if (character2 === 123) 23590 if (offset2 === 0) 23591 parse$2(characters2, root2, reference, reference, props, rulesets, length2, points, children); 23592 else 23593 switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) { 23594 // d l m s 23595 case 100: 23596 case 108: 23597 case 109: 23598 case 115: 23599 parse$2(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2, children), children), rules, children, length2, points, rule ? props : children); 23600 break; 23601 default: 23602 parse$2(characters2, reference, reference, reference, [""], children, 0, points, children); 23603 } 23604 } 23605 index2 = offset2 = property2 = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo; 23606 break; 23607 // : 23608 case 58: 23609 length2 = 1 + strlen(characters2), property2 = previous; 23610 default: 23611 if (variable < 1) { 23612 if (character2 == 123) 23613 --variable; 23614 else if (character2 == 125 && variable++ == 0 && prev() == 125) 23615 continue; 23616 } 23617 switch (characters2 += from(character2), character2 * variable) { 23618 // & 23619 case 38: 23620 ampersand = offset2 > 0 ? 1 : (characters2 += "\f", -1); 23621 break; 23622 // , 23623 case 44: 23624 points[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1; 23625 break; 23626 // @ 23627 case 64: 23628 if (peek() === 45) 23629 characters2 += delimit(next()); 23630 atrule = peek(), offset2 = length2 = strlen(type = characters2 += identifier(caret())), character2++; 23631 break; 23632 // - 23633 case 45: 23634 if (previous === 45 && strlen(characters2) == 2) 23635 variable = 0; 23636 } 23637 } 23638 return rulesets; 23639 } 23640 function ruleset(value, root2, parent, index2, offset2, rules, points, type, props, children, length2, siblings) { 23641 var post = offset2 - 1; 23642 var rule = offset2 === 0 ? rules : [""]; 23643 var size = sizeof(rule); 23644 for (var i2 = 0, j2 = 0, k2 = 0; i2 < index2; ++i2) 23645 for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j2 = points[i2])), z2 = value; x2 < size; ++x2) 23646 if (z2 = trim$1(j2 > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2]))) 23647 props[k2++] = z2; 23648 return node(value, root2, parent, offset2 === 0 ? RULESET : type, props, children, length2, siblings); 23649 } 23650 function comment(value, root2, parent, siblings) { 23651 return node(value, root2, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings); 23652 } 23653 function declaration(value, root2, parent, length2, siblings) { 23654 return node(value, root2, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2, siblings); 23655 } 23656 function prefix(value, length2, children) { 23657 switch (hash(value, length2)) { 23658 // color-adjust 23659 case 5103: 23660 return WEBKIT + "print-" + value + value; 23661 // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) 23662 case 5737: 23663 case 4201: 23664 case 3177: 23665 case 3433: 23666 case 1641: 23667 case 4457: 23668 case 2921: 23669 // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break 23670 case 5572: 23671 case 6356: 23672 case 5844: 23673 case 3191: 23674 case 6645: 23675 case 3005: 23676 // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, 23677 case 6391: 23678 case 5879: 23679 case 5623: 23680 case 6135: 23681 case 4599: 23682 case 4855: 23683 // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) 23684 case 4215: 23685 case 6389: 23686 case 5109: 23687 case 5365: 23688 case 5621: 23689 case 3829: 23690 return WEBKIT + value + value; 23691 // tab-size 23692 case 4789: 23693 return MOZ + value + value; 23694 // appearance, user-select, transform, hyphens, text-size-adjust 23695 case 5349: 23696 case 4246: 23697 case 4810: 23698 case 6968: 23699 case 2756: 23700 return WEBKIT + value + MOZ + value + MS + value + value; 23701 // writing-mode 23702 case 5936: 23703 switch (charat(value, length2 + 11)) { 23704 // vertical-l(r) 23705 case 114: 23706 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value; 23707 // vertical-r(l) 23708 case 108: 23709 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value; 23710 // horizontal(-)tb 23711 case 45: 23712 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value; 23713 } 23714 // flex, flex-direction, scroll-snap-type, writing-mode 23715 case 6828: 23716 case 4268: 23717 case 2903: 23718 return WEBKIT + value + MS + value + value; 23719 // order 23720 case 6165: 23721 return WEBKIT + value + MS + "flex-" + value + value; 23722 // align-items 23723 case 5187: 23724 return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value; 23725 // align-self 23726 case 5443: 23727 return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/g, "") + (!match$1(value, /flex-|baseline/) ? MS + "grid-row-" + replace(value, /flex-|-self/g, "") : "") + value; 23728 // align-content 23729 case 4675: 23730 return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/g, "") + value; 23731 // flex-shrink 23732 case 5548: 23733 return WEBKIT + value + MS + replace(value, "shrink", "negative") + value; 23734 // flex-basis 23735 case 5292: 23736 return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value; 23737 // flex-grow 23738 case 6060: 23739 return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value; 23740 // transition 23741 case 4554: 23742 return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value; 23743 // cursor 23744 case 6187: 23745 return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value; 23746 // background, background-image 23747 case 5495: 23748 case 3959: 23749 return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1"); 23750 // justify-content 23751 case 4968: 23752 return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value; 23753 // justify-self 23754 case 4200: 23755 if (!match$1(value, /flex-|baseline/)) return MS + "grid-column-align" + substr(value, length2) + value; 23756 break; 23757 // grid-template-(columns|rows) 23758 case 2592: 23759 case 3360: 23760 return MS + replace(value, "template-", "") + value; 23761 // grid-(row|column)-start 23762 case 4384: 23763 case 3616: 23764 if (children && children.some(function(element, index2) { 23765 return length2 = index2, match$1(element.props, /grid-\w+-end/); 23766 })) { 23767 return ~indexof(value + (children = children[length2].value), "span", 0) ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span", 0) ? match$1(children, /\d+/) : +match$1(children, /\d+/) - +match$1(value, /\d+/)) + ";"; 23768 } 23769 return MS + replace(value, "-start", "") + value; 23770 // grid-(row|column)-end 23771 case 4896: 23772 case 4128: 23773 return children && children.some(function(element) { 23774 return match$1(element.props, /grid-\w+-start/); 23775 }) ? value : MS + replace(replace(value, "-end", "-span"), "span ", "") + value; 23776 // (margin|padding)-inline-(start|end) 23777 case 4095: 23778 case 3583: 23779 case 4068: 23780 case 2532: 23781 return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value; 23782 // (min|max)?(width|height|inline-size|block-size) 23783 case 8116: 23784 case 7059: 23785 case 5753: 23786 case 5535: 23787 case 5445: 23788 case 5701: 23789 case 4933: 23790 case 4677: 23791 case 5533: 23792 case 5789: 23793 case 5021: 23794 case 4765: 23795 if (strlen(value) - 1 - length2 > 6) 23796 switch (charat(value, length2 + 1)) { 23797 // (m)ax-content, (m)in-content 23798 case 109: 23799 if (charat(value, length2 + 4) !== 45) 23800 break; 23801 // (f)ill-available, (f)it-content 23802 case 102: 23803 return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value; 23804 // (s)tretch 23805 case 115: 23806 return ~indexof(value, "stretch", 0) ? prefix(replace(value, "stretch", "fill-available"), length2, children) + value : value; 23807 } 23808 break; 23809 // grid-(column|row) 23810 case 5152: 23811 case 5920: 23812 return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a2, b2, c2, d2, e2, f2) { 23813 return MS + a2 + ":" + b2 + f2 + (c2 ? MS + a2 + "-sp
23813an:" + (d2 ? e2 : +e2 - +b2) + f2 : "") + value; 23814 }); 23815 // position: sticky 23816 case 4949: 23817 if (charat(value, length2 + 6) === 121) 23818 return replace(value, ":", ":" + WEBKIT) + value; 23819 break; 23820 // display: (flex|inline-flex|grid|inline-grid) 23821 case 6444: 23822 switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) { 23823 // (inline-)?fle(x) 23824 case 120: 23825 return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value; 23826 // (inline-)?gri(d) 23827 case 100: 23828 return replace(value, ":", ":" + MS) + value; 23829 } 23830 break; 23831 // scroll-margin, scroll-margin-(top|right|bottom|left) 23832 case 5719: 23833 case 2647: 23834 case 2135: 23835 case 3927: 23836 case 2391: 23837 return replace(value, "scroll-", "scroll-snap-") + value; 23838 } 23839 return value; 23840 } 23841 function serialize(children, callback) { 23842 var output = ""; 23843 for (var i2 = 0; i2 < children.length; i2++) 23844 output += callback(children[i2], i2, children, callback) || ""; 23845 return output; 23846 } 23847 function stringify(element, index2, children, callback) { 23848 switch (element.type) { 23849 case LAYER: 23850 if (element.children.length) break; 23851 case IMPORT: 23852 case DECLARATION: 23853 return element.return = element.return || element.value; 23854 case COMMENT: 23855 return ""; 23856 case KEYFRAMES: 23857 return element.return = element.value + "{" + serialize(element.children, callback) + "}"; 23858 case RULESET: 23859 if (!strlen(element.value = element.props.join(","))) return ""; 23860 } 23861 return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : ""; 23862 } 23863 function middleware(collection) { 23864 var length2 = sizeof(collection); 23865 return function(element, index2, children, callback) { 23866 var output = ""; 23867 for (var i2 = 0; i2 < length2; i2++) 23868 output += collection[i2](element, index2, children, callback) || ""; 23869 return output; 23870 }; 23871 } 23872 function rulesheet(callback) { 23873 return function(element) { 23874 if (!element.root) { 23875 if (element = element.return) 23876 callback(element); 23877 } 23878 }; 23879 } 23880 function prefixer(element, index2, children, callback) { 23881 if (element.length > -1) { 23882 if (!element.return) 23883 switch (element.type) { 23884 case DECLARATION: 23885 element.return = prefix(element.value, element.length, children); 23886 return; 23887 case KEYFRAMES: 23888 return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback); 23889 case RULESET: 23890 if (element.length) 23891 return combine(children = element.props, function(value) { 23892 switch (match$1(value, callback = /(::plac\w+|:read-\w+)/)) { 23893 // :read-(only|write) 23894 case ":read-only": 23895 case ":read-write": 23896 lift(copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] })); 23897 lift(copy(element, { props: [value] })); 23898 assign$1(element, { props: filter$1(children, callback) }); 23899 break; 23900 // :placeholder 23901 case "::placeholder": 23902 lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] })); 23903 lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] })); 23904 lift(copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] })); 23905 lift(copy(element, { props: [value] })); 23906 assign$1(element, { props: filter$1(children, callback) }); 23907 break; 23908 } 23909 return ""; 23910 }); 23911 } 23912 } 23913 } 23914 var unitlessKeys = { 23915 animationIterationCount: 1, 23916 aspectRatio: 1, 23917 borderImageOutset: 1, 23918 borderImageSlice: 1, 23919 borderImageWidth: 1, 23920 boxFlex: 1, 23921 boxFlexGroup: 1, 23922 boxOrdinalGroup: 1, 23923 columnCount: 1, 23924 columns: 1, 23925 flex: 1, 23926 flexGrow: 1, 23927 flexPositive: 1, 23928 flexShrink: 1, 23929 flexNegative: 1, 23930 flexOrder: 1, 23931 gridRow: 1, 23932 gridRowEnd: 1, 23933 gridRowSpan: 1, 23934 gridRowStart: 1, 23935 gridColumn: 1, 23936 gridColumnEnd: 1, 23937 gridColumnSpan: 1, 23938 gridColumnStart: 1, 23939 msGridRow: 1, 23940 msGridRowSpan: 1, 23941 msGridColumn: 1, 23942 msGridColumnSpan: 1, 23943 fontWeight: 1, 23944 lineHeight: 1, 23945 opacity: 1, 23946 order: 1, 23947 orphans: 1, 23948 tabSize: 1, 23949 widows: 1, 23950 zIndex: 1, 23951 zoom: 1, 23952 WebkitLineClamp: 1, 23953 // SVG-related properties 23954 fillOpacity: 1, 23955 floodOpacity: 1, 23956 stopOpacity: 1, 23957 strokeDasharray: 1, 23958 strokeDashoffset: 1, 23959 strokeMiterlimit: 1, 23960 strokeOpacity: 1, 23961 strokeWidth: 1 23962 }; 23963 var define_process_env_default = {}; 23964 var f$5 = "undefined" != typeof process && void 0 !== define_process_env_default && (define_process_env_default.REACT_APP_SC_ATTR || define_process_env_default.SC_ATTR) || "data-styled", m$4 = "active", y$5 = "data-styled-version", v$5 = "6.1.17", g$3 = "/*!sc*/\n", S$2 = "undefined" != typeof window && "HTMLElement" in window, w$7 = Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== define_process_env_default && void 0 !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY && "" !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY ? "false" !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY && define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== define_process_env_default && void 0 !== define_process_env_default.SC_DISABLE_SPEEDY && "" !== define_process_env_default.SC_DISABLE_SPEEDY ? "false" !== define_process_env_default.SC_DISABLE_SPEEDY && define_process_env_default.SC_DISABLE_SPEEDY : false), b$4 = {}, _$4 = Object.freeze([]), C$5 = Object.freeze({}); 23965 function I$3(e2, t2, n2) { 23966 return void 0 === n2 && (n2 = C$5), e2.theme !== n2.theme && e2.theme || t2 || n2.theme; 23967 } 23968 var A$4 = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]), O$5 = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, D$5 = /(^-|-$)/g; 23969 function R$5(e2) { 23970 return e2.replace(O$5, "-").replace(D$5, ""); 23971 } 23972 var T$4 = /(a)(d)/gi, k$4 = 52, j$2 = function(e2) { 23973 return String.fromCharCode(e2 + (e2 > 25 ? 39 : 97)); 23974 }; 23975 function x$4(e2) { 23976 var t2, n2 = ""; 23977 for (t2 = Math.abs(e2); t2 > k$4; t2 = t2 / k$4 | 0) n2 = j$2(t2 % k$4) + n2; 23978 return (j$2(t2 % k$4) + n2).replace(T$4, "$1-$2"); 23979 }
vendor: 9,738 bytes, lines 23980-24174
23980 var V$4, F$4 = 5381, M$7 = function(e2, t2) { 23981 for (var n2 = t2.length; n2; ) e2 = 33 * e2 ^ t2.charCodeAt(--n2); 23982 return e2; 23983 }, z$4 = function(e2) { 23984 return M$7(F$4, e2); 23985 }; 23986 function $$5(e2) { 23987 return x$4(z$4(e2) >>> 0); 23988 } 23989 function B$2(e2) { 23990 return e2.displayName || e2.name || "Component"; 23991 } 23992 function L$5(e2) { 23993 return "string" == typeof e2 && true; 23994 } 23995 var G$2 = "function" == typeof Symbol && Symbol.for, Y$2 = G$2 ? Symbol.for("react.memo") : 60115, W$1 = G$2 ? Symbol.for("react.forward_ref") : 60112, q$3 = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }, H$4 = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }, U$3 = { $$typeof: true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }, J$2 = ((V$4 = {})[W$1] = { $$typeof: true, render: true, defaultProps: true, displayName: true, propTypes: true }, V$4[Y$2] = U$3, V$4); 23996 function X$1(e2) { 23997 return ("type" in (t2 = e2) && t2.type.$$typeof) === Y$2 ? U$3 : "$$typeof" in e2 ? J$2[e2.$$typeof] : q$3; 23998 var t2; 23999 } 24000 var Z$2 = Object.defineProperty, K$3 = Object.getOwnPropertyNames, Q$4 = Object.getOwnPropertySymbols, ee$1 = Object.getOwnPropertyDescriptor, te$1 = Object.getPrototypeOf, ne$1 = Object.prototype; 24001 function oe$1(e2, t2, n2) { 24002 if ("string" != typeof t2) { 24003 if (ne$1) { 24004 var o2 = te$1(t2); 24005 o2 && o2 !== ne$1 && oe$1(e2, o2, n2); 24006 } 24007 var r2 = K$3(t2); 24008 Q$4 && (r2 = r2.concat(Q$4(t2))); 24009 for (var s2 = X$1(e2), i2 = X$1(t2), a2 = 0; a2 < r2.length; ++a2) { 24010 var c2 = r2[a2]; 24011 if (!(c2 in H$4 || n2 && n2[c2] || i2 && c2 in i2 || s2 && c2 in s2)) { 24012 var l2 = ee$1(t2, c2); 24013 try { 24014 Z$2(e2, c2, l2); 24015 } catch (e3) { 24016 } 24017 } 24018 } 24019 } 24020 return e2; 24021 } 24022 function re$1(e2) { 24023 return "function" == typeof e2; 24024 } 24025 function se$1(e2) { 24026 return "object" == typeof e2 && "styledComponentId" in e2; 24027 } 24028 function ie$1(e2, t2) { 24029 return e2 && t2 ? "".concat(e2, " ").concat(t2) : e2 || t2 || ""; 24030 } 24031 function ae$1(e2, t2) { 24032 if (0 === e2.length) return ""; 24033 for (var n2 = e2[0], o2 = 1; o2 < e2.length; o2++) n2 += e2[o2]; 24034 return n2; 24035 } 24036 function ce$1(e2) { 24037 return null !== e2 && "object" == typeof e2 && e2.constructor.name === Object.name && !("props" in e2 && e2.$$typeof); 24038 } 24039 function le$1(e2, t2, n2) { 24040 if (void 0 === n2 && (n2 = false), !n2 && !ce$1(e2) && !Array.isArray(e2)) return t2; 24041 if (Array.isArray(t2)) for (var o2 = 0; o2 < t2.length; o2++) e2[o2] = le$1(e2[o2], t2[o2]); 24042 else if (ce$1(t2)) for (var o2 in t2) e2[o2] = le$1(e2[o2], t2[o2]); 24043 return e2; 24044 } 24045 function ue$1(e2, t2) { 24046 Object.defineProperty(e2, "toString", { value: t2 }); 24047 } 24048 function he$2(t2) { 24049 for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2]; 24050 return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t2, " for more information.").concat(n2.length > 0 ? " Args: ".concat(n2.join(", ")) : "")); 24051 } 24052 var fe$3 = (function() { 24053 function e2(e3) { 24054 this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e3; 24055 } 24056 return e2.prototype.indexOfGroup = function(e3) { 24057 for (var t2 = 0, n2 = 0; n2 < e3; n2++) t2 += this.groupSizes[n2]; 24058 return t2; 24059 }, e2.prototype.insertRules = function(e3, t2) { 24060 if (e3 >= this.groupSizes.length) { 24061 for (var n2 = this.groupSizes, o2 = n2.length, r2 = o2; e3 >= r2; ) if ((r2 <<= 1) < 0) throw he$2(16, "".concat(e3)); 24062 this.groupSizes = new Uint32Array(r2), this.groupSizes.set(n2), this.length = r2; 24063 for (var s2 = o2; s2 < r2; s2++) this.groupSizes[s2] = 0; 24064 } 24065 for (var i2 = this.indexOfGroup(e3 + 1), a2 = (s2 = 0, t2.length); s2 < a2; s2++) this.tag.insertRule(i2, t2[s2]) && (this.groupSizes[e3]++, i2++); 24066 }, e2.prototype.clearGroup = function(e3) { 24067 if (e3 < this.length) { 24068 var t2 = this.groupSizes[e3], n2 = this.indexOfGroup(e3), o2 = n2 + t2; 24069 this.groupSizes[e3] = 0; 24070 for (var r2 = n2; r2 < o2; r2++) this.tag.deleteRule(n2); 24071 } 24072 }, e2.prototype.getGroup = function(e3) { 24073 var t2 = ""; 24074 if (e3 >= this.length || 0 === this.groupSizes[e3]) return t2; 24075 for (var n2 = this.groupSizes[e3], o2 = this.indexOfGroup(e3), r2 = o2 + n2, s2 = o2; s2 < r2; s2++) t2 += "".concat(this.tag.getRule(s2)).concat(g$3); 24076 return t2; 24077 }, e2; 24078 })(), ye$2 = /* @__PURE__ */ new Map(), ve$2 = /* @__PURE__ */ new Map(), ge$2 = 1, Se$2 = function(e2) { 24079 if (ye$2.has(e2)) return ye$2.get(e2); 24080 for (; ve$2.has(ge$2); ) ge$2++; 24081 var t2 = ge$2++; 24082 return ye$2.set(e2, t2), ve$2.set(t2, e2), t2; 24083 }, we$2 = function(e2, t2) { 24084 ge$2 = t2 + 1, ye$2.set(e2, t2), ve$2.set(t2, e2); 24085 }, be$2 = "style[".concat(f$5, "][").concat(y$5, '="').concat(v$5, '"]'), Ee$2 = new RegExp("^".concat(f$5, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Ne$2 = function(e2, t2, n2) { 24086 for (var o2, r2 = n2.split(","), s2 = 0, i2 = r2.length; s2 < i2; s2++) (o2 = r2[s2]) && e2.registerName(t2, o2); 24087 }, Pe$2 = function(e2, t2) { 24088 for (var n2, o2 = (null !== (n2 = t2.textContent) && void 0 !== n2 ? n2 : "").split(g$3), r2 = [], s2 = 0, i2 = o2.length; s2 < i2; s2++) { 24089 var a2 = o2[s2].trim(); 24090 if (a2) { 24091 var c2 = a2.match(Ee$2); 24092 if (c2) { 24093 var l2 = 0 | parseInt(c2[1], 10), u2 = c2[2]; 24094 0 !== l2 && (we$2(u2, l2), Ne$2(e2, u2, c2[3]), e2.getTag().insertRules(l2, r2)), r2.length = 0; 24095 } else r2.push(a2); 24096 } 24097 } 24098 }, _e$2 = function(e2) { 24099 for (var t2 = document.querySelectorAll(be$2), n2 = 0, o2 = t2.length; n2 < o2; n2++) { 24100 var r2 = t2[n2]; 24101 r2 && r2.getAttribute(f$5) !== m$4 && (Pe$2(e2, r2), r2.parentNode && r2.parentNode.removeChild(r2)); 24102 } 24103 }; 24104 function Ce$2() { 24105 return "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null; 24106 } 24107 var Ie$2 = function(e2) { 24108 var t2 = document.head, n2 = e2 || t2, o2 = document.createElement("style"), r2 = (function(e3) { 24109 var t3 = Array.from(e3.querySelectorAll("style[".concat(f$5, "]"))); 24110 return t3[t3.length - 1]; 24111 })(n2), s2 = void 0 !== r2 ? r2.nextSibling : null; 24112 o2.setAttribute(f$5, m$4), o2.setAttribute(y$5, v$5); 24113 var i2 = Ce$2(); 24114 return i2 && o2.setAttribute("nonce", i2), n2.insertBefore(o2, s2), o2; 24115 }, Ae$2 = (function() { 24116 function e2(e3) { 24117 this.element = Ie$2(e3), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e4) { 24118 if (e4.sheet) return e4.sheet; 24119 for (var t2 = document.styleSheets, n2 = 0, o2 = t2.length; n2 < o2; n2++) { 24120 var r2 = t2[n2]; 24121 if (r2.ownerNode === e4) return r2; 24122 } 24123 throw he$2(17); 24124 })(this.element), this.length = 0; 24125 } 24126 return e2.prototype.insertRule = function(e3, t2) { 24127 try { 24128 return this.sheet.insertRule(t2, e3), this.length++, true; 24129 } catch (e4) { 24130 return false; 24131 } 24132 }, e2.prototype.deleteRule = function(e3) { 24133 this.sheet.deleteRule(e3), this.length--; 24134 }, e2.prototype.getRule = function(e3) { 24135 var t2 = this.sheet.cssRules[e3]; 24136 return t2 && t2.cssText ? t2.cssText : ""; 24137 }, e2; 24138 })(), Oe$2 = (function() { 24139 function e2(e3) { 24140 this.element = Ie$2(e3), this.nodes = this.element.childNodes, this.length = 0; 24141 } 24142 return e2.prototype.insertRule = function(e3, t2) { 24143 if (e3 <= this.length && e3 >= 0) { 24144 var n2 = document.createTextNode(t2); 24145 return this.element.insertBefore(n2, this.nodes[e3] || null), this.length++, true; 24146 } 24147 return false; 24148 }, e2.prototype.deleteRule = function(e3) { 24149 this.element.removeChild(this.nodes[e3]), this.length--; 24150 }, e2.prototype.getRule = function(e3) { 24151 return e3 < this.length ? this.nodes[e3].textContent : ""; 24152 }, e2; 24153 })(), De$2 = (function() { 24154 function e2(e3) { 24155 this.rules = [], this.length = 0; 24156 } 24157 return e2.prototype.insertRule = function(e3, t2) { 24158 return e3 <= this.length && (this.rules.splice(e3, 0, t2), this.length++, true); 24159 }, e2.prototype.deleteRule = function(e3) { 24160 this.rules.splice(e3, 1), this.length--; 24161 }, e2.prototype.getRule = function(e3) { 24162 return e3 < this.length ? this.rules[e3] : ""; 24163 }, e2; 24164 })(), Re$2 = S$2, Te$2 = { isServer: !S$2, useCSSOMInjection: !w$7 }, ke$2 = (function() { 24165 function e2(e3, n2, o2) { 24166 void 0 === e3 && (e3 = C$5), void 0 === n2 && (n2 = {}); 24167 var r2 = this; 24168 this.options = __assign$3(__assign$3({}, Te$2), e3), this.gs = n2, this.names = new Map(o2), this.server = !!e3.isServer, !this.server && S$2 && Re$2 && (Re$2 = false, _e$2(this)), ue$1(this, function() { 24169 return (function(e4) { 24170 for (var t2 = e4.getTag(), n3 = t2.length, o3 = "", r3 = function(n4) { 24171 var r4 = (function(e5) { 24172 return ve$2.get(e5); 24173 })(n4); 24174 if (void 0 === r4) return "continue";
24175 var s3 = e4.names.get(r4), i2 = t2.getGroup(n4); 24176 if (void 0 === s3 || !s3.size || 0 === i2.length) return "continue"; 24177 var a2 = "".concat(f$5, ".g").concat(n4, '[id="').concat(r4, '"]'), c2 = ""; 24178 void 0 !== s3 && s3.forEach(function(e5) { 24179 e5.length > 0 && (c2 += "".concat(e5, ",")); 24180 }), o3 += "".concat(i2).concat(a2, '{content:"').concat(c2, '"}').concat(g$3); 24181 }, s2 = 0; s2 < n3; s2++) r3(s2); 24182 return o3; 24183 })(r2); 24184 }); 24185 } 24186 return e2.registerId = function(e3) { 24187 return Se$2(e3); 24188 }, e2.prototype.rehydrate = function() { 24189 !this.server && S$2 && _e$2(this); 24190 }, e2.prototype.reconstructWithOptions = function(n2, o2) { 24191 return void 0 === o2 && (o2 = true), new e2(__assign$3(__assign$3({}, this.options), n2), this.gs, o2 && this.names || void 0); 24192 }, e2.prototype.allocateGSInstance = function(e3) { 24193 return this.gs[e3] = (this.gs[e3] || 0) + 1; 24194 }, e2.prototype.getTag = function() { 24195 return this.tag || (this.tag = (e3 = (function(e4) { 24196 var t2 = e4.useCSSOMInjection, n2 = e4.target; 24197 return e4.isServer ? new De$2(n2) : t2 ? new Ae$2(n2) : new Oe$2(n2); 24198 })(this.options), new fe$3(e3))); 24199 var e3; 24200 }, e2.prototype.hasNameForId = function(e3, t2) { 24201 return this.names.has(e3) && this.names.get(e3).has(t2); 24202 }, e2.prototype.registerName = function(e3, t2) { 24203 if (Se$2(e3), this.names.has(e3)) this.names.get(e3).add(t2); 24204 else { 24205 var n2 = /* @__PURE__ */ new Set(); 24206 n2.add(t2), this.names.set(e3, n2); 24207 } 24208 }, e2.prototype.insertRules = function(e3, t2, n2) { 24209 this.registerName(e3, t2), this.getTag().insertRules(Se$2(e3), n2); 24210 }, e2.prototype.clearNames = function(e3) { 24211 this.names.has(e3) && this.names.get(e3).clear(); 24212 }, e2.prototype.clearRules = function(e3) { 24213 this.getTag().clearGroup(Se$2(e3)), this.clearNames(e3); 24214 }, e2.prototype.clearTag = function() { 24215 this.tag = void 0; 24216 }, e2; 24217 })(), je$2 = /&/g, xe$2 = /^\s*\/\/.*$/gm; 24218 function Ve$2(e2, t2) { 24219 return e2.map(function(e3) { 24220 return "rule" === e3.type && (e3.value = "".concat(t2, " ").concat(e3.value), e3.value = e3.value.replaceAll(",", ",".concat(t2, " ")), e3.props = e3.props.map(function(e4) { 24221 return "".concat(t2, " ").concat(e4); 24222 })), Array.isArray(e3.children) && "@keyframes" !== e3.type && (e3.children = Ve$2(e3.children, t2)), e3; 24223 }); 24224 } 24225 function Fe$3(e2) { 24226 var t2, n2, o2, r2 = C$5, s2 = r2.options, i2 = void 0 === s2 ? C$5 : s2, a2 = r2.plugins, c2 = void 0 === a2 ? _$4 : a2, l2 = function(e3, o3, r3) { 24227 return r3.startsWith(n2) && r3.endsWith(n2) && r3.replaceAll(n2, "").length > 0 ? ".".concat(t2) : e3; 24228 }, u2 = c2.slice(); 24229 u2.push(function(e3) { 24230 e3.type === RULESET && e3.value.includes("&") && (e3.props[0] = e3.props[0].replace(je$2, n2).replace(o2, l2)); 24231 }), i2.prefix && u2.push(prefixer), u2.push(stringify); 24232 var p2 = function(e3, r3, s3, a3) { 24233 void 0 === r3 && (r3 = ""), void 0 === s3 && (s3 = ""), void 0 === a3 && (a3 = "&"), t2 = a3, n2 = r3, o2 = new RegExp("\\".concat(n2, "\\b"), "g"); 24234 var c3 = e3.replace(xe$2, ""), l3 = compile$1(s3 || r3 ? "".concat(s3, " ").concat(r3, " { ").concat(c3, " }") : c3); 24235 i2.namespace && (l3 = Ve$2(l3, i2.namespace)); 24236 var p3 = []; 24237 return serialize(l3, middleware(u2.concat(rulesheet(function(e4) { 24238 return p3.push(e4); 24239 })))), p3; 24240 }; 24241 return p2.hash = c2.length ? c2.reduce(function(e3, t3) { 24242 return t3.name || he$2(15), M$7(e3, t3.name); 24243 }, F$4).toString() : "", p2; 24244 } 24245 var Me$2 = new ke$2(), ze$2 = Fe$3(), $e$2 = e$3.createContext({ shouldForwardProp: void 0, styleSheet: Me$2, stylis: ze$2 }); 24246 $e$2.Consumer; 24247 e$3.createContext(void 0); 24248 function Ge$2() { 24249 return reactExports.useContext($e$2); 24250 } 24251 var We$2 = (function() { 24252 function e2(e3, t2) { 24253 var n2 = this; 24254 this.inject = function(e4, t3) { 24255 void 0 === t3 && (t3 = ze$2); 24256 var o2 = n2.name + t3.hash; 24257 e4.hasNameForId(n2.id, o2) || e4.insertRules(n2.id, o2, t3(n2.rules, o2, "@keyframes")); 24258 }, this.name = e3, this.id = "sc-keyframes-".concat(e3), this.rules = t2, ue$1(this, function() { 24259 throw he$2(12, String(n2.name)); 24260 }); 24261 } 24262 return e2.prototype.getName = function(e3) { 24263 return void 0 === e3 && (e3 = ze$2), this.name + e3.hash; 24264 }, e2; 24265 })(), qe$2 = function(e2) { 24266 return e2 >= "A" && e2 <= "Z"; 24267 }; 24268 function He$2(e2) { 24269 for (var t2 = "", n2 = 0; n2 < e2.length; n2++) { 24270 var o2 = e2[n2]; 24271 if (1 === n2 && "-" === o2 && "-" === e2[0]) return e2; 24272 qe$2(o2) ? t2 += "-" + o2.toLowerCase() : t2 += o2; 24273 } 24274 return t2.startsWith("ms-") ? "-" + t2 : t2; 24275 } 24276 var Ue$2 = function(e2) { 24277 return null == e2 || false === e2 || "" === e2; 24278 }, Je$2 = function(t2) { 24279 var n2, o2, r2 = []; 24280 for (var s2 in t2) { 24281 var i2 = t2[s2]; 24282 t2.hasOwnProperty(s2) && !Ue$2(i2) && (Array.isArray(i2) && i2.isCss || re$1(i2) ? r2.push("".concat(He$2(s2), ":"), i2, ";") : ce$1(i2) ? r2.push.apply(r2, __spreadArray$1(__spreadArray$1(["".concat(s2, " {")], Je$2(i2), false), ["}"], false)) : r2.push("".concat(He$2(s2), ": ").concat((n2 = s2, null == (o2 = i2) || "boolean" == typeof o2 || "" === o2 ? "" : "number" != typeof o2 || 0 === o2 || n2 in unitlessKeys || n2.startsWith("--") ? String(o2).trim() : "".concat(o2, "px")), ";"))); 24283 } 24284 return r2; 24285 }; 24286 function Xe$2(e2, t2, n2, o2) { 24287 if (Ue$2(e2)) return []; 24288 if (se$1(e2)) return [".".concat(e2.styledComponentId)]; 24289 if (re$1(e2)) { 24290 if (!re$1(s2 = e2) || s2.prototype && s2.prototype.isReactComponent || !t2) return [e2]; 24291 var r2 = e2(t2); 24292 return Xe$2(r2, t2, n2, o2); 24293 } 24294 var s2; 24295 return e2 instanceof We$2 ? n2 ? (e2.inject(n2, o2), [e2.getName(o2)]) : [e2] : ce$1(e2) ? Je$2(e2)
24295: Array.isArray(e2) ? Array.prototype.concat.apply(_$4, e2.map(function(e3) { 24296 return Xe$2(e3, t2, n2, o2); 24297 })) : [e2.toString()]; 24298 } 24299 function Ze$2(e2) { 24300 for (var t2 = 0; t2 < e2.length; t2 += 1) { 24301 var n2 = e2[t2]; 24302 if (re$1(n2) && !se$1(n2)) return false; 24303 } 24304 return true; 24305 } 24306 var Ke$2 = z$4(v$5), Qe$1 = (function() { 24307 function e2(e3, t2, n2) { 24308 this.rules = e3, this.staticRulesId = "", this.isStatic = (void 0 === n2 || n2.isStatic) && Ze$2(e3), this.componentId = t2, this.baseHash = M$7(Ke$2, t2), this.baseStyle = n2, ke$2.registerId(t2); 24309 } 24310 return e2.prototype.generateAndInjectStyles = function(e3, t2, n2) { 24311 var o2 = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e3, t2, n2) : ""; 24312 if (this.isStatic && !n2.hash) if (this.staticRulesId && t2.hasNameForId(this.componentId, this.staticRulesId)) o2 = ie$1(o2, this.staticRulesId); 24313 else { 24314 var r2 = ae$1(Xe$2(this.rules, e3, t2, n2)), s2 = x$4(M$7(this.baseHash, r2) >>> 0); 24315 if (!t2.hasNameForId(this.componentId, s2)) { 24316 var i2 = n2(r2, ".".concat(s2), void 0, this.componentId); 24317 t2.insertRules(this.componentId, s2, i2); 24318 } 24319 o2 = ie$1(o2, s2), this.staticRulesId = s2; 24320 } 24321 else { 24322 for (var a2 = M$7(this.baseHash, n2.hash), c2 = "", l2 = 0; l2 < this.rules.length; l2++) { 24323 var u2 = this.rules[l2]; 24324 if ("string" == typeof u2) c2 += u2; 24325 else if (u2) { 24326 var p2 = ae$1(Xe$2(u2, e3, t2, n2)); 24327 a2 = M$7(a2, p2 + l2), c2 += p2; 24328 } 24329 } 24330 if (c2) { 24331 var d2 = x$4(a2 >>> 0); 24332 t2.hasNameForId(this.componentId, d2) || t2.insertRules(this.componentId, d2, n2(c2, ".".concat(d2), void 0, this.componentId)), o2 = ie$1(o2, d2); 24333 } 24334 } 24335 return o2; 24336 }, e2; 24337 })(), et$1 = e$3.createContext(void 0); 24338 et$1.Consumer; 24339 var rt$1 = {}; 24340 function it$1(e2, r2, s2) { 24341 var i2 = se$1(e2), a2 = e2, c2 = !L$5(e2), p2 = r2.attrs, d2 = void 0 === p2 ? _$4 : p2, h2 = r2.componentId, f2 = void 0 === h2 ? (function(e3, t2) { 24342 var n2 = "string" != typeof e3 ? "sc" : R$5(e3); 24343 rt$1[n2] = (rt$1[n2] || 0) + 1; 24344 var o2 = "".concat(n2, "-").concat($$5(v$5 + n2 + rt$1[n2])); 24345 return t2 ? "".concat(t2, "-").concat(o2) : o2; 24346 })(r2.displayName, r2.parentComponentId) : h2, m2 = r2.displayName, y2 = void 0 === m2 ? (function(e3) { 24347 return L$5(e3) ? "styled.".concat(e3) : "Styled(".concat(B$2(e3), ")"); 24348 })(e2) : m2, g2 = r2.displayName && r2.componentId ? "".concat(R$5(r2.displayName), "-").concat(r2.componentId) : r2.componentId || f2, S2 = i2 && a2.attrs ? a2.attrs.concat(d2).filter(Boolean) : d2, w2 = r2.shouldForwardProp; 24349 if (i2 && a2.shouldForwardProp) { 24350 var b2 = a2.shouldForwardProp; 24351 if (r2.shouldForwardProp) { 24352 var E2 = r2.shouldForwardProp; 24353 w2 = function(e3, t2) { 24354 return b2(e3, t2) && E2(e3, t2); 24355 }; 24356 } else w2 = b2; 24357 } 24358 var N2 = new Qe$1(s2, g2, i2 ? a2.componentStyle : void 0); 24359 function O2(e3, r3) { 24360 return (function(e4, r4, s3) { 24361 var i3 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p3 = e4.foldedComponentIds, d3 = e4.styledComponentId, h3 = e4.target, f3 = e$3.useContext(et$1), m3 = Ge$2(), y3 = e4.shouldForwardProp || m3.shouldForwardProp; 24362 var v2 = I$3(r4, f3, c3) || C$5, g3 = (function(e5, n2, o2) { 24363 for (var r5, s4 = __assign$3(__assign$3({}, n2), { className: void 0, theme: o2 }), i4 = 0; i4 < e5.length; i4 += 1) { 24364 var a4 = re$1(r5 = e5[i4]) ? r5(s4) : r5; 24365 for (var c4 in a4) s4[c4] = "className" === c4 ? ie$1(s4[c4], a4[c4]) : "style" === c4 ? __assign$3(__assign$3({}, s4[c4]), a4[c4]) : a4[c4]; 24366 } 24367 return n2.className && (s4.className = ie$1(s4.className, n2.className)), s4; 24368 })(i3, r4, v2), S3 = g3.as || h3, w3 = {}; 24369 for (var b3 in g3) void 0 === g3[b3] || "$" === b3[0] || "as" === b3 || "theme" === b3 && g3.theme === v2 || ("forwardedAs" === b3 ? w3.as = g3.forwardedAs : y3 && !y3(b3, S3) || (w3[b3] = g3[b3], y3 || true)); 24370 var E3 = (function(e5, t2) { 24371 var n2 = Ge$2(), o2 = e5.generateAndInjectStyles(t2, n2.styleSheet, n2.stylis); 24372 return o2; 24373 })(a3, g3); 24374 var N3 = ie$1(p3, d3); 24375 return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L$5(S3) && !A$4.has(S3) ? "class" : "className"] = N3, s3 && (w3.ref = s3), reactExports.createElement(S3, w3); 24376 })(D2, e3, r3); 24377 } 24378 O2.displayName = y2; 24379 var D2 = e$3.forwardRef(O2); 24380 return D2.attrs = S2, D2.componentStyle = N2, D2.displayName = y2, D2.shouldForwardProp = w2, D2.foldedComponentIds = i2 ? ie$1(a2.foldedComponentIds, a2.styledComponentId) : "", D2.styledComponentId = g2, D2.target = i2 ? a2.target : e2, Object.defineProperty(D2, "defaultProps", { get: function() { 24381 return this._foldedDefaultProps; 24382 }, set: function(e3) { 24383 this._foldedDefaultProps = i2 ? (function(e4) { 24384 for (var t2 = [], n2 = 1; n2 < arguments.length; n2++) t2[n2 - 1] = arguments[n2]; 24385 for (var o2 = 0, r3 = t2; o2 < r3.length; o2++) le$1(e4, r3[o2], true); 24386 return e4; 24387 })({}, a2.defaultProps, e3) : e3; 24388 } }), ue$1(D2, function() { 24389 return ".".concat(D2.styledComponentId); 24390 }), c2 && oe$1(D2, e2, { attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, shouldForwardProp: true, styledComponentId: true, target: true }), D2; 24391 } 24392 function at$1(e2, t2) { 24393 for (var n2 = [e2[0]], o2 = 0, r2 = t2.length; o2 < r2; o2 += 1) n2.push(t2[o2], e2[o2 + 1]); 24394 return n2; 24395 } 24396 var ct$1 = function(e2) { 24397 return Object.assign(e2, { isCss: true }); 24398 }; 24399 function lt$2(t2) { 24400 for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2]; 24401 if (re$1(t2) || ce$1(t2)) return ct$1(Xe$2(at$1(_$4, __spreadArray$1([t2], n2, true)))); 24402 var r2 = t2; 24403 return 0 === n2.length && 1 === r2.length && "string" == typeof r2[0] ? Xe$2(r2) : ct$1(Xe$2(at$1(r2, n2))); 24404 } 24405 function ut$1(n2, o2, r2) { 24406 if (void 0 === r2 && (r2 = C$5), !o2) throw he$2(1, o2); 24407 var s2 = function(t2) { 24408 for (var s3 = [], i2 = 1; i2 < arguments.length; i2++) s3[i2 - 1] = arguments[i2]; 24409 return n2(o2, r2, lt$2.apply(void 0, __spreadArray$1([t2], s3, false))); 24410 }; 24411 return s2.attrs = function(e2) { 24412 return ut$1(n2, o2, __assign$3(__assign$3({}
24412, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) })); 24413 }, s2.withConfig = function(e2) { 24414 return ut$1(n2, o2, __assign$3(__assign$3({}, r2), e2)); 24415 }, s2; 24416 } 24417 var pt$2 = function(e2) { 24418 return ut$1(it$1, e2); 24419 }, dt$2 = pt$2; 24420 A$4.forEach(function(e2) { 24421 dt$2[e2] = pt$2(e2); 24422 }); 24423 var ht$3 = (function() { 24424 function e2(e3, t2) { 24425 this.rules = e3, this.componentId = t2, this.isStatic = Ze$2(e3), ke$2.registerId(this.componentId + 1); 24426 } 24427 return e2.prototype.createStyles = function(e3, t2, n2, o2) { 24428 var r2 = o2(ae$1(Xe$2(this.rules, t2, n2, o2)), ""), s2 = this.componentId + e3; 24429 n2.insertRules(s2, s2, r2); 24430 }, e2.prototype.removeStyles = function(e3, t2) { 24431 t2.clearRules(this.componentId + e3); 24432 }, e2.prototype.renderStyles = function(e3, t2, n2, o2) { 24433 e3 > 2 && ke$2.registerId(this.componentId + e3), this.removeStyles(e3, n2), this.createStyles(e3, t2, n2, o2); 24434 }, e2; 24435 })(); 24436 function ft$2(n2) { 24437 for (var r2 = [], s2 = 1; s2 < arguments.length; s2++) r2[s2 - 1] = arguments[s2]; 24438 var i2 = lt$2.apply(void 0, __spreadArray$1([n2], r2, false)), a2 = "sc-global-".concat($$5(JSON.stringify(i2))), c2 = new ht$3(i2, a2); 24439 var l2 = function(e2) { 24440 var t2 = Ge$2(), n3 = e$3.useContext(et$1), r3 = e$3.useRef(t2.styleSheet.allocateGSInstance(a2)).current; 24441 return t2.styleSheet.server && u2(r3, e2, t2.styleSheet, n3, t2.stylis), e$3.useLayoutEffect(function() { 24442 if (!t2.styleSheet.server) return u2(r3, e2, t2.styleSheet, n3, t2.stylis), function() { 24443 return c2.removeStyles(r3, t2.styleSheet); 24444 }; 24445 }, [r3, e2, t2.styleSheet, n3, t2.stylis]), null; 24446 }; 24447 function u2(e2, n3, o2, r3, s3) { 24448 if (c2.isStatic) c2.renderStyles(e2, b$4, o2, s3); 24449 else { 24450 var i3 = __assign$3(__assign$3({}, n3), { theme: I$3(n3, r3, l2.defaultProps) }); 24451 c2.renderStyles(e2, i3, o2, s3); 24452 } 24453 } 24454 return e$3.memo(l2); 24455 } 24456 function mt$2(t2) { 24457 for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2]; 24458 var r2 = ae$1(lt$2.apply(void 0, __spreadArray$1([t2], n2, false))), s2 = $$5(r2); 24459 return new We$2(s2, r2); 24460 } 24461 var freeGlobal = typeof global == "object" && global && global.Object === Object && global; 24462 var freeSelf = typeof self == "object" && self && self.Object === Object && self; 24463 var root$1 = freeGlobal || freeSelf || Function("return this")(); 24464 var Symbol$1 = root$1.Symbol; 24465 var objectProto$h = Object.prototype; 24466 var hasOwnProperty$e = objectProto$h.hasOwnProperty; 24467 var nativeObjectToString$1 = objectProto$h.toString; 24468 var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0; 24469 function getRawTag(value) { 24470 var isOwn = hasOwnProperty$e.call(value, symToStringTag$1), tag = value[symToStringTag$1]; 24471 try { 24472 value[symToStringTag$1] = void 0; 24473 var unmasked = true; 24474 } catch (e2) { 24475 } 24476 var result = nativeObjectToString$1.call(value); 24477 if (unmasked) { 24478 if (isOwn) { 24479 value[symToStringTag$1] = tag; 24480 } else { 24481 delete value[symToStringTag$1]; 24482 } 24483 } 24484 return result; 24485 } 24486 var objectProto$g = Object.prototype; 24487 var nativeObjectToString = objectProto$g.toString; 24488 function objectToString$1(value) { 24489 return nativeObjectToString.call(value); 24490 } 24491 var nullTag = "[object Null]", undefinedTag = "[object Undefined]"; 24492 var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0; 24493 function baseGetTag(value) { 24494 if (value == null) { 24495 return value === void 0 ? undefinedTag : nullTag; 24496 } 24497 return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString$1(value); 24498 } 24499 function isObject$3(value) { 24500 var type = typeof value; 24501 return value != null && (type == "object" || type == "function"); 24502 } 24503 var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; 24504 function isFunction$1(value) { 24505 if (!isObject$3(value)) { 24506 return false;
vendor: 5,776 bytes, lines 24507-24679
24507 } 24508 var tag = baseGetTag(value); 24509 return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag; 24510 } 24511 var coreJsData = root$1["__core-js_shared__"]; 24512 var maskSrcKey = (function() { 24513 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); 24514 return uid ? "Symbol(src)_1." + uid : ""; 24515 })(); 24516 function isMasked(func) { 24517 return !!maskSrcKey && maskSrcKey in func; 24518 } 24519 var funcProto$2 = Function.prototype; 24520 var funcToString$2 = funcProto$2.toString; 24521 function toSource(func) { 24522 if (func != null) { 24523 try { 24524 return funcToString$2.call(func); 24525 } catch (e2) { 24526 } 24527 try { 24528 return func + ""; 24529 } catch (e2) { 24530 } 24531 } 24532 return ""; 24533 } 24534 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 24535 var reIsHostCtor = /^\[object .+?Constructor\]$/; 24536 var funcProto$1 = Function.prototype, objectProto$f = Object.prototype; 24537 var funcToString$1 = funcProto$1.toString; 24538 var hasOwnProperty$d = objectProto$f.hasOwnProperty; 24539 var reIsNative = RegExp( 24540 "^" + funcToString$1.call(hasOwnProperty$d).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" 24541 ); 24542 function baseIsNative(value) { 24543 if (!isObject$3(value) || isMasked(value)) { 24544 return false; 24545 } 24546 var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor; 24547 return pattern.test(toSource(value)); 24548 } 24549 function getValue(object2, key) { 24550 return object2 == null ? void 0 : object2[key]; 24551 } 24552 function getNative(object2, key) { 24553 var value = getValue(object2, key); 24554 return baseIsNative(value) ? value : void 0; 24555 } 24556 var nativeCreate = getNative(Object, "create"); 24557 function hashClear() { 24558 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 24559 this.size = 0; 24560 } 24561 function hashDelete(key) { 24562 var result = this.has(key) && delete this.__data__[key]; 24563 this.size -= result ? 1 : 0; 24564 return result; 24565 } 24566 var HASH_UNDEFINED$2 = "__lodash_hash_undefined__"; 24567 var objectProto$e = Object.prototype; 24568 var hasOwnProperty$c = objectProto$e.hasOwnProperty; 24569 function hashGet(key) { 24570 var data = this.__data__; 24571 if (nativeCreate) { 24572 var result = data[key]; 24573 return result === HASH_UNDEFINED$2 ? void 0 : result; 24574 } 24575 return hasOwnProperty$c.call(data, key) ? data[key] : void 0; 24576 } 24577 var objectProto$d = Object.prototype; 24578 var hasOwnProperty$b = objectProto$d.hasOwnProperty; 24579 function hashHas(key) { 24580 var data = this.__data__; 24581 return nativeCreate ? data[key] !== void 0 : hasOwnProperty$b.call(data, key); 24582 } 24583 var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; 24584 function hashSet(key, value) { 24585 var data = this.__data__; 24586 this.size += this.has(key) ? 0 : 1; 24587 data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value; 24588 return this; 24589 } 24590 function Hash(entries2) { 24591 var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; 24592 this.clear(); 24593 while (++index2 < length2) { 24594 var entry = entries2[index2]; 24595 this.set(entry[0], entry[1]); 24596 } 24597 } 24598 Hash.prototype.clear = hashClear; 24599 Hash.prototype["delete"] = hashDelete; 24600 Hash.prototype.get = hashGet; 24601 Hash.prototype.has = hashHas; 24602 Hash.prototype.set = hashSet; 24603 function listCacheClear() { 24604 this.__data__ = []; 24605 this.size = 0; 24606 } 24607 function eq(value, other) { 24608 return value === other || value !== value && other !== other; 24609 } 24610 function assocIndexOf(array2, key) { 24611 var length2 = array2.length; 24612 while (length2--) { 24613 if (eq(array2[length2][0], key)) { 24614 return length2; 24615 } 24616 } 24617 return -1; 24618 } 24619 var arrayProto = Array.prototype; 24620 var splice = arrayProto.splice; 24621 function listCacheDelete(key) { 24622 var data = this.__data__, index2 = assocIndexOf(data, key); 24623 if (index2 < 0) { 24624 return false; 24625 } 24626 var lastIndex = data.length - 1; 24627 if (index2 == lastIndex) { 24628 data.pop(); 24629 } else { 24630 splice.call(data, index2, 1); 24631 } 24632 --this.size; 24633 return true; 24634 } 24635 function listCacheGet(key) { 24636 var data = this.__data__, index2 = assocIndexOf(data, key); 24637 return index2 < 0 ? void 0 : data[index2][1]; 24638 } 24639 function listCacheHas(key) { 24640 return assocIndexOf(this.__data__, key) > -1; 24641 } 24642 function listCacheSet(key, value) { 24643 var data = this.__data__, index2 = assocIndexOf(data, key); 24644 if (index2 < 0) { 24645 ++this.size; 24646 data.push([key, value]); 24647 } else { 24648 data[index2][1] = value; 24649 } 24650 return this; 24651 } 24652 function ListCache(entries2) { 24653 var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; 24654 this.clear(); 24655 while (++index2 < length2) { 24656 var entry = entries2[index2]; 24657 this.set(entry[0], entry[1]); 24658 } 24659 } 24660 ListCache.prototype.clear = listCacheClear; 24661 ListCache.prototype["delete"] = listCacheDelete; 24662 ListCache.prototype.get = listCacheGet; 24663 ListCache.prototype.has = listCacheHas; 24664 ListCache.prototype.set = listCacheSet; 24665 var Map$1 = getNative(root$1, "Map"); 24666 function mapCacheClear() { 24667 this.size = 0; 24668 this.__data__ = { 24669 "hash": new Hash(), 24670 "map": new (Map$1 || ListCache)(), 24671 "string": new Hash() 24672 }; 24673 } 24674 function isKeyable(value) { 24675 var type = typeof value; 24676 return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; 24677 } 24678 function getMapData(map2, key) { 24679 var data = map2.__data__;
vendor: 6,395 bytes, lines 24680-24890
24680 return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; 24681 } 24682 function mapCacheDelete(key) { 24683 var result = getMapData(this, key)["delete"](key); 24684 this.size -= result ? 1 : 0; 24685 return result; 24686 } 24687 function mapCacheGet(key) { 24688 return getMapData(this, key).get(key); 24689 } 24690 function mapCacheHas(key) { 24691 return getMapData(this, key).has(key); 24692 } 24693 function mapCacheSet(key, value) { 24694 var data = getMapData(this, key), size = data.size; 24695 data.set(key, value); 24696 this.size += data.size == size ? 0 : 1; 24697 return this; 24698 } 24699 function MapCache(entries2) { 24700 var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; 24701 this.clear(); 24702 while (++index2 < length2) { 24703 var entry = entries2[index2]; 24704 this.set(entry[0], entry[1]); 24705 } 24706 } 24707 MapCache.prototype.clear = mapCacheClear; 24708 MapCache.prototype["delete"] = mapCacheDelete; 24709 MapCache.prototype.get = mapCacheGet; 24710 MapCache.prototype.has = mapCacheHas; 24711 MapCache.prototype.set = mapCacheSet; 24712 var HASH_UNDEFINED = "__lodash_hash_undefined__"; 24713 function setCacheAdd(value) { 24714 this.__data__.set(value, HASH_UNDEFINED); 24715 return this; 24716 } 24717 function setCacheHas(value) { 24718 return this.__data__.has(value); 24719 } 24720 function SetCache(values) { 24721 var index2 = -1, length2 = values == null ? 0 : values.length; 24722 this.__data__ = new MapCache(); 24723 while (++index2 < length2) { 24724 this.add(values[index2]); 24725 } 24726 } 24727 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 24728 SetCache.prototype.has = setCacheHas; 24729 function arrayMap(array2, iteratee) { 24730 var index2 = -1, length2 = array2 == null ? 0 : array2.length, result = Array(length2); 24731 while (++index2 < length2) { 24732 result[index2] = iteratee(array2[index2], index2, array2); 24733 } 24734 return result; 24735 } 24736 function baseUnary(func) { 24737 return function(value) { 24738 return func(value); 24739 }; 24740 } 24741 function cacheHas(cache, key) { 24742 return cache.has(key); 24743 } 24744 function identity(value) { 24745 return value; 24746 } 24747 function apply$1(func, thisArg, args) { 24748 switch (args.length) { 24749 case 0: 24750 return func.call(thisArg); 24751 case 1: 24752 return func.call(thisArg, args[0]); 24753 case 2: 24754 return func.call(thisArg, args[0], args[1]); 24755 case 3: 24756 return func.call(thisArg, args[0], args[1], args[2]); 24757 } 24758 return func.apply(thisArg, args); 24759 } 24760 var nativeMax = Math.max; 24761 function overRest(func, start, transform2) { 24762 start = nativeMax(start === void 0 ? func.length - 1 : start, 0); 24763 return function() { 24764 var args = arguments, index2 = -1, length2 = nativeMax(args.length - start, 0), array2 = Array(length2); 24765 while (++index2 < length2) { 24766 array2[index2] = args[start + index2]; 24767 } 24768 index2 = -1; 24769 var otherArgs = Array(start + 1); 24770 while (++index2 < start) { 24771 otherArgs[index2] = args[index2]; 24772 } 24773 otherArgs[start] = transform2(array2); 24774 return apply$1(func, this, otherArgs); 24775 }; 24776 } 24777 function constant(value) { 24778 return function() { 24779 return value; 24780 }; 24781 } 24782 var defineProperty = (function() { 24783 try { 24784 var func = getNative(Object, "defineProperty"); 24785 func({}, "", {}); 24786 return func; 24787 } catch (e2) { 24788 } 24789 })(); 24790 var baseSetToString = !defineProperty ? identity : function(func, string2) { 24791 return defineProperty(func, "toString", { 24792 "configurable": true, 24793 "enumerable": false, 24794 "value": constant(string2), 24795 "writable": true 24796 }); 24797 }; 24798 var HOT_COUNT = 800, HOT_SPAN = 16; 24799 var nativeNow = Date.now; 24800 function shortOut(func) { 24801 var count2 = 0, lastCalled = 0; 24802 return function() { 24803 var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); 24804 lastCalled = stamp; 24805 if (remaining > 0) { 24806 if (++count2 >= HOT_COUNT) { 24807 return arguments[0]; 24808 } 24809 } else { 24810 count2 = 0; 24811 } 24812 return func.apply(void 0, arguments); 24813 }; 24814 } 24815 var setToString = shortOut(baseSetToString); 24816 function baseRest(func, start) { 24817 return setToString(overRest(func, start, identity), func + ""); 24818 } 24819 var MAX_SAFE_INTEGER$1 = 9007199254740991; 24820 function isLength(value) { 24821 return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1; 24822 } 24823 function isArrayLike(value) { 24824 return value != null && isLength(value.length) && !isFunction$1(value); 24825 } 24826 function isObjectLike(value) { 24827 return value != null && typeof value == "object"; 24828 } 24829 function isArrayLikeObject(value) { 24830 return isObjectLike(value) && isArrayLike(value); 24831 } 24832 const sizeStylesMap$1 = { 24833 small: lt$2` 24834 font-size: var(--font-size-200); 24835 line-height: var(--font-line-height-200); 24836 letter-spacing: var(--font-letter-spacing-looser); 24837 gap: var(--space-150); 24838 `, 24839 medium: lt$2` 24840 font-size: var(--font-size-300); 24841 line-height: var(--font-line-height-300); 24842 letter-spacing: var(--font-letter-spacing-loose); 24843 gap: var(--space-200); 24844 `, 24845 large: lt$2` 24846 font-size: var(--font-size-400); 24847 line-height: var(--font-line-height-400); 24848 letter-spacing: var(--font-letter-spacing-normal); 24849 gap: var(--space-200); 24850 ` 24851 }; 24852 const variantStylesMap = { 24853 primary: lt$2` 24854 color: var(--text-primary); 24855 &:hover, 24856 &:active { 24857 color: var(--text-secondary); 24858 } 24859 `, 24860 secondary: lt$2` 24861 color: var(--text-secondary); 24862 &:hover, 24863 &:active { 24864 color: var(--text-primary); 24865 } 24866 `, 24867 brand: lt$2` 24868 color: var(--text-link); 24869 &:hover, 24870 &:active { 24871 color: var(--text-link-secondary); 24872 } 24873 ` 24874 }; 24875 const Container$v = dt$2.button` 24876 display: inline-flex; 24877 align-items: center; 24878 min-height: 1lh; 24879 text-align: left; 24880 font-family: var(--font-family-body); 24881 font-weight: var(--font-weight-400); 24882 &:is(a, button):not(:disabled) { 24883 cursor: pointer; 24884 } 24885 ${({ $size }) => sizeStylesMap$1[$size]}; 24886 ${({ $variant }) => variantStylesMap[$variant]}; 24887 ${({ $disabled }) => $disabled && lt$2` 24888 opacity: 0.5; 24889 &, 24890 &:is(a, button) {
24891 cursor: not-allowed; 24892 } 24893 `} 24894 & > svg { 24895 flex-shrink: 0; 24896 } 24897`; 24898 const Label$5 = dt$2.span` 24899 text-box: trim-both cap alphabetic; 24900`; 24901 const iconSizeMap$2 = { 24902 small: 12, 24903 medium: 14, 24904 large: 16 24905 }; 24906 const getComponent$3 = ({ to: to2, onClick, disabled }) => { 24907 if (to2 && !disabled) return Link; 24908 if (onClick) return "button"; 24909 return "div"; 24910 }; 24911 const TextButton = ({ 24912 label, 24913 icon: Icon2, 24914 variant = "primary", 24915 size = "medium", 24916 testid = "TextButton", 24917 disabled, 24918 to: to2, 24919 state, 24920 onClick 24921 }) => { 24922 const component = getComponent$3({ to: to2, onClick, disabled }); 24923 const isButton = component === "button"; 24924 const isLink = component === Link; 24925 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 24926 Container$v, 24927 { 24928 as: component, 24929 type: isButton ? "button" : void 0, 24930 disabled: isButton ? disabled : void 0, 24931 "aria-disabled": !isButton && disabled ? true : void 0, 24932 $disabled: disabled, 24933 to: isLink ? to2 : void 0, 24934 state: isLink ? state : void 0, 24935 onClick, 24936 "data-testid": testid, 24937 $size: size, 24938 $variant: variant, 24939 children: [ 24940 Icon2 && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { width: iconSizeMap$2[size], height: iconSizeMap$2[size], "aria-hidden": true }),
24941 /* @__PURE__ */ jsxRuntimeExports.jsx(Label$5, { children: label }) 24942 ] 24943 } 24944 ); 24945 }; 24946 var symbolTag$3 = "[object Symbol]"; 24947 function isSymbol(value) { 24948 return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3; 24949 } 24950 var pe$2 = () => { 24951 let e2 = reactExports.useRef(null); 24952 return [e2, () => { 24953 var _a; 24954 (_a = e2.current) == null ? void 0 : _a.focus(); 24955 }]; 24956 }; 24957 var V$3 = class V { 24958 constructor() { 24959 __publicField(this, "setItem", (t2, r2) => { 24960 localStorage.setItem(t2, r2); 24961 }); 24962 __publicField(this, "setObjectItem", (t2, r2) => { 24963 this.setItem(t2, JSON.stringify(r2)); 24964 }); 24965 __publicField(this, "getItem", (t2) => localStorage.getItem(t2)); 24966 __publicField(this, "getObjectItem", (t2) => { 24967 try { 24968 return JSON.parse(this.getItem(t2) || ""); 24969 } catch (e2) { 24970 return; 24971 } 24972 }); 24973 __publicField(this, "removeItem", (t2) => { 24974 localStorage.removeItem(t2); 24975 }); 24976 } 24977 }, L$4 = new V$3(), H$3 = (e2) => ({ localStorage: reactExports.useMemo(() => ({ get: (r2) => { 24978 let o2 = L$4.getObjectItem(e2); 24979 return o2 ? o2[r2] : void 0; 24980 }, set: (r2, o2) => { 24981 let s2 = L$4.getObjectItem(e2); 24982 return L$4.setObjectItem(e2, __spreadProps(__spreadValues({}, s2), { [r2]: o2 })); 24983 }, clear: () => { 24984 L$4.removeItem(e2); 24985 } }), [e2]) }); 24986 function baseAssignValue(object2, key, value) { 24987 if (key == "__proto__" && defineProperty) { 24988 defineProperty(object2, key, { 24989 "configurable": true, 24990 "enumerable": true, 24991 "value": value, 24992 "writable": true 24993 }); 24994 } else { 24995 object2[key] = value; 24996 } 24997 } 24998 function createBaseFor(fromRight) { 24999 return function(object2, iteratee, keysFunc) { 25000 var index2 = -1, iterable = Object(object2), props = keysFunc(object2), length2 = props.length; 25001 while (length2--) { 25002 var key = props[++index2]; 25003 if (iteratee(iterable[key], key, iterable) === false) { 25004 break; 25005 } 25006 } 25007 return object2; 25008 }; 25009 } 25010 var baseFor = createBaseFor(); 25011 function baseTimes(n2, iteratee) { 25012 var index2 = -1, result = Array(n2); 25013 while (++index2 < n2) { 25014 result[index2] = iteratee(index2); 25015 } 25016 return result; 25017 } 25018 var argsTag$3 = "[object Arguments]"; 25019 function baseIsArguments(value) { 25020 return isObjectLike(value) && baseGetTag(value) == argsTag$3; 25021 } 25022 var objectProto$c = Object.prototype; 25023 var hasOwnProperty$a = objectProto$c.hasOwnProperty; 25024 var propertyIsEnumerable$1 = objectProto$c.propertyIsEnumerable; 25025 var isArguments = baseIsArguments(/* @__PURE__ */ (function() { 25026 return arguments; 25027 })()) ? baseIsArguments : function(value) { 25028 return isObjectLike(value) && hasOwnProperty$a.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee"); 25029 }; 25030 var isArray = Array.isArray; 25031 function stubFalse() { 25032 return false; 25033 } 25034 var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports; 25035 var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module; 25036 var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2; 25037 var Buffer$2 = moduleExports$2 ? root$1.Buffer : void 0; 25038 var nativeIsBuffer = Buffer$2 ? Buffer$2.isBuffer : void 0; 25039 var isBuffer = nativeIsBuffer || stubFalse; 25040 var MAX_SAFE_INTEGER = 9007199254740991; 25041 var reIsUint = /^(?:0|[1-9]\d*)$/; 25042 function isIndex(value, length2) { 25043 var type = typeof value; 25044 length2 = length2 == null ? MAX_SAFE_INTEGER : length2; 25045 return !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2); 25046 } 25047 var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$6 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$6 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]"; 25048 var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array
25048]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]"; 25049 var typedArrayTags = {}; 25050 typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true; 25051 typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$6] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$6] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false; 25052 function baseIsTypedArray(value) { 25053 return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 25054 } 25055 var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports; 25056 var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module; 25057 var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; 25058 var freeProcess = moduleExports$1 && freeGlobal.process; 25059 var nodeUtil = (function() { 25060 try { 25061 var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types; 25062 if (types) { 25063 return types; 25064 } 25065 return freeProcess && freeProcess.binding && freeProcess.binding("util"); 25066 } catch (e2) { 25067 } 25068 })(); 25069 var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 25070 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 25071 var objectProto$b = Object.prototype; 25072 var hasOwnProperty$9 = objectProto$b.hasOwnProperty; 25073 function arrayLikeKeys(value, inherited) { 25074 var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length; 25075 for (var key in value) { 25076 if ((inherited || hasOwnProperty$9.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. 25077 (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. 25078 isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. 25079 isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. 25080 isIndex(key, length2)))) { 25081 result.push(key); 25082 } 25083 } 25084 return result; 25085 } 25086 var objectProto$a = Object.prototype; 25087 function isPrototype(value) { 25088 var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$a; 25089 return value === proto; 25090 } 25091 function overArg(func, transform2) { 25092 return function(arg) { 25093 return func(transform2(arg)); 25094 }; 25095 } 25096 var nativeKeys = overArg(Object.keys, Object); 25097 var objectProto$9 = Object.prototype; 25098 var hasOwnProperty$8 = objectProto$9.hasOwnProperty; 25099 function baseKeys(object2) { 25100 if (!isPrototype(object2)) { 25101 return nativeKeys(object2); 25102 } 25103 var result = []; 25104 for (var key in Object(object2)) { 25105 if (hasOwnProperty$8.call(object2, key) && key != "constructor") { 25106 result.push(key); 25107 } 25108 } 25109 return result; 25110 } 25111 function keys(object2) { 25112 return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2); 25113 } 25114 function baseForOwn(object2, iteratee) { 25115 return object2 && baseFor(object2, iteratee, keys); 25116 } 25117 function stackClear() {
vendor: 2,574 bytes, lines 25118-25189
25118 this.__data__ = new ListCache(); 25119 this.size = 0; 25120 } 25121 function stackDelete(key) { 25122 var data = this.__data__, result = data["delete"](key); 25123 this.size = data.size; 25124 return result; 25125 } 25126 function stackGet(key) { 25127 return this.__data__.get(key); 25128 } 25129 function stackHas(key) { 25130 return this.__data__.has(key); 25131 } 25132 var LARGE_ARRAY_SIZE = 200; 25133 function stackSet(key, value) { 25134 var data = this.__data__; 25135 if (data instanceof ListCache) { 25136 var pairs = data.__data__; 25137 if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) { 25138 pairs.push([key, value]); 25139 this.size = ++data.size; 25140 return this; 25141 } 25142 data = this.__data__ = new MapCache(pairs); 25143 } 25144 data.set(key, value); 25145 this.size = data.size; 25146 return this; 25147 } 25148 function Stack(entries2) { 25149 var data = this.__data__ = new ListCache(entries2); 25150 this.size = data.size; 25151 } 25152 Stack.prototype.clear = stackClear; 25153 Stack.prototype["delete"] = stackDelete; 25154 Stack.prototype.get = stackGet; 25155 Stack.prototype.has = stackHas; 25156 Stack.prototype.set = stackSet; 25157 function arraySome(array2, predicate) { 25158 var index2 = -1, length2 = array2 == null ? 0 : array2.length; 25159 while (++index2 < length2) { 25160 if (predicate(array2[index2], index2, array2)) { 25161 return true; 25162 } 25163 } 25164 return false; 25165 } 25166 var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2; 25167 function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) { 25168 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array2.length, othLength = other.length; 25169 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 25170 return false; 25171 } 25172 var arrStacked = stack.get(array2); 25173 var othStacked = stack.get(other); 25174 if (arrStacked && othStacked) { 25175 return arrStacked == other && othStacked == array2; 25176 } 25177 var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0; 25178 stack.set(array2, other); 25179 stack.set(other, array2); 25180 while (++index2 < arrLength) { 25181 var arrValue = array2[index2], othValue = other[index2]; 25182 if (customizer) { 25183 var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack); 25184 } 25185 if (compared !== void 0) { 25186 if (compared) { 25187 continue; 25188 } 25189 result = false;
vendor: 4,273 bytes, lines 25190-25300
25190 break; 25191 } 25192 if (seen) { 25193 if (!arraySome(other, function(othValue2, othIndex) { 25194 if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { 25195 return seen.push(othIndex); 25196 } 25197 })) { 25198 result = false; 25199 break; 25200 } 25201 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 25202 result = false; 25203 break; 25204 } 25205 } 25206 stack["delete"](array2); 25207 stack["delete"](other); 25208 return result; 25209 } 25210 var Uint8Array$1 = root$1.Uint8Array; 25211 function mapToArray(map2) { 25212 var index2 = -1, result = Array(map2.size); 25213 map2.forEach(function(value, key) { 25214 result[++index2] = [key, value]; 25215 }); 25216 return result; 25217 } 25218 function setToArray(set2) { 25219 var index2 = -1, result = Array(set2.size); 25220 set2.forEach(function(value) { 25221 result[++index2] = value; 25222 }); 25223 return result; 25224 } 25225 var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2; 25226 var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", mapTag$5 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]"; 25227 var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]"; 25228 var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : void 0; 25229 function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) { 25230 switch (tag) { 25231 case dataViewTag$3: 25232 if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) { 25233 return false; 25234 } 25235 object2 = object2.buffer; 25236 other = other.buffer; 25237 case arrayBufferTag$2: 25238 if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object2), new Uint8Array$1(other))) { 25239 return false; 25240 } 25241 return true; 25242 case boolTag$2: 25243 case dateTag$2: 25244 case numberTag$2: 25245 return eq(+object2, +other); 25246 case errorTag$1: 25247 return object2.name == other.name && object2.message == other.message; 25248 case regexpTag$2: 25249 case stringTag$2: 25250 return object2 == other + ""; 25251 case mapTag$5: 25252 var convert = mapToArray; 25253 case setTag$5: 25254 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4; 25255 convert || (convert = setToArray); 25256 if (object2.size != other.size && !isPartial) { 25257 return false; 25258 } 25259 var stacked = stack.get(object2); 25260 if (stacked) { 25261 return stacked == other; 25262 } 25263 bitmask |= COMPARE_UNORDERED_FLAG$2; 25264 stack.set(object2, other); 25265 var result = equalArrays(convert(object2), convert(other), bitmask, customizer, equalFunc, stack); 25266 stack["delete"](object2); 25267 return result; 25268 case symbolTag$2: 25269 if (symbolValueOf$1) { 25270 return symbolValueOf$1.call(object2) == symbolValueOf$1.call(other); 25271 } 25272 } 25273 return false; 25274 } 25275 function arrayPush$1(array2, values) { 25276 var index2 = -1, length2 = values.length, offset2 = array2.length; 25277 while (++index2 < length2) { 25278 array2[offset2 + index2] = values[index2]; 25279 } 25280 return array2; 25281 } 25282 function baseGetAllKeys(object2, keysFunc, symbolsFunc) { 25283 var result = keysFunc(object2); 25284 return isArray(object2) ? result : arrayPush$1(result, symbolsFunc(object2)); 25285 } 25286 function arrayFilter(array2, predicate) { 25287 var index2 = -1, length2 = array2 == null ? 0 : array2.length, resIndex = 0, result = []; 25288 while (++index2 < length2) { 25289 var value = array2[index2]; 25290 if (predicate(value, index2, array2)) { 25291 result[resIndex++] = value; 25292 } 25293 } 25294 return result; 25295 } 25296 function stubArray() { 25297 return []; 25298 } 25299 var objectProto$8 = Object.prototype; 25300 var propertyIsEnumerable = objectProto$8.propertyIsEnumerable;
vendor: 1,952 bytes, lines 25301-25345
25301 var nativeGetSymbols$1 = Object.getOwnPropertySymbols; 25302 var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object2) { 25303 if (object2 == null) { 25304 return []; 25305 } 25306 object2 = Object(object2); 25307 return arrayFilter(nativeGetSymbols$1(object2), function(symbol) { 25308 return propertyIsEnumerable.call(object2, symbol); 25309 }); 25310 }; 25311 function getAllKeys(object2) { 25312 return baseGetAllKeys(object2, keys, getSymbols); 25313 } 25314 var COMPARE_PARTIAL_FLAG$3 = 1; 25315 var objectProto$7 = Object.prototype; 25316 var hasOwnProperty$7 = objectProto$7.hasOwnProperty; 25317 function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) { 25318 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; 25319 if (objLength != othLength && !isPartial) { 25320 return false; 25321 } 25322 var index2 = objLength; 25323 while (index2--) { 25324 var key = objProps[index2]; 25325 if (!(isPartial ? key in other : hasOwnProperty$7.call(other, key))) { 25326 return false; 25327 } 25328 } 25329 var objStacked = stack.get(object2); 25330 var othStacked = stack.get(other); 25331 if (objStacked && othStacked) { 25332 return objStacked == other && othStacked == object2; 25333 } 25334 var result = true; 25335 stack.set(object2, other); 25336 stack.set(other, object2); 25337 var skipCtor = isPartial; 25338 while (++index2 < objLength) { 25339 key = objProps[index2]; 25340 var objValue = object2[key], othValue = other[key]; 25341 if (customizer) { 25342 var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack); 25343 } 25344 if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { 25345 result = false;
vendor: 10,086 bytes, lines 25346-25588
25346 break; 25347 } 25348 skipCtor || (skipCtor = key == "constructor"); 25349 } 25350 if (result && !skipCtor) { 25351 var objCtor = object2.constructor, othCtor = other.constructor; 25352 if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { 25353 result = false; 25354 } 25355 } 25356 stack["delete"](object2); 25357 stack["delete"](other); 25358 return result; 25359 } 25360 var DataView = getNative(root$1, "DataView"); 25361 var Promise$1 = getNative(root$1, "Promise"); 25362 var Set$1 = getNative(root$1, "Set"); 25363 var WeakMap$1 = getNative(root$1, "WeakMap"); 25364 var mapTag$4 = "[object Map]", objectTag$3 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]"; 25365 var dataViewTag$2 = "[object DataView]"; 25366 var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1); 25367 var getTag = baseGetTag; 25368 if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) { 25369 getTag = function(value) { 25370 var result = baseGetTag(value), Ctor = result == objectTag$3 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; 25371 if (ctorString) { 25372 switch (ctorString) { 25373 case dataViewCtorString: 25374 return dataViewTag$2; 25375 case mapCtorString: 25376 return mapTag$4; 25377 case promiseCtorString: 25378 return promiseTag; 25379 case setCtorString: 25380 return setTag$4; 25381 case weakMapCtorString: 25382 return weakMapTag$1; 25383 } 25384 } 25385 return result; 25386 }; 25387 } 25388 var COMPARE_PARTIAL_FLAG$2 = 1; 25389 var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", objectTag$2 = "[object Object]"; 25390 var objectProto$6 = Object.prototype; 25391 var hasOwnProperty$6 = objectProto$6.hasOwnProperty; 25392 function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) { 25393 var objIsArr = isArray(object2), othIsArr = isArray(other), objTag = objIsArr ? arrayTag$1 : getTag(object2), othTag = othIsArr ? arrayTag$1 : getTag(other); 25394 objTag = objTag == argsTag$1 ? objectTag$2 : objTag; 25395 othTag = othTag == argsTag$1 ? objectTag$2 : othTag; 25396 var objIsObj = objTag == objectTag$2, othIsObj = othTag == objectTag$2, isSameTag = objTag == othTag; 25397 if (isSameTag && isBuffer(object2)) { 25398 if (!isBuffer(other)) { 25399 return false; 25400 } 25401 objIsArr = true; 25402 objIsObj = false; 25403 } 25404 if (isSameTag && !objIsObj) { 25405 stack || (stack = new Stack()); 25406 return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack); 25407 } 25408 if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) { 25409 var objIsWrapped = objIsObj && hasOwnProperty$6.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$6.call(other, "__wrapped__"); 25410 if (objIsWrapped || othIsWrapped) { 25411 var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other; 25412 stack || (stack = new Stack()); 25413 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 25414 } 25415 } 25416 if (!isSameTag) { 25417 return false; 25418 } 25419 stack || (stack = new Stack()); 25420 return equalObjects(object2, other, bitmask, customizer, equalFunc, stack); 25421 } 25422 function baseIsEqual(value, other, bitmask, customizer, stack) { 25423 if (value === other) { 25424 return true; 25425 } 25426 if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { 25427 return value !== value && other !== other; 25428 } 25429 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 25430 } 25431 var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; 25432 function baseIsMatch(object2, source, matchData, customizer) { 25433 var index2 = matchData.length, length2 = index2; 25434 if (object2 == null) { 25435 return !length2; 25436 } 25437 object2 = Object(object2); 25438 while (index2--) { 25439 var data = matchData[index2]; 25440 if (data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) { 25441 return false; 25442 } 25443 } 25444 while (++index2 < length2) { 25445 data = matchData[index2]; 25446 var key = data[0], objValue = object2[key], srcValue = data[1]; 25447 if (data[2]) { 25448 if (objValue === void 0 && !(key in object2)) { 25449 return false; 25450 } 25451 } else { 25452 var stack = new Stack(); 25453 var result; 25454 if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) { 25455 return false; 25456 } 25457 } 25458 } 25459 return true; 25460 } 25461 function isStrictComparable(value) { 25462 return value === value && !isObject$3(value); 25463 } 25464 function getMatchData(object2) { 25465 var result = keys(object2), length2 = result.length; 25466 while (length2--) { 25467 var key = result[length2], value = object2[key]; 25468 result[length2] = [key, value, isStrictComparable(value)]; 25469 } 25470 return result; 25471 } 25472 function matchesStrictComparable(key, srcValue) { 25473 return function(object2) { 25474 if (object2 == null) { 25475 return false; 25476 } 25477 return object2[key] === srcValue && (srcValue !== void 0 || key in Object(object2)); 25478 }; 25479 } 25480 function baseMatches(source) { 25481 var matchData = getMatchData(source); 25482 if (matchData.length == 1 && matchData[0][2]) { 25483 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 25484 } 25485 return function(object2) { 25486 return object2 === source || baseIsMatch(object2, source, matchData); 25487 }; 25488 } 25489 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; 25490 function isKey(value, object2) { 25491 if (isArray(value)) { 25492 return false; 25493 } 25494 var type = typeof value; 25495 if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { 25496 return true; 25497 } 25498 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object2 != null && value in Object(object2); 25499 } 25500 var FUNC_ERROR_TEXT$1 = "Expected a function"; 25501 function memoize(func, resolver) { 25502 if (typeof func != "function" || resolver != null && typeof resolver != "function") { 25503 throw new TypeError(FUNC_ERROR_TEXT$1); 25504 } 25505 var memoized = function() { 25506 var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; 25507 if (cache.has(key)) { 25508 return cache.get(key); 25509 } 25510 var result = func.apply(this, args); 25511 memoized.cache = cache.set(key, result) || cache; 25512 return result; 25513 }; 25514 memoized.cache = new (memoize.Cache || MapCache)(); 25515 return memoized; 25516 } 25517 memoize.Cache = MapCache; 25518 var MAX_MEMOIZE_SIZE = 500; 25519 function memoizeCapped(func) { 25520 var result = memoize(func, function(key) { 25521 if (cache.size === MAX_MEMOIZE_SIZE) { 25522 cache.clear(); 25523 } 25524 return key; 25525 }); 25526 var cache = result.cache; 25527 return result; 25528 } 25529 var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 25530 var reEscapeChar = /\\(\\)?/g; 25531 var stringToPath = memoizeCapped(function(string2) { 25532 var result = []; 25533 if (string2.charCodeAt(0) === 46) { 25534 result.push(""); 25535 } 25536 string2.replace(rePropName, function(match2, number2, quote, subString) { 25537 result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match2); 25538 }); 25539 return result; 25540 }); 25541 var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString$2 = symbolProto$1 ? symbolProto$1.toString : void 0; 25542 function baseToString(value) { 25543 if (typeof value == "string") { 25544 return value; 25545 } 25546 if (isArray(value)) { 25547 return arrayMap(value, baseToString) + ""; 25548 } 25549 if (isSymbol(value)) { 25550 return symbolToString$2 ? symbolToString$2.call(value) : ""; 25551 } 25552 var result = value + ""; 25553 return result == "0" && 1 / value == -Infinity ? "-0" : result; 25554 } 25555 function toString$1(value) { 25556 return value == null ? "" : baseToString(value); 25557 } 25558 function castPath(value, object2) { 25559 if (isArray(value)) { 25560 return value; 25561 } 25562 return isKey(value, object2) ? [value] : stringToPath(toString$1(value)); 25563 } 25564 function toKey(value) { 25565 if (typeof value == "string" || isSymbol(value)) { 25566 return value; 25567 } 25568 var result = value + ""; 25569 return result == "0" && 1 / value == -Infinity ? "-0" : result; 25570 } 25571 function baseGet(object2, path) { 25572 path = castPath(path, object2); 25573 var index2 = 0, length2 = path.length; 25574 while (object2 != null && index2 < length2) { 25575 object2 = object2[toKey(path[index2++])]; 25576 } 25577 return index2 && index2 == length2 ? object2 : void 0; 25578 } 25579 function get(object2, path, defaultValue) { 25580 var result = object2 == null ? void 0 : baseGet(object2, path); 25581 return result === void 0 ? defaultValue : result; 25582 } 25583 function baseHasIn(object2, key) { 25584 return object2 != null && key in Object(object2); 25585 } 25586 function hasPath(object2, path, hasFunc) { 25587 path = castPath(path, object2); 25588 var index2 = -1, length2 = path.length, result = false;
25589 while (++index2 < length2) { 25590 var key = toKey(path[index2]); 25591 if (!(result = object2 != null && hasFunc(object2, key))) { 25592 break; 25593 } 25594 object2 = object2[key]; 25595 } 25596 if (result || ++index2 != length2) { 25597 return result; 25598 } 25599 length2 = object2 == null ? 0 : object2.length; 25600 return !!length2 && isLength(length2) && isIndex(key, length2) && (isArray(object2) || isArguments(object2)); 25601 } 25602 function hasIn(object2, path) { 25603 return object2 != null && hasPath(object2, path, baseHasIn); 25604 } 25605 var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; 25606 function baseMatchesProperty(path, srcValue) { 25607 if (isKey(path) && isStrictComparable(srcValue)) { 25608 return matchesStrictComparable(toKey(path), srcValue); 25609 } 25610 return function(object2) { 25611 var objValue = get(object2, path); 25612 return objValue === void 0 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 25613 }; 25614 } 25615 function baseProperty(key) { 25616 return function(object2) { 25617 return object2 == null ? void 0 : object2[key]; 25618 }; 25619 } 25620 function basePropertyDeep(path) { 25621 return function(object2) { 25622 return baseGet(object2, path); 25623 }; 25624 } 25625 function property(path) { 25626 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 25627 } 25628 function baseIteratee(value) { 25629 if (typeof value == "function") { 25630 return value; 25631 } 25632 if (value == null) { 25633 return identity; 25634 } 25635 if (typeof value == "object") { 25636 return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); 25637 } 25638 return property(value); 25639 } 25640 function mapValues(object2, iteratee) { 25641 var result = {}; 25642 iteratee = baseIteratee(iteratee); 25643 baseForOwn(object2, function(value, key, object3) { 25644 baseAssignValue(result, key, iteratee(value, key, object3)); 25645 }); 25646 return result; 25647 } 25648 const breakpoints = { 25649 mobileM: 375, 25650 tablet: 768, 25651 laptopS: 992, 25652 laptop: 1280, 25653 desktop: 1920 25654 }; 25655 const mediaQueriesExpressions = mapValues(breakpoints, (item) => { 25656 return `(min-width: ${item}px)`; 25657 }); 25658 const mediaQueries = mapValues(mediaQueriesExpressions, (item) => { 25659 return `@media ${item}`; 25660 }); 25661 const Container$u = dt$2.div` 25662 padding: var(--space-200) var(--space-300); 25663 display: flex; 25664 align-items: center; 25665 gap: var(--space-400); 25666 border-radius: var(--panel-radius-normal); 25667 font-weight: var(--font-weight-500); 25668 25669 ${({ $type }) => $type === "success" && lt$2` 25670 background: var(--bg-success); 25671 color: var(--text-white); 25672 `} 25673 25674 ${({ $type }) => $type === "info" && lt$2` 25675 background: var(--bg-primary-invert); 25676 color: var(--text-primary-invert); 25677 `} 25678 25679 ${({ $type }) => $type === "error" && lt$2` 25680 background: var(--bg-critical); 25681 color: var(--text-white); 25682 `} 25683 25684 ${mediaQueries.tablet} { 25685 padding: var(--space-300) var(--space-400); 25686 max-width: 870px; 25687 width: 80vw; 25688 } 25689 25690 ol { 25691 padding-left: var(--space-500); 25692 list-style-type: decimal; 25693 } 25694 25695 a { 25696 text-decoration: underline; 25697 } 25698`; 25699 const Message = dt$2.div` 25700 white-space: pre-line; 25701 flex: 1; 25702`; 25703 const Close = dt$2.button` 25704 padding: var(--space-200); 25705 margin: var(--space-n200); 25706 color: inherit; 25707`; 25708 const Alert = ({ message, type = "info", onClose }) => { 25709 const [closeButtonRef, setCloseButtonFocus] = pe$2(); 25710 reactExports.useEffect(() => { 25711 const timeout = setTimeout(() => { 25712 setCloseButtonFocus(); 25713 }, 200); 25714 return () => clearTimeout(timeout); 25715 }, [setCloseButtonFocus]); 25716 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$u, { $type: type, role: "alert", children: [
25717 /* @__PURE__ */ jsxRuntimeExports.jsx(Message, { children: message }), 25718 onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(Close, { title: "Close", onClick: onClose, "data-testid": "Alert.Close", ref: closeButtonRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx($4, { height: 16, "aria-label": "close" }) }) 25719 ] }); 25720 }; 25721 const AspectBox = ({ ratio, children }) => { 25722 return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: reactExports.Children.map(children, (child) => { 25723 if (reactExports.isValidElement(child)) { 25724 return reactExports.cloneElement(child, __spreadProps(__spreadValues({}, child.props), { 25725 style: __spreadProps(__spreadValues({}, child.props.style), { 25726 aspectRatio: ratio.split(":").join("/") 25727 }) 25728 })); 25729 } 25730 }) }); 25731 }; 25732 function arrayEach(array2, iteratee) { 25733 var index2 = -1, length2 = array2 == null ? 0 : array2.length; 25734 while (++index2 < length2) { 25735 if (iteratee(array2[index2], index2, array2) === false) { 25736 break; 25737 } 25738 } 25739 return array2; 25740 } 25741 var objectProto$5 = Object.prototype; 25742 var hasOwnProperty$5 = objectProto$5.hasOwnProperty; 25743 function assignValue(object2, key, value) { 25744 var objValue = object2[key]; 25745 if (!(hasOwnProperty$5.call(object2, key) && eq(objValue, value)) || value === void 0 && !(key in object2)) { 25746 baseAssignValue(object2, key, value); 25747 } 25748 } 25749 function copyObject(source, props, object2, customizer) { 25750 var isNew = !object2; 25751 object2 || (object2 = {}); 25752 var index2 = -1, length2 = props.length; 25753 while (++index2 < length2) { 25754 var key = props[index2]; 25755 var newValue = void 0; 25756 if (newValue === void 0) { 25757 newValue = source[key]; 25758 } 25759 if (isNew) { 25760 baseAssignValue(object2, key, newValue); 25761 } else { 25762 assignValue(object2, key, newValue); 25763 } 25764 } 25765 return object2; 25766 } 25767 function baseAssign(object2, source) { 25768 return object2 && copyObject(source, keys(source), object2); 25769 } 25770 function nativeKeysIn(object2) { 25771 var result = []; 25772 if (object2 != null) { 25773 for (var key in Object(object2)) { 25774 result.push(key); 25775 } 25776 } 25777 return result; 25778 } 25779 var objectProto$4 = Object.prototype; 25780 var hasOwnProperty$4 = objectProto$4.hasOwnProperty; 25781 function baseKeysIn(object2) { 25782 if (!isObject$3(object2)) { 25783 return nativeKeysIn(object2); 25784 } 25785 var isProto = isPrototype(object2), result = []; 25786 for (var key in object2) { 25787 if (!(key == "constructor" && (isProto || !hasOwnProperty$4.call(object2, key)))) { 25788 result.push(key); 25789 } 25790 } 25791 return result; 25792 } 25793 function keysIn(object2) { 25794 return isArrayLike(object2) ? arrayLikeKeys(object2, true) : baseKeysIn(object2); 25795 } 25796 function baseAssignIn(object2, source) { 25797 return object2 && copyObject(source, keysIn(source), object2); 25798 } 25799 var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; 25800 var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; 25801 var moduleExports = freeModule && freeModule.exports === freeExports; 25802 var Buffer$1 = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0; 25803 function cloneBuffer(buffer, isDeep) { 25804 if (isDeep) { 25805 return buffer.slice(); 25806 } 25807 var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2); 25808 buffer.copy(result); 25809 return result; 25810 } 25811 function copyArray(source, array2) { 25812 var index2 = -1, length2 = source.length; 25813 array2 || (array2 = Array(length2)); 25814 while (++index2 < length2) { 25815 array2[index2] = source[index2]; 25816 } 25817 return array2; 25818 } 25819 function copySymbols(source, object2) { 25820 return copyObject(source, getSymbols(source), object2); 25821 } 25822 var getPrototype = overArg(Object.getPrototypeOf, Object); 25823 var nativeGetSymbols = Object.getOwnPropertySymbols; 25824 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object2) { 25825 var result = []; 25826 while (object2) {
vendor: 4,720 bytes, lines 25827-25938
25827 arrayPush$1(result, getSymbols(object2)); 25828 object2 = getPrototype(object2); 25829 } 25830 return result; 25831 }; 25832 function copySymbolsIn(source, object2) { 25833 return copyObject(source, getSymbolsIn(source), object2); 25834 } 25835 function getAllKeysIn(object2) { 25836 return baseGetAllKeys(object2, keysIn, getSymbolsIn); 25837 } 25838 var objectProto$3 = Object.prototype; 25839 var hasOwnProperty$3 = objectProto$3.hasOwnProperty; 25840 function initCloneArray(array2) { 25841 var length2 = array2.length, result = new array2.constructor(length2); 25842 if (length2 && typeof array2[0] == "string" && hasOwnProperty$3.call(array2, "index")) { 25843 result.index = array2.index; 25844 result.input = array2.input; 25845 } 25846 return result; 25847 } 25848 function cloneArrayBuffer(arrayBuffer) { 25849 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 25850 new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer)); 25851 return result; 25852 } 25853 function cloneDataView(dataView, isDeep) { 25854 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 25855 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 25856 } 25857 var reFlags = /\w*$/; 25858 function cloneRegExp(regexp) { 25859 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 25860 result.lastIndex = regexp.lastIndex; 25861 return result; 25862 } 25863 var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; 25864 function cloneSymbol(symbol) { 25865 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 25866 } 25867 function cloneTypedArray(typedArray, isDeep) { 25868 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 25869 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 25870 } 25871 var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$3 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]"; 25872 var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]"; 25873 function initCloneByTag(object2, tag, isDeep) { 25874 var Ctor = object2.constructor; 25875 switch (tag) { 25876 case arrayBufferTag$1: 25877 return cloneArrayBuffer(object2); 25878 case boolTag$1: 25879 case dateTag$1: 25880 return new Ctor(+object2); 25881 case dataViewTag$1: 25882 return cloneDataView(object2, isDeep); 25883 case float32Tag$1: 25884 case float64Tag$1: 25885 case int8Tag$1: 25886 case int16Tag$1: 25887 case int32Tag$1: 25888 case uint8Tag$1: 25889 case uint8ClampedTag$1: 25890 case uint16Tag$1: 25891 case uint32Tag$1: 25892 return cloneTypedArray(object2, isDeep); 25893 case mapTag$3: 25894 return new Ctor(); 25895 case numberTag$1: 25896 case stringTag$1: 25897 return new Ctor(object2); 25898 case regexpTag$1: 25899 return cloneRegExp(object2); 25900 case setTag$3: 25901 return new Ctor(); 25902 case symbolTag$1: 25903 return cloneSymbol(object2); 25904 } 25905 } 25906 var objectCreate = Object.create; 25907 var baseCreate = /* @__PURE__ */ (function() { 25908 function object2() { 25909 } 25910 return function(proto) { 25911 if (!isObject$3(proto)) { 25912 return {}; 25913 } 25914 if (objectCreate) { 25915 return objectCreate(proto); 25916 } 25917 object2.prototype = proto; 25918 var result = new object2(); 25919 object2.prototype = void 0; 25920 return result; 25921 }; 25922 })(); 25923 function initCloneObject(object2) { 25924 return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate(getPrototype(object2)) : {}; 25925 } 25926 var mapTag$2 = "[object Map]"; 25927 function baseIsMap(value) { 25928 return isObjectLike(value) && getTag(value) == mapTag$2; 25929 } 25930 var nodeIsMap = nodeUtil && nodeUtil.isMap; 25931 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 25932 var setTag$2 = "[object Set]"; 25933 function baseIsSet(value) { 25934 return isObjectLike(value) && getTag(value) == setTag$2; 25935 } 25936 var nodeIsSet = nodeUtil && nodeUtil.isSet; 25937 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 25938 var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$2 = 4;
vendor: 4,277 bytes, lines 25939-26013
25939 var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag = "[object Number]", objectTag$1 = "[object Object]", regexpTag = "[object RegExp]", setTag$1 = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]"; 25940 var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; 25941 var cloneableTags = {}; 25942 cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag] = cloneableTags[objectTag$1] = cloneableTags[regexpTag] = cloneableTags[setTag$1] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 25943 cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; 25944 function baseClone$1(value, bitmask, customizer, key, object2, stack) { 25945 var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$2; 25946 if (result !== void 0) { 25947 return result; 25948 } 25949 if (!isObject$3(value)) { 25950 return value; 25951 } 25952 var isArr = isArray(value); 25953 if (isArr) { 25954 result = initCloneArray(value); 25955 if (!isDeep) { 25956 return copyArray(value, result); 25957 } 25958 } else { 25959 var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; 25960 if (isBuffer(value)) { 25961 return cloneBuffer(value, isDeep); 25962 } 25963 if (tag == objectTag$1 || tag == argsTag || isFunc && !object2) { 25964 result = isFlat || isFunc ? {} : initCloneObject(value); 25965 if (!isDeep) { 25966 return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); 25967 } 25968 } else { 25969 if (!cloneableTags[tag]) { 25970 return object2 ? value : {}; 25971 } 25972 result = initCloneByTag(value, tag, isDeep); 25973 } 25974 } 25975 stack || (stack = new Stack()); 25976 var stacked = stack.get(value); 25977 if (stacked) { 25978 return stacked; 25979 } 25980 stack.set(value, result); 25981 if (isSet(value)) { 25982 value.forEach(function(subValue) { 25983 result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack)); 25984 }); 25985 } else if (isMap(value)) { 25986 value.forEach(function(subValue, key2) { 25987 result.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack)); 25988 }); 25989 } 25990 var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; 25991 var props = isArr ? void 0 : keysFunc(value); 25992 arrayEach(props || value, function(subValue, key2) { 25993 if (props) { 25994 key2 = subValue; 25995 subValue = value[key2]; 25996 } 25997 assignValue(result, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack)); 25998 }); 25999 return result; 26000 } 26001 var CLONE_SYMBOLS_FLAG$1 = 4; 26002 function clone$2(value) { 26003 return baseClone$1(value, CLONE_SYMBOLS_FLAG$1); 26004 } 26005 function assignMergeValue(object2, key, value) { 26006 if (value !== void 0 && !eq(object2[key], value) || value === void 0 && !(key in object2)) { 26007 baseAssignValue(object2, key, value); 26008 } 26009 } 26010 var objectTag = "[object Object]"; 26011 var funcProto = Function.prototype, objectProto$2 = Object.prototype; 26012 var funcToString = funcProto.toString; 26013 var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
vendor: 7,546 bytes, lines 26014-26210
26014 var objectCtorString = funcToString.call(Object); 26015 function isPlainObject$1(value) { 26016 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 26017 return false; 26018 } 26019 var proto = getPrototype(value); 26020 if (proto === null) { 26021 return true; 26022 } 26023 var Ctor = hasOwnProperty$2.call(proto, "constructor") && proto.constructor; 26024 return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; 26025 } 26026 function safeGet(object2, key) { 26027 if (key === "constructor" && typeof object2[key] === "function") { 26028 return; 26029 } 26030 if (key == "__proto__") { 26031 return; 26032 } 26033 return object2[key]; 26034 } 26035 function toPlainObject(value) { 26036 return copyObject(value, keysIn(value)); 26037 } 26038 function baseMergeDeep(object2, source, key, srcIndex, mergeFunc, customizer, stack) { 26039 var objValue = safeGet(object2, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); 26040 if (stacked) { 26041 assignMergeValue(object2, key, stacked); 26042 return; 26043 } 26044 var newValue = customizer ? customizer(objValue, srcValue, key + "", object2, source, stack) : void 0; 26045 var isCommon = newValue === void 0; 26046 if (isCommon) { 26047 var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); 26048 newValue = srcValue; 26049 if (isArr || isBuff || isTyped) { 26050 if (isArray(objValue)) { 26051 newValue = objValue; 26052 } else if (isArrayLikeObject(objValue)) { 26053 newValue = copyArray(objValue); 26054 } else if (isBuff) { 26055 isCommon = false; 26056 newValue = cloneBuffer(srcValue, true); 26057 } else if (isTyped) { 26058 isCommon = false; 26059 newValue = cloneTypedArray(srcValue, true); 26060 } else { 26061 newValue = []; 26062 } 26063 } else if (isPlainObject$1(srcValue) || isArguments(srcValue)) { 26064 newValue = objValue; 26065 if (isArguments(objValue)) { 26066 newValue = toPlainObject(objValue); 26067 } else if (!isObject$3(objValue) || isFunction$1(objValue)) { 26068 newValue = initCloneObject(srcValue); 26069 } 26070 } else { 26071 isCommon = false; 26072 } 26073 } 26074 if (isCommon) { 26075 stack.set(srcValue, newValue); 26076 mergeFunc(newValue, srcValue, srcIndex, customizer, stack); 26077 stack["delete"](srcValue); 26078 } 26079 assignMergeValue(object2, key, newValue); 26080 } 26081 function baseMerge(object2, source, srcIndex, customizer, stack) { 26082 if (object2 === source) { 26083 return; 26084 } 26085 baseFor(source, function(srcValue, key) { 26086 stack || (stack = new Stack()); 26087 if (isObject$3(srcValue)) { 26088 baseMergeDeep(object2, source, key, srcIndex, baseMerge, customizer, stack); 26089 } else { 26090 var newValue = customizer ? customizer(safeGet(object2, key), srcValue, key + "", object2, source, stack) : void 0; 26091 if (newValue === void 0) { 26092 newValue = srcValue; 26093 } 26094 assignMergeValue(object2, key, newValue); 26095 } 26096 }, keysIn); 26097 } 26098 function isIterateeCall(value, index2, object2) { 26099 if (!isObject$3(object2)) { 26100 return false; 26101 } 26102 var type = typeof index2; 26103 if (type == "number" ? isArrayLike(object2) && isIndex(index2, object2.length) : type == "string" && index2 in object2) { 26104 return eq(object2[index2], value); 26105 } 26106 return false; 26107 } 26108 function createAssigner(assigner) { 26109 return baseRest(function(object2, sources) { 26110 var index2 = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0; 26111 customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0; 26112 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 26113 customizer = length2 < 3 ? void 0 : customizer; 26114 length2 = 1; 26115 } 26116 object2 = Object(object2); 26117 while (++index2 < length2) { 26118 var source = sources[index2]; 26119 if (source) { 26120 assigner(object2, source, index2, customizer); 26121 } 26122 } 26123 return object2; 26124 }); 26125 } 26126 var merge = createAssigner(function(object2, source, srcIndex) { 26127 baseMerge(object2, source, srcIndex); 26128 }); 26129 function arrayReduce(array2, iteratee, accumulator, initAccum) { 26130 var index2 = -1, length2 = array2 == null ? 0 : array2.length; 26131 if (initAccum && length2) { 26132 accumulator = array2[++index2]; 26133 } 26134 while (++index2 < length2) { 26135 accumulator = iteratee(accumulator, array2[index2], index2, array2); 26136 } 26137 return accumulator; 26138 } 26139 function createBaseEach(eachFunc, fromRight) { 26140 return function(collection, iteratee) { 26141 if (collection == null) { 26142 return collection; 26143 } 26144 if (!isArrayLike(collection)) { 26145 return eachFunc(collection, iteratee); 26146 } 26147 var length2 = collection.length, index2 = -1, iterable = Object(collection); 26148 while (++index2 < length2) { 26149 if (iteratee(iterable[index2], index2, iterable) === false) { 26150 break; 26151 } 26152 } 26153 return collection; 26154 }; 26155 } 26156 var baseEach = createBaseEach(baseForOwn); 26157 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 26158 eachFunc(collection, function(value, index2, collection2) { 26159 accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index2, collection2); 26160 }); 26161 return accumulator; 26162 } 26163 function reduce(collection, iteratee, accumulator) { 26164 var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; 26165 return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach); 26166 } 26167 function baseSet(object2, path, value, customizer) { 26168 if (!isObject$3(object2)) { 26169 return object2; 26170 } 26171 path = castPath(path, object2); 26172 var index2 = -1, length2 = path.length, lastIndex = length2 - 1, nested = object2; 26173 while (nested != null && ++index2 < length2) { 26174 var key = toKey(path[index2]), newValue = value; 26175 if (key === "__proto__" || key === "constructor" || key === "prototype") { 26176 return object2; 26177 } 26178 if (index2 != lastIndex) { 26179 var objValue = nested[key]; 26180 newValue = void 0; 26181 if (newValue === void 0) { 26182 newValue = isObject$3(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {}; 26183 } 26184 } 26185 assignValue(nested, key, newValue); 26186 nested = nested[key]; 26187 } 26188 return object2; 26189 } 26190 function set$1(object2, path, value) { 26191 return object2 == null ? object2 : baseSet(object2, path, value); 26192 } 26193 var __assign$2 = function() { 26194 __assign$2 = Object.assign || function(t2) { 26195 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 26196 s2 = arguments[i2]; 26197 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) 26198 t2[p2] = s2[p2]; 26199 } 26200 return t2; 26201 }; 26202 return __assign$2.apply(this, arguments); 26203 }; 26204 var pairDivider = "~"; 26205 var blockDivider = "~~"; 26206 function generateNamedReferences(input, prev2) { 26207 var entities = {}; 26208 var characters2 = {}; 26209 var blocks = input.split(blockDivider); 26210 var isOptionalBlock = false;
vendor: 4,763 bytes, lines 26211-26234
26211 for (var i2 = 0; blocks.length > i2; i2++) { 26212 var entries2 = blocks[i2].split(pairDivider); 26213 for (var j2 = 0; j2 < entries2.length; j2 += 2) { 26214 var entity = entries2[j2]; 26215 var character2 = entries2[j2 + 1]; 26216 var fullEntity = "&" + entity + ";"; 26217 entities[fullEntity] = character2; 26218 if (isOptionalBlock) { 26219 entities["&" + entity] = character2; 26220 } 26221 characters2[character2] = fullEntity; 26222 } 26223 isOptionalBlock = true; 26224 } 26225 return prev2 ? { entities: __assign$2(__assign$2({}, entities), prev2.entities), characters: __assign$2(__assign$2({}, characters2), prev2.characters) } : { entities, characters: characters2 }; 26226 } 26227 var bodyRegExps = { 26228 xml: /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g, 26229 html4: /∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g, 26230 html5: /·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g 26231 }; 26232 var namedReferences = {}; 26233 namedReferences["xml"] = generateNamedReferences(`lt~<~gt~>~quot~"~apos~'~amp~&`); 26234 namedReferences["html4"] = generateNamedReferences(`apos~'~OElig~Å~oelig~Å~Scaron~Å ~scaron~Å¡~Yuml~Ÿ~circ~Ë~tilde~Ë~ensp~â~emsp~â~thinsp~â~zwnj~â~zwj~â~lrm~â~rlm~â~ndash~â~mdash~â~lsquo~â~rsquo~â~sbquo~â~ldquo~â~rdquo~â~bdquo~â~dagger~â ~Dagger~â¡~permil~â°~lsaquo~â¹~rsaquo~âº~euro~â¬~fnof~Æ~Alpha~Î~Beta~Î~Gamma~Î~Delta~Î~Epsilon~Î~Zeta~Î~Eta~Î~Theta~Î~Iota~Î~Kappa~Î~Lambda~Î~Mu~Î~Nu~Î~Xi~Î~Omicron~Î~Pi~Î ~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Î¥~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~Ï~rho~Ï~sigmaf~Ï~sigma~Ï~tau~Ï~upsilon~Ï ~phi~Ï~chi~Ï~psi~Ï~omega~Ï~thetasym~Ï~upsih~Ï~piv~Ï~bull~â¢~hellip~â¦~prime~â²~Prime~â³~oline~â¾~frasl~â~weierp~â~image~â~real~â~trade~â¢~alefsym~âµ~larr~â~uarr~â~rarr~â~darr~â~harr~â~crarr~âµ~lArr~â~uArr~â~rArr~â~dArr~â~hArr~â~forall~â~part~â~exist~â~empty~â ~nabla~â~isin~â~notin~â~ni~â~prod~â~sum~â~minus~â~lowast~â~radic~â~prop~â~infin~â~ang~â ~and~â§~or~â¨~cap~â©~cup~âª~int~â«~there4~â´~sim~â¼~cong~â ~asymp~â~ne~â ~equiv~â¡~le~â¤~ge~â¥~sub~â~sup~â~nsub~â~sube~â~supe~â~oplus~â~otimes~â~perp~â¥~sdot~â ~lceil~â~rceil~â~lfloor~â~rfloor~â~lang~â©~rang~âª~loz~â~spades~â ~clubs~â£~hearts~â¥~diams~â¦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~Â¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~Â~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~Ã~Aacute~Ã~Acirc~Ã~Atilde~Ã~Auml~Ã~Aring~à ~AElig~Ã~Ccedil~Ã~Egrave~Ã~Eacute~Ã~Ecirc~Ã~Euml~Ã~Igrave~Ã~Iacute~Ã~Icirc~Ã~Iuml~Ã~ETH~Ã~Ntilde~Ã~Ograve~Ã~Oacute~Ã~Ocirc~Ã~Otilde~Ã~Ouml~Ã~times~Ã~Oslash~Ã~Ugrave~Ã~Uacute~Ã~Ucirc~Ã~Uuml~Ã~Yacute~Ã~THORN~Ã~szlig~Ã~agrave~à ~aacute~á~acirc~â~atilde~ã~auml~ä~aring~Ã¥~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~
26234ê~euml~ë~igrave~ì~iacute~Ã~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~"~amp~&~lt~<~gt~>`); 26235 namedReferences["html5"] = generateNamedReferences('Abreve~Ä~Acy~Ð~Afr~ð~Amacr~Ä~And~â©~Aogon~Ä~Aopf~ð¸~ApplyFunction~â¡~Ascr~ð~Assign~â~Backslash~â~Barv~â«§~Barwed~â~Bcy~Ð~Because~âµ~Bernoullis~â¬~Bfr~ð ~Bopf~ð¹~Breve~Ë~Bscr~â¬~Bumpeq~â~CHcy~Ч~Cacute~Ä~Cap~â~CapitalDifferentialD~â ~Cayleys~â~Ccaron~Ä~Ccirc~Ä~Cconint~â°~Cdot~Ä~Cedilla~¸~CenterDot~·~Cfr~â~CircleDot~â~CircleMinus~â~CirclePlus~â~CircleTimes~â~ClockwiseContourIntegral~â²~CloseCurlyDoubleQuote~â~CloseCurlyQuote~â~Colon~â·~Colone~â©´~Congruent~â¡~Conint~â¯~ContourIntegral~â®~Copf~â~Coproduct~â~CounterClockwiseContourIntegral~â³~Cross~⨯~Cscr~ð~Cup~â~CupCap~â~DD~â ~DDotrahd~â¤~DJcy~Ð~DScy~Ð ~DZcy~Ð~Darr~â¡~Dashv~⫤~Dcaron~Ä~Dcy~Ð~Del~â~Dfr~ð~DiacriticalAcute~´~DiacriticalDot~Ë~DiacriticalDoubleAcute~Ë~DiacriticalGrave~`~DiacriticalTilde~Ë~Diamond~â~DifferentialD~â ~Dopf~ð»~Dot~¨~DotDot~â~DotEqual~â~DoubleContourIntegral~â¯~DoubleDot~¨~DoubleDownArrow~â~DoubleLeftArrow~â~DoubleLeftRightArrow~â~DoubleLeftTee~⫤~DoubleLongLeftArrow~â¸~DoubleLongLeftRightArrow~âº~DoubleLongRightArrow~â¹~DoubleRightArrow~â~DoubleRightTee~â¨~DoubleUpArrow~â~DoubleUpDownArrow~â~DoubleVerticalBar~â¥~DownArrow~â~DownArrowBar~â¤~DownArrowUpArrow~âµ~DownBreve~Ì~DownLeftRightVector~â¥~DownLeftTeeVector~â¥~DownLeftVector~â½~DownLeftVectorBar~â¥~DownRightTeeVector~â¥~DownRightVector~â~DownRightVectorBar~â¥~DownTee~â¤~DownTeeArrow~â§~Downarrow~â~Dscr~ð~Dstrok~Ä~ENG~Å~Ecaron~Ä~Ecy~Ð~Edot~Ä~Efr~ð~Element~â~Emacr~Ä~EmptySmallSquare~â»~EmptyVerySmallSquare~â«~Eogon~Ä~Eopf~ð¼~Equal~⩵~EqualTilde~â~Equilibrium~â~Escr~â°~Esim~⩳~Exists~â~ExponentialE~â ~Fcy~Ф~Ffr~ð~FilledSmallSquare~â¼~FilledVerySmallSquare~âª~Fopf~ð½~ForAll~â~Fouriertrf~â±~Fscr~â±~GJcy~Ð~Gammad~Ï~Gbreve~Ä~Gcedil~Ä¢~Gcirc~Ä~Gcy~Ð~Gdot~Ä ~Gfr~ð~Gg~â~Gopf~ð¾~GreaterEqual~â¥~GreaterEqualLess~â~GreaterFullEqual~â§~GreaterGreater~⪢~GreaterLess~â·~GreaterSlantEqual~⩾~GreaterTilde~â³~Gscr~ð¢~Gt~â«~HARDcy~Ъ~Hacek~Ë~Hat~^~Hcirc~Ĥ~Hfr~â~HilbertSpace~â~Hopf~â~HorizontalLine~â~Hscr~â~Hstrok~Ħ~HumpDownHump~â~HumpEqual~â~IEcy~Ð~IJlig~IJ~IOcy~Ð~Icy~Ð~Idot~İ~Ifr~â~Im~â~Imacr~Ī~ImaginaryI~â ~Implies~â~Int~â¬~Integral~â«~Intersection~â~InvisibleComma~â£~InvisibleTimes~â¢~Iogon~Ä®~Iopf~ð~Iscr~â~Itilde~Ĩ~Iukcy~Ð~Jcirc~Ä´~Jcy~Ð~Jfr~ð~Jopf~ð~Jscr~ð¥~Jsercy~Ð~Jukcy~Ð~KHcy~Ð¥~KJcy~Ð~Kcedil~Ķ~Kcy~Ð~Kfr~ð~Kopf~ð~Kscr~ð¦~LJcy~Ð~Lacute~Ĺ~Lang~âª~Laplacetrf~â~Larr~â~Lcaron~Ľ~Lcedil~Ä»~Lcy~Ð~LeftAngleBracket~â¨~LeftArrow~â~LeftArrowBar~â¤~LeftArrowRightArrow~â~LeftCeiling~â~LeftDoubleBracket~â¦~LeftDownTeeVector~⥡~LeftDownVector~â~LeftDownVectorBar~â¥~LeftFloor~â~LeftRightArrow~â~LeftRightVector~â¥~LeftTee~â£~LeftTeeArrow~â¤~LeftTeeVector~â¥~LeftTriangle~â²~LeftTriangleBar~â§~LeftTriangleEqual~â´~LeftUpDownVector~â¥~LeftUpTeeVector~⥠~LeftUpVector~â¿~LeftUpVectorBar~â¥~LeftVector~â¼~LeftVectorBar~â¥~Leftarrow~â~Leftrightarrow~â~LessEqualGreater~â~LessFullEqual~â¦~LessGreater~â¶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~â²~Lfr~ð~Ll~â~Lleftarrow~â~Lmidot~Ä¿~LongLeftArrow~âµ~LongLeftRightArrow~â·~LongRightArrow~â¶~Longleftarrow~â¸~Longleftrightarrow~âº~Longrightarrow~â¹~Lopf~ð~LowerLeftArrow~â~LowerRightArrow~â~Lscr~â~Lsh~â°~Lstrok~Å~Lt~âª~Map~⤠~Mcy~Ð~MediumSpace~â~Mellintrf~â³~Mfr~ð~MinusPlus~â~Mopf~ð~Mscr~â³~NJcy~Ð~Nacute~Å~Ncaron~Å~Ncedil~Å ~Ncy~Ð~NegativeMediumSpace~â~NegativeThickSpace~â~NegativeThinSpace~â~NegativeVeryThinSpace~â~NestedGreaterGreater~â«~NestedLessLess~âª~NewLine~\n~Nfr~ð~NoBreak~â ~NonBreakingSpace~ ~Nopf~â~Not~⫬~NotCongruent~â¢~NotCupCap~â~NotDoubleVerticalBar~â¦~NotElement~â~NotEqual~â ~NotEqualTilde~â̸~NotExists~â~NotGreater~â¯~NotGreaterEqual~â±~NotGreaterFullEqual~â§Ì¸~NotGreaterGreater~â«Ì¸~NotGreaterLess~â¹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~âµ~NotHumpDownHump~â̸~NotHumpEqual~â̸~NotLeftTriangle~âª~NotLeftTriangleBar~â§
26235̸~NotLeftTriangleEqual~â¬~NotLess~â®~NotLessEqual~â°~NotLessGreater~â¸~NotLessLess~âªÌ¸~NotLessSlantEqual~⩽̸~NotLessTilde~â´~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~â~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~â ~NotReverseElement~â~NotRightTriangle~â«~NotRightTriangleBar~â§Ì¸~NotRightTriangleEqual~â~NotSquareSubset~â̸~NotSquareSubsetEqual~â¢~NotSquareSuperset~â̸~NotSquareSupersetEqual~â£~NotSubset~ââ~NotSubsetEqual~â~NotSucceeds~â~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~â¡~NotSucceedsTilde~â¿Ì¸~NotSuperset~ââ~NotSupersetEqual~â~NotTilde~â~NotTildeEqual~â~NotTildeFullEqual~â~NotTildeTilde~â~NotVerticalBar~â¤~Nscr~ð©~Ocy~Ð~Odblac~Å~Ofr~ð~Omacr~Å~Oopf~ð~OpenCurlyDoubleQuote~â~OpenCurlyQuote~â~Or~â©~Oscr~ðª~Otimes~⨷~OverBar~â¾~OverBrace~â~OverBracket~â´~OverParenthesis~â~PartialD~â~Pcy~Ð~Pfr~ð~PlusMinus~±~Poincareplane~â~Popf~â~Pr~⪻~Precedes~âº~PrecedesEqual~⪯~PrecedesSlantEqual~â¼~PrecedesTilde~â¾~Product~â~Proportion~â·~Proportional~â~Pscr~ð«~Qfr~ð~Qopf~â~Qscr~ð¬~RBarr~â¤~Racute~Å~Rang~â«~Rarr~â ~Rarrtl~â¤~Rcaron~Å~Rcedil~Å~Rcy~Ð ~Re~â~ReverseElement~â~ReverseEquilibrium~â~ReverseUpEquilibrium~⥯~Rfr~â~RightAngleBracket~â©~RightArrow~â~RightArrowBar~â¥~RightArrowLeftArrow~â~RightCeiling~â~RightDoubleBracket~â§~RightDownTeeVector~â¥~RightDownVector~â~RightDownVectorBar~â¥~RightFloor~â~RightTee~â¢~RightTeeArrow~â¦~RightTeeVector~â¥~RightTriangle~â³~RightTriangleBar~â§~RightTriangleEqual~âµ~RightUpDownVector~â¥~RightUpTeeVector~â¥~RightUpVector~â¾~RightUpVectorBar~â¥~RightVector~â~RightVectorBar~â¥~Rightarrow~â~Ropf~â~RoundImplies~⥰~Rrightarrow~â~Rscr~â~Rsh~â±~RuleDelayed~â§´~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Å~Sc~⪼~Scedil~Å~Scirc~Å~Scy~С~Sfr~ð~ShortDownArrow~â~ShortLeftArrow~â~ShortRightArrow~â~ShortUpArrow~â~SmallCircle~â~Sopf~ð~Sqrt~â~Square~â¡~SquareIntersection~â~SquareSubset~â~SquareSubsetEqual~â~SquareSuperset~â~SquareSupersetEqual~â~SquareUnion~â~Sscr~ð®~Star~â~Sub~â~Subset~â~SubsetEqual~â~Succeeds~â»~SucceedsEqual~⪰~SucceedsSlantEqual~â½~SucceedsTilde~â¿~SuchThat~â~Sum~â~Sup~â~Superset~â~SupersetEqual~â~Supset~â~TRADE~â¢~TSHcy~Ð~TScy~Ц~Tab~
vendor: 15,711 bytes, line 26235
26235~Tcaron~Ť~Tcedil~Å¢~Tcy~Т~Tfr~ð~Therefore~â´~ThickSpace~ââ~ThinSpace~â~Tilde~â¼~TildeEqual~â~TildeFullEqual~â
~TildeTilde~â~Topf~ð~TripleDot~â~Tscr~ð¯~Tstrok~Ŧ~Uarr~â~Uarrocir~â¥~Ubrcy~Ð~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~ð~Umacr~Ū~UnderBar~_~UnderBrace~â~UnderBracket~âµ~UnderParenthesis~â~Union~â~UnionPlus~â~Uogon~Ų~Uopf~ð~UpArrow~â~UpArrowBar~â¤~UpArrowDownArrow~â
~UpDownArrow~â~UpEquilibrium~⥮~UpTee~â¥~UpTeeArrow~â¥~Uparrow~â~Updownarrow~â~UpperLeftArrow~â~UpperRightArrow~â~Upsi~Ï~Uring~Å®~Uscr~ð°~Utilde~Ũ~VDash~â«~Vbar~â««~Vcy~Ð~Vdash~â©~Vdashl~⫦~Vee~â~Verbar~â~Vert~â~VerticalBar~â£~VerticalLine~|~VerticalSeparator~â~VerticalTilde~â~VeryThinSpace~â~Vfr~ð~Vopf~ð~Vscr~ð±~Vvdash~âª~Wcirc~Å´~Wedge~â~Wfr~ð~Wopf~ð~Wscr~ð²~Xfr~ð~Xopf~ð~Xscr~ð³~YAcy~Я~YIcy~Ð~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~ð~Yopf~ð~Yscr~ð´~ZHcy~Ð~Zacute~Ź~Zcaron~Ž~Zcy~Ð~Zdot~Å»~ZeroWidthSpace~â~Zfr~â¨~Zopf~â¤~Zscr~ðµ~abreve~Ä~ac~â¾~acE~â¾Ì³~acd~â¿~acy~а~af~â¡~afr~ð~aleph~âµ~amacr~Ä~amalg~⨿~andand~â©~andd~â©~andslope~â©~andv~â©~ange~⦤~angle~â ~angmsd~â¡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~â¦~angmsdag~⦮~angmsdah~⦯~angrt~â~angrtvb~â¾~angrtvbd~â¦~angsph~â¢~angst~Ã
~angzarr~â¼~aogon~Ä
~aopf~ð~ap~â~apE~â©°~apacir~⩯~ape~â~apid~â~approx~â~approxeq~â~ascr~ð¶~ast~*~asympeq~â~awconint~â³~awint~â¨~bNot~â«~backcong~â~backepsilon~϶~backprime~âµ~backsim~â½~backsimeq~â~barvee~â½~barwed~â
~barwedge~â
~bbrk~âµ~bbrktbrk~â¶~bcong~â~bcy~б~becaus~âµ~because~âµ~bemptyv~⦰~bepsi~϶~bernou~â¬~beth~â¶~between~â¬~bfr~ð~bigcap~â~bigcirc~â¯~bigcup~â~bigodot~â¨~bigoplus~â¨~bigotimes~â¨~bigsqcup~â¨~bigstar~â
~bigtriangledown~â½~bigtriangleup~â³~biguplus~â¨~bigvee~â~bigwedge~â~bkarow~â¤~blacklozenge~â§«~blacksquare~âª~blacktriangle~â´~blacktriangledown~â¾~blacktriangleleft~â~blacktriangleright~â¸~blank~â£~blk12~â~blk14~â~blk34~â~block~â~bne~=â¥~bnequiv~â¡â¥~bnot~â~bopf~ð~bot~â¥~bottom~â¥~bowtie~â~boxDL~â~boxDR~â~boxDl~â~boxDr~â~boxH~â~boxHD~â¦~boxHU~â©~boxHd~â¤~boxHu~â§~boxUL~â~boxUR~â~boxUl~â~boxUr~â~boxV~â~boxVH~â¬~boxVL~â£~boxVR~â ~boxVh~â«~boxVl~â¢~boxVr~â~boxbox~â§~boxdL~â~boxdR~â~boxdl~â~boxdr~â~boxh~â~boxhD~â¥~boxhU~â¨~boxhd~â¬~boxhu~â´~boxminus~â~boxplus~â~boxtimes~â ~boxuL~â~boxuR~â~boxul~â~boxur~â~boxv~â~boxvH~âª~boxvL~â¡~boxvR~â~boxvh~â¼~boxvl~â¤~boxvr~â~bprime~âµ~breve~Ë~bscr~ð·~bsemi~â~bsim~â½~bsime~â~bsol~\\~bsolb~â§
~bsolhsub~â~bullet~â¢~bump~â~bumpE~⪮~bumpe~â~bumpeq~â~cacute~Ä~capand~â©~capbrcup~â©~capcap~â©~capcup~â©~capdot~â©~caps~â©ï¸~caret~â~caron~Ë~ccaps~â©~ccaron~Ä~ccirc~Ä~ccups~â©~ccupssm~â©~cdot~Ä~cemptyv~⦲~centerdot~·~cfr~ð ~chcy~Ñ~check~â~checkmark~â~cir~â~cirE~â§~circeq~â~circlearrowleft~âº~circlearrowright~â»~circledR~®~circledS~â~circledast~â~circledcirc~â~circleddash~â~cire~â~cirfnint~â¨~cirmid~⫯~cirscir~â§~clubsuit~â£~colon~:~colone~â~coloneq~â~comma~,~commat~@~comp~â~compfn~â~complement~â~complexes~â~congdot~â©~conint~â®~copf~ð~coprod~â~copysr~â~cross~â~cscr~ð¸~csub~â«~csube~â«~csup~â«~csupe~â«~ctdot~â¯~cudarrl~⤸~cudarrr~⤵~cuepr~â~cuesc~â~cularr~â¶~cularrp~⤽~cupbrcap~â©~cupcap~â©~cupcup~â©~cupdot~â~cupor~â©
~cups~âªï¸~curarr~â·~curarrm~⤼~curlyeqprec~â~curlyeqsucc~â~curlyvee~â~curlywedge~â~curvearrowleft~â¶~curvearrowright~â·~cuvee~â~cuwed~â~cwconint~â²~cwint~â±~cylcty~â~dHar~⥥~daleth~â¸~dash~â~dashv~â£~dbkarow~â¤~dblac~Ë~dcaron~Ä~dcy~д~dd~â
~ddagger~â¡~ddarr~â~ddotseq~â©·~demptyv~⦱~dfisht~⥿~dfr~ð¡~dharl~â~dharr~â~diam~â~diamond~â~diamondsuit~â¦~die~¨~digamma~Ï~disin~â²~div~÷~divideontimes~â~divonx~â~djcy~Ñ~dlcorn~â~dlcrop~â~dollar~$~dopf~ð~dot~Ë~doteq~â~doteqdot~â~dotminus~â¸~dotplus~â~dotsquare~â¡~doublebarwedge~â~downarrow~â~downdownarrows~â~downharpoonleft~â~downharpoonright~â~drbkarow~â¤~drcorn~â~drcrop~â~dscr~ð¹~dscy~Ñ~dsol~â§¶~dstrok~Ä~dtdot~â±~dtri~â¿~dtrif~â¾~duarr~âµ~duhar~⥯~dwangle~⦦~dzcy~Ñ~dzigrarr~â¿~eDDot~â©·~eDot~â~easter~â©®~ecaron~Ä~ecir~â~ecolon~â~ecy~Ñ~edot~Ä~ee~â
~efDot~â~efr~ð¢~eg~âª~egs~âª~egsdot~âª~el~âª~elinters~â§~ell~â~els~âª~elsdot~âª~emacr~Ä~emptyset~â
~emptyv~â
~emsp13~â~emsp14~â
~eng~Å~eogon~Ä~eopf~ð~epar~â~eparsl~â§£~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~â~eqcolon~â~eqsim~â~eqslantgtr~âª~eqslantless~âª~equals~=~equest~â~equivDD~⩸~eqvparsl~â§¥~erDot~â~erarr~⥱~escr~â¯~esdot~â~esim~â~excl~!~expectation~â°~exponentiale~â
~fallingdotseq~â~fcy~Ñ~female~â~ffilig~ï¬~fflig~ï¬~ffllig~ï¬~ffr~ð£~filig~ï¬~fjlig~fj~flat~â~fllig~ï¬~fltns~â±~fopf~ð~fork~â~forkv~â«~fpartint~â¨~frac13~â
~frac15~â
~frac16~â
~frac18~â
~frac23~â
~frac25~â
~frac35~â
~frac38~â
~frac45~â
~frac56~â
~frac58~â
~frac78~â
~frown~â¢~fscr~ð»~gE~â§~gEl~âª~gacute~ǵ~gammad~Ï~gap~âª~gbreve~Ä~gcirc~Ä~gcy~г~gdot~Ä¡~gel~â~geq~â¥~geqq~â§~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~âª~gesdoto~âª~gesdotol~âª~gesl~âï¸~gesles~âª~gfr~ð¤~gg~â«~ggg~â~gimel~â·~gjcy~Ñ~gl~â·~glE~âª~gla~⪥~glj~⪤~gnE~â©~gnap~âª~gnapprox~âª~gne~âª~gneq~âª~gneqq~â©~gnsim~â§~gopf~ð~grave~`~gscr~â~gsim~â³~gsime~âª~gsiml~âª~gtcc~⪧~gtcir~⩺~gtdot~â~gtlPar~â¦~gtquest~⩼~gtrapprox~âª~gtrarr~⥸~gtrdot~â~gtreqless~â~gtreqqless~âª~gtrless~â·~gtrsim~â³~gvertneqq~â©ï¸~gvnE~â©ï¸~hairsp~â~half~½~hamilt~â~hardcy~Ñ~harrcir~â¥~harrw~â~hbar~â~hcirc~Ä¥~heartsuit~â¥~hercon~â¹~hfr~ð¥~hksearow~⤥~hkswarow~⤦~hoarr~â¿~homtht~â»~hookleftarrow~â©~hookrightarrow~âª~hopf~ð~horbar~â~hscr~ð½~hslash~â~hstrok~ħ~hybull~â~hyphen~â~ic~â£~icy~и~iecy~е~iff~â~ifr~ð¦~ii~â
~iiiint~â¨~iiint~â~iinfin~â§~iiota~â©~ijlig~ij~imacr~Ä«~imagline~â~imagpart~â~imath~ı~imof~â·~imped~Ƶ~in~â~incare~â
~infintie~â§~inodot~ı~intcal~âº~integers~â¤~intercal~âº~intlarhk~â¨~intprod~⨼~iocy~Ñ~iogon~į~iopf~ð~iprod~⨼~iscr~ð¾~isinE~â¹~isindot~âµ~isins~â´~isinsv~â³~isinv~â~it~â¢~itilde~Ä©~iukcy~Ñ~jcirc~ĵ~jcy~й~jfr~ð§~jmath~È·~jopf~ð~jscr~ð¿~jsercy~Ñ~jukcy~Ñ~kappav~ϰ~kcedil~Ä·~kcy~к~kfr~ð¨~kgreen~ĸ~khcy~Ñ
~kjcy~Ñ~kopf~ð~kscr~ð~lAarr~â~lAtail~â¤~lBarr~â¤~lE~â¦~lEg~âª~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~â~langd~â¦~langle~â¨~lap~âª
~larrb~â¤~larrbfs~â¤~larrfs~â¤~larrhk~â©~larrlp~â«~larrpl~⤹~larrsim~⥳~larrtl~â¢~lat~⪫~latail~â¤~late~âª~lates~âªï¸~lbarr~â¤~lbbrk~â²~lbrace~{~lbrack~[~lbrke~â¦~lbrksld~â¦~lbrkslu~â¦~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~â~ldrdhar~⥧~ldrushar~â¥~ldsh~â²~leftarrow~â~leftarrowtail~â¢~leftharpoondown~â½~leftharpoonup~â¼~leftleftarrows~â~leftrightarrow~â~leftrightarrows~â~leftrightharpoons~â~leftrightsquigarrow~â~leftthreetimes~â~leg~â~leq~â¤~leqq~â¦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~â©¿~lesdoto~âª~lesdotor~âª~lesg~âï¸~lesges~âª~lessapprox~âª
~lessdot~â~lesseqgtr~â~lesseqqgtr~âª~lessgtr~â¶~lesssim~â²~lfisht~⥼~lfr~ð©~lg~â¶~lgE~âª~lhard~â½~lharu~â¼~lharul~⥪~lhblk~â~ljcy~Ñ~ll~âª~llarr~â~llcorner~â~llhard~⥫~lltri~âº~lmidot~Å~lmoust~â°~lmoustache~â°~lnE~â¨~lnap~âª~lnapprox~âª~lne~âª~lneq~âª~lneqq~â¨~lnsim~â¦~loang~â¬~loarr~â½~lobrk~â¦~longleftarrow~âµ~longleftrightarrow~â·~longmapsto~â¼~longrightarrow~â¶~looparrowleft~â«~looparrowright~â¬~lopar~â¦
~lopf~ð~loplus~â¨~lotimes~⨴~lowbar~_~lozenge~â~lozf~â§«~lpar~(~lparlt~â¦~lrarr~â~lrcorner~â~lrhar~â~lrhard~â¥~lrtri~â¿~lscr~ð~lsh~â°~lsim~â²~lsime~âª~lsimg~âª~lsqb~[~lsquor~â~lstrok~Å~ltcc~⪦~ltcir~⩹~ltdot~â~lthree~â~ltimes~â~ltlarr~⥶~ltquest~â©»~ltrPar~â¦~ltri~â~ltrie~â´~ltrif~â~lurdshar~â¥~luruhar~⥦~lvertneqq~â¨ï¸~lvnE~â¨ï¸~mDDot~âº~male~â~malt~â ~maltese~â ~map~â¦~mapsto~â¦~mapstodown~â§~mapstoleft~â¤~mapstoup~â¥~marker~â®~mcomma~⨩~mcy~м~measuredangle~â¡~mfr~ðª~mho~â§~mid~â£~midast~*~midcir~â«°~minusb~â~minusd~â¸~minusdu~⨪~mlcp~â«~mldr~â¦~mnplus~â~models~â§~mopf~ð~mp~â~mscr~ð~mstpos~â¾~multimap~â¸~mumap~â¸~nGg~â̸~nGt~â«â~nGtv~â«Ì¸~nLeftarrow~â~nLeftrightarrow~â~nLl~â̸~nLt~âªâ~nLtv~âªÌ¸~nRightarrow~â~nVDash~â¯~nVdash~â®~nacute~Å~nang~â â~nap~â~napE~⩰̸~napid~â̸~napos~Å~napprox~â~natur~â®~natural~â®~naturals~â~nbump~â̸~nbumpe~â̸~ncap~â©~ncaron~Å~ncedil~Å~ncong~â~ncongdot~â©Ì¸~ncup~â©~ncy~н~neArr~â~nearhk~⤤~nearr~â~nearrow~â~nedot~â̸~nequiv~â¢~nesear~⤨~nesim~â̸~nexist~â~nexists~â~nfr~ð«~ngE~â§Ì¸~nge~â±~ngeq~â±~ngeqq~â§Ì¸~ngeqslant~⩾̸~nges~⩾̸~ngsim~âµ~ngt~â¯~ngtr~â¯~nhArr~â~nharr~â®~nhpar~⫲~nis~â¼~nisd~âº~niv~â~njcy~Ñ~nlArr~â~nlE~â¦Ì¸~nlarr~â~nldr~â¥~nle~â°~nleftarrow~â~nleftrightarrow~â®~nleq~â°~nleqq~â¦Ì¸~nleqslant~⩽̸~nles~⩽̸~nless~â®~nlsim~â´~nlt~â®~nltri~âª~nltrie~â¬~nmid~â¤~nopf~ð~notinE~â¹Ì¸~notindot~âµÌ¸~notinva~â~notinvb~â·~notinvc~â¶~notni~â~notniva~â~notnivb~â¾~notnivc~â½~npar~â¦~nparallel~â¦~nparsl~⫽â¥~npart~â̸~npolint~â¨~npr~â~nprcue~â ~npre~⪯̸~nprec~â~npreceq~⪯̸~nrArr~â~nrarr~â~nrarrc~⤳̸~nrarrw~â̸~nrightarrow~â~nrtri~â«~nrtrie~â~nsc~â~nsccue~â¡~nsce~⪰̸~nscr~ð~nshortmid~â¤~nshortparallel~â¦~nsim~â~nsime~â~nsimeq~â~nsmid~â¤~nspar~â¦~nsqsube~â¢~nsqsupe~â£~nsubE~â«
̸~nsube~â~nsubset~ââ~nsubseteq~â~nsubseteqq~â«
̸~nsucc~â~nsucceq~⪰̸~nsup~â
~nsupE~â«Ì¸~nsupe~â~nsupset~ââ~nsupseteq~â~nsupseteqq~â«Ì¸~ntgl~â¹~ntlg~â¸~ntriangleleft~âª~ntrianglelefteq~â¬~ntriangleright~â«~ntrianglerighteq~â~num~#~numero~â~numsp~â~nvDash~â~nvHarr~â¤~nvap~ââ~nvdash~â¬~nvge~â¥â~nvgt~>â~nvinfin~â§~nvlArr~â¤~nvle~â¤â~nvlt~<â~nvltrie~â´â~nvrArr~â¤~nvrtrie~âµâ~nvsim~â¼â~nwArr~â~nwarhk~⤣~nwarr~â~nwarrow~â~nwnear~⤧~oS~â~oast~â~ocir~â~ocy~о~odash~â~odblac~Å~odiv~⨸~odot~â~odsold~⦼~ofcir~⦿~ofr~ð¬~ogon~Ë~ogt~â§~ohbar~⦵~ohm~Ω~oint~â®~olarr~âº~olcir~⦾~olcross~⦻~olt~â§~omacr~Å~omid~⦶~ominus~â~oopf~ð ~opar~⦷~operp~⦹~orarr~â»~ord~â©~order~â´~orderof~â´~origof~â¶~oror~â©~orslope~â©~orv~â©~oscr~â´~osol~â~otimesas~⨶~ovbar~â½~par~â¥~parallel~â¥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~â±~pfr~ð~phiv~Ï~phmmat~â³~phone~â~pitchfork~â~planck~â~planckh~â~plankv~â~plus~+~plusacir~⨣~plusb~â~pluscir~⨢~plusdo~â~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~â¨~popf~ð¡~pr~âº~prE~⪳~prap~⪷~prcue~â¼~pre~⪯~prec~âº~precapprox~⪷~preccurlyeq~â¼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~â¨~precsim~â¾~primes~â~prnE~⪵~prnap~⪹~prnsim~â¨~profalar~â®~profline~â~profsurf~â~propto~â~prsim~â¾~prurel~â°~pscr~ð
~puncsp~â~qfr~ð®~qint~â¨~qopf~ð¢~qprime~â~qscr~ð~quaternions~â~quatint~â¨~quest~?~questeq~â~rAarr~â~rAtail~â¤~rBarr~â¤~rHar~⥤~race~â½Ì±~racute~Å~raemptyv~⦳~rangd~â¦~range~⦥~rangle~â©~rarrap~⥵~rarrb~â¥~rarrbfs~⤠~rarrc~⤳~rarrfs~â¤~rarrhk~âª~rarrlp~â¬~rarrpl~â¥
~rarrsim~⥴~rarrtl~â£~rarrw~â~ratail~â¤~ratio~â¶~rationals~â~rbarr~â¤~rbbrk~â³~rbrace~}~rbrack~]~rbrke~â¦~rbrksld~â¦~rbrkslu~â¦~rcaron~Å~rcedil~Å~rcub~}~rcy~Ñ~rdca~⤷~rdldhar~⥩~rdquor~â~rdsh~â³~realine~â~realpart~â~reals~â~rect~â~rfisht~⥽~rfr~ð¯~rhard~â~rharu~â~rharul~⥬~rhov~ϱ~rightarrow~â~rightarrowtail~â£~rightharpoondown~â~rightharpoonup~â~rightleftarrows~â~rightleftharpoons~â~rightrightarrows~â~rightsquigarrow~â~rightthreetimes~â~ring~Ë~risingdotseq~â~rlarr~â~rlhar~â~rmoust~â±~rmoustache~â±~rnmid~â«®~roang~â~roarr~â¾~robrk~â§~ropar~â¦~ropf~ð£~roplus~⨮~rotimes~⨵~rpar~)~rpargt~â¦~rppolint~â¨~rrarr~â~rscr~ð~rsh~â±~rsqb~]~rsquor~â~rthree~â~rtimes~â~rtri~â¹~rtrie~âµ~rtrif~â¸~rtriltri~â§~ruluhar~⥨~rx~â~sacute~Å~sc~â»~scE~⪴~scap~⪸~sccue~â½~sce~⪰~scedil~Å~scirc~Å~scnE~⪶~scnap~⪺~scnsim~â©~scpolint~â¨~scsim~â¿~scy~Ñ~sdotb~â¡~sdote~⩦~seArr~â~searhk~⤥~searr~â~searrow~â~semi~;~seswar~⤩~setminus~â~setmn~â~sext~â¶~sfr~ð°~sfrown~â¢~sharp~â¯~shchcy~Ñ~shcy~Ñ~shortmid~â£~shortparallel~â¥~sigmav~Ï~simdot~⩪~sime~â~simeq~â~simg~âª~simgE~⪠~siml~âª~simlE~âª~simne~â~simplus~⨤~simrarr~⥲~slarr~â~smallsetminus~â~smashp~⨳~smeparsl~⧤~smid~â£~smile~â£~smt~⪪~smte~⪬~smtes~⪬ï¸~softcy~Ñ~sol~/~solb~â§~solbar~â¿~sopf~ð¤~spadesuit~â ~spar~â¥~sqcap~â~sqcaps~âï¸~sqcup~â~sqcups~âï¸~sqsub~â~sqsube~â~sqsubset~â~sqsubseteq~â~sqsup~â~sqsupe~â~sqsupset~â~sqsupseteq~â~squ~â¡~square~â¡~squarf~âª~squf~âª~srarr~â~sscr~ð~ssetmn~â~ssmile~â£~sstarf~â~star~â~starf~â
~straightepsilon~ϵ~straightphi~Ï~strns~¯~subE~â«
~subdot~⪽~subedot~â«~submult~â«~subnE~â«~subne~â~subplus~⪿~subrarr~⥹~subset~â~subseteq~â~subseteqq~â«
~subsetneq~â~subsetneqq~â«~subsim~â«~subsub~â«~subsup~â«~succ~â»~succapprox~⪸~succcurlyeq~â½~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~â©~succsim~â¿~sung~âª~supE~â«~supdot~⪾~supdsub~â«~supedot~â«~suphsol~â~suphsub~â«~suplarr~⥻~supmult~â«~supnE~â«~supne~â~supplus~â«~supset~â~supseteq~â~supseteqq~â«~supsetneq~â~supsetneqq~â«~supsim~â«~supsub~â«~supsup~â«~swArr~â~swarhk~⤦~swarr~â~swarrow~â~swnwar~⤪~target~â~tbrk~â´~tcaron~Å¥~tcedil~Å£~tcy~Ñ~tdot~â~telrec~â~tfr~ð±~therefore~â´~thetav~Ï~thickapprox~â~thicksim~â¼~thkap~â~thksim~â¼~timesb~â ~timesbar~⨱~timesd~⨰~tint~â~toea~⤨~top~â¤~topbot~â¶~topcir~⫱~topf~ð¥~topfork~â«~tosa~⤩~tprime~â´~triangle~âµ~triangledown~â¿~triangleleft~â~trianglelefteq~â´~triangleq~â~triangleright~â¹~trianglerighteq~âµ~tridot~â¬~trie~â~triminus~⨺~triplus~⨹~trisb~â§~tritime~⨻~trpezium~â¢~tscr~ð~tscy~Ñ~tshcy~Ñ~tstrok~ŧ~twixt~â¬~twoheadleftarrow~â~twoheadrightarrow~â ~uHar~⥣~ubrcy~Ñ~ubreve~Å~ucy~Ñ~udarr~â
~udblac~ű~udhar~⥮~ufisht~⥾~ufr~ð²~uharl~â¿~uharr~â¾~uhblk~â~ulcorn~â~ulcorner~â~ulcrop~â~ultri~â¸~umacr~Å«~uogon~ų~uopf~ð¦~uparrow~â~updownarrow~â~upharpoonleft~â¿~upharpoonright~â¾~uplus~â~upsi~Ï
~upuparrows~â~urcorn~â~urcorner~â~urcrop~â~uring~ů~urtri~â¹~uscr~ð~utdot~â°~utilde~Å©~utri~âµ~utrif~â´~uuarr~â~uwangle~⦧~vArr~â~vBar~⫨~vBarv~â«©~vDash~â¨~vangrt~â¦~varepsilon~ϵ~varkappa~ϰ~varnothing~â
~varphi~Ï~varpi~Ï~varpropto~â~varr~â~varrho~ϱ~varsigma~Ï~varsubsetneq~âï¸~varsubsetneqq~â«ï¸~varsupsetneq~âï¸~varsupsetneqq~â«ï¸~vartheta~Ï~vartriangleleft~â²~vartriangleright~â³~vcy~в~vdash~â¢~vee~â¨~veebar~â»~veeeq~â~vellip~â®~verbar~|~vert~|~vfr~ð³~vltri~â²~vnsub~ââ~vnsup~ââ~vopf~ð§~vprop~â~vrtri~â³~vscr~ð~vsubnE~â«ï¸~vsubne~âï¸~vsupnE~â«ï¸~vsupne~âï¸~vzigzag~â¦~wcirc~ŵ~wedbar~â©~wedge~â§~wedgeq~â~wfr~ð´~wopf~ð¨~wp~â~wr~â~wreath~â~wscr~ð~xcap~â~xcirc~â¯~xcup~â~xdtri~â½~xfr~ðµ~xhArr~âº~xharr~â·~xlArr~â¸~xlarr~âµ~xmap~â¼~xnis~â»~xodot~â¨~xopf~ð©~xoplus~â¨~xotime~â¨~xrArr~â¹~xrarr~â¶~xscr~ð~xsqcup~â¨~xuplus~â¨~xutri~â³~xvee~â~xwedge~â~yacy~Ñ~ycirc~Å·~ycy~Ñ~yfr~ð¶~yicy~Ñ~yopf~ðª~yscr~ð~yucy~Ñ~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~â¨~zfr~ð·~zhcy~ж~zigrarr~â~zopf~ð«~zscr~ð~~AMP~&~COPY~©~GT~>~LT~<~QUOT~
26235"~REG~®', namedReferences["html4"]); 26236 var numericUnicodeMap = { 26237 0: 65533, 26238 128: 8364, 26239 130: 8218, 26240 131: 402, 26241 132: 8222, 26242 133: 8230, 26243 134: 8224, 26244 135: 8225, 26245 136: 710, 26246 137: 8240, 26247 138: 352, 26248 139: 8249, 26249 140: 338, 26250 142: 381, 26251 145: 8216, 26252 146: 8217, 26253 147: 8220, 26254 148: 8221, 26255 149: 8226, 26256 150: 8211, 26257 151: 8212, 26258 152: 732, 26259 153: 8482, 26260 154: 353, 26261 155: 8250, 26262 156: 339, 26263 158: 382, 26264 159: 376 26265 }; 26266 var fromCodePoint = String.fromCodePoint || function(astralCodePoint) { 26267 return String.fromCharCode(Math.floor((astralCodePoint - 65536) / 1024) + 55296, (astralCodePoint - 65536) % 1024 + 56320); 26268 }; 26269 var __assign$1 = function() { 26270 __assign$1 = Object.assign || function(t2) { 26271 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 26272 s2 = arguments[i2]; 26273 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) 26274 t2[p2] = s2[p2]; 26275 } 26276 return t2; 26277 }; 26278 return __assign$1.apply(this, arguments); 26279 }; 26280 var allNamedReferences = __assign$1(__assign$1({}, namedReferences), { all: namedReferences.html5 }); 26281 var defaultDecodeOptions = { 26282 scope: "body", 26283 level: "all" 26284 }; 26285 var strict = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g; 26286 var attribute = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g; 26287 var baseDecodeRegExps = { 26288 xml: { 26289 strict, 26290 attribute, 26291 body: bodyRegExps.xml 26292 }, 26293 html4: { 26294 strict, 26295 attribute, 26296 body: bodyRegExps.html4 26297 }, 26298 html5: { 26299 strict, 26300 attribute, 26301 body: bodyRegExps.html5 26302 } 26303 }; 26304 var decodeRegExps = __assign$1(__assign$1({}, baseDecodeRegExps), { all: baseDecodeRegExps.html5 }); 26305 var fromCharCode = String.fromCharCode; 26306 var outOfBoundsChar = fromCharCode(65533); 26307 function getDecodedEntity(entity, references, isAttribute, isStrict) { 26308 var decodeResult = entity; 26309 var decodeEntityLastChar = entity[entity.length - 1]; 26310 if (isAttribute && decodeEntityLastChar === "=") { 26311 decodeResult = entity; 26312 } else if (isStrict && decodeEntityLastChar !== ";") { 26313 decodeResult = entity; 26314 } else { 26315 var decodeResultByReference = references[entity]; 26316 if (decodeResultByReference) { 26317 decodeResult = decodeResultByReference; 26318 } else if (entity[0] === "&" && entity[1] === "#") { 26319 var decodeSecondChar = entity[2]; 26320 var decodeCode = decodeSecondChar == "x" || decodeSecondChar == "X" ? parseInt(entity.substr(3), 16) : parseInt(entity.substr(2)); 26321 decodeResult = decodeCode >= 1114111 ? outOfBoundsChar : decodeCode > 65535 ? fromCodePoint(decodeCode) : fromCharCode(numericUnicodeMap[decodeCode] || decodeCode); 26322 } 26323 } 26324 return decodeResult; 26325 } 26326 function decode(text2, _a) { 26327 var _b = _a === void 0 ? defaultDecodeOptions : _a, _c = _b.level, level = _c === void 0 ? "all" : _c, _d = _b.scope, scope = _d === void 0 ? level === "xml" ? "strict" : "body" : _d; 26328 if (!text2) { 26329 return ""; 26330 } 26331 var decodeRegExp = decodeRegExps[level][scope]; 26332 var references = allNamedReferences[level].entities; 26333 var isAttribute = scope === "attribute"; 26334 var isStrict = scope === "strict"; 26335 return text2.replace(decodeRegExp, function(entity) { 26336 return getDecodedEntity(entity, references, isAttribute, isStrict); 26337 }); 26338 } 26339 /*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */ 26340 function _arrayLikeToArray$2(r2, a2) { 26341 (null == a2 || a2 > r2.length) && (a2 = r2.length); 26342 for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2]; 26343 return n2; 26344 } 26345 function _arrayWithHoles$2(r2) { 26346 if (Array.isArray(r2)) return r2; 26347 } 26348 function _iterableToArrayLimit$2(r2, l2) { 26349 var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"]; 26350 if (null != t2) { 26351 var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
26352 try { 26353 if (i2 = (t2 = t2.call(r2)).next, 0 === l2) ; 26354 else for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true) ; 26355 } catch (r3) { 26356 o2 = true, n2 = r3; 26357 } finally { 26358 try { 26359 if (!f2 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) return; 26360 } finally { 26361 if (o2) throw n2; 26362 } 26363 } 26364 return a2; 26365 } 26366 } 26367 function _nonIterableRest$2() { 26368 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 26369 } 26370 function _slicedToArray$2(r2, e2) { 26371 return _arrayWithHoles$2(r2) || _iterableToArrayLimit$2(r2, e2) || _unsupportedIterableToArray$2(r2, e2) || _nonIterableRest$2(); 26372 } 26373 function _unsupportedIterableToArray$2(r2, a2) { 26374 if (r2) { 26375 if ("string" == typeof r2) return _arrayLikeToArray$2(r2, a2); 26376 var t2 = {}.toString.call(r2).slice(8, -1); 26377 return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$2(r2, a2) : void 0; 26378 } 26379 } 26380 const entries = Object.entries, setPrototypeOf = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf = Object.getPrototypeOf, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 26381 let freeze = Object.freeze, seal = Object.seal, create$9 = Object.create; 26382 let _ref = typeof Reflect !== "undefined" && Reflect, apply = _ref.apply, construct = _ref.construct; 26383 if (!freeze) { 26384 freeze = function freeze2(x2) { 26385 return x2; 26386 }; 26387 } 26388 if (!seal) { 26389 seal = function seal2(x2) { 26390 return x2; 26391 }; 26392 } 26393 if (!apply) { 26394 apply = function apply2(func, thisArg) { 26395 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 26396 args[_key - 2] = arguments[_key]; 26397 } 26398 return func.apply(thisArg, args); 26399 }; 26400 } 26401 if (!construct) { 26402 construct = function construct2(Func) { 26403 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 26404 args[_key2 - 1] = arguments[_key2]; 26405 } 26406 return new Func(...args); 26407 }; 26408 } 26409 const arrayForEach = unapply(Array.prototype.forEach); 26410 const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf); 26411 const arrayPop = unapply(Array.prototype.pop); 26412 const arrayPush = unapply(Array.prototype.push); 26413 const arraySplice = unapply(Array.prototype.splice); 26414 const arrayIsArray = Array.isArray; 26415 const stringToLowerCase = unapply(String.prototype.toLowerCase); 26416 const stringToString = unapply(String.prototype.toString); 26417 const stringMatch = unapply(String.prototype.match); 26418 const stringReplace = unapply(String.prototype.replace); 26419 const stringIndexOf = unapply(String.prototype.indexOf); 26420 const stringTrim = unapply(String.prototype.trim); 26421 const numberToString = unapply(Number.prototype.toString); 26422 const booleanToString = unapply(Boolean.prototype.toString); 26423 const bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString); 26424 const symbolToString$1 = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString); 26425 const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); 26426 const objectToString = unapply(Object.prototype.toString); 26427 const regExpTest = unapply(RegExp.prototype.test); 26428 const typeErrorCreate = unconstruct(TypeError); 26429 function unapply(func) { 26430 return function(thisArg) { 26431 if (thisArg instanceof RegExp) { 26432 thisArg.lastIndex = 0; 26433 } 26434 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { 26435 args[_key3 - 1] = arguments[_key3]; 26436 } 26437 return apply(func, thisArg, args); 26438 }; 26439 } 26440 function unconstruct(Func) { 26441 return function() { 26442 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
vendor: 8,250 bytes, lines 26443-26572
26443 args[_key4] = arguments[_key4]; 26444 } 26445 return construct(Func, args); 26446 }; 26447 } 26448 function addToSet(set2, array2) { 26449 let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase; 26450 if (setPrototypeOf) { 26451 setPrototypeOf(set2, null); 26452 } 26453 if (!arrayIsArray(array2)) { 26454 return set2; 26455 } 26456 let l2 = array2.length; 26457 while (l2--) { 26458 let element = array2[l2]; 26459 if (typeof element === "string") { 26460 const lcElement = transformCaseFunc(element); 26461 if (lcElement !== element) { 26462 if (!isFrozen(array2)) { 26463 array2[l2] = lcElement; 26464 } 26465 element = lcElement; 26466 } 26467 } 26468 set2[element] = true; 26469 } 26470 return set2; 26471 } 26472 function cleanArray(array2) { 26473 for (let index2 = 0; index2 < array2.length; index2++) { 26474 const isPropertyExist = objectHasOwnProperty(array2, index2); 26475 if (!isPropertyExist) { 26476 array2[index2] = null; 26477 } 26478 } 26479 return array2; 26480 } 26481 function clone$1(object2) { 26482 const newObject = create$9(null); 26483 for (const _ref2 of entries(object2)) { 26484 var _ref3 = _slicedToArray$2(_ref2, 2); 26485 const property2 = _ref3[0]; 26486 const value = _ref3[1]; 26487 const isPropertyExist = objectHasOwnProperty(object2, property2); 26488 if (isPropertyExist) { 26489 if (arrayIsArray(value)) { 26490 newObject[property2] = cleanArray(value); 26491 } else if (value && typeof value === "object" && value.constructor === Object) { 26492 newObject[property2] = clone$1(value); 26493 } else { 26494 newObject[property2] = value; 26495 } 26496 } 26497 } 26498 return newObject; 26499 } 26500 function stringifyValue(value) { 26501 switch (typeof value) { 26502 case "string": { 26503 return value; 26504 } 26505 case "number": { 26506 return numberToString(value); 26507 } 26508 case "boolean": { 26509 return booleanToString(value); 26510 } 26511 case "bigint": { 26512 return bigintToString ? bigintToString(value) : "0"; 26513 } 26514 case "symbol": { 26515 return symbolToString$1 ? symbolToString$1(value) : "Symbol()"; 26516 } 26517 case "undefined": { 26518 return objectToString(value); 26519 } 26520 case "function": 26521 case "object": { 26522 if (value === null) { 26523 return objectToString(value); 26524 } 26525 const valueAsRecord = value; 26526 const valueToString = lookupGetter(valueAsRecord, "toString"); 26527 if (typeof valueToString === "function") { 26528 const stringified = valueToString(valueAsRecord); 26529 return typeof stringified === "string" ? stringified : objectToString(stringified); 26530 } 26531 return objectToString(value); 26532 } 26533 default: { 26534 return objectToString(value); 26535 } 26536 } 26537 } 26538 function lookupGetter(object2, prop) { 26539 while (object2 !== null) { 26540 const desc = getOwnPropertyDescriptor(object2, prop); 26541 if (desc) { 26542 if (desc.get) { 26543 return unapply(desc.get); 26544 } 26545 if (typeof desc.value === "function") { 26546 return unapply(desc.value); 26547 } 26548 } 26549 object2 = getPrototypeOf(object2); 26550 } 26551 function fallbackValue() { 26552 return null; 26553 } 26554 return fallbackValue; 26555 } 26556 function isRegex(value) { 26557 try { 26558 regExpTest(value, ""); 26559 return true; 26560 } catch (_unused) { 26561 return false; 26562 } 26563 } 26564 const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]); 26565 const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]); 26566 const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]); 26567 const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]); 26568 const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]); 26569 const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]); 26570 const text = freeze(["#text"]); 26571 const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]); 26572 const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "dis
26572play", "divisor", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]); 26573 const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]); 26574 const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]); 26575 const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g); 26576 const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g); 26577 const TMPLIT_EXPR = seal(/\${[\w\W]*/g); 26578 const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); 26579 const ARIA_ATTR = seal(/^aria-[\-\w]+$/); 26580 const IS_ALLOWED_URI = seal(
vendor: 4,923 bytes, lines 26581-26691
26581 /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i 26582 // eslint-disable-line no-useless-escape 26583 ); 26584 const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); 26585 const ATTR_WHITESPACE = seal( 26586 /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g 26587 // eslint-disable-line no-control-regex 26588 ); 26589 const DOCTYPE_NAME = seal(/^html$/i); 26590 const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); 26591 const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g); 26592 const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g); 26593 const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i); 26594 const SELF_CLOSING_TAG = seal(/\/>/i); 26595 const NODE_TYPE = { 26596 element: 1, 26597 attribute: 2, 26598 text: 3, 26599 cdataSection: 4, 26600 entityReference: 5, 26601 // Deprecated 26602 entityNode: 6, 26603 // Deprecated 26604 processingInstruction: 7, 26605 comment: 8, 26606 document: 9, 26607 documentType: 10, 26608 documentFragment: 11, 26609 notation: 12 26610 // Deprecated 26611 }; 26612 const getGlobal = function getGlobal2() { 26613 return typeof window === "undefined" ? null : window; 26614 }; 26615 const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) { 26616 if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") { 26617 return null; 26618 } 26619 let suffix = null; 26620 const ATTR_NAME = "data-tt-policy-suffix"; 26621 if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { 26622 suffix = purifyHostElement.getAttribute(ATTR_NAME); 26623 } 26624 const policyName = "dompurify" + (suffix ? "#" + suffix : ""); 26625 try { 26626 return trustedTypes.createPolicy(policyName, { 26627 createHTML(html2) { 26628 return html2; 26629 }, 26630 createScriptURL(scriptUrl) { 26631 return scriptUrl; 26632 } 26633 }); 26634 } catch (_2) { 26635 console.warn("TrustedTypes policy " + policyName + " could not be created."); 26636 return null; 26637 } 26638 }; 26639 const _createHooksMap = function _createHooksMap2() { 26640 return { 26641 afterSanitizeAttributes: [], 26642 afterSanitizeElements: [], 26643 afterSanitizeShadowDOM: [], 26644 beforeSanitizeAttributes: [], 26645 beforeSanitizeElements: [], 26646 beforeSanitizeShadowDOM: [], 26647 uponSanitizeAttribute: [], 26648 uponSanitizeElement: [], 26649 uponSanitizeShadowNode: [] 26650 }; 26651 }; 26652 const _resolveSetOption = function _resolveSetOption2(cfg, key, fallback, options2) { 26653 return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options2.base ? clone$1(options2.base) : {}, cfg[key], options2.transform) : fallback; 26654 }; 26655 function createDOMPurify() { 26656 let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(); 26657 const DOMPurify = (root2) => createDOMPurify(root2); 26658 DOMPurify.version = "3.4.12"; 26659 DOMPurify.removed = []; 26660 if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) { 26661 DOMPurify.isSupported = false; 26662 return DOMPurify; 26663 } 26664 let document2 = window2.document; 26665 const originalDocument = document2; 26666 const currentScript = originalDocument.currentScript; 26667 window2.DocumentFragment; 26668 const HTMLTemplateElement = window2.HTMLTemplateElement, Node2 = window2.Node, Element2 = window2.Element, NodeFilter = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap; 26669 _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap; 26670 window2.HTMLFormElement; 26671 const DOMParser = window2.DOMParser, trustedTypes = window2.trustedTypes; 26672 const ElementPrototype = Element2.prototype; 26673 const cloneNode = lookupGetter(ElementPrototype, "cloneNode"); 26674 const remove = lookupGetter(ElementPrototype, "remove"); 26675 const getNextSibling = lookupGetter(ElementPrototype, "nextSibling"); 26676 const getChildNodes = lookupGetter(ElementPrototype, "childNodes"); 26677 const getParentNode2 = lookupGetter(ElementPrototype, "parentNode"); 26678 const getShadowRoot = lookupGetter(ElementPrototype, "shadowRoot"); 26679 const getAttributes = lookupGetter(ElementPrototype, "attributes"); 26680 const getNodeType = Node2 && Node2.prototype ? lookupGetter(Node2.prototype, "nodeType") : null; 26681 const getNodeName2 = Node2 && Node2.prototype ? lookupGetter(Node2.prototype, "nodeName") : null; 26682 if (typeof HTMLTemplateElement === "function") { 26683 const template = document2.createElement("template"); 26684 if (template.content && template.content.ownerDocument) { 26685 document2 = template.content.ownerDocument; 26686 } 26687 } 26688 let trustedTypesPolicy; 26689 let emptyHTML = ""; 26690 let defaultTrustedTypesPolicy; 26691 let defaultTrustedTypesPolicyResolved = false;
vendor: 3,872 bytes, lines 26692-26779
26692 let IN_TRUSTED_TYPES_POLICY = 0; 26693 const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy2() { 26694 if (IN_TRUSTED_TYPES_POLICY > 0) { 26695 throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.'); 26696 } 26697 }; 26698 const _createTrustedHTML = function _createTrustedHTML2(html2) { 26699 _assertNotInTrustedTypesPolicy(); 26700 IN_TRUSTED_TYPES_POLICY++; 26701 try { 26702 return trustedTypesPolicy.createHTML(html2); 26703 } finally { 26704 IN_TRUSTED_TYPES_POLICY--; 26705 } 26706 }; 26707 const _createTrustedScriptURL = function _createTrustedScriptURL2(scriptUrl) { 26708 _assertNotInTrustedTypesPolicy(); 26709 IN_TRUSTED_TYPES_POLICY++; 26710 try { 26711 return trustedTypesPolicy.createScriptURL(scriptUrl); 26712 } finally { 26713 IN_TRUSTED_TYPES_POLICY--; 26714 } 26715 }; 26716 const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy2() { 26717 if (!defaultTrustedTypesPolicyResolved) { 26718 defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); 26719 defaultTrustedTypesPolicyResolved = true; 26720 } 26721 return defaultTrustedTypesPolicy; 26722 }; 26723 const _document = document2, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName; 26724 const importNode = originalDocument.importNode; 26725 let hooks = _createHooksMap(); 26726 DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode2 === "function" && implementation && implementation.createHTMLDocument !== void 0; 26727 const MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT; 26728 let IS_ALLOWED_URI$1 = IS_ALLOWED_URI; 26729 let ALLOWED_TAGS = null; 26730 const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]); 26731 let ALLOWED_ATTR = null; 26732 const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); 26733 let CUSTOM_ELEMENT_HANDLING = Object.seal(create$9(null, { 26734 tagNameCheck: { 26735 writable: true, 26736 configurable: false, 26737 enumerable: true, 26738 value: null 26739 }, 26740 attributeNameCheck: { 26741 writable: true, 26742 configurable: false, 26743 enumerable: true, 26744 value: null 26745 }, 26746 allowCustomizedBuiltInElements: { 26747 writable: true, 26748 configurable: false, 26749 enumerable: true, 26750 value: false 26751 } 26752 })); 26753 let FORBID_TAGS = null; 26754 let FORBID_ATTR = null; 26755 const EXTRA_ELEMENT_HANDLING = Object.seal(create$9(null, { 26756 tagCheck: { 26757 writable: true, 26758 configurable: false, 26759 enumerable: true, 26760 value: null 26761 }, 26762 attributeCheck: { 26763 writable: true, 26764 configurable: false, 26765 enumerable: true, 26766 value: null 26767 } 26768 })); 26769 let ALLOW_ARIA_ATTR = true; 26770 let ALLOW_DATA_ATTR = true; 26771 let ALLOW_UNKNOWN_PROTOCOLS = false; 26772 let ALLOW_SELF_CLOSE_IN_ATTR = true; 26773 let SAFE_FOR_TEMPLATES = false; 26774 let SAFE_FOR_XML = true; 26775 let WHOLE_DOCUMENT = false; 26776 let SET_CONFIG = false; 26777 let SET_CONFIG_ALLOWED_TAGS = null; 26778 let SET_CONFIG_ALLOWED_ATTR = null; 26779 let FORCE_BODY = false;
26780 let RETURN_DOM = false; 26781 let RETURN_DOM_FRAGMENT = false; 26782 let RETURN_TRUSTED_TYPE = false; 26783 let SANITIZE_DOM = true; 26784 let SANITIZE_NAMED_PROPS = false; 26785 const SANITIZE_NAMED_PROPS_PREFIX = "user-content-"; 26786 let KEEP_CONTENT = true; 26787 let IN_PLACE = false; 26788 let USE_PROFILES = {}; 26789 let FORBID_CONTENTS = null; 26790 const DEFAULT_FORBID_CONTENTS = addToSet({}, [ 26791 "annotation-xml", 26792 "audio", 26793 "colgroup", 26794 "desc", 26795 "foreignobject", 26796 "head", 26797 "iframe", 26798 "math", 26799 "mi", 26800 "mn", 26801 "mo", 26802 "ms", 26803 "mtext", 26804 "noembed", 26805 "noframes", 26806 "noscript", 26807 "plaintext", 26808 "script", 26809 // <selectedcontent> mirrors the selected <option>'s subtree, cloned by 26810 // the UA (customizable <select>) â including any on* handlers â and the 26811 // engine re-mirrors synchronously whenever a removal changes which 26812 // option/selectedcontent is current, even inside DOMPurify's inert 26813 // DOMParser document. Hoisting its children on removal re-inserts a fresh 26814 // mirror target ahead of the walk, which the engine refills, looping 26815 // forever (DoS) and amplifying output. Dropping its content on removal 26816 // (rather than hoisting) breaks that cascade; the content is a duplicate 26817 // of the option, which is sanitized on its own. See campaign-3 F1/F6. 26818 "selectedcontent", 26819 "style", 26820 "svg", 26821 "template", 26822 "thead", 26823 "title", 26824 "video", 26825 "xmp" 26826 ]); 26827 let DATA_URI_TAGS = null; 26828 const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]); 26829 let URI_SAFE_ATTRIBUTES = null; 26830 const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]); 26831 const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; 26832 const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; 26833 const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; 26834 let NAMESPACE = HTML_NAMESPACE; 26835 let IS_EMPTY_INPUT = false;
vendor: 1,968 bytes, lines 26836-26869
26836 let ALLOWED_NAMESPACES = null; 26837 const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); 26838 const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(["mi", "mo", "mn", "ms", "mtext"]); 26839 let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); 26840 const DEFAULT_HTML_INTEGRATION_POINTS = freeze(["annotation-xml"]); 26841 let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); 26842 const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]); 26843 let PARSER_MEDIA_TYPE = null; 26844 const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"]; 26845 const DEFAULT_PARSER_MEDIA_TYPE = "text/html"; 26846 let transformCaseFunc = null; 26847 let CONFIG = null; 26848 const formElement = document2.createElement("form"); 26849 const isRegexOrFunction = function isRegexOrFunction2(testValue) { 26850 return testValue instanceof RegExp || testValue instanceof Function; 26851 }; 26852 const _parseConfig = function _parseConfig2() { 26853 let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 26854 if (CONFIG && CONFIG === cfg) { 26855 return; 26856 } 26857 if (!cfg || typeof cfg !== "object") { 26858 cfg = {}; 26859 } 26860 cfg = clone$1(cfg); 26861 PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes 26862 SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; 26863 transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase; 26864 ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, { 26865 transform: transformCaseFunc 26866 }); 26867 ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, { 26868 transform: transformCaseFunc 26869 });
vendor: 9,382 bytes, lines 26870-27051
26870 ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, { 26871 transform: stringToString 26872 }); 26873 URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, { 26874 transform: transformCaseFunc, 26875 base: DEFAULT_URI_SAFE_ATTRIBUTES 26876 }); 26877 DATA_URI_TAGS = _resolveSetOption(cfg, "ADD_DATA_URI_TAGS", DEFAULT_DATA_URI_TAGS, { 26878 transform: transformCaseFunc, 26879 base: DEFAULT_DATA_URI_TAGS 26880 }); 26881 FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, { 26882 transform: transformCaseFunc 26883 }); 26884 FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone$1({}), { 26885 transform: transformCaseFunc 26886 }); 26887 FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone$1({}), { 26888 transform: transformCaseFunc 26889 }); 26890 USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone$1(cfg.USE_PROFILES) : cfg.USE_PROFILES : false; 26891 ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; 26892 ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; 26893 ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; 26894 ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; 26895 SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; 26896 SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; 26897 WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; 26898 RETURN_DOM = cfg.RETURN_DOM || false; 26899 RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; 26900 RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; 26901 FORCE_BODY = cfg.FORCE_BODY || false; 26902 SANITIZE_DOM = cfg.SANITIZE_DOM !== false; 26903 SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; 26904 KEEP_CONTENT = cfg.KEEP_CONTENT !== false; 26905 IN_PLACE = cfg.IN_PLACE || false; 26906 IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; 26907 NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE; 26908 MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "MATHML_TEXT_INTEGRATION_POINTS") && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === "object" ? clone$1(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); 26909 HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "HTML_INTEGRATION_POINTS") && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === "object" ? clone$1(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); 26910 const customElementHandling = objectHasOwnProperty(cfg, "CUSTOM_ELEMENT_HANDLING") && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === "object" ? clone$1(cfg.CUSTOM_ELEMENT_HANDLING) : create$9(null); 26911 CUSTOM_ELEMENT_HANDLING = create$9(null); 26912 if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) { 26913 CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; 26914 } 26915 if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) { 26916 CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck; 26917 } 26918 if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") { 26919 CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; 26920 } 26921 seal(CUSTOM_ELEMENT_HANDLING); 26922 if (SAFE_FOR_TEMPLATES) { 26923 ALLOW_DATA_ATTR = false; 26924 } 26925 if (RETURN_DOM_FRAGMENT) { 26926 RETURN_DOM = true; 26927 } 26928 if (USE_PROFILES) { 26929 ALLOWED_TAGS = addToSet({}, text); 26930 ALLOWED_ATTR = create$9(null); 26931 if (USE_PROFILES.html === true) { 26932 addToSet(ALLOWED_TAGS, html$1); 26933 addToSet(ALLOWED_ATTR, html); 26934 } 26935 if (USE_PROFILES.svg === true) { 26936 addToSet(ALLOWED_TAGS, svg$1); 26937 addToSet(ALLOWED_ATTR, svg); 26938 addToSet(ALLOWED_ATTR, xml); 26939 } 26940 if (USE_PROFILES.svgFilters === true) { 26941 addToSet(ALLOWED_TAGS, svgFilters); 26942 addToSet(ALLOWED_ATTR, svg); 26943 addToSet(ALLOWED_ATTR, xml); 26944 } 26945 if (USE_PROFILES.mathMl === true) { 26946 addToSet(ALLOWED_TAGS, mathMl$1); 26947 addToSet(ALLOWED_ATTR, mathMl); 26948 addToSet(ALLOWED_ATTR, xml); 26949 } 26950 } 26951 EXTRA_ELEMENT_HANDLING.tagCheck = null; 26952 EXTRA_ELEMENT_HANDLING.attributeCheck = null; 26953 if (objectHasOwnProperty(cfg, "ADD_TAGS")) { 26954 if (typeof cfg.ADD_TAGS === "function") { 26955 EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS; 26956 } else if (arrayIsArray(cfg.ADD_TAGS)) { 26957 if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { 26958 ALLOWED_TAGS = clone$1(ALLOWED_TAGS); 26959 } 26960 addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); 26961 } 26962 } 26963 if (objectHasOwnProperty(cfg, "ADD_ATTR")) { 26964 if (typeof cfg.ADD_ATTR === "function") { 26965 EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR; 26966 } else if (arrayIsArray(cfg.ADD_ATTR)) { 26967 if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { 26968 ALLOWED_ATTR = clone$1(ALLOWED_ATTR); 26969 } 26970 addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); 26971 } 26972 } 26973 if (objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) { 26974 addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); 26975 } 26976 if (objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS)) { 26977 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { 26978 FORBID_CONTENTS = clone$1(FORBID_CONTENTS); 26979 } 26980 addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); 26981 } 26982 if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) { 26983 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { 26984 FORBID_CONTENTS = clone$1(FORBID_CONTENTS); 26985 } 26986 addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc); 26987 } 26988 if (KEEP_CONTENT) { 26989 ALLOWED_TAGS["#text"] = true; 26990 } 26991 if (WHOLE_DOCUMENT) { 26992 addToSet(ALLOWED_TAGS, ["html", "head", "body"]); 26993 } 26994 if (ALLOWED_TAGS.table) { 26995 addToSet(ALLOWED_TAGS, ["tbody"]); 26996 delete FORBID_TAGS.tbody; 26997 } 26998 if (cfg.TRUSTED_TYPES_POLICY) { 26999 if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") { 27000 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); 27001 } 27002 if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") { 27003 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); 27004 } 27005 const previousTrustedTypesPolicy = trustedTypesPolicy; 27006 trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; 27007 try { 27008 emptyHTML = _createTrustedHTML(""); 27009 } catch (error) { 27010 trustedTypesPolicy = previousTrustedTypesPolicy; 27011 throw error; 27012 } 27013 } else if (cfg.TRUSTED_TYPES_POLICY === null) { 27014 trustedTypesPolicy = void 0; 27015 emptyHTML = ""; 27016 } else { 27017 if (trustedTypesPolicy === void 0) { 27018 trustedTypesPolicy = _getDefaultTrustedTypesPolicy(); 27019 } 27020 if (trustedTypesPolicy && typeof emptyHTML === "string") { 27021 emptyHTML = _createTrustedHTML(""); 27022 } 27023 } 27024 if (freeze) { 27025 freeze(cfg); 27026 } 27027 CONFIG = cfg; 27028 }; 27029 const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); 27030 const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); 27031 const _checkSvgNamespace = function _checkSvgNamespace2(tagName, parent, parentTagName) { 27032 if (parent.namespaceURI === HTML_NAMESPACE) { 27033 return tagName === "svg"; 27034 } 27035 if (parent.namespaceURI === MATHML_NAMESPACE) { 27036 return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); 27037 } 27038 return Boolean(ALL_SVG_TAGS[tagName]); 27039 }; 27040 const _checkMathMlNamespace = function _checkMathMlNamespace2(tagName, parent, parentTagName) { 27041 if (parent.namespaceURI === HTML_NAMESPACE) { 27042 return tagName === "math"; 27043 } 27044 if (parent.namespaceURI === SVG_NAMESPACE) { 27045 return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName]; 27046 } 27047 return Boolean(ALL_MATHML_TAGS[tagName]); 27048 }; 27049 const _checkHtmlNamespace = function _checkHtmlNamespace2(tagName, parent, parentTagName) { 27050 if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { 27051 return false;
vendor: 27,760 bytes, lines 27052-27683
27052 } 27053 if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { 27054 return false; 27055 } 27056 return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); 27057 }; 27058 const _checkValidNamespace = function _checkValidNamespace2(element) { 27059 let parent = getParentNode2(element); 27060 if (!parent || !parent.tagName) { 27061 parent = { 27062 namespaceURI: NAMESPACE, 27063 tagName: "template" 27064 }; 27065 } 27066 const tagName = stringToLowerCase(element.tagName); 27067 const parentTagName = stringToLowerCase(parent.tagName); 27068 if (!ALLOWED_NAMESPACES[element.namespaceURI]) { 27069 return false; 27070 } 27071 if (element.namespaceURI === SVG_NAMESPACE) { 27072 return _checkSvgNamespace(tagName, parent, parentTagName); 27073 } 27074 if (element.namespaceURI === MATHML_NAMESPACE) { 27075 return _checkMathMlNamespace(tagName, parent, parentTagName); 27076 } 27077 if (element.namespaceURI === HTML_NAMESPACE) { 27078 return _checkHtmlNamespace(tagName, parent, parentTagName); 27079 } 27080 if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) { 27081 return true; 27082 } 27083 return false; 27084 }; 27085 const _forceRemove = function _forceRemove2(node2) { 27086 arrayPush(DOMPurify.removed, { 27087 element: node2 27088 }); 27089 try { 27090 getParentNode2(node2).removeChild(node2); 27091 } catch (_2) { 27092 remove(node2); 27093 if (!getParentNode2(node2)) { 27094 throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place"); 27095 } 27096 } 27097 }; 27098 const _neutralizeRoot = function _neutralizeRoot2(root2) { 27099 _neutralizeSubtree(root2); 27100 const childNodes = getChildNodes(root2); 27101 if (childNodes) { 27102 const snapshot = []; 27103 arrayForEach(childNodes, (child) => { 27104 arrayPush(snapshot, child); 27105 }); 27106 arrayForEach(snapshot, (child) => { 27107 try { 27108 remove(child); 27109 } catch (_2) { 27110 } 27111 }); 27112 } 27113 const attributes = getAttributes(root2); 27114 if (attributes) { 27115 for (let i2 = attributes.length - 1; i2 >= 0; --i2) { 27116 const attribute2 = attributes[i2]; 27117 const name = attribute2 && attribute2.name; 27118 if (typeof name === "string") { 27119 try { 27120 root2.removeAttribute(name); 27121 } catch (_2) { 27122 } 27123 } 27124 } 27125 } 27126 }; 27127 const _removeAttribute = function _removeAttribute2(name, element) { 27128 try { 27129 arrayPush(DOMPurify.removed, { 27130 attribute: element.getAttributeNode(name), 27131 from: element 27132 }); 27133 } catch (_2) { 27134 arrayPush(DOMPurify.removed, { 27135 attribute: null, 27136 from: element 27137 }); 27138 } 27139 element.removeAttribute(name); 27140 if (name === "is") { 27141 if (RETURN_DOM || RETURN_DOM_FRAGMENT) { 27142 try { 27143 _forceRemove(element); 27144 } catch (_2) { 27145 } 27146 } else { 27147 try { 27148 element.setAttribute(name, ""); 27149 } catch (_2) { 27150 } 27151 } 27152 } 27153 }; 27154 const _stripDisallowedAttributes = function _stripDisallowedAttributes2(element) { 27155 const attributes = getAttributes(element); 27156 if (!attributes) { 27157 return; 27158 } 27159 for (let i2 = attributes.length - 1; i2 >= 0; --i2) { 27160 const attribute2 = attributes[i2]; 27161 const name = attribute2 && attribute2.name; 27162 if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) { 27163 continue; 27164 } 27165 try { 27166 element.removeAttribute(name); 27167 } catch (_2) { 27168 } 27169 } 27170 }; 27171 const _neutralizeSubtree = function _neutralizeSubtree2(root2) { 27172 const stack = [root2]; 27173 while (stack.length > 0) { 27174 const node2 = stack.pop(); 27175 const nodeType = getNodeType ? getNodeType(node2) : node2.nodeType; 27176 if (nodeType === NODE_TYPE.element) { 27177 _stripDisallowedAttributes(node2); 27178 } 27179 const childNodes = getChildNodes(node2); 27180 if (childNodes) { 27181 for (let i2 = childNodes.length - 1; i2 >= 0; --i2) { 27182 stack.push(childNodes[i2]); 27183 } 27184 } 27185 } 27186 }; 27187 const _neutralizePatchLinkage = function _neutralizePatchLinkage2(root2) { 27188 if (!SAFE_FOR_XML) { 27189 return; 27190 } 27191 const stack = [root2]; 27192 while (stack.length > 0) { 27193 const node2 = stack.pop(); 27194 const nodeType = getNodeType ? getNodeType(node2) : node2.nodeType; 27195 if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node2.data)) { 27196 try { 27197 remove(node2); 27198 } catch (_2) { 27199 } 27200 continue; 27201 } 27202 if (nodeType === NODE_TYPE.element) { 27203 const element = node2; 27204 const lcTag = transformCaseFunc(getNodeName2 ? getNodeName2(node2) : node2.nodeName); 27205 try { 27206 if (element.hasAttribute && element.hasAttribute("patchsrc")) { 27207 element.removeAttribute("patchsrc"); 27208 } 27209 if (element.hasAttribute && element.hasAttribute("for") && lcTag !== "label" && lcTag !== "output") { 27210 element.removeAttribute("for"); 27211 } 27212 } catch (_2) { 27213 } 27214 } 27215 const childNodes = getChildNodes(node2); 27216 if (childNodes) { 27217 for (let i2 = childNodes.length - 1; i2 >= 0; --i2) { 27218 stack.push(childNodes[i2]); 27219 } 27220 } 27221 } 27222 }; 27223 const _initDocument = function _initDocument2(dirty) { 27224 let doc = null; 27225 let leadingWhitespace = null; 27226 if (FORCE_BODY) { 27227 dirty = "<remove></remove>" + dirty; 27228 } else { 27229 const matches2 = stringMatch(dirty, /^[\r\n\t ]+/); 27230 leadingWhitespace = matches2 && matches2[0]; 27231 } 27232 if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) { 27233 dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>"; 27234 } 27235 const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty; 27236 if (NAMESPACE === HTML_NAMESPACE) { 27237 try { 27238 doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); 27239 } catch (_2) { 27240 } 27241 } 27242 if (!doc || !doc.documentElement) { 27243 doc = implementation.createDocument(NAMESPACE, "template", null); 27244 try { 27245 doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; 27246 } catch (_2) { 27247 } 27248 } 27249 const body = doc.body || doc.documentElement; 27250 if (dirty && leadingWhitespace) { 27251 body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null); 27252 } 27253 if (NAMESPACE === HTML_NAMESPACE) { 27254 return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0]; 27255 } 27256 return WHOLE_DOCUMENT ? doc.documentElement : body; 27257 }; 27258 const _createNodeIterator = function _createNodeIterator2(root2) { 27259 return createNodeIterator.call( 27260 root2.ownerDocument || root2, 27261 root2, 27262 // eslint-disable-next-line no-bitwise 27263 NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, 27264 null 27265 ); 27266 }; 27267 const _stripTemplateExpressions = function _stripTemplateExpressions2(value) { 27268 value = stringReplace(value, MUSTACHE_EXPR$1, " "); 27269 value = stringReplace(value, ERB_EXPR$1, " "); 27270 value = stringReplace(value, TMPLIT_EXPR$1, " "); 27271 return value; 27272 }; 27273 const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node2) { 27274 var _node$querySelectorAl; 27275 node2.normalize(); 27276 const walker = createNodeIterator.call( 27277 node2.ownerDocument || node2, 27278 node2, 27279 // eslint-disable-next-line no-bitwise 27280 NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, 27281 null 27282 ); 27283 let currentNode = walker.nextNode(); 27284 while (currentNode) { 27285 currentNode.data = _stripTemplateExpressions(currentNode.data); 27286 currentNode = walker.nextNode(); 27287 } 27288 const templates = (_node$querySelectorAl = node2.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node2, "template"); 27289 if (templates) { 27290 arrayForEach(templates, (tmpl) => { 27291 if (_isDocumentFragment(tmpl.content)) { 27292 _scrubTemplateExpressions2(tmpl.content); 27293 } 27294 }); 27295 } 27296 }; 27297 const _isClobbered = function _isClobbered2(element) { 27298 const realTagName = getNodeName2 ? getNodeName2(element) : null; 27299 if (typeof realTagName !== "string") { 27300 return false; 27301 } 27302 if (transformCaseFunc(realTagName) !== "form") { 27303 return false; 27304 } 27305 return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || // Realm-safe NamedNodeMap detection: equality against the cached 27306 // prototype getter. Clobbered .attributes (e.g. <input name="attributes">) 27307 // makes the direct read diverge from the cached read; a clean form 27308 // (same-realm OR foreign-realm) has both reads pointing at the same 27309 // canonical NamedNodeMap. 27310 element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter 27311 // returns the integer 1 for any Element regardless of realm; direct 27312 // read on a clobbered form (e.g. <input name="nodeType">) returns 27313 // the named child element. Cheap addition â nodeType is read from 27314 // an internal slot, no serialization cost â and removes a residual 27315 // clobbering surface used by several mXSS / PI / comment branches 27316 // in _sanitizeElements that compare currentNode.nodeType directly. 27317 element.nodeType !== getNodeType(element) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named 27318 // "childNodes" shadows the prototype getter. Direct reads of 27319 // form.childNodes from a clobbered form return the named child 27320 // instead of the real NodeList, so any walk that reads it directly 27321 // skips the form's real children. Compare the direct read to the 27322 // cached Node.prototype getter â when the form's named-property 27323 // getter intercepts the read, the two values differ and we flag 27324 // the form. This catches every clobbering child type (input, 27325 // select, etc.) regardless of whether the named child happens to 27326 // carry a numeric .length, which a typeof-based probe would miss 27327 // (e.g. HTMLSelectElement.length is a defined unsigned-long). 27328 element.childNodes !== getChildNodes(element); 27329 }; 27330 const _isDocumentFragment = function _isDocumentFragment2(value) { 27331 if (!getNodeType || typeof value !== "object" || value === null) { 27332 return false; 27333 } 27334 try { 27335 return getNodeType(value) === NODE_TYPE.documentFragment; 27336 } catch (_2) { 27337 return false; 27338 } 27339 }; 27340 const _isNode = function _isNode2(value) { 27341 if (!getNodeType || typeof value !== "object" || value === null) { 27342 return false; 27343 } 27344 try { 27345 return typeof getNodeType(value) === "number"; 27346 } catch (_2) { 27347 return false; 27348 } 27349 }; 27350 function _executeHooks(hooks2, currentNode, data) { 27351 if (hooks2.length === 0) { 27352 return; 27353 } 27354 arrayForEach(hooks2, (hook) => { 27355 hook.call(DOMPurify, currentNode, data, CONFIG); 27356 }); 27357 } 27358 const _isUnsafeNode = function _isUnsafeNode2(currentNode, tagName) { 27359 if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) { 27360 return true; 27361 } 27362 if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === "style" && _isNode(currentNode.firstElementChild)) { 27363 return true; 27364 } 27365 if (currentNode.nodeType === NODE_TYPE.processingInstruction) { 27366 return true; 27367 } 27368 if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) { 27369 return true; 27370 } 27371 return false; 27372 }; 27373 const _sanitizeDisallowedNode = function _sanitizeDisallowedNode2(currentNode, tagName) { 27374 if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { 27375 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { 27376 return false; 27377 } 27378 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { 27379 return false; 27380 } 27381 } 27382 if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { 27383 const parentNode = getParentNode2(currentNode); 27384 const childNodes = getChildNodes(currentNode); 27385 if (childNodes && parentNode) { 27386 const childCount = childNodes.length; 27387 for (let i2 = childCount - 1; i2 >= 0; --i2) { 27388 const hoisted = IN_PLACE ? childNodes[i2] : cloneNode(childNodes[i2], true); 27389 parentNode.insertBefore(hoisted, getNextSibling(currentNode)); 27390 } 27391 } 27392 } 27393 _forceRemove(currentNode); 27394 return true; 27395 }; 27396 const _sanitizeElements = function _sanitizeElements2(currentNode, root2) { 27397 _executeHooks(hooks.beforeSanitizeElements, currentNode, null); 27398 if (currentNode !== root2 && getParentNode2(currentNode) === null) { 27399 return true; 27400 } 27401 if (_isClobbered(currentNode)) { 27402 _forceRemove(currentNode); 27403 return true; 27404 } 27405 const tagName = transformCaseFunc(getNodeName2 ? getNodeName2(currentNode) : currentNode.nodeName); 27406 _executeHooks(hooks.uponSanitizeElement, currentNode, { 27407 tagName, 27408 allowedTags: ALLOWED_TAGS 27409 }); 27410 if (currentNode !== root2 && getParentNode2(currentNode) === null) { 27411 return true; 27412 } 27413 if (_isUnsafeNode(currentNode, tagName)) { 27414 _forceRemove(currentNode); 27415 return true; 27416 } 27417 if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) { 27418 const removed = _sanitizeDisallowedNode(currentNode, tagName); 27419 if (removed === false) { 27420 _executeHooks(hooks.afterSanitizeElements, currentNode, null); 27421 } 27422 return removed; 27423 } 27424 const nt2 = getNodeType ? getNodeType(currentNode) : currentNode.nodeType; 27425 if (nt2 === NODE_TYPE.element && !_checkValidNamespace(currentNode)) { 27426 _forceRemove(currentNode); 27427 return true; 27428 } 27429 if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) { 27430 _forceRemove(currentNode); 27431 return true; 27432 } 27433 if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { 27434 const content = _stripTemplateExpressions(currentNode.textContent); 27435 if (currentNode.textContent !== content) { 27436 arrayPush(DOMPurify.removed, { 27437 element: currentNode.cloneNode() 27438 }); 27439 currentNode.textContent = content; 27440 } 27441 } 27442 _executeHooks(hooks.afterSanitizeElements, currentNode, null); 27443 return false; 27444 }; 27445 const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) { 27446 if (FORBID_ATTR[lcName]) { 27447 return false; 27448 } 27449 if (SAFE_FOR_XML && lcName === "patchsrc") { 27450 return false; 27451 } 27452 if (SAFE_FOR_XML && lcName === "for" && lcTag !== "label" && lcTag !== "output") { 27453 return false; 27454 } 27455 if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) { 27456 return false; 27457 } 27458 const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag); 27459 if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; 27460 else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; 27461 else if (!nameIsPermitted) { 27462 if ( 27463 // First condition does a very basic check if a) it's basically a valid custom element tagname AND 27464 // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck 27465 // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck 27466 _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || // Alternative, second condition checks if it's an `is`-attribute, AND 27467 // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck 27468 lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)) 27469 ) ; 27470 else { 27471 return false; 27472 } 27473 } else if (URI_SAFE_ATTRIBUTES[lcName]) ; 27474 else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) ; 27475 else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) ; 27476 else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) ; 27477 else if (value) { 27478 return false; 27479 } else ; 27480 return true; 27481 }; 27482 const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]); 27483 const _isBasicCustomElement = function _isBasicCustomElement2(tagName) { 27484 return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName); 27485 }; 27486 const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute2(lcTag, lcName, namespaceURI, value) { 27487 if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) { 27488 switch (trustedTypes.getAttributeType(lcTag, lcName)) { 27489 case "TrustedHTML": { 27490 return _createTrustedHTML(value); 27491 } 27492 case "TrustedScriptURL": { 27493 return _createTrustedScriptURL(value); 27494 } 27495 } 27496 } 27497 return value; 27498 }; 27499 const _setAttributeValue = function _setAttributeValue2(currentNode, name, namespaceURI, value) { 27500 try { 27501 if (namespaceURI) { 27502 currentNode.setAttributeNS(namespaceURI, name, value); 27503 } else { 27504 currentNode.setAttribute(name, value); 27505 } 27506 if (_isClobbered(currentNode)) { 27507 _forceRemove(currentNode); 27508 } else { 27509 arrayPop(DOMPurify.removed); 27510 } 27511 } catch (_2) { 27512 _removeAttribute(name, currentNode); 27513 } 27514 }; 27515 const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) { 27516 _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null); 27517 const attributes = currentNode.attributes; 27518 if (!attributes || _isClobbered(currentNode)) { 27519 return; 27520 } 27521 const hookEvent = { 27522 attrName: "", 27523 attrValue: "", 27524 keepAttr: true, 27525 allowedAttributes: ALLOWED_ATTR, 27526 forceKeepAttr: void 0 27527 }; 27528 let l2 = attributes.length; 27529 const lcTag = transformCaseFunc(currentNode.nodeName); 27530 while (l2--) { 27531 const attr2 = attributes[l2]; 27532 const name = attr2.name, namespaceURI = attr2.namespaceURI, attrValue = attr2.value; 27533 const lcName = transformCaseFunc(name); 27534 const initValue = attrValue; 27535 let value = name === "value" ? initValue : stringTrim(initValue); 27536 hookEvent.attrName = lcName; 27537 hookEvent.attrValue = value; 27538 hookEvent.keepAttr = true; 27539 hookEvent.forceKeepAttr = void 0; 27540 _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent); 27541 value = hookEvent.attrValue; 27542 if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) { 27543 _removeAttribute(name, currentNode); 27544 value = SANITIZE_NAMED_PROPS_PREFIX + value; 27545 } 27546 if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) { 27547 _removeAttribute(name, currentNode); 27548 continue; 27549 } 27550 if (lcName === "attributename" && stringMatch(value, "href")) { 27551 _removeAttribute(name, currentNode); 27552 continue; 27553 } 27554 if (hookEvent.forceKeepAttr) { 27555 continue; 27556 } 27557 if (!hookEvent.keepAttr) { 27558 _removeAttribute(name, currentNode); 27559 continue; 27560 } 27561 if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) { 27562 _removeAttribute(name, currentNode); 27563 continue; 27564 } 27565 if (SAFE_FOR_TEMPLATES) { 27566 value = _stripTemplateExpressions(value); 27567 } 27568 if (!_isValidAttribute(lcTag, lcName, value)) { 27569 _removeAttribute(name, currentNode); 27570 continue; 27571 } 27572 value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value); 27573 if (value !== initValue) { 27574 _setAttributeValue(currentNode, name, namespaceURI, value); 27575 } 27576 } 27577 _executeHooks(hooks.afterSanitizeAttributes, currentNode, null); 27578 }; 27579 const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) { 27580 let shadowNode = null; 27581 const shadowIterator = _createNodeIterator(fragment); 27582 _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null); 27583 while (shadowNode = shadowIterator.nextNode()) { 27584 _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null); 27585 _sanitizeElements(shadowNode, fragment); 27586 _sanitizeAttributes(shadowNode); 27587 if (_isDocumentFragment(shadowNode.content)) { 27588 _sanitizeShadowDOM2(shadowNode.content); 27589 } 27590 const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType; 27591 if (shadowNodeType === NODE_TYPE.element) { 27592 const innerSr = getShadowRoot(shadowNode); 27593 if (_isDocumentFragment(innerSr)) { 27594 _sanitizeAttachedShadowRoots(innerSr); 27595 _sanitizeShadowDOM2(innerSr); 27596 } 27597 } 27598 } 27599 _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null); 27600 }; 27601 const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots2(root2) { 27602 const stack = [{ 27603 node: root2, 27604 shadow: null 27605 }]; 27606 while (stack.length > 0) { 27607 const item = stack.pop(); 27608 if (item.shadow) { 27609 _sanitizeShadowDOM2(item.shadow); 27610 continue; 27611 } 27612 const node2 = item.node; 27613 const nodeType = getNodeType ? getNodeType(node2) : node2.nodeType; 27614 const isElement2 = nodeType === NODE_TYPE.element; 27615 const childNodes = getChildNodes(node2); 27616 if (childNodes) { 27617 for (let i2 = childNodes.length - 1; i2 >= 0; --i2) { 27618 stack.push({ 27619 node: childNodes[i2], 27620 shadow: null 27621 }); 27622 } 27623 } 27624 if (isElement2) { 27625 const rootName = getNodeName2 ? getNodeName2(node2) : null; 27626 if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") { 27627 const content = node2.content; 27628 if (_isDocumentFragment(content)) { 27629 stack.push({ 27630 node: content, 27631 shadow: null 27632 }); 27633 } 27634 } 27635 } 27636 if (isElement2) { 27637 const sr2 = getShadowRoot(node2); 27638 if (_isDocumentFragment(sr2)) { 27639 stack.push({ 27640 node: null, 27641 shadow: sr2 27642 }, { 27643 node: sr2, 27644 shadow: null 27645 }); 27646 } 27647 } 27648 } 27649 }; 27650 DOMPurify.sanitize = function(dirty) { 27651 let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 27652 let body = null; 27653 let importedNode = null; 27654 let currentNode = null; 27655 let returnNode = null; 27656 IS_EMPTY_INPUT = !dirty; 27657 if (IS_EMPTY_INPUT) { 27658 dirty = "<!-->"; 27659 } 27660 if (typeof dirty !== "string" && !_isNode(dirty)) { 27661 dirty = stringifyValue(dirty); 27662 if (typeof dirty !== "string") { 27663 throw typeErrorCreate("dirty is not a string, aborting"); 27664 } 27665 } 27666 if (!DOMPurify.isSupported) { 27667 return dirty; 27668 } 27669 if (SET_CONFIG) { 27670 ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS; 27671 ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR; 27672 } else { 27673 _parseConfig(cfg); 27674 } 27675 if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) { 27676 ALLOWED_TAGS = clone$1(ALLOWED_TAGS); 27677 } 27678 if (hooks.uponSanitizeAttribute.length > 0) { 27679 ALLOWED_ATTR = clone$1(ALLOWED_ATTR); 27680 } 27681 DOMPurify.removed = []; 27682 const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty); 27683 if (inPlace) {
vendor: 8,621 bytes, lines 27684-27934
27684 _neutralizePatchLinkage(dirty); 27685 const nn2 = getNodeName2 ? getNodeName2(dirty) : dirty.nodeName; 27686 if (typeof nn2 === "string") { 27687 const tagName = transformCaseFunc(nn2); 27688 if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { 27689 _neutralizeRoot(dirty); 27690 throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place"); 27691 } 27692 } 27693 if (_isClobbered(dirty)) { 27694 _neutralizeRoot(dirty); 27695 throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place"); 27696 } 27697 try { 27698 _sanitizeAttachedShadowRoots(dirty); 27699 } catch (error) { 27700 _neutralizeRoot(dirty); 27701 throw error; 27702 } 27703 } else if (_isNode(dirty)) { 27704 body = _initDocument("<!---->"); 27705 importedNode = body.ownerDocument.importNode(dirty, true); 27706 if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") { 27707 body = importedNode; 27708 } else if (importedNode.nodeName === "HTML") { 27709 body = importedNode; 27710 } else { 27711 body.appendChild(importedNode); 27712 } 27713 _sanitizeAttachedShadowRoots(importedNode); 27714 } else { 27715 if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes 27716 dirty.indexOf("<") === -1) { 27717 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty; 27718 } 27719 body = _initDocument(dirty); 27720 if (!body) { 27721 return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ""; 27722 } 27723 } 27724 if (body && FORCE_BODY) { 27725 _forceRemove(body.firstChild); 27726 } 27727 const walkRoot = inPlace ? dirty : body; 27728 const nodeIterator = _createNodeIterator(walkRoot); 27729 try { 27730 while (currentNode = nodeIterator.nextNode()) { 27731 _sanitizeElements(currentNode, walkRoot); 27732 _sanitizeAttributes(currentNode); 27733 if (_isDocumentFragment(currentNode.content)) { 27734 _sanitizeShadowDOM2(currentNode.content); 27735 } 27736 } 27737 } catch (error) { 27738 if (inPlace) { 27739 _neutralizeRoot(dirty); 27740 arrayForEach(DOMPurify.removed, (entry) => { 27741 if (entry.element) { 27742 _neutralizeSubtree(entry.element); 27743 } 27744 }); 27745 } 27746 throw error; 27747 } 27748 if (inPlace) { 27749 arrayForEach(DOMPurify.removed, (entry) => { 27750 if (entry.element) { 27751 _neutralizeSubtree(entry.element); 27752 } 27753 }); 27754 if (SAFE_FOR_TEMPLATES) { 27755 _scrubTemplateExpressions2(dirty); 27756 } 27757 return dirty; 27758 } 27759 if (RETURN_DOM) { 27760 if (SAFE_FOR_TEMPLATES) { 27761 _scrubTemplateExpressions2(body); 27762 } 27763 if (RETURN_DOM_FRAGMENT) { 27764 returnNode = createDocumentFragment.call(body.ownerDocument); 27765 while (body.firstChild) { 27766 returnNode.appendChild(body.firstChild); 27767 } 27768 } else { 27769 returnNode = body; 27770 } 27771 if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { 27772 returnNode = importNode.call(originalDocument, returnNode, true); 27773 } 27774 return returnNode; 27775 } 27776 let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; 27777 if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { 27778 serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML; 27779 } 27780 if (SAFE_FOR_TEMPLATES) { 27781 serializedHTML = _stripTemplateExpressions(serializedHTML); 27782 } 27783 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML; 27784 }; 27785 DOMPurify.setConfig = function() { 27786 let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 27787 _parseConfig(cfg); 27788 SET_CONFIG = true; 27789 SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS; 27790 SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR; 27791 }; 27792 DOMPurify.clearConfig = function() { 27793 CONFIG = null; 27794 SET_CONFIG = false; 27795 SET_CONFIG_ALLOWED_TAGS = null; 27796 SET_CONFIG_ALLOWED_ATTR = null; 27797 trustedTypesPolicy = defaultTrustedTypesPolicy; 27798 emptyHTML = ""; 27799 }; 27800 DOMPurify.isValidAttribute = function(tag, attr2, value) { 27801 if (!CONFIG) { 27802 _parseConfig({}); 27803 } 27804 const lcTag = transformCaseFunc(tag); 27805 const lcName = transformCaseFunc(attr2); 27806 return _isValidAttribute(lcTag, lcName, value); 27807 }; 27808 DOMPurify.addHook = function(entryPoint, hookFunction) { 27809 if (typeof hookFunction !== "function") { 27810 return; 27811 } 27812 if (!objectHasOwnProperty(hooks, entryPoint)) { 27813 return; 27814 } 27815 arrayPush(hooks[entryPoint], hookFunction); 27816 }; 27817 DOMPurify.removeHook = function(entryPoint, hookFunction) { 27818 if (!objectHasOwnProperty(hooks, entryPoint)) { 27819 return void 0; 27820 } 27821 if (hookFunction !== void 0) { 27822 const index2 = arrayLastIndexOf(hooks[entryPoint], hookFunction); 27823 return index2 === -1 ? void 0 : arraySplice(hooks[entryPoint], index2, 1)[0]; 27824 } 27825 return arrayPop(hooks[entryPoint]); 27826 }; 27827 DOMPurify.removeHooks = function(entryPoint) { 27828 if (!objectHasOwnProperty(hooks, entryPoint)) { 27829 return; 27830 } 27831 hooks[entryPoint] = []; 27832 }; 27833 DOMPurify.removeAllHooks = function() { 27834 hooks = _createHooksMap(); 27835 }; 27836 return DOMPurify; 27837 } 27838 var purify = createDOMPurify(); 27839 var browser_default = purify; 27840 purify.sanitize.bind(purify); 27841 purify.isSupported; 27842 purify.addHook.bind(purify); 27843 purify.removeHook.bind(purify); 27844 purify.removeHooks.bind(purify); 27845 purify.removeAllHooks.bind(purify); 27846 purify.setConfig.bind(purify); 27847 purify.clearConfig.bind(purify); 27848 purify.isValidAttribute.bind(purify); 27849 purify.version; 27850 purify.removed; 27851 var names = { 27852 aliceblue: "f0f8ff", 27853 antiquewhite: "faebd7", 27854 aqua: "0ff", 27855 aquamarine: "7fffd4", 27856 azure: "f0ffff", 27857 beige: "f5f5dc", 27858 bisque: "ffe4c4", 27859 black: "000", 27860 blanchedalmond: "ffebcd", 27861 blue: "00f", 27862 blueviolet: "8a2be2", 27863 brown: "a52a2a", 27864 burlywood: "deb887", 27865 burntsienna: "ea7e5d", 27866 cadetblue: "5f9ea0", 27867 chartreuse: "7fff00", 27868 chocolate: "d2691e", 27869 coral: "ff7f50", 27870 cornflowerblue: "6495ed", 27871 cornsilk: "fff8dc", 27872 crimson: "dc143c", 27873 cyan: "0ff", 27874 darkblue: "00008b", 27875 darkcyan: "008b8b", 27876 darkgoldenrod: "b8860b", 27877 darkgray: "a9a9a9", 27878 darkgreen: "006400", 27879 darkgrey: "a9a9a9", 27880 darkkhaki: "bdb76b", 27881 darkmagenta: "8b008b", 27882 darkolivegreen: "556b2f", 27883 darkorange: "ff8c00", 27884 darkorchid: "9932cc", 27885 darkred: "8b0000", 27886 darksalmon: "e9967a", 27887 darkseagreen: "8fbc8f", 27888 darkslateblue: "483d8b", 27889 darkslategray: "2f4f4f", 27890 darkslategrey: "2f4f4f", 27891 darkturquoise: "00ced1", 27892 darkviolet: "9400d3", 27893 deeppink: "ff1493", 27894 deepskyblue: "00bfff", 27895 dimgray: "696969", 27896 dimgrey: "696969", 27897 dodgerblue: "1e90ff", 27898 firebrick: "b22222", 27899 floralwhite: "fffaf0", 27900 forestgreen: "228b22", 27901 fuchsia: "f0f", 27902 gainsboro: "dcdcdc", 27903 ghostwhite: "f8f8ff", 27904 gold: "ffd700", 27905 goldenrod: "daa520", 27906 gray: "808080", 27907 green: "008000", 27908 greenyellow: "adff2f", 27909 grey: "808080", 27910 honeydew: "f0fff0", 27911 hotpink: "ff69b4", 27912 indianred: "cd5c5c", 27913 indigo: "4b0082", 27914 ivory: "fffff0", 27915 khaki: "f0e68c", 27916 lavender: "e6e6fa", 27917 lavenderblush: "fff0f5", 27918 lawngreen: "7cfc00", 27919 lemonchiffon: "fffacd", 27920 lightblue: "add8e6", 27921 lightcoral: "f08080", 27922 lightcyan: "e0ffff", 27923 lightgoldenrodyellow: "fafad2", 27924 lightgray: "d3d3d3", 27925 lightgreen: "90ee90", 27926 lightgrey: "d3d3d3", 27927 lightpink: "ffb6c1", 27928 lightsalmon: "ffa07a", 27929 lightseagreen: "20b2aa", 27930 lightskyblue: "87cefa", 27931 lightslategray: "789", 27932 lightslategrey: "789", 27933 lightsteelblue: "b0c4de", 27934 lightyellow: "ffffe0",
27935 lime: "0f0", 27936 limegreen: "32cd32", 27937 linen: "faf0e6", 27938 magenta: "f0f", 27939 maroon: "800000", 27940 mediumaquamarine: "66cdaa", 27941 mediumblue: "0000cd", 27942 mediumorchid: "ba55d3", 27943 mediumpurple: "9370db", 27944 mediumseagreen: "3cb371", 27945 mediumslateblue: "7b68ee", 27946 mediumspringgreen: "00fa9a", 27947 mediumturquoise: "48d1cc", 27948 mediumvioletred: "c71585", 27949 midnightblue: "191970", 27950 mintcream: "f5fffa", 27951 mistyrose: "ffe4e1", 27952 moccasin: "ffe4b5", 27953 navajowhite: "ffdead", 27954 navy: "000080", 27955 oldlace: "fdf5e6", 27956 olive: "808000", 27957 olivedrab: "6b8e23", 27958 orange: "ffa500", 27959 orangered: "ff4500", 27960 orchid: "da70d6", 27961 palegoldenrod: "eee8aa", 27962 palegreen: "98fb98", 27963 paleturquoise: "afeeee", 27964 palevioletred: "db7093", 27965 papayawhip: "ffefd5", 27966 peachpuff: "ffdab9", 27967 peru: "cd853f", 27968 pink: "ffc0cb", 27969 plum: "dda0dd", 27970 powderblue: "b0e0e6", 27971 purple: "800080", 27972 rebeccapurple: "663399", 27973 red: "f00", 27974 rosybrown: "bc8f8f", 27975 royalblue: "4169e1", 27976 saddlebrown: "8b4513", 27977 salmon: "fa8072", 27978 sandybrown: "f4a460", 27979 seagreen: "2e8b57", 27980 seashell: "fff5ee", 27981 sienna: "a0522d", 27982 silver: "c0c0c0", 27983 skyblue: "87ceeb", 27984 slateblue: "6a5acd", 27985 slategray: "708090", 27986 slategrey: "708090", 27987 snow: "fffafa", 27988 springgreen: "00ff7f", 27989 steelblue: "4682b4", 27990 tan: "d2b48c", 27991 teal: "008080", 27992 thistle: "d8bfd8", 27993 tomato: "ff6347", 27994 turquoise: "40e0d0", 27995 violet: "ee82ee", 27996 wheat: "f5deb3", 27997 white: "fff", 27998 whitesmoke: "f5f5f5", 27999 yellow: "ff0", 28000 yellowgreen: "9acd32" 28001 }; 28002 flip$3(names); 28003 function flip$3(o2) { 28004 var flipped = {}; 28005 for (var i2 in o2) { 28006 if (o2.hasOwnProperty(i2)) { 28007 flipped[o2[i2]] = i2; 28008 } 28009 } 28010 return flipped; 28011 } 28012 var I$2 = (e2, t2, o2 = `${t2}s`) => e2 === 1 ? t2 : o2, M$6 = (e2, t2, o2) => { 28013 let r2 = "â¢".repeat(o2); 28014 if (e2.length <= t2) return r2; 28015 let n2 = e2.slice(-t2); 28016 return r2 + n2; 28017 }; 28018 var E$6 = (e2, t2) => browser_default.sanitize(e2, void 0), me$2 = (e2) => e2.replaceAll("&", "\\u0026").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029"), fe$2 = (e2, t2) => decode(E$6(e2), { scope: "strict" }); 28019 const BackButton$1 = ({ label, to: to2, state, onClick }) => /* @__PURE__ */ jsxRuntimeExports.jsx( 28020 TextButton, 28021 { 28022 label, 28023 icon: X4, 28024 size: "medium", 28025 variant: "secondary", 28026 to: to2, 28027 state, 28028 onClick, 28029 testid: "BackButton" 28030 } 28031 ); 28032 const Container$t = dt$2.div` 28033 position: relative; 28034 display: flex; 28035 background: var(--bg-transparent); 28036 color: var(--text-primary); 28037 border-radius: var(--panel-radius-normal); 28038 28039 a, 28040 button { 28041 font-size: inherit; 28042 line-height: inherit; 28043 text-decoration: underline; 28044 text-underline-offset: var(--space-100); 28045 } 28046 28047 ul { 28048 list-style: disc; 28049 padding-inline-start: 1.5em; 28050 } 28051 28052 ol { 28053 list-style: decimal; 28054 padding-inline-start: 1.5em; 28055 } 28056 28057 strong { 28058 font-weight: var(--font-weight-500); 28059 } 28060 28061 ${({ $appearance }) => $appearance === "info" && lt$2` 28062 background: var(--bg-transparent); 28063 color: var(--text-primary); 28064 `}; 28065 28066 ${({ $appearance }) => $appearance === "danger" && lt$2` 28067 background: var(--bg-critical-secondary); 28068 color: var(--text-critical-tertiary); 28069 `}; 28070 28071 ${({ $appearance }) => $appearance === "warning" && lt$2` 28072 background: var(--bg-alert-secondary); 28073 color: var(--text-alert-tertiary); 28074 `}; 28075 28076 ${({ $appearance }) => $appearance === "inherit" && lt$2` 28077 background: var(--bg-secondary); 28078 color: var(--text-primary); 28079 `}; 28080 28081 ${({ $appearance }) => $appearance === "danger-strong" && lt$2` 28082 background: var(--bg-critical); 28083 color: var(--text-white); 28084 `}; 28085 28086 ${({ $appearance }) => $appearance === "clean" && lt$2` 28087 background: none; 28088 `}; 28089 28090 ${({ $appearance }) => $appearance === "pro" && lt$2` 28091 background-color: var(--bg-pro); 28092 color: var(--text-pro); 28093 `}; 28094 28095 ${({ $appearance }) => $appearance === "success" && lt$2` 28096 background: var(--bg-success-secondary); 28097 color: var(--text-success-secondary); 28098 `}; 28099 28100 ${({ $size }) => $size === "normal" && lt$2` 28101 padding: var(--space-300) var(--space-500); 28102 font-size: var(--font-size-400); 28103 `}; 28104 28105 ${({ $size }) => $size === "small" && lt$2` 28106 padding: var(--space-250) var(--space-400); 28107 font-size: var(--font-size-300); 28108 `}; 28109 28110 ${({ $size }) => $size === "xsmall" && lt$2` 28111 padding: var(--space-200) var(--space-300); 28112 font-size: var(--font-size-200); 28113 `}; 28114 28115 ${({ $size, $withRightContent }) => $size === "normal" && $withRightContent && lt$2` 28116 padding-right: 52px; 28117 `}; 28118 28119 ${({ $size, $withRightContent }) => ($size === "small" || $size === "xsmall") && $withRightContent && lt$2` 28120 padding-right: var(--space-1200); 28121 `}; 28122 28123 ${({ $withoutPaddings }) => $withoutPaddings && lt$2` 28124 padding: 0; 28125 `}; 28126`; 28127 const Main$1 = dt$2.div` 28128 flex: 1; 28129 display: flex; 28130 28131 ${({ $size }) => $size === "normal" && lt$2` 28132 gap: var(--space-350); 28133 line-height: var(--font-line-height-400); 28134 font-size: var(--font-size-400); 28135 letter-spacing: var(--font-letter-spacing-normal); 28136 `} 28137 28138 ${({ $size }) => $size === "small" && lt$2` 28139 gap: var(--space-300); 28140 line-height: var(--font-line-height-300); 28141 font-size: var(--font-size-300); 28142 letter-spacing: var(--font-letter-spacing-loose); 28143 `} 28144 28145 ${({ $size }) => $size === "xsmall" && lt$2` 28146 gap: var(--space-200); 28147 font-family: var(--font-family-body); 28148 font-size: var(--font-size-200); 28149 font-weight: var(--font-weight-400); 28150 line-height: var(--font-line-height-200); 28151 letter-spacing: var(--font-letter-spacing-looser); 28152 `} 28153 28154 ${({ $justify }) => $justify === "center" && lt$2` 28155 justify-content: center; 28156 `}; 28157 28158 ${({ $justify }) => $justify === "right" && lt$2` 28159 justify-content: flex-end; 28160 `}; 28161`; 28162 const IconContainer$2 = dt$2.div` 28163 display: flex; 28164 align-items: center; 28165 justify-content: center; 28166 28167 ${({ $size }) => $size === "normal" && lt$2` 28168 height: var(--font-line-height-400); 28169 `}; 28170 28171 ${({ $size }) => $size === "small" && lt$2` 28172 height: var(--font-line-height-300); 28173 `}; 28174 28175 ${({ $size }) => $size === "xsmall" && lt$2` 28176 height: var(--font-line-height-200); 28177 `}; 28178`; 28179 const Title$3 = dt$2.div` 28180 font-size: var(--font-size-400); 28181`; 28182 const Subtitle$1 = dt$2.div` 28183 font-size: var(--font-size-300); 28184 letter-spacing: var(--font-letter-spacing-loose); 28185`; 28186 const CloseButtonContainer = dt$2.button` 28187 position: absolute; 28188 cursor: pointer; 28189 right: var(--space-500); 28190 28191 ${({ $size }) => $size === "normal" && lt$2` 28192 top: var(--space-400); 28193 `}; 28194 28195 ${({ $size }) => $size === "small" && lt$2` 28196 top: var(--space-350); 28197 `}; 28198 28199 ${({ $size }) => $size === "xsmall" && lt$2` 28200 top: var(--space-300); 28201 `}; 28202`; 28203 const ICON_SIZE_MAP = { normal: 16, small: 14, xsmall: 12 }; 28204 const Banner = ({ 28205 title, 28206 subtitle, 28207 panel, 28208 appearance, 28209 withoutPaddings = false, 28210 icon: Icon2 = je$3, 28211 size = "normal", 28212 justify = "left", 28213 children, 28214 onClose 28215 }) => { 28216 const [isOpen, setIsOpen] = reactExports.useState(false); 28217 const ArrowIcon = isOpen ? K4 : Z4; 28218 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 28219 Container$t, 28220 { 28221 $appearance: appearance, 28222 $size: size,
28223 $withoutPaddings: withoutPaddings, 28224 role: "alert", 28225 "data-testid": "Banner", 28226 $withRightContent: !!onClose, 28227 children: [ 28228 /* @__PURE__ */ jsxRuntimeExports.jsxs(Main$1, { $justify: justify, $size: size, children: [ 28229 Icon2 !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(IconContainer$2, { $size: size, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { height: ICON_SIZE_MAP[size] }) }), 28230 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ 28231 title && /* @__PURE__ */ jsxRuntimeExports.jsx(Title$3, { children: title }), 28232 subtitle && /* @__PURE__ */ jsxRuntimeExports.jsx(Subtitle$1, { children: subtitle }), 28233 isOpen && panel && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginTop: 8 }, children: panel }), 28234 children 28235 ] }) 28236 ] }), 28237 panel && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => setIsOpen((currentIsOpen) => !currentIsOpen), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowIcon, { height: 16 }) }) }), 28238 onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(CloseButtonContainer, { $size: size, onClick: onClose, children: /* @__PURE__ */ jsxRuntimeExports.jsx($4, { height: 16 }) }) 28239 ] 28240 } 28241 ); 28242 }; 28243 const getSize = (size) => ({ micro: 12, small: 15, medium: 18, large: 32 })[size]; 28244 const getColor = ({ $appearance }) => { 28245 if ($appearance === "primary") { 28246 return "var(--text-primary-invert)"; 28247 } 28248 if ($appearance === "secondary") { 28249 return "var(--text-primary)"; 28250 } 28251 if ($appearance === "inherit") { 28252 return "currentColor"; 28253 } 28254 }; 28255 const wrapperAnimation = mt$2` 28256 0% { 28257 transform: rotateZ(0deg); 28258 } 28259 100% { 28260 transform: rotateZ(360deg) 28261 } 28262`; 28263 const circleAnimation = mt$2` 28264 0%, 28265 25% { 28266 stroke-dashoffset: 270; 28267 transform: rotate(0); 28268 } 28269 28270 50%, 28271 75% { 28272 stroke-dashoffset: 75; 28273 transform: rotate(45deg); 28274 } 28275 28276 100% { 28277 stroke-dashoffset: 270; 28278 transform: rotate(360deg); 28279 } 28280`; 28281 const Wrapper = dt$2.svg` 28282 width: ${({ $size }) => getSize($size)}px; 28283 animation: 2s linear infinite ${wrapperAnimation}; 28284 animation-delay: -1.5s; 28285`; 28286 const Circle = dt$2.circle` 28287 animation: 1.4s ease-in-out infinite both ${circleAnimation}; 28288 animation-delay: -1.05s; 28289 display: block; 28290 fill: transparent; 28291 stroke: ${getColor}; 28292 stroke-dasharray: 283; 28293 stroke-dashoffset: 75; 28294 stroke-width: 10px; 28295 transform-origin: 50% 50%; 28296`; 28297 const Loader = ({ appearance = "secondary", size = "medium" }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Wrapper, { viewBox: "0 0 100 100", $size: size, "aria-label": "loader", "data-testid": "Loader", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Circle, { cx: "50", cy: "50", r: "45", $appearance: appearance }) }); 28298 const bodyMd = lt$2` 28299 font-size: var(--font-size-400); 28300 line-height: var(--font-line-height-400); 28301 letter-spacing: var(--font-letter-spacing-normal); 28302`; 28303 const bodySm = lt$2` 28304 font-size: var(--font-size-300); 28305 line-height: var(--font-line-height-300); 28306 letter-spacing: var(--font-letter-spacing-loose); 28307`; 28308 const bodyXs = lt$2` 28309 font-size: var(--font-size-200); 28310 line-height: var(--font-line-height-200); 28311 letter-spacing: var(--font-letter-spacing-looser); 28312`; 28313 const sizeStylesMap = { 28314 large: lt$2` 28315 height: var(--space-1200); 28316 padding: 0 var(--space-400); 28317 gap: var(--space-300); 28318 ${bodyMd} 28319 `, 28320 medium: lt$2` 28321 height: var(--space-1000); 28322 padding: 0 var(--space-350); 28323 gap: var(--space-250); 28324 ${bodyMd} 28325 `, 28326 small: lt$2` 28327 height: var(--space-800); 28328 padding: 0 var(--space-250); 28329 gap: var(--space-250); 28330 ${bodySm} 28331 `, 28332 micro: lt$2` 28333 height: var(--space-600); 28334 padding: 0 var(--space-200); 28335 gap: var(--space-150); 28336 ${bodyXs} 28337 ` 28338 }; 28339 const proGradient = (start, end) => lt$2` 28340 background: radial-gradient(135.71% 135.71% at 28.85% 0%, ${start} 0%, ${end} 100%); 28341`; 28342 const appearanceStylesMap = { 28343 primary: lt$2` 28344 color: var(--text-primary-invert); 28345 background: var(--bg-brand); 28346 &:hover:not(:disabled) { 28347 background: var(--bg-brand-hover); 28348 } 28349 &:active:not(:disabled) { 28350 background: var(--bg-brand-active); 28351 } 28352 `, 28353 secondary: lt$2` 28354 color: var(--text-primary); 28355 background: var(--bg-secondary); 28356 &:hover:not(:disabled) { 28357 background: var(--bg-secondary-hover); 28358 } 28359 &:active:not(:disabled) { 28360 background: var(--bg-secondary-active); 28361 } 28362 `, 28363 "semi-transparent": lt$2` 28364 color: var(--text-primary); 28365 background: var(--bg-transparent); 28366 &:hover:not(:disabled) { 28367 background: var(--bg-transparent-strong); 28368 } 28369 &:active:not(:disabled) { 28370 background: var(--bg-transparent-strongest); 28371 } 28372 `, 28373 transparent: lt$2` 28374 color: var(--text-primary); 28375 background: transparent; 28376 &:hover:not(:disabled) { 28377 background: var(--bg-transparent); 28378 } 28379 &:active:not(:disabled) { 28380 background: var(--bg-transparent-strong); 28381 } 28382 `, 28383 destructive: lt$2` 28384 color: var(--text-white); 28385 background: var(--bg-critical); 28386 &:hover:not(:disabled) { 28387 background: var(--bg-critical-hover); 28388 } 28389 &:active:not(:disabled) { 28390 background: var(--bg-critical-active); 28391 } 28392 `, 28393 "destructive-secondary": lt$2` 28394 color: var(--text-critical-tertiary); 28395 background: var(--bg-critical-secondary); 28396 &:hover:not(:disabled) { 28397 background: var(--bg-critical-secondary-hover); 28398 } 28399 &:active:not(:disabled) { 28400 background: var(--bg-critical-secondary-active); 28401 } 28402 `, 28403 alert: lt$2` 28404 color: var(--text-alert-tertiary); 28405 background: var(--bg-alert-secondary); 28406 &:hover:not(:disabled) { 28407 background: var(--bg-alert-secondary-hover); 28408 } 28409 &:active:not(:disabled) { 28410 background: var(--bg-alert-secondary-active); 28411 } 28412 `, 28413 pro: lt$2` 28414 color: var(--text-white); 28415 ${proGradient("var(--bg-pro-gradient-start)", "var(--bg-pro-gradient-end)")} 28416 &:hover:not(:disabled), 28417 &:active:not(:disabled) { 28418 ${proGradient("var(--bg-pro-gradient-start-hover)", "var(--bg-pro-gradient-end-h
28418over)")} 28419 } 28420 ` 28421 }; 28422 const Container$s = dt$2.button` 28423 position: relative; 28424 display: flex; 28425 align-items: center; 28426 justify-content: center; 28427 width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"}; 28428 border: none; 28429 border-radius: var(--button-radius-normal); 28430 font-family: var(--font-family-body); 28431 font-weight: var(--font-weight-500); 28432 text-transform: var(--text-transform-body); 28433 text-decoration: none; 28434 white-space: nowrap; 28435 cursor: pointer; 28436 appearance: none !important; // NOTE: Required for Safari. 28437 ${({ $size }) => sizeStylesMap[$size]} 28438 ${({ $appearance }) => appearanceStylesMap[$appearance]} 28439 &:disabled { 28440 cursor: not-allowed; 28441 opacity: 0.4; 28442 } 28443 &:focus-visible { 28444 outline: var(--space-50) solid var(--text-primary); 28445 outline-offset: var(--space-50); 28446 } 28447`; 28448 const Content$4 = dt$2.span` 28449 display: inline-flex; 28450 align-items: center; 28451 gap: inherit; 28452 visibility: ${({ $hidden }) => $hidden ? "hidden" : "visible"}; 28453`; 28454 const labelOffsetMap = { 28455 large: "0", 28456 medium: "0", 28457 small: "1px", 28458 micro: "1px" 28459 }; 28460 const Label$4 = dt$2.span` 28461 padding-top: ${({ $size }) => labelOffsetMap[$size]}; 28462`; 28463 const Icon = dt$2.span` 28464 display: inline-flex; 28465 align-items: center; 28466 justify-content: center; 28467 flex-shrink: 0; 28468`; 28469 const LoaderContainer$2 = dt$2.span` 28470 position: absolute; 28471 inset: 0; 28472 display: flex; 28473 align-items: center; 28474 justify-content: center; 28475`; 28476 const iconSizeMap$1 = { 28477 large: 16, 28478 medium: 16, 28479 small: 14, 28480 micro: 12 28481 }; 28482 const loaderSizeMap$1 = { 28483 large: "medium", 28484 medium: "medium", 28485 small: "small", 28486 micro: "micro" 28487 }; 28488 const renderIcon = (icon, size) => { 28489 if (reactExports.isValidElement(icon)) { 28490 return /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { "aria-hidden": "true", children: icon }); 28491 } 28492 const Icon$1 = icon; 28493 return /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { width: size, height: size }) }); 28494 }; 28495 const getComponent$2 = ({ 28496 to: to2, 28497 href, 28498 inactive 28499 }) => { 28500 if (!inactive && to2) return Link; 28501 if (!inactive && href) return "a"; 28502 return "button"; 28503 }; 28504 const Button$1 = ({ 28505 id: id2, 28506 label, 28507 appearance = "secondary", 28508 size = "large", 28509 leftIcon, 28510 rightIcon, 28511 to: to2, 28512 href, 28513 target, 28514 download, 28515 disabled = false, 28516 loading = false, 28517 fullWidth = false, 28518 type = "button", 28519 className, 28520 analytics, 28521 "aria-label": ariaLabel, 28522 onClick 28523 }) => { 28524 const inactive = disabled || loading; 28525 const component = getComponent$2({ to: to2, href, inactive }); 28526 const isButton = component === "button"; 28527 const iconSize = iconSizeMap$1[size]; 28528 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 28529 Container$s, 28530 { 28531 as: component, 28532 id: id2, 28533 className, 28534 role: isButton ? void 0 : "button", 28535 $appearance: appearance, 28536 $size: size, 28537 $fullWidth: fullWidth, 28538 to: isButton ? void 0 : to2, 28539 href: isButton ? void 0 : href, 28540 target: isButton ? void 0 : target, 28541 download: isButton ? void 0 : download, 28542 type: isButton ? type : void 0, 28543 disabled: isButton ? inactive : void 0, 28544 "aria-busy": loading || void 0, 28545 "aria-label": ariaLabel, 28546 onClick, 28547 "data-analytics": analytics, 28548 "data-testid": "button", 28549 children: [
28550 /* @__PURE__ */ jsxRuntimeExports.jsxs(Content$4, { $hidden: loading, children: [ 28551 leftIcon && renderIcon(leftIcon, iconSize), 28552 label && /* @__PURE__ */ jsxRuntimeExports.jsx(Label$4, { $size: size, children: label }), 28553 rightIcon && renderIcon(rightIcon, iconSize) 28554 ] }), 28555 loading && /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderContainer$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { appearance: "inherit", size: loaderSizeMap$1[size] }) }) 28556 ] 28557 } 28558 ); 28559 }; 28560 const Button = dt$2.button` 28561 display: inline-flex; 28562 align-items: center; 28563 28564 font-weight: inherit; 28565 font-size: inherit; 28566 font-family: inherit; 28567 text-align: left; 28568 28569 cursor: pointer; 28570 28571 appearance: none !important; // NOTE: Required for Safari. 28572 28573 ${({ $appearance }) => $appearance === "inherit" && lt$2` 28574 color: inherit; 28575 `} 28576 28577 ${({ $appearance }) => $appearance === "primary" && lt$2` 28578 color: var(--text-primary); 28579 `} 28580 28581 ${({ $appearance }) => $appearance === "secondary" && lt$2` 28582 color: var(--text-secondary); 28583 `} 28584 28585 ${({ $appearance }) => $appearance === "destructive" && lt$2` 28586 color: var(--text-critical); 28587 `} 28588 28589 ${({ $appearance }) => $appearance === "success" && lt$2` 28590 color: var(--text-success); 28591 `} 28592 28593 ${({ $appearance }) => $appearance === "warning" && lt$2` 28594 color: var(--text-alert); 28595 `} 28596 28597 &:hover, 28598 &:active, 28599 &:focus { 28600 ${({ $appearance }) => $appearance === "primary" && lt$2` 28601 color: var(--text-link); 28602 `} 28603 28604 ${({ $appearance }) => $appearance === "secondary" && lt$2` 28605 color: var(--text-primary); 28606 `} 28607 28608 ${({ $appearance }) => $appearance === "destructive" && lt$2` 28609 color: var(--text-critical); 28610 `} 28611 28612 ${({ $appearance }) => $appearance === "success" && lt$2` 28613 color: var(--text-success); 28614 `} 28615 28616 ${({ $appearance }) => $appearance === "warning" && lt$2` 28617 color: var(--text-alert); 28618 `} 28619 28620 ${({ disabled }) => disabled && lt$2` 28621 color: inherit; 28622 `} 28623 } 28624 28625 ${({ $withUnderline }) => $withUnderline && lt$2` 28626 text-decoration-line: underline; 28627 text-underline-offset: var(--space-100); 28628 `} 28629 28630 ${({ disabled }) => disabled && lt$2` 28631 cursor: not-allowed; 28632 `} 28633 28634 & > svg { 28635 margin-right: var(--space-200); 28636 } 28637`; 28638 const getComponent$1 = ({ to: to2, href }) => { 28639 if (to2) return Link; 28640 if (href) return "a"; 28641 return "button"; 28642 }; 28643 const ButtonClean = ({ 28644 appearance = "primary", 28645 ariaLabel, 28646 analyticsKey, 28647 to: to2, 28648 state, 28649 href, 28650 target, 28651 label, 28652 title, 28653 icon: Icon2, 28654 withUnderline = true, 28655 disabled = false, 28656 type = "button", 28657 onClick 28658 }) => /* @__PURE__ */ jsxRuntimeExports.jsxs( 28659 Button, 28660 { 28661 $appearance: appearance, 28662 as: getComponent$1({ to: to2, href }), 28663 to: to2, 28664 state, 28665 href, 28666 target, 28667 title, 28668 $withUnderline: withUnderline, 28669 disabled, 28670 onClick, 28671 type, 28672 "aria-label": ariaLabel, 28673 "data-testid": "ButtonClean", 28674 "data-analytics": analyticsKey, 28675 children: [ 28676 Icon2 && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { height: 12, "aria-hidden": true }), 28677 label 28678 ] 28679 } 28680 ); 28681 const Group = dt$2.div` 28682 display: flex; 28683 flex-direction: ${({ $direction }) => $direction}; 28684 28685 ${({ $space }) => $space === "small" && lt$2` 28686 gap: var(--space-50); 28687 `} 28688 28689 ${({ $space }) => $space === "medium" && lt$2` 28690 gap: var(--space-200); 28691 `} 28692 28693 ${({ $space }) => $space === "large" && lt$2` 28694 gap: var(--space-400); 28695 `} 28696 28697 ${({ $space }) => $space === "xlarge" && lt$2` 28698 gap: var(--space-500); 28699 `} 28700 28701 ${({ $fullWidth }) => $fullWidth && lt$2` 28702 width: 100%; 28703 `} 28704 28705 ${({ $justify }) => $justify === "right" && lt$2` 28706 justify-content: flex-end; 28707 `} 28708 28709 ${({ $align }) => $align === "center" && lt$2` 28710 align-items: center; 28711 `} 28712`; 28713 const ButtonGroup = ({ 28714 space = "small", 28715 justify = "left", 28716 align, 28717 direction = "row", 28718 fullWidth = false, 28719 children 28720 }) => { 28721 return /* @__PURE__ */ jsxRuntimeExports.jsx( 28722 Group, 28723 { 28724 $justify: justify, 28725 $align: align, 28726 $direction: direction, 28727 $fullWidth: fullWidth, 28728 $space: space, 28729 children 28730 } 28731 ); 28732 }; 28733 const containerSizeMap = { 28734 large: 48, 28735 medium: 40, 28736 small: 32, 28737 micro: 24 28738 }; 28739 const Container$r = dt$2.button` 28740 display: inline-flex; 28741 align-items: center; 28742 justify-content: center; 28743 color: var(--icon-primary); 28744 background: var(--bg-secondary); 28745 border-radius: var(--button-radius-normal); 28746 cursor: pointer; 28747 flex-shrink: 0; 28748 text-decoration: none; 28749 border: none; 28750 28751 &:hover:not(:disabled) { 28752 background: var(--bg-secondary-hover); 28753 } 28754 28755 &:active:not(:disabled) { 28756 background: var(--bg-secondary-active); 28757 } 28758 28759 &:disabled { 28760 opacity: 0.4; 28761 color: var(--icon-secondary);
28762 cursor: not-allowed; 28763 } 28764 28765 height: ${({ $size }) => containerSizeMap[$size]}px; 28766 width: ${({ $size }) => containerSizeMap[$size]}px; 28767 28768 ${({ $variant }) => $variant === "primary" && lt$2` 28769 color: var(--text-primary-invert); 28770 background: var(--bg-brand); 28771 28772 &:hover:not(:disabled) { 28773 background: var(--bg-brand-hover); 28774 } 28775 28776 &:active:not(:disabled) { 28777 background: var(--bg-brand-hover); 28778 } 28779 28780 &:disabled { 28781 color: var(--text-primary-invert); 28782 } 28783 `} 28784 28785 ${({ $variant }) => $variant === "transparent" && lt$2` 28786 background: transparent; 28787 28788 &:hover:not(:disabled) { 28789 background: var(--bg-transparent); 28790 } 28791 28792 &:active:not(:disabled) { 28793 background: var(--bg-transparent-strong); 28794 } 28795 `} 28796 28797 ${({ $variant }) => $variant === "semi-transparent" && lt$2` 28798 background: var(--bg-transparent); 28799 28800 &:hover:not(:disabled) { 28801 background: var(--bg-transparent-strong); 28802 } 28803 28804 &:active:not(:disabled) { 28805 background: var(--bg-transparent-strongest); 28806 } 28807 `} 28808 28809 ${({ $variant }) => $variant === "outline" && lt$2` 28810 background: var(--bg-primary); 28811 border: 1px solid var(--border-transparent-strongest); 28812 28813 &:hover:not(:disabled) { 28814 background: var(--bg-primary-hover); 28815 } 28816 28817 &:active:not(:disabled) { 28818 background: var(--bg-transparent-strongest); 28819 } 28820 `} 28821 28822 ${({ $variant }) => $variant === "subtle" && lt$2` 28823 color: var(--icon-secondary); 28824 background: transparent; 28825 28826 &:hover:not(:disabled) { 28827 color: var(--icon-primary); 28828 background: var(--bg-transparent); 28829 } 28830 28831 &:active:not(:disabled) { 28832 color: var(--icon-primary); 28833 background: var(--bg-transparent-strong); 28834 } 28835 `} 28836 28837 ${({ $isActive, $variant }) => { 28838 if (!$isActive) return null; 28839 const activeBackgroundMap = { 28840 standard: "var(--bg-secondary-active)", 28841 primary: "var(--bg-brand-hover)", 28842 transparent: "var(--bg-transparent-strong)", 28843 "semi-transparent": "var(--bg-transparent-strongest)", 28844 outline: "var(--bg-transparent-strongest)", 28845 subtle: "var(--bg-transparent-strong)" 28846 }; 28847 return lt$2` 28848 background: ${activeBackgroundMap[$variant]}; 28849 `; 28850 }} 28851`; 28852 const iconSizeMap = { 28853 large: 20, 28854 medium: 18, 28855 small: 16, 28856 micro: 12 28857 }; 28858 const loaderSizeMap = { 28859 large: "medium", 28860 medium: "medium", 28861 small: "small", 28862 micro: "micro" 28863 }; 28864 const getComponent = ({ to: to2, href }) => { 28865 if (to2) return Link; 28866 if (href) return "a"; 28867 return "button"; 28868 }; 28869 const IconButton = reactExports.forwardRef( 28870 (_f, ref) => { 28871 var _g = _f, { 28872 icon: Icon2, 28873 size = "medium", 28874 variant = "standard", 28875 isActive = false, 28876 loading = false, 28877 type = "button", 28878 to: to2, 28879 href, 28880 target, 28881 disabled, 28882 onClick 28883 } = _g, rest = __objRest(_g, [ 28884 "icon", 28885 "size", 28886 "variant", 28887 "isActive", 28888 "loading", 28889 "type", 28890 "to", 28891 "href", 28892 "target", 28893 "disabled", 28894 "onClick" 28895 ]); 28896 const component = getComponent({ to: to2, href }); 28897 const isButton = component === "button"; 28898 const handleClick = (event) => { 28899 if (isButton) { 28900 event.preventDefault(); 28901 } 28902 if (!onClick) return; 28903 onClick(event); 28904 }; 28905 return /* @__PURE__ */ jsxRuntimeExports.jsx( 28906 Container$r, 28907 __spreadProps(__spreadValues({ 28908 ref, 28909 as: component, 28910 $size: size, 28911 $variant: variant, 28912 $isActive: isActive, 28913 type: isButton ? type : void 0, 28914 to: to2, 28915 href, 28916 target, 28917 disabled: disabled || loading, 28918 onClick: handleClick, 28919 "data-icon-button": true 28920 }, rest), {
28921 children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx( 28922 Loader, 28923 { 28924 appearance: variant === "primary" ? "primary" : "secondary", 28925 size: loaderSizeMap[size] 28926 } 28927 ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { height: iconSizeMap[size], width: iconSizeMap[size] }) 28928 }) 28929 ); 28930 } 28931 ); 28932 IconButton.displayName = "IconButton"; 28933 function isNil(value) { 28934 return value == null; 28935 } 28936 function isUndefined(value) { 28937 return value === void 0; 28938 } 28939 var p$4 = ["po box", "post office box", "p.o. box", "p.o box", "postal box", "p.o.b", "p.o.box"], d$3 = (t2) => !!p$4.find((e2) => t2.toLowerCase().includes(e2)), s$3 = new RegExp("\\p{Script=Latin}\\p{White_Space}\\p{Punctuation}\\p{Number}\\n\\+", "gu"), m$3 = (t2) => new RegExp(`^[${s$3}]*$`, "gu").test(t2), V$2 = (t2) => /<\/?\s*[a-zA-Z][^>]*>/g.test(t2); 28940 var isMergeableObject = function isMergeableObject2(value) { 28941 return isNonNullObject(value) && !isSpecial(value); 28942 }; 28943 function isNonNullObject(value) { 28944 return !!value && typeof value === "object"; 28945 } 28946 function isSpecial(value) { 28947 var stringValue = Object.prototype.toString.call(value); 28948 return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); 28949 } 28950 var canUseSymbol = typeof Symbol === "function" && Symbol.for; 28951 var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103; 28952 function isReactElement(value) { 28953 return value.$$typeof === REACT_ELEMENT_TYPE; 28954 } 28955 function emptyTarget(val) { 28956 return Array.isArray(val) ? [] : {}; 28957 } 28958 function cloneUnlessOtherwiseSpecified(value, options2) { 28959 return options2.clone !== false && options2.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options2) : value; 28960 } 28961 function defaultArrayMerge(target, source, options2) { 28962 return target.concat(source).map(function(element) { 28963 return cloneUnlessOtherwiseSpecified(element, options2); 28964 }); 28965 } 28966 function mergeObject(target, source, options2) { 28967 var destination = {}; 28968 if (options2.isMergeableObject(target)) { 28969 Object.keys(target).forEach(function(key) { 28970 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options2); 28971 }); 28972 } 28973 Object.keys(source).forEach(function(key) { 28974 if (!options2.isMergeableObject(source[key]) || !target[key]) { 28975 destination[key] = cloneUnlessOtherwiseSpecified(source[key], options2); 28976 } else { 28977 destination[key] = deepmerge(target[key], source[key], options2); 28978 } 28979 }); 28980 return destination; 28981 } 28982 function deepmerge(target, source, options2) { 28983 options2 = options2 || {}; 28984 options2.arrayMerge = options2.arrayMerge || defaultArrayMerge; 28985 options2.isMergeableObject = options2.isMergeableObject || isMergeableObject; 28986 var sourceIsArray = Array.isArray(source); 28987 var targetIsArray = Array.isArray(target); 28988 var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; 28989 if (!sourceAndTargetTypesMatch) { 28990 return cloneUnlessOtherwiseSpecified(source, options2); 28991 } else if (sourceIsArray) { 28992 return options2.arrayMerge(target, source, options2); 28993 } else { 28994 return mergeObject(target, source, options2); 28995 } 28996 } 28997 deepmerge.all = function deepmergeAll(array2, options2) { 28998 if (!Array.isArray(array2)) { 28999 throw new Error("first argument should be an array"); 29000 } 29001 return array2.reduce(function(prev2, next2) { 29002 return deepmerge(prev2, next2, options2); 29003 }, {}); 29004 }; 29005 var deepmerge_1 = deepmerge; 29006 var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; 29007 function cloneDeep(value) { 29008 return baseClone$1(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 29009 } 29010 var reactFastCompare$1; 29011 var hasRequiredReactFastCompare$1; 29012 function requireReactFastCompare$1() { 29013 if (hasRequiredReactFastCompare$1) return reactFastCompare$1; 29014 hasRequiredReactFastCompare$1 = 1; 29015 var isArray2 = Array.isArray; 29016 var keyList = Object.keys; 29017 var hasProp2 = Object.prototype.hasOwnProperty; 29018 var hasElementType = typeof Element !== "undefined"; 29019 function equal(a2, b2) { 29020 if (a2 === b2) return true; 29021 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { 29022 var arrA = isArray2(a2), arrB = isArray2(b2), i2, length2, key; 29023 if (arrA && arrB) { 29024 length2 = a2.length; 29025 if (length2 != b2.length) return false;
29026 for (i2 = length2; i2-- !== 0; ) 29027 if (!equal(a2[i2], b2[i2])) return false; 29028 return true; 29029 } 29030 if (arrA != arrB) return false; 29031 var dateA = a2 instanceof Date, dateB = b2 instanceof Date; 29032 if (dateA != dateB) return false; 29033 if (dateA && dateB) return a2.getTime() == b2.getTime(); 29034 var regexpA = a2 instanceof RegExp, regexpB = b2 instanceof RegExp; 29035 if (regexpA != regexpB) return false; 29036 if (regexpA && regexpB) return a2.toString() == b2.toString(); 29037 var keys2 = keyList(a2); 29038 length2 = keys2.length; 29039 if (length2 !== keyList(b2).length) 29040 return false; 29041 for (i2 = length2; i2-- !== 0; ) 29042 if (!hasProp2.call(b2, keys2[i2])) return false; 29043 if (hasElementType && a2 instanceof Element && b2 instanceof Element) 29044 return a2 === b2; 29045 for (i2 = length2; i2-- !== 0; ) { 29046 key = keys2[i2]; 29047 if (key === "_owner" && a2.$$typeof) { 29048 continue; 29049 } else { 29050 if (!equal(a2[key], b2[key])) return false; 29051 } 29052 } 29053 return true; 29054 } 29055 return a2 !== a2 && b2 !== b2; 29056 } 29057 reactFastCompare$1 = function exportedEqual(a2, b2) { 29058 try { 29059 return equal(a2, b2); 29060 } catch (error) { 29061 if (error.message && error.message.match(/stack|recursion/i) || error.number === -2146828260) { 29062 console.warn("Warning: react-fast-compare does not handle circular references.", error.name, error.message); 29063 return false; 29064 } 29065 throw error; 29066 } 29067 }; 29068 return reactFastCompare$1; 29069 } 29070 var reactFastCompareExports$1 = requireReactFastCompare$1(); 29071 const isEqual$1 = /* @__PURE__ */ getDefaultExportFromCjs(reactFastCompareExports$1); 29072 function toPath(value) { 29073 if (isArray(value)) { 29074 return arrayMap(value, toKey); 29075 } 29076 return isSymbol(value) ? [value] : copyArray(stringToPath(toString$1(value))); 29077 } 29078 function _extends$6() { 29079 _extends$6 = Object.assign || function(target) { 29080 for (var i2 = 1; i2 < arguments.length; i2++) { 29081 var source = arguments[i2]; 29082 for (var key in source) { 29083 if (Object.prototype.hasOwnProperty.call(source, key)) { 29084 target[key] = source[key]; 29085 } 29086 } 29087 } 29088 return target; 29089 }; 29090 return _extends$6.apply(this, arguments); 29091 } 29092 function _objectWithoutPropertiesLoose$2(source, excluded) { 29093 if (source == null) return {}; 29094 var target = {}; 29095 var sourceKeys = Object.keys(source); 29096 var key, i2; 29097 for (i2 = 0; i2 < sourceKeys.length; i2++) { 29098 key = sourceKeys[i2]; 29099 if (excluded.indexOf(key) >= 0) continue; 29100 target[key] = source[key]; 29101 } 29102 return target; 29103 } 29104 var FormikContext = /* @__PURE__ */ reactExports.createContext(void 0); 29105 FormikContext.displayName = "FormikContext"; 29106 var FormikProvider = FormikContext.Provider; 29107 FormikContext.Consumer; 29108 function useFormikContext() { 29109 var formik = reactExports.useContext(FormikContext); 29110 return formik; 29111 } 29112 var isFunction = function isFunction2(obj) { 29113 return typeof obj === "function"; 29114 }; 29115 var isObject$2 = function isObject2(obj) { 29116 return obj !== null && typeof obj === "object"; 29117 }; 29118 var isInteger = function isInteger2(obj) { 29119 return String(Math.floor(Number(obj))) === obj; 29120 }; 29121 var isString = function isString2(obj) { 29122 return Object.prototype.toString.call(obj) === "[object String]"; 29123 }; 29124 var isEmptyChildren = function isEmptyChildren2(children) { 29125 return reactExports.Children.count(children) === 0; 29126 }; 29127 var isPromise = function isPromise2(value) { 29128 return isObject$2(value) && isFunction(value.then); 29129 }; 29130 function getIn$1(obj, key, def, p2) { 29131 if (p2 === void 0) { 29132 p2 = 0; 29133 } 29134 var path = toPath(key); 29135 while (obj && p2 < path.length) { 29136 obj = obj[path[p2++]]; 29137 } 29138 if (p2 !== path.length && !obj) { 29139 return def; 29140 } 29141 return obj === void 0 ? def : obj; 29142 } 29143 function setIn(obj, path, value) { 29144 var res = clone$2(obj); 29145 var resVal = res; 29146 var i2 = 0; 29147 var pathArray = toPath(path); 29148 for (; i2 < pathArray.length - 1; i2++) { 29149 var currentPath = pathArray[i2]; 29150 var currentObj = getIn$1(obj, pathArray.slice(0, i2 + 1)); 29151 if (currentObj && (isObject$2(currentObj) || Array.isArray(currentObj))) { 29152 resVal = resVal[currentPath] = clone$2(currentObj); 29153 } else {
vendor: 4,778 bytes, lines 29154-29275
29154 var nextPath = pathArray[i2 + 1]; 29155 resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {}; 29156 } 29157 } 29158 if ((i2 === 0 ? obj : resVal)[pathArray[i2]] === value) { 29159 return obj; 29160 } 29161 if (value === void 0) { 29162 delete resVal[pathArray[i2]]; 29163 } else { 29164 resVal[pathArray[i2]] = value; 29165 } 29166 if (i2 === 0 && value === void 0) { 29167 delete res[pathArray[i2]]; 29168 } 29169 return res; 29170 } 29171 function setNestedObjectValues(object2, value, visited, response) { 29172 if (visited === void 0) { 29173 visited = /* @__PURE__ */ new WeakMap(); 29174 } 29175 if (response === void 0) { 29176 response = {}; 29177 } 29178 for (var _i2 = 0, _Object$keys = Object.keys(object2); _i2 < _Object$keys.length; _i2++) { 29179 var k2 = _Object$keys[_i2]; 29180 var val = object2[k2]; 29181 if (isObject$2(val)) { 29182 if (!visited.get(val)) { 29183 visited.set(val, true); 29184 response[k2] = Array.isArray(val) ? [] : {}; 29185 setNestedObjectValues(val, value, visited, response[k2]); 29186 } 29187 } else { 29188 response[k2] = value; 29189 } 29190 } 29191 return response; 29192 } 29193 function formikReducer(state, msg) { 29194 switch (msg.type) { 29195 case "SET_VALUES": 29196 return _extends$6({}, state, { 29197 values: msg.payload 29198 }); 29199 case "SET_TOUCHED": 29200 return _extends$6({}, state, { 29201 touched: msg.payload 29202 }); 29203 case "SET_ERRORS": 29204 if (isEqual$1(state.errors, msg.payload)) { 29205 return state; 29206 } 29207 return _extends$6({}, state, { 29208 errors: msg.payload 29209 }); 29210 case "SET_STATUS": 29211 return _extends$6({}, state, { 29212 status: msg.payload 29213 }); 29214 case "SET_ISSUBMITTING": 29215 return _extends$6({}, state, { 29216 isSubmitting: msg.payload 29217 }); 29218 case "SET_ISVALIDATING": 29219 return _extends$6({}, state, { 29220 isValidating: msg.payload 29221 }); 29222 case "SET_FIELD_VALUE": 29223 return _extends$6({}, state, { 29224 values: setIn(state.values, msg.payload.field, msg.payload.value) 29225 }); 29226 case "SET_FIELD_TOUCHED": 29227 return _extends$6({}, state, { 29228 touched: setIn(state.touched, msg.payload.field, msg.payload.value) 29229 }); 29230 case "SET_FIELD_ERROR": 29231 return _extends$6({}, state, { 29232 errors: setIn(state.errors, msg.payload.field, msg.payload.value) 29233 }); 29234 case "RESET_FORM": 29235 return _extends$6({}, state, msg.payload); 29236 case "SET_FORMIK_STATE": 29237 return msg.payload(state); 29238 case "SUBMIT_ATTEMPT": 29239 return _extends$6({}, state, { 29240 touched: setNestedObjectValues(state.values, true), 29241 isSubmitting: true, 29242 submitCount: state.submitCount + 1 29243 }); 29244 case "SUBMIT_FAILURE": 29245 return _extends$6({}, state, { 29246 isSubmitting: false 29247 }); 29248 case "SUBMIT_SUCCESS": 29249 return _extends$6({}, state, { 29250 isSubmitting: false 29251 }); 29252 default: 29253 return state; 29254 } 29255 } 29256 var emptyErrors = {}; 29257 var emptyTouched = {}; 29258 function useFormik(_ref2) { 29259 var _ref$validateOnChange = _ref2.validateOnChange, validateOnChange = _ref$validateOnChange === void 0 ? true : _ref$validateOnChange, _ref$validateOnBlur = _ref2.validateOnBlur, validateOnBlur = _ref$validateOnBlur === void 0 ? true : _ref$validateOnBlur, _ref$validateOnMount = _ref2.validateOnMount, validateOnMount = _ref$validateOnMount === void 0 ? false : _ref$validateOnMount, isInitialValid = _ref2.isInitialValid, _ref$enableReinitiali = _ref2.enableReinitialize, enableReinitialize = _ref$enableReinitiali === void 0 ? false : _ref$enableReinitiali, onSubmit = _ref2.onSubmit, rest = _objectWithoutPropertiesLoose$2(_ref2, ["validateOnChange", "validateOnBlur", "validateOnMount", "isInitialValid", "enableReinitialize", "onSubmit"]); 29260 var props = _extends$6({ 29261 validateOnChange, 29262 validateOnBlur, 29263 validateOnMount, 29264 onSubmit 29265 }, rest); 29266 var initialValues = reactExports.useRef(props.initialValues); 29267 var initialErrors = reactExports.useRef(props.initialErrors || emptyErrors); 29268 var initialTouched = reactExports.useRef(props.initialTouched || emptyTouched); 29269 var initialStatus = reactExports.useRef(props.initialStatus); 29270 var isMounted = reactExports.useRef(false); 29271 var fieldRegistry = reactExports.useRef({}); 29272 reactExports.useEffect(function() { 29273 isMounted.current = true; 29274 return function() { 29275 isMounted.current = false;
29276 }; 29277 }, []); 29278 var _React$useState = reactExports.useState(0), setIteration = _React$useState[1]; 29279 var stateRef = reactExports.useRef({ 29280 values: cloneDeep(props.initialValues), 29281 errors: cloneDeep(props.initialErrors) || emptyErrors, 29282 touched: cloneDeep(props.initialTouched) || emptyTouched, 29283 status: cloneDeep(props.initialStatus), 29284 isSubmitting: false, 29285 isValidating: false, 29286 submitCount: 0 29287 }); 29288 var state = stateRef.current; 29289 var dispatch = reactExports.useCallback(function(action) { 29290 var prev2 = stateRef.current; 29291 stateRef.current = formikReducer(prev2, action); 29292 if (prev2 !== stateRef.current) setIteration(function(x2) { 29293 return x2 + 1; 29294 }); 29295 }, []); 29296 var runValidateHandler = reactExports.useCallback(function(values, field) { 29297 return new Promise(function(resolve, reject) { 29298 var maybePromisedErrors = props.validate(values, field); 29299 if (maybePromisedErrors == null) { 29300 resolve(emptyErrors); 29301 } else if (isPromise(maybePromisedErrors)) { 29302 maybePromisedErrors.then(function(errors) { 29303 resolve(errors || emptyErrors); 29304 }, function(actualException) { 29305 reject(actualException); 29306 }); 29307 } else { 29308 resolve(maybePromisedErrors); 29309 } 29310 }); 29311 }, [props.validate]); 29312 var runValidationSchema = reactExports.useCallback(function(values, field) { 29313 var validationSchema = props.validationSchema; 29314 var schema = isFunction(validationSchema) ? validationSchema(field) : validationSchema; 29315 var promise = field && schema.validateAt ? schema.validateAt(field, values) : validateYupSchema(values, schema); 29316 return new Promise(function(resolve, reject) { 29317 promise.then(function() { 29318 resolve(emptyErrors); 29319 }, function(err) { 29320 if (err.name === "ValidationError") { 29321 resolve(yupToFormErrors(err)); 29322 } else { 29323 reject(err); 29324 } 29325 }); 29326 }); 29327 }, [props.validationSchema]); 29328 var runSingleFieldLevelValidation = reactExports.useCallback(function(field, value) { 29329 return new Promise(function(resolve) { 29330 return resolve(fieldRegistry.current[field].validate(value)); 29331 }); 29332 }, []); 29333 var runFieldLevelValidations = reactExports.useCallback(function(values) { 29334 var fieldKeysWithValidation = Object.keys(fieldRegistry.current).filter(function(f2) { 29335 return isFunction(fieldRegistry.current[f2].validate); 29336 }); 29337 var fieldValidations = fieldKeysWithValidation.length > 0 ? fieldKeysWithValidation.map(function(f2) { 29338 return runSingleFieldLevelValidation(f2, getIn$1(values, f2)); 29339 }) : [Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")]; 29340 return Promise.all(fieldValidations).then(function(fieldErrorsList) { 29341 return fieldErrorsList.reduce(function(prev2, curr, index2) { 29342 if (curr === "DO_NOT_DELETE_YOU_WILL_BE_FIRED") { 29343 return prev2; 29344 } 29345 if (curr) { 29346 prev2 = setIn(prev2, fieldKeysWithValidation[index2], curr); 29347 } 29348 return prev2; 29349 }, {}); 29350 }); 29351 }, [runSingleFieldLevelValidation]); 29352 var runAllValidations = reactExports.useCallback(function(values) { 29353 return Promise.all([runFieldLevelValidations(values), props.validationSchema ? runValidationSchema(values) : {}, props.validate ? runValidateHandler(values) : {}]).then(function(_ref22) { 29354 var fieldErrors = _ref22[0], schemaErrors = _ref22[1], validateErrors = _ref22[2]; 29355 var combinedErrors = deepmerge_1.all([fieldErrors, schemaErrors, validateErrors], { 29356 arrayMerge 29357 }); 29358 return combinedErrors; 29359 }); 29360 }, [props.validate, props.validationSchema, runFieldLevelValidations, runValidateHandler, runValidationSchema]); 29361 var validateFormWithHighPriority = useEventCallback(function(values) { 29362 if (values === void 0) { 29363 values = state.values; 29364 } 29365 dispatch({ 29366 type: "SET_ISVALIDATING", 29367 payload: true 29368 }); 29369 return runAllValidations(values).then(function(combinedErrors) { 29370 if (!!isMounted.current) { 29371 dispatch({ 29372 type: "SET_ISVALIDATING", 29373 payload: false 29374 }); 29375 dispatch({ 29376 type: "SET_ERRORS", 29377 payload: combinedErrors 29378 }); 29379 } 29380 return combinedErrors; 29381 }); 29382 }); 29383 reactExports.useEffect(function() { 29384 if (validateOnMount && isMounted.current === true && isEqual$1(initialValues.current, props.initialValues)) { 29385 validateFormWithHighPriority(initialValues.current); 29386 } 29387 }, [validateOnMount, validateFormWithHighPriority]); 29388 var resetForm = reactExports.useCallback(function(nextState) { 29389 var values = nextState && nextState.values ? nextState.values : initialValues.current; 29390 var errors = nextState && nextState.errors ? nextState.errors : initialErrors.current ? initialErrors.current : props.initialErrors || {}; 29391 var touched = nextState && nextState.touched ? nextState.touched : initialTouched.current ? initialTouched.current : props.initialTouched || {}; 29392 var status = nextState && nextState.status ? nextState.status : initialStatus.current ? initialStatus.current : props.initialStatus; 29393 initialValues.current = values; 29394 initialErrors.current = errors; 29395 initialTouched.current = touched; 29396 initialStatus.current = status; 29397 var dispatchFn = function dispatchFn2() { 29398 dispatch({ 29399 type: "RESET_FORM", 29400 payload: { 29401 isSubmitting: !!nextState && !!nextState.isSubmitting, 29402 errors, 29403 touched, 29404 status, 29405 values, 29406 isValidating: !!nextState && !!nextState.isValidating, 29407 submitCount: !!nextState && !!nextState.submitCount && typeof nextState.submitCount === "number" ? nextState.submitCount : 0 29408 } 29409 }); 29410 }; 29411 if (props.onReset) { 29412 var maybePromisedOnReset = props.onReset(state.values, imperativeMethods);
29413 if (isPromise(maybePromisedOnReset)) { 29414 maybePromisedOnReset.then(dispatchFn); 29415 } else { 29416 dispatchFn(); 29417 } 29418 } else { 29419 dispatchFn(); 29420 } 29421 }, [props.initialErrors, props.initialStatus, props.initialTouched, props.onReset]); 29422 reactExports.useEffect(function() { 29423 if (isMounted.current === true && !isEqual$1(initialValues.current, props.initialValues)) { 29424 if (enableReinitialize) { 29425 initialValues.current = props.initialValues; 29426 resetForm(); 29427 if (validateOnMount) { 29428 validateFormWithHighPriority(initialValues.current); 29429 } 29430 } 29431 } 29432 }, [enableReinitialize, props.initialValues, resetForm, validateOnMount, validateFormWithHighPriority]); 29433 reactExports.useEffect(function() { 29434 if (enableReinitialize && isMounted.current === true && !isEqual$1(initialErrors.current, props.initialErrors)) { 29435 initialErrors.current = props.initialErrors || emptyErrors; 29436 dispatch({ 29437 type: "SET_ERRORS", 29438 payload: props.initialErrors || emptyErrors 29439 }); 29440 } 29441 }, [enableReinitialize, props.initialErrors]); 29442 reactExports.useEffect(function() { 29443 if (enableReinitialize && isMounted.current === true && !isEqual$1(initialTouched.current, props.initialTouched)) { 29444 initialTouched.current = props.initialTouched || emptyTouched; 29445 dispatch({ 29446 type: "SET_TOUCHED", 29447 payload: props.initialTouched || emptyTouched 29448 }); 29449 } 29450 }, [enableReinitialize, props.initialTouched]); 29451 reactExports.useEffect(function() { 29452 if (enableReinitialize && isMounted.current === true && !isEqual$1(initialStatus.current, props.initialStatus)) { 29453 initialStatus.current = props.initialStatus; 29454 dispatch({ 29455 type: "SET_STATUS", 29456 payload: props.initialStatus 29457 }); 29458 } 29459 }, [enableReinitialize, props.initialStatus, props.initialTouched]); 29460 var validateField = useEventCallback(function(name) { 29461 if (fieldRegistry.current[name] && isFunction(fieldRegistry.current[name].validate)) { 29462 var value = getIn$1(state.values, name); 29463 var maybePromise = fieldRegistry.current[name].validate(value); 29464 if (isPromise(maybePromise)) { 29465 dispatch({ 29466 type: "SET_ISVALIDATING", 29467 payload: true 29468 }); 29469 return maybePromise.then(function(x2) { 29470 return x2; 29471 }).then(function(error) { 29472 dispatch({ 29473 type: "SET_FIELD_ERROR", 29474 payload: { 29475 field: name, 29476 value: error 29477 } 29478 }); 29479 dispatch({ 29480 type: "SET_ISVALIDATING", 29481 payload: false 29482 }); 29483 }); 29484 } else { 29485 dispatch({ 29486 type: "SET_FIELD_ERROR", 29487 payload: { 29488 field: name, 29489 value: maybePromise 29490 } 29491 }); 29492 return Promise.resolve(maybePromise); 29493 } 29494 } else if (props.validationSchema) { 29495 dispatch({ 29496 type: "SET_ISVALIDATING", 29497 payload: true 29498 }); 29499 return runValidationSchema(state.values, name).then(function(x2) { 29500 return x2; 29501 }).then(function(error) { 29502 dispatch({ 29503 type: "SET_FIELD_ERROR", 29504 payload: { 29505 field: name, 29506 value: getIn$1(error, name) 29507 } 29508 }); 29509 dispatch({ 29510 type: "SET_ISVALIDATING", 29511 payload: false 29512 }); 29513 }); 29514 } 29515 return Promise.resolve(); 29516 }); 29517 var registerField = reactExports.useCallback(function(name, _ref3) { 29518 var validate = _ref3.validate; 29519 fieldRegistry.current[name] = { 29520 validate 29521 }; 29522 }, []); 29523 var unregisterField = reactExports.useCallback(function(name) { 29524 delete fieldRegistry.current[name]; 29525 }, []); 29526 var setTouched = useEventCallback(function(touched, shouldValidate) { 29527 dispatch({ 29528 type: "SET_TOUCHED", 29529 payload: touched 29530 }); 29531 var willValidate = shouldValidate === void 0 ? validateOnBlur : shouldValidate; 29532 return willValidate ? validateFormWithHighPriority(state.values) : Promise.resolve(); 29533 }); 29534 var setErrors = reactExports.useCallback(function(errors) { 29535 dispatch({ 29536 type: "SET_ERRORS", 29537 payload: errors 29538 }); 29539 }, []); 29540 var setValues = useEventCallback(function(values, shouldValidate) { 29541 var resolvedValues = isFunction(values) ? values(state.values) : values; 29542 dispatch({
vendor: 12,048 bytes, lines 29543-29866
29543 type: "SET_VALUES", 29544 payload: resolvedValues 29545 }); 29546 var willValidate = shouldValidate === void 0 ? validateOnChange : shouldValidate; 29547 return willValidate ? validateFormWithHighPriority(resolvedValues) : Promise.resolve(); 29548 }); 29549 var setFieldError = reactExports.useCallback(function(field, value) { 29550 dispatch({ 29551 type: "SET_FIELD_ERROR", 29552 payload: { 29553 field, 29554 value 29555 } 29556 }); 29557 }, []); 29558 var setFieldValue = useEventCallback(function(field, value, shouldValidate) { 29559 dispatch({ 29560 type: "SET_FIELD_VALUE", 29561 payload: { 29562 field, 29563 value 29564 } 29565 }); 29566 var willValidate = shouldValidate === void 0 ? validateOnChange : shouldValidate; 29567 return willValidate ? validateFormWithHighPriority(setIn(state.values, field, value)) : Promise.resolve(); 29568 }); 29569 var executeChange = reactExports.useCallback(function(eventOrTextValue, maybePath) { 29570 var field = maybePath; 29571 var val = eventOrTextValue; 29572 var parsed; 29573 if (!isString(eventOrTextValue)) { 29574 if (eventOrTextValue.persist) { 29575 eventOrTextValue.persist(); 29576 } 29577 var target = eventOrTextValue.target ? eventOrTextValue.target : eventOrTextValue.currentTarget; 29578 var type = target.type, name = target.name, id2 = target.id, value = target.value, checked = target.checked; 29579 target.outerHTML; 29580 var options2 = target.options, multiple = target.multiple; 29581 field = maybePath ? maybePath : name ? name : id2; 29582 val = /number|range/.test(type) ? (parsed = parseFloat(value), isNaN(parsed) ? "" : parsed) : /checkbox/.test(type) ? getValueForCheckbox(getIn$1(state.values, field), checked, value) : options2 && multiple ? getSelectedValues(options2) : value; 29583 } 29584 if (field) { 29585 setFieldValue(field, val); 29586 } 29587 }, [setFieldValue, state.values]); 29588 var handleChange = useEventCallback(function(eventOrPath) { 29589 if (isString(eventOrPath)) { 29590 return function(event) { 29591 return executeChange(event, eventOrPath); 29592 }; 29593 } else { 29594 executeChange(eventOrPath); 29595 } 29596 }); 29597 var setFieldTouched = useEventCallback(function(field, touched, shouldValidate) { 29598 if (touched === void 0) { 29599 touched = true; 29600 } 29601 dispatch({ 29602 type: "SET_FIELD_TOUCHED", 29603 payload: { 29604 field, 29605 value: touched 29606 } 29607 }); 29608 var willValidate = shouldValidate === void 0 ? validateOnBlur : shouldValidate; 29609 return willValidate ? validateFormWithHighPriority(state.values) : Promise.resolve(); 29610 }); 29611 var executeBlur = reactExports.useCallback(function(e2, path) { 29612 if (e2.persist) { 29613 e2.persist(); 29614 } 29615 var _e$target = e2.target, name = _e$target.name, id2 = _e$target.id; 29616 _e$target.outerHTML; 29617 var field = path ? path : name ? name : id2; 29618 setFieldTouched(field, true); 29619 }, [setFieldTouched]); 29620 var handleBlur = useEventCallback(function(eventOrString) { 29621 if (isString(eventOrString)) { 29622 return function(event) { 29623 return executeBlur(event, eventOrString); 29624 }; 29625 } else { 29626 executeBlur(eventOrString); 29627 } 29628 }); 29629 var setFormikState = reactExports.useCallback(function(stateOrCb) { 29630 if (isFunction(stateOrCb)) { 29631 dispatch({ 29632 type: "SET_FORMIK_STATE", 29633 payload: stateOrCb 29634 }); 29635 } else { 29636 dispatch({ 29637 type: "SET_FORMIK_STATE", 29638 payload: function payload() { 29639 return stateOrCb; 29640 } 29641 }); 29642 } 29643 }, []); 29644 var setStatus = reactExports.useCallback(function(status) { 29645 dispatch({ 29646 type: "SET_STATUS", 29647 payload: status 29648 }); 29649 }, []); 29650 var setSubmitting = reactExports.useCallback(function(isSubmitting) { 29651 dispatch({ 29652 type: "SET_ISSUBMITTING", 29653 payload: isSubmitting 29654 }); 29655 }, []); 29656 var submitForm = useEventCallback(function() { 29657 dispatch({ 29658 type: "SUBMIT_ATTEMPT" 29659 }); 29660 return validateFormWithHighPriority().then(function(combinedErrors) { 29661 var isInstanceOfError = combinedErrors instanceof Error; 29662 var isActuallyValid = !isInstanceOfError && Object.keys(combinedErrors).length === 0; 29663 if (isActuallyValid) { 29664 var promiseOrUndefined; 29665 try { 29666 promiseOrUndefined = executeSubmit(); 29667 if (promiseOrUndefined === void 0) { 29668 return; 29669 } 29670 } catch (error) { 29671 throw error; 29672 } 29673 return Promise.resolve(promiseOrUndefined).then(function(result) { 29674 if (!!isMounted.current) { 29675 dispatch({ 29676 type: "SUBMIT_SUCCESS" 29677 }); 29678 } 29679 return result; 29680 })["catch"](function(_errors) { 29681 if (!!isMounted.current) { 29682 dispatch({ 29683 type: "SUBMIT_FAILURE" 29684 }); 29685 throw _errors; 29686 } 29687 }); 29688 } else if (!!isMounted.current) { 29689 dispatch({ 29690 type: "SUBMIT_FAILURE" 29691 }); 29692 if (isInstanceOfError) { 29693 throw combinedErrors; 29694 } 29695 } 29696 return; 29697 }); 29698 }); 29699 var handleSubmit = useEventCallback(function(e2) { 29700 if (e2 && e2.preventDefault && isFunction(e2.preventDefault)) { 29701 e2.preventDefault(); 29702 } 29703 if (e2 && e2.stopPropagation && isFunction(e2.stopPropagation)) { 29704 e2.stopPropagation(); 29705 } 29706 submitForm()["catch"](function(reason) { 29707 console.warn("Warning: An unhandled error was caught from submitForm()", reason); 29708 }); 29709 }); 29710 var imperativeMethods = { 29711 resetForm, 29712 validateForm: validateFormWithHighPriority, 29713 validateField, 29714 setErrors, 29715 setFieldError, 29716 setFieldTouched, 29717 setFieldValue, 29718 setStatus, 29719 setSubmitting, 29720 setTouched, 29721 setValues, 29722 setFormikState, 29723 submitForm 29724 }; 29725 var executeSubmit = useEventCallback(function() { 29726 return onSubmit(state.values, imperativeMethods); 29727 }); 29728 var handleReset = useEventCallback(function(e2) { 29729 if (e2 && e2.preventDefault && isFunction(e2.preventDefault)) { 29730 e2.preventDefault(); 29731 } 29732 if (e2 && e2.stopPropagation && isFunction(e2.stopPropagation)) { 29733 e2.stopPropagation(); 29734 } 29735 resetForm(); 29736 }); 29737 var getFieldMeta = reactExports.useCallback(function(name) { 29738 return { 29739 value: getIn$1(state.values, name), 29740 error: getIn$1(state.errors, name), 29741 touched: !!getIn$1(state.touched, name), 29742 initialValue: getIn$1(initialValues.current, name), 29743 initialTouched: !!getIn$1(initialTouched.current, name), 29744 initialError: getIn$1(initialErrors.current, name) 29745 }; 29746 }, [state.errors, state.touched, state.values]); 29747 var getFieldHelpers = reactExports.useCallback(function(name) { 29748 return { 29749 setValue: function setValue(value, shouldValidate) { 29750 return setFieldValue(name, value, shouldValidate); 29751 }, 29752 setTouched: function setTouched2(value, shouldValidate) { 29753 return setFieldTouched(name, value, shouldValidate); 29754 }, 29755 setError: function setError(value) { 29756 return setFieldError(name, value); 29757 } 29758 }; 29759 }, [setFieldValue, setFieldTouched, setFieldError]); 29760 var getFieldProps = reactExports.useCallback(function(nameOrOptions) { 29761 var isAnObject = isObject$2(nameOrOptions); 29762 var name = isAnObject ? nameOrOptions.name : nameOrOptions; 29763 var valueState = getIn$1(state.values, name); 29764 var field = { 29765 name, 29766 value: valueState, 29767 onChange: handleChange, 29768 onBlur: handleBlur 29769 }; 29770 if (isAnObject) { 29771 var type = nameOrOptions.type, valueProp = nameOrOptions.value, is = nameOrOptions.as, multiple = nameOrOptions.multiple; 29772 if (type === "checkbox") { 29773 if (valueProp === void 0) { 29774 field.checked = !!valueState; 29775 } else { 29776 field.checked = !!(Array.isArray(valueState) && ~valueState.indexOf(valueProp)); 29777 field.value = valueProp; 29778 } 29779 } else if (type === "radio") { 29780 field.checked = valueState === valueProp; 29781 field.value = valueProp; 29782 } else if (is === "select" && multiple) { 29783 field.value = field.value || []; 29784 field.multiple = true; 29785 } 29786 } 29787 return field; 29788 }, [handleBlur, handleChange, state.values]); 29789 var dirty = reactExports.useMemo(function() { 29790 return !isEqual$1(initialValues.current, state.values); 29791 }, [initialValues.current, state.values]); 29792 var isValid = reactExports.useMemo(function() { 29793 return typeof isInitialValid !== "undefined" ? dirty ? state.errors && Object.keys(state.errors).length === 0 : isInitialValid !== false && isFunction(isInitialValid) ? isInitialValid(props) : isInitialValid : state.errors && Object.keys(state.errors).length === 0; 29794 }, [isInitialValid, dirty, state.errors, props]); 29795 var ctx = _extends$6({}, state, { 29796 initialValues: initialValues.current, 29797 initialErrors: initialErrors.current, 29798 initialTouched: initialTouched.current, 29799 initialStatus: initialStatus.current, 29800 handleBlur, 29801 handleChange, 29802 handleReset, 29803 handleSubmit, 29804 resetForm, 29805 setErrors, 29806 setFormikState, 29807 setFieldTouched, 29808 setFieldValue, 29809 setFieldError, 29810 setStatus, 29811 setSubmitting, 29812 setTouched, 29813 setValues, 29814 submitForm, 29815 validateForm: validateFormWithHighPriority, 29816 validateField, 29817 isValid, 29818 dirty, 29819 unregisterField, 29820 registerField, 29821 getFieldProps, 29822 getFieldMeta, 29823 getFieldHelpers, 29824 validateOnBlur, 29825 validateOnChange, 29826 validateOnMount 29827 }); 29828 return ctx; 29829 } 29830 function Formik(props) { 29831 var formikbag = useFormik(props); 29832 var component = props.component, children = props.children, render = props.render, innerRef = props.innerRef; 29833 reactExports.useImperativeHandle(innerRef, function() { 29834 return formikbag; 29835 }); 29836 return reactExports.createElement(FormikProvider, { 29837 value: formikbag 29838 }, component ? reactExports.createElement(component, formikbag) : render ? render(formikbag) : children ? isFunction(children) ? children(formikbag) : !isEmptyChildren(children) ? reactExports.Children.only(children) : null : null); 29839 } 29840 function yupToFormErrors(yupError) { 29841 var errors = {}; 29842 if (yupError.inner) { 29843 if (yupError.inner.length === 0) { 29844 return setIn(errors, yupError.path, yupError.message); 29845 } 29846 for (var _iterator = yupError.inner, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { 29847 var _ref5; 29848 if (_isArray) { 29849 if (_i2 >= _iterator.length) break; 29850 _ref5 = _iterator[_i2++]; 29851 } else { 29852 _i2 = _iterator.next(); 29853 if (_i2.done) break; 29854 _ref5 = _i2.value; 29855 } 29856 var err = _ref5; 29857 if (!getIn$1(errors, err.path)) { 29858 errors = setIn(errors, err.path, err.message); 29859 } 29860 } 29861 } 29862 return errors; 29863 } 29864 function validateYupSchema(values, schema, sync, context) { 29865 if (sync === void 0) { 29866 sync = false;
29867 } 29868 var normalizedValues = prepareDataForValidation(values); 29869 return schema[sync ? "validateSync" : "validate"](normalizedValues, { 29870 abortEarly: false, 29871 context: context || normalizedValues 29872 }); 29873 } 29874 function prepareDataForValidation(values) { 29875 var data = Array.isArray(values) ? [] : {}; 29876 for (var k2 in values) { 29877 if (Object.prototype.hasOwnProperty.call(values, k2)) { 29878 var key = String(k2); 29879 if (Array.isArray(values[key]) === true) { 29880 data[key] = values[key].map(function(value) { 29881 if (Array.isArray(value) === true || isPlainObject$1(value)) { 29882 return prepareDataForValidation(value); 29883 } else { 29884 return value !== "" ? value : void 0; 29885 } 29886 }); 29887 } else if (isPlainObject$1(values[key])) { 29888 data[key] = prepareDataForValidation(values[key]); 29889 } else { 29890 data[key] = values[key] !== "" ? values[key] : void 0; 29891 } 29892 } 29893 } 29894 return data; 29895 } 29896 function arrayMerge(target, source, options2) { 29897 var destination = target.slice(); 29898 source.forEach(function merge2(e2, i2) { 29899 if (typeof destination[i2] === "undefined") { 29900 var cloneRequested = options2.clone !== false; 29901 var shouldClone = cloneRequested && options2.isMergeableObject(e2); 29902 destination[i2] = shouldClone ? deepmerge_1(Array.isArray(e2) ? [] : {}, e2, options2) : e2; 29903 } else if (options2.isMergeableObject(e2)) { 29904 destination[i2] = deepmerge_1(target[i2], e2, options2); 29905 } else if (target.indexOf(e2) === -1) { 29906 destination.push(e2); 29907 } 29908 }); 29909 return destination; 29910 } 29911 function getSelectedValues(options2) { 29912 return Array.from(options2).filter(function(el) { 29913 return el.selected; 29914 }).map(function(el) { 29915 return el.value; 29916 }); 29917 } 29918 function getValueForCheckbox(currentValue, checked, valueProp) { 29919 if (typeof currentValue === "boolean") { 29920 return Boolean(checked); 29921 } 29922 var currentArrayOfValues = []; 29923 var isValueInArray = false; 29924 var index2 = -1; 29925 if (!Array.isArray(currentValue)) { 29926 if (!valueProp || valueProp == "true" || valueProp == "false") { 29927 return Boolean(checked); 29928 } 29929 } else { 29930 currentArrayOfValues = currentValue; 29931 index2 = currentValue.indexOf(valueProp); 29932 isValueInArray = index2 >= 0; 29933 } 29934 if (checked && valueProp && !isValueInArray) { 29935 return currentArrayOfValues.concat(valueProp); 29936 } 29937 if (!isValueInArray) { 29938 return currentArrayOfValues; 29939 } 29940 return currentArrayOfValues.slice(0, index2).concat(currentArrayOfValues.slice(index2 + 1)); 29941 } 29942 var useIsomorphicLayoutEffect$3 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect; 29943 function useEventCallback(fn2) { 29944 var ref = reactExports.useRef(fn2); 29945 useIsomorphicLayoutEffect$3(function() { 29946 ref.current = fn2; 29947 }); 29948 return reactExports.useCallback(function() { 29949 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 29950 args[_key] = arguments[_key]; 29951 } 29952 return ref.current.apply(void 0, args); 29953 }, []); 29954 } 29955 function Field(_ref2) { 29956 var validate = _ref2.validate, name = _ref2.name, render = _ref2.render, children = _ref2.children, is = _ref2.as, component = _ref2.component, className = _ref2.className, props = _objectWithoutPropertiesLoose$2(_ref2, ["validate", "name", "render", "children", "as", "component", "className"]); 29957 var _useFormikContext = useFormikContext(), formik = _objectWithoutPropertiesLoose$2(_useFormikContext, ["validate", "validationSchema"]); 29958 var registerField = formik.registerField, unregisterField = formik.unregisterField; 29959 reactExports.useEffect(function() { 29960 registerField(name, { 29961 validate 29962 }); 29963 return function() { 29964 unregisterField(name); 29965 }; 29966 }, [registerField, unregisterField, name, validate]); 29967 var field = formik.getFieldProps(_extends$6({ 29968 name 29969 }, props)); 29970 var meta = formik.getFieldMeta(name); 29971 var legacyBag = { 29972 field, 29973 form: formik 29974 }; 29975 if (render) { 29976 return render(_extends$6({}, legacyBag, { 29977 meta 29978 })); 29979 } 29980 if (isFunction(children)) { 29981 return children(_extends$6({}, legacyBag, { 29982 meta 29983 })); 29984 } 29985 if (component) { 29986 if (typeof component === "string") { 29987 var innerRef = props.innerRef, rest = _objectWithoutPropertiesLoose$2(props, ["innerRef"]); 29988 return reactExports.createElement(component, _extends$6({ 29989 ref: innerRef 29990 }, field, rest, { 29991 className 29992 }), children); 29993 } 29994 return reactExports.createElement(component, _extends$6({ 29995 field, 29996 form: formik 29997 }, props, { 29998 className 29999 }), children); 30000 } 30001 var asElement = is || "input"; 30002 if (typeof asElement === "string") { 30003 var _innerRef = props.innerRef, _rest = _objectWithoutPropertiesLoose$2(props, ["innerRef"]); 30004 return reactExports.createElement(asElement, _extends$6({ 30005 ref: _innerRef 30006 }, field, _rest, { 30007 className 30008 }), children); 30009 } 30010 return reactExports.createElement(asElement, _extends$6({}, field, props, { 30011 className 30012 }), children); 30013 } 30014 var Form = /* @__PURE__ */ reactExports.forwardRef(function(props, ref) { 30015 var action = props.action, rest = _objectWithoutPropertiesLoose$2(props, ["action"]); 30016 var _action = action != null ? action : "#"; 30017 var _useFormikContext = useFormikContext(), handleReset = _useFormikContext.handleReset, handleSubmit = _useFormikContext.handleSubmit; 30018 return reactExports.createElement("form", _extends$6({ 30019 onSubmit: handleSubmit, 30020 ref, 30021 onReset: handleReset, 30022 action: _action 30023 }, rest)); 30024 }); 30025 Form.displayName = "Form"; 30026 var mapTag = "[object Map]", setTag = "[object Set]"; 30027 var objectProto$1 = Object.prototype; 30028 var hasOwnProperty$1 = objectProto$1.hasOwnProperty; 30029 function isEmpty(value) { 30030 if (value == null) { 30031 return true; 30032 } 30033 if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) { 30034 return !value.length; 30035 } 30036 var tag = getTag(value); 30037 if (tag == mapTag || tag == setTag) { 30038 return !value.size; 30039 } 30040 if (isPrototype(value)) { 30041 return !baseKeys(value).length; 30042 } 30043 for (var key in value) { 30044 if (hasOwnProperty$1.call(value, key)) { 30045 return false;
30046 } 30047 } 30048 return true; 30049 } 30050 var l$1 = (r2, t2 = {}) => { 30051 let [o2, e2] = reactExports.useState(false); 30052 return reactExports.useEffect(() => { 30053 r2 && t2.hidePristineErrors && e2(true); 30054 }, [r2, t2.hidePristineErrors]), o2; 30055 }; 30056 var P$3 = (r2, t2, o2) => isObject$3(r2) ? (Object.entries(r2).forEach(([e2, n2]) => { 30057 P$3(n2, t2 ? `${t2}.${e2}` : e2, o2); 30058 }), o2) : (o2[t2] = r2, o2), u$4 = (r2, t2 = []) => P$3(r2, t2.join("."), {}), E$5 = (r2) => reduce(r2, (t2, o2, e2) => set$1(t2, e2, o2), {}); 30059 var F$3 = (r2, t2) => (o2) => { 30060 let e2 = r2.getFieldProps(o2); 30061 return __spreadProps(__spreadValues({}, e2), { onChange: (s2) => { 30062 var _a, _b; 30063 if (e2.onChange(s2), (_b = (_a = r2.status) == null ? void 0 : _a.errors) == null ? void 0 : _b[o2]) { 30064 let _c = r2.status.errors, { [o2]: i2 } = _c, a2 = __objRest(_c, [__restKey(o2)]); 30065 r2.setStatus(__spreadProps(__spreadValues({}, r2.status), { errors: a2 })); 30066 } 30067 }, error: get(t2, o2), submitCount: r2.submitCount }); 30068 }; 30069 var d$2 = (r2, t2, o2 = {}) => { 30070 var _a; 30071 let e2 = u$4(r2.touched), n2 = u$4(r2.errors), s2 = u$4(((_a = r2.status) == null ? void 0 : _a.errors) || {}); 30072 if (!t2 && o2.hidePristineErrors && r2.submitCount === 0) return {}; 30073 let i2 = mapValues(merge(s2, n2), (a2, p2) => { 30074 let c2 = !!get(r2.values, p2); 30075 return r2.submitCount > 0 || c2 && get(e2, p2) ? a2 : void 0; 30076 }); 30077 return o2.showOnlyFirstError && !isEmpty(i2) ? { [Object.keys(i2)[0]]: Object.values(i2)[0] } : E$5(i2); 30078 }; 30079 var y$4 = (r2 = {}) => { 30080 let t2 = useFormikContext(), o2 = l$1(t2.dirty, r2), e2 = d$2(t2, o2, r2), n2 = F$3(t2, e2); 30081 return __spreadProps(__spreadValues({}, t2), { errors: e2, getFieldProps: n2 }); 30082 }; 30083 var Fr$2 = (r2) => function(_a) { 30084 var _b = _a, { invalid: t2 = false, error: o2, field: e2, form: n2, onChange: s2, onBlur: i2 } = _b, a2 = __objRest(_b, ["invalid", "error", "field", "form", "onChange", "onBlur"]); 30085 let p2 = e2 && n2 && get(n2.touched, e2.name), c2 = e2 && n2 && get(n2.errors, e2.name), k2 = (m2) => { 30086 var _a2, _b2, _c, _d, _e2; 30087 return ((_a2 = m2 == null ? void 0 : m2.target) == null ? void 0 : _a2.type) === "checkbox" ? isNil((_b2 = m2 == null ? void 0 : m2.target) == null ? void 0 : _b2.checked) ? m2 : (_c = m2 == null ? void 0 : m2.target) == null ? void 0 : _c.checked : isNil((_d = m2 == null ? void 0 : m2.target) == null ? void 0 : _d.value) ? m2 : (_e2 = m2 == null ? void 0 : m2.target) == null ? void 0 : _e2.value; 30088 }, f2 = (m2) => (n2 && e2 && n2.setFieldValue(e2.name, k2(m2)), s2 ? s2(m2) : null), v2 = (m2) => { 30089 i2 && i2(m2), n2 && e2 && n2.setFieldTouched(e2.name, true); 30090 }; 30091 return jsxRuntimeExports.jsx(r2, __spreadProps(__spreadValues(__spreadValues({}, a2), e2), { invalid: t2 || o2 || (p2 || (n2 == null ? void 0 : n2.submitCount)) && !!c2, error: o2 || (p2 || (n2 == null ? void 0 : n2.submitCount)) && c2, onChange: f2, onBlur: v2 })); 30092 }; 30093 const INPUT_PADDING = 15; 30094 const INPUT_PADDING_XSMALL = 10; 30095 const INPUT_PADDING_SMALL = 6; 30096 const PREPEND_MARGIN = 8; 30097 const APPEND_MARGIN = 4; 30098 const ICON_SIZE = 16; 30099 const ACTION_ICON_SIZE = 12; 30100 const ICON_MARGIN = 10; 30101 const SPINNER_OFFSET = 30; 30102 const Root$3 = dt$2.div` 30103 position: relative; 30104 30105 width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"}; 30106`; 30107 const Container$q = dt$2.div` 30108 position: relative; 30109 width: 100%; 30110`; 30111 const getBoxBorderColor = ({ $invalid, $focused, $transparent }) => { 30112 if ($transparent) { 30113 return "transparent"; 30114 } 30115 if ($invalid) { 30116 return "var(--input-border-critical) !important"; 30117 } 30118 if ($focused) { 30119 return "var(--input-border-active) !important"; 30120 } 30121 return "var(--input-border, var(--border-secondary))"; 30122 }; 30123 const getBoxBackground = ({ $transparent }) => { 30124 if ($transparent) { 30125 return "transparent"; 30126 } 30127 return "var(--input-bg)"; 30128 };
30129 const getBoxDisabledBackground = ({ $transparent }) => { 30130 if ($transparent) { 30131 return "transparent"; 30132 } 30133 return "var(--bg-secondary)"; 30134 }; 30135 const Box$2 = dt$2.div` 30136 /* Input */ 30137 width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"}; 30138 background: ${getBoxBackground}; 30139 border: 1px solid ${getBoxBorderColor}; 30140 display: flex; 30141 align-items: center; 30142 30143 border-radius: var(--input-radius-normal); 30144 30145 ${({ $size, $fullHeight }) => $size === "large" && !$fullHeight && lt$2` 30146 height: 56px; 30147 `} 30148 30149 ${({ $size, $fullHeight }) => $size === "medium" && !$fullHeight && lt$2` 30150 height: 48px; 30151 `} 30152 30153 ${({ $size, $fullHeight }) => $size === "small" && !$fullHeight && lt$2` 30154 height: 40px; 30155 `} 30156 30157 ${({ $size, $fullHeight }) => $size === "xsmall" && !$fullHeight && lt$2` 30158 height: 32px; 30159 `} 30160 30161 ${({ $disabled, $hovered }) => !$disabled && lt$2` 30162 &:hover { 30163 border-color: var(--input-border-hover); 30164 } 30165 30166 ${$hovered && lt$2` 30167 border-color: var(--input-border-hover); 30168 `} 30169 `} 30170 30171 ${({ $disabled, $transparent }) => $disabled && lt$2` 30172 opacity: 0.3; 30173 background: ${getBoxDisabledBackground({ $transparent })}; 30174 cursor: not-allowed; 30175 `} 30176`; 30177 const Label$3 = dt$2.label` 30178 position: absolute; 30179 top: 50%; 30180 left: 0; 30181 width: 100%; 30182 transform: translateY(-50%); 30183 color: var(--text-secondary); 30184 pointer-events: none; 30185 font-size: var(--font-size-400); 30186 line-height: var(--font-line-height-400); 30187 letter-spacing: var(--font-letter-spacing-normal); 30188 padding-left: var(--space-400); 30189 padding-right: var(--space-400); 30190 white-space: nowrap; 30191 text-overflow: ellipsis; 30192 overflow: hidden; 30193 30194 user-select: none; 30195 30196 ${({ $size }) => $size === "xsmall" && lt$2` 30197 font-size: var(--font-size-300); 30198 line-height: var(--font-line-height-300); 30199 letter-spacing: var(--font-letter-spacing-loose); 30200 `} 30201 30202 ${({ $size, $hasValue }) => $size === "large" && $hasValue && lt$2` 30203 top: 0; 30204 transform: none; 30205 font-size: var(--font-size-200); 30206 line-height: 34px; 30207 `} 30208 30209 ${({ $size, $hasValue }) => $size === "medium" && $hasValue && lt$2` 30210 top: 0; 30211 transform: none; 30212 font-size: var(--font-size-100); 30213 line-height: var(--font-line-height-100); 30214 letter-spacing: var(--font-letter-spacing-loosest); 30215 `} 30216 30217 ${({ $size, $hasValue }) => ($size === "small" || $size === "xsmall") && $hasValue && lt$2` 30218 display: none; 30219 `} 30220 30221 ${({ $centered }) => $centered && lt$2` 30222 padding-left: ${SPINNER_OFFSET}px; 30223 padding-right: ${SPINNER_OFFSET}px; 30224 text-align: center; 30225 `} 30226`; 30227 const getTextColor = () => "var(--text-primary)"; 30228 const Input$3 = dt$2.input` 30229 width: 100%; 30230 padding: 0 var(--space-350); 30231 background: transparent; 30232 border: 0; 30233 outline: 0; 30234 vertical-align: top; 30235 30236 font-size: var(--font-size-400); 30237 color: ${getTextColor}; 30238 30239 ::placeholder { 30240 color: var(--text-secondary); 30241 } 30242 30243 &:disabled { 30244 color: ${getTextColor}; 30245 cursor: not-allowed; 30246 } 30247 30248 // https://css-tricks.com/snippets/css/change-autocomplete-styles-webkit-browsers/ 30249 &:-webkit-autofill, 30250 &:-webkit-autofill:focus, 30251 &:-webkit-autofill:hover { 30252 -webkit-text-fill-color: ${getTextColor}; 30253 -webkit-background-clip: text; 30254 caret-color: ${getTextColor}; 30255 } 30256 30257 ${({ $centered }) => $centered && lt$2` 30258 text-align: center; 30259 `} 30260 30261 ${({ $inputSize, $hasLabel }) => $inputSize === "large" && lt$2` 30262 line-height: 54px; 30263 30264 &:-webkit-autofill { 30265 & ~ ${Label$3} { 30266 top: 0; 30267 transform: none; 30268 font-size: var(--font-size-200); 30269 line-height: 34px; 30270 } 30271 } 30272 30273 ${$hasLabel && lt$2` 30274 padding-top: var(--space-400); 30275 line-height: 38px; 30276 `} 30277 `} 30278 30279 ${({ $inputSize, $hasLabel }) => $inputSize === "medium" && lt$2` 30280 line-height: 48px; 30281 30282 &:-webkit-autofill { 30283 & ~ ${Label$3} { 30284 top: 0; 30285 transform: none; 30286 font-size: var(--font-size-100); 30287 line-height: var(--font-line-height-100); 30288 letter-spacing: var(--font-letter-spacing-loosest); 30289 } 30290 } 30291 30292 ${$hasLabel && lt$2` 30293 padding-top: var(--space-350); 30294 30295 line-height: var(--font-line-height-400); /* 150% */ 30296 letter-spacing: var(--font-letter-spacing-normal); 30297 `} 30298 `} 30299 30300 ${({ $inputSize, $hasLabel }) => $inputSize === "small" && lt$2` 30301 line-height: 38px; 30302 30303 &:-webkit-autofill { 30304 & ~ ${Label$3} { 30305 display: none; 30306 } 30307 } 30308 30309 ${$hasLabel && lt$2` 30310 line-height: 38px; 30311 `} 30312 `} 30313 30314 ${({ $inputSize, $hasLabel }) => $inputSize === "xsmall" && lt$2` 30315 font-size: var(--font-size-300); 30316 line-height: var(--font-line-height-300); 30317 letter-spacing: var(--font-letter-spacing-loose); 30318 30319 &:-webkit-autofill { 30320 & ~ ${Label$3} { 30321 display: none; 30322 } 30323 } 30324 30325 ${$hasLabel && lt$2` 30326 line-height: var(--font-line-height-300); 30327 `} 30328 30329 padding: 0 var(--space-250); 30330 `} 30331 30332 ${({ type, $hasSpinner }) => type === "number" && lt$2` 30333 ${$hasSpinner && lt$2` 30334 min-width: 90px; 30335 `} 30336 30337 &[type='number'] { 30338 -webkit-appearance: textfield; 30339 -moz-appearance: textfield; 30340 appearance: textfield; 30341 } 30342 30343 &[type='number']::-webkit-inner-spin-button, 30344 &[type='number']::-webkit-outer-spin-button { 30345 -webkit-appearance: none; 30346 } 30347 `} 30348 30349 ${({ $readOnly }) => $readOnly && lt$2` 30350 caret-color: transparent; 30351 `} 30352 30353 ${({ $strikethrough }) => $strikethrough && lt$2` 30354 &:not(:focus) { 30355 text-decoration: line-through; 30356 } 30357 `} 30358 30359 ${({ $masked }) => $masked && lt$2` 30360 color: transparent; 30361 30362 &::selection { 30363 background: transparent; 30364 } 30365 `} 30366 30367 ${({ $innerPadding }) => $innerPadding === "small" && lt$2` 30368 padding: 0 ${INPUT_PADDING_SMALL}px; 30369 `} 30370 30371 ${({ $innerPadding }) => $innerPadding === "medium" && lt$2` 30372 padding: 0 ${INPUT_PADDING}px; 30373 `} 30374`; 30375 const SpinnerLeft$1 = dt$2.div` 30376 position: absolute; 30377 left: 0; 30378 top: 0; 30379 bottom: 0; 30380 display: flex; 30381 justify-content: center; 30382 align-items: center; 30383 padding: var(--space-50); 30384`; 30385 const SpinnerRight$1 = dt$2.div` 30386 position: absolute; 30387 right: 0; 30388 top: 0; 30389 bottom: 0; 30390 display: flex; 30391 justify-content: center; 30392 align-items: center; 30393 padding: var(--space-50); 30394`; 30395 const SpinnerItem$1 = dt$2.button` 30396 display: flex; 30397 justify-content: center; 30398 align-items: center; 30399 width: 24px; 30400 height: 100%; 30401 color: ${getTextColor}; 30402 background-color: var(--bg-secondary); 30403 border: none; 30404 cursor: pointer; 30405 border-radius: var(--input-radius-normal); 30406 30407 &:disabled {
30408 cursor: not-allowed; 30409 } 30410`; 30411 const Prepend$1 = dt$2.div` 30412 color: ${getTextColor}; 30413 font-size: var(--font-size-300); 30414 position: absolute; 30415 left: var(--space-400); 30416 top: 1px; 30417 bottom: 1px; 30418 user-select: none; 30419 visibility: hidden; 30420 line-height: 1.5; 30421 letter-spacing: var(--font-letter-spacing-normal); 30422 color: var(--text-secondary); 30423 30424 /* NOTE: Trim left side of prepend when its width is bigger than 50% of input */ 30425 direction: rtl; 30426 max-width: 50%; 30427 text-overflow: ellipsis; 30428 white-space: nowrap; 30429 overflow: hidden; 30430 30431 ${({ $size, $hasLabel }) => $size === "large" && lt$2` 30432 line-height: 54px; 30433 30434 ${$hasLabel && lt$2` 30435 padding-top: var(--space-400); 30436 line-height: 38px; 30437 `} 30438 `} 30439 30440 ${({ $size, $hasLabel }) => $size === "medium" && lt$2` 30441 line-height: 48px; 30442 30443 ${$hasLabel && lt$2` 30444 padding-top: var(--space-350); 30445 line-height: 32px; 30446 `} 30447 `} 30448 30449 ${({ $size }) => $size === "small" && lt$2` 30450 line-height: 38px; 30451 `} 30452 30453 ${({ $size }) => $size === "xsmall" && lt$2` 30454 line-height: 30px; 30455 `} 30456 30457 ${({ $visible }) => $visible && lt$2` 30458 visibility: visible; 30459 `} 30460`; 30461 const Append$1 = dt$2(Prepend$1)` 30462 right: var(--space-400); 30463 left: auto; 30464 direction: ltr; 30465 30466 ${({ $largeSpace }) => $largeSpace && lt$2` 30467 right: var(--space-900); 30468 `} 30469`; 30470 const getIconColor = ({ $hasValue }) => { 30471 if ($hasValue) { 30472 return "var(--text-primary)"; 30473 } 30474 return "var(--icon-secondary)"; 30475 }; 30476 const IconContainer$1 = dt$2.div` 30477 position: absolute; 30478 padding-left: var(--space-300); 30479 color: ${getIconColor}; 30480 30481 ${({ $validElement }) => $validElement && lt$2` 30482 padding: var(--space-100); 30483 cursor: pointer; 30484 color: var(--text-secondary); 30485 30486 &:hover { 30487 color: var(--text-primary); 30488 } 30489 `} 30490`; 30491 const ActionIconContainer$1 = dt$2.div` 30492 position: absolute; 30493 display: flex; 30494 align-items: center; 30495 right: 0; 30496 margin-right: var(--space-200); 30497 padding: var(--space-200); 30498 color: ${({ $iconColor }) => $iconColor || "var(--text-secondary)"}; 30499 30500 ${({ $hoverable }) => $hoverable && lt$2` 30501 cursor: pointer; 30502 30503 &:hover { 30504 color: var(--text-primary); 30505 } 30506 `} 30507 30508 ${({ $size }) => $size === "small" && lt$2` 30509 margin-right: var(--space-100); 30510 `} 30511 30512 ${({ $size }) => $size === "xsmall" && lt$2` 30513 margin-right: var(--space-100); 30514 `} 30515`; 30516 const Suggestion$1 = dt$2.div` 30517 margin-top: ${({ $withoutMargin }) => $withoutMargin ? "none" : "var(--space-200)"}; 30518 30519 color: var(--text-secondary); 30520 font-size: var(--font-size-300); 30521 font-weight: var(--font-weight-400); 30522 line-height: var(--font-line-height-300); 30523 30524 a { 30525 text-decoration-line: underline; 30526 text-decoration-skip-ink: none; 30527 text-underline-offset: var(--space-100); 30528 30529 &:hover { 30530 color: var(--text-link); 30531 } 30532 } 30533`; 30534 const Error$2 = dt$2.div` 30535 display: flex; 30536 padding: var(--space-100) var(--space-150); 30537 margin-top: ${({ $withoutMargin }) => $withoutMargin ? "0px" : "var(--space-100)"}; 30538 30539 font-size: var(--font-size-300); 30540 line-height: var(--font-line-height-300); 30541 color: var(--text-white); 30542 background: var(--bg-critical); 30543 border-radius: var(--input-radius-normal); 30544`; 30545 const Footer$4 = dt$2.div` 30546 display: flex; 30547 align-items: flex-start; 30548 gap: var(--space-400); 30549 margin-top: var(--space-200); 30550`; 30551 const Info$1 = dt$2.div` 30552 flex-shrink: 0; 30553 margin-left: auto; 30554 font-size: var(--font-size-200); 30555 line-height: var(--font-line-height-200); 30556 text-align: right; 30557 white-space: nowrap; 30558 color: var(--text-secondary); 30559`; 30560 const getMaskedPlaceholderStyles = ({ $maskType }) => { 30561 if ($maskType === "partial") { 30562 return lt$2` 30563 color: ${getTextColor}; 30564 font-size: var(--font-size-400); 30565 letter-spacing: 0.05em; 30566 `; 30567 } 30568 return lt$2` 30569 border-radius: var(--input-radius-normal); 30570 background: var(--bg-transparent-strong); 30571 height: 1.5em; 30572 `; 30573 }; 30574 const MaskedPlaceholder$1 = dt$2.div` 30575 display: inline-block; 30576 position: absolute; 30577 left: var(--space-400); 30578 width: ${({ $length }) => $length}ch; 30579 vertical-align: middle; 30580 pointer-events: none; 30581 30582 ${getMaskedPlaceholderStyles} 30583 30584 ${({ $size }) => $size === "large" && lt$2` 30585 top: calc(50% + var(--space-250)); 30586 transform: translateY(-50%); 30587 `} 30588 30589 ${({ $size }) => $size === "medium" && lt$2` 30590 top: calc(50% + var(--space-200)); 30591 transform: translateY(-50%); 30592 `} 30593 30594 ${({ $size }) => $size === "small" && lt$2` 30595 top: calc(50%); 30596 transform: translateY(-50%); 30597 `} 30598 30599 ${({ $size }) => $size === "xsmall" && lt$2` 30600 top: calc(50%); 30601 transform: translateY(-50%); 30602 `} 30603`; 30604 const Root$2 = Root$3; 30605 const Container$p = Container$q; 30606 const Box$1 = Box$2; 30607 const Input$2 = Input$3; 30608 const SpinnerLeft = SpinnerLeft$1; 30609 const SpinnerRight = SpinnerRight$1; 30610 const SpinnerItem = reactExports.forwardRef((_h, ref) => { 30611 var _i2 = _h, { icon: Icon2, iconSize } = _i2, props = __objRest(_i2, ["icon", "iconSize"]); 30612 return /* @__PURE__ */ jsxRuntimeExports.jsx(SpinnerItem$1, __spreadProps(__spreadValues({ ref, t
30612ype: "button" }, props), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { height: iconSize }) })); 30613 }); 30614 const Prepend = Prepend$1; 30615 const Append = Append$1; 30616 const IconContainer = IconContainer$1; 30617 const ActionIconContainer = ActionIconContainer$1; 30618 const Label$2 = Label$3; 30619 const Suggestion = Suggestion$1; 30620 const Footer$3 = Footer$4; 30621 const Info = Info$1; 30622 const MaskedPlaceholder = MaskedPlaceholder$1; 30623 const Error$1 = reactExports.forwardRef( 30624 (_j, ref) => { 30625 var _k = _j, { errorTimestampKey, $withoutMargin, children } = _k, props = __objRest(_k, ["errorTimestampKey", "$withoutMargin", "children"]); 30626 return /* @__PURE__ */ jsxRuntimeExports.jsx( 30627 Error$2, 30628 __spreadProps(__spreadValues({ 30629 ref, 30630 "aria-live": "polite", 30631 "aria-atomic": "true", 30632 role: "alert", 30633 $withoutMargin 30634 }, props), { 30635 children 30636 }), 30637 errorTimestampKey 30638 ); 30639 } 30640 ); 30641 const InputUIConsts = { 30642 INPUT_PADDING, 30643 INPUT_PADDING_XSMALL, 30644 PREPEND_MARGIN, 30645 APPEND_MARGIN, 30646 ICON_SIZE, 30647 ICON_MARGIN, 30648 ACTION_ICON_SIZE, 30649 SPINNER_OFFSET 30650 }; 30651 const triggerOnChange = (element, value) => { 30652 var _a; 30653 const nativeInputValueSetter = (_a = Object.getOwnPropertyDescriptor( 30654 window.HTMLInputElement.prototype, 30655 "value" 30656 )) == null ? void 0 : _a.set; 30657 if (nativeInputValueSetter) { 30658 nativeInputValueSetter.call(element, value); 30659 } 30660 }; 30661 const dispatchEvent = (element, event = "input") => { 30662 element.dispatchEvent(new Event(event, { bubbles: true })); 30663 }; 30664 const InputComponent = ({ 30665 label, 30666 type = "text", 30667 placeholder, 30668 prepend, 30669 append: append2, 30670 showAppend = false, 30671 suggestion, 30672 disabled, 30673 readOnly = false, 30674 focused, 30675 hovered, 30676 leftIcon, 30677 actionIcon, 30678 actionIconColor, 30679 tabIndex, 30680 fullWidth, 30681 centered = false, 30682 name, 30683 value = "", 30684 invalid = false, 30685 required, 30686 autoFocus, 30687 autoComplete, 30688 maxLength, 30689 showCharacterCount = false, 30690 size = "large", 30691 innerPadding, 30692 transparent = false, 30693 error, 30694 displayError = true, 30695 submitCount, 30696 hideSpinner = false, 30697 step, 30698 min: min2, 30699 max: max2, 30700 inputRef, 30701 role, 30702 ariaDescribedBy, 30703 strikethrough, 30704 masked, 30705 maskType, 30706 maskedVisibleChars = 4, 30707 maskedDotsCount = 4, 30708 onChange, 30709 onValueChange, 30710 onFocus, 30711 onBlur, 30712 onKeyDown, 30713 onPaste, 30714 onActionIconClick 30715 }) => { 30716 const prependEl = reactExports.useRef(null); 30717 const appendEl = reactExports.useRef(null); 30718 const labelEl = reactExports.useRef(null); 30719 const internalInputRef = reactExports.useRef(null); 30720 const localInputRef = inputRef != null ? inputRef : internalInputRef; 30721 const [prependWidth, setPrependWidth] = reactExports.useState(0); 30722 const [appendWidth, setAppendWidth] = reactExports.useState(0); 30723 const [isFocused, setIsFocused] = reactExports.useState(false); 30724 const [isLabelTruncated, setIsLabelTruncated] = reactExports.useState(false); 30725 const charactersLeft = (maxLength || Infinity) - ((value == null ? void 0 : value.length) || 0); 30726 const showSuggestion = (!displayError || !error) && !!suggestion; 30727 reactExports.useLayoutEffect(() => { 30728 if (!isUndefined(focused)) { 30729 setIsFocused(focused); 30730 } 30731 }, [focused]); 30732 reactExports.useLayoutEffect(() => { 30733 if (prependEl.current) { 30734 setPrependWidth(prependEl.current.offsetWidth); 30735 } 30736 }, [prepend]); 30737 reactExports.useLayoutEffect(() => { 30738 if (appendEl.current) { 30739 setAppendWidth(appendEl.current.offsetWidth); 30740 } 30741 }, [append2]); 30742 reactExports.useLayoutEffect(() => { 30743 if (labelEl.current) { 30744 setIsLabelTruncated(labelEl.current.scrollWidth > labelEl.current.clientWidth); 30745 } 30746 }, [label, size]); 30747 const hasValue = () => { 30748 if (type === "date" || type === "datetime-local") return true; 30749 if (isFocused) return true; 30750 return !isNil(value) && !!value.toString().length; 30751 }; 30752 const hasFocus = () => { 30753 if (readOnly) return false;
30754 return isFocused; 30755 }; 30756 const handleSetValue = (newValue) => { 30757 const inputElement = localInputRef.current; 30758 if (inputElement && !disabled) { 30759 triggerOnChange(inputElement, newValue); 30760 dispatchEvent(inputElement); 30761 } 30762 }; 30763 const handleChange = (e2) => { 30764 if (onChange) { 30765 onChange(e2); 30766 } 30767 if (onValueChange) { 30768 onValueChange(e2.target.value); 30769 } 30770 }; 30771 const handleFocus = (e2) => { 30772 if (readOnly) return; 30773 setIsFocused(true); 30774 if (onFocus) { 30775 onFocus(e2); 30776 } 30777 }; 30778 const handleBlur = (e2) => { 30779 setIsFocused(false); 30780 if (onBlur) { 30781 onBlur(e2); 30782 } 30783 }; 30784 const disableWheel = (e2) => { 30785 if (type === "number") { 30786 e2.currentTarget.blur(); 30787 } 30788 }; 30789 const handleKeyDown2 = (e2) => { 30790 if (onKeyDown) { 30791 onKeyDown(e2); 30792 } 30793 }; 30794 const getIconOffset = () => { 30795 return InputUIConsts.INPUT_PADDING + InputUIConsts.ICON_SIZE + InputUIConsts.ICON_MARGIN; 30796 }; 30797 const getPrependOffset = () => { 30798 return InputUIConsts.INPUT_PADDING + prependWidth + InputUIConsts.PREPEND_MARGIN; 30799 }; 30800 const getAppendOffset = () => { 30801 return InputUIConsts.INPUT_PADDING + appendWidth + InputUIConsts.APPEND_MARGIN + (actionIcon ? InputUIConsts.ICON_SIZE + InputUIConsts.APPEND_MARGIN : 0); 30802 }; 30803 const getInputOffset = () => { 30804 if (leftIcon && !prepend) { 30805 return getIconOffset(); 30806 } 30807 if (hasValue() && prepend && prependWidth) { 30808 return getPrependOffset(); 30809 } 30810 if (type === "number" && !hideSpinner) { 30811 return InputUIConsts.SPINNER_OFFSET; 30812 } 30813 if (innerPadding) { 30814 return void 0; 30815 } 30816 return size === "xsmall" ? InputUIConsts.INPUT_PADDING_XSMALL : InputUIConsts.INPUT_PADDING; 30817 }; 30818 const getRightInputOffset = () => { 30819 if (hasValue() && append2 && appendWidth) { 30820 return getAppendOffset(); 30821 } 30822 if (actionIcon) { 30823 return getIconOffset(); 30824 } 30825 if (type === "number" && !hideSpinner) { 30826 return InputUIConsts.SPINNER_OFFSET; 30827 } 30828 }; 30829 const getLabelOffset = () => { 30830 if (leftIcon && !prepend) { 30831 return getIconOffset(); 30832 } 30833 }; 30834 const getPlaceholder = () => { 30835 return label ? void 0 : placeholder; 30836 }; 30837 const getLabelId = () => { 30838 return name ? `${name}__label` : void 0; 30839 }; 30840 const getInputId = () => { 30841 return name ? `${name}__input` : void 0; 30842 }; 30843 const renderIcon2 = () => { 30844 if (!leftIcon || prepend) return null; 30845 const isIconValidElement = reactExports.isValidElement(leftIcon); 30846 const LeftIcon = leftIcon; 30847 return /* @__PURE__ */ jsxRuntimeExports.jsx(IconContainer, { $validElement: isIconValidElement, $hasValue: hasValue(), children: isIconValidElement ? leftIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(LeftIcon, { height: InputUIConsts.ICON_SIZE }) }); 30848 }; 30849 const renderActionIcon = () => { 30850 if (!actionIcon) return null; 30851 const ActionIcon = actionIcon; 30852 return /* @__PURE__ */ jsxRuntimeExports.jsx( 30853 ActionIconContainer, 30854 { 30855 $size: size, 30856 $iconColor: actionIconColor, 30857 $hoverable: !disabled && !!onActionIconClick, 30858 "data-testid": "Input.ActionIcon", 30859 onClick: onActionIconClick, 30860 children: reactExports.isValidElement(actionIcon) ? actionIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { height: InputUIConsts.ACTION_ICON_SIZE }) 30861 } 30862 ); 30863 }; 30864 const renderPrepend = () => { 30865 if (!prepend) return null; 30866 return /* @__PURE__ */ jsxRuntimeExports.jsx( 30867 Prepend, 30868 { 30869 ref: prependEl, 30870 $size: size, 30871 $hasLabel: !!label, 30872 $visible: hasValue() && !!prependWidth, 30873 children: prepend 30874 } 30875 ); 30876 }; 30877 const renderAppend = () => { 30878 if (!append2) return null; 30879 return /* @__PURE__ */ jsxRuntimeExports.jsx( 30880 Append, 30881 { 30882 ref: appendEl, 30883 $size: size, 30884 $hasLabel: !!label, 30885 $visible: showAppend || hasValue() && !!appendWidth, 30886 $largeSpace: !!actionIcon, 30887 children: append2 30888 } 30889 ); 30890 }; 30891 const increaseValue = () => { 30892 handleSetValue(value ? `${parseInt(value) + 1}` : "1"); 30893 }; 30894 const decreaseValue = () => { 30895 handleSetValue(value ? `${parseInt(value) - 1}` : "-1"); 30896 }; 30897 const renderSpinnerLeft = () => { 30898 if (type === "number" && !hideSpinner) { 30899 return /* @__PURE__ */ jsxRuntimeExports.jsx(SpinnerLeft, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 30900 SpinnerItem, 30901 { 30902 "data-testid": "Input.SpinnerItem.Decrease", 30903 "aria-label": "Decrease", 30904 disabled: !!disabled || min2 !== void 0 && Number(value) <= min2, 30905 icon: wt$2, 30906 iconSize: 12, 30907 onClick: decreaseValue 30908 } 30909 ) }); 30910 } 30911 return null; 30912 }; 30913 const renderSpinnerRight = () => { 30914 if (type === "number" && !hideSpinner) { 30915 return /* @__PURE__ */ jsxRuntimeExports.jsx(SpinnerRight, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 30916 SpinnerItem, 30917 { 30918 "data-testid": "Input.SpinnerItem.Increase", 30919 "aria-label": "Increase", 30920 disabled: !!disabled || max2 !== void 0 && Number(value) >= max2, 30921 icon: W9, 30922 iconSize: 12, 30923 onClick: increaseValue 30924 } 30925 ) }); 30926 } 30927 return null; 30928 }; 30929 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Root$2, { $fullWidth: !!fullWidth, children: [
30930 /* @__PURE__ */ jsxRuntimeExports.jsxs( 30931 Box$1, 30932 { 30933 $invalid: invalid, 30934 $fullWidth: fullWidth, 30935 $disabled: disabled, 30936 $focused: hasFocus(), 30937 $hovered: hovered, 30938 $size: size, 30939 $transparent: transparent && !hasFocus(), 30940 children: [ 30941 renderPrepend(), 30942 /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$p, { children: [ 30943 /* @__PURE__ */ jsxRuntimeExports.jsx( 30944 Input$2, 30945 { 30946 ref: localInputRef, 30947 $inputSize: size, 30948 $hasLabel: !!label && hasValue(), 30949 $hasSpinner: !hideSpinner, 30950 $centered: centered || type === "number" && !hideSpinner, 30951 $innerPadding: innerPadding, 30952 id: getInputId(), 30953 type, 30954 name, 30955 value: masked ? "" : value, 30956 placeholder: getPlaceholder(), 30957 disabled, 30958 $readOnly: readOnly, 30959 required, 30960 autoFocus, 30961 autoComplete, 30962 maxLength, 30963 step, 30964 min: min2, 30965 max: max2, 30966 tabIndex, 30967 "aria-labelledby": getLabelId(), 30968 "aria-invalid": invalid ? "true" : "false", 30969 "data-testid": "Input", 30970 style: { paddingLeft: getInputOffset(), paddingRight: getRightInputOffset() }, 30971 role, 30972 "aria-describedby": ariaDescribedBy, 30973 $strikethrough: strikethrough, 30974 $masked: masked, 30975 onChange: handleChange, 30976 onFocus: handleFocus, 30977 onBlur: handleBlur, 30978 onWheel: disableWheel, 30979 onKeyDown: handleKeyDown2, 30980 onPaste 30981 } 30982 ),
30983 /* @__PURE__ */ jsxRuntimeExports.jsx( 30984 Label$2, 30985 { 30986 ref: labelEl, 30987 id: getLabelId(), 30988 $hasValue: hasValue(), 30989 $centered: type === "number" && !hideSpinner, 30990 htmlFor: getInputId(), 30991 $size: size, 30992 title: isLabelTruncated ? label : void 0, 30993 style: { paddingLeft: getLabelOffset() }, 30994 "data-testid": "Input.Label", 30995 children: label 30996 } 30997 ), 30998 renderSpinnerLeft(), 30999 renderSpinnerRight(), 31000 masked && !!value.length && /* @__PURE__ */ jsxRuntimeExports.jsx(MaskedPlaceholder, { $length: value.length, $size: size, $maskType: maskType, children: maskType === "partial" && M$6(value, maskedVisibleChars, maskedDotsCount) }) 31001 ] }), 31002 renderAppend(), 31003 renderIcon2(), 31004 renderActionIcon() 31005 ] 31006 } 31007 ),
31008 (showSuggestion || showCharacterCount) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Footer$3, { children: [ 31009 showSuggestion && /* @__PURE__ */ jsxRuntimeExports.jsx(Suggestion, { $withoutMargin: true, children: suggestion }), 31010 showCharacterCount && /* @__PURE__ */ jsxRuntimeExports.jsx(Info, { children: `${charactersLeft} ${I$2(charactersLeft, "character")} left` }) 31011 ] }), 31012 displayError && !!error && /* @__PURE__ */ jsxRuntimeExports.jsx(Error$1, { errorTimestampKey: submitCount, children: error }) 31013 ] }); 31014 }; 31015 const Input$1 = Fr$2(InputComponent); 31016 const DOCK_INSET_BOTTOM = "var(--dock-inset-bottom, 0px)"; 31017 const SAFE_AREA_INSET_BOTTOM = "var(--safe-area-inset-bottom, 0px)"; 31018 const SAFE_AREA_INSET_TOP = "var(--safe-area-inset-top, 0px)"; 31019 const OVERLAY_BOTTOM_INSET = `var(--overlay-inset-bottom, ${SAFE_AREA_INSET_BOTTOM})`; 31020 const OVERLAY_TOP_INSET = SAFE_AREA_INSET_TOP; 31021 const pageBottomOffset = (minSpacing = "0px") => `max(${minSpacing}, ${DOCK_INSET_BOTTOM}, ${SAFE_AREA_INSET_BOTTOM})`; 31022 const overlayBottomOffset = (minSpacing = "0px") => `max(${minSpacing}, ${OVERLAY_BOTTOM_INSET})`; 31023 function basePropertyOf(object2) { 31024 return function(key) { 31025 return object2 == null ? void 0 : object2[key]; 31026 }; 31027 } 31028 function hasWindow() { 31029 return typeof window !== "undefined"; 31030 } 31031 function getNodeName(node2) { 31032 if (isNode(node2)) { 31033 return (node2.nodeName || "").toLowerCase(); 31034 } 31035 return "#document"; 31036 } 31037 function getWindow(node2) { 31038 var _node$ownerDocument; 31039 return (node2 == null || (_node$ownerDocument = node2.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 31040 } 31041 function getDocumentElement(node2) { 31042 var _ref2; 31043 return (_ref2 = (isNode(node2) ? node2.ownerDocument : node2.document) || window.document) == null ? void 0 : _ref2.documentElement; 31044 } 31045 function isNode(value) { 31046 if (!hasWindow()) { 31047 return false; 31048 } 31049 return value instanceof Node || value instanceof getWindow(value).Node; 31050 } 31051 function isElement(value) { 31052 if (!hasWindow()) { 31053 return false; 31054 } 31055 return value instanceof Element || value instanceof getWindow(value).Element; 31056 } 31057 function isHTMLElement(value) { 31058 if (!hasWindow()) { 31059 return false; 31060 } 31061 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 31062 } 31063 function isShadowRoot(value) { 31064 if (!hasWindow() || typeof ShadowRoot === "undefined") { 31065 return false; 31066 } 31067 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 31068 } 31069 const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]); 31070 function isOverflowElement(element) { 31071 const { 31072 overflow, 31073 overflowX, 31074 overflowY, 31075 display 31076 } = getComputedStyle$2(element); 31077 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display); 31078 } 31079 const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]); 31080 function isTableElement(element) { 31081 return tableElements.has(getNodeName(element)); 31082 } 31083 const topLayerSelectors = [":popover-open", ":modal"]; 31084 function isTopLayer(element) { 31085 return topLayerSelectors.some((selector) => { 31086 try { 31087 return element.matches(selector); 31088 } catch (_e2) { 31089 return false; 31090 } 31091 }); 31092 } 31093 const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"]; 31094 const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"]; 31095 const containValues = ["paint", "layout", "strict", "content"]; 31096 function isContainingBlock(elementOrCss) { 31097 const webkit = isWebKit(); 31098 const css = isElement(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss; 31099 return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value)); 31100 } 31101 function getContainingBlock(element) { 31102 let currentNode = getParentNode(element); 31103 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 31104 if (isContainingBlock(currentNode)) { 31105 return currentNode; 31106 } else if (isTopLayer(currentNode)) { 31107 return null; 31108 } 31109 currentNode = getParentNode(currentNode); 31110 } 31111 return null; 31112 } 31113 function isWebKit() { 31114 if (typeof CSS === "undefined" || !CSS.supports) return false;
vendor: 2,454 bytes, lines 31115-31176
31115 return CSS.supports("-webkit-backdrop-filter", "none"); 31116 } 31117 const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]); 31118 function isLastTraversableNode(node2) { 31119 return lastTraversableNodeNames.has(getNodeName(node2)); 31120 } 31121 function getComputedStyle$2(element) { 31122 return getWindow(element).getComputedStyle(element); 31123 } 31124 function getNodeScroll(element) { 31125 if (isElement(element)) { 31126 return { 31127 scrollLeft: element.scrollLeft, 31128 scrollTop: element.scrollTop 31129 }; 31130 } 31131 return { 31132 scrollLeft: element.scrollX, 31133 scrollTop: element.scrollY 31134 }; 31135 } 31136 function getParentNode(node2) { 31137 if (getNodeName(node2) === "html") { 31138 return node2; 31139 } 31140 const result = ( 31141 // Step into the shadow DOM of the parent of a slotted node. 31142 node2.assignedSlot || // DOM Element detected. 31143 node2.parentNode || // ShadowRoot detected. 31144 isShadowRoot(node2) && node2.host || // Fallback. 31145 getDocumentElement(node2) 31146 ); 31147 return isShadowRoot(result) ? result.host : result; 31148 } 31149 function getNearestOverflowAncestor(node2) { 31150 const parentNode = getParentNode(node2); 31151 if (isLastTraversableNode(parentNode)) { 31152 return node2.ownerDocument ? node2.ownerDocument.body : node2.body; 31153 } 31154 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 31155 return parentNode; 31156 } 31157 return getNearestOverflowAncestor(parentNode); 31158 } 31159 function getOverflowAncestors(node2, list, traverseIframes) { 31160 var _node$ownerDocument2; 31161 if (list === void 0) { 31162 list = []; 31163 } 31164 if (traverseIframes === void 0) { 31165 traverseIframes = true; 31166 } 31167 const scrollableAncestor = getNearestOverflowAncestor(node2); 31168 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node2.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 31169 const win = getWindow(scrollableAncestor); 31170 if (isBody) { 31171 const frameElement = getFrameElement(win); 31172 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 31173 } 31174 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 31175 } 31176 function getFrameElement(win) {
31177 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 31178 } 31179 const min = Math.min; 31180 const max = Math.max; 31181 const round = Math.round; 31182 const floor = Math.floor; 31183 const createCoords = (v2) => ({ 31184 x: v2, 31185 y: v2 31186 }); 31187 const oppositeSideMap = { 31188 left: "right", 31189 right: "left", 31190 bottom: "top", 31191 top: "bottom" 31192 }; 31193 const oppositeAlignmentMap = { 31194 start: "end", 31195 end: "start" 31196 }; 31197 function clamp$1(start, value, end) { 31198 return max(start, min(value, end)); 31199 } 31200 function evaluate(value, param) { 31201 return typeof value === "function" ? value(param) : value; 31202 } 31203 function getSide(placement) { 31204 return placement.split("-")[0]; 31205 } 31206 function getAlignment(placement) { 31207 return placement.split("-")[1]; 31208 } 31209 function getOppositeAxis(axis) { 31210 return axis === "x" ? "y" : "x"; 31211 } 31212 function getAxisLength(axis) { 31213 return axis === "y" ? "height" : "width"; 31214 } 31215 const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]); 31216 function getSideAxis(placement) { 31217 return yAxisSides.has(getSide(placement)) ? "y" : "x"; 31218 } 31219 function getAlignmentAxis(placement) { 31220 return getOppositeAxis(getSideAxis(placement)); 31221 } 31222 function getAlignmentSides(placement, rects, rtl) { 31223 if (rtl === void 0) { 31224 rtl = false; 31225 } 31226 const alignment = getAlignment(placement); 31227 const alignmentAxis = getAlignmentAxis(placement); 31228 const length2 = getAxisLength(alignmentAxis); 31229 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 31230 if (rects.reference[length2] > rects.floating[length2]) { 31231 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 31232 } 31233 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 31234 } 31235 function getExpandedPlacements(placement) { 31236 const oppositePlacement = getOppositePlacement(placement); 31237 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 31238 } 31239 function getOppositeAlignmentPlacement(placement) { 31240 return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]); 31241 } 31242 const lrPlacement = ["left", "right"]; 31243 const rlPlacement = ["right", "left"]; 31244 const tbPlacement = ["top", "bottom"]; 31245 const btPlacement = ["bottom", "top"]; 31246 function getSideList(side, isStart, rtl) { 31247 switch (side) { 31248 case "top": 31249 case "bottom": 31250 if (rtl) return isStart ? rlPlacement : lrPlacement; 31251 return isStart ? lrPlacement : rlPlacement; 31252 case "left": 31253 case "right": 31254 return isStart ? tbPlacement : btPlacement; 31255 default: 31256 return []; 31257 } 31258 } 31259 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 31260 const alignment = getAlignment(placement); 31261 let list = getSideList(getSide(placement), direction === "start", rtl); 31262 if (alignment) { 31263 list = list.map((side) => side + "-" + alignment); 31264 if (flipAlignment) { 31265 list = list.concat(list.map(getOppositeAlignmentPlacement)); 31266 } 31267 } 31268 return list; 31269 } 31270 function getOppositePlacement(placement) { 31271 return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]); 31272 } 31273 function expandPaddingObject(padding) { 31274 return __spreadValues({ 31275 top: 0, 31276 right: 0, 31277 bottom: 0, 31278 left: 0 31279 }, padding); 31280 } 31281 function getPaddingObject(padding) { 31282 return typeof padding !== "number" ? expandPaddingObject(padding) : { 31283 top: padding, 31284 right: padding, 31285 bottom: padding, 31286 left: padding 31287 }; 31288 } 31289 function rectToClientRect(rect) { 31290 const { 31291 x: x2, 31292 y: y2, 31293 width, 31294 height 31295 } = rect; 31296 return { 31297 width, 31298 height, 31299 top: y2, 31300 left: x2, 31301 right: x2 + width, 31302 bottom: y2 + height, 31303 x: x2, 31304 y: y2 31305 }; 31306 } 31307 /*! 31308 * tabbable 6.3.0 31309 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE 31310 */ 31311 var candidateSelectors = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not
vendor: 5,381 bytes, lines 31311-31422
31311(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"]; 31312 var candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); 31313 var NoElement = typeof Element === "undefined"; 31314 var matches = NoElement ? function() { 31315 } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; 31316 var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { 31317 var _element$getRootNode; 31318 return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element); 31319 } : function(element) { 31320 return element === null || element === void 0 ? void 0 : element.ownerDocument; 31321 }; 31322 var _isInert = function isInert(node2, lookUp) { 31323 var _node$getAttribute; 31324 if (lookUp === void 0) { 31325 lookUp = true; 31326 } 31327 var inertAtt = node2 === null || node2 === void 0 ? void 0 : (_node$getAttribute = node2.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node2, "inert"); 31328 var inert = inertAtt === "" || inertAtt === "true"; 31329 var result = inert || lookUp && node2 && _isInert(node2.parentNode); 31330 return result; 31331 }; 31332 var isContentEditable = function isContentEditable2(node2) { 31333 var _node$getAttribute2; 31334 var attValue = node2 === null || node2 === void 0 ? void 0 : (_node$getAttribute2 = node2.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node2, "contenteditable"); 31335 return attValue === "" || attValue === "true"; 31336 }; 31337 var getCandidates = function getCandidates2(el, includeContainer, filter2) { 31338 if (_isInert(el)) { 31339 return []; 31340 } 31341 var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector)); 31342 if (includeContainer && matches.call(el, candidateSelector)) { 31343 candidates.unshift(el); 31344 } 31345 candidates = candidates.filter(filter2); 31346 return candidates; 31347 }; 31348 var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options2) { 31349 var candidates = []; 31350 var elementsToCheck = Array.from(elements); 31351 while (elementsToCheck.length) { 31352 var element = elementsToCheck.shift(); 31353 if (_isInert(element, false)) { 31354 continue; 31355 } 31356 if (element.tagName === "SLOT") { 31357 var assigned = element.assignedElements(); 31358 var content = assigned.length ? assigned : element.children; 31359 var nestedCandidates = _getCandidatesIteratively(content, true, options2); 31360 if (options2.flatten) { 31361 candidates.push.apply(candidates, nestedCandidates); 31362 } else { 31363 candidates.push({ 31364 scopeParent: element, 31365 candidates: nestedCandidates 31366 }); 31367 } 31368 } else { 31369 var validCandidate = matches.call(element, candidateSelector); 31370 if (validCandidate && options2.filter(element) && (includeContainer || !elements.includes(element))) { 31371 candidates.push(element); 31372 } 31373 var shadowRoot = element.shadowRoot || // check for an undisclosed shadow 31374 typeof options2.getShadowRoot === "function" && options2.getShadowRoot(element); 31375 var validShadowRoot = !_isInert(shadowRoot, false) && (!options2.shadowRootFilter || options2.shadowRootFilter(element)); 31376 if (shadowRoot && validShadowRoot) { 31377 var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options2); 31378 if (options2.flatten) { 31379 candidates.push.apply(candidates, _nestedCandidates); 31380 } else { 31381 candidates.push({ 31382 scopeParent: element, 31383 candidates: _nestedCandidates 31384 }); 31385 } 31386 } else { 31387 elementsToCheck.unshift.apply(elementsToCheck, element.children); 31388 } 31389 } 31390 } 31391 return candidates; 31392 }; 31393 var hasTabIndex = function hasTabIndex2(node2) { 31394 return !isNaN(parseInt(node2.getAttribute("tabindex"), 10)); 31395 }; 31396 var getTabIndex = function getTabIndex2(node2) { 31397 if (!node2) { 31398 throw new Error("No node provided"); 31399 } 31400 if (node2.tabIndex < 0) { 31401 if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node2.tagName) || isContentEditable(node2)) && !hasTabIndex(node2)) { 31402 return 0; 31403 } 31404 } 31405 return node2.tabIndex; 31406 }; 31407 var getSortOrderTabIndex = function getSortOrderTabIndex2(node2, isScope) { 31408 var tabIndex = getTabIndex(node2); 31409 if (tabIndex < 0 && isScope && !hasTabIndex(node2)) { 31410 return 0; 31411 } 31412 return tabIndex; 31413 }; 31414 var sortOrderedTabbables = function sortOrderedTabbables2(a2, b2) { 31415 return a2.tabIndex === b2.tabIndex ? a2.documentOrder - b2.documentOrder : a2.tabIndex - b2.tabIndex; 31416 }; 31417 var isInput = function isInput2(node2) { 31418 return node2.tagName === "INPUT"; 31419 }; 31420 var isHiddenInput = function isHiddenInput2(node2) { 31421 return isInput(node2) && node2.type === "hidden"; 31422 };
vendor: 8,888 bytes, lines 31423-31613
31423 var isDetailsWithSummary = function isDetailsWithSummary2(node2) { 31424 var r2 = node2.tagName === "DETAILS" && Array.prototype.slice.apply(node2.children).some(function(child) { 31425 return child.tagName === "SUMMARY"; 31426 }); 31427 return r2; 31428 }; 31429 var getCheckedRadio = function getCheckedRadio2(nodes, form) { 31430 for (var i2 = 0; i2 < nodes.length; i2++) { 31431 if (nodes[i2].checked && nodes[i2].form === form) { 31432 return nodes[i2]; 31433 } 31434 } 31435 }; 31436 var isTabbableRadio = function isTabbableRadio2(node2) { 31437 if (!node2.name) { 31438 return true; 31439 } 31440 var radioScope = node2.form || getRootNode(node2); 31441 var queryRadios = function queryRadios2(name) { 31442 return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); 31443 }; 31444 var radioSet; 31445 if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { 31446 radioSet = queryRadios(window.CSS.escape(node2.name)); 31447 } else { 31448 try { 31449 radioSet = queryRadios(node2.name); 31450 } catch (err) { 31451 console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message); 31452 return false; 31453 } 31454 } 31455 var checked = getCheckedRadio(radioSet, node2.form); 31456 return !checked || checked === node2; 31457 }; 31458 var isRadio = function isRadio2(node2) { 31459 return isInput(node2) && node2.type === "radio"; 31460 }; 31461 var isNonTabbableRadio = function isNonTabbableRadio2(node2) { 31462 return isRadio(node2) && !isTabbableRadio(node2); 31463 }; 31464 var isNodeAttached = function isNodeAttached2(node2) { 31465 var _nodeRoot; 31466 var nodeRoot = node2 && getRootNode(node2); 31467 var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host; 31468 var attached = false; 31469 if (nodeRoot && nodeRoot !== node2) { 31470 var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument; 31471 attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node2 !== null && node2 !== void 0 && (_node$ownerDocument = node2.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node2)); 31472 while (!attached && nodeRootHost) { 31473 var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD; 31474 nodeRoot = getRootNode(nodeRootHost); 31475 nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host; 31476 attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost)); 31477 } 31478 } 31479 return attached; 31480 }; 31481 var isZeroArea = function isZeroArea2(node2) { 31482 var _node$getBoundingClie = node2.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; 31483 return width === 0 && height === 0; 31484 }; 31485 var isHidden = function isHidden2(node2, _ref2) { 31486 var displayCheck = _ref2.displayCheck, getShadowRoot = _ref2.getShadowRoot; 31487 if (displayCheck === "full-native") { 31488 if ("checkVisibility" in node2) { 31489 var visible = node2.checkVisibility({ 31490 // Checking opacity might be desirable for some use cases, but natively, 31491 // opacity zero elements _are_ focusable and tabbable. 31492 checkOpacity: false, 31493 opacityProperty: false, 31494 contentVisibilityAuto: true, 31495 visibilityProperty: true, 31496 // This is an alias for `visibilityProperty`. Contemporary browsers 31497 // support both. However, this alias has wider browser support (Chrome 31498 // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so 31499 // we include it anyway. 31500 checkVisibilityCSS: true 31501 }); 31502 return !visible; 31503 } 31504 } 31505 if (getComputedStyle(node2).visibility === "hidden") { 31506 return true; 31507 } 31508 var isDirectSummary = matches.call(node2, "details>summary:first-of-type"); 31509 var nodeUnderDetails = isDirectSummary ? node2.parentElement : node2; 31510 if (matches.call(nodeUnderDetails, "details:not([open]) *")) { 31511 return true; 31512 } 31513 if (!displayCheck || displayCheck === "full" || // full-native can run this branch when it falls through in case 31514 // Element#checkVisibility is unsupported 31515 displayCheck === "full-native" || displayCheck === "legacy-full") { 31516 if (typeof getShadowRoot === "function") { 31517 var originalNode = node2; 31518 while (node2) { 31519 var parentElement = node2.parentElement; 31520 var rootNode = getRootNode(node2); 31521 if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) { 31522 return isZeroArea(node2); 31523 } else if (node2.assignedSlot) { 31524 node2 = node2.assignedSlot; 31525 } else if (!parentElement && rootNode !== node2.ownerDocument) { 31526 node2 = rootNode.host; 31527 } else { 31528 node2 = parentElement; 31529 } 31530 } 31531 node2 = originalNode; 31532 } 31533 if (isNodeAttached(node2)) { 31534 return !node2.getClientRects().length; 31535 } 31536 if (displayCheck !== "legacy-full") { 31537 return true; 31538 } 31539 } else if (displayCheck === "non-zero-area") { 31540 return isZeroArea(node2); 31541 } 31542 return false; 31543 }; 31544 var isDisabledFromFieldset = function isDisabledFromFieldset2(node2) { 31545 if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node2.tagName)) { 31546 var parentNode = node2.parentElement; 31547 while (parentNode) { 31548 if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { 31549 for (var i2 = 0; i2 < parentNode.children.length; i2++) { 31550 var child = parentNode.children.item(i2); 31551 if (child.tagName === "LEGEND") { 31552 return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node2); 31553 } 31554 } 31555 return true; 31556 } 31557 parentNode = parentNode.parentElement; 31558 } 31559 } 31560 return false; 31561 }; 31562 var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options2, node2) { 31563 if (node2.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor 31564 // because we're limited in the type of selectors we can use in JSDom (see related 31565 // note related to `candidateSelectors`) 31566 _isInert(node2) || isHiddenInput(node2) || isHidden(node2, options2) || // For a details element with a summary, the summary element gets the focus 31567 isDetailsWithSummary(node2) || isDisabledFromFieldset(node2)) { 31568 return false; 31569 } 31570 return true; 31571 }; 31572 var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options2, node2) { 31573 if (isNonTabbableRadio(node2) || getTabIndex(node2) < 0 || !isNodeMatchingSelectorFocusable(options2, node2)) { 31574 return false; 31575 } 31576 return true; 31577 }; 31578 var isShadowRootTabbable = function isShadowRootTabbable2(shadowHostNode) { 31579 var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10); 31580 if (isNaN(tabIndex) || tabIndex >= 0) { 31581 return true; 31582 } 31583 return false; 31584 }; 31585 var _sortByOrder = function sortByOrder(candidates) { 31586 var regularTabbables = []; 31587 var orderedTabbables = []; 31588 candidates.forEach(function(item, i2) { 31589 var isScope = !!item.scopeParent; 31590 var element = isScope ? item.scopeParent : item; 31591 var candidateTabindex = getSortOrderTabIndex(element, isScope); 31592 var elements = isScope ? _sortByOrder(item.candidates) : element; 31593 if (candidateTabindex === 0) { 31594 isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element); 31595 } else { 31596 orderedTabbables.push({ 31597 documentOrder: i2, 31598 tabIndex: candidateTabindex, 31599 item, 31600 isScope, 31601 content: elements 31602 }); 31603 } 31604 }); 31605 return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) { 31606 sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content); 31607 return acc; 31608 }, []).concat(regularTabbables); 31609 }; 31610 var tabbable = function tabbable2(container, options2) { 31611 options2 = options2 || {}; 31612 var candidates; 31613 if (options2.getShadowRoot) {
31614 candidates = _getCandidatesIteratively([container], options2.includeContainer, { 31615 filter: isNodeMatchingSelectorTabbable.bind(null, options2), 31616 flatten: false, 31617 getShadowRoot: options2.getShadowRoot, 31618 shadowRootFilter: isShadowRootTabbable 31619 }); 31620 } else { 31621 candidates = getCandidates(container, options2.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options2)); 31622 } 31623 return _sortByOrder(candidates); 31624 }; 31625 var focusable = function focusable2(container, options2) { 31626 options2 = options2 || {}; 31627 var candidates; 31628 if (options2.getShadowRoot) { 31629 candidates = _getCandidatesIteratively([container], options2.includeContainer, { 31630 filter: isNodeMatchingSelectorFocusable.bind(null, options2), 31631 flatten: true, 31632 getShadowRoot: options2.getShadowRoot 31633 }); 31634 } else { 31635 candidates = getCandidates(container, options2.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options2)); 31636 } 31637 return candidates; 31638 }; 31639 var isTabbable = function isTabbable2(node2, options2) { 31640 options2 = options2 || {}; 31641 if (!node2) { 31642 throw new Error("No node provided"); 31643 } 31644 if (matches.call(node2, candidateSelector) === false) { 31645 return false; 31646 } 31647 return isNodeMatchingSelectorTabbable(options2, node2); 31648 }; 31649 function getPlatform() { 31650 const uaData = navigator.userAgentData; 31651 if (uaData != null && uaData.platform) { 31652 return uaData.platform; 31653 } 31654 return navigator.platform; 31655 } 31656 function getUserAgent() { 31657 const uaData = navigator.userAgentData; 31658 if (uaData && Array.isArray(uaData.brands)) { 31659 return uaData.brands.map((_ref2) => { 31660 let { 31661 brand, 31662 version 31663 } = _ref2; 31664 return brand + "/" + version; 31665 }).join(" "); 31666 } 31667 return navigator.userAgent; 31668 } 31669 function isSafari() { 31670 return /apple/i.test(navigator.vendor); 31671 } 31672 function isAndroid() { 31673 const re2 = /android/i; 31674 return re2.test(getPlatform()) || re2.test(getUserAgent()); 31675 } 31676 function isMac() { 31677 return getPlatform().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints; 31678 } 31679 function isJSDOM() { 31680 return getUserAgent().includes("jsdom/"); 31681 } 31682 const FOCUSABLE_ATTRIBUTE$1 = "data-floating-ui-focusable"; 31683 const TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; 31684 function activeElement(doc) { 31685 let activeElement2 = doc.activeElement; 31686 while (((_activeElement = activeElement2) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) { 31687 var _activeElement; 31688 activeElement2 = activeElement2.shadowRoot.activeElement; 31689 } 31690 return activeElement2; 31691 } 31692 function contains$1(parent, child) { 31693 if (!parent || !child) { 31694 return false; 31695 } 31696 const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); 31697 if (parent.contains(child)) { 31698 return true; 31699 } 31700 if (rootNode && isShadowRoot(rootNode)) { 31701 let next2 = child; 31702 while (next2) { 31703 if (parent === next2) { 31704 return true; 31705 } 31706 next2 = next2.parentNode || next2.host; 31707 } 31708 } 31709 return false; 31710 } 31711 function getTarget$1(event) { 31712 if ("composedPath" in event) { 31713 return event.composedPath()[0]; 31714 } 31715 return event.target; 31716 } 31717 function isEventTargetWithin(event, node2) { 31718 if (node2 == null) { 31719 return false; 31720 } 31721 if ("composedPath" in event) { 31722 return event.composedPath().includes(node2); 31723 } 31724 const e2 = event; 31725 return e2.target != null && node2.contains(e2.target); 31726 } 31727 function isRootElement(element) { 31728 return element.matches("html,body"); 31729 } 31730 function getDocument$1(node2) { 31731 return (node2 == null ? void 0 : node2.ownerDocument) || document; 31732 } 31733 function isTypeableElement(element) { 31734 return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); 31735 } 31736 function isTypeableCombobox(element) { 31737 if (!element) return false;
31738 return element.getAttribute("role") === "combobox" && isTypeableElement(element); 31739 } 31740 function matchesFocusVisible(element) { 31741 if (!element || isJSDOM()) return true; 31742 try { 31743 return element.matches(":focus-visible"); 31744 } catch (_e2) { 31745 return true; 31746 } 31747 } 31748 function getFloatingFocusElement(floatingElement) { 31749 if (!floatingElement) { 31750 return null; 31751 } 31752 return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE$1) ? floatingElement : floatingElement.querySelector("[" + FOCUSABLE_ATTRIBUTE$1 + "]") || floatingElement; 31753 } 31754 function getNodeChildren$1(nodes, id2, onlyOpenChildren) { 31755 if (onlyOpenChildren === void 0) { 31756 onlyOpenChildren = true; 31757 } 31758 const directChildren = nodes.filter((node2) => { 31759 var _node$context; 31760 return node2.parentId === id2 && (!onlyOpenChildren || ((_node$context = node2.context) == null ? void 0 : _node$context.open)); 31761 }); 31762 return directChildren.flatMap((child) => [child, ...getNodeChildren$1(nodes, child.id, onlyOpenChildren)]); 31763 } 31764 function getNodeAncestors(nodes, id2) { 31765 var _nodes$find; 31766 let allAncestors = []; 31767 let currentParentId = (_nodes$find = nodes.find((node2) => node2.id === id2)) == null ? void 0 : _nodes$find.parentId; 31768 while (currentParentId) { 31769 const currentNode = nodes.find((node2) => node2.id === currentParentId); 31770 currentParentId = currentNode == null ? void 0 : currentNode.parentId; 31771 if (currentNode) { 31772 allAncestors = allAncestors.concat(currentNode); 31773 } 31774 } 31775 return allAncestors; 31776 } 31777 function stopEvent(event) { 31778 event.preventDefault(); 31779 event.stopPropagation(); 31780 } 31781 function isReactEvent(event) { 31782 return "nativeEvent" in event; 31783 } 31784 function isVirtualClick(event) { 31785 if (event.mozInputSource === 0 && event.isTrusted) { 31786 return true; 31787 } 31788 if (isAndroid() && event.pointerType) { 31789 return event.type === "click" && event.buttons === 1; 31790 } 31791 return event.detail === 0 && !event.pointerType; 31792 } 31793 function isVirtualPointerEvent(event) { 31794 if (isJSDOM()) return false; 31795 return !isAndroid() && event.width === 0 && event.height === 0 || isAndroid() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse" || // iOS VoiceOver returns 0.333⢠for width/height. 31796 event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "touch"; 31797 } 31798 function isMouseLikePointerType(pointerType, strict2) { 31799 const values = ["mouse", "pen"]; 31800 { 31801 values.push("", void 0); 31802 } 31803 return values.includes(pointerType); 31804 } 31805 var isClient$1 = typeof document !== "undefined"; 31806 var noop$6 = function noop2() { 31807 }; 31808 var index$1 = isClient$1 ? reactExports.useLayoutEffect : noop$6; 31809 const SafeReact$1 = __spreadValues({}, React); 31810 function useLatestRef$1(value) { 31811 const ref = reactExports.useRef(value); 31812 index$1(() => { 31813 ref.current = value; 31814 }); 31815 return ref; 31816 } 31817 const useInsertionEffect = SafeReact$1.useInsertionEffect; 31818 const useSafeInsertionEffect = useInsertionEffect || ((fn2) => fn2()); 31819 function useEffectEvent(callback) { 31820 const ref = reactExports.useRef(() => { 31821 }); 31822 useSafeInsertionEffect(() => { 31823 ref.current = callback; 31824 }); 31825 return reactExports.useCallback(function() { 31826 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 31827 args[_key] = arguments[_key]; 31828 } 31829 return ref.current == null ? void 0 : ref.current(...args); 31830 }, []); 31831 } 31832 const getTabbableOptions = () => ({ 31833 getShadowRoot: true, 31834 displayCheck: ( 31835 // JSDOM does not support the `tabbable` library. To solve this we can 31836 // check if `ResizeObserver` is a real function (not polyfilled), which 31837 // determines if the current environment is JSDOM-like. 31838 typeof ResizeObserver === "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none" 31839 ) 31840 }); 31841 function getTabbableIn(container, dir) { 31842 const list = tabbable(container, getTabbableOptions()); 31843 const len = list.length; 31844 if (len === 0) return; 31845 const active = activeElement(getDocument$1(container)); 31846 const index2 = list.indexOf(active); 31847 const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; 31848 return list[nextIndex]; 31849 } 31850 function getNextTabbable(referenceElement) { 31851 return getTabbableIn(getDocument$1(referenceElement).body, 1) || referenceElement; 31852 } 31853 function getPreviousTabbable(referenceElement) { 31854 return getTabbableIn(getDocument$1(referenceElement).body, -1) || referenceElement; 31855 } 31856 function isOutsideEvent(event, container) { 31857 const containerElement = container || event.currentTarget; 31858 const relatedTarget = event.relatedTarget; 31859 return !relatedTarget || !contains$1(containerElement, relatedTarget); 31860 } 31861 function disableFocusInside(container) { 31862 const tabbableElements = tabbable(container, getTabbableOptions());
31863 tabbableElements.forEach((element) => { 31864 element.dataset.tabindex = element.getAttribute("tabindex") || ""; 31865 element.setAttribute("tabindex", "-1"); 31866 }); 31867 } 31868 function enableFocusInside(container) { 31869 const elements = container.querySelectorAll("[data-tabindex]"); 31870 elements.forEach((element) => { 31871 const tabindex = element.dataset.tabindex; 31872 delete element.dataset.tabindex; 31873 if (tabindex) { 31874 element.setAttribute("tabindex", tabindex); 31875 } else { 31876 element.removeAttribute("tabindex"); 31877 } 31878 }); 31879 } 31880 function computeCoordsFromPlacement(_ref2, placement, rtl) { 31881 let { 31882 reference, 31883 floating 31884 } = _ref2; 31885 const sideAxis = getSideAxis(placement); 31886 const alignmentAxis = getAlignmentAxis(placement); 31887 const alignLength = getAxisLength(alignmentAxis); 31888 const side = getSide(placement); 31889 const isVertical = sideAxis === "y"; 31890 const commonX = reference.x + reference.width / 2 - floating.width / 2; 31891 const commonY = reference.y + reference.height / 2 - floating.height / 2; 31892 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 31893 let coords; 31894 switch (side) { 31895 case "top": 31896 coords = { 31897 x: commonX, 31898 y: reference.y - floating.height 31899 }; 31900 break; 31901 case "bottom": 31902 coords = { 31903 x: commonX, 31904 y: reference.y + reference.height 31905 }; 31906 break; 31907 case "right": 31908 coords = { 31909 x: reference.x + reference.width, 31910 y: commonY 31911 }; 31912 break; 31913 case "left": 31914 coords = { 31915 x: reference.x - floating.width, 31916 y: commonY 31917 }; 31918 break; 31919 default: 31920 coords = { 31921 x: reference.x, 31922 y: reference.y 31923 }; 31924 } 31925 switch (getAlignment(placement)) { 31926 case "start": 31927 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 31928 break; 31929 case "end": 31930 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 31931 break; 31932 } 31933 return coords; 31934 } 31935 const computePosition$1 = (reference, floating, config) => __async(null, null, function* () { 31936 const { 31937 placement = "bottom", 31938 strategy = "absolute", 31939 middleware: middleware2 = [], 31940 platform: platform2 31941 } = config; 31942 const validMiddleware = middleware2.filter(Boolean); 31943 const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(floating); 31944 let rects = yield platform2.getElementRects({ 31945 reference, 31946 floating, 31947 strategy 31948 }); 31949 let { 31950 x: x2, 31951 y: y2 31952 } = computeCoordsFromPlacement(rects, placement, rtl); 31953 let statefulPlacement = placement; 31954 let middlewareData = {}; 31955 let resetCount = 0; 31956 for (let i2 = 0; i2 < validMiddleware.length; i2++) { 31957 const { 31958 name, 31959 fn: fn2 31960 } = validMiddleware[i2]; 31961 const { 31962 x: nextX, 31963 y: nextY, 31964 data, 31965 reset 31966 } = yield fn2({ 31967 x: x2, 31968 y: y2, 31969 initialPlacement: placement, 31970 placement: statefulPlacement, 31971 strategy, 31972 middlewareData, 31973 rects, 31974 platform: platform2, 31975 elements: { 31976 reference, 31977 floating 31978 } 31979 }); 31980 x2 = nextX != null ? nextX : x2; 31981 y2 = nextY != null ? nextY : y2; 31982 middlewareData = __spreadProps(__spreadValues({}, middlewareData), { 31983 [name]: __spreadValues(__spreadValues({}, middlewareData[name]), data) 31984 }); 31985 if (reset && resetCount <= 50) { 31986 resetCount++; 31987 if (typeof reset === "object") { 31988 if (reset.placement) { 31989 statefulPlacement = reset.placement; 31990 } 31991 if (reset.rects) { 31992 rects = reset.rects === true ? yield platform2.getElementRects({ 31993 reference, 31994 floating, 31995 strategy 31996 }) : reset.rects; 31997 } 31998 ({ 31999 x: x2, 32000 y: y2 32001 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 32002 } 32003 i2 = -1; 32004 } 32005 } 32006 return { 32007 x: x2, 32008 y: y2, 32009 placement: statefulPlacement, 32010 strategy, 32011 middlewareData 32012 }; 32013 }); 32014 function detectOverflow(state, options2) { 32015 return __async(this, null, function* () { 32016 var _await$platform$isEle; 32017 if (options2 === void 0) { 32018 options2 = {}; 32019 } 32020 const { 32021 x: x2, 32022 y: y2, 32023 platform: platform2, 32024 rects, 32025 elements, 32026 strategy 32027 } = state; 32028 const { 32029 boundary = "clippingAncestors", 32030 rootBoundary = "viewport", 32031 elementContext = "floating", 32032 altBoundary = false, 32033 padding = 0 32034 } = evaluate(options2, state);
32035 const paddingObject = getPaddingObject(padding); 32036 const altContext = elementContext === "floating" ? "reference" : "floating"; 32037 const element = elements[altBoundary ? altContext : elementContext]; 32038 const clippingClientRect = rectToClientRect(yield platform2.getClippingRect({ 32039 element: ((_await$platform$isEle = yield platform2.isElement == null ? void 0 : platform2.isElement(element)) != null ? _await$platform$isEle : true) ? element : element.contextElement || (yield platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)), 32040 boundary, 32041 rootBoundary, 32042 strategy 32043 })); 32044 const rect = elementContext === "floating" ? { 32045 x: x2, 32046 y: y2, 32047 width: rects.floating.width, 32048 height: rects.floating.height 32049 } : rects.reference; 32050 const offsetParent = yield platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating); 32051 const offsetScale = (yield platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? (yield platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || { 32052 x: 1, 32053 y: 1 32054 } : { 32055 x: 1, 32056 y: 1 32057 }; 32058 const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? yield platform2.convertOffsetParentRelativeRectToViewportRelativeRect({ 32059 elements, 32060 rect, 32061 offsetParent, 32062 strategy 32063 }) : rect); 32064 return { 32065 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 32066 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 32067 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 32068 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 32069 }; 32070 }); 32071 } 32072 const flip$2 = function(options2) { 32073 if (options2 === void 0) { 32074 options2 = {}; 32075 } 32076 return { 32077 name: "flip", 32078 options: options2, 32079 fn(state) { 32080 return __async(this, null, function* () { 32081 var _middlewareData$arrow, _middlewareData$flip; 32082 const { 32083 placement, 32084 middlewareData, 32085 rects, 32086 initialPlacement, 32087 platform: platform2, 32088 elements 32089 } = state; 32090 const _a2 = evaluate(options2, state), { 32091 mainAxis: checkMainAxis = true, 32092 crossAxis: checkCrossAxis = true, 32093 fallbackPlacements: specifiedFallbackPlacements, 32094 fallbackStrategy = "bestFit", 32095 fallbackAxisSideDirection = "none", 32096 flipAlignment = true 32097 } = _a2, detectOverflowOptions = __objRest(_a2, [ 32098 "mainAxis", 32099 "crossAxis", 32100 "fallbackPlacements", 32101 "fallbackStrategy", 32102 "fallbackAxisSideDirection", 32103 "flipAlignment" 32104 ]); 32105 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 32106 return {}; 32107 } 32108 const side = getSide(placement); 32109 const initialSideAxis = getSideAxis(initialPlacement); 32110 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 32111 const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating); 32112 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 32113 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 32114 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 32115 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 32116 } 32117 const placements = [initialPlacement, ...fallbackPlacements]; 32118 const overflow = yield detectOverflow(state, detectOverflowOptions); 32119 const overflows = []; 32120 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 32121 if (checkMainAxis) { 32122 overflows.push(overflow[side]); 32123 } 32124 if (checkCrossAxis) { 32125 const sides = getAlignmentSides(placement, rects, rtl); 32126 overflows.push(overflow[sides[0]], overflow[sides[1]]); 32127 } 32128 overflowsData = [...overflowsData, { 32129 placement, 32130 overflows 32131 }]; 32132 if (!overflows.every((side2) => side2 <= 0)) { 32133 var _middlewareData$flip2, _overflowsData$filter; 32134 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 32135 const nextPlacement = placements[nextIndex]; 32136 if (nextPlacement) { 32137 const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
32138 if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis 32139 // overflows the main axis. 32140 overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) { 32141 return { 32142 data: { 32143 index: nextIndex, 32144 overflows: overflowsData 32145 }, 32146 reset: { 32147 placement: nextPlacement 32148 } 32149 }; 32150 } 32151 } 32152 let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 32153 if (!resetPlacement) { 32154 switch (fallbackStrategy) { 32155 case "bestFit": { 32156 var _overflowsData$filter2; 32157 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => { 32158 if (hasFallbackAxisSideDirection) { 32159 const currentSideAxis = getSideAxis(d2.placement); 32160 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 32161 // reading directions favoring greater width. 32162 currentSideAxis === "y"; 32163 } 32164 return true; 32165 }).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 32166 if (placement2) { 32167 resetPlacement = placement2; 32168 } 32169 break; 32170 } 32171 case "initialPlacement": 32172 resetPlacement = initialPlacement; 32173 break; 32174 } 32175 } 32176 if (placement !== resetPlacement) { 32177 return { 32178 reset: { 32179 placement: resetPlacement 32180 } 32181 }; 32182 } 32183 } 32184 return {}; 32185 }); 32186 } 32187 }; 32188 }; 32189 const originSides = /* @__PURE__ */ new Set(["left", "top"]); 32190 function convertValueToCoords(state, options2) { 32191 return __async(this, null, function* () { 32192 const { 32193 placement, 32194 platform: platform2, 32195 elements 32196 } = state; 32197 const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating); 32198 const side = getSide(placement); 32199 const alignment = getAlignment(placement); 32200 const isVertical = getSideAxis(placement) === "y"; 32201 const mainAxisMulti = originSides.has(side) ? -1 : 1; 32202 const crossAxisMulti = rtl && isVertical ? -1 : 1; 32203 const rawValue = evaluate(options2, state); 32204 let { 32205 mainAxis, 32206 crossAxis, 32207 alignmentAxis 32208 } = typeof rawValue === "number" ? { 32209 mainAxis: rawValue, 32210 crossAxis: 0, 32211 alignmentAxis: null 32212 } : { 32213 mainAxis: rawValue.mainAxis || 0, 32214 crossAxis: rawValue.crossAxis || 0, 32215 alignmentAxis: rawValue.alignmentAxis 32216 }; 32217 if (alignment && typeof alignmentAxis === "number") { 32218 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 32219 } 32220 return isVertical ? { 32221 x: crossAxis * crossAxisMulti, 32222 y: mainAxis * mainAxisMulti 32223 } : { 32224 x: mainAxis * mainAxisMulti, 32225 y: crossAxis * crossAxisMulti 32226 }; 32227 }); 32228 } 32229 const offset$2 = function(options2) { 32230 if (options2 === void 0) { 32231 options2 = 0; 32232 } 32233 return { 32234 name: "offset", 32235 options: options2, 32236 fn(state) { 32237 return __async(this, null, function* () { 32238 var _middlewareData$offse, _middlewareData$arrow; 32239 const { 32240 x: x2, 32241 y: y2, 32242 placement, 32243 middlewareData 32244 } = state; 32245 const diffCoords = yield convertValueToCoords(state, options2); 32246 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 32247 return {}; 32248 } 32249 return { 32250 x: x2 + diffCoords.x, 32251 y: y2 + diffCoords.y, 32252 data: __spreadProps(__spreadValues({}, diffCoords), { 32253 placement 32254 }) 32255 }; 32256 }); 32257 } 32258 }; 32259 }; 32260 const shift$2 = function(options2) { 32261 if (options2 === void 0) { 32262 options2 = {}; 32263 } 32264 return { 32265 name: "shift", 32266 options: options2, 32267 fn(state) { 32268 return __async(this, null, function* () { 32269 const { 32270 x: x2, 32271 y: y2, 32272 placement 32273 } = state; 32274 const _a2 = evaluate(options2, state), { 32275 mainAxis: checkMainAxis = true, 32276 crossAxis: checkCrossAxis = false, 32277 limiter = {
32278 fn: (_ref2) => { 32279 let { 32280 x: x3, 32281 y: y3 32282 } = _ref2; 32283 return { 32284 x: x3, 32285 y: y3 32286 }; 32287 } 32288 } 32289 } = _a2, detectOverflowOptions = __objRest(_a2, [ 32290 "mainAxis", 32291 "crossAxis", 32292 "limiter" 32293 ]); 32294 const coords = { 32295 x: x2, 32296 y: y2 32297 }; 32298 const overflow = yield detectOverflow(state, detectOverflowOptions); 32299 const crossAxis = getSideAxis(getSide(placement)); 32300 const mainAxis = getOppositeAxis(crossAxis); 32301 let mainAxisCoord = coords[mainAxis]; 32302 let crossAxisCoord = coords[crossAxis]; 32303 if (checkMainAxis) { 32304 const minSide = mainAxis === "y" ? "top" : "left"; 32305 const maxSide = mainAxis === "y" ? "bottom" : "right"; 32306 const min2 = mainAxisCoord + overflow[minSide]; 32307 const max2 = mainAxisCoord - overflow[maxSide]; 32308 mainAxisCoord = clamp$1(min2, mainAxisCoord, max2); 32309 } 32310 if (checkCrossAxis) { 32311 const minSide = crossAxis === "y" ? "top" : "left"; 32312 const maxSide = crossAxis === "y" ? "bottom" : "right"; 32313 const min2 = crossAxisCoord + overflow[minSide]; 32314 const max2 = crossAxisCoord - overflow[maxSide]; 32315 crossAxisCoord = clamp$1(min2, crossAxisCoord, max2); 32316 } 32317 const limitedCoords = limiter.fn(__spreadProps(__spreadValues({}, state), { 32318 [mainAxis]: mainAxisCoord, 32319 [crossAxis]: crossAxisCoord 32320 })); 32321 return __spreadProps(__spreadValues({}, limitedCoords), { 32322 data: { 32323 x: limitedCoords.x - x2, 32324 y: limitedCoords.y - y2, 32325 enabled: { 32326 [mainAxis]: checkMainAxis, 32327 [crossAxis]: checkCrossAxis 32328 } 32329 } 32330 }); 32331 }); 32332 } 32333 }; 32334 }; 32335 function getCssDimensions(element) { 32336 const css = getComputedStyle$2(element); 32337 let width = parseFloat(css.width) || 0; 32338 let height = parseFloat(css.height) || 0; 32339 const hasOffset = isHTMLElement(element); 32340 const offsetWidth = hasOffset ? element.offsetWidth : width; 32341 const offsetHeight = hasOffset ? element.offsetHeight : height; 32342 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 32343 if (shouldFallback) { 32344 width = offsetWidth; 32345 height = offsetHeight; 32346 } 32347 return { 32348 width, 32349 height, 32350 $: shouldFallback 32351 }; 32352 } 32353 function unwrapElement(element) { 32354 return !isElement(element) ? element.contextElement : element; 32355 } 32356 function getScale(element) { 32357 const domElement = unwrapElement(element); 32358 if (!isHTMLElement(domElement)) { 32359 return createCoords(1); 32360 } 32361 const rect = domElement.getBoundingClientRect(); 32362 const { 32363 width, 32364 height, 32365 $: $2 32366 } = getCssDimensions(domElement); 32367 let x2 = ($2 ? round(rect.width) : rect.width) / width; 32368 let y2 = ($2 ? round(rect.height) : rect.height) / height; 32369 if (!x2 || !Number.isFinite(x2)) { 32370 x2 = 1; 32371 } 32372 if (!y2 || !Number.isFinite(y2)) { 32373 y2 = 1; 32374 } 32375 return { 32376 x: x2, 32377 y: y2 32378 }; 32379 } 32380 const noOffsets = /* @__PURE__ */ createCoords(0); 32381 function getVisualOffsets(element) { 32382 const win = getWindow(element); 32383 if (!isWebKit() || !win.visualViewport) { 32384 return noOffsets; 32385 } 32386 return { 32387 x: win.visualViewport.offsetLeft, 32388 y: win.visualViewport.offsetTop 32389 }; 32390 } 32391 function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 32392 if (isFixed === void 0) { 32393 isFixed = false; 32394 } 32395 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { 32396 return false;
vendor: 5,338 bytes, lines 32397-32531
32397 } 32398 return isFixed; 32399 } 32400 function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 32401 if (includeScale === void 0) { 32402 includeScale = false; 32403 } 32404 if (isFixedStrategy === void 0) { 32405 isFixedStrategy = false; 32406 } 32407 const clientRect = element.getBoundingClientRect(); 32408 const domElement = unwrapElement(element); 32409 let scale2 = createCoords(1); 32410 if (includeScale) { 32411 if (offsetParent) { 32412 if (isElement(offsetParent)) { 32413 scale2 = getScale(offsetParent); 32414 } 32415 } else { 32416 scale2 = getScale(element); 32417 } 32418 } 32419 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 32420 let x2 = (clientRect.left + visualOffsets.x) / scale2.x; 32421 let y2 = (clientRect.top + visualOffsets.y) / scale2.y; 32422 let width = clientRect.width / scale2.x; 32423 let height = clientRect.height / scale2.y; 32424 if (domElement) { 32425 const win = getWindow(domElement); 32426 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 32427 let currentWin = win; 32428 let currentIFrame = getFrameElement(currentWin); 32429 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 32430 const iframeScale = getScale(currentIFrame); 32431 const iframeRect = currentIFrame.getBoundingClientRect(); 32432 const css = getComputedStyle$2(currentIFrame); 32433 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 32434 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 32435 x2 *= iframeScale.x; 32436 y2 *= iframeScale.y; 32437 width *= iframeScale.x; 32438 height *= iframeScale.y; 32439 x2 += left; 32440 y2 += top; 32441 currentWin = getWindow(currentIFrame); 32442 currentIFrame = getFrameElement(currentWin); 32443 } 32444 } 32445 return rectToClientRect({ 32446 width, 32447 height, 32448 x: x2, 32449 y: y2 32450 }); 32451 } 32452 function getWindowScrollBarX(element, rect) { 32453 const leftScroll = getNodeScroll(element).scrollLeft; 32454 if (!rect) { 32455 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 32456 } 32457 return rect.left + leftScroll; 32458 } 32459 function getHTMLOffset(documentElement, scroll) { 32460 const htmlRect = documentElement.getBoundingClientRect(); 32461 const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 32462 const y2 = htmlRect.top + scroll.scrollTop; 32463 return { 32464 x: x2, 32465 y: y2 32466 }; 32467 } 32468 function convertOffsetParentRelativeRectToViewportRelativeRect(_ref2) { 32469 let { 32470 elements, 32471 rect, 32472 offsetParent, 32473 strategy 32474 } = _ref2; 32475 const isFixed = strategy === "fixed"; 32476 const documentElement = getDocumentElement(offsetParent); 32477 const topLayer = elements ? isTopLayer(elements.floating) : false; 32478 if (offsetParent === documentElement || topLayer && isFixed) { 32479 return rect; 32480 } 32481 let scroll = { 32482 scrollLeft: 0, 32483 scrollTop: 0 32484 }; 32485 let scale2 = createCoords(1); 32486 const offsets = createCoords(0); 32487 const isOffsetParentAnElement = isHTMLElement(offsetParent); 32488 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 32489 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 32490 scroll = getNodeScroll(offsetParent); 32491 } 32492 if (isHTMLElement(offsetParent)) { 32493 const offsetRect = getBoundingClientRect(offsetParent); 32494 scale2 = getScale(offsetParent); 32495 offsets.x = offsetRect.x + offsetParent.clientLeft; 32496 offsets.y = offsetRect.y + offsetParent.clientTop; 32497 } 32498 } 32499 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 32500 return { 32501 width: rect.width * scale2.x, 32502 height: rect.height * scale2.y, 32503 x: rect.x * scale2.x - scroll.scrollLeft * scale2.x + offsets.x + htmlOffset.x, 32504 y: rect.y * scale2.y - scroll.scrollTop * scale2.y + offsets.y + htmlOffset.y 32505 }; 32506 } 32507 function getClientRects(element) { 32508 return Array.from(element.getClientRects()); 32509 } 32510 function getDocumentRect(element) { 32511 const html2 = getDocumentElement(element); 32512 const scroll = getNodeScroll(element); 32513 const body = element.ownerDocument.body; 32514 const width = max(html2.scrollWidth, html2.clientWidth, body.scrollWidth, body.clientWidth); 32515 const height = max(html2.scrollHeight, html2.clientHeight, body.scrollHeight, body.clientHeight); 32516 let x2 = -scroll.scrollLeft + getWindowScrollBarX(element); 32517 const y2 = -scroll.scrollTop; 32518 if (getComputedStyle$2(body).direction === "rtl") { 32519 x2 += max(html2.clientWidth, body.clientWidth) - width; 32520 } 32521 return { 32522 width, 32523 height, 32524 x: x2, 32525 y: y2 32526 }; 32527 } 32528 const SCROLLBAR_MAX = 25; 32529 function getViewportRect(element, strategy) { 32530 const win = getWindow(element); 32531 const html2 = getDocumentElement(element);
vendor: 4,670 bytes, lines 32532-32634
32532 const visualViewport = win.visualViewport; 32533 let width = html2.clientWidth; 32534 let height = html2.clientHeight; 32535 let x2 = 0; 32536 let y2 = 0; 32537 if (visualViewport) { 32538 width = visualViewport.width; 32539 height = visualViewport.height; 32540 const visualViewportBased = isWebKit(); 32541 if (!visualViewportBased || visualViewportBased && strategy === "fixed") { 32542 x2 = visualViewport.offsetLeft; 32543 y2 = visualViewport.offsetTop; 32544 } 32545 } 32546 const windowScrollbarX = getWindowScrollBarX(html2); 32547 if (windowScrollbarX <= 0) { 32548 const doc = html2.ownerDocument; 32549 const body = doc.body; 32550 const bodyStyles = getComputedStyle(body); 32551 const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 32552 const clippingStableScrollbarWidth = Math.abs(html2.clientWidth - body.clientWidth - bodyMarginInline); 32553 if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { 32554 width -= clippingStableScrollbarWidth; 32555 } 32556 } else if (windowScrollbarX <= SCROLLBAR_MAX) { 32557 width += windowScrollbarX; 32558 } 32559 return { 32560 width, 32561 height, 32562 x: x2, 32563 y: y2 32564 }; 32565 } 32566 const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]); 32567 function getInnerBoundingClientRect(element, strategy) { 32568 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 32569 const top = clientRect.top + element.clientTop; 32570 const left = clientRect.left + element.clientLeft; 32571 const scale2 = isHTMLElement(element) ? getScale(element) : createCoords(1); 32572 const width = element.clientWidth * scale2.x; 32573 const height = element.clientHeight * scale2.y; 32574 const x2 = left * scale2.x; 32575 const y2 = top * scale2.y; 32576 return { 32577 width, 32578 height, 32579 x: x2, 32580 y: y2 32581 }; 32582 } 32583 function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 32584 let rect; 32585 if (clippingAncestor === "viewport") { 32586 rect = getViewportRect(element, strategy); 32587 } else if (clippingAncestor === "document") { 32588 rect = getDocumentRect(getDocumentElement(element)); 32589 } else if (isElement(clippingAncestor)) { 32590 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 32591 } else { 32592 const visualOffsets = getVisualOffsets(element); 32593 rect = { 32594 x: clippingAncestor.x - visualOffsets.x, 32595 y: clippingAncestor.y - visualOffsets.y, 32596 width: clippingAncestor.width, 32597 height: clippingAncestor.height 32598 }; 32599 } 32600 return rectToClientRect(rect); 32601 } 32602 function hasFixedPositionAncestor(element, stopNode) { 32603 const parentNode = getParentNode(element); 32604 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 32605 return false; 32606 } 32607 return getComputedStyle$2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); 32608 } 32609 function getClippingElementAncestors(element, cache) { 32610 const cachedResult = cache.get(element); 32611 if (cachedResult) { 32612 return cachedResult; 32613 } 32614 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 32615 let currentContainingBlockComputedStyle = null; 32616 const elementIsFixed = getComputedStyle$2(element).position === "fixed"; 32617 let currentNode = elementIsFixed ? getParentNode(element) : element; 32618 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 32619 const computedStyle = getComputedStyle$2(currentNode); 32620 const currentNodeIsContaining = isContainingBlock(currentNode); 32621 if (!currentNodeIsContaining && computedStyle.position === "fixed") { 32622 currentContainingBlockComputedStyle = null; 32623 } 32624 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 32625 if (shouldDropCurrentNode) { 32626 result = result.filter((ancestor) => ancestor !== currentNode); 32627 } else { 32628 currentContainingBlockComputedStyle = computedStyle; 32629 } 32630 currentNode = getParentNode(currentNode); 32631 } 32632 cache.set(element, result); 32633 return result; 32634 }
vendor: 10,177 bytes, lines 32635-32910
32635 function getClippingRect(_ref2) { 32636 let { 32637 element, 32638 boundary, 32639 rootBoundary, 32640 strategy 32641 } = _ref2; 32642 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 32643 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 32644 const firstClippingAncestor = clippingAncestors[0]; 32645 const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { 32646 const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); 32647 accRect.top = max(rect.top, accRect.top); 32648 accRect.right = min(rect.right, accRect.right); 32649 accRect.bottom = min(rect.bottom, accRect.bottom); 32650 accRect.left = max(rect.left, accRect.left); 32651 return accRect; 32652 }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); 32653 return { 32654 width: clippingRect.right - clippingRect.left, 32655 height: clippingRect.bottom - clippingRect.top, 32656 x: clippingRect.left, 32657 y: clippingRect.top 32658 }; 32659 } 32660 function getDimensions(element) { 32661 const { 32662 width, 32663 height 32664 } = getCssDimensions(element); 32665 return { 32666 width, 32667 height 32668 }; 32669 } 32670 function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 32671 const isOffsetParentAnElement = isHTMLElement(offsetParent); 32672 const documentElement = getDocumentElement(offsetParent); 32673 const isFixed = strategy === "fixed"; 32674 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 32675 let scroll = { 32676 scrollLeft: 0, 32677 scrollTop: 0 32678 }; 32679 const offsets = createCoords(0); 32680 function setLeftRTLScrollbarOffset() { 32681 offsets.x = getWindowScrollBarX(documentElement); 32682 } 32683 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 32684 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 32685 scroll = getNodeScroll(offsetParent); 32686 } 32687 if (isOffsetParentAnElement) { 32688 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 32689 offsets.x = offsetRect.x + offsetParent.clientLeft; 32690 offsets.y = offsetRect.y + offsetParent.clientTop; 32691 } else if (documentElement) { 32692 setLeftRTLScrollbarOffset(); 32693 } 32694 } 32695 if (isFixed && !isOffsetParentAnElement && documentElement) { 32696 setLeftRTLScrollbarOffset(); 32697 } 32698 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 32699 const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 32700 const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 32701 return { 32702 x: x2, 32703 y: y2, 32704 width: rect.width, 32705 height: rect.height 32706 }; 32707 } 32708 function isStaticPositioned(element) { 32709 return getComputedStyle$2(element).position === "static"; 32710 } 32711 function getTrueOffsetParent(element, polyfill) { 32712 if (!isHTMLElement(element) || getComputedStyle$2(element).position === "fixed") { 32713 return null; 32714 } 32715 if (polyfill) { 32716 return polyfill(element); 32717 } 32718 let rawOffsetParent = element.offsetParent; 32719 if (getDocumentElement(element) === rawOffsetParent) { 32720 rawOffsetParent = rawOffsetParent.ownerDocument.body; 32721 } 32722 return rawOffsetParent; 32723 } 32724 function getOffsetParent(element, polyfill) { 32725 const win = getWindow(element); 32726 if (isTopLayer(element)) { 32727 return win; 32728 } 32729 if (!isHTMLElement(element)) { 32730 let svgOffsetParent = getParentNode(element); 32731 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 32732 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 32733 return svgOffsetParent; 32734 } 32735 svgOffsetParent = getParentNode(svgOffsetParent); 32736 } 32737 return win; 32738 } 32739 let offsetParent = getTrueOffsetParent(element, polyfill); 32740 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 32741 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 32742 } 32743 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 32744 return win; 32745 } 32746 return offsetParent || getContainingBlock(element) || win; 32747 } 32748 const getElementRects = function(data) { 32749 return __async(this, null, function* () { 32750 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 32751 const getDimensionsFn = this.getDimensions; 32752 const floatingDimensions = yield getDimensionsFn(data.floating); 32753 return { 32754 reference: getRectRelativeToOffsetParent(data.reference, yield getOffsetParentFn(data.floating), data.strategy), 32755 floating: { 32756 x: 0, 32757 y: 0, 32758 width: floatingDimensions.width, 32759 height: floatingDimensions.height 32760 } 32761 }; 32762 }); 32763 }; 32764 function isRTL(element) { 32765 return getComputedStyle$2(element).direction === "rtl"; 32766 } 32767 const platform = { 32768 convertOffsetParentRelativeRectToViewportRelativeRect, 32769 getDocumentElement, 32770 getClippingRect, 32771 getOffsetParent, 32772 getElementRects, 32773 getClientRects, 32774 getDimensions, 32775 getScale, 32776 isElement, 32777 isRTL 32778 }; 32779 function rectsAreEqual(a2, b2) { 32780 return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height; 32781 } 32782 function observeMove(element, onMove) { 32783 let io2 = null; 32784 let timeoutId; 32785 const root2 = getDocumentElement(element); 32786 function cleanup() { 32787 var _io; 32788 clearTimeout(timeoutId); 32789 (_io = io2) == null || _io.disconnect(); 32790 io2 = null; 32791 } 32792 function refresh(skip, threshold) { 32793 if (skip === void 0) { 32794 skip = false; 32795 } 32796 if (threshold === void 0) { 32797 threshold = 1; 32798 } 32799 cleanup(); 32800 const elementRectForRootMargin = element.getBoundingClientRect(); 32801 const { 32802 left, 32803 top, 32804 width, 32805 height 32806 } = elementRectForRootMargin; 32807 if (!skip) { 32808 onMove(); 32809 } 32810 if (!width || !height) { 32811 return; 32812 } 32813 const insetTop = floor(top); 32814 const insetRight = floor(root2.clientWidth - (left + width)); 32815 const insetBottom = floor(root2.clientHeight - (top + height)); 32816 const insetLeft = floor(left); 32817 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 32818 const options2 = { 32819 rootMargin, 32820 threshold: max(0, min(1, threshold)) || 1 32821 }; 32822 let isFirstUpdate = true; 32823 function handleObserve(entries2) { 32824 const ratio = entries2[0].intersectionRatio; 32825 if (ratio !== threshold) { 32826 if (!isFirstUpdate) { 32827 return refresh(); 32828 } 32829 if (!ratio) { 32830 timeoutId = setTimeout(() => { 32831 refresh(false, 1e-7); 32832 }, 1e3); 32833 } else { 32834 refresh(false, ratio); 32835 } 32836 } 32837 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 32838 refresh(); 32839 } 32840 isFirstUpdate = false; 32841 } 32842 try { 32843 io2 = new IntersectionObserver(handleObserve, __spreadProps(__spreadValues({}, options2), { 32844 // Handle <iframe>s 32845 root: root2.ownerDocument 32846 })); 32847 } catch (_e2) { 32848 io2 = new IntersectionObserver(handleObserve, options2); 32849 } 32850 io2.observe(element); 32851 } 32852 refresh(true); 32853 return cleanup; 32854 } 32855 function autoUpdate(reference, floating, update2, options2) { 32856 if (options2 === void 0) { 32857 options2 = {}; 32858 } 32859 const { 32860 ancestorScroll = true, 32861 ancestorResize = true, 32862 elementResize = typeof ResizeObserver === "function", 32863 layoutShift = typeof IntersectionObserver === "function", 32864 animationFrame = false 32865 } = options2; 32866 const referenceEl = unwrapElement(reference); 32867 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : []; 32868 ancestors.forEach((ancestor) => { 32869 ancestorScroll && ancestor.addEventListener("scroll", update2, { 32870 passive: true 32871 }); 32872 ancestorResize && ancestor.addEventListener("resize", update2); 32873 }); 32874 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : null; 32875 let reobserveFrame = -1; 32876 let resizeObserver = null; 32877 if (elementResize) { 32878 resizeObserver = new ResizeObserver((_ref2) => { 32879 let [firstEntry] = _ref2; 32880 if (firstEntry && firstEntry.target === referenceEl && resizeObserver) { 32881 resizeObserver.unobserve(floating); 32882 cancelAnimationFrame(reobserveFrame); 32883 reobserveFrame = requestAnimationFrame(() => { 32884 var _resizeObserver; 32885 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 32886 }); 32887 } 32888 update2(); 32889 }); 32890 if (referenceEl && !animationFrame) { 32891 resizeObserver.observe(referenceEl); 32892 } 32893 resizeObserver.observe(floating); 32894 } 32895 let frameId; 32896 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 32897 if (animationFrame) { 32898 frameLoop(); 32899 } 32900 function frameLoop() { 32901 const nextRefRect = getBoundingClientRect(reference); 32902 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 32903 update2(); 32904 } 32905 prevRefRect = nextRefRect; 32906 frameId = requestAnimationFrame(frameLoop); 32907 } 32908 update2(); 32909 return () => { 32910 var _resizeObserver2;
vendor: 6,186 bytes, lines 32911-33089
32911 ancestors.forEach((ancestor) => { 32912 ancestorScroll && ancestor.removeEventListener("scroll", update2); 32913 ancestorResize && ancestor.removeEventListener("resize", update2); 32914 }); 32915 cleanupIo == null || cleanupIo(); 32916 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 32917 resizeObserver = null; 32918 if (animationFrame) { 32919 cancelAnimationFrame(frameId); 32920 } 32921 }; 32922 } 32923 const offset$1 = offset$2; 32924 const shift$1 = shift$2; 32925 const flip$1 = flip$2; 32926 const computePosition = (reference, floating, options2) => { 32927 const cache = /* @__PURE__ */ new Map(); 32928 const mergedOptions = __spreadValues({ 32929 platform 32930 }, options2); 32931 const platformWithCache = __spreadProps(__spreadValues({}, mergedOptions.platform), { 32932 _c: cache 32933 }); 32934 return computePosition$1(reference, floating, __spreadProps(__spreadValues({}, mergedOptions), { 32935 platform: platformWithCache 32936 })); 32937 }; 32938 var isClient = typeof document !== "undefined"; 32939 var noop$5 = function noop2() { 32940 }; 32941 var index = isClient ? reactExports.useLayoutEffect : noop$5; 32942 function deepEqual(a2, b2) { 32943 if (a2 === b2) { 32944 return true; 32945 } 32946 if (typeof a2 !== typeof b2) { 32947 return false; 32948 } 32949 if (typeof a2 === "function" && a2.toString() === b2.toString()) { 32950 return true; 32951 } 32952 let length2; 32953 let i2; 32954 let keys2; 32955 if (a2 && b2 && typeof a2 === "object") { 32956 if (Array.isArray(a2)) { 32957 length2 = a2.length; 32958 if (length2 !== b2.length) return false; 32959 for (i2 = length2; i2-- !== 0; ) { 32960 if (!deepEqual(a2[i2], b2[i2])) { 32961 return false; 32962 } 32963 } 32964 return true; 32965 } 32966 keys2 = Object.keys(a2); 32967 length2 = keys2.length; 32968 if (length2 !== Object.keys(b2).length) { 32969 return false; 32970 } 32971 for (i2 = length2; i2-- !== 0; ) { 32972 if (!{}.hasOwnProperty.call(b2, keys2[i2])) { 32973 return false; 32974 } 32975 } 32976 for (i2 = length2; i2-- !== 0; ) { 32977 const key = keys2[i2]; 32978 if (key === "_owner" && a2.$$typeof) { 32979 continue; 32980 } 32981 if (!deepEqual(a2[key], b2[key])) { 32982 return false; 32983 } 32984 } 32985 return true; 32986 } 32987 return a2 !== a2 && b2 !== b2; 32988 } 32989 function getDPR(element) { 32990 if (typeof window === "undefined") { 32991 return 1; 32992 } 32993 const win = element.ownerDocument.defaultView || window; 32994 return win.devicePixelRatio || 1; 32995 } 32996 function roundByDPR(element, value) { 32997 const dpr = getDPR(element); 32998 return Math.round(value * dpr) / dpr; 32999 } 33000 function useLatestRef(value) { 33001 const ref = reactExports.useRef(value); 33002 index(() => { 33003 ref.current = value; 33004 }); 33005 return ref; 33006 } 33007 function useFloating$1(options2) { 33008 if (options2 === void 0) { 33009 options2 = {}; 33010 } 33011 const { 33012 placement = "bottom", 33013 strategy = "absolute", 33014 middleware: middleware2 = [], 33015 platform: platform2, 33016 elements: { 33017 reference: externalReference, 33018 floating: externalFloating 33019 } = {}, 33020 transform: transform2 = true, 33021 whileElementsMounted, 33022 open 33023 } = options2; 33024 const [data, setData] = reactExports.useState({ 33025 x: 0, 33026 y: 0, 33027 strategy, 33028 placement, 33029 middlewareData: {}, 33030 isPositioned: false 33031 }); 33032 const [latestMiddleware, setLatestMiddleware] = reactExports.useState(middleware2); 33033 if (!deepEqual(latestMiddleware, middleware2)) { 33034 setLatestMiddleware(middleware2); 33035 } 33036 const [_reference, _setReference] = reactExports.useState(null); 33037 const [_floating, _setFloating] = reactExports.useState(null); 33038 const setReference = reactExports.useCallback((node2) => { 33039 if (node2 !== referenceRef.current) { 33040 referenceRef.current = node2; 33041 _setReference(node2); 33042 } 33043 }, []); 33044 const setFloating = reactExports.useCallback((node2) => { 33045 if (node2 !== floatingRef.current) { 33046 floatingRef.current = node2; 33047 _setFloating(node2); 33048 } 33049 }, []); 33050 const referenceEl = externalReference || _reference; 33051 const floatingEl = externalFloating || _floating; 33052 const referenceRef = reactExports.useRef(null); 33053 const floatingRef = reactExports.useRef(null); 33054 const dataRef = reactExports.useRef(data); 33055 const hasWhileElementsMounted = whileElementsMounted != null; 33056 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 33057 const platformRef = useLatestRef(platform2); 33058 const openRef = useLatestRef(open); 33059 const update2 = reactExports.useCallback(() => { 33060 if (!referenceRef.current || !floatingRef.current) { 33061 return; 33062 } 33063 const config = { 33064 placement, 33065 strategy, 33066 middleware: latestMiddleware 33067 }; 33068 if (platformRef.current) { 33069 config.platform = platformRef.current; 33070 } 33071 computePosition(referenceRef.current, floatingRef.current, config).then((data2) => { 33072 const fullData = __spreadProps(__spreadValues({}, data2), { 33073 // The floating element's position may be recomputed while it's closed 33074 // but still mounted (such as when transitioning out). To ensure 33075 // `isPositioned` will be `false` initially on the next open, avoid 33076 // setting it to `true` when `open === false` (must be specified). 33077 isPositioned: openRef.current !== false 33078 }); 33079 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 33080 dataRef.current = fullData; 33081 reactDomExports.flushSync(() => { 33082 setData(fullData); 33083 }); 33084 } 33085 }); 33086 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 33087 index(() => { 33088 if (open === false && dataRef.current.isPositioned) { 33089 dataRef.current.isPositioned = false;
33090 setData((data2) => __spreadProps(__spreadValues({}, data2), { 33091 isPositioned: false 33092 })); 33093 } 33094 }, [open]); 33095 const isMountedRef = reactExports.useRef(false); 33096 index(() => { 33097 isMountedRef.current = true; 33098 return () => { 33099 isMountedRef.current = false; 33100 }; 33101 }, []); 33102 index(() => { 33103 if (referenceEl) referenceRef.current = referenceEl; 33104 if (floatingEl) floatingRef.current = floatingEl; 33105 if (referenceEl && floatingEl) { 33106 if (whileElementsMountedRef.current) { 33107 return whileElementsMountedRef.current(referenceEl, floatingEl, update2); 33108 } 33109 update2(); 33110 } 33111 }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); 33112 const refs = reactExports.useMemo(() => ({ 33113 reference: referenceRef, 33114 floating: floatingRef, 33115 setReference, 33116 setFloating 33117 }), [setReference, setFloating]); 33118 const elements = reactExports.useMemo(() => ({ 33119 reference: referenceEl, 33120 floating: floatingEl 33121 }), [referenceEl, floatingEl]); 33122 const floatingStyles = reactExports.useMemo(() => { 33123 const initialStyles = { 33124 position: strategy, 33125 left: 0, 33126 top: 0 33127 }; 33128 if (!elements.floating) { 33129 return initialStyles; 33130 } 33131 const x2 = roundByDPR(elements.floating, data.x); 33132 const y2 = roundByDPR(elements.floating, data.y); 33133 if (transform2) { 33134 return __spreadValues(__spreadProps(__spreadValues({}, initialStyles), { 33135 transform: "translate(" + x2 + "px, " + y2 + "px)" 33136 }), getDPR(elements.floating) >= 1.5 && { 33137 willChange: "transform" 33138 }); 33139 } 33140 return { 33141 position: strategy, 33142 left: x2, 33143 top: y2 33144 }; 33145 }, [strategy, transform2, elements.floating, data.x, data.y]); 33146 return reactExports.useMemo(() => __spreadProps(__spreadValues({}, data), { 33147 update: update2, 33148 refs, 33149 elements, 33150 floatingStyles 33151 }), [data, update2, refs, elements, floatingStyles]); 33152 } 33153 const offset = (options2, deps) => __spreadProps(__spreadValues({}, offset$1(options2)), { 33154 options: [options2, deps] 33155 }); 33156 const shift = (options2, deps) => __spreadProps(__spreadValues({}, shift$1(options2)), { 33157 options: [options2, deps] 33158 }); 33159 const flip = (options2, deps) => __spreadProps(__spreadValues({}, flip$1(options2)), { 33160 options: [options2, deps] 33161 }); 33162 const FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable"; 33163 const ACTIVE_KEY = "active"; 33164 const SELECTED_KEY = "selected"; 33165 const SafeReact = __spreadValues({}, React); 33166 let serverHandoffComplete = false; 33167 let count = 0; 33168 const genId = () => ( 33169 // Ensure the id is unique with multiple independent versions of Floating UI 33170 // on <React 18 33171 "floating-ui-" + Math.random().toString(36).slice(2, 6) + count++ 33172 ); 33173 function useFloatingId() { 33174 const [id2, setId] = reactExports.useState(() => serverHandoffComplete ? genId() : void 0); 33175 index$1(() => { 33176 if (id2 == null) { 33177 setId(genId()); 33178 } 33179 }, []); 33180 reactExports.useEffect(() => { 33181 serverHandoffComplete = true; 33182 }, []); 33183 return id2; 33184 } 33185 const useReactId = SafeReact.useId; 33186 const useId = useReactId || useFloatingId; 33187 function createEventEmitter() { 33188 const map2 = /* @__PURE__ */ new Map(); 33189 return { 33190 emit(event, data) { 33191 var _map$get; 33192 (_map$get = map2.get(event)) == null || _map$get.forEach((listener) => listener(data)); 33193 }, 33194 on(event, listener) { 33195 if (!map2.has(event)) { 33196 map2.set(event, /* @__PURE__ */ new Set()); 33197 } 33198 map2.get(event).add(listener); 33199 }, 33200 off(event, listener) { 33201 var _map$get2; 33202 (_map$get2 = map2.get(event)) == null || _map$get2.delete(listener); 33203 } 33204 }; 33205 } 33206 const FloatingNodeContext = /* @__PURE__ */ reactExports.createContext(null); 33207 const FloatingTreeContext = /* @__PURE__ */ reactExports.createContext(null); 33208 const useFloatingParentNodeId = () => { 33209 var _React$useContext; 33210 return ((_React$useContext = reactExports.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.
33210id) || null; 33211 }; 33212 const useFloatingTree = () => reactExports.useContext(FloatingTreeContext); 33213 function createAttribute(name) { 33214 return "data-floating-ui-" + name; 33215 } 33216 function clearTimeoutIfSet(timeoutRef) { 33217 if (timeoutRef.current !== -1) { 33218 clearTimeout(timeoutRef.current); 33219 timeoutRef.current = -1; 33220 } 33221 } 33222 const safePolygonIdentifier = /* @__PURE__ */ createAttribute("safe-polygon"); 33223 function getDelay(value, prop, pointerType) { 33224 if (pointerType && !isMouseLikePointerType(pointerType)) { 33225 return 0; 33226 } 33227 if (typeof value === "number") { 33228 return value; 33229 } 33230 if (typeof value === "function") { 33231 const result = value(); 33232 if (typeof result === "number") { 33233 return result; 33234 } 33235 return result == null ? void 0 : result[prop]; 33236 } 33237 return value == null ? void 0 : value[prop]; 33238 } 33239 function getRestMs(value) { 33240 if (typeof value === "function") { 33241 return value(); 33242 } 33243 return value; 33244 } 33245 function useHover(context, props) { 33246 if (props === void 0) { 33247 props = {}; 33248 } 33249 const { 33250 open, 33251 onOpenChange, 33252 dataRef, 33253 events, 33254 elements 33255 } = context; 33256 const { 33257 enabled = true, 33258 delay: delay2 = 0, 33259 handleClose = null, 33260 mouseOnly = false, 33261 restMs = 0, 33262 move = true 33263 } = props; 33264 const tree = useFloatingTree(); 33265 const parentId = useFloatingParentNodeId(); 33266 const handleCloseRef = useLatestRef$1(handleClose); 33267 const delayRef = useLatestRef$1(delay2); 33268 const openRef = useLatestRef$1(open); 33269 const restMsRef = useLatestRef$1(restMs); 33270 const pointerTypeRef = reactExports.useRef(); 33271 const timeoutRef = reactExports.useRef(-1); 33272 const handlerRef = reactExports.useRef(); 33273 const restTimeoutRef = reactExports.useRef(-1); 33274 const blockMouseMoveRef = reactExports.useRef(true); 33275 const performedPointerEventsMutationRef = reactExports.useRef(false); 33276 const unbindMouseMoveRef = reactExports.useRef(() => { 33277 }); 33278 const restTimeoutPendingRef = reactExports.useRef(false); 33279 const isHoverOpen = useEffectEvent(() => { 33280 var _dataRef$current$open; 33281 const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type; 33282 return (type == null ? void 0 : type.includes("mouse")) && type !== "mousedown"; 33283 }); 33284 reactExports.useEffect(() => { 33285 if (!enabled) return; 33286 function onOpenChange2(_ref2) { 33287 let { 33288 open: open2 33289 } = _ref2; 33290 if (!open2) { 33291 clearTimeoutIfSet(timeoutRef); 33292 clearTimeoutIfSet(restTimeoutRef); 33293 blockMouseMoveRef.current = true; 33294 restTimeoutPendingRef.current = false; 33295 } 33296 } 33297 events.on("openchange", onOpenChange2); 33298 return () => { 33299 events.off("openchange", onOpenChange2); 33300 }; 33301 }, [enabled, events]); 33302 reactExports.useEffect(() => { 33303 if (!enabled) return; 33304 if (!handleCloseRef.current) return; 33305 if (!open) return; 33306 function onLeave(event) { 33307 if (isHoverOpen()) { 33308 onOpenChange(false, event, "hover"); 33309 } 33310 } 33311 const html2 = getDocument$1(elements.floating).documentElement; 33312 html2.addEventListener("mouseleave", onLeave); 33313 return () => { 33314 html2.removeEventListener("mouseleave", onLeave); 33315 }; 33316 }, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]); 33317 const closeWithDelay = reactExports.useCallback(function(event, runElseBranch, reason) { 33318 if (runElseBranch === void 0) { 33319 runElseBranch = true; 33320 } 33321 if (reason === void 0) { 33322 reason = "hover"; 33323 } 33324 const closeDelay = getDelay(delayRef.current, "close", pointerTypeRef.current); 33325 if (closeDelay && !handlerRef.current) { 33326 clearTimeoutIfSet(timeoutRef); 33327 timeoutRef.current = window.setTimeout(() => onOpenChange(false, event, reason), closeDelay); 33328 } else if (runElseBranch) { 33329 clearTimeoutIfSet(timeoutRef); 33330 onOpenChange(false, event, reason); 33331 } 33332 }, [delayRef, onOpenChange]); 33333 const cleanupMouseMoveHandler = useEffectEvent(() => { 33334 unbindMouseMoveRef.current(); 33335 handlerRef.current = void 0; 33336 }); 33337 const clearPointerEvents = useEffectEvent(() => { 33338 if (performedPointerEventsMutationRef.current) { 33339 const body = getDocument$1(elements.floating).body; 33340 body.style.pointerEvents = ""; 33341 body.removeAttribute(safePolygonIdentifier); 33342 performedPointerEventsMutationRef.current = false;
33343 } 33344 }); 33345 const isClickLikeOpenEvent = useEffectEvent(() => { 33346 return dataRef.current.openEvent ? ["click", "mousedown"].includes(dataRef.current.openEvent.type) : false; 33347 }); 33348 reactExports.useEffect(() => { 33349 if (!enabled) return; 33350 function onReferenceMouseEnter(event) { 33351 clearTimeoutIfSet(timeoutRef); 33352 blockMouseMoveRef.current = false; 33353 if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current) || getRestMs(restMsRef.current) > 0 && !getDelay(delayRef.current, "open")) { 33354 return; 33355 } 33356 const openDelay = getDelay(delayRef.current, "open", pointerTypeRef.current); 33357 if (openDelay) { 33358 timeoutRef.current = window.setTimeout(() => { 33359 if (!openRef.current) { 33360 onOpenChange(true, event, "hover"); 33361 } 33362 }, openDelay); 33363 } else if (!open) { 33364 onOpenChange(true, event, "hover"); 33365 } 33366 } 33367 function onReferenceMouseLeave(event) { 33368 if (isClickLikeOpenEvent()) { 33369 clearPointerEvents(); 33370 return; 33371 } 33372 unbindMouseMoveRef.current(); 33373 const doc = getDocument$1(elements.floating); 33374 clearTimeoutIfSet(restTimeoutRef); 33375 restTimeoutPendingRef.current = false; 33376 if (handleCloseRef.current && dataRef.current.floatingContext) { 33377 if (!open) { 33378 clearTimeoutIfSet(timeoutRef); 33379 } 33380 handlerRef.current = handleCloseRef.current(__spreadProps(__spreadValues({}, dataRef.current.floatingContext), { 33381 tree, 33382 x: event.clientX, 33383 y: event.clientY, 33384 onClose() { 33385 clearPointerEvents(); 33386 cleanupMouseMoveHandler(); 33387 if (!isClickLikeOpenEvent()) { 33388 closeWithDelay(event, true, "safe-polygon"); 33389 } 33390 } 33391 })); 33392 const handler = handlerRef.current; 33393 doc.addEventListener("mousemove", handler); 33394 unbindMouseMoveRef.current = () => { 33395 doc.removeEventListener("mousemove", handler); 33396 }; 33397 return; 33398 } 33399 const shouldClose = pointerTypeRef.current === "touch" ? !contains$1(elements.floating, event.relatedTarget) : true; 33400 if (shouldClose) { 33401 closeWithDelay(event); 33402 } 33403 } 33404 function onScrollMouseLeave(event) { 33405 if (isClickLikeOpenEvent()) return; 33406 if (!dataRef.current.floatingContext) return; 33407 handleCloseRef.current == null || handleCloseRef.current(__spreadProps(__spreadValues({}, dataRef.current.floatingContext), { 33408 tree, 33409 x: event.clientX, 33410 y: event.clientY, 33411 onClose() { 33412 clearPointerEvents(); 33413 cleanupMouseMoveHandler(); 33414 if (!isClickLikeOpenEvent()) { 33415 closeWithDelay(event); 33416 } 33417 } 33418 }))(event); 33419 } 33420 function onFloatingMouseEnter() { 33421 clearTimeoutIfSet(timeoutRef); 33422 } 33423 function onFloatingMouseLeave(event) { 33424 if (!isClickLikeOpenEvent()) { 33425 closeWithDelay(event, false); 33426 } 33427 } 33428 if (isElement(elements.domReference)) { 33429 const reference2 = elements.domReference; 33430 const floating = elements.floating; 33431 if (open) { 33432 reference2.addEventListener("mouseleave", onScrollMouseLeave); 33433 } 33434 if (move) { 33435 reference2.addEventListener("mousemove", onReferenceMouseEnter, { 33436 once: true 33437 }); 33438 } 33439 reference2.addEventListener("mouseenter", onReferenceMouseEnter); 33440 reference2.addEventListener("mouseleave", onReferenceMouseLeave); 33441 if (floating) { 33442 floating.addEventListener("mouseleave", onScrollMouseLeave); 33443 floating.addEventListener("mouseenter", onFloatingMouseEnter); 33444 floating.addEventListener("mouseleave", onFloatingMouseLeave); 33445 } 33446 return () => { 33447 if (open) { 33448 reference2.removeEventListener("mouseleave", onScrollMouseLeave); 33449 } 33450 if (move) { 33451 reference2.removeEventListener("mousemove", onReferenceMouseEnter); 33452 } 33453 reference2.removeEventListener("mouseenter", onReferenceMouseEnter); 33454 reference2.removeEventListener("mouseleave", onReferenceMouseLeave); 33455 if (floating) { 33456 floating.removeEventListener("mouseleave", onScrollMouseLeave); 33457 floating.removeEventListener("mouseenter", onFloatingMouseEnter); 33458 floating.removeEventListener("mouseleave", onFloatingMouseLeave); 33459 } 33460 }; 33461 } 33462 }, [elements, enabled, context, mouseOnly, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent, restMsRef]); 33463 index$1(() => { 33464 var _handleCloseRef$curre; 33465 if (!enabled) return; 33466 if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && (_handleCloseRef$curre = _handleCloseRef$curre.__options) != null && _handleCloseRef$curre.blockPointerEvents && isHoverOpen()) { 33467 performedPointerEventsMutationRef.current = true; 33468 const floatingEl = elements.floating; 33469 if (isElement(elements.domReference) && floatingEl) { 33470 var _tree$nodesRef$curren; 33471 const body = getDocument$1(elements.floating).body; 33472 body.setAttribute(safePolygonIdentifier, ""); 33473 const ref = elements.domReference; 33474 const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find((node2) => node2.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating; 33475 if (parentFloating) { 33476 parentFloating.style.pointerEvents = ""; 33477 } 33478 body.style.pointerEvents = "none"; 33479 ref.style.pointerEvents = "auto"; 33480 floatingEl.style.pointerEvents = "auto"; 33481 return () => { 33482 body.style.pointerEvents = ""; 33483 ref.style.pointerEvents = ""; 33484 floatingEl.style.pointerEvents = ""; 33485 }; 33486 } 33487 } 33488 }, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]); 33489 index$1(() => { 33490 if (!open) { 33491 pointerTypeRef.current = void 0; 33492 restTimeoutPendingRef.current = false;
33493 cleanupMouseMoveHandler(); 33494 clearPointerEvents(); 33495 } 33496 }, [open, cleanupMouseMoveHandler, clearPointerEvents]); 33497 reactExports.useEffect(() => { 33498 return () => { 33499 cleanupMouseMoveHandler(); 33500 clearTimeoutIfSet(timeoutRef); 33501 clearTimeoutIfSet(restTimeoutRef); 33502 clearPointerEvents(); 33503 }; 33504 }, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]); 33505 const reference = reactExports.useMemo(() => { 33506 function setPointerRef(event) { 33507 pointerTypeRef.current = event.pointerType; 33508 } 33509 return { 33510 onPointerDown: setPointerRef, 33511 onPointerEnter: setPointerRef, 33512 onMouseMove(event) { 33513 const { 33514 nativeEvent 33515 } = event; 33516 function handleMouseMove() { 33517 if (!blockMouseMoveRef.current && !openRef.current) { 33518 onOpenChange(true, nativeEvent, "hover"); 33519 } 33520 } 33521 if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) { 33522 return; 33523 } 33524 if (open || getRestMs(restMsRef.current) === 0) { 33525 return; 33526 } 33527 if (restTimeoutPendingRef.current && __pow(event.movementX, 2) + __pow(event.movementY, 2) < 2) { 33528 return; 33529 } 33530 clearTimeoutIfSet(restTimeoutRef); 33531 if (pointerTypeRef.current === "touch") { 33532 handleMouseMove(); 33533 } else { 33534 restTimeoutPendingRef.current = true; 33535 restTimeoutRef.current = window.setTimeout(handleMouseMove, getRestMs(restMsRef.current)); 33536 } 33537 } 33538 }; 33539 }, [mouseOnly, onOpenChange, open, openRef, restMsRef]); 33540 return reactExports.useMemo(() => enabled ? { 33541 reference 33542 } : {}, [enabled, reference]); 33543 } 33544 let rafId = 0; 33545 function enqueueFocus(el, options2) { 33546 if (options2 === void 0) { 33547 options2 = {}; 33548 } 33549 const { 33550 preventScroll = false, 33551 cancelPrevious = true, 33552 sync = false 33553 } = options2; 33554 cancelPrevious && cancelAnimationFrame(rafId); 33555 const exec = () => el == null ? void 0 : el.focus({ 33556 preventScroll 33557 }); 33558 if (sync) { 33559 exec(); 33560 } else { 33561 rafId = requestAnimationFrame(exec); 33562 } 33563 } 33564 function contains(parent, child) { 33565 if (!parent || !child) { 33566 return false; 33567 } 33568 const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); 33569 if (parent.contains(child)) { 33570 return true; 33571 } 33572 if (rootNode && isShadowRoot(rootNode)) { 33573 let next2 = child; 33574 while (next2) { 33575 if (parent === next2) { 33576 return true; 33577 } 33578 next2 = next2.parentNode || next2.host; 33579 } 33580 } 33581 return false; 33582 } 33583 function getTarget(event) { 33584 if ("composedPath" in event) { 33585 return event.composedPath()[0]; 33586 } 33587 return event.target; 33588 } 33589 function getDocument(node2) { 33590 return (node2 == null ? void 0 : node2.ownerDocument) || document; 33591 } 33592 const counters = { 33593 inert: /* @__PURE__ */ new WeakMap(), 33594 "aria-hidden": /* @__PURE__ */ new WeakMap(), 33595 none: /* @__PURE__ */ new WeakMap() 33596 }; 33597 function getCounterMap(control) { 33598 if (control === "inert") return counters.inert; 33599 if (control === "aria-hidden") return counters["aria-hidden"]; 33600 return counters.none; 33601 } 33602 let uncontrolledElementsSet = /* @__PURE__ */ new WeakSet(); 33603 let markerMap = {}; 33604 let lockCount$1 = 0; 33605 const supportsInert = () => typeof HTMLElement !== "undefined" && "inert" in HTMLElement.prototype; 33606 const unwrapHost = (node2) => node2 && (node2.host || unwrapHost(node2.parentNode)); 33607 const correctElements = (parent, targets) => targets.map((target) => { 33608 if (parent.contains(target)) { 33609 return target; 33610 } 33611 const correctedTarget = unwrapHost(target); 33612 if (parent.contains(correctedTarget)) { 33613 return correctedTarget; 33614 } 33615 return null; 33616 }).filter((x2) => x2 != null); 33617 function applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert) { 33618 const markerName = "data-floating-ui-inert"; 33619 const controlAttribute = inert ? "inert" : ariaHidden ? "aria-hidden" : null; 33620 const avoidElements = correctElements(body, uncorrectedAvoidElements); 33621 const elementsToKeep = /* @__PURE__ */ new Set(); 33622 const elementsToStop = new Set(avoidElements); 33623 const hiddenElements = []; 33624 if (!markerMap[markerName]) { 33625 markerMap[markerName] = /* @__PURE__ */ new WeakMap(); 33626 } 33627 const markerCounter = markerMap[markerName];
33628 avoidElements.forEach(keep); 33629 deep(body); 33630 elementsToKeep.clear(); 33631 function keep(el) { 33632 if (!el || elementsToKeep.has(el)) { 33633 return; 33634 } 33635 elementsToKeep.add(el); 33636 el.parentNode && keep(el.parentNode); 33637 } 33638 function deep(parent) { 33639 if (!parent || elementsToStop.has(parent)) { 33640 return; 33641 } 33642 [].forEach.call(parent.children, (node2) => { 33643 if (getNodeName(node2) === "script") return; 33644 if (elementsToKeep.has(node2)) { 33645 deep(node2); 33646 } else { 33647 const attr2 = controlAttribute ? node2.getAttribute(controlAttribute) : null; 33648 const alreadyHidden = attr2 !== null && attr2 !== "false"; 33649 const counterMap = getCounterMap(controlAttribute); 33650 const counterValue = (counterMap.get(node2) || 0) + 1; 33651 const markerValue = (markerCounter.get(node2) || 0) + 1; 33652 counterMap.set(node2, counterValue); 33653 markerCounter.set(node2, markerValue); 33654 hiddenElements.push(node2); 33655 if (counterValue === 1 && alreadyHidden) { 33656 uncontrolledElementsSet.add(node2); 33657 } 33658 if (markerValue === 1) { 33659 node2.setAttribute(markerName, ""); 33660 } 33661 if (!alreadyHidden && controlAttribute) { 33662 node2.setAttribute(controlAttribute, controlAttribute === "inert" ? "" : "true"); 33663 } 33664 } 33665 }); 33666 } 33667 lockCount$1++; 33668 return () => { 33669 hiddenElements.forEach((element) => { 33670 const counterMap = getCounterMap(controlAttribute); 33671 const currentCounterValue = counterMap.get(element) || 0; 33672 const counterValue = currentCounterValue - 1; 33673 const markerValue = (markerCounter.get(element) || 0) - 1; 33674 counterMap.set(element, counterValue); 33675 markerCounter.set(element, markerValue); 33676 if (!counterValue) { 33677 if (!uncontrolledElementsSet.has(element) && controlAttribute) { 33678 element.removeAttribute(controlAttribute); 33679 } 33680 uncontrolledElementsSet.delete(element); 33681 } 33682 if (!markerValue) { 33683 element.removeAttribute(markerName); 33684 } 33685 }); 33686 lockCount$1--; 33687 if (!lockCount$1) { 33688 counters.inert = /* @__PURE__ */ new WeakMap(); 33689 counters["aria-hidden"] = /* @__PURE__ */ new WeakMap(); 33690 counters.none = /* @__PURE__ */ new WeakMap(); 33691 uncontrolledElementsSet = /* @__PURE__ */ new WeakSet(); 33692 markerMap = {}; 33693 } 33694 }; 33695 } 33696 function markOthers(avoidElements, ariaHidden, inert) { 33697 if (ariaHidden === void 0) { 33698 ariaHidden = false; 33699 } 33700 if (inert === void 0) { 33701 inert = false; 33702 } 33703 const body = getDocument(avoidElements[0]).body; 33704 return applyAttributeToOthers(avoidElements.concat(Array.from(body.querySelectorAll('[aria-live],[role="status"],output'))), body, ariaHidden, inert); 33705 } 33706 const HIDDEN_STYLES = { 33707 border: 0, 33708 clip: "rect(0 0 0 0)", 33709 height: "1px", 33710 margin: "-1px", 33711 overflow: "hidden", 33712 padding: 0, 33713 position: "fixed", 33714 whiteSpace: "nowrap", 33715 width: "1px", 33716 top: 0, 33717 left: 0 33718 }; 33719 const FocusGuard = /* @__PURE__ */ reactExports.forwardRef(function FocusGuard2(props, ref) { 33720 const [role, setRole] = reactExports.useState(); 33721 index$1(() => { 33722 if (isSafari()) { 33723 setRole("button"); 33724 } 33725 }, []); 33726 const restProps = { 33727 ref, 33728 tabIndex: 0, 33729 // Role is only for VoiceOver 33730 role, 33731 "aria-hidden": role ? void 0 : true, 33732 [createAttribute("focus-guard")]: "", 33733 style: HIDDEN_STYLES 33734 }; 33735 return /* @__PURE__ */ jsxRuntimeExports.jsx("span", __spreadValues(__spreadValues({}, props), restProps)); 33736 }); 33737 const PortalContext = /* @__PURE__ */ reactExports.createContext(null); 33738 const attr = /* @__PURE__ */ createAttribute("portal");
33739 function useFloatingPortalNode(props) { 33740 if (props === void 0) { 33741 props = {}; 33742 } 33743 const { 33744 id: id2, 33745 root: root2 33746 } = props; 33747 const uniqueId = useId(); 33748 const portalContext = usePortalContext(); 33749 const [portalNode, setPortalNode] = reactExports.useState(null); 33750 const portalNodeRef = reactExports.useRef(null); 33751 index$1(() => { 33752 return () => { 33753 portalNode == null || portalNode.remove(); 33754 queueMicrotask(() => { 33755 portalNodeRef.current = null; 33756 }); 33757 }; 33758 }, [portalNode]); 33759 index$1(() => { 33760 if (!uniqueId) return; 33761 if (portalNodeRef.current) return; 33762 const existingIdRoot = id2 ? document.getElementById(id2) : null; 33763 if (!existingIdRoot) return; 33764 const subRoot = document.createElement("div"); 33765 subRoot.id = uniqueId; 33766 subRoot.setAttribute(attr, ""); 33767 existingIdRoot.appendChild(subRoot); 33768 portalNodeRef.current = subRoot; 33769 setPortalNode(subRoot); 33770 }, [id2, uniqueId]); 33771 index$1(() => { 33772 if (root2 === null) return; 33773 if (!uniqueId) return; 33774 if (portalNodeRef.current) return; 33775 let container = root2 || (portalContext == null ? void 0 : portalContext.portalNode); 33776 if (container && !isNode(container)) container = container.current; 33777 container = container || document.body; 33778 let idWrapper = null; 33779 if (id2) { 33780 idWrapper = document.createElement("div"); 33781 idWrapper.id = id2; 33782 container.appendChild(idWrapper); 33783 } 33784 const subRoot = document.createElement("div"); 33785 subRoot.id = uniqueId; 33786 subRoot.setAttribute(attr, ""); 33787 container = idWrapper || container; 33788 container.appendChild(subRoot); 33789 portalNodeRef.current = subRoot; 33790 setPortalNode(subRoot); 33791 }, [id2, root2, uniqueId, portalContext]); 33792 return portalNode; 33793 } 33794 function FloatingPortal(props) { 33795 const { 33796 children, 33797 id: id2, 33798 root: root2, 33799 preserveTabOrder = true 33800 } = props; 33801 const portalNode = useFloatingPortalNode({ 33802 id: id2, 33803 root: root2 33804 }); 33805 const [focusManagerState, setFocusManagerState] = reactExports.useState(null); 33806 const beforeOutsideRef = reactExports.useRef(null); 33807 const afterOutsideRef = reactExports.useRef(null); 33808 const beforeInsideRef = reactExports.useRef(null); 33809 const afterInsideRef = reactExports.useRef(null); 33810 const modal = focusManagerState == null ? void 0 : focusManagerState.modal; 33811 const open = focusManagerState == null ? void 0 : focusManagerState.open; 33812 const shouldRenderGuards = ( 33813 // The FocusManager and therefore floating element are currently open/ 33814 // rendered. 33815 !!focusManagerState && // Guards are only for non-modal focus management. 33816 !focusManagerState.modal && // Don't render if unmount is transitioning. 33817 focusManagerState.open && preserveTabOrder && !!(root2 || portalNode) 33818 ); 33819 reactExports.useEffect(() => { 33820 if (!portalNode || !preserveTabOrder || modal) { 33821 return; 33822 } 33823 function onFocus(event) { 33824 if (portalNode && isOutsideEvent(event)) { 33825 const focusing = event.type === "focusin"; 33826 const manageFocus = focusing ? enableFocusInside : disableFocusInside; 33827 manageFocus(portalNode); 33828 } 33829 } 33830 portalNode.addEventListener("focusin", onFocus, true); 33831 portalNode.addEventListener("focusout", onFocus, true); 33832 return () => { 33833 portalNode.removeEventListener("focusin", onFocus, true); 33834 portalNode.removeEventListener("focusout", onFocus, true); 33835 }; 33836 }, [portalNode, preserveTabOrder, modal]); 33837 reactExports.useEffect(() => { 33838 if (!portalNode) return; 33839 if (open) return; 33840 enableFocusInside(portalNode); 33841 }, [open, portalNode]); 33842 return /* @__PURE__ */ jsxRuntimeExports.jsxs(PortalContext.Provider, { 33843 value: reactExports.useMemo(() => ({ 33844 preserveTabOrder, 33845 beforeOutsideRef, 33846 afterOutsideRef, 33847 beforeInsideRef, 33848 afterInsideRef, 33849 portalNode, 33850 setFocusManagerState 33851 }), [preserveTabOrder, portalNode]),
33852 children: [shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntimeExports.jsx(FocusGuard, { 33853 "data-type": "outside", 33854 ref: beforeOutsideRef, 33855 onFocus: (event) => { 33856 if (isOutsideEvent(event, portalNode)) { 33857 var _beforeInsideRef$curr; 33858 (_beforeInsideRef$curr = beforeInsideRef.current) == null || _beforeInsideRef$curr.focus(); 33859 } else { 33860 const domReference = focusManagerState ? focusManagerState.domReference : null; 33861 const prevTabbable = getPreviousTabbable(domReference); 33862 prevTabbable == null || prevTabbable.focus(); 33863 } 33864 } 33865 }), shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { 33866 "aria-owns": portalNode.id, 33867 style: HIDDEN_STYLES 33868 }), portalNode && /* @__PURE__ */ reactDomExports.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntimeExports.jsx(FocusGuard, { 33869 "data-type": "outside", 33870 ref: afterOutsideRef, 33871 onFocus: (event) => { 33872 if (isOutsideEvent(event, portalNode)) { 33873 var _afterInsideRef$curre; 33874 (_afterInsideRef$curre = afterInsideRef.current) == null || _afterInsideRef$curre.focus(); 33875 } else { 33876 const domReference = focusManagerState ? focusManagerState.domReference : null; 33877 const nextTabbable = getNextTabbable(domReference); 33878 nextTabbable == null || nextTabbable.focus(); 33879 (focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) && (focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false, event.nativeEvent, "focus-out")); 33880 } 33881 } 33882 })] 33883 }); 33884 } 33885 const usePortalContext = () => reactExports.useContext(PortalContext); 33886 function useLiteMergeRefs(refs) { 33887 return reactExports.useMemo(() => { 33888 return (value) => { 33889 refs.forEach((ref) => { 33890 if (ref) { 33891 ref.current = value; 33892 } 33893 }); 33894 }; 33895 }, refs); 33896 } 33897 const LIST_LIMIT = 20; 33898 let previouslyFocusedElements = []; 33899 function clearDisconnectedPreviouslyFocusedElements() { 33900 previouslyFocusedElements = previouslyFocusedElements.filter((el) => el.isConnected); 33901 } 33902 function addPreviouslyFocusedElement(element) { 33903 clearDisconnectedPreviouslyFocusedElements(); 33904 if (element && getNodeName(element) !== "body") { 33905 previouslyFocusedElements.push(element); 33906 if (previouslyFocusedElements.length > LIST_LIMIT) { 33907 previouslyFocusedElements = previouslyFocusedElements.slice(-20); 33908 } 33909 } 33910 } 33911 function getPreviouslyFocusedElement() { 33912 clearDisconnectedPreviouslyFocusedElements(); 33913 return previouslyFocusedElements[previouslyFocusedElements.length - 1]; 33914 } 33915 function getFirstTabbableElement(container) { 33916 const tabbableOptions = getTabbableOptions(); 33917 if (isTabbable(container, tabbableOptions)) { 33918 return container; 33919 } 33920 return tabbable(container, tabbableOptions)[0] || container; 33921 } 33922 function handleTabIndex(floatingFocusElement, orderRef) { 33923 var _floatingFocusElement; 33924 if (!orderRef.current.includes("floating") && !((_floatingFocusElement = floatingFocusElement.getAttribute("role")) != null && _floatingFocusElement.includes("dialog"))) { 33925 return; 33926 } 33927 const options2 = getTabbableOptions(); 33928 const focusableElements2 = focusable(floatingFocusElement, options2); 33929 const tabbableContent = focusableElements2.filter((element) => { 33930 const dataTabIndex = element.getAttribute("data-tabindex") || ""; 33931 return isTabbable(element, options2) || element.hasAttribute("data-tabindex") && !dataTabIndex.startsWith("-"); 33932 }); 33933 const tabIndex = floatingFocusElement.getAttribute("tabindex"); 33934 if (orderRef.current.includes("floating") || tabbableContent.length === 0) { 33935 if (tabIndex !== "0") { 33936 floatingFocusElement.setAttribute("tabindex", "0"); 33937 } 33938 } else if (tabIndex !== "-1" || floatingFocusElement.hasAttribute("data-tabindex") && floatingFocusElement.getAttribute("data-tabindex") !== "-1") { 33939 floatingFocusElement.setAttribute("tabindex", "-1"); 33940 floatingFocusElement.setAttribute("data-tabindex", "-1"); 33941 } 33942 } 33943 const VisuallyHiddenDismiss = /* @__PURE__ */ reactExports.forwardRef(function VisuallyHiddenDismiss2(props, ref) { 33944 return /* @__PURE__ */ jsxRuntimeExports.jsx("button", __spreadProps(__spreadValues({}, props), { 33945 type: "button", 33946 ref, 33947 tabIndex: -1, 33948 style: HIDDEN_STYLES 33949 })); 33950 }); 33951 function FloatingFocusManager(props) { 33952 const { 33953 context, 33954 children, 33955 disabled = false, 33956 order = ["content"], 33957 guards: _guards = true, 33958 initialFocus = 0, 33959 returnFocus = true, 33960 restoreFocus = false, 33961 modal = true, 33962 visuallyHiddenDismiss = false, 33963 closeOnFocusOut = true, 33964 outsideElementsInert = false, 33965 getInsideElements: _getInsideElements = () => [] 33966 } = props; 33967 const { 33968 open, 33969 onOpenChange, 33970 events, 33971 dataRef, 33972 elements: { 33973 domReference, 33974 floating 33975 } 33976 } = context; 33977 const getNodeId = useEffectEvent(() => { 33978 var _dataRef$current$floa; 33979 return (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId; 33980 }); 33981 const getInsideElements = useEffectEvent(_getInsideElements); 33982 const ignoreInitialFocus = typeof initialFocus === "number" && initialFocus < 0; 33983 const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus; 33984 const inertSupported = supportsInert(); 33985 const guards = inertSupported ? _guards : true; 33986 const useInert = !guards || inertSupported && outsideElementsInert; 33987 const orderRef = useLatestRef$1(order); 33988 const initialFocusRef = useLatestRef$1(initialFocus); 33989 const returnFocusRef = useLatestRef$1(returnFocus); 33990 const tree = useFloatingTree(); 33991 const portalContext = usePortalContext(); 33992 const startDismissButtonRef = reactExports.useRef(null); 33993 const endDismissButtonRef = reactExports.useRef(null); 33994 const preventReturnFocusRef = reactExports.useRef(false); 33995 const isPointerDownRef = reactExports.useRef(false); 33996 const tabbableIndexRef = reactExports.useRef(-1); 33997 const blurTimeoutRef = reactExports.useRef(-1); 33998 const isInsidePortal = portalContext != null; 33999 const floatingFocusElement = getFloatingFocusElement(floating); 34000 const getTabbableContent = useEffectEvent(function(container) { 34001 if (container === void 0) { 34002 container = floatingFocusElement; 34003 } 34004 return container ? tabbable(container, getTabbableOptions()) : []; 34005 }); 34006 const getTabbableElements = useEffectEvent((container) => { 34007 const content = getTabbableContent(container); 34008 return orderRef.current.map((type) => { 34009 if (domReference && type === "reference") { 34010 return domReference; 34011 } 34012 if (floatingFocusElement && type === "floating") { 34013 return floatingFocusElement; 34014 } 34015 return content; 34016 }
34016).filter(Boolean).flat(); 34017 }); 34018 reactExports.useEffect(() => { 34019 if (disabled) return; 34020 if (!modal) return; 34021 function onKeyDown(event) { 34022 if (event.key === "Tab") { 34023 if (contains$1(floatingFocusElement, activeElement(getDocument$1(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) { 34024 stopEvent(event); 34025 } 34026 const els = getTabbableElements(); 34027 const target = getTarget$1(event); 34028 if (orderRef.current[0] === "reference" && target === domReference) { 34029 stopEvent(event); 34030 if (event.shiftKey) { 34031 enqueueFocus(els[els.length - 1]); 34032 } else { 34033 enqueueFocus(els[1]); 34034 } 34035 } 34036 if (orderRef.current[1] === "floating" && target === floatingFocusElement && event.shiftKey) { 34037 stopEvent(event); 34038 enqueueFocus(els[0]); 34039 } 34040 } 34041 } 34042 const doc = getDocument$1(floatingFocusElement); 34043 doc.addEventListener("keydown", onKeyDown); 34044 return () => { 34045 doc.removeEventListener("keydown", onKeyDown); 34046 }; 34047 }, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent, getTabbableElements]); 34048 reactExports.useEffect(() => { 34049 if (disabled) return; 34050 if (!floating) return; 34051 function handleFocusIn(event) { 34052 const target = getTarget$1(event); 34053 const tabbableContent = getTabbableContent(); 34054 const tabbableIndex = tabbableContent.indexOf(target); 34055 if (tabbableIndex !== -1) { 34056 tabbableIndexRef.current = tabbableIndex; 34057 } 34058 } 34059 floating.addEventListener("focusin", handleFocusIn); 34060 return () => { 34061 floating.removeEventListener("focusin", handleFocusIn); 34062 }; 34063 }, [disabled, floating, getTabbableContent]); 34064 reactExports.useEffect(() => { 34065 if (disabled) return; 34066 if (!closeOnFocusOut) return; 34067 function handlePointerDown() { 34068 isPointerDownRef.current = true; 34069 setTimeout(() => { 34070 isPointerDownRef.current = false; 34071 }); 34072 } 34073 function handleFocusOutside(event) { 34074 const relatedTarget = event.relatedTarget; 34075 const currentTarget = event.currentTarget; 34076 const target = getTarget$1(event); 34077 queueMicrotask(() => { 34078 const nodeId = getNodeId(); 34079 const movedToUnrelatedNode = !(contains$1(domReference, relatedTarget) || contains$1(floating, relatedTarget) || contains$1(relatedTarget, floating) || contains$1(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || relatedTarget != null && relatedTarget.hasAttribute(createAttribute("focus-guard")) || tree && (getNodeChildren$1(tree.nodesRef.current, nodeId).find((node2) => { 34080 var _node$context, _node$context2; 34081 return contains$1((_node$context = node2.context) == null ? void 0 : _node$context.elements.floating, relatedTarget) || contains$1((_node$context2 = node2.context) == null ? void 0 : _node$context2.elements.domReference, relatedTarget); 34082 }) || getNodeAncestors(tree.nodesRef.current, nodeId).find((node2) => { 34083 var _node$context3, _node$context4, _node$context5; 34084 return [(_node$context3 = node2.context) == null ? void 0 : _node$context3.elements.floating, getFloatingFocusElement((_node$context4 = node2.context) == null ? void 0 : _node$context4.elements.floating)].includes(relatedTarget) || ((_node$context5 = node2.context) == null ? void 0 : _node$context5.elements.domReference) === relatedTarget; 34085 }))); 34086 if (currentTarget === domReference && floatingFocusElement) { 34087 handleTabIndex(floatingFocusElement, orderRef); 34088 } 34089 if (restoreFocus && currentTarget !== domReference && !(target != null && target.isConnected) && activeElement(getDocument$1(floatingFocusElement)) === getDocument$1(floatingFocusElement).body) { 34090 if (isHTMLElement(floatingFocusElement)) { 34091 floatingFocusElement.focus(); 34092 } 34093 const prevTabbableIndex = tabbableIndexRef.current; 34094 const tabbableContent = getTabbableContent(); 34095 const nodeToFocus = tabbableContent[prevTabbableIndex] || tabbableContent[tabbableContent.length - 1] || floatingFocusElement; 34096 if (isHTMLElement(nodeToFocus)) { 34097 nodeToFocus.focus(); 34098 } 34099 } 34100 if (dataRef.current.insideReactTree) { 34101 dataRef.current.insideReactTree = false;
34102 return; 34103 } 34104 if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && // Fix React 18 Strict Mode returnFocus due to double rendering. 34105 relatedTarget !== getPreviouslyFocusedElement()) { 34106 preventReturnFocusRef.current = true; 34107 onOpenChange(false, event, "focus-out"); 34108 } 34109 }); 34110 } 34111 const shouldHandleBlurCapture = Boolean(!tree && portalContext); 34112 function markInsideReactTree() { 34113 clearTimeoutIfSet(blurTimeoutRef); 34114 dataRef.current.insideReactTree = true; 34115 blurTimeoutRef.current = window.setTimeout(() => { 34116 dataRef.current.insideReactTree = false; 34117 }); 34118 } 34119 if (floating && isHTMLElement(domReference)) { 34120 domReference.addEventListener("focusout", handleFocusOutside); 34121 domReference.addEventListener("pointerdown", handlePointerDown); 34122 floating.addEventListener("focusout", handleFocusOutside); 34123 if (shouldHandleBlurCapture) { 34124 floating.addEventListener("focusout", markInsideReactTree, true); 34125 } 34126 return () => { 34127 domReference.removeEventListener("focusout", handleFocusOutside); 34128 domReference.removeEventListener("pointerdown", handlePointerDown); 34129 floating.removeEventListener("focusout", handleFocusOutside); 34130 if (shouldHandleBlurCapture) { 34131 floating.removeEventListener("focusout", markInsideReactTree, true); 34132 } 34133 }; 34134 } 34135 }, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, onOpenChange, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, orderRef, dataRef]); 34136 const beforeGuardRef = reactExports.useRef(null); 34137 const afterGuardRef = reactExports.useRef(null); 34138 const mergedBeforeGuardRef = useLiteMergeRefs([beforeGuardRef, portalContext == null ? void 0 : portalContext.beforeInsideRef]); 34139 const mergedAfterGuardRef = useLiteMergeRefs([afterGuardRef, portalContext == null ? void 0 : portalContext.afterInsideRef]); 34140 reactExports.useEffect(() => { 34141 var _portalContext$portal, _ancestors$find; 34142 if (disabled) return; 34143 if (!floating) return; 34144 const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll("[" + createAttribute("portal") + "]")) || []); 34145 const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : []; 34146 const rootAncestorComboboxDomReference = (_ancestors$find = ancestors.find((node2) => { 34147 var _node$context6; 34148 return isTypeableCombobox(((_node$context6 = node2.context) == null ? void 0 : _node$context6.elements.domReference) || null); 34149 })) == null || (_ancestors$find = _ancestors$find.context) == null ? void 0 : _ancestors$find.elements.domReference; 34150 const insideElements = [floating, rootAncestorComboboxDomReference, ...portalNodes, ...getInsideElements(), startDismissButtonRef.current, endDismissButtonRef.current, beforeGuardRef.current, afterGuardRef.current, portalContext == null ? void 0 : portalContext.beforeOutsideRef.current, portalContext == null ? void 0 : portalContext.afterOutsideRef.current, orderRef.current.includes("reference") || isUntrappedTypeableCombobox ? domReference : null].filter((x2) => x2 != null); 34151 const cleanup2 = modal || isUntrappedTypeableCombobox ? markOthers(insideElements, !useInert, useInert) : markOthers(insideElements); 34152 return () => { 34153 cleanup2(); 34154 }; 34155 }, [disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, guards, useInert, tree, getNodeId, getInsideElements]); 34156 index$1(() => { 34157 if (disabled || !isHTMLElement(floatingFocusElement)) return; 34158 const doc = getDocument$1(floatingFocusElement); 34159 const previouslyFocusedElement = activeElement(doc); 34160 queueMicrotask(() => { 34161 const focusableElements2 = getTabbableElements(floatingFocusElement); 34162 const initialFocusValue = initialFocusRef.current; 34163 const elToFocus = (typeof initialFocusValue === "number" ? focusableElements2[initialFocusValue] : initialFocusValue.current) || floatingFocusElement; 34164 const focusAlreadyInsideFloatingEl = contains$1(floatingFocusElement, previouslyFocusedElement); 34165 if (!ignoreInitialFocus && !focusAlreadyInsideFloatingEl && open) { 34166 enqueueFocus(elToFocus, { 34167 preventScroll: elToFocus === floatingFocusElement 34168 }); 34169 } 34170 }); 34171 }, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableElements, initialFocusRef]); 34172 index$1(() => { 34173 if (disabled || !floatingFocusElement) return; 34174 const doc = getDocument$1(floatingFocusElement); 34175 const previouslyFocusedElement = activeElement(doc); 34176 addPreviouslyFocusedElement(previouslyFocusedElement); 34177 function onOpenChange2(_ref2) { 34178 let { 34179 reason, 34180 event, 34181 nested 34182 } = _ref2; 34183 if (["hover", "safe-polygon"].includes(reason) && event.type === "mouseleave") { 34184 preventReturnFocusRef.current = true; 34185 } 34186 if (reason !== "outside-press") return; 34187 if (nested) { 34188 preventReturnFocusRef.current = false;
34189 } else if (isVirtualClick(event) || isVirtualPointerEvent(event)) { 34190 preventReturnFocusRef.current = false; 34191 } else { 34192 let isPreventScrollSupported = false; 34193 document.createElement("div").focus({ 34194 get preventScroll() { 34195 isPreventScrollSupported = true; 34196 return false; 34197 } 34198 }); 34199 if (isPreventScrollSupported) { 34200 preventReturnFocusRef.current = false; 34201 } else { 34202 preventReturnFocusRef.current = true; 34203 } 34204 } 34205 } 34206 events.on("openchange", onOpenChange2); 34207 const fallbackEl = doc.createElement("span"); 34208 fallbackEl.setAttribute("tabindex", "-1"); 34209 fallbackEl.setAttribute("aria-hidden", "true"); 34210 Object.assign(fallbackEl.style, HIDDEN_STYLES); 34211 if (isInsidePortal && domReference) { 34212 domReference.insertAdjacentElement("afterend", fallbackEl); 34213 } 34214 function getReturnElement() { 34215 if (typeof returnFocusRef.current === "boolean") { 34216 const el = domReference || getPreviouslyFocusedElement(); 34217 return el && el.isConnected ? el : fallbackEl; 34218 } 34219 return returnFocusRef.current.current || fallbackEl; 34220 } 34221 return () => { 34222 events.off("openchange", onOpenChange2); 34223 const activeEl = activeElement(doc); 34224 const isFocusInsideFloatingTree = contains$1(floating, activeEl) || tree && getNodeChildren$1(tree.nodesRef.current, getNodeId(), false).some((node2) => { 34225 var _node$context7; 34226 return contains$1((_node$context7 = node2.context) == null ? void 0 : _node$context7.elements.floating, activeEl); 34227 }); 34228 const returnElement = getReturnElement(); 34229 queueMicrotask(() => { 34230 const tabbableReturnElement = getFirstTabbableElement(returnElement); 34231 if ( 34232 // eslint-disable-next-line react-hooks/exhaustive-deps 34233 returnFocusRef.current && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && // If the focus moved somewhere else after mount, avoid returning focus 34234 // since it likely entered a different element which should be 34235 // respected: https://github.com/floating-ui/floating-ui/issues/2607 34236 (tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true) 34237 ) { 34238 tabbableReturnElement.focus({ 34239 preventScroll: true 34240 }); 34241 } 34242 fallbackEl.remove(); 34243 }); 34244 }; 34245 }, [disabled, floating, floatingFocusElement, returnFocusRef, dataRef, events, tree, isInsidePortal, domReference, getNodeId]); 34246 reactExports.useEffect(() => { 34247 queueMicrotask(() => { 34248 preventReturnFocusRef.current = false; 34249 }); 34250 return () => { 34251 queueMicrotask(clearDisconnectedPreviouslyFocusedElements); 34252 }; 34253 }, [disabled]); 34254 index$1(() => { 34255 if (disabled) return; 34256 if (!portalContext) return; 34257 portalContext.setFocusManagerState({ 34258 modal, 34259 closeOnFocusOut, 34260 open, 34261 onOpenChange, 34262 domReference 34263 }); 34264 return () => { 34265 portalContext.setFocusManagerState(null); 34266 }; 34267 }, [disabled, portalContext, modal, open, onOpenChange, closeOnFocusOut, domReference]); 34268 index$1(() => { 34269 if (disabled) return; 34270 if (!floatingFocusElement) return; 34271 handleTabIndex(floatingFocusElement, orderRef); 34272 }, [disabled, floatingFocusElement, orderRef]); 34273 function renderDismissButton(location) { 34274 if (disabled || !visuallyHiddenDismiss || !modal) { 34275 return null; 34276 } 34277 return /* @__PURE__ */ jsxRuntimeExports.jsx(VisuallyHiddenDismiss, { 34278 ref: location === "start" ? startDismissButtonRef : endDismissButtonRef, 34279 onClick: (event) => onOpenChange(false, event.nativeEvent), 34280 children: typeof visuallyHiddenDismiss === "string" ? visuallyHiddenDismiss : "Dismiss" 34281 }); 34282 } 34283 const shouldRenderGuards = !disabled && guards && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal); 34284 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
34285 children: [shouldRenderGuards && /* @__PURE__ */ jsxRuntimeExports.jsx(FocusGuard, { 34286 "data-type": "inside", 34287 ref: mergedBeforeGuardRef, 34288 onFocus: (event) => { 34289 if (modal) { 34290 const els = getTabbableElements(); 34291 enqueueFocus(order[0] === "reference" ? els[0] : els[els.length - 1]); 34292 } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) { 34293 preventReturnFocusRef.current = false; 34294 if (isOutsideEvent(event, portalContext.portalNode)) { 34295 const nextTabbable = getNextTabbable(domReference); 34296 nextTabbable == null || nextTabbable.focus(); 34297 } else { 34298 var _portalContext$before; 34299 (_portalContext$before = portalContext.beforeOutsideRef.current) == null || _portalContext$before.focus(); 34300 } 34301 } 34302 } 34303 }), !isUntrappedTypeableCombobox && renderDismissButton("start"), children, renderDismissButton("end"), shouldRenderGuards && /* @__P
34303URE__ */ jsxRuntimeExports.jsx(FocusGuard, { 34304 "data-type": "inside", 34305 ref: mergedAfterGuardRef, 34306 onFocus: (event) => { 34307 if (modal) { 34308 enqueueFocus(getTabbableElements()[0]); 34309 } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) { 34310 if (closeOnFocusOut) { 34311 preventReturnFocusRef.current = true; 34312 } 34313 if (isOutsideEvent(event, portalContext.portalNode)) { 34314 const prevTabbable = getPreviousTabbable(domReference); 34315 prevTabbable == null || prevTabbable.focus(); 34316 } else { 34317 var _portalContext$afterO; 34318 (_portalContext$afterO = portalContext.afterOutsideRef.current) == null || _portalContext$afterO.focus(); 34319 } 34320 } 34321 } 34322 })] 34323 }); 34324 } 34325 const bubbleHandlerKeys = { 34326 pointerdown: "onPointerDown", 34327 mousedown: "onMouseDown", 34328 click: "onClick" 34329 }; 34330 const captureHandlerKeys = { 34331 pointerdown: "onPointerDownCapture", 34332 mousedown: "onMouseDownCapture", 34333 click: "onClickCapture" 34334 }; 34335 const normalizeProp = (normalizable) => { 34336 var _normalizable$escapeK, _normalizable$outside; 34337 return { 34338 escapeKey: typeof normalizable === "boolean" ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false, 34339 outsidePress: typeof normalizable === "boolean" ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true 34340 }; 34341 }; 34342 function useDismiss(context, props) { 34343 if (props === void 0) { 34344 props = {}; 34345 } 34346 const { 34347 open, 34348 onOpenChange, 34349 elements, 34350 dataRef 34351 } = context; 34352 const { 34353 enabled = true, 34354 escapeKey = true, 34355 outsidePress: unstable_outsidePress = true, 34356 outsidePressEvent = "pointerdown", 34357 referencePress = false, 34358 referencePressEvent = "pointerdown", 34359 ancestorScroll = false, 34360 bubbles, 34361 capture 34362 } = props; 34363 const tree = useFloatingTree(); 34364 const outsidePressFn = useEffectEvent(typeof unstable_outsidePress === "function" ? unstable_outsidePress : () => false); 34365 const outsidePress = typeof unstable_outsidePress === "function" ? outsidePressFn : unstable_outsidePress; 34366 const endedOrStartedInsideRef = reactExports.useRef(false); 34367 const { 34368 escapeKey: escapeKeyBubbles, 34369 outsidePress: outsidePressBubbles 34370 } = normalizeProp(bubbles); 34371 const { 34372 escapeKey: escapeKeyCapture, 34373 outsidePress: outsidePressCapture 34374 } = normalizeProp(capture); 34375 const isComposingRef = reactExports.useRef(false); 34376 const closeOnEscapeKeyDown = useEffectEvent((event) => { 34377 var _dataRef$current$floa; 34378 if (!open || !enabled || !escapeKey || event.key !== "Escape") { 34379 return; 34380 } 34381 if (isComposingRef.current) { 34382 return; 34383 } 34384 const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId; 34385 const children = tree ? getNodeChildren$1(tree.nodesRef.current, nodeId) : []; 34386 if (!escapeKeyBubbles) { 34387 event.stopPropagation(); 34388 if (children.length > 0) { 34389 let shouldDismiss = true; 34390 children.forEach((child) => { 34391 var _child$context; 34392 if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) { 34393 shouldDismiss = false; 34394 return; 34395 } 34396 }); 34397 if (!shouldDismiss) { 34398 return; 34399 } 34400 } 34401 } 34402 onOpenChange(false, isReactEvent(event) ? event.nativeEvent : event, "escape-key"); 34403 }); 34404 const closeOnEscapeKeyDownCapture = useEffectEvent((event) => { 34405 var _getTarget2; 34406 const callback = () => { 34407 var _getTarget; 34408 closeOnEscapeKeyDown(event); 34409 (_getTarget = getTarget$1(event)) == null || _getTarget.removeEventListener("keydown", callback); 34410 }; 34411 (_getTarget2 = getTarget$1(event)) == null || _getTarget2.addEventListener("keydown", callback); 34412 }); 34413 const closeOnPressOutside = useEffectEvent((event) => { 34414 var _dataRef$current$floa2; 34415 const insideReactTree = dataRef.current.insideReactTree; 34416 dataRef.current.insideReactTree = false;
34417 const endedOrStartedInside = endedOrStartedInsideRef.current; 34418 endedOrStartedInsideRef.current = false; 34419 if (outsidePressEvent === "click" && endedOrStartedInside) { 34420 return; 34421 } 34422 if (insideReactTree) { 34423 return; 34424 } 34425 if (typeof outsidePress === "function" && !outsidePress(event)) { 34426 return; 34427 } 34428 const target = getTarget$1(event); 34429 const inertSelector = "[" + createAttribute("inert") + "]"; 34430 const markers = getDocument$1(elements.floating).querySelectorAll(inertSelector); 34431 let targetRootAncestor = isElement(target) ? target : null; 34432 while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { 34433 const nextParent = getParentNode(targetRootAncestor); 34434 if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { 34435 break; 34436 } 34437 targetRootAncestor = nextParent; 34438 } 34439 if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). 34440 !contains$1(target, elements.floating) && // If the target root element contains none of the markers, then the 34441 // element was injected after the floating element rendered. 34442 Array.from(markers).every((marker) => !contains$1(targetRootAncestor, marker))) { 34443 return; 34444 } 34445 if (isHTMLElement(target) && floating) { 34446 const lastTraversableNode = isLastTraversableNode(target); 34447 const style = getComputedStyle$2(target); 34448 const scrollRe = /auto|scroll/; 34449 const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); 34450 const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); 34451 const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; 34452 const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; 34453 const isRTL2 = style.direction === "rtl"; 34454 const pressedVerticalScrollbar = canScrollY && (isRTL2 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); 34455 const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; 34456 if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { 34457 return; 34458 } 34459 } 34460 const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId; 34461 const targetIsInsideChildren = tree && getNodeChildren$1(tree.nodesRef.current, nodeId).some((node2) => { 34462 var _node$context; 34463 return isEventTargetWithin(event, (_node$context = node2.context) == null ? void 0 : _node$context.elements.floating); 34464 }); 34465 if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) { 34466 return; 34467 } 34468 const children = tree ? getNodeChildren$1(tree.nodesRef.current, nodeId) : []; 34469 if (children.length > 0) { 34470 let shouldDismiss = true; 34471 children.forEach((child) => { 34472 var _child$context2; 34473 if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) { 34474 shouldDismiss = false; 34475 return; 34476 } 34477 }); 34478 if (!shouldDismiss) { 34479 return; 34480 } 34481 } 34482 onOpenChange(false, event, "outside-press"); 34483 }); 34484 const closeOnPressOutsideCapture = useEffectEvent((event) => { 34485 var _getTarget4; 34486 const callback = () => { 34487 var _getTarget3; 34488 closeOnPressOutside(event); 34489 (_getTarget3 = getTarget$1(event)) == null || _getTarget3.removeEventListener(outsidePressEvent, callback); 34490 }; 34491 (_getTarget4 = getTarget$1(event)) == null || _getTarget4.addEventListener(outsidePressEvent, callback); 34492 }); 34493 reactExports.useEffect(() => { 34494 if (!open || !enabled) { 34495 return; 34496 } 34497 dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; 34498 dataRef.current.__outsidePressBubbles = outsidePressBubbles; 34499 let compositionTimeout = -1; 34500 function onScroll(event) { 34501 onOpenChange(false, event, "ancestor-scroll"); 34502 } 34503 function handleCompositionStart() { 34504 window.clearTimeout(compositionTimeout); 34505 isComposingRef.current = true; 34506 } 34507 function handleCompositionEnd() { 34508 compositionTimeout = window.setTimeout( 34509 () => { 34510 isComposingRef.current = false;
34511 }, 34512 // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. 34513 // Only apply to WebKit for the test to remain 0ms. 34514 isWebKit() ? 5 : 0 34515 ); 34516 } 34517 const doc = getDocument$1(elements.floating); 34518 if (escapeKey) { 34519 doc.addEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture); 34520 doc.addEventListener("compositionstart", handleCompositionStart); 34521 doc.addEventListener("compositionend", handleCompositionEnd); 34522 } 34523 outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture); 34524 let ancestors = []; 34525 if (ancestorScroll) { 34526 if (isElement(elements.domReference)) { 34527 ancestors = getOverflowAncestors(elements.domReference); 34528 } 34529 if (isElement(elements.floating)) { 34530 ancestors = ancestors.concat(getOverflowAncestors(elements.floating)); 34531 } 34532 if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) { 34533 ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement)); 34534 } 34535 } 34536 ancestors = ancestors.filter((ancestor) => { 34537 var _doc$defaultView; 34538 return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport); 34539 }); 34540 ancestors.forEach((ancestor) => { 34541 ancestor.addEventListener("scroll", onScroll, { 34542 passive: true 34543 }); 34544 }); 34545 return () => { 34546 if (escapeKey) { 34547 doc.removeEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture); 34548 doc.removeEventListener("compositionstart", handleCompositionStart); 34549 doc.removeEventListener("compositionend", handleCompositionEnd); 34550 } 34551 outsidePress && doc.removeEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture); 34552 ancestors.forEach((ancestor) => { 34553 ancestor.removeEventListener("scroll", onScroll); 34554 }); 34555 window.clearTimeout(compositionTimeout); 34556 }; 34557 }, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]); 34558 reactExports.useEffect(() => { 34559 dataRef.current.insideReactTree = false; 34560 }, [dataRef, outsidePress, outsidePressEvent]); 34561 const reference = reactExports.useMemo(() => __spreadValues({ 34562 onKeyDown: closeOnEscapeKeyDown 34563 }, referencePress && __spreadValues({ 34564 [bubbleHandlerKeys[referencePressEvent]]: (event) => { 34565 onOpenChange(false, event.nativeEvent, "reference-press"); 34566 } 34567 }, referencePressEvent !== "click" && { 34568 onClick(event) { 34569 onOpenChange(false, event.nativeEvent, "reference-press"); 34570 } 34571 })), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]); 34572 const floating = reactExports.useMemo(() => ({ 34573 onKeyDown: closeOnEscapeKeyDown, 34574 onMouseDown() { 34575 endedOrStartedInsideRef.current = true; 34576 }, 34577 onMouseUp() { 34578 endedOrStartedInsideRef.current = true; 34579 }, 34580 [captureHandlerKeys[outsidePressEvent]]: () => { 34581 dataRef.current.insideReactTree = true; 34582 } 34583 }), [closeOnEscapeKeyDown, outsidePressEvent, dataRef]); 34584 return reactExports.useMemo(() => enabled ? { 34585 reference, 34586 floating 34587 } : {}, [enabled, reference, floating]); 34588 } 34589 function useFloatingRootContext(options2) { 34590 const { 34591 open = false, 34592 onOpenChange: onOpenChangeProp, 34593 elements: elementsProp 34594 } = options2; 34595 const floatingId = useId(); 34596 const dataRef = reactExports.useRef({}); 34597 const [events] = reactExports.useState(() => createEventEmitter()); 34598 const nested = useFloatingParentNodeId() != null; 34599 const [positionReference, setPositionReference] = reactExports.useState(elementsProp.reference); 34600 const onOpenChange = useEffectEvent((open2, event, reason) => { 34601 dataRef.current.openEvent = open2 ? event : void 0; 34602 events.emit("openchange", { 34603 open: open2, 34604 event, 34605 reason, 34606 nested 34607 }); 34608 onOpenChangeProp == null || onOpenChangeProp(open2, event, reason); 34609 }); 34610 const refs = reactExports.useMemo(() => ({ 34611 setPositionReference 34612 }), []); 34613 const elements = reactExports.useMemo(() => ({ 34614 reference: positionReference || elementsProp.reference || null, 34615 floating: elementsProp.floating || null, 34616 domReference: elementsProp.reference 34617 }), [positionReference, elementsProp.reference, elementsProp.floating]); 34618 return reactExports.useMemo(() => ({ 34619 dataRef, 34620 open, 34621 onOpenChange, 34622 elements, 34623 events, 34624 floatingId, 34625 refs 34626 }), [open, onOpenChange, elements, events, floatingId, refs]); 34627 } 34628 function useFloating(options2) { 34629 if (options2 === void 0) { 34630 options2 = {}; 34631 } 34632 const { 34633 nodeId 34634 } = options2; 34635 const internalRootContext = useFloatingRootContext(__spreadProps(__spreadValues({}, options2), { 34636 elements: __spreadValues({ 34637 reference: null, 34638 floating: null 34639 }, options2.elements) 34640 })); 34641 const rootContext = options2.rootContext || internalRootContext; 34642 const computedElements = rootContext.elements; 34643 const [_domReference, setDomReference] = reactExports.useState(null); 34644 const [positionReference, _setPositionReference] = reactExports.useState(null); 34645 const optionDomReference = computedElements == null ? void 0 : computedElements.domReference; 34646 const domReference = optionDomReference || _domReference; 34647 const domReferenceRef = reactExports.useRef(null); 34648 const tree = useFloatingTree(); 34649 index$1(() => { 34650 if (domReference) { 34651 domReferenceRef.current = domReference; 34652 } 34653 }, [domReference]); 34654 const position2 = useFloating$1(__spreadProps(__spreadValues({}, options2), { 34655 elements: __spreadValues(__spreadValues({}, computedElements), positionReference && { 34656 reference: positionReference 34657 }) 34658 })); 34659 const setPositionReference = reactExports.useCallback((node2) => { 34660 const computedPositionReference = isElement(node2) ? { 34661 getBoundingClientRect: () => node2.getBoundingClientRect(), 34662 getClientRects: () => node2.getClientRects(), 34663 contextElement: node2 34664 } : node2; 34665 _setPositionReference(computedPositionReference); 34666 position2.refs.setReference(computedPositionReference); 34667 }, [position2.refs]); 34668 const setReference = reactExports.useCallback((node2) => { 34669 if (isElement(node2) || node2 === null) { 34670 domReferenceRef.current = node2; 34671 setDomReference(node2); 34672 } 34673 if (isElement(position2.refs.reference.current) || position2.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
34674 // `null` to support `positionReference` + an unstable `reference` 34675 // callback ref. 34676 node2 !== null && !isElement(node2)) { 34677 position2.refs.setReference(node2); 34678 } 34679 }, [position2.refs]); 34680 const refs = reactExports.useMemo(() => __spreadProps(__spreadValues({}, position2.refs), { 34681 setReference, 34682 setPositionReference, 34683 domReference: domReferenceRef 34684 }), [position2.refs, setReference, setPositionReference]); 34685 const elements = reactExports.useMemo(() => __spreadProps(__spreadValues({}, position2.elements), { 34686 domReference 34687 }), [position2.elements, domReference]); 34688 const context = reactExports.useMemo(() => __spreadProps(__spreadValues(__spreadValues({}, position2), rootContext), { 34689 refs, 34690 elements, 34691 nodeId 34692 }), [position2, refs, elements, nodeId, rootContext]); 34693 index$1(() => { 34694 rootContext.dataRef.current.floatingContext = context; 34695 const node2 = tree == null ? void 0 : tree.nodesRef.current.find((node22) => node22.id === nodeId); 34696 if (node2) { 34697 node2.context = context; 34698 } 34699 }); 34700 return reactExports.useMemo(() => __spreadProps(__spreadValues({}, position2), { 34701 context, 34702 refs, 34703 elements 34704 }), [position2, refs, elements, context]); 34705 } 34706 function isMacSafari() { 34707 return isMac() && isSafari(); 34708 } 34709 function useFocus(context, props) { 34710 if (props === void 0) { 34711 props = {}; 34712 } 34713 const { 34714 open, 34715 onOpenChange, 34716 events, 34717 dataRef, 34718 elements 34719 } = context; 34720 const { 34721 enabled = true, 34722 visibleOnly = true 34723 } = props; 34724 const blockFocusRef = reactExports.useRef(false); 34725 const timeoutRef = reactExports.useRef(-1); 34726 const keyboardModalityRef = reactExports.useRef(true); 34727 reactExports.useEffect(() => { 34728 if (!enabled) return; 34729 const win = getWindow(elements.domReference); 34730 function onBlur() { 34731 if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument$1(elements.domReference))) { 34732 blockFocusRef.current = true; 34733 } 34734 } 34735 function onKeyDown() { 34736 keyboardModalityRef.current = true; 34737 } 34738 function onPointerDown() { 34739 keyboardModalityRef.current = false; 34740 } 34741 win.addEventListener("blur", onBlur); 34742 if (isMacSafari()) { 34743 win.addEventListener("keydown", onKeyDown, true); 34744 win.addEventListener("pointerdown", onPointerDown, true); 34745 } 34746 return () => { 34747 win.removeEventListener("blur", onBlur); 34748 if (isMacSafari()) { 34749 win.removeEventListener("keydown", onKeyDown, true); 34750 win.removeEventListener("pointerdown", onPointerDown, true); 34751 } 34752 }; 34753 }, [elements.domReference, open, enabled]); 34754 reactExports.useEffect(() => { 34755 if (!enabled) return; 34756 function onOpenChange2(_ref2) { 34757 let { 34758 reason 34759 } = _ref2; 34760 if (reason === "reference-press" || reason === "escape-key") { 34761 blockFocusRef.current = true; 34762 } 34763 } 34764 events.on("openchange", onOpenChange2); 34765 return () => { 34766 events.off("openchange", onOpenChange2); 34767 }; 34768 }, [events, enabled]); 34769 reactExports.useEffect(() => { 34770 return () => { 34771 clearTimeoutIfSet(timeoutRef); 34772 }; 34773 }, []); 34774 const reference = reactExports.useMemo(() => ({ 34775 onMouseLeave() { 34776 blockFocusRef.current = false; 34777 }, 34778 onFocus(event) { 34779 if (blockFocusRef.current) return; 34780 const target = getTarget$1(event.nativeEvent); 34781 if (visibleOnly && isElement(target)) { 34782 if (isMacSafari() && !event.relatedTarget) { 34783 if (!keyboardModalityRef.current && !isTypeableElement(target)) { 34784 return; 34785 } 34786 } else if (!matchesFocusVisible(target)) { 34787 return; 34788 } 34789 } 34790 onOpenChange(true, event.nativeEvent, "focus"); 34791 }, 34792 onBlur(event) { 34793 blockFocusRef.current = false;
34794 const relatedTarget = event.relatedTarget; 34795 const nativeEvent = event.nativeEvent; 34796 const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside"; 34797 timeoutRef.current = window.setTimeout(() => { 34798 var _dataRef$current$floa; 34799 const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document); 34800 if (!relatedTarget && activeEl === elements.domReference) return; 34801 if (contains$1((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains$1(elements.domReference, activeEl) || movedToFocusGuard) { 34802 return; 34803 } 34804 onOpenChange(false, nativeEvent, "focus"); 34805 }); 34806 } 34807 }), [dataRef, elements.domReference, onOpenChange, visibleOnly]); 34808 return reactExports.useMemo(() => enabled ? { 34809 reference 34810 } : {}, [enabled, reference]); 34811 } 34812 function mergeProps(userProps, propsList, elementKey) { 34813 const map2 = /* @__PURE__ */ new Map(); 34814 const isItem = elementKey === "item"; 34815 let domUserProps = userProps; 34816 if (isItem && userProps) { 34817 const _a = userProps, { 34818 [ACTIVE_KEY]: _2, 34819 [SELECTED_KEY]: __ 34820 } = _a, validProps = __objRest(_a, [ 34821 __restKey(ACTIVE_KEY), 34822 __restKey(SELECTED_KEY) 34823 ]); 34824 domUserProps = validProps; 34825 } 34826 return __spreadValues(__spreadValues(__spreadValues({}, elementKey === "floating" && { 34827 tabIndex: -1, 34828 [FOCUSABLE_ATTRIBUTE]: "" 34829 }), domUserProps), propsList.map((value) => { 34830 const propsOrGetProps = value ? value[elementKey] : null; 34831 if (typeof propsOrGetProps === "function") { 34832 return userProps ? propsOrGetProps(userProps) : null; 34833 } 34834 return propsOrGetProps; 34835 }).concat(userProps).reduce((acc, props) => { 34836 if (!props) { 34837 return acc; 34838 } 34839 Object.entries(props).forEach((_ref2) => { 34840 let [key, value] = _ref2; 34841 if (isItem && [ACTIVE_KEY, SELECTED_KEY].includes(key)) { 34842 return; 34843 } 34844 if (key.indexOf("on") === 0) { 34845 if (!map2.has(key)) { 34846 map2.set(key, []); 34847 } 34848 if (typeof value === "function") { 34849 var _map$get; 34850 (_map$get = map2.get(key)) == null || _map$get.push(value); 34851 acc[key] = function() { 34852 var _map$get2; 34853 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 34854 args[_key] = arguments[_key]; 34855 } 34856 return (_map$get2 = map2.get(key)) == null ? void 0 : _map$get2.map((fn2) => fn2(...args)).find((val) => val !== void 0); 34857 }; 34858 } 34859 } else { 34860 acc[key] = value; 34861 } 34862 }); 34863 return acc; 34864 }, {})); 34865 } 34866 function useInteractions(propsList) { 34867 if (propsList === void 0) { 34868 propsList = []; 34869 } 34870 const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference); 34871 const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating); 34872 const itemDeps = propsList.map((key) => key == null ? void 0 : key.item); 34873 const getReferenceProps = reactExports.useCallback( 34874 (userProps) => mergeProps(userProps, propsList, "reference"), 34875 // eslint-disable-next-line react-hooks/exhaustive-deps 34876 referenceDeps 34877 ); 34878 const getFloatingProps = reactExports.useCallback( 34879 (userProps) => mergeProps(userProps, propsList, "floating"), 34880 // eslint-disable-next-line react-hooks/exhaustive-deps 34881 floatingDeps 34882 ); 34883 const getItemProps = reactExports.useCallback( 34884 (userProps) => mergeProps(userProps, propsList, "item"), 34885 // eslint-disable-next-line react-hooks/exhaustive-deps 34886 itemDeps 34887 ); 34888 return reactExports.useMemo(() => ({ 34889 getReferenceProps, 34890 getFloatingProps, 34891 getItemProps 34892 }), [getReferenceProps, getFloatingProps, getItemProps]); 34893 } 34894 const componentRoleToAriaRoleMap = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", false]]); 34895 function useRole(context, props) { 34896 var _elements$domReferenc, _componentRoleToAriaR; 34897 if (props === void 0) { 34898 props = {}; 34899 } 34900 const { 34901 open, 34902 elements, 34903 floatingId: defaultFloatingId 34904 } = context; 34905 const { 34906 enabled = true, 34907 role = "dialog" 34908 } = props; 34909 const defaultReferenceId = useId(); 34910 const referenceId = ((_elements$domReferenc = elements.domReference) == null ? void 0 : _elements$domReferenc.id) || defaultReferenceId; 34911 const floatingId = reactExports.useMemo(() => { 34912 var _getFloatingFocusElem; 34913 return ((_getFloatingFocusElem = getFloatingFocusElement(elements.floating)) == null ? void 0 : _getFloatingFocusElem.id) || defaultFloatingId; 34914 }, [elements.floating, defaultFloatingId]); 34915 const ariaRole = (_componentRoleToAriaR = componentRoleToAriaRoleMap.get(role)) != null ? _componentRoleToAriaR : role; 34916 const parentId = useFloatingParentNodeId(); 34917 const isNested = parentId != null; 34918 const reference = reactExports.useMemo(() => { 34919 if (ariaRole === "tooltip" || role === "label") { 34920 return { 34921 ["aria-" + (role === "label" ? "labelledby" : "describedby")]: open ? floatingId : void 0 34922 }; 34923 } 34924 return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({ 34925 "aria-expanded": open ? "true" : "false", 34926 "aria-haspopup": ariaRole === "alertdialog" ? "dialog" : ariaRole, 34927 "aria-controls": open ? floatingId : void 0 34928 }, ariaRole === "listbox" && { 34929 role: "combobox" 34930 }), ariaRole === "menu" && { 34931 id: referenceId 34932 }), ariaRole === "menu" && isNested && { 34933 role: "menuitem" 34934 }), role === "select" && { 34935 "aria-autocomplete": "none" 34936 }), role === "combobox" && { 34937 "aria-autocomplete": "list" 34938 }); 34939 }, [ariaRole, floatingId, isNested, open, referenceId, role]); 34940 const floating = reactExports.useMemo(() => { 34941 const floatingProps = __spreadValues({ 34942 id: floatingId 34943 }, ariaRole && { 34944 role: ariaRole 34945 }); 34946 if (ariaRole === "tooltip" || role === "label") { 34947 return floatingProps; 34948 } 34949 return __spreadValues(__spreadValues({}, floatingProps), ariaRole === "menu" && { 34950 "aria-labelledby": referenceId 34951 }); 34952 }, [ariaRole, floatingId, referenceId, role]); 34953 const item = reactExports.useCallback((_ref2) => { 34954 let { 34955 active, 34956 selected 34957 } = _ref2; 34958 const commonProps = __spreadValues({ 34959 role: "option" 34960 }, active && { 34961 id: floatingId + "-fui-option" 34962 }); 34963 switch (role) { 34964 case "select": 34965 case "combobox": 34966 return __spreadProps(__spreadValues({}, commonProps), { 34967 "aria-selected": selected 34968 }); 34969 } 34970 return {}; 34971 }, [floatingId, role]); 34972 return reactExports.useMemo(() => enabled ? { 34973 reference, 34974 floating, 34975 item 34976 } : {}, [enabled, reference, floating, item]); 34977 } 34978 const camelCaseToKebabCase = (str) => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($2, ofs) => (ofs ? "-" : "") + $2.toLowerCase()); 34979 function execWithArgsOrReturn(valueOrFn, args) { 34980 return typeof valueOrFn === "function" ? valueOrFn(args) : valueOrFn; 34981 } 34982 function useDelayUnmount(open, durationMs) { 34983 const [isMounted, setIsMounted] = reactExports.useState(open); 34984 if (open && !isMounted) { 34985 setIsMounted(true); 34986 } 34987 reactExports.useEffect(() => { 34988 if (!open && isMounted) { 34989 const timeout = setTimeout(() => setIsMounted(false), durationMs); 34990 return () => clearTimeout(timeout); 34991 } 34992 }, [open, isMounted, durationMs]); 34993 return isMounted; 34994 } 34995 function useTransitionStatus(context, props) { 34996 if (props === void 0) { 34997 props = {}; 34998 } 34999 const { 35000 open, 35001 elements: { 35002 floating 35003 } 35004 } = context; 35005 const { 35006 duration = 250 35007 } = props; 35008 const isNumberDuration = typeof duration === "number"; 35009 const closeDuration = (isNumberDuration ? duration : duration.close) || 0; 35010 const [status, setStatus] = reactExports.useState("unmounted"); 35011 const isMounted = useDelayUnmount(open, closeDuration); 35012 if (!isMounted && status === "close") { 35013 setStatus("unmounted"); 35014 } 35015 index$1(() => { 35016 if (!floating) return; 35017 if (open) { 35018 setStatus("initial"); 35019 const frame2 = requestAnimationFrame(() => { 35020 reactDomExports.flushSync(() => { 35021 setStatus("open"); 35022 }); 35023 }); 35024 return () => { 35025 cancelAnimationFrame(frame2); 35026 }; 35027 } 35028 setStatus("close"); 35029 }, [open, floating]); 35030 return { 35031 isMounted, 35032 status 35033 }; 35034 } 35035 function useTransitionStyles(context, props) { 35036 if (props === void 0) { 35037 props = {}; 35038 } 35039 const { 35040 initial: unstable_initial = { 35041 opacity: 0 35042 }, 35043 open: unstable_open, 35044 close: unstable_close, 35045 common: unstable_common, 35046 duration = 250 35047 } = props; 35048 const placement = context.placement; 35049 const side = placement.split("-")[0]; 35050 const fnArgs = reactExports.useMemo(() => ({ 35051 side, 35052 placement 35053 }), [side, placement]); 35054 const isNumberDuration = typeof duration === "number"; 35055 const openDuration = (isNumberDuration ? duration : duration.open) || 0; 35056 const closeDuration = (isNumberDuration ? duration : duration.close) || 0; 35057 const [styles, setStyles] = reactExports.useState(() => __spreadValues(__spreadValues({}, execWithArgsOrReturn(unstable_common, fnArgs)), execWithArgsOrReturn(unstable_initial, fnArgs))); 35058 const { 35059 isMounted, 35060 status 35061 } = useTransitionStatus(context, { 35062 duration 35063 }); 35064 const initialRef = useLatestRef$1(unstable_initial); 35065 const openRef = useLatestRef$1(unstable_open); 35066 const closeRef = useLatestRef$1(unstable_close); 35067 const commonRef = useLatestRef$1(unstable_common); 35068 index$1(() => { 35069 const initialStyles = execWithArgsOrReturn(initialRef.current, fnArgs); 35070 const closeStyles = execWithArgsOrReturn(closeRef.current, fnArgs); 35071 const commonStyles = execWithArgsOrReturn(commonRef.current, fnArgs); 35072 const openStyles = execWithArgsOrReturn(openRef.current, fnArgs) || Object.keys(initialStyles).reduce((acc, key) => { 35073 acc[key] = ""; 35074 return acc; 35075 }, {}); 35076 if (status === "initial") { 35077 setStyles((styles2) => __spreadValues(__spreadValues({ 35078 transitionProperty: styles2.transitionProperty 35079 }, commonStyles), initialStyles)); 35080 } 35081 if (status === "open") { 35082 setStyles(__spreadValues(__spreadValues({ 35083 transitionProperty: Object.keys(openStyles).map(camelCaseToKebabCase).join(","), 35084 transitionDuration: openDuration + "ms"
35085 }, commonStyles), openStyles)); 35086 } 35087 if (status === "close") { 35088 const styles2 = closeStyles || initialStyles; 35089 setStyles(__spreadValues(__spreadValues({ 35090 transitionProperty: Object.keys(styles2).map(camelCaseToKebabCase).join(","), 35091 transitionDuration: closeDuration + "ms" 35092 }, commonStyles), styles2)); 35093 } 35094 }, [closeDuration, closeRef, initialRef, openRef, commonRef, openDuration, status, fnArgs]); 35095 return { 35096 isMounted, 35097 styles 35098 }; 35099 } 35100 function getNodeChildren(nodes, id2, onlyOpenChildren) { 35101 if (onlyOpenChildren === void 0) { 35102 onlyOpenChildren = true; 35103 } 35104 const directChildren = nodes.filter((node2) => { 35105 var _node$context; 35106 return node2.parentId === id2 && (!onlyOpenChildren || ((_node$context = node2.context) == null ? void 0 : _node$context.open)); 35107 }); 35108 return directChildren.flatMap((child) => [child, ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); 35109 } 35110 function isPointInPolygon(point, polygon) { 35111 const [x2, y2] = point; 35112 let isInside2 = false; 35113 const length2 = polygon.length; 35114 for (let i2 = 0, j2 = length2 - 1; i2 < length2; j2 = i2++) { 35115 const [xi2, yi2] = polygon[i2] || [0, 0]; 35116 const [xj, yj] = polygon[j2] || [0, 0]; 35117 const intersect = yi2 >= y2 !== yj >= y2 && x2 <= (xj - xi2) * (y2 - yi2) / (yj - yi2) + xi2; 35118 if (intersect) { 35119 isInside2 = !isInside2; 35120 } 35121 } 35122 return isInside2; 35123 } 35124 function isInside(point, rect) { 35125 return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height; 35126 } 35127 function safePolygon(options2) { 35128 if (options2 === void 0) { 35129 options2 = {}; 35130 } 35131 const { 35132 buffer = 0.5, 35133 blockPointerEvents = false, 35134 requireIntent = true 35135 } = options2; 35136 const timeoutRef = { 35137 current: -1 35138 }; 35139 let hasLanded = false; 35140 let lastX = null; 35141 let lastY = null; 35142 let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0; 35143 function getCursorSpeed(x2, y2) { 35144 const currentTime = performance.now(); 35145 const elapsedTime = currentTime - lastCursorTime; 35146 if (lastX === null || lastY === null || elapsedTime === 0) { 35147 lastX = x2; 35148 lastY = y2; 35149 lastCursorTime = currentTime; 35150 return null; 35151 } 35152 const deltaX = x2 - lastX; 35153 const deltaY = y2 - lastY; 35154 const distance2 = Math.sqrt(deltaX * deltaX + deltaY * deltaY); 35155 const speed = distance2 / elapsedTime; 35156 lastX = x2; 35157 lastY = y2; 35158 lastCursorTime = currentTime; 35159 return speed; 35160 } 35161 const fn2 = (_ref2) => { 35162 let { 35163 x: x2, 35164 y: y2, 35165 placement, 35166 elements, 35167 onClose, 35168 nodeId, 35169 tree 35170 } = _ref2; 35171 return function onMouseMove(event) { 35172 function close() { 35173 clearTimeoutIfSet(timeoutRef); 35174 onClose(); 35175 } 35176 clearTimeoutIfSet(timeoutRef); 35177 if (!elements.domReference || !elements.floating || placement == null || x2 == null || y2 == null) { 35178 return; 35179 } 35180 const { 35181 clientX, 35182 clientY 35183 } = event; 35184 const clientPoint = [clientX, clientY]; 35185 const target = getTarget(event); 35186 const isLeave = event.type === "mouseleave"; 35187 const isOverFloatingEl = contains(elements.floating, target); 35188 const isOverReferenceEl = contains(elements.domReference, target); 35189 const refRect = elements.domReference.getBoundingClientRect(); 35190 const rect = elements.floating.getBoundingClientRect(); 35191 const side = placement.split("-")[0]; 35192 const cursorLeaveFromRight = x2 > rect.right - rect.width / 2; 35193 const cursorLeaveFromBottom = y2 > rect.bottom - rect.height / 2; 35194 const isOverReferenceRect = isInside(clientPoint, refRect); 35195 const isFloatingWider = rect.width > refRect.width; 35196 const isFloatingTaller = rect.height > refRect.height; 35197 const left = (isFloatingWider ? refRect : rect).left; 35198 const right = (isFloatingWider ? refRect : rect).right; 35199 const top = (isFloatingTaller ? refRect : rect).top; 35200 const bottom = (isFloatingTaller ? refRect : rect).bottom; 35201 if (isOverFloatingEl) { 35202 hasLanded = true; 35203 if (!isLeave) { 35204 return; 35205 } 35206 } 35207 if (isOverReferenceEl) { 35208 hasLanded = false;
35209 } 35210 if (isOverReferenceEl && !isLeave) { 35211 hasLanded = true; 35212 return; 35213 } 35214 if (isLeave && isElement(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) { 35215 return; 35216 } 35217 if (tree && getNodeChildren(tree.nodesRef.current, nodeId).length) { 35218 return; 35219 } 35220 if (side === "top" && y2 >= refRect.bottom - 1 || side === "bottom" && y2 <= refRect.top + 1 || side === "left" && x2 >= refRect.right - 1 || side === "right" && x2 <= refRect.left + 1) { 35221 return close(); 35222 } 35223 let rectPoly = []; 35224 switch (side) { 35225 case "top": 35226 rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]]; 35227 break; 35228 case "bottom": 35229 rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]]; 35230 break; 35231 case "left": 35232 rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]]; 35233 break; 35234 case "right": 35235 rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]]; 35236 break; 35237 } 35238 function getPolygon(_ref22) { 35239 let [x22, y22] = _ref22; 35240 switch (side) { 35241 case "top": { 35242 const cursorPointOne = [isFloatingWider ? x22 + buffer / 2 : cursorLeaveFromRight ? x22 + buffer * 4 : x22 - buffer * 4, y22 + buffer + 1]; 35243 const cursorPointTwo = [isFloatingWider ? x22 - buffer / 2 : cursorLeaveFromRight ? x22 + buffer * 4 : x22 - buffer * 4, y22 + buffer + 1]; 35244 const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]]; 35245 return [cursorPointOne, cursorPointTwo, ...commonPoints]; 35246 } 35247 case "bottom": { 35248 const cursorPointOne = [isFloatingWider ? x22 + buffer / 2 : cursorLeaveFromRight ? x22 + buffer * 4 : x22 - buffer * 4, y22 - buffer]; 35249 const cursorPointTwo = [isFloatingWider ? x22 - buffer / 2 : cursorLeaveFromRight ? x22 + buffer * 4 : x22 - buffer * 4, y22 - buffer]; 35250 const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]]; 35251 return [cursorPointOne, cursorPointTwo, ...commonPoints]; 35252 } 35253 case "left": { 35254 const cursorPointOne = [x22 + buffer + 1, isFloatingTaller ? y22 + buffer / 2 : cursorLeaveFromBottom ? y22 + buffer * 4 : y22 - buffer * 4]; 35255 const cursorPointTwo = [x22 + buffer + 1, isFloatingTaller ? y22 - buffer / 2 : cursorLeaveFromBottom ? y22 + buffer * 4 : y22 - buffer * 4]; 35256 const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]]; 35257 return [...commonPoints, cursorPointOne, cursorPointTwo]; 35258 } 35259 case "right": { 35260 const cursorPointOne = [x22 - buffer, isFloatingTaller ? y22 + buffer / 2 : cursorLeaveFromBottom ? y22 + buffer * 4 : y22 - buffer * 4]; 35261 const cursorPointTwo = [x22 - buffer, isFloatingTaller ? y22 - buffer / 2 : cursorLeaveFromBottom ? y22 + buffer * 4 : y22 - buffer * 4]; 35262 const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]]; 35263 return [cursorPointOne, cursorPointTwo, ...commonPoints]; 35264 } 35265 } 35266 } 35267 if (isPointInPolygon([clientX, clientY], rectPoly)) { 35268 return; 35269 } 35270 if (hasLanded && !isOverReferenceRect) { 35271 return close(); 35272 } 35273 if (!isLeave && requireIntent) { 35274 const cursorSpeed = getCursorSpeed(event.clientX, event.clientY); 35275 const cursorSpeedThreshold = 0.1;
35276 if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) { 35277 return close(); 35278 } 35279 } 35280 if (!isPointInPolygon([clientX, clientY], getPolygon([x2, y2]))) { 35281 close(); 35282 } else if (!hasLanded && requireIntent) { 35283 timeoutRef.current = window.setTimeout(close, 40); 35284 } 35285 }; 35286 }; 35287 fn2.__options = { 35288 blockPointerEvents 35289 }; 35290 return fn2; 35291 } 35292 var lib$1 = {}; 35293 var useMedia = {}; 35294 var utilities = {}; 35295 var camelToHyphen = {}; 35296 var hasRequiredCamelToHyphen; 35297 function requireCamelToHyphen() { 35298 if (hasRequiredCamelToHyphen) return camelToHyphen; 35299 hasRequiredCamelToHyphen = 1; 35300 Object.defineProperty(camelToHyphen, "__esModule", { value: true }); 35301 function camelToHyphen$1(camelString) { 35302 return camelString.replace(/[A-Z]/g, function(string2) { 35303 return "-" + string2.toLowerCase(); 35304 }).toLowerCase(); 35305 } 35306 camelToHyphen.default = camelToHyphen$1; 35307 return camelToHyphen; 35308 } 35309 var queryObjectToString = {}; 35310 var hasRequiredQueryObjectToString; 35311 function requireQueryObjectToString() { 35312 if (hasRequiredQueryObjectToString) return queryObjectToString; 35313 hasRequiredQueryObjectToString = 1; 35314 Object.defineProperty(queryObjectToString, "__esModule", { value: true }); 35315 var camelToHyphen_1 = requireCamelToHyphen(); 35316 var QUERY_COMBINATOR = " and "; 35317 function queryObjectToString$1(query) { 35318 if (typeof query === "string") { 35319 return query; 35320 } 35321 return Object.entries(query).map(function(_a) { 35322 var feature = _a[0], value = _a[1]; 35323 var convertedFeature = camelToHyphen_1.default(feature); 35324 var convertedValue = value; 35325 if (typeof convertedValue === "boolean") { 35326 return convertedValue ? convertedFeature : "not " + convertedFeature; 35327 } 35328 if (typeof convertedValue === "number" && /[height|width]$/.test(convertedFeature)) { 35329 convertedValue = convertedValue + "px"; 35330 } 35331 return "(" + convertedFeature + ": " + convertedValue + ")"; 35332 }).join(QUERY_COMBINATOR); 35333 } 35334 queryObjectToString.default = queryObjectToString$1; 35335 return queryObjectToString; 35336 } 35337 var noop$4 = {}; 35338 var hasRequiredNoop; 35339 function requireNoop() { 35340 if (hasRequiredNoop) return noop$4; 35341 hasRequiredNoop = 1; 35342 Object.defineProperty(noop$4, "__esModule", { value: true }); 35343 function noop2() { 35344 } 35345 noop$4.default = noop2; 35346 return noop$4; 35347 } 35348 var hasRequiredUtilities; 35349 function requireUtilities() { 35350 if (hasRequiredUtilities) return utilities; 35351 hasRequiredUtilities = 1; 35352 (function(exports$1) { 35353 Object.defineProperty(exports$1, "__esModule", { value: true }); 35354 exports$1.noop = exports$1.queryObjectToString = exports$1.camelToHyphen = void 0; 35355 var camelToHyphen_1 = requireCamelToHyphen(); 35356 Object.defineProperty(exports$1, "camelToHyphen", { enumerable: true, get: function() { 35357 return camelToHyphen_1.default; 35358 } }); 35359 var queryObjectToString_1 = requireQueryObjectToString(); 35360 Object.defineProperty(exports$1, "queryObjectToString", { enumerable: true, get: function() { 35361 return queryObjectToString_1.default; 35362 } }); 35363 var noop_1 = requireNoop(); 35364 Object.defineProperty(exports$1, "noop", { enumerable: true, get: function() { 35365 return noop_1.default; 35366 } }); 35367 })(utilities); 35368 return utilities; 35369 } 35370 var hasRequiredUseMedia; 35371 function requireUseMedia() { 35372 if (hasRequiredUseMedia) return useMedia; 35373 hasRequiredUseMedia = 1; 35374 (function(exports$1) { 35375 Object.defineProperty(exports$1, "__esModule", { value: true }); 35376 exports$1.useMediaLayout = exports$1.useMedia = exports$1.mockMediaQueryList = void 0; 35377 var react_1 = requireReact(); 35378 var utilities_1 = requireUtilities(); 35379 exports$1.mockMediaQueryList = { 35380 media: "", 35381 matches: false, 35382 onchange: utilities_1.noop, 35383 addListener: utilities_1.noop, 35384 removeListener: utilities_1.noop, 35385 addEventListener: utilities_1.noop, 35386 removeEventListener: utilities_1.noop, 35387 dispatchEvent: function(_2) { 35388 return true; 35389 } 35390 }; 35391 var createUseMedia = function(effect) { 35392 return function(rawQuery, defaultState) { 35393 if (defaultState === void 0) { 35394 defaultState = false;
35395 } 35396 var _a = react_1.useState(defaultState), state = _a[0], setState = _a[1]; 35397 var query = utilities_1.queryObjectToString(rawQuery); 35398 effect(function() { 35399 var mounted = true; 35400 var mediaQueryList = typeof window === "undefined" ? exports$1.mockMediaQueryList : window.matchMedia(query); 35401 var onChange = function() { 35402 if (!mounted) { 35403 return; 35404 } 35405 setState(Boolean(mediaQueryList.matches)); 35406 }; 35407 mediaQueryList.addListener(onChange); 35408 setState(mediaQueryList.matches); 35409 return function() { 35410 mounted = false; 35411 mediaQueryList.removeListener(onChange); 35412 }; 35413 }, [query]); 35414 return state; 35415 }; 35416 }; 35417 exports$1.useMedia = createUseMedia(react_1.useEffect); 35418 exports$1.useMediaLayout = createUseMedia(react_1.useLayoutEffect); 35419 exports$1.default = exports$1.useMedia; 35420 })(useMedia); 35421 return useMedia; 35422 } 35423 var hasRequiredLib$1; 35424 function requireLib$1() { 35425 if (hasRequiredLib$1) return lib$1; 35426 hasRequiredLib$1 = 1; 35427 (function(exports$1) { 35428 Object.defineProperty(exports$1, "__esModule", { value: true }); 35429 exports$1.useMediaLayout = exports$1.useMedia = exports$1.default = void 0; 35430 var useMedia_1 = requireUseMedia(); 35431 Object.defineProperty(exports$1, "default", { enumerable: true, get: function() { 35432 return useMedia_1.default; 35433 } }); 35434 Object.defineProperty(exports$1, "useMedia", { enumerable: true, get: function() { 35435 return useMedia_1.useMedia; 35436 } }); 35437 Object.defineProperty(exports$1, "useMediaLayout", { enumerable: true, get: function() { 35438 return useMedia_1.useMediaLayout; 35439 } }); 35440 })(lib$1); 35441 return lib$1; 35442 } 35443 var libExports$1 = requireLib$1(); 35444 const initialValue = { 35445 mobileM: false, 35446 tablet: false, 35447 laptopS: false, 35448 laptop: false, 35449 desktop: false, 35450 breakpoints, 35451 currentBreakpoint: "mobileM" 35452 }; 35453 const MediaQueryContext = reactExports.createContext(initialValue); 35454 const MediaQueryProvider = ({ children }) => { 35455 const mobileM = libExports$1.useMedia(mediaQueriesExpressions.mobileM); 35456 const tablet = libExports$1.useMedia(mediaQueriesExpressions.tablet); 35457 const laptopS = libExports$1.useMedia(mediaQueriesExpressions.laptopS); 35458 const laptop = libExports$1.useMedia(mediaQueriesExpressions.laptop); 35459 const desktop = libExports$1.useMedia(mediaQueriesExpressions.desktop); 35460 const currentBreakpoint = reactExports.useMemo(() => { 35461 if (desktop) { 35462 return "desktop"; 35463 } 35464 if (laptop) { 35465 return "laptop"; 35466 } 35467 if (laptopS) { 35468 return "laptopS"; 35469 } 35470 if (tablet) { 35471 return "tablet"; 35472 } 35473 if (mobileM) { 35474 return "mobileM"; 35475 } 35476 return "mobileM"; 35477 }, [desktop, laptop, laptopS, mobileM, tablet]); 35478 const value = reactExports.useMemo( 35479 () => ({ 35480 mobileM, 35481 tablet, 35482 laptopS, 35483 laptop, 35484 desktop, 35485 breakpoints, 35486 currentBreakpoint 35487 }), 35488 [mobileM, tablet, laptopS, laptop, desktop, currentBreakpoint] 35489 ); 35490 return /* @__PURE__ */ jsxRuntimeExports.jsx(MediaQueryContext.Provider, { value, children }); 35491 }; 35492 const useMediaQueryContext = () => { 35493 return reactExports.useContext(MediaQueryContext); 35494 }; 35495 const SPRING = { type: "spring", stiffness: 400, damping: 40 }; 35496 const BACKDROP_OPACITY = 0.8; 35497 const OVERLAY_Z_INDEX = 100; 35498 const LayoutGroupContext = reactExports.createContext({}); 35499 function useConstant(init2) { 35500 const ref = reactExports.useRef(null); 35501 if (ref.current === null) { 35502 ref.current = init2(); 35503 } 35504 return ref.current; 35505 } 35506 const PresenceContext = reactExports.createContext(null); 35507 const MotionConfigContext = reactExports.createContext({ 35508 transformPagePoint: (p2) => p2, 35509 isStatic: false,
35510 reducedMotion: "never" 35511 }); 35512 class PopChildMeasure extends reactExports.Component { 35513 getSnapshotBeforeUpdate(prevProps) { 35514 const element = this.props.childRef.current; 35515 if (element && prevProps.isPresent && !this.props.isPresent) { 35516 const size = this.props.sizeRef.current; 35517 size.height = element.offsetHeight || 0; 35518 size.width = element.offsetWidth || 0; 35519 size.top = element.offsetTop; 35520 size.left = element.offsetLeft; 35521 } 35522 return null; 35523 } 35524 /** 35525 * Required with getSnapshotBeforeUpdate to stop React complaining. 35526 */ 35527 componentDidUpdate() { 35528 } 35529 render() { 35530 return this.props.children; 35531 } 35532 } 35533 function PopChild({ children, isPresent }) { 35534 const id2 = reactExports.useId(); 35535 const ref = reactExports.useRef(null); 35536 const size = reactExports.useRef({ 35537 width: 0, 35538 height: 0, 35539 top: 0, 35540 left: 0 35541 }); 35542 const { nonce } = reactExports.useContext(MotionConfigContext); 35543 reactExports.useInsertionEffect(() => { 35544 const { width, height, top, left } = size.current; 35545 if (isPresent || !ref.current || !width || !height) 35546 return; 35547 ref.current.dataset.motionPopId = id2; 35548 const style = document.createElement("style"); 35549 if (nonce) 35550 style.nonce = nonce; 35551 document.head.appendChild(style); 35552 if (style.sheet) { 35553 style.sheet.insertRule(` 35554 [data-motion-pop-id="${id2}"] { 35555 position: absolute !important; 35556 width: ${width}px !important; 35557 height: ${height}px !important; 35558 top: ${top}px !important; 35559 left: ${left}px !important; 35560 } 35561 `); 35562 } 35563 return () => { 35564 document.head.removeChild(style); 35565 }; 35566 }, [isPresent]); 35567 return jsxRuntimeExports.jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, children: reactExports.cloneElement(children, { ref }) }); 35568 } 35569 const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode }) => { 35570 const presenceChildren = useConstant(newChildrenMap); 35571 const id2 = reactExports.useId(); 35572 const memoizedOnExitComplete = reactExports.useCallback((childId) => { 35573 presenceChildren.set(childId, true); 35574 for (const isComplete of presenceChildren.values()) { 35575 if (!isComplete) 35576 return; 35577 } 35578 onExitComplete && onExitComplete(); 35579 }, [presenceChildren, onExitComplete]); 35580 const context = reactExports.useMemo( 35581 () => ({ 35582 id: id2, 35583 initial, 35584 isPresent, 35585 custom, 35586 onExitComplete: memoizedOnExitComplete, 35587 register: (childId) => { 35588 presenceChildren.set(childId, false); 35589 return () => presenceChildren.delete(childId); 35590 } 35591 }), 35592 /** 35593 * If the presence of a child affects the layout of the components around it, 35594 * we want to make a new context value to ensure they get re-rendered 35595 * so they can detect that layout change. 35596 */ 35597 presenceAffectsLayout ? [Math.random(), memoizedOnExitComplete] : [isPresent, memoizedOnExitComplete] 35598 ); 35599 reactExports.useMemo(() => { 35600 presenceChildren.forEach((_2, key) => presenceChildren.set(key, false)); 35601 }, [isPresent]); 35602 reactExports.useEffect(() => { 35603 !isPresent && !presenceChildren.size && onExitComplete && onExitComplete(); 35604 }, [isPresent]); 35605 if (mode === "popLayout") { 35606 children = jsxRuntimeExports.jsx(PopChild, { isPresent, children }); 35607 } 35608 return jsxRuntimeExports.jsx(PresenceContext.Provider, { value: context, children }); 35609 }; 35610 function newChildrenMap() { 35611 return /* @__PURE__ */ new Map(); 35612 } 35613 function usePresence(subscribe = true) { 35614 const context = reactExports.useContext(PresenceContext); 35615 if (context === null) 35616 return [true, null]; 35617 const { isPresent, onExitComplete, register } = context; 35618 const id2 = reactExports.useId(); 35619 reactExports.useEffect(() => { 35620 if (subscribe) 35621 register(id2); 35622 }, [subscribe]); 35623 const safeToRemove = reactExports.useCallback(() => subscribe && onExitComplete && onExitComplete(id2), [id2, onExitComplete, subscribe]); 35624 return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; 35625 } 35626 const getChildKey = (child) => child.key || ""; 35627 function onlyElements(children) { 35628 const filtered = [];
35629 reactExports.Children.forEach(children, (child) => { 35630 if (reactExports.isValidElement(child)) 35631 filtered.push(child); 35632 }); 35633 return filtered; 35634 } 35635 const isBrowser = typeof window !== "undefined"; 35636 const useIsomorphicLayoutEffect$2 = isBrowser ? reactExports.useLayoutEffect : reactExports.useEffect; 35637 const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false }) => { 35638 const [isParentPresent, safeToRemove] = usePresence(propagate); 35639 const presentChildren = reactExports.useMemo(() => onlyElements(children), [children]); 35640 const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); 35641 const isInitialRender = reactExports.useRef(true); 35642 const pendingPresentChildren = reactExports.useRef(presentChildren); 35643 const exitComplete = useConstant(() => /* @__PURE__ */ new Map()); 35644 const [diffedChildren, setDiffedChildren] = reactExports.useState(presentChildren); 35645 const [renderedChildren, setRenderedChildren] = reactExports.useState(presentChildren); 35646 useIsomorphicLayoutEffect$2(() => { 35647 isInitialRender.current = false; 35648 pendingPresentChildren.current = presentChildren; 35649 for (let i2 = 0; i2 < renderedChildren.length; i2++) { 35650 const key = getChildKey(renderedChildren[i2]); 35651 if (!presentKeys.includes(key)) { 35652 if (exitComplete.get(key) !== true) { 35653 exitComplete.set(key, false); 35654 } 35655 } else { 35656 exitComplete.delete(key); 35657 } 35658 } 35659 }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); 35660 const exitingChildren = []; 35661 if (presentChildren !== diffedChildren) { 35662 let nextChildren = [...presentChildren]; 35663 for (let i2 = 0; i2 < renderedChildren.length; i2++) { 35664 const child = renderedChildren[i2]; 35665 const key = getChildKey(child); 35666 if (!presentKeys.includes(key)) { 35667 nextChildren.splice(i2, 0, child); 35668 exitingChildren.push(child); 35669 } 35670 } 35671 if (mode === "wait" && exitingChildren.length) { 35672 nextChildren = exitingChildren; 35673 } 35674 setRenderedChildren(onlyElements(nextChildren)); 35675 setDiffedChildren(presentChildren); 35676 return; 35677 } 35678 const { forceRender } = reactExports.useContext(LayoutGroupContext); 35679 return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderedChildren.map((child) => { 35680 const key = getChildKey(child); 35681 const isPresent = propagate && !isParentPresent ? false : presentChildren === renderedChildren || presentKeys.includes(key); 35682 const onExit = () => { 35683 if (exitComplete.has(key)) { 35684 exitComplete.set(key, true); 35685 } else { 35686 return; 35687 } 35688 let isEveryExitComplete = true; 35689 exitComplete.forEach((isExitComplete) => { 35690 if (!isExitComplete) 35691 isEveryExitComplete = false; 35692 }); 35693 if (isEveryExitComplete) { 35694 forceRender === null || forceRender === void 0 ? void 0 : forceRender(); 35695 setRenderedChildren(pendingPresentChildren.current); 35696 propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove()); 35697 onExitComplete && onExitComplete(); 35698 } 35699 }; 35700 return jsxRuntimeExports.jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : false, custom: isPresent ? void 0 : custom, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, children: child }, key); 35701 }) }); 35702 }; 35703 const noop$3 = /* @__NO_SIDE_EFFECTS__ */ (any) => any; 35704 let invariant = noop$3; 35705 // @__NO_SIDE_EFFECTS__ 35706 function memo(callback) { 35707 let result; 35708 return () => { 35709 if (result === void 0) 35710 result = callback(); 35711 return result; 35712 }; 35713 } 35714 const progress = /* @__NO_SIDE_EFFECTS__ */ (from2, to2, value) => { 35715 const toFromDifference = to2 - from2; 35716 return toFromDifference === 0 ? 1 : (value - from2) / toFromDifference; 35717 }; 35718 const secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds) => seconds * 1e3; 35719 const millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds) => milliseconds / 1e3; 35720 const MotionGlobalConfig = { 35721 useManualTiming: false 35722 }; 35723 function createRenderStep(runNextFrame) { 35724 let thisFrame = /* @__PURE__ */ new Set(); 35725 let nextFrame = /* @__PURE__ */ new Set(); 35726 let isProcessing = false;
35727 let flushNextFrame = false; 35728 const toKeepAlive = /* @__PURE__ */ new WeakSet(); 35729 let latestFrameData = { 35730 delta: 0, 35731 timestamp: 0, 35732 isProcessing: false 35733 }; 35734 function triggerCallback(callback) { 35735 if (toKeepAlive.has(callback)) { 35736 step.schedule(callback); 35737 runNextFrame(); 35738 } 35739 callback(latestFrameData); 35740 } 35741 const step = { 35742 /** 35743 * Schedule a process to run on the next frame. 35744 */ 35745 schedule: (callback, keepAlive = false, immediate = false) => { 35746 const addToCurrentFrame = immediate && isProcessing; 35747 const queue = addToCurrentFrame ? thisFrame : nextFrame; 35748 if (keepAlive) 35749 toKeepAlive.add(callback); 35750 if (!queue.has(callback)) 35751 queue.add(callback); 35752 return callback; 35753 }, 35754 /** 35755 * Cancel the provided callback from running on the next frame. 35756 */ 35757 cancel: (callback) => { 35758 nextFrame.delete(callback); 35759 toKeepAlive.delete(callback); 35760 }, 35761 /** 35762 * Execute all schedule callbacks. 35763 */ 35764 process: (frameData2) => { 35765 latestFrameData = frameData2; 35766 if (isProcessing) { 35767 flushNextFrame = true; 35768 return; 35769 } 35770 isProcessing = true; 35771 [thisFrame, nextFrame] = [nextFrame, thisFrame]; 35772 thisFrame.forEach(triggerCallback); 35773 thisFrame.clear(); 35774 isProcessing = false; 35775 if (flushNextFrame) { 35776 flushNextFrame = false; 35777 step.process(frameData2); 35778 } 35779 } 35780 }; 35781 return step; 35782 } 35783 const stepsOrder = [ 35784 "read", 35785 // Read 35786 "resolveKeyframes", 35787 // Write/Read/Write/Read 35788 "update", 35789 // Compute 35790 "preRender", 35791 // Compute 35792 "render", 35793 // Write 35794 "postRender" 35795 // Compute 35796 ]; 35797 const maxElapsed = 40; 35798 function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { 35799 let runNextFrame = false; 35800 let useDefaultElapsed = true; 35801 const state = { 35802 delta: 0, 35803 timestamp: 0, 35804 isProcessing: false 35805 }; 35806 const flagRunNextFrame = () => runNextFrame = true; 35807 const steps = stepsOrder.reduce((acc, key) => { 35808 acc[key] = createRenderStep(flagRunNextFrame); 35809 return acc; 35810 }, {}); 35811 const { read, resolveKeyframes, update: update2, preRender, render, postRender } = steps; 35812 const processBatch = () => { 35813 const timestamp = performance.now(); 35814 runNextFrame = false; 35815 state.delta = useDefaultElapsed ? 1e3 / 60 : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); 35816 state.timestamp = timestamp; 35817 state.isProcessing = true; 35818 read.process(state); 35819 resolveKeyframes.process(state); 35820 update2.process(state); 35821 preRender.process(state); 35822 render.process(state); 35823 postRender.process(state); 35824 state.isProcessing = false; 35825 if (runNextFrame && allowKeepAlive) { 35826 useDefaultElapsed = false; 35827 scheduleNextBatch(processBatch); 35828 } 35829 }; 35830 const wake = () => { 35831 runNextFrame = true; 35832 useDefaultElapsed = true; 35833 if (!state.isProcessing) { 35834 scheduleNextBatch(processBatch); 35835 } 35836 }; 35837 const schedule = stepsOrder.reduce((acc, key) => { 35838 const step = steps[key]; 35839 acc[key] = (process2, keepAlive = false, immediate = false) => { 35840 if (!runNextFrame) 35841 wake(); 35842 return step.schedule(process2, keepAlive, immediate); 35843 }; 35844 return acc; 35845 }, {}); 35846 const cancel = (process2) => { 35847 for (let i2 = 0; i2 < stepsOrder.length; i2++) { 35848 steps[stepsOrder[i2]].cancel(process2); 35849 } 35850 }; 35851 return { schedule, cancel, state, steps }; 35852 } 35853 const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop$3, true); 35854 const LazyContext = reactExports.createContext({ strict: false }); 35855 const featureProps = { 35856 animation: [ 35857 "animate", 35858 "variants", 35859 "whileHover", 35860 "whileTap", 35861 "exit", 35862 "whileInView", 35863 "whileFocus", 35864 "whileDrag" 35865 ], 35866 exit: ["exit"], 35867 drag: ["drag", "dragControls"], 35868 focus: ["whileFocus"], 35869 hover: ["whileHover", "onHoverStart", "onHoverEnd"],
35870 tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], 35871 pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], 35872 inView: ["whileInView", "onViewportEnter", "onViewportLeave"], 35873 layout: ["layout", "layoutId"] 35874 }; 35875 const featureDefinitions = {}; 35876 for (const key in featureProps) { 35877 featureDefinitions[key] = { 35878 isEnabled: (props) => featureProps[key].some((name) => !!props[name]) 35879 }; 35880 } 35881 function loadFeatures(features) { 35882 for (const key in features) { 35883 featureDefinitions[key] = __spreadValues(__spreadValues({}, featureDefinitions[key]), features[key]); 35884 } 35885 } 35886 const validMotionProps = /* @__PURE__ */ new Set([ 35887 "animate", 35888 "exit", 35889 "variants", 35890 "initial", 35891 "style", 35892 "values", 35893 "variants", 35894 "transition", 35895 "transformTemplate", 35896 "custom", 35897 "inherit", 35898 "onBeforeLayoutMeasure", 35899 "onAnimationStart", 35900 "onAnimationComplete", 35901 "onUpdate", 35902 "onDragStart", 35903 "onDrag", 35904 "onDragEnd", 35905 "onMeasureDragConstraints", 35906 "onDirectionLock", 35907 "onDragTransitionEnd", 35908 "_dragX", 35909 "_dragY", 35910 "onHoverStart", 35911 "onHoverEnd", 35912 "onViewportEnter", 35913 "onViewportLeave", 35914 "globalTapTarget", 35915 "ignoreStrict", 35916 "viewport" 35917 ]); 35918 function isValidMotionProp(key) { 35919 return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key); 35920 } 35921 let shouldForward = (key) => !isValidMotionProp(key); 35922 function loadExternalIsValidProp(isValidProp) { 35923 if (!isValidProp) 35924 return; 35925 shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); 35926 } 35927 try { 35928 loadExternalIsValidProp(require("@emotion/is-prop-valid").default); 35929 } catch (_a) { 35930 } 35931 function filterProps(props, isDom, forwardMotionProps) { 35932 const filteredProps = {}; 35933 for (const key in props) { 35934 if (key === "values" && typeof props.values === "object") 35935 continue; 35936 if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners 35937 props["draggable"] && key.startsWith("onDrag")) { 35938 filteredProps[key] = props[key]; 35939 } 35940 } 35941 return filteredProps; 35942 } 35943 function createDOMMotionComponentProxy(componentFactory) { 35944 if (typeof Proxy === "undefined") { 35945 return componentFactory; 35946 } 35947 const componentCache = /* @__PURE__ */ new Map(); 35948 const deprecatedFactoryFunction = (...args) => { 35949 return componentFactory(...args); 35950 }; 35951 return new Proxy(deprecatedFactoryFunction, { 35952 /** 35953 * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. 35954 * The prop name is passed through as `key` and we can use that to generate a `motion` 35955 * DOM component with that name. 35956 */ 35957 get: (_target, key) => { 35958 if (key === "create") 35959 return componentFactory; 35960 if (!componentCache.has(key)) { 35961 componentCache.set(key, componentFactory(key)); 35962 } 35963 return componentCache.get(key); 35964 } 35965 }); 35966 } 35967 const MotionContext = reactExports.createContext({}); 35968 function isVariantLabel(v2) { 35969 return typeof v2 === "string" || Array.isArray(v2); 35970 } 35971 function isAnimationControls(v2) { 35972 return v2 !== null && typeof v2 === "object" && typeof v2.start === "function"; 35973 } 35974 const variantPriorityOrder = [ 35975 "animate", 35976 "whileInView", 35977 "whileFocus", 35978 "whileHover", 35979 "whileTap", 35980 "whileDrag", 35981 "exit" 35982 ]; 35983 const variantProps = ["initial", ...variantPriorityOrder]; 35984 function isControllingVariants(props) { 35985 return isAnimationControls(props.animate) || variantProps.some((name) => isVariantLabel(props[name])); 35986 } 35987 function isVariantNode(props) { 35988 return Boolean(isControllingVariants(props) || props.variants); 35989 } 35990 function getCurrentTreeVariants(props, context) { 35991 if (isControllingVariants(props)) { 35992 const { initial, animate } = props; 35993 return { 35994 initial: initial === false || isVariantLabel(initial) ? initial : void 0, 35995 animate: isVariantLabel(animate) ? animate : void 0 35996 }; 35997 } 35998 return props.inherit !== false ? context : {}; 35999 } 36000 function useCreateMotionContext(props) { 36001 const { initial, animate } = getCurrentTreeVariants(props, reactExports.useContext(MotionContext)); 36002 return reactExports.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); 36003 } 36004 function variantLabelsAsDependency(prop) { 36005 return Array.isArray(prop) ? prop.join(" ") : prop; 36006 } 36007 const motionComponentSymbol = Symbol.for("motionComponentSymbol"); 36008 function isRefObject(ref) { 36009 return ref && typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current"); 36010 } 36011 function useMotionRef(visualState, visualElement, externalRef) { 36012 return reactExports.useCallback( 36013 (instance2) => { 36014 if (instance2) { 36015 visualState.onMount && visualState.onMount(instance2); 36016 } 36017 if (visualElement) { 36018 if (instance2) { 36019 visualElement.mount(instance2); 36020 } else { 36021 visualElement.unmount(); 36022 } 36023 } 36024 if (externalRef) { 36025 if (typeof externalRef === "function") { 36026 externalRef(instance2); 36027 } else if (isRefObject(externalRef)) { 36028 externalRef.current = instance2; 36029 } 36030 } 36031 }, 36032 /** 36033 * Only pass a new ref callback to React if we've received a visual element 36034 * factory. Otherwise we'll be mounting/remounting every time externalRef 36035 * or other dependencies change. 36036 */ 36037 [visualElement] 36038 ); 36039 } 36040 const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(); 36041 const optimizedAppearDataId = "framerAppearId"; 36042 const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); 36043 const { schedule: microtask } = createRenderBatcher(queueMicrotask, false); 36044 const SwitchLayoutGroupContext = reactExports.createContext({}); 36045 function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) { 36046 var _a, _b; 36047 const { visualElement: parent } = reactExports.useContext(MotionContext); 36048 const lazyContext = reactExports.useContext(LazyContext); 36049 const presenceContext = reactExports.useContext(PresenceContext); 36050 const reducedMotionConfig = reactExports.useContext(MotionConfigContext).reducedMotion; 36051 const visualElementRef = reactExports.useRef(null); 36052 createVisualElement = createVisualElement || lazyContext.renderer; 36053 if (!visualElementRef.current && createVisualElement) { 36054 visualElementRef.current = createVisualElement(Component, { 36055 visualState, 36056 parent, 36057 props, 36058 presenceContext, 36059 blockInitialAnimation: presenceContext ? presenceContext.
36059initial === false : false, 36060 reducedMotionConfig 36061 }); 36062 } 36063 const visualElement = visualElementRef.current; 36064 const initialLayoutGroupConfig = reactExports.useContext(SwitchLayoutGroupContext); 36065 if (visualElement && !visualElement.projection && ProjectionNodeConstructor && (visualElement.type === "html" || visualElement.type === "svg")) { 36066 createProjectionNode$1(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); 36067 } 36068 const isMounted = reactExports.useRef(false); 36069 reactExports.useInsertionEffect(() => { 36070 if (visualElement && isMounted.current) { 36071 visualElement.update(props, presenceContext); 36072 } 36073 }); 36074 const optimisedAppearId = props[optimizedAppearDataAttribute]; 36075 const wantsHandoff = reactExports.useRef(Boolean(optimisedAppearId) && !((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) && ((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId))); 36076 useIsomorphicLayoutEffect$2(() => { 36077 if (!visualElement) 36078 return; 36079 isMounted.current = true; 36080 window.MotionIsMounted = true; 36081 visualElement.updateFeatures(); 36082 microtask.render(visualElement.render); 36083 if (wantsHandoff.current && visualElement.animationState) { 36084 visualElement.animationState.animateChanges(); 36085 } 36086 }); 36087 reactExports.useEffect(() => { 36088 if (!visualElement) 36089 return; 36090 if (!wantsHandoff.current && visualElement.animationState) { 36091 visualElement.animationState.animateChanges(); 36092 } 36093 if (wantsHandoff.current) { 36094 queueMicrotask(() => { 36095 var _a2; 36096 (_a2 = window.MotionHandoffMarkAsComplete) === null || _a2 === void 0 ? void 0 : _a2.call(window, optimisedAppearId); 36097 }); 36098 wantsHandoff.current = false; 36099 } 36100 }); 36101 return visualElement; 36102 } 36103 function createProjectionNode$1(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { 36104 const { layoutId, layout: layout2, drag: drag2, dragConstraints, layoutScroll, layoutRoot } = props; 36105 visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] ? void 0 : getClosestProjectingNode(visualElement.parent)); 36106 visualElement.projection.setOptions({ 36107 layoutId, 36108 layout: layout2, 36109 alwaysMeasureLayout: Boolean(drag2) || dragConstraints && isRefObject(dragConstraints), 36110 visualElement, 36111 /** 36112 * TODO: Update options in an effect. This could be tricky as it'll be too late 36113 * to update by the time layout animations run. 36114 * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, 36115 * ensuring it gets called if there's no potential layout animations. 36116 * 36117 */ 36118 animationType: typeof layout2 === "string" ? layout2 : "both", 36119 initialPromotionConfig, 36120 layoutScroll, 36121 layoutRoot 36122 }); 36123 } 36124 function getClosestProjectingNode(visualElement) { 36125 if (!visualElement) 36126 return void 0; 36127 return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent); 36128 } 36129 function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component }) { 36130 var _a, _b; 36131 preloadedFeatures && loadFeatures(preloadedFeatures); 36132 function MotionComponent(props, externalRef) { 36133 let MeasureLayout2; 36134 const configAndProps = __spreadProps(__spreadValues(__spreadValues({}, reactExports.useContext(MotionConfigContext)), props), { 36135 layoutId: useLayoutId(props) 36136 }); 36137 const { isStatic } = configAndProps; 36138 const context = useCreateMotionContext(props); 36139 const visualState = useVisualState(props, isStatic); 36140 if (!isStatic && isBrowser) { 36141 useStrictMode(); 36142 const layoutProjection = getProjectionFunctionality(configAndProps); 36143 MeasureLayout2 = layoutProjection.MeasureLayout; 36144 context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode); 36145 } 36146 return jsxRuntimeExports.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? jsxRuntimeExports.jsx(MeasureLayout2, __spreadValues({ visualElement: context.visualElement }, configAndProps)) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] }); 36147 } 36148 MotionComponent.displayName = `motion.${typeof Component === "string" ? Component : `create(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : ""})`}`; 36149 const ForwardRefMotionComponent = reactExports.forwardRef(MotionComponent); 36150 ForwardRefMotionComponent[motionComponentSymbol] = Component; 36151 return ForwardRefMotionComponent; 36152 } 36153 function useLayoutId({ layoutId }) { 36154 const layoutGroupId = reactExports.useContext(LayoutGroupContext).id; 36155 return layoutGroupId && layoutId !== void 0 ? layoutGroupId + "-" + layoutId : layoutId; 36156 } 36157 function useStrictMode(configAndProps, preloadedFeatures) { 36158 reactExports.useContext(LazyContext).strict; 36159 } 36160 function getProjectionFunctionality(props) { 36161 const { drag: drag2, layout: layout2 } = featureDefinitions; 36162 if (!drag2 && !layout2) 36163 return {}; 36164 const combined = __spreadValues(__spreadValues({}, drag2), layout2); 36165 return { 36166 MeasureLayout: (drag2 === null || drag2 === void 0 ? void 0 : drag2.isEnabled(props)) || (layout2 === null || layout2 === void 0 ? void 0 : layout2.isEnabled(props)) ? combined.MeasureLayout : void 0, 36167 ProjectionNode: combined.ProjectionNode 36168 }; 36169 } 36170 const lowercaseSVGElements = [ 36171 "animate", 36172 "circle", 36173 "defs", 36174 "desc", 36175 "ellipse", 36176 "g", 36177 "image", 36178 "line", 36179 "filter", 36180 "marker", 36181 "mask", 36182 "metadata", 36183 "path", 36184 "pattern", 36185 "polygon", 36186 "polyline", 36187 "rect", 36188 "stop", 36189 "switch", 36190 "symbol", 36191 "svg", 36192 "text", 36193 "tspan", 36194 "use", 36195 "view" 36196 ]; 36197 function isSVGComponent(Component) { 36198 if ( 36199 /** 36200 * If it's not a string, it's a custom React component. Currently we only support 36201 * HTML custom React components. 36202 */ 36203 typeof Component !== "string" || /** 36204 * If it contains a dash, the element is a custom HTML webcomponent. 36205 */ 36206 Component.includes("-") 36207 ) { 36208 return false;
36209 } else if ( 36210 /** 36211 * If it's in our list of lowercase SVG tags, it's an SVG component 36212 */ 36213 lowercaseSVGElements.indexOf(Component) > -1 || /** 36214 * If it contains a capital letter, it's an SVG component 36215 */ 36216 /[A-Z]/u.test(Component) 36217 ) { 36218 return true; 36219 } 36220 return false; 36221 } 36222 function getValueState(visualElement) { 36223 const state = [{}, {}]; 36224 visualElement === null || visualElement === void 0 ? void 0 : visualElement.values.forEach((value, key) => { 36225 state[0][key] = value.get(); 36226 state[1][key] = value.getVelocity(); 36227 }); 36228 return state; 36229 } 36230 function resolveVariantFromProps(props, definition, custom, visualElement) { 36231 if (typeof definition === "function") { 36232 const [current, velocity] = getValueState(visualElement); 36233 definition = definition(custom !== void 0 ? custom : props.custom, current, velocity); 36234 } 36235 if (typeof definition === "string") { 36236 definition = props.variants && props.variants[definition]; 36237 } 36238 if (typeof definition === "function") { 36239 const [current, velocity] = getValueState(visualElement); 36240 definition = definition(custom !== void 0 ? custom : props.custom, current, velocity); 36241 } 36242 return definition; 36243 } 36244 const isKeyframesTarget = (v2) => { 36245 return Array.isArray(v2); 36246 }; 36247 const isCustomValue = (v2) => { 36248 return Boolean(v2 && typeof v2 === "object" && v2.mix && v2.toValue); 36249 }; 36250 const resolveFinalValueInKeyframes = (v2) => { 36251 return isKeyframesTarget(v2) ? v2[v2.length - 1] || 0 : v2; 36252 }; 36253 const isMotionValue = (value) => Boolean(value && value.getVelocity); 36254 function resolveMotionValue(value) { 36255 const unwrappedValue = isMotionValue(value) ? value.get() : value; 36256 return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue; 36257 } 36258 function makeState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, createRenderState, onUpdate }, props, context, presenceContext) { 36259 const state = { 36260 latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps2), 36261 renderState: createRenderState() 36262 }; 36263 if (onUpdate) { 36264 state.onMount = (instance2) => onUpdate(__spreadValues({ props, current: instance2 }, state)); 36265 state.onUpdate = (visualElement) => onUpdate(visualElement); 36266 } 36267 return state; 36268 } 36269 const makeUseVisualState = (config) => (props, isStatic) => { 36270 const context = reactExports.useContext(MotionContext); 36271 const presenceContext = reactExports.useContext(PresenceContext); 36272 const make = () => makeState(config, props, context, presenceContext); 36273 return isStatic ? make() : useConstant(make); 36274 }; 36275 function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { 36276 const values = {}; 36277 const motionValues = scrapeMotionValues(props, {}); 36278 for (const key in motionValues) { 36279 values[key] = resolveMotionValue(motionValues[key]); 36280 } 36281 let { initial, animate } = props; 36282 const isControllingVariants$1 = isControllingVariants(props); 36283 const isVariantNode$1 = isVariantNode(props); 36284 if (context && isVariantNode$1 && !isControllingVariants$1 && props.inherit !== false) { 36285 if (initial === void 0) 36286 initial = context.initial; 36287 if (animate === void 0) 36288 animate = context.animate; 36289 } 36290 let isInitialAnimationBlocked = presenceContext ? presenceContext.initial === false : false; 36291 isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; 36292 const variantToSet = isInitialAnimationBlocked ? animate : initial; 36293 if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) { 36294 const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; 36295 for (let i2 = 0; i2 < list.length; i2++) { 36296 const resolved = resolveVariantFromProps(props, list[i2]); 36297 if (resolved) { 36298 const _a = resolved, { transitionEnd, transition } = _a, target = __objRest(_a, ["transitionEnd", "transition"]); 36299 for (const key in target) { 36300 let valueTarget = target[key]; 36301 if (Array.isArray(valueTarget)) { 36302 const index2 = isInitialAnimationBlocked ? valueTarget.length - 1 : 0; 36303 valueTarget = valueTarget[index2]; 36304 } 36305 if (valueTarget !== null) { 36306 values[key] = valueTarget; 36307 } 36308 } 36309 for (const key in transitionEnd) { 36310 values[key] = transitionEnd[key]; 36311 } 36312 } 36313 } 36314 } 36315 return values; 36316 } 36317 const transformPropOrder = [ 36318 "transformPerspective", 36319 "x", 36320 "y", 36321 "z", 36322 "translateX", 36323 "translateY", 36324 "translateZ", 36325 "scale", 36326 "scaleX", 36327 "scaleY", 36328 "rotate", 36329 "rotateX", 36330 "rotateY", 36331 "rotateZ", 36332 "skew", 36333 "skewX", 36334 "skewY" 36335 ]; 36336 const transformProps = new Set(transformPropOrder); 36337 const checkStringStartsWith = (token2) => (key) => typeof key === "string" && key.startsWith(token2); 36338 const isCSSVariableName = /* @__PURE__ */ checkStringStartsWith("--"); 36339 const startsAsVariableToken = /* @__PURE__ */ checkStringStartsWith("var(--"); 36340 const isCSSVariableToken = (value) => { 36341 const startsWithToken = startsAsVariableToken(value); 36342 if (!startsWithToken) 36343 return false;
36344 return singleCssVariableRegex.test(value.split("/*")[0].trim()); 36345 }; 36346 const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; 36347 const getValueAsType = (value, type) => { 36348 return type && typeof value === "number" ? type.transform(value) : value; 36349 }; 36350 const clamp = (min2, max2, v2) => { 36351 if (v2 > max2) 36352 return max2; 36353 if (v2 < min2) 36354 return min2; 36355 return v2; 36356 }; 36357 const number$1 = { 36358 test: (v2) => typeof v2 === "number", 36359 parse: parseFloat, 36360 transform: (v2) => v2 36361 }; 36362 const alpha = __spreadProps(__spreadValues({}, number$1), { 36363 transform: (v2) => clamp(0, 1, v2) 36364 }); 36365 const scale = __spreadProps(__spreadValues({}, number$1), { 36366 default: 1 36367 }); 36368 const createUnitType = (unit) => ({ 36369 test: (v2) => typeof v2 === "string" && v2.endsWith(unit) && v2.split(" ").length === 1, 36370 parse: parseFloat, 36371 transform: (v2) => `${v2}${unit}` 36372 }); 36373 const degrees = /* @__PURE__ */ createUnitType("deg"); 36374 const percent = /* @__PURE__ */ createUnitType("%"); 36375 const px = /* @__PURE__ */ createUnitType("px"); 36376 const vh = /* @__PURE__ */ createUnitType("vh"); 36377 const vw = /* @__PURE__ */ createUnitType("vw"); 36378 const progressPercentage = __spreadProps(__spreadValues({}, percent), { 36379 parse: (v2) => percent.parse(v2) / 100, 36380 transform: (v2) => percent.transform(v2 * 100) 36381 }); 36382 const browserNumberValueTypes = { 36383 // Border props 36384 borderWidth: px, 36385 borderTopWidth: px, 36386 borderRightWidth: px, 36387 borderBottomWidth: px, 36388 borderLeftWidth: px, 36389 borderRadius: px, 36390 radius: px, 36391 borderTopLeftRadius: px, 36392 borderTopRightRadius: px, 36393 borderBottomRightRadius: px, 36394 borderBottomLeftRadius: px, 36395 // Positioning props 36396 width: px, 36397 maxWidth: px, 36398 height: px, 36399 maxHeight: px, 36400 top: px, 36401 right: px, 36402 bottom: px, 36403 left: px, 36404 // Spacing props 36405 padding: px, 36406 paddingTop: px, 36407 paddingRight: px, 36408 paddingBottom: px, 36409 paddingLeft: px, 36410 margin: px, 36411 marginTop: px, 36412 marginRight: px, 36413 marginBottom: px, 36414 marginLeft: px, 36415 // Misc 36416 backgroundPositionX: px, 36417 backgroundPositionY: px 36418 }; 36419 const transformValueTypes = { 36420 rotate: degrees, 36421 rotateX: degrees, 36422 rotateY: degrees, 36423 rotateZ: degrees, 36424 scale, 36425 scaleX: scale, 36426 scaleY: scale, 36427 scaleZ: scale, 36428 skew: degrees, 36429 skewX: degrees, 36430 skewY: degrees, 36431 distance: px, 36432 translateX: px, 36433 translateY: px, 36434 translateZ: px, 36435 x: px, 36436 y: px, 36437 z: px, 36438 perspective: px, 36439 transformPerspective: px, 36440 opacity: alpha, 36441 originX: progressPercentage, 36442 originY: progressPercentage, 36443 originZ: px 36444 }; 36445 const int = __spreadProps(__spreadValues({}, number$1), { 36446 transform: Math.round 36447 }); 36448 const numberValueTypes = __spreadProps(__spreadValues(__spreadValues({}, browserNumberValueTypes), transformValueTypes), { 36449 zIndex: int, 36450 size: px, 36451 // SVG 36452 fillOpacity: alpha, 36453 strokeOpacity: alpha, 36454 numOctaves: int 36455 }); 36456 const translateAlias = { 36457 x: "translateX", 36458 y: "translateY", 36459 z: "translateZ", 36460 transformPerspective: "perspective" 36461 }; 36462 const numTransforms = transformPropOrder.length; 36463 function buildTransform(latestValues, transform2, transformTemplate) { 36464 let transformString = ""; 36465 let transformIsDefault = true; 36466 for (let i2 = 0; i2 < numTransforms; i2++) { 36467 const key = transformPropOrder[i2]; 36468 const value = latestValues[key]; 36469 if (value === void 0) 36470 continue; 36471 let valueIsDefault = true; 36472 if (typeof value === "number") { 36473 valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); 36474 } else { 36475 valueIsDefault = parseFloat(value) === 0; 36476 } 36477 if (!valueIsDefault || transformTemplate) { 36478 const valueAsType = getValueAsType(value, numberValueTypes[key]); 36479 if (!valueIsDefault) { 36480 transformIsDefault = false;
36481 const transformName = translateAlias[key] || key; 36482 transformString += `${transformName}(${valueAsType}) `; 36483 } 36484 if (transformTemplate) { 36485 transform2[key] = valueAsType; 36486 } 36487 } 36488 } 36489 transformString = transformString.trim(); 36490 if (transformTemplate) { 36491 transformString = transformTemplate(transform2, transformIsDefault ? "" : transformString); 36492 } else if (transformIsDefault) { 36493 transformString = "none"; 36494 } 36495 return transformString; 36496 } 36497 function buildHTMLStyles(state, latestValues, transformTemplate) { 36498 const { style, vars, transformOrigin } = state; 36499 let hasTransform2 = false; 36500 let hasTransformOrigin = false; 36501 for (const key in latestValues) { 36502 const value = latestValues[key]; 36503 if (transformProps.has(key)) { 36504 hasTransform2 = true; 36505 continue; 36506 } else if (isCSSVariableName(key)) { 36507 vars[key] = value; 36508 continue; 36509 } else { 36510 const valueAsType = getValueAsType(value, numberValueTypes[key]); 36511 if (key.startsWith("origin")) { 36512 hasTransformOrigin = true; 36513 transformOrigin[key] = valueAsType; 36514 } else { 36515 style[key] = valueAsType; 36516 } 36517 } 36518 } 36519 if (!latestValues.transform) { 36520 if (hasTransform2 || transformTemplate) { 36521 style.transform = buildTransform(latestValues, state.transform, transformTemplate); 36522 } else if (style.transform) { 36523 style.transform = "none"; 36524 } 36525 } 36526 if (hasTransformOrigin) { 36527 const { originX = "50%", originY = "50%", originZ = 0 } = transformOrigin; 36528 style.transformOrigin = `${originX} ${originY} ${originZ}`; 36529 } 36530 } 36531 const dashKeys = { 36532 offset: "stroke-dashoffset", 36533 array: "stroke-dasharray" 36534 }; 36535 const camelKeys = { 36536 offset: "strokeDashoffset", 36537 array: "strokeDasharray" 36538 }; 36539 function buildSVGPath(attrs, length2, spacing = 1, offset2 = 0, useDashCase = true) { 36540 attrs.pathLength = 1; 36541 const keys2 = useDashCase ? dashKeys : camelKeys; 36542 attrs[keys2.offset] = px.transform(-offset2); 36543 const pathLength = px.transform(length2); 36544 const pathSpacing = px.transform(spacing); 36545 attrs[keys2.array] = `${pathLength} ${pathSpacing}`; 36546 } 36547 function calcOrigin$1(origin2, offset2, size) { 36548 return typeof origin2 === "string" ? origin2 : px.transform(offset2 + size * origin2); 36549 } 36550 function calcSVGTransformOrigin(dimensions, originX, originY) { 36551 const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width); 36552 const pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height); 36553 return `${pxOriginX} ${pxOriginY}`; 36554 } 36555 function buildSVGAttrs(state, _l, isSVGTag2, transformTemplate) { 36556 var _m = _l, { 36557 attrX, 36558 attrY, 36559 attrScale, 36560 originX, 36561 originY, 36562 pathLength, 36563 pathSpacing = 1, 36564 pathOffset = 0 36565 } = _m, latest = __objRest(_m, [ 36566 "attrX", 36567 "attrY", 36568 "attrScale", 36569 "originX", 36570 "originY", 36571 "pathLength", 36572 "pathSpacing", 36573 "pathOffset" 36574 ]); 36575 buildHTMLStyles(state, latest, transformTemplate); 36576 if (isSVGTag2) { 36577 if (state.style.viewBox) { 36578 state.attrs.viewBox = state.style.viewBox; 36579 } 36580 return; 36581 } 36582 state.attrs = state.style; 36583 state.style = {}; 36584 const { attrs, style, dimensions } = state; 36585 if (attrs.transform) { 36586 if (dimensions) 36587 style.transform = attrs.transform; 36588 delete attrs.transform; 36589 } 36590 if (dimensions && (originX !== void 0 || originY !== void 0 || style.transform)) { 36591 style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== void 0 ? originX : 0.5, originY !== void 0 ? originY : 0.5); 36592 } 36593 if (attrX !== void 0) 36594 attrs.x = attrX; 36595 if (attrY !== void 0) 36596 attrs.y = attrY; 36597 if (attrScale !== void 0) 36598 attrs.scale = attrScale;
36599 if (pathLength !== void 0) { 36600 buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); 36601 } 36602 } 36603 const createHtmlRenderState = () => ({ 36604 style: {}, 36605 transform: {}, 36606 transformOrigin: {}, 36607 vars: {} 36608 }); 36609 const createSvgRenderState = () => __spreadProps(__spreadValues({}, createHtmlRenderState()), { 36610 attrs: {} 36611 }); 36612 const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; 36613 function renderHTML(element, { style, vars }, styleProp, projection) { 36614 Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); 36615 for (const key in vars) { 36616 element.style.setProperty(key, vars[key]); 36617 } 36618 } 36619 const camelCaseAttributes = /* @__PURE__ */ new Set([ 36620 "baseFrequency", 36621 "diffuseConstant", 36622 "kernelMatrix", 36623 "kernelUnitLength", 36624 "keySplines", 36625 "keyTimes", 36626 "limitingConeAngle", 36627 "markerHeight", 36628 "markerWidth", 36629 "numOctaves", 36630 "targetX", 36631 "targetY", 36632 "surfaceScale", 36633 "specularConstant", 36634 "specularExponent", 36635 "stdDeviation", 36636 "tableValues", 36637 "viewBox", 36638 "gradientTransform", 36639 "pathLength", 36640 "startOffset", 36641 "textLength", 36642 "lengthAdjust" 36643 ]);
36644 function renderSVG(element, renderState, _styleProp, projection) { 36645 renderHTML(element, renderState, void 0, projection); 36646 for (const key in renderState.attrs) { 36647 element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); 36648 } 36649 } 36650 const scaleCorrectors = {}; 36651 function addScaleCorrector(correctors) { 36652 Object.assign(scaleCorrectors, correctors); 36653 } 36654 function isForcedMotionValue(key, { layout: layout2, layoutId }) { 36655 return transformProps.has(key) || key.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity"); 36656 } 36657 function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { 36658 var _a; 36659 const { style } = props; 36660 const newValues = {}; 36661 for (const key in style) { 36662 if (isMotionValue(style[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== void 0) { 36663 newValues[key] = style[key]; 36664 } 36665 } 36666 return newValues; 36667 } 36668 function scrapeMotionValuesFromProps(props, prevProps, visualElement) { 36669 const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); 36670 for (const key in props) { 36671 if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) { 36672 const targetKey = transformPropOrder.indexOf(key) !== -1 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) : key; 36673 newValues[targetKey] = props[key]; 36674 } 36675 } 36676 return newValues; 36677 } 36678 function updateSVGDimensions(instance2, renderState) { 36679 try { 36680 renderState.dimensions = typeof instance2.getBBox === "function" ? instance2.getBBox() : instance2.getBoundingClientRect(); 36681 } catch (e2) { 36682 renderState.dimensions = { 36683 x: 0, 36684 y: 0, 36685 width: 0, 36686 height: 0 36687 }; 36688 } 36689 } 36690 const layoutProps = ["x", "y", "width", "height", "cx", "cy", "r"]; 36691 const svgMotionConfig = { 36692 useVisualState: makeUseVisualState({ 36693 scrapeMotionValuesFromProps, 36694 createRenderState: createSvgRenderState, 36695 onUpdate: ({ props, prevProps, current, renderState, latestValues }) => { 36696 if (!current) 36697 return; 36698 let hasTransform2 = !!props.drag; 36699 if (!hasTransform2) { 36700 for (const key in latestValues) { 36701 if (transformProps.has(key)) { 36702 hasTransform2 = true; 36703 break; 36704 } 36705 } 36706 } 36707 if (!hasTransform2) 36708 return; 36709 let needsMeasure = !prevProps; 36710 if (prevProps) { 36711 for (let i2 = 0; i2 < layoutProps.length; i2++) { 36712 const key = layoutProps[i2]; 36713 if (props[key] !== prevProps[key]) { 36714 needsMeasure = true; 36715 } 36716 } 36717 } 36718 if (!needsMeasure) 36719 return; 36720 frame.read(() => { 36721 updateSVGDimensions(current, renderState); 36722 frame.render(() => { 36723 buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate); 36724 renderSVG(current, renderState); 36725 }); 36726 }); 36727 } 36728 }) 36729 }; 36730 const htmlMotionConfig = { 36731 useVisualState: makeUseVisualState({ 36732 scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, 36733 createRenderState: createHtmlRenderState 36734 }) 36735 }; 36736 function copyRawValuesOnly(target, source, props) { 36737 for (const key in source) { 36738 if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { 36739 target[key] = source[key]; 36740 } 36741 } 36742 } 36743 function useInitialMotionValues({ transformTemplate }, visualState) { 36744 return reactExports.useMemo(() => { 36745 const state = createHtmlRenderState(); 36746 buildHTMLStyles(state, visualState, transformTemplate); 36747 return Object.assign({}, state.vars, state.style); 36748 }, [visualState]); 36749 } 36750 function useStyle(props, visualState) { 36751 const styleProp = props.style || {}; 36752 const style = {}; 36753 copyRawValuesOnly(style, styleProp, props); 36754 Object.assign(style, useInitialMotionValues(props, visualState)); 36755 return style; 36756 } 36757 function useHTMLProps(props, visualState) { 36758 const htmlProps = {}; 36759 const style = useStyle(props, visualState); 36760 if (props.drag && props.dragListener !== false) { 36761 htmlProps.draggable = false;
36762 style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none"; 36763 style.touchAction = props.drag === true ? "none" : `pan-${props.drag === "x" ? "y" : "x"}`; 36764 } 36765 if (props.tabIndex === void 0 && (props.onTap || props.onTapStart || props.whileTap)) { 36766 htmlProps.tabIndex = 0; 36767 } 36768 htmlProps.style = style; 36769 return htmlProps; 36770 } 36771 function useSVGProps(props, visualState, _isStatic, Component) { 36772 const visualProps = reactExports.useMemo(() => { 36773 const state = createSvgRenderState(); 36774 buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate); 36775 return __spreadProps(__spreadValues({}, state.attrs), { 36776 style: __spreadValues({}, state.style) 36777 }); 36778 }, [visualState]); 36779 if (props.style) { 36780 const rawStyles = {}; 36781 copyRawValuesOnly(rawStyles, props.style, props); 36782 visualProps.style = __spreadValues(__spreadValues({}, rawStyles), visualProps.style); 36783 } 36784 return visualProps; 36785 } 36786 function createUseRender(forwardMotionProps = false) { 36787 const useRender = (Component, props, ref, { latestValues }, isStatic) => { 36788 const useVisualProps = isSVGComponent(Component) ? useSVGProps : useHTMLProps; 36789 const visualProps = useVisualProps(props, latestValues, isStatic, Component); 36790 const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); 36791 const elementProps = Component !== reactExports.Fragment ? __spreadProps(__spreadValues(__spreadValues({}, filteredProps), visualProps), { ref }) : {}; 36792 const { children } = props; 36793 const renderedChildren = reactExports.useMemo(() => isMotionValue(children) ? children.get() : children, [children]); 36794 return reactExports.createElement(Component, __spreadProps(__spreadValues({}, elementProps), { 36795 children: renderedChildren 36796 })); 36797 }; 36798 return useRender; 36799 } 36800 function createMotionComponentFactory(preloadedFeatures, createVisualElement) { 36801 return function createMotionComponent2(Component, { forwardMotionProps } = { forwardMotionProps: false }) { 36802 const baseConfig = isSVGComponent(Component) ? svgMotionConfig : htmlMotionConfig; 36803 const config = __spreadProps(__spreadValues({}, baseConfig), { 36804 preloadedFeatures, 36805 useRender: createUseRender(forwardMotionProps), 36806 createVisualElement, 36807 Component 36808 }); 36809 return createRendererMotionComponent(config); 36810 }; 36811 } 36812 function shallowCompare(next2, prev2) { 36813 if (!Array.isArray(prev2)) 36814 return false; 36815 const prevLength = prev2.length; 36816 if (prevLength !== next2.length) 36817 return false; 36818 for (let i2 = 0; i2 < prevLength; i2++) { 36819 if (prev2[i2] !== next2[i2]) 36820 return false; 36821 } 36822 return true; 36823 } 36824 function resolveVariant(visualElement, definition, custom) { 36825 const props = visualElement.getProps(); 36826 return resolveVariantFromProps(props, definition, custom !== void 0 ? custom : props.custom, visualElement); 36827 } 36828 const supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== void 0); 36829 class BaseGroupPlaybackControls { 36830 constructor(animations2) { 36831 this.stop = () => this.runAll("stop"); 36832 this.animations = animations2.filter(Boolean); 36833 } 36834 get finished() { 36835 return Promise.all(this.animations.map((animation) => "finished" in animation ? animation.finished : animation)); 36836 } 36837 /** 36838 * TODO: Filter out cancelled or stopped animations before returning 36839 */ 36840 getAll(propName) { 36841 return this.animations[0][propName]; 36842 } 36843 setAll(propName, newValue) { 36844 for (let i2 = 0; i2 < this.animations.length; i2++) { 36845 this.animations[i2][propName] = newValue; 36846 } 36847 } 36848 attachTimeline(timeline, fallback) { 36849 const subscriptions = this.animations.map((animation) => { 36850 if (supportsScrollTimeline() && animation.attachTimeline) { 36851 return animation.attachTimeline(timeline); 36852 } else if (typeof fallback === "function") { 36853 return fallback(animation); 36854 } 36855 }); 36856 return () => { 36857 subscriptions.forEach((cancel, i2) => { 36858 cancel && cancel(); 36859 this.animations[i2].stop(); 36860 }); 36861 }; 36862 } 36863 get time() { 36864 return this.getAll("time"); 36865 } 36866 set time(time2) { 36867 this.setAll("time", time2); 36868 } 36869 get speed() { 36870 return this.getAll("speed"); 36871 } 36872 set speed(speed) { 36873 this.setAll("speed", speed); 36874 } 36875 get startTime() { 36876 return this.getAll("startTime"); 36877 } 36878 get duration() { 36879 let max2 = 0; 36880 for (let i2 = 0; i2 < this.animations.length; i2++) { 36881 max2 = Math.max(max2, this.animations[i2].duration); 36882 } 36883 return max2; 36884 } 36885 runAll(methodName) { 36886 this.animations.forEach((controls) => controls[methodName]()); 36887 } 36888 flatten() { 36889 this.runAll("flatten"); 36890 } 36891 play() { 36892 this.runAll("play"); 36893 } 36894 pause() { 36895 this.runAll("pause"); 36896 } 36897 cancel() { 36898 this.runAll("cancel"); 36899 } 36900 complete() { 36901 this.runAll("complete"); 36902 } 36903 } 36904 class GroupPlaybackControls extends BaseGroupPlaybackControls { 36905 then(onResolve, onReject) {
36906 return Promise.all(this.animations).then(onResolve).catch(onReject); 36907 } 36908 } 36909 function getValueTransition(transition, key) { 36910 return transition ? transition[key] || transition["default"] || transition : void 0; 36911 } 36912 const maxGeneratorDuration = 2e4; 36913 function calcGeneratorDuration(generator) { 36914 let duration = 0; 36915 const timeStep = 50; 36916 let state = generator.next(duration); 36917 while (!state.done && duration < maxGeneratorDuration) { 36918 duration += timeStep; 36919 state = generator.next(duration); 36920 } 36921 return duration >= maxGeneratorDuration ? Infinity : duration; 36922 } 36923 function isGenerator(type) { 36924 return typeof type === "function"; 36925 } 36926 function attachTimeline(animation, timeline) { 36927 animation.timeline = timeline; 36928 animation.onfinish = null; 36929 } 36930 const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; 36931 const supportsFlags = { 36932 linearEasing: void 0 36933 }; 36934 function memoSupports(callback, supportsFlag) { 36935 const memoized = /* @__PURE__ */ memo(callback); 36936 return () => { 36937 var _a; 36938 return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : memoized(); 36939 }; 36940 } 36941 const supportsLinearEasing = /* @__PURE__ */ memoSupports(() => { 36942 try { 36943 document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" }); 36944 } catch (e2) { 36945 return false; 36946 } 36947 return true; 36948 }, "linearEasing"); 36949 const generateLinearEasing = (easing, duration, resolution = 10) => { 36950 let points = ""; 36951 const numPoints = Math.max(Math.round(duration / resolution), 2); 36952 for (let i2 = 0; i2 < numPoints; i2++) { 36953 points += easing(/* @__PURE__ */ progress(0, numPoints - 1, i2)) + ", "; 36954 } 36955 return `linear(${points.substring(0, points.length - 2)})`; 36956 }; 36957 function isWaapiSupportedEasing(easing) { 36958 return Boolean(typeof easing === "function" && supportsLinearEasing() || !easing || typeof easing === "string" && (easing in supportedWaapiEasing || supportsLinearEasing()) || isBezierDefinition(easing) || Array.isArray(easing) && easing.every(isWaapiSupportedEasing)); 36959 } 36960 const cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`; 36961 const supportedWaapiEasing = { 36962 linear: "linear", 36963 ease: "ease", 36964 easeIn: "ease-in", 36965 easeOut: "ease-out", 36966 easeInOut: "ease-in-out", 36967 circIn: /* @__PURE__ */ cubicBezierAsString([0, 0.65, 0.55, 1]), 36968 circOut: /* @__PURE__ */ cubicBezierAsString([0.55, 0, 1, 0.45]), 36969 backIn: /* @__PURE__ */ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), 36970 backOut: /* @__PURE__ */ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]) 36971 }; 36972 function mapEasingToNativeEasing(easing, duration) { 36973 if (!easing) { 36974 return void 0; 36975 } else if (typeof easing === "function" && supportsLinearEasing()) { 36976 return generateLinearEasing(easing, duration); 36977 } else if (isBezierDefinition(easing)) { 36978 return cubicBezierAsString(easing); 36979 } else if (Array.isArray(easing)) { 36980 return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || supportedWaapiEasing.easeOut); 36981 } else { 36982 return supportedWaapiEasing[easing]; 36983 } 36984 } 36985 const isDragging = { 36986 x: false, 36987 y: false 36988 }; 36989 function isDragActive() { 36990 return isDragging.x || isDragging.y; 36991 } 36992 function resolveElements(elementOrSelector, scope, selectorCache) { 36993 var _a; 36994 if (elementOrSelector instanceof Element) { 36995 return [elementOrSelector]; 36996 } else if (typeof elementOrSelector === "string") { 36997 let root2 = document; 36998 const elements = (_a = void 0) !== null && _a !== void 0 ? _a : root2.querySelectorAll(elementOrSelector); 36999 return elements ? Array.from(elements) : []; 37000 } 37001 return Array.from(elementOrSelector); 37002 } 37003 function setupGesture(elementOrSelector, options2) { 37004 const elements = resolveElements(elementOrSelector); 37005 const gestureAbortController = new AbortController(); 37006 const eventOptions = __spreadProps(__spreadValues({ 37007 passive: true 37008 }, options2), { 37009 signal: gestureAbortController.signal 37010 }); 37011 const cancel = () => gestureAbortController.abort(); 37012 return [elements, eventOptions, cancel]; 37013 } 37014 function filterEvents$1(callback) { 37015 return (event) => { 37016 if (event.pointerType === "touch" || isDragActive()) 37017 return; 37018 callback(event); 37019 }; 37020 } 37021 function hover(elementOrSelector, onHoverStart, options2 = {}) { 37022 const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options2); 37023 const onPointerEnter = filterEvents$1((enterEvent) => { 37024 const { target } = enterEvent; 37025 const onHoverEnd = onHoverStart(enterEvent); 37026 if (typeof onHoverEnd !== "function" || !target) 37027 return; 37028 const onPointerLeave = filterEvents$1((leaveEvent) => { 37029 onHoverEnd(leaveEvent); 37030 target.removeEventListener("pointerleave", onPointerLeave); 37031 }); 37032 target.addEventListener("pointerleave", onPointerLeave, eventOptions); 37033 });
37034 elements.forEach((element) => { 37035 element.addEventListener("pointerenter", onPointerEnter, eventOptions); 37036 }); 37037 return cancel; 37038 } 37039 const isNodeOrChild = (parent, child) => { 37040 if (!child) { 37041 return false; 37042 } else if (parent === child) { 37043 return true; 37044 } else { 37045 return isNodeOrChild(parent, child.parentElement); 37046 } 37047 }; 37048 const isPrimaryPointer = (event) => { 37049 if (event.pointerType === "mouse") { 37050 return typeof event.button !== "number" || event.button <= 0; 37051 } else { 37052 return event.isPrimary !== false; 37053 } 37054 }; 37055 const focusableElements = /* @__PURE__ */ new Set([ 37056 "BUTTON", 37057 "INPUT", 37058 "SELECT", 37059 "TEXTAREA", 37060 "A" 37061 ]); 37062 function isElementKeyboardAccessible(element) { 37063 return focusableElements.has(element.tagName) || element.tabIndex !== -1; 37064 } 37065 const isPressing = /* @__PURE__ */ new WeakSet(); 37066 function filterEvents(callback) { 37067 return (event) => { 37068 if (event.key !== "Enter") 37069 return; 37070 callback(event); 37071 }; 37072 } 37073 function firePointerEvent(target, type) { 37074 target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); 37075 } 37076 const enableKeyboardPress = (focusEvent, eventOptions) => { 37077 const element = focusEvent.currentTarget; 37078 if (!element) 37079 return; 37080 const handleKeydown = filterEvents(() => { 37081 if (isPressing.has(element)) 37082 return; 37083 firePointerEvent(element, "down"); 37084 const handleKeyup = filterEvents(() => { 37085 firePointerEvent(element, "up"); 37086 }); 37087 const handleBlur = () => firePointerEvent(element, "cancel"); 37088 element.addEventListener("keyup", handleKeyup, eventOptions); 37089 element.addEventListener("blur", handleBlur, eventOptions); 37090 }); 37091 element.addEventListener("keydown", handleKeydown, eventOptions); 37092 element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); 37093 }; 37094 function isValidPressEvent(event) { 37095 return isPrimaryPointer(event) && !isDragActive(); 37096 } 37097 function press(elementOrSelector, onPressStart, options2 = {}) { 37098 const [elements, eventOptions, cancelEvents] = setupGesture(elementOrSelector, options2); 37099 const startPress = (startEvent) => { 37100 const element = startEvent.currentTarget; 37101 if (!isValidPressEvent(startEvent) || isPressing.has(element)) 37102 return; 37103 isPressing.add(element); 37104 const onPressEnd = onPressStart(startEvent); 37105 const onPointerEnd = (endEvent, success) => { 37106 window.removeEventListener("pointerup", onPointerUp); 37107 window.removeEventListener("pointercancel", onPointerCancel); 37108 if (!isValidPressEvent(endEvent) || !isPressing.has(element)) { 37109 return; 37110 } 37111 isPressing.delete(element); 37112 if (typeof onPressEnd === "function") { 37113 onPressEnd(endEvent, { success }); 37114 } 37115 }; 37116 const onPointerUp = (upEvent) => { 37117 onPointerEnd(upEvent, options2.useGlobalTarget || isNodeOrChild(element, upEvent.target)); 37118 }; 37119 const onPointerCancel = (cancelEvent) => { 37120 onPointerEnd(cancelEvent, false); 37121 }; 37122 window.addEventListener("pointerup", onPointerUp, eventOptions); 37123 window.addEventListener("pointercancel", onPointerCancel, eventOptions); 37124 }; 37125 elements.forEach((element) => { 37126 if (!isElementKeyboardAccessible(element) && element.getAttribute("tabindex") === null) { 37127 element.tabIndex = 0; 37128 } 37129 const target = options2.useGlobalTarget ? window : element; 37130 target.addEventListener("pointerdown", startPress, eventOptions); 37131 element.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions), eventOptions); 37132 }); 37133 return cancelEvents; 37134 } 37135 function setDragLock(axis) { 37136 if (axis === "x" || axis === "y") { 37137 if (isDragging[axis]) { 37138 return null; 37139 } else { 37140 isDragging[axis] = true; 37141 return () => { 37142 isDragging[axis] = false;
vendor: 15,417 bytes, lines 37143-37613
37143 }; 37144 } 37145 } else { 37146 if (isDragging.x || isDragging.y) { 37147 return null; 37148 } else { 37149 isDragging.x = isDragging.y = true; 37150 return () => { 37151 isDragging.x = isDragging.y = false; 37152 }; 37153 } 37154 } 37155 } 37156 const positionalKeys = /* @__PURE__ */ new Set([ 37157 "width", 37158 "height", 37159 "top", 37160 "left", 37161 "right", 37162 "bottom", 37163 ...transformPropOrder 37164 ]); 37165 let now; 37166 function clearTime() { 37167 now = void 0; 37168 } 37169 const time = { 37170 now: () => { 37171 if (now === void 0) { 37172 time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()); 37173 } 37174 return now; 37175 }, 37176 set: (newTime) => { 37177 now = newTime; 37178 queueMicrotask(clearTime); 37179 } 37180 }; 37181 function addUniqueItem(arr, item) { 37182 if (arr.indexOf(item) === -1) 37183 arr.push(item); 37184 } 37185 function removeItem(arr, item) { 37186 const index2 = arr.indexOf(item); 37187 if (index2 > -1) 37188 arr.splice(index2, 1); 37189 } 37190 class SubscriptionManager { 37191 constructor() { 37192 this.subscriptions = []; 37193 } 37194 add(handler) { 37195 addUniqueItem(this.subscriptions, handler); 37196 return () => removeItem(this.subscriptions, handler); 37197 } 37198 notify(a2, b2, c2) { 37199 const numSubscriptions = this.subscriptions.length; 37200 if (!numSubscriptions) 37201 return; 37202 if (numSubscriptions === 1) { 37203 this.subscriptions[0](a2, b2, c2); 37204 } else { 37205 for (let i2 = 0; i2 < numSubscriptions; i2++) { 37206 const handler = this.subscriptions[i2]; 37207 handler && handler(a2, b2, c2); 37208 } 37209 } 37210 } 37211 getSize() { 37212 return this.subscriptions.length; 37213 } 37214 clear() { 37215 this.subscriptions.length = 0; 37216 } 37217 } 37218 function velocityPerSecond(velocity, frameDuration) { 37219 return frameDuration ? velocity * (1e3 / frameDuration) : 0; 37220 } 37221 const MAX_VELOCITY_DELTA = 30; 37222 const isFloat = (value) => { 37223 return !isNaN(parseFloat(value)); 37224 }; 37225 const collectMotionValues = { 37226 current: void 0 37227 }; 37228 class MotionValue { 37229 /** 37230 * @param init - The initiating value 37231 * @param config - Optional configuration options 37232 * 37233 * - `transformer`: A function to transform incoming values with. 37234 * 37235 * @internal 37236 */ 37237 constructor(init2, options2 = {}) { 37238 this.version = "11.18.2"; 37239 this.canTrackVelocity = null; 37240 this.events = {}; 37241 this.updateAndNotify = (v2, render = true) => { 37242 const currentTime = time.now(); 37243 if (this.updatedAt !== currentTime) { 37244 this.setPrevFrameValue(); 37245 } 37246 this.prev = this.current; 37247 this.setCurrent(v2); 37248 if (this.current !== this.prev && this.events.change) { 37249 this.events.change.notify(this.current); 37250 } 37251 if (render && this.events.renderRequest) { 37252 this.events.renderRequest.notify(this.current); 37253 } 37254 }; 37255 this.hasAnimated = false; 37256 this.setCurrent(init2); 37257 this.owner = options2.owner; 37258 } 37259 setCurrent(current) { 37260 this.current = current; 37261 this.updatedAt = time.now(); 37262 if (this.canTrackVelocity === null && current !== void 0) { 37263 this.canTrackVelocity = isFloat(this.current); 37264 } 37265 } 37266 setPrevFrameValue(prevFrameValue = this.current) { 37267 this.prevFrameValue = prevFrameValue; 37268 this.prevUpdatedAt = this.updatedAt; 37269 } 37270 /** 37271 * Adds a function that will be notified when the `MotionValue` is updated. 37272 * 37273 * It returns a function that, when called, will cancel the subscription. 37274 * 37275 * When calling `onChange` inside a React component, it should be wrapped with the 37276 * `useEffect` hook. As it returns an unsubscribe function, this should be returned 37277 * from the `useEffect` function to ensure you don't add duplicate subscribers.. 37278 * 37279 * ```jsx 37280 * export const MyComponent = () => { 37281 * const x = useMotionValue(0) 37282 * const y = useMotionValue(0) 37283 * const opacity = useMotionValue(1) 37284 * 37285 * useEffect(() => { 37286 * function updateOpacity() { 37287 * const maxXY = Math.max(x.get(), y.get()) 37288 * const newOpacity = transform(maxXY, [0, 100], [1, 0]) 37289 * opacity.set(newOpacity) 37290 * } 37291 * 37292 * const unsubscribeX = x.on("change", updateOpacity) 37293 * const unsubscribeY = y.on("change", updateOpacity) 37294 * 37295 * return () => { 37296 * unsubscribeX() 37297 * unsubscribeY() 37298 * } 37299 * }, []) 37300 * 37301 * return <motion.div style={{ x }} /> 37302 * } 37303 * ``` 37304 * 37305 * @param subscriber - A function that receives the latest value. 37306 * @returns A function that, when called, will cancel this subscription. 37307 * 37308 * @deprecated 37309 */ 37310 onChange(subscription) { 37311 return this.on("change", subscription); 37312 } 37313 on(eventName, callback) { 37314 if (!this.events[eventName]) { 37315 this.events[eventName] = new SubscriptionManager(); 37316 } 37317 const unsubscribe = this.events[eventName].add(callback); 37318 if (eventName === "change") { 37319 return () => { 37320 unsubscribe(); 37321 frame.read(() => { 37322 if (!this.events.change.getSize()) { 37323 this.stop(); 37324 } 37325 }); 37326 }; 37327 } 37328 return unsubscribe; 37329 } 37330 clearListeners() { 37331 for (const eventManagers in this.events) { 37332 this.events[eventManagers].clear(); 37333 } 37334 } 37335 /** 37336 * Attaches a passive effect to the `MotionValue`. 37337 * 37338 * @internal 37339 */ 37340 attach(passiveEffect, stopPassiveEffect) { 37341 this.passiveEffect = passiveEffect; 37342 this.stopPassiveEffect = stopPassiveEffect; 37343 } 37344 /** 37345 * Sets the state of the `MotionValue`. 37346 * 37347 * @remarks 37348 * 37349 * ```jsx 37350 * const x = useMotionValue(0) 37351 * x.set(10) 37352 * ``` 37353 * 37354 * @param latest - Latest value to set. 37355 * @param render - Whether to notify render subscribers. Defaults to `true` 37356 * 37357 * @public 37358 */ 37359 set(v2, render = true) { 37360 if (!render || !this.passiveEffect) { 37361 this.updateAndNotify(v2, render); 37362 } else { 37363 this.passiveEffect(v2, this.updateAndNotify); 37364 } 37365 } 37366 setWithVelocity(prev2, current, delta) { 37367 this.set(current); 37368 this.prev = void 0; 37369 this.prevFrameValue = prev2; 37370 this.prevUpdatedAt = this.updatedAt - delta; 37371 } 37372 /** 37373 * Set the state of the `MotionValue`, stopping any active animations, 37374 * effects, and resets velocity to `0`. 37375 */ 37376 jump(v2, endAnimation = true) { 37377 this.updateAndNotify(v2); 37378 this.prev = v2; 37379 this.prevUpdatedAt = this.prevFrameValue = void 0; 37380 endAnimation && this.stop(); 37381 if (this.stopPassiveEffect) 37382 this.stopPassiveEffect(); 37383 } 37384 /** 37385 * Returns the latest state of `MotionValue` 37386 * 37387 * @returns - The latest state of `MotionValue` 37388 * 37389 * @public 37390 */ 37391 get() { 37392 if (collectMotionValues.current) { 37393 collectMotionValues.current.push(this); 37394 } 37395 return this.current; 37396 } 37397 /** 37398 * @public 37399 */ 37400 getPrevious() { 37401 return this.prev; 37402 } 37403 /** 37404 * Returns the latest velocity of `MotionValue` 37405 * 37406 * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. 37407 * 37408 * @public 37409 */ 37410 getVelocity() { 37411 const currentTime = time.now(); 37412 if (!this.canTrackVelocity || this.prevFrameValue === void 0 || currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { 37413 return 0; 37414 } 37415 const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); 37416 return velocityPerSecond(parseFloat(this.current) - parseFloat(this.prevFrameValue), delta); 37417 } 37418 /** 37419 * Registers a new animation to control this `MotionValue`. Only one 37420 * animation can drive a `MotionValue` at one time. 37421 * 37422 * ```jsx 37423 * value.start() 37424 * ``` 37425 * 37426 * @param animation - A function that starts the provided animation 37427 * 37428 * @internal 37429 */ 37430 start(startAnimation) { 37431 this.stop(); 37432 return new Promise((resolve) => { 37433 this.hasAnimated = true; 37434 this.animation = startAnimation(resolve); 37435 if (this.events.animationStart) { 37436 this.events.animationStart.notify(); 37437 } 37438 }).then(() => { 37439 if (this.events.animationComplete) { 37440 this.events.animationComplete.notify(); 37441 } 37442 this.clearAnimation(); 37443 }); 37444 } 37445 /** 37446 * Stop the currently active animation. 37447 * 37448 * @public 37449 */ 37450 stop() { 37451 if (this.animation) { 37452 this.animation.stop(); 37453 if (this.events.animationCancel) { 37454 this.events.animationCancel.notify(); 37455 } 37456 } 37457 this.clearAnimation(); 37458 } 37459 /** 37460 * Returns `true` if this value is currently animating. 37461 * 37462 * @public 37463 */ 37464 isAnimating() { 37465 return !!this.animation; 37466 } 37467 clearAnimation() { 37468 delete this.animation; 37469 } 37470 /** 37471 * Destroy and clean up subscribers to this `MotionValue`. 37472 * 37473 * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically 37474 * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually 37475 * created a `MotionValue` via the `motionValue` function. 37476 * 37477 * @public 37478 */ 37479 destroy() { 37480 this.clearListeners(); 37481 this.stop(); 37482 if (this.stopPassiveEffect) { 37483 this.stopPassiveEffect(); 37484 } 37485 } 37486 } 37487 function motionValue(init2, options2) { 37488 return new MotionValue(init2, options2); 37489 } 37490 function setMotionValue(visualElement, key, value) { 37491 if (visualElement.hasValue(key)) { 37492 visualElement.getValue(key).set(value); 37493 } else { 37494 visualElement.addValue(key, motionValue(value)); 37495 } 37496 } 37497 function setTarget(visualElement, definition) { 37498 const resolved = resolveVariant(visualElement, definition); 37499 let _a = resolved || {}, { transitionEnd = {}, transition = {} } = _a, target = __objRest(_a, ["transitionEnd", "transition"]); 37500 target = __spreadValues(__spreadValues({}, target), transitionEnd); 37501 for (const key in target) { 37502 const value = resolveFinalValueInKeyframes(target[key]); 37503 setMotionValue(visualElement, key, value); 37504 } 37505 } 37506 function isWillChangeMotionValue(value) { 37507 return Boolean(isMotionValue(value) && value.add); 37508 } 37509 function addValueToWillChange(visualElement, key) { 37510 const willChange = visualElement.getValue("willChange"); 37511 if (isWillChangeMotionValue(willChange)) { 37512 return willChange.add(key); 37513 } 37514 } 37515 function getOptimisedAppearId(visualElement) { 37516 return visualElement.props[optimizedAppearDataAttribute]; 37517 } 37518 const calcBezier = (t2, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t2 + (3 * a2 - 6 * a1)) * t2 + 3 * a1) * t2; 37519 const subdivisionPrecision = 1e-7; 37520 const subdivisionMaxIterations = 12; 37521 function binarySubdivide(x2, lowerBound, upperBound, mX1, mX2) { 37522 let currentX; 37523 let currentT; 37524 let i2 = 0; 37525 do { 37526 currentT = lowerBound + (upperBound - lowerBound) / 2; 37527 currentX = calcBezier(currentT, mX1, mX2) - x2; 37528 if (currentX > 0) { 37529 upperBound = currentT; 37530 } else { 37531 lowerBound = currentT; 37532 } 37533 } while (Math.abs(currentX) > subdivisionPrecision && ++i2 < subdivisionMaxIterations); 37534 return currentT; 37535 } 37536 function cubicBezier(mX1, mY1, mX2, mY2) { 37537 if (mX1 === mY1 && mX2 === mY2) 37538 return noop$3; 37539 const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); 37540 return (t2) => t2 === 0 || t2 === 1 ? t2 : calcBezier(getTForX(t2), mY1, mY2); 37541 } 37542 const mirrorEasing = (easing) => (p2) => p2 <= 0.5 ? easing(2 * p2) / 2 : (2 - easing(2 * (1 - p2))) / 2; 37543 const reverseEasing = (easing) => (p2) => 1 - easing(1 - p2); 37544 const backOut = /* @__PURE__ */ cubicBezier(0.33, 1.53, 0.69, 0.99); 37545 const backIn = /* @__PURE__ */ reverseEasing(backOut); 37546 const backInOut = /* @__PURE__ */ mirrorEasing(backIn); 37547 const anticipate = (p2) => (p2 *= 2) < 1 ? 0.5 * backIn(p2) : 0.5 * (2 - Math.pow(2, -10 * (p2 - 1))); 37548 const circIn = (p2) => 1 - Math.sin(Math.acos(p2)); 37549 const circOut = reverseEasing(circIn); 37550 const circInOut = mirrorEasing(circIn); 37551 const isZeroValueString = (v2) => /^0[^.\s]+$/u.test(v2); 37552 function isNone(value) { 37553 if (typeof value === "number") { 37554 return value === 0; 37555 } else if (value !== null) { 37556 return value === "none" || value === "0" || isZeroValueString(value); 37557 } else { 37558 return true; 37559 } 37560 } 37561 const sanitize = (v2) => Math.round(v2 * 1e5) / 1e5; 37562 const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; 37563 function isNullish(v2) { 37564 return v2 == null; 37565 } 37566 const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; 37567 const isColorString = (type, testProp) => (v2) => { 37568 return Boolean(typeof v2 === "string" && singleColorRegex.test(v2) && v2.startsWith(type) || testProp && !isNullish(v2) && Object.prototype.hasOwnProperty.call(v2, testProp)); 37569 }; 37570 const splitColor = (aName, bName, cName) => (v2) => { 37571 if (typeof v2 !== "string") 37572 return v2; 37573 const [a2, b2, c2, alpha2] = v2.match(floatRegex); 37574 return { 37575 [aName]: parseFloat(a2), 37576 [bName]: parseFloat(b2), 37577 [cName]: parseFloat(c2), 37578 alpha: alpha2 !== void 0 ? parseFloat(alpha2) : 1 37579 }; 37580 }; 37581 const clampRgbUnit = (v2) => clamp(0, 255, v2); 37582 const rgbUnit = __spreadProps(__spreadValues({}, number$1), { 37583 transform: (v2) => Math.round(clampRgbUnit(v2)) 37584 }); 37585 const rgba = { 37586 test: /* @__PURE__ */ isColorString("rgb", "red"), 37587 parse: /* @__PURE__ */ splitColor("red", "green", "blue"), 37588 transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + rgbUnit.transform(red) + ", " + rgbUnit.transform(green) + ", " + rgbUnit.transform(blue) + ", " + sanitize(alpha.transform(alpha$1)) + ")" 37589 }; 37590 function parseHex(v2) { 37591 let r2 = ""; 37592 let g2 = ""; 37593 let b2 = ""; 37594 let a2 = ""; 37595 if (v2.length > 5) { 37596 r2 = v2.substring(1, 3); 37597 g2 = v2.substring(3, 5); 37598 b2 = v2.substring(5, 7); 37599 a2 = v2.substring(7, 9); 37600 } else { 37601 r2 = v2.substring(1, 2); 37602 g2 = v2.substring(2, 3); 37603 b2 = v2.substring(3, 4); 37604 a2 = v2.substring(4, 5); 37605 r2 += r2; 37606 g2 += g2; 37607 b2 += b2; 37608 a2 += a2; 37609 } 37610 return { 37611 red: parseInt(r2, 16), 37612 green: parseInt(g2, 16), 37613 blue: parseInt(b2, 16),
37614 alpha: a2 ? parseInt(a2, 16) / 255 : 1 37615 }; 37616 } 37617 const hex = { 37618 test: /* @__PURE__ */ isColorString("#"), 37619 parse: parseHex, 37620 transform: rgba.transform 37621 }; 37622 const hsla = { 37623 test: /* @__PURE__ */ isColorString("hsl", "hue"), 37624 parse: /* @__PURE__ */ splitColor("hue", "saturation", "lightness"), 37625 transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { 37626 return "hsla(" + Math.round(hue) + ", " + percent.transform(sanitize(saturation)) + ", " + percent.transform(sanitize(lightness)) + ", " + sanitize(alpha.transform(alpha$1)) + ")"; 37627 } 37628 }; 37629 const color = { 37630 test: (v2) => rgba.test(v2) || hex.test(v2) || hsla.test(v2), 37631 parse: (v2) => { 37632 if (rgba.test(v2)) { 37633 return rgba.parse(v2); 37634 } else if (hsla.test(v2)) { 37635 return hsla.parse(v2); 37636 } else { 37637 return hex.parse(v2); 37638 } 37639 }, 37640 transform: (v2) => { 37641 return typeof v2 === "string" ? v2 : v2.hasOwnProperty("red") ? rgba.transform(v2) : hsla.transform(v2); 37642 } 37643 }; 37644 const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; 37645 function test(v2) { 37646 var _a, _b; 37647 return isNaN(v2) && typeof v2 === "string" && (((_a = v2.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) + (((_b = v2.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) > 0; 37648 } 37649 const NUMBER_TOKEN = "number"; 37650 const COLOR_TOKEN = "color"; 37651 const VAR_TOKEN = "var"; 37652 const VAR_FUNCTION_TOKEN = "var("; 37653 const SPLIT_TOKEN = "${}"; 37654 const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; 37655 function analyseComplexValue(value) { 37656 const originalValue = value.toString(); 37657 const values = []; 37658 const indexes = { 37659 color: [], 37660 number: [], 37661 var: [] 37662 }; 37663 const types = []; 37664 let i2 = 0; 37665 const tokenised = originalValue.replace(complexRegex, (parsedValue) => { 37666 if (color.test(parsedValue)) { 37667 indexes.color.push(i2); 37668 types.push(COLOR_TOKEN); 37669 values.push(color.parse(parsedValue)); 37670 } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { 37671 indexes.var.push(i2); 37672 types.push(VAR_TOKEN); 37673 values.push(parsedValue); 37674 } else { 37675 indexes.number.push(i2); 37676 types.push(NUMBER_TOKEN); 37677 values.push(parseFloat(parsedValue)); 37678 } 37679 ++i2; 37680 return SPLIT_TOKEN; 37681 }); 37682 const split = tokenised.split(SPLIT_TOKEN); 37683 return { values, split, indexes, types }; 37684 } 37685 function parseComplexValue(v2) { 37686 return analyseComplexValue(v2).values; 37687 } 37688 function createTransformer(source) { 37689 const { split, types } = analyseComplexValue(source); 37690 const numSections = split.length; 37691 return (v2) => { 37692 let output = ""; 37693 for (let i2 = 0; i2 < numSections; i2++) { 37694 output += split[i2]; 37695 if (v2[i2] !== void 0) { 37696 const type = types[i2]; 37697 if (type === NUMBER_TOKEN) { 37698 output += sanitize(v2[i2]); 37699 } else if (type === COLOR_TOKEN) { 37700 output += color.transform(v2[i2]); 37701 } else { 37702 output += v2[i2]; 37703 } 37704 } 37705 } 37706 return output; 37707 }; 37708 } 37709 const convertNumbersToZero = (v2) => typeof v2 === "number" ? 0 : v2; 37710 function getAnimatableNone$1(v2) { 37711 const parsed = parseComplexValue(v2); 37712 const transformer = createTransformer(v2); 37713 return transformer(parsed.map(convertNumbersToZero)); 37714 } 37715 const complex = { 37716 test, 37717 parse: parseComplexValue, 37718 createTransformer, 37719 getAnimatableNone: getAnimatableNone$1 37720 }; 37721 const maxDefaults = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]); 37722 function applyDefaultFilter(v2) { 37723 const [name, value] = v2.slice(0, -1).split("("); 37724 if (name === "drop-shadow") 37725 return v2; 37726 const [number2] = value.match(floatRegex) || []; 37727 if (!number2) 37728 return v2; 37729 const unit = value.replace(number2, ""); 37730 let defaultValue = maxDefaults.has(name) ? 1 : 0; 37731 if (number2 !== value) 37732 defaultValue *= 100; 37733 return name + "(" + defaultValue + unit + ")"; 37734 } 37735 const functionRegex = /\b([a-z-]*)\(.*?\)/gu; 37736 const filter = __spreadProps(__spreadValues({}, complex), { 37737 getAnimatableNone: (v2) => { 37738 const functions = v2.match(functionRegex); 37739 return functions ? functions.map(applyDefaultFilter).join(" ") : v2; 37740 } 37741 }); 37742 const defaultValueTypes = __spreadProps(__spreadValues({}, numberValueTypes), { 37743 // Color props 37744 color, 37745 backgroundColor: color, 37746 outlineColor: color, 37747 fill: color, 37748 stroke: color, 37749 // Border props 37750 borderColor: color, 37751 borderTopColor: color, 37752 borderRightColor: color, 37753 borderBottomColor: color, 37754 borderLeftColor: color, 37755 filter, 37756 WebkitFilter: filter 37757 }); 37758 const getDefaultValueType = (key) => defaultValueTypes[key]; 37759 function getAnimatableNone(key, value) { 37760 let defaultValueType = getDefaultValueType(key); 37761 if (defaultValueType !== filter) 37762 defaultValueType = complex; 37763 return defaultValueType.getAnimatableNone ? defaultValueType.getAnimatableNone(value) : void 0; 37764 } 37765 const invalidTemplates = /* @__PURE__ */ new Set(["auto", "none", "0"]); 37766 function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { 37767 let i2 = 0; 37768 let animatableTemplate = void 0; 37769 while (i2 < unresolvedKeyframes.length && !animatableTemplate) {
37770 const keyframe = unresolvedKeyframes[i2]; 37771 if (typeof keyframe === "string" && !invalidTemplates.has(keyframe) && analyseComplexValue(keyframe).values.length) { 37772 animatableTemplate = unresolvedKeyframes[i2]; 37773 } 37774 i2++; 37775 } 37776 if (animatableTemplate && name) { 37777 for (const noneIndex of noneKeyframeIndexes) { 37778 unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); 37779 } 37780 } 37781 } 37782 const isNumOrPxType = (v2) => v2 === number$1 || v2 === px; 37783 const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]); 37784 const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform2 }) => { 37785 if (transform2 === "none" || !transform2) 37786 return 0; 37787 const matrix3d = transform2.match(/^matrix3d\((.+)\)$/u); 37788 if (matrix3d) { 37789 return getPosFromMatrix(matrix3d[1], pos3); 37790 } else { 37791 const matrix = transform2.match(/^matrix\((.+)\)$/u); 37792 if (matrix) { 37793 return getPosFromMatrix(matrix[1], pos2); 37794 } else { 37795 return 0; 37796 } 37797 } 37798 }; 37799 const transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]); 37800 const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); 37801 function removeNonTranslationalTransform(visualElement) { 37802 const removedTransforms = []; 37803 nonTranslationalTransformKeys.forEach((key) => { 37804 const value = visualElement.getValue(key); 37805 if (value !== void 0) { 37806 removedTransforms.push([key, value.get()]); 37807 value.set(key.startsWith("scale") ? 1 : 0); 37808 } 37809 }); 37810 return removedTransforms; 37811 } 37812 const positionalValues = { 37813 // Dimensions 37814 width: ({ x: x2 }, { paddingLeft = "0", paddingRight = "0" }) => x2.max - x2.min - parseFloat(paddingLeft) - parseFloat(paddingRight), 37815 height: ({ y: y2 }, { paddingTop = "0", paddingBottom = "0" }) => y2.max - y2.min - parseFloat(paddingTop) - parseFloat(paddingBottom), 37816 top: (_bbox, { top }) => parseFloat(top), 37817 left: (_bbox, { left }) => parseFloat(left), 37818 bottom: ({ y: y2 }, { top }) => parseFloat(top) + (y2.max - y2.min), 37819 right: ({ x: x2 }, { left }) => parseFloat(left) + (x2.max - x2.min), 37820 // Transform 37821 x: getTranslateFromMatrix(4, 13), 37822 y: getTranslateFromMatrix(5, 14) 37823 }; 37824 positionalValues.translateX = positionalValues.x; 37825 positionalValues.translateY = positionalValues.y; 37826 const toResolve = /* @__PURE__ */ new Set(); 37827 let isScheduled = false; 37828 let anyNeedsMeasurement = false; 37829 function measureAllKeyframes() { 37830 if (anyNeedsMeasurement) { 37831 const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); 37832 const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); 37833 const transformsToRestore = /* @__PURE__ */ new Map(); 37834 elementsToMeasure.forEach((element) => { 37835 const removedTransforms = removeNonTranslationalTransform(element); 37836 if (!removedTransforms.length) 37837 return; 37838 transformsToRestore.set(element, removedTransforms); 37839 element.render(); 37840 }); 37841 resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); 37842 elementsToMeasure.forEach((element) => { 37843 element.render(); 37844 const restore = transformsToRestore.get(element); 37845 if (restore) { 37846 restore.forEach(([key, value]) => { 37847 var _a; 37848 (_a = element.getValue(key)) === null || _a === void 0 ? void 0 : _a.set(value); 37849 }); 37850 } 37851 }); 37852 resolversToMeasure.forEach((resolver) => resolver.measureEndState()); 37853 resolversToMeasure.forEach((resolver) => { 37854 if (resolver.suspendedScrollY !== void 0) { 37855 window.scrollTo(0, resolver.suspendedScrollY); 37856 } 37857 }); 37858 } 37859 anyNeedsMeasurement = false; 37860 isScheduled = false; 37861 toResolve.forEach((resolver) => resolver.complete()); 37862 toResolve.clear(); 37863 } 37864 function readAllKeyframes() { 37865 toResolve.forEach((resolver) => { 37866 resolver.readKeyframes(); 37867 if (resolver.needsMeasurement) { 37868 anyNeedsMeasurement = true; 37869 } 37870 }); 37871 } 37872 function flushKeyframeResolvers() { 37873 readAllKeyframes(); 37874 measureAllKeyframes(); 37875 } 37876 class KeyframeResolver { 37877 constructor(unresolvedKeyframes, onComplete, name, motionValue2, element, isAsync = false) { 37878 this.isComplete = false;
37879 this.isAsync = false; 37880 this.needsMeasurement = false; 37881 this.isScheduled = false; 37882 this.unresolvedKeyframes = [...unresolvedKeyframes]; 37883 this.onComplete = onComplete; 37884 this.name = name; 37885 this.motionValue = motionValue2; 37886 this.element = element; 37887 this.isAsync = isAsync; 37888 } 37889 scheduleResolve() { 37890 this.isScheduled = true; 37891 if (this.isAsync) { 37892 toResolve.add(this); 37893 if (!isScheduled) { 37894 isScheduled = true; 37895 frame.read(readAllKeyframes); 37896 frame.resolveKeyframes(measureAllKeyframes); 37897 } 37898 } else { 37899 this.readKeyframes(); 37900 this.complete(); 37901 } 37902 } 37903 readKeyframes() { 37904 const { unresolvedKeyframes, name, element, motionValue: motionValue2 } = this; 37905 for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) { 37906 if (unresolvedKeyframes[i2] === null) { 37907 if (i2 === 0) { 37908 const currentValue = motionValue2 === null || motionValue2 === void 0 ? void 0 : motionValue2.get(); 37909 const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; 37910 if (currentValue !== void 0) { 37911 unresolvedKeyframes[0] = currentValue; 37912 } else if (element && name) { 37913 const valueAsRead = element.readValue(name, finalKeyframe); 37914 if (valueAsRead !== void 0 && valueAsRead !== null) { 37915 unresolvedKeyframes[0] = valueAsRead; 37916 } 37917 } 37918 if (unresolvedKeyframes[0] === void 0) { 37919 unresolvedKeyframes[0] = finalKeyframe; 37920 } 37921 if (motionValue2 && currentValue === void 0) { 37922 motionValue2.set(unresolvedKeyframes[0]); 37923 } 37924 } else { 37925 unresolvedKeyframes[i2] = unresolvedKeyframes[i2 - 1]; 37926 } 37927 } 37928 } 37929 } 37930 setFinalKeyframe() { 37931 } 37932 measureInitialState() { 37933 } 37934 renderEndStyles() { 37935 } 37936 measureEndState() { 37937 } 37938 complete() { 37939 this.isComplete = true; 37940 this.onComplete(this.unresolvedKeyframes, this.finalKeyframe); 37941 toResolve.delete(this); 37942 } 37943 cancel() { 37944 if (!this.isComplete) { 37945 this.isScheduled = false; 37946 toResolve.delete(this); 37947 } 37948 } 37949 resume() { 37950 if (!this.isComplete) 37951 this.scheduleResolve(); 37952 } 37953 } 37954 const isNumericalString = (v2) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v2); 37955 const splitCSSVariableRegex = ( 37956 // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words 37957 /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u 37958 ); 37959 function parseCSSVariable(current) { 37960 const match2 = splitCSSVariableRegex.exec(current); 37961 if (!match2) 37962 return [,]; 37963 const [, token1, token2, fallback] = match2; 37964 return [`--${token1 !== null && token1 !== void 0 ? token1 : token2}`, fallback]; 37965 } 37966 function getVariableValue(current, element, depth = 1) { 37967 const [token2, fallback] = parseCSSVariable(current); 37968 if (!token2) 37969 return; 37970 const resolved = window.getComputedStyle(element).getPropertyValue(token2); 37971 if (resolved) { 37972 const trimmed = resolved.trim(); 37973 return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; 37974 } 37975 return isCSSVariableToken(fallback) ? getVariableValue(fallback, element, depth + 1) : fallback; 37976 } 37977 const testValueType = (v2) => (type) => type.test(v2); 37978 const auto = { 37979 test: (v2) => v2 === "auto", 37980 parse: (v2) => v2 37981 }; 37982 const dimensionValueTypes = [number$1, px, percent, degrees, vw, vh, auto]; 37983 const findDimensionValueType = (v2) => dimensionValueTypes.find(testValueType(v2)); 37984 class DOMKeyframesResolver extends KeyframeResolver { 37985 constructor(unresolvedKeyframes, onComplete, name, motionValue2, element) { 37986 super(unresolvedKeyframes, onComplete, name, motionValue2, element, true); 37987 } 37988 readKeyframes() { 37989 const { unresolvedKeyframes, element, name } = this; 37990 if (!element || !element.current) 37991 return; 37992 super.readKeyframes(); 37993 for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) { 37994 let keyframe = unresolvedKeyframes[i2]; 37995 if (typeof keyframe === "string") { 37996 keyframe = keyframe.trim(); 37997 if (isCSSVariableToken(keyframe)) { 37998 const resolved = getVariableValue(keyframe, element.current); 37999 if (resolved !== void 0) { 38000 unresolvedKeyframes[i2] = resolved; 38001 } 38002 if (i2 === unresolvedKeyframes.length - 1) { 38003 this.finalKeyframe = keyframe; 38004 } 38005 } 38006 } 38007 } 38008 this.resolveNoneKeyframes(); 38009 if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { 38010 return; 38011 } 38012 const [origin2, target] = unresolvedKeyframes; 38013 const originType = findDimensionValueType(origin2); 38014 const targetType = findDimensionValueType(target); 38015 if (originType === targetType) 38016 return; 38017 if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { 38018 for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) { 38019 const value = unresolvedKeyframes[i2]; 38020 if (typeof value === "string") { 38021 unresolvedKeyframes[i2] = parseFloat(value); 38022 } 38023 } 38024 } else { 38025 this.needsMeasurement = true; 38026 } 38027 } 38028 resolveNoneKeyframes() { 38029 const { unresolvedKeyframes, name } = this; 38030 const noneKeyframeIndexes = []; 38031 for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) { 38032 if (isNone(unresolvedKeyframes[i2])) { 38033 noneKeyframeIndexes.push(i2); 38034 } 38035 } 38036 if (noneKeyframeIndexes.length) { 38037 makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); 38038 } 38039 } 38040 measureInitialState() { 38041 const { element, unresolvedKeyframes, name } = this; 38042 if (!element || !element.current) 38043 return; 38044 if (name === "height") { 38045 this.suspendedScrollY = window.pageYOffset; 38046 } 38047 this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); 38048 unresolvedKeyframes[0] = this.measuredOrigin; 38049 const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; 38050 if (measureKeyframe !== void 0) { 38051 element.getValue(name, measureKeyframe).jump(measureKeyframe, false); 38052 } 38053 } 38054 measureEndState() { 38055 var _a; 38056 const { element, name, unresolvedKeyframes } = this; 38057 if (!element || !element.current) 38058 return; 38059 const value = element.getValue(name); 38060 value && value.jump(this.measuredOrigin, false); 38061 const finalKeyframeIndex = unresolvedKeyframes.length - 1; 38062 const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; 38063 unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); 38064 if (finalKeyframe !== null && this.finalKeyframe === void 0) { 38065 this.finalKeyframe = finalKeyframe; 38066 } 38067 if ((_a = this.removedTransforms) === null || _a === void 0 ? void 0 : _a.length) {
38068 this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { 38069 element.getValue(unsetTransformName).set(unsetTransformValue); 38070 }); 38071 } 38072 this.resolveNoneKeyframes(); 38073 } 38074 } 38075 const isAnimatable = (value, name) => { 38076 if (name === "zIndex") 38077 return false; 38078 if (typeof value === "number" || Array.isArray(value)) 38079 return true; 38080 if (typeof value === "string" && // It's animatable if we have a string 38081 (complex.test(value) || value === "0") && // And it contains numbers and/or colors 38082 !value.startsWith("url(")) { 38083 return true; 38084 } 38085 return false; 38086 }; 38087 function hasKeyframesChanged(keyframes2) { 38088 const current = keyframes2[0]; 38089 if (keyframes2.length === 1) 38090 return true; 38091 for (let i2 = 0; i2 < keyframes2.length; i2++) { 38092 if (keyframes2[i2] !== current) 38093 return true; 38094 } 38095 } 38096 function canAnimate(keyframes2, name, type, velocity) { 38097 const originKeyframe = keyframes2[0]; 38098 if (originKeyframe === null) 38099 return false; 38100 if (name === "display" || name === "visibility") 38101 return true; 38102 const targetKeyframe = keyframes2[keyframes2.length - 1]; 38103 const isOriginAnimatable = isAnimatable(originKeyframe, name); 38104 const isTargetAnimatable = isAnimatable(targetKeyframe, name); 38105 if (!isOriginAnimatable || !isTargetAnimatable) { 38106 return false; 38107 } 38108 return hasKeyframesChanged(keyframes2) || (type === "spring" || isGenerator(type)) && velocity; 38109 } 38110 const isNotNull = (value) => value !== null; 38111 function getFinalKeyframe(keyframes2, { repeat, repeatType = "loop" }, finalKeyframe) { 38112 const resolvedKeyframes = keyframes2.filter(isNotNull); 38113 const index2 = repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : resolvedKeyframes.length - 1; 38114 return !index2 || finalKeyframe === void 0 ? resolvedKeyframes[index2] : finalKeyframe; 38115 } 38116 const MAX_RESOLVE_DELAY = 40; 38117 class BaseAnimation { 38118 constructor(_n2) { 38119 var _o2 = _n2, { autoplay = true, delay: delay2 = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop" } = _o2, options2 = __objRest(_o2, ["autoplay", "delay", "type", "repeat", "repeatDelay", "repeatType"]); 38120 this.isStopped = false; 38121 this.hasAttemptedResolve = false; 38122 this.createdAt = time.now(); 38123 this.options = __spreadValues({ 38124 autoplay, 38125 delay: delay2, 38126 type, 38127 repeat, 38128 repeatDelay, 38129 repeatType 38130 }, options2); 38131 this.updateFinishedPromise(); 38132 } 38133 /** 38134 * This method uses the createdAt and resolvedAt to calculate the 38135 * animation startTime. *Ideally*, we would use the createdAt time as t=0 38136 * as the following frame would then be the first frame of the animation in 38137 * progress, which would feel snappier. 38138 * 38139 * However, if there's a delay (main thread work) between the creation of 38140 * the animation and the first commited frame, we prefer to use resolvedAt 38141 * to avoid a sudden jump into the animation. 38142 */ 38143 calcStartTime() { 38144 if (!this.resolvedAt) 38145 return this.createdAt; 38146 return this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY ? this.resolvedAt : this.createdAt; 38147 } 38148 /** 38149 * A getter for resolved data. If keyframes are not yet resolved, accessing 38150 * this.resolved will synchronously flush all pending keyframe resolvers. 38151 * This is a deoptimisation, but at its worst still batches read/writes. 38152 */ 38153 get resolved() { 38154 if (!this._resolved && !this.hasAttemptedResolve) { 38155 flushKeyframeResolvers(); 38156 } 38157 return this._resolved; 38158 } 38159 /** 38160 * A method to be called when the keyframes resolver completes. This method 38161 * will check if its possible to run the animation and, if not, skip it. 38162 * Otherwise, it will call initPlayback on the implementing class. 38163 */ 38164 onKeyframesResolved(keyframes2, finalKeyframe) { 38165 this.resolvedAt = time.now(); 38166 this.hasAttemptedResolve = true; 38167 const { name, type, velocity, delay: delay2, onComplete, onUpdate, isGenerator: isGenerator2 } = this.options;
38168 if (!isGenerator2 && !canAnimate(keyframes2, name, type, velocity)) { 38169 if (!delay2) { 38170 onUpdate && onUpdate(getFinalKeyframe(keyframes2, this.options, finalKeyframe)); 38171 onComplete && onComplete(); 38172 this.resolveFinishedPromise(); 38173 return; 38174 } else { 38175 this.options.duration = 0; 38176 } 38177 } 38178 const resolvedAnimation = this.initPlayback(keyframes2, finalKeyframe); 38179 if (resolvedAnimation === false) 38180 return; 38181 this._resolved = __spreadValues({ 38182 keyframes: keyframes2, 38183 finalKeyframe 38184 }, resolvedAnimation); 38185 this.onPostResolved(); 38186 } 38187 onPostResolved() { 38188 } 38189 /** 38190 * Allows the returned animation to be awaited or promise-chained. Currently 38191 * resolves when the animation finishes at all but in a future update could/should 38192 * reject if its cancels. 38193 */ 38194 then(resolve, reject) { 38195 return this.currentFinishedPromise.then(resolve, reject); 38196 } 38197 flatten() { 38198 this.options.type = "keyframes"; 38199 this.options.ease = "linear"; 38200 } 38201 updateFinishedPromise() { 38202 this.currentFinishedPromise = new Promise((resolve) => { 38203 this.resolveFinishedPromise = resolve; 38204 }); 38205 } 38206 } 38207 const mixNumber$1 = (from2, to2, progress2) => { 38208 return from2 + (to2 - from2) * progress2; 38209 }; 38210 function hueToRgb(p2, q2, t2) { 38211 if (t2 < 0) 38212 t2 += 1; 38213 if (t2 > 1) 38214 t2 -= 1; 38215 if (t2 < 1 / 6) 38216 return p2 + (q2 - p2) * 6 * t2; 38217 if (t2 < 1 / 2) 38218 return q2; 38219 if (t2 < 2 / 3) 38220 return p2 + (q2 - p2) * (2 / 3 - t2) * 6; 38221 return p2; 38222 } 38223 function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) { 38224 hue /= 360; 38225 saturation /= 100; 38226 lightness /= 100; 38227 let red = 0; 38228 let green = 0; 38229 let blue = 0; 38230 if (!saturation) { 38231 red = green = blue = lightness; 38232 } else { 38233 const q2 = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation; 38234 const p2 = 2 * lightness - q2; 38235 red = hueToRgb(p2, q2, hue + 1 / 3); 38236 green = hueToRgb(p2, q2, hue); 38237 blue = hueToRgb(p2, q2, hue - 1 / 3); 38238 } 38239 return { 38240 red: Math.round(red * 255), 38241 green: Math.round(green * 255), 38242 blue: Math.round(blue * 255), 38243 alpha: alpha2 38244 }; 38245 } 38246 function mixImmediate(a2, b2) { 38247 return (p2) => p2 > 0 ? b2 : a2; 38248 } 38249 const mixLinearColor = (from2, to2, v2) => { 38250 const fromExpo = from2 * from2; 38251 const expo = v2 * (to2 * to2 - fromExpo) + fromExpo; 38252 return expo < 0 ? 0 : Math.sqrt(expo); 38253 }; 38254 const colorTypes = [hex, rgba, hsla]; 38255 const getColorType = (v2) => colorTypes.find((type) => type.test(v2)); 38256 function asRGBA(color2) { 38257 const type = getColorType(color2); 38258 if (!Boolean(type)) 38259 return false; 38260 let model = type.parse(color2); 38261 if (type === hsla) { 38262 model = hslaToRgba(model); 38263 } 38264 return model; 38265 } 38266 const mixColor = (from2, to2) => { 38267 const fromRGBA = asRGBA(from2); 38268 const toRGBA = asRGBA(to2); 38269 if (!fromRGBA || !toRGBA) { 38270 return mixImmediate(from2, to2); 38271 } 38272 const blended = __spreadValues({}, fromRGBA); 38273 return (v2) => { 38274 blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v2); 38275 blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v2); 38276 blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v2); 38277 blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v2); 38278 return rgba.transform(blended); 38279 }; 38280 }; 38281 const combineFunctions = (a2, b2) => (v2) => b2(a2(v2)); 38282 const pipe = (...transformers) => transformers.reduce(combineFunctions); 38283 const invisibleValues = /* @__PURE__ */ new Set(["none", "hidden"]); 38284 function mixVisibility(origin2, target) { 38285 if (invisibleValues.has(origin2)) { 38286 return (p2) => p2 <= 0 ? origin2 : target; 38287 } else { 38288 return (p2) => p2 >= 1 ? target : origin2; 38289 } 38290 } 38291 function mixNumber(a2, b2) { 38292 return (p2) => mixNumber$1(a2, b2, p2); 38293 } 38294 function getMixer$1(a2) { 38295 if (typeof a2 === "number") { 38296 return mixNumber; 38297 } else if (typeof a2 === "string") { 38298 return isCSSVariableToken(a2) ? mixImmediate : color.test(a2) ? mixColor : mixComplex; 38299 } else if (Array.isArray(a2)) { 38300 return mixArray; 38301 } else if (typeof a2 === "object") { 38302 return color.test(a2) ? mixColor : mixObject; 38303 } 38304 return mixImmediate; 38305 } 38306 function mixArray(a2, b2) { 38307 const output = [...a2]; 38308 const numValues = output.length; 38309 const blendValue = a2.map((v2, i2) => getMixer$1(v2)(v2, b2[i2])); 38310 return (p2) => { 38311 for (let i2 = 0; i2 < numValues; i2++) { 38312 output[i2] = blendValue[i2](p2); 38313 } 38314 return output; 38315 }; 38316 } 38317 function mixObject(a2, b2) { 38318 const output = __spreadValues(__spreadValues({}, a2), b2); 38319 const blendValue = {}; 38320 for (const key in output) { 38321 if (a2[key] !== void 0 && b2[key] !== void 0) {
vendor: 18,441 bytes, lines 38322-38772
38322 blendValue[key] = getMixer$1(a2[key])(a2[key], b2[key]); 38323 } 38324 } 38325 return (v2) => { 38326 for (const key in blendValue) { 38327 output[key] = blendValue[key](v2); 38328 } 38329 return output; 38330 }; 38331 } 38332 function matchOrder(origin2, target) { 38333 var _a; 38334 const orderedOrigin = []; 38335 const pointers = { color: 0, var: 0, number: 0 }; 38336 for (let i2 = 0; i2 < target.values.length; i2++) { 38337 const type = target.types[i2]; 38338 const originIndex = origin2.indexes[type][pointers[type]]; 38339 const originValue = (_a = origin2.values[originIndex]) !== null && _a !== void 0 ? _a : 0; 38340 orderedOrigin[i2] = originValue; 38341 pointers[type]++; 38342 } 38343 return orderedOrigin; 38344 } 38345 const mixComplex = (origin2, target) => { 38346 const template = complex.createTransformer(target); 38347 const originStats = analyseComplexValue(origin2); 38348 const targetStats = analyseComplexValue(target); 38349 const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && originStats.indexes.color.length === targetStats.indexes.color.length && originStats.indexes.number.length >= targetStats.indexes.number.length; 38350 if (canInterpolate) { 38351 if (invisibleValues.has(origin2) && !targetStats.values.length || invisibleValues.has(target) && !originStats.values.length) { 38352 return mixVisibility(origin2, target); 38353 } 38354 return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); 38355 } else { 38356 return mixImmediate(origin2, target); 38357 } 38358 }; 38359 function mix(from2, to2, p2) { 38360 if (typeof from2 === "number" && typeof to2 === "number" && typeof p2 === "number") { 38361 return mixNumber$1(from2, to2, p2); 38362 } 38363 const mixer = getMixer$1(from2); 38364 return mixer(from2, to2); 38365 } 38366 const velocitySampleDuration = 5; 38367 function calcGeneratorVelocity(resolveValue, t2, current) { 38368 const prevT = Math.max(t2 - velocitySampleDuration, 0); 38369 return velocityPerSecond(current - resolveValue(prevT), t2 - prevT); 38370 } 38371 const springDefaults = { 38372 // Default spring physics 38373 stiffness: 100, 38374 damping: 10, 38375 mass: 1, 38376 velocity: 0, 38377 // Default duration/bounce-based options 38378 duration: 800, 38379 // in ms 38380 bounce: 0.3, 38381 visualDuration: 0.3, 38382 // in seconds 38383 // Rest thresholds 38384 restSpeed: { 38385 granular: 0.01, 38386 default: 2 38387 }, 38388 restDelta: { 38389 granular: 5e-3, 38390 default: 0.5 38391 }, 38392 // Limits 38393 minDuration: 0.01, 38394 // in seconds 38395 maxDuration: 10, 38396 // in seconds 38397 minDamping: 0.05, 38398 maxDamping: 1 38399 }; 38400 const safeMin = 1e-3; 38401 function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass }) { 38402 let envelope; 38403 let derivative; 38404 let dampingRatio = 1 - bounce; 38405 dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); 38406 duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, /* @__PURE__ */ millisecondsToSeconds(duration)); 38407 if (dampingRatio < 1) { 38408 envelope = (undampedFreq2) => { 38409 const exponentialDecay = undampedFreq2 * dampingRatio; 38410 const delta = exponentialDecay * duration; 38411 const a2 = exponentialDecay - velocity; 38412 const b2 = calcAngularFreq(undampedFreq2, dampingRatio); 38413 const c2 = Math.exp(-delta); 38414 return safeMin - a2 / b2 * c2; 38415 }; 38416 derivative = (undampedFreq2) => { 38417 const exponentialDecay = undampedFreq2 * dampingRatio; 38418 const delta = exponentialDecay * duration; 38419 const d2 = delta * velocity + velocity; 38420 const e2 = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq2, 2) * duration; 38421 const f2 = Math.exp(-delta); 38422 const g2 = calcAngularFreq(Math.pow(undampedFreq2, 2), dampingRatio); 38423 const factor = -envelope(undampedFreq2) + safeMin > 0 ? -1 : 1; 38424 return factor * ((d2 - e2) * f2) / g2; 38425 }; 38426 } else { 38427 envelope = (undampedFreq2) => { 38428 const a2 = Math.exp(-undampedFreq2 * duration); 38429 const b2 = (undampedFreq2 - velocity) * duration + 1; 38430 return -safeMin + a2 * b2; 38431 }; 38432 derivative = (undampedFreq2) => { 38433 const a2 = Math.exp(-undampedFreq2 * duration); 38434 const b2 = (velocity - undampedFreq2) * (duration * duration); 38435 return a2 * b2; 38436 }; 38437 } 38438 const initialGuess = 5 / duration; 38439 const undampedFreq = approximateRoot(envelope, derivative, initialGuess); 38440 duration = /* @__PURE__ */ secondsToMilliseconds(duration); 38441 if (isNaN(undampedFreq)) { 38442 return { 38443 stiffness: springDefaults.stiffness, 38444 damping: springDefaults.damping, 38445 duration 38446 }; 38447 } else { 38448 const stiffness = Math.pow(undampedFreq, 2) * mass; 38449 return { 38450 stiffness, 38451 damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), 38452 duration 38453 }; 38454 } 38455 } 38456 const rootIterations = 12; 38457 function approximateRoot(envelope, derivative, initialGuess) { 38458 let result = initialGuess; 38459 for (let i2 = 1; i2 < rootIterations; i2++) { 38460 result = result - envelope(result) / derivative(result); 38461 } 38462 return result; 38463 } 38464 function calcAngularFreq(undampedFreq, dampingRatio) { 38465 return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); 38466 } 38467 const durationKeys = ["duration", "bounce"]; 38468 const physicsKeys = ["stiffness", "damping", "mass"]; 38469 function isSpringType(options2, keys2) { 38470 return keys2.some((key) => options2[key] !== void 0); 38471 } 38472 function getSpringOptions(options2) { 38473 let springOptions = __spreadValues({ 38474 velocity: springDefaults.velocity, 38475 stiffness: springDefaults.stiffness, 38476 damping: springDefaults.damping, 38477 mass: springDefaults.mass, 38478 isResolvedFromDuration: false 38479 }, options2); 38480 if (!isSpringType(options2, physicsKeys) && isSpringType(options2, durationKeys)) { 38481 if (options2.visualDuration) { 38482 const visualDuration = options2.visualDuration; 38483 const root2 = 2 * Math.PI / (visualDuration * 1.2); 38484 const stiffness = root2 * root2; 38485 const damping = 2 * clamp(0.05, 1, 1 - (options2.bounce || 0)) * Math.sqrt(stiffness); 38486 springOptions = __spreadProps(__spreadValues({}, springOptions), { 38487 mass: springDefaults.mass, 38488 stiffness, 38489 damping 38490 }); 38491 } else { 38492 const derived = findSpring(options2); 38493 springOptions = __spreadProps(__spreadValues(__spreadValues({}, springOptions), derived), { 38494 mass: springDefaults.mass 38495 }); 38496 springOptions.isResolvedFromDuration = true; 38497 } 38498 } 38499 return springOptions; 38500 } 38501 function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { 38502 const options2 = typeof optionsOrVisualDuration !== "object" ? { 38503 visualDuration: optionsOrVisualDuration, 38504 keyframes: [0, 1], 38505 bounce 38506 } : optionsOrVisualDuration; 38507 let { restSpeed, restDelta } = options2; 38508 const origin2 = options2.keyframes[0]; 38509 const target = options2.keyframes[options2.keyframes.length - 1]; 38510 const state = { done: false, value: origin2 }; 38511 const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions(__spreadProps(__spreadValues({}, options2), { 38512 velocity: -/* @__PURE__ */ millisecondsToSeconds(options2.velocity || 0) 38513 })); 38514 const initialVelocity = velocity || 0; 38515 const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); 38516 const initialDelta = target - origin2; 38517 const undampedAngularFreq = /* @__PURE__ */ millisecondsToSeconds(Math.sqrt(stiffness / mass)); 38518 const isGranularScale = Math.abs(initialDelta) < 5; 38519 restSpeed || (restSpeed = isGranularScale ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default); 38520 restDelta || (restDelta = isGranularScale ? springDefaults.restDelta.granular : springDefaults.restDelta.default); 38521 let resolveSpring; 38522 if (dampingRatio < 1) { 38523 const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); 38524 resolveSpring = (t2) => { 38525 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t2); 38526 return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t2) + initialDelta * Math.cos(angularFreq * t2)); 38527 }; 38528 } else if (dampingRatio === 1) { 38529 resolveSpring = (t2) => target - Math.exp(-undampedAngularFreq * t2) * (initialDelta + (initialVelocity + undampedAngularFreq * initialDelta) * t2); 38530 } else { 38531 const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); 38532 resolveSpring = (t2) => { 38533 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t2); 38534 const freqForT = Math.min(dampedAngularFreq * t2, 300); 38535 return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) * Math.sinh(freqForT) + dampedAngularFreq * initialDelta * Math.cosh(freqForT)) / dampedAngularFreq; 38536 }; 38537 } 38538 const generator = { 38539 calculatedDuration: isResolvedFromDuration ? duration || null : null, 38540 next: (t2) => { 38541 const current = resolveSpring(t2); 38542 if (!isResolvedFromDuration) { 38543 let currentVelocity = 0; 38544 if (dampingRatio < 1) { 38545 currentVelocity = t2 === 0 ? /* @__PURE__ */ secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t2, current); 38546 } 38547 const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; 38548 const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta; 38549 state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; 38550 } else { 38551 state.done = t2 >= duration; 38552 } 38553 state.value = state.done ? target : current; 38554 return state; 38555 }, 38556 toString: () => { 38557 const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); 38558 const easing = generateLinearEasing((progress2) => generator.next(calculatedDuration * progress2).value, calculatedDuration, 30); 38559 return calculatedDuration + "ms " + easing; 38560 } 38561 }; 38562 return generator; 38563 } 38564 function inertia({ keyframes: keyframes2, velocity = 0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min: min2, max: max2, restDelta = 0.5, restSpeed }) { 38565 const origin2 = keyframes2[0]; 38566 const state = { 38567 done: false, 38568 value: origin2 38569 }; 38570 const isOutOfBounds = (v2) => min2 !== void 0 && v2 < min2 || max2 !== void 0 && v2 > max2; 38571 const nearestBoundary = (v2) => { 38572 if (min2 === void 0) 38573 return max2; 38574 if (max2 === void 0) 38575 return min2; 38576 return Math.abs(min2 - v2) < Math.abs(max2 - v2) ? min2 : max2; 38577 }; 38578 let amplitude = power * velocity; 38579 const ideal = origin2 + amplitude; 38580 const target = modifyTarget === void 0 ? ideal : modifyTarget(ideal); 38581 if (target !== ideal) 38582 amplitude = target - origin2; 38583 const calcDelta = (t2) => -amplitude * Math.exp(-t2 / timeConstant); 38584 const calcLatest = (t2) => target + calcDelta(t2); 38585 const applyFriction = (t2) => { 38586 const delta = calcDelta(t2); 38587 const latest = calcLatest(t2); 38588 state.done = Math.abs(delta) <= restDelta; 38589 state.value = state.done ? target : latest; 38590 }; 38591 let timeReachedBoundary; 38592 let spring$1; 38593 const checkCatchBoundary = (t2) => { 38594 if (!isOutOfBounds(state.value)) 38595 return; 38596 timeReachedBoundary = t2; 38597 spring$1 = spring({ 38598 keyframes: [state.value, nearestBoundary(state.value)], 38599 velocity: calcGeneratorVelocity(calcLatest, t2, state.value), 38600 // TODO: This should be passing * 1000 38601 damping: bounceDamping, 38602 stiffness: bounceStiffness, 38603 restDelta, 38604 restSpeed 38605 }); 38606 }; 38607 checkCatchBoundary(0); 38608 return { 38609 calculatedDuration: null, 38610 next: (t2) => { 38611 let hasUpdatedFrame = false; 38612 if (!spring$1 && timeReachedBoundary === void 0) { 38613 hasUpdatedFrame = true; 38614 applyFriction(t2); 38615 checkCatchBoundary(t2); 38616 } 38617 if (timeReachedBoundary !== void 0 && t2 >= timeReachedBoundary) { 38618 return spring$1.next(t2 - timeReachedBoundary); 38619 } else { 38620 !hasUpdatedFrame && applyFriction(t2); 38621 return state; 38622 } 38623 } 38624 }; 38625 } 38626 const easeIn = /* @__PURE__ */ cubicBezier(0.42, 0, 1, 1); 38627 const easeOut = /* @__PURE__ */ cubicBezier(0, 0, 0.58, 1); 38628 const easeInOut = /* @__PURE__ */ cubicBezier(0.42, 0, 0.58, 1); 38629 const isEasingArray = (ease2) => { 38630 return Array.isArray(ease2) && typeof ease2[0] !== "number"; 38631 }; 38632 const easingLookup = { 38633 linear: noop$3, 38634 easeIn, 38635 easeInOut, 38636 easeOut, 38637 circIn, 38638 circInOut, 38639 circOut, 38640 backIn, 38641 backInOut, 38642 backOut, 38643 anticipate 38644 }; 38645 const easingDefinitionToFunction = (definition) => { 38646 if (isBezierDefinition(definition)) { 38647 invariant(definition.length === 4); 38648 const [x1, y1, x2, y2] = definition; 38649 return cubicBezier(x1, y1, x2, y2); 38650 } else if (typeof definition === "string") { 38651 return easingLookup[definition]; 38652 } 38653 return definition; 38654 }; 38655 function createMixers(output, ease2, customMixer) { 38656 const mixers = []; 38657 const mixerFactory = customMixer || mix; 38658 const numMixers = output.length - 1; 38659 for (let i2 = 0; i2 < numMixers; i2++) { 38660 let mixer = mixerFactory(output[i2], output[i2 + 1]); 38661 if (ease2) { 38662 const easingFunction = Array.isArray(ease2) ? ease2[i2] || noop$3 : ease2; 38663 mixer = pipe(easingFunction, mixer); 38664 } 38665 mixers.push(mixer); 38666 } 38667 return mixers; 38668 } 38669 function interpolate(input, output, { clamp: isClamp = true, ease: ease2, mixer } = {}) { 38670 const inputLength = input.length; 38671 invariant(inputLength === output.length); 38672 if (inputLength === 1) 38673 return () => output[0]; 38674 if (inputLength === 2 && output[0] === output[1]) 38675 return () => output[1]; 38676 const isZeroDeltaRange = input[0] === input[1]; 38677 if (input[0] > input[inputLength - 1]) { 38678 input = [...input].reverse(); 38679 output = [...output].reverse(); 38680 } 38681 const mixers = createMixers(output, ease2, mixer); 38682 const numMixers = mixers.length; 38683 const interpolator = (v2) => { 38684 if (isZeroDeltaRange && v2 < input[0]) 38685 return output[0]; 38686 let i2 = 0; 38687 if (numMixers > 1) { 38688 for (; i2 < input.length - 2; i2++) { 38689 if (v2 < input[i2 + 1]) 38690 break; 38691 } 38692 } 38693 const progressInRange = /* @__PURE__ */ progress(input[i2], input[i2 + 1], v2); 38694 return mixers[i2](progressInRange); 38695 }; 38696 return isClamp ? (v2) => interpolator(clamp(input[0], input[inputLength - 1], v2)) : interpolator; 38697 } 38698 function fillOffset(offset2, remaining) { 38699 const min2 = offset2[offset2.length - 1]; 38700 for (let i2 = 1; i2 <= remaining; i2++) { 38701 const offsetProgress = /* @__PURE__ */ progress(0, remaining, i2); 38702 offset2.push(mixNumber$1(min2, 1, offsetProgress)); 38703 } 38704 } 38705 function defaultOffset(arr) { 38706 const offset2 = [0]; 38707 fillOffset(offset2, arr.length - 1); 38708 return offset2; 38709 } 38710 function convertOffsetToTimes(offset2, duration) { 38711 return offset2.map((o2) => o2 * duration); 38712 } 38713 function defaultEasing(values, easing) { 38714 return values.map(() => easing || easeInOut).splice(0, values.length - 1); 38715 } 38716 function keyframes({ duration = 300, keyframes: keyframeValues, times, ease: ease2 = "easeInOut" }) { 38717 const easingFunctions = isEasingArray(ease2) ? ease2.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease2); 38718 const state = { 38719 done: false, 38720 value: keyframeValues[0] 38721 }; 38722 const absoluteTimes = convertOffsetToTimes( 38723 // Only use the provided offsets if they're the correct length 38724 // TODO Maybe we should warn here if there's a length mismatch 38725 times && times.length === keyframeValues.length ? times : defaultOffset(keyframeValues), 38726 duration 38727 ); 38728 const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { 38729 ease: Array.isArray(easingFunctions) ? easingFunctions : defaultEasing(keyframeValues, easingFunctions) 38730 }); 38731 return { 38732 calculatedDuration: duration, 38733 next: (t2) => { 38734 state.value = mapTimeToKeyframe(t2); 38735 state.done = t2 >= duration; 38736 return state; 38737 } 38738 }; 38739 } 38740 const frameloopDriver = (update2) => { 38741 const passTimestamp = ({ timestamp }) => update2(timestamp); 38742 return { 38743 start: () => frame.update(passTimestamp, true), 38744 stop: () => cancelFrame(passTimestamp), 38745 /** 38746 * If we're processing this frame we can use the 38747 * framelocked timestamp to keep things in sync. 38748 */ 38749 now: () => frameData.isProcessing ? frameData.timestamp : time.now() 38750 }; 38751 }; 38752 const generators = { 38753 decay: inertia, 38754 inertia, 38755 tween: keyframes, 38756 keyframes, 38757 spring 38758 }; 38759 const percentToProgress = (percent2) => percent2 / 100; 38760 class MainThreadAnimation extends BaseAnimation { 38761 constructor(options2) { 38762 super(options2); 38763 this.holdTime = null; 38764 this.cancelTime = null; 38765 this.currentTime = 0; 38766 this.playbackSpeed = 1; 38767 this.pendingPlayState = "running"; 38768 this.startTime = null; 38769 this.state = "idle"; 38770 this.stop = () => { 38771 this.resolver.cancel(); 38772 this.isStopped = true;
38773 if (this.state === "idle") 38774 return; 38775 this.teardown(); 38776 const { onStop } = this.options; 38777 onStop && onStop(); 38778 }; 38779 const { name, motionValue: motionValue2, element, keyframes: keyframes2 } = this.options; 38780 const KeyframeResolver$1 = (element === null || element === void 0 ? void 0 : element.KeyframeResolver) || KeyframeResolver; 38781 const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe); 38782 this.resolver = new KeyframeResolver$1(keyframes2, onResolved, name, motionValue2, element); 38783 this.resolver.scheduleResolve(); 38784 } 38785 flatten() { 38786 super.flatten(); 38787 if (this._resolved) { 38788 Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes)); 38789 } 38790 } 38791 initPlayback(keyframes$1) { 38792 const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0 } = this.options; 38793 const generatorFactory = isGenerator(type) ? type : generators[type] || keyframes; 38794 let mapPercentToKeyframes; 38795 let mirroredGenerator; 38796 if (generatorFactory !== keyframes && typeof keyframes$1[0] !== "number") { 38797 mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); 38798 keyframes$1 = [0, 100]; 38799 } 38800 const generator = generatorFactory(__spreadProps(__spreadValues({}, this.options), { keyframes: keyframes$1 })); 38801 if (repeatType === "mirror") { 38802 mirroredGenerator = generatorFactory(__spreadProps(__spreadValues({}, this.options), { 38803 keyframes: [...keyframes$1].reverse(), 38804 velocity: -velocity 38805 })); 38806 } 38807 if (generator.calculatedDuration === null) { 38808 generator.calculatedDuration = calcGeneratorDuration(generator); 38809 } 38810 const { calculatedDuration } = generator; 38811 const resolvedDuration = calculatedDuration + repeatDelay; 38812 const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay; 38813 return { 38814 generator, 38815 mirroredGenerator, 38816 mapPercentToKeyframes, 38817 calculatedDuration, 38818 resolvedDuration, 38819 totalDuration 38820 }; 38821 } 38822 onPostResolved() { 38823 const { autoplay = true } = this.options; 38824 this.play(); 38825 if (this.pendingPlayState === "paused" || !autoplay) { 38826 this.pause(); 38827 } else { 38828 this.state = this.pendingPlayState; 38829 } 38830 } 38831 tick(timestamp, sample = false) { 38832 const { resolved } = this; 38833 if (!resolved) { 38834 const { keyframes: keyframes3 } = this.options; 38835 return { done: true, value: keyframes3[keyframes3.length - 1] }; 38836 } 38837 const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes: keyframes2, calculatedDuration, totalDuration, resolvedDuration } = resolved; 38838 if (this.startTime === null) 38839 return generator.next(0); 38840 const { delay: delay2, repeat, repeatType, repeatDelay, onUpdate } = this.options; 38841 if (this.speed > 0) { 38842 this.startTime = Math.min(this.startTime, timestamp); 38843 } else if (this.speed < 0) { 38844 this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); 38845 } 38846 if (sample) { 38847 this.currentTime = timestamp; 38848 } else if (this.holdTime !== null) { 38849 this.currentTime = this.holdTime; 38850 } else { 38851 this.currentTime = Math.round(timestamp - this.startTime) * this.speed; 38852 } 38853 const timeWithoutDelay = this.currentTime - delay2 * (this.speed >= 0 ? 1 : -1); 38854 const isInDelayPhase = this.speed >= 0 ? timeWithoutDelay < 0 : timeWithoutDelay > totalDuration; 38855 this.currentTime = Math.max(timeWithoutDelay, 0); 38856 if (this.state === "finished" && this.holdTime === null) { 38857 this.currentTime = totalDuration; 38858 } 38859 let elapsed = this.currentTime; 38860 let frameGenerator = generator; 38861 if (repeat) { 38862 const progress2 = Math.min(this.currentTime, totalDuration) / resolvedDuration; 38863 let currentIteration = Math.floor(progress2); 38864 let iterationProgress = progress2 % 1; 38865 if (!iterationProgress && progress2 >= 1) { 38866 iterationProgress = 1; 38867 } 38868 iterationProgress === 1 && currentIteration--; 38869 currentIteration = Math.min(currentIteration, repeat + 1); 38870 const isOddIteration = Boolean(currentIteration % 2); 38871 if (isOddIteration) { 38872 if (repeatType === "reverse") { 38873 iterationProgress = 1 - iterationProgress; 38874 if (repeatDelay) { 38875 iterationProgress -= repeatDelay / resolvedDuration; 38876 } 38877 } else if (repeatType === "mirror") { 38878 frameGenerator = mirroredGenerator; 38879 } 38880 }
38881 elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; 38882 } 38883 const state = isInDelayPhase ? { done: false, value: keyframes2[0] } : frameGenerator.next(elapsed); 38884 if (mapPercentToKeyframes) { 38885 state.value = mapPercentToKeyframes(state.value); 38886 } 38887 let { done } = state; 38888 if (!isInDelayPhase && calculatedDuration !== null) { 38889 done = this.speed >= 0 ? this.currentTime >= totalDuration : this.currentTime <= 0; 38890 } 38891 const isAnimationFinished = this.holdTime === null && (this.state === "finished" || this.state === "running" && done); 38892 if (isAnimationFinished && finalKeyframe !== void 0) { 38893 state.value = getFinalKeyframe(keyframes2, this.options, finalKeyframe); 38894 } 38895 if (onUpdate) { 38896 onUpdate(state.value); 38897 } 38898 if (isAnimationFinished) { 38899 this.finish(); 38900 } 38901 return state; 38902 } 38903 get duration() { 38904 const { resolved } = this; 38905 return resolved ? /* @__PURE__ */ millisecondsToSeconds(resolved.calculatedDuration) : 0; 38906 } 38907 get time() { 38908 return /* @__PURE__ */ millisecondsToSeconds(this.currentTime); 38909 } 38910 set time(newTime) { 38911 newTime = /* @__PURE__ */ secondsToMilliseconds(newTime); 38912 this.currentTime = newTime; 38913 if (this.holdTime !== null || this.speed === 0) { 38914 this.holdTime = newTime; 38915 } else if (this.driver) { 38916 this.startTime = this.driver.now() - newTime / this.speed; 38917 } 38918 } 38919 get speed() { 38920 return this.playbackSpeed; 38921 } 38922 set speed(newSpeed) { 38923 const hasChanged = this.playbackSpeed !== newSpeed; 38924 this.playbackSpeed = newSpeed; 38925 if (hasChanged) { 38926 this.time = /* @__PURE__ */ millisecondsToSeconds(this.currentTime); 38927 } 38928 } 38929 play() { 38930 if (!this.resolver.isScheduled) { 38931 this.resolver.resume(); 38932 } 38933 if (!this._resolved) { 38934 this.pendingPlayState = "running"; 38935 return; 38936 } 38937 if (this.isStopped) 38938 return; 38939 const { driver = frameloopDriver, onPlay, startTime } = this.options; 38940 if (!this.driver) { 38941 this.driver = driver((timestamp) => this.tick(timestamp)); 38942 } 38943 onPlay && onPlay(); 38944 const now2 = this.driver.now(); 38945 if (this.holdTime !== null) { 38946 this.startTime = now2 - this.holdTime; 38947 } else if (!this.startTime) { 38948 this.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime(); 38949 } else if (this.state === "finished") { 38950 this.startTime = now2; 38951 } 38952 if (this.state === "finished") { 38953 this.updateFinishedPromise(); 38954 } 38955 this.cancelTime = this.startTime; 38956 this.holdTime = null; 38957 this.state = "running"; 38958 this.driver.start(); 38959 } 38960 pause() { 38961 var _a; 38962 if (!this._resolved) { 38963 this.pendingPlayState = "paused"; 38964 return; 38965 } 38966 this.state = "paused"; 38967 this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0; 38968 } 38969 complete() { 38970 if (this.state !== "running") { 38971 this.play(); 38972 } 38973 this.pendingPlayState = this.state = "finished"; 38974 this.holdTime = null; 38975 } 38976 finish() { 38977 this.teardown(); 38978 this.state = "finished"; 38979 const { onComplete } = this.options; 38980 onComplete && onComplete(); 38981 } 38982 cancel() { 38983 if (this.cancelTime !== null) { 38984 this.tick(this.cancelTime); 38985 } 38986 this.teardown(); 38987 this.updateFinishedPromise(); 38988 } 38989 teardown() { 38990 this.state = "idle"; 38991 this.stopDriver(); 38992 this.resolveFinishedPromise(); 38993 this.updateFinishedPromise(); 38994 this.startTime = this.cancelTime = null; 38995 this.resolver.cancel(); 38996 } 38997 stopDriver() { 38998 if (!this.driver) 38999 return; 39000 this.driver.stop(); 39001 this.driver = void 0; 39002 } 39003 sample(time2) { 39004 this.startTime = 0; 39005 return this.tick(time2, true); 39006 } 39007 } 39008 const acceleratedValues = /* @__PURE__ */ new Set([ 39009 "opacity", 39010 "clipPath", 39011 "filter", 39012 "transform" 39013 // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved 39014 // or until we implement support for linear() easing. 39015 // "background-color" 39016 ]); 39017 function startWaapiAnimation(element, valueName, keyframes2, { delay: delay2 = 0, duration = 300, repeat = 0, repeatType = "loop", ease: ease2 = "easeInOut", times } = {}) {
39018 const keyframeOptions = { [valueName]: keyframes2 }; 39019 if (times) 39020 keyframeOptions.offset = times; 39021 const easing = mapEasingToNativeEasing(ease2, duration); 39022 if (Array.isArray(easing)) 39023 keyframeOptions.easing = easing; 39024 return element.animate(keyframeOptions, { 39025 delay: delay2, 39026 duration, 39027 easing: !Array.isArray(easing) ? easing : "linear", 39028 fill: "both", 39029 iterations: repeat + 1, 39030 direction: repeatType === "reverse" ? "alternate" : "normal" 39031 }); 39032 } 39033 const supportsWaapi = /* @__PURE__ */ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); 39034 const sampleDelta = 10; 39035 const maxDuration = 2e4; 39036 function requiresPregeneratedKeyframes(options2) { 39037 return isGenerator(options2.type) || options2.type === "spring" || !isWaapiSupportedEasing(options2.ease); 39038 } 39039 function pregenerateKeyframes(keyframes2, options2) { 39040 const sampleAnimation = new MainThreadAnimation(__spreadProps(__spreadValues({}, options2), { 39041 keyframes: keyframes2, 39042 repeat: 0, 39043 delay: 0, 39044 isGenerator: true 39045 })); 39046 let state = { done: false, value: keyframes2[0] }; 39047 const pregeneratedKeyframes = []; 39048 let t2 = 0; 39049 while (!state.done && t2 < maxDuration) { 39050 state = sampleAnimation.sample(t2); 39051 pregeneratedKeyframes.push(state.value); 39052 t2 += sampleDelta; 39053 } 39054 return { 39055 times: void 0, 39056 keyframes: pregeneratedKeyframes, 39057 duration: t2 - sampleDelta, 39058 ease: "linear" 39059 }; 39060 } 39061 const unsupportedEasingFunctions = { 39062 anticipate, 39063 backInOut, 39064 circInOut 39065 }; 39066 function isUnsupportedEase(key) { 39067 return key in unsupportedEasingFunctions; 39068 } 39069 class AcceleratedAnimation extends BaseAnimation { 39070 constructor(options2) { 39071 super(options2); 39072 const { name, motionValue: motionValue2, element, keyframes: keyframes2 } = this.options; 39073 this.resolver = new DOMKeyframesResolver(keyframes2, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue2, element); 39074 this.resolver.scheduleResolve(); 39075 } 39076 initPlayback(keyframes2, finalKeyframe) { 39077 let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name, startTime } = this.options; 39078 if (!motionValue2.owner || !motionValue2.owner.current) { 39079 return false; 39080 } 39081 if (typeof ease2 === "string" && supportsLinearEasing() && isUnsupportedEase(ease2)) { 39082 ease2 = unsupportedEasingFunctions[ease2]; 39083 } 39084 if (requiresPregeneratedKeyframes(this.options)) { 39085 const _a = this.options, { onComplete, onUpdate, motionValue: motionValue3, element } = _a, options2 = __objRest(_a, ["onComplete", "onUpdate", "motionValue", "element"]); 39086 const pregeneratedAnimation = pregenerateKeyframes(keyframes2, options2); 39087 keyframes2 = pregeneratedAnimation.keyframes; 39088 if (keyframes2.length === 1) { 39089 keyframes2[1] = keyframes2[0]; 39090 } 39091 duration = pregeneratedAnimation.duration; 39092 times = pregeneratedAnimation.times; 39093 ease2 = pregeneratedAnimation.ease; 39094 type = "keyframes"; 39095 } 39096 const animation = startWaapiAnimation(motionValue2.owner.current, name, keyframes2, __spreadProps(__spreadValues({}, this.options), { duration, times, ease: ease2 })); 39097 animation.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime(); 39098 if (this.pendingTimeline) { 39099 attachTimeline(animation, this.pendingTimeline); 39100 this.pendingTimeline = void 0; 39101 } else { 39102 animation.onfinish = () => { 39103 const { onComplete } = this.options; 39104 motionValue2.set(getFinalKeyframe(keyframes2, this.options, finalKeyframe)); 39105 onComplete && onComplete(); 39106 this.cancel(); 39107 this.resolveFinishedPromise(); 39108 }; 39109 } 39110 return { 39111 animation, 39112 duration, 39113 times, 39114 type, 39115 ease: ease2, 39116 keyframes: keyframes2 39117 }; 39118 } 39119 get duration() { 39120 const { resolved } = this; 39121 if (!resolved) 39122 return 0; 39123 const { duration } = resolved; 39124 return /* @__PURE__ */ millisecondsToSeconds(duration); 39125 } 39126 get time() { 39127 const { resolved } = this; 39128 if (!resolved) 39129 return 0; 39130 const { animation } = resolved; 39131 return /* @__PURE__ */ millisecondsToSeconds(animation.currentTime || 0); 39132 } 39133 set time(newTime) { 39134 const { resolved } = this; 39135 if (!resolved) 39136 return; 39137 const { animation } = resolved; 39138 animation.currentTime = /* @__PURE__ */ secondsToMilliseconds(newTime); 39139 } 39140 get speed() { 39141 const { resolved } = this; 39142 if (!resolved) 39143 return 1; 39144 const { animation } = resolved; 39145 return animation.playbackRate; 39146 } 39147 set speed(newSpeed) { 39148 const { resolved } = this; 39149 if (!resolved) 39150 return; 39151 const { animation } = resolved; 39152 animation.playbackRate = newSpeed; 39153 } 39154 get state() { 39155 const { resolved } = this; 39156 if (!resolved) 39157 return "idle"; 39158 const { animation } = resolved; 39159 return animation.playState; 39160 } 39161 get startTime() { 39162 const { resolved } = this; 39163 if (!resolved) 39164 return null; 39165 const { animation } = resolved; 39166 return animation.startTime; 39167 } 39168 /** 39169 * Replace the default DocumentTimeline with another AnimationTimeline. 39170 * Currently used for scroll animations. 39171 */ 39172 attachTimeline(timeline) { 39173 if (!this._resolved) { 39174 this.pendingTimeline = timeline; 39175 } else { 39176 const { resolved } = this; 39177 if (!resolved) 39178 return noop$3; 39179 const { animation } = resolved; 39180 attachTimeline(animation, timeline); 39181 } 39182 return noop$3; 39183 } 39184 play() { 39185 if (this.isStopped) 39186 return; 39187 const { resolved } = this; 39188 if (!resolved) 39189 return; 39190 const { animation } = resolved; 39191 if (animation.playState === "finished") {
39192 this.updateFinishedPromise(); 39193 } 39194 animation.play(); 39195 } 39196 pause() { 39197 const { resolved } = this; 39198 if (!resolved) 39199 return; 39200 const { animation } = resolved; 39201 animation.pause(); 39202 } 39203 stop() { 39204 this.resolver.cancel(); 39205 this.isStopped = true; 39206 if (this.state === "idle") 39207 return; 39208 this.resolveFinishedPromise(); 39209 this.updateFinishedPromise(); 39210 const { resolved } = this; 39211 if (!resolved) 39212 return; 39213 const { animation, keyframes: keyframes2, duration, type, ease: ease2, times } = resolved; 39214 if (animation.playState === "idle" || animation.playState === "finished") { 39215 return; 39216 } 39217 if (this.time) { 39218 const _a = this.options, { motionValue: motionValue2, onUpdate, onComplete, element } = _a, options2 = __objRest(_a, ["motionValue", "onUpdate", "onComplete", "element"]); 39219 const sampleAnimation = new MainThreadAnimation(__spreadProps(__spreadValues({}, options2), { 39220 keyframes: keyframes2, 39221 duration, 39222 type, 39223 ease: ease2, 39224 times, 39225 isGenerator: true 39226 })); 39227 const sampleTime = /* @__PURE__ */ secondsToMilliseconds(this.time); 39228 motionValue2.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta); 39229 } 39230 const { onStop } = this.options; 39231 onStop && onStop(); 39232 this.cancel(); 39233 } 39234 complete() { 39235 const { resolved } = this; 39236 if (!resolved) 39237 return; 39238 resolved.animation.finish(); 39239 } 39240 cancel() { 39241 const { resolved } = this; 39242 if (!resolved) 39243 return; 39244 resolved.animation.cancel(); 39245 } 39246 static supports(options2) { 39247 const { motionValue: motionValue2, name, repeatDelay, repeatType, damping, type } = options2; 39248 if (!motionValue2 || !motionValue2.owner || !(motionValue2.owner.current instanceof HTMLElement)) { 39249 return false; 39250 } 39251 const { onUpdate, transformTemplate } = motionValue2.owner.getProps(); 39252 return supportsWaapi() && name && acceleratedValues.has(name) && /** 39253 * If we're outputting values to onUpdate then we can't use WAAPI as there's 39254 * no way to read the value from WAAPI every frame. 39255 */ 39256 !onUpdate && !transformTemplate && !repeatDelay && repeatType !== "mirror" && damping !== 0 && type !== "inertia"; 39257 } 39258 } 39259 const underDampedSpring = { 39260 type: "spring", 39261 stiffness: 500, 39262 damping: 25, 39263 restSpeed: 10 39264 }; 39265 const criticallyDampedSpring = (target) => ({ 39266 type: "spring", 39267 stiffness: 550, 39268 damping: target === 0 ? 2 * Math.sqrt(550) : 30, 39269 restSpeed: 10 39270 }); 39271 const keyframesTransition = { 39272 type: "keyframes", 39273 duration: 0.8 39274 }; 39275 const ease = { 39276 type: "keyframes", 39277 ease: [0.25, 0.1, 0.35, 1], 39278 duration: 0.3 39279 }; 39280 const getDefaultTransition = (valueKey, { keyframes: keyframes2 }) => { 39281 if (keyframes2.length > 2) { 39282 return keyframesTransition; 39283 } else if (transformProps.has(valueKey)) { 39284 return valueKey.startsWith("scale") ? criticallyDampedSpring(keyframes2[1]) : underDampedSpring; 39285 } 39286 return ease; 39287 }; 39288 function isTransitionDefined(_p) { 39289 var _q = _p, { when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from: from2, elapsed } = _q, transition = __objRest(_q, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from", "elapsed"]); 39290 return !!Object.keys(transition).length; 39291 } 39292 const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { 39293 const valueTransition = getValueTransition(transition, name) || {}; 39294 const delay2 = valueTransition.delay || transition.delay || 0;
39295 let { elapsed = 0 } = transition; 39296 elapsed = elapsed - /* @__PURE__ */ secondsToMilliseconds(delay2); 39297 let options2 = __spreadProps(__spreadValues({ 39298 keyframes: Array.isArray(target) ? target : [null, target], 39299 ease: "easeOut", 39300 velocity: value.getVelocity() 39301 }, valueTransition), { 39302 delay: -elapsed, 39303 onUpdate: (v2) => { 39304 value.set(v2); 39305 valueTransition.onUpdate && valueTransition.onUpdate(v2); 39306 }, 39307 onComplete: () => { 39308 onComplete(); 39309 valueTransition.onComplete && valueTransition.onComplete(); 39310 }, 39311 name, 39312 motionValue: value, 39313 element: isHandoff ? void 0 : element 39314 }); 39315 if (!isTransitionDefined(valueTransition)) { 39316 options2 = __spreadValues(__spreadValues({}, options2), getDefaultTransition(name, options2)); 39317 } 39318 if (options2.duration) { 39319 options2.duration = /* @__PURE__ */ secondsToMilliseconds(options2.duration); 39320 } 39321 if (options2.repeatDelay) { 39322 options2.repeatDelay = /* @__PURE__ */ secondsToMilliseconds(options2.repeatDelay); 39323 } 39324 if (options2.from !== void 0) { 39325 options2.keyframes[0] = options2.from; 39326 } 39327 let shouldSkip = false; 39328 if (options2.type === false || options2.duration === 0 && !options2.repeatDelay) { 39329 options2.duration = 0; 39330 if (options2.delay === 0) { 39331 shouldSkip = true; 39332 } 39333 } 39334 if (shouldSkip && !isHandoff && value.get() !== void 0) { 39335 const finalKeyframe = getFinalKeyframe(options2.keyframes, valueTransition); 39336 if (finalKeyframe !== void 0) { 39337 frame.update(() => { 39338 options2.onUpdate(finalKeyframe); 39339 options2.onComplete(); 39340 }); 39341 return new GroupPlaybackControls([]); 39342 } 39343 } 39344 if (!isHandoff && AcceleratedAnimation.supports(options2)) { 39345 return new AcceleratedAnimation(options2); 39346 } else { 39347 return new MainThreadAnimation(options2); 39348 } 39349 }; 39350 function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { 39351 const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; 39352 needsAnimating[key] = false; 39353 return shouldBlock; 39354 } 39355 function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0, transitionOverride, type } = {}) { 39356 var _a; 39357 let _a2 = targetAndTransition, { transition = visualElement.getDefaultTransition(), transitionEnd } = _a2, target = __objRest(_a2, ["transition", "transitionEnd"]); 39358 if (transitionOverride) 39359 transition = transitionOverride; 39360 const animations2 = []; 39361 const animationTypeState = type && visualElement.animationState && visualElement.animationState.getState()[type]; 39362 for (const key in target) { 39363 const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null); 39364 const valueTarget = target[key]; 39365 if (valueTarget === void 0 || animationTypeState && shouldBlockAnimation(animationTypeState, key)) { 39366 continue; 39367 } 39368 const valueTransition = __spreadValues({ 39369 delay: delay2 39370 }, getValueTransition(transition || {}, key)); 39371 let isHandoff = false; 39372 if (window.MotionHandoffAnimation) { 39373 const appearId = getOptimisedAppearId(visualElement); 39374 if (appearId) { 39375 const startTime = window.MotionHandoffAnimation(appearId, key, frame); 39376 if (startTime !== null) { 39377 valueTransition.startTime = startTime; 39378 isHandoff = true; 39379 } 39380 } 39381 } 39382 addValueToWillChange(visualElement, key); 39383 value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key) ? { type: false } : valueTransition, visualElement, isHandoff)); 39384 const animation = value.animation; 39385 if (animation) { 39386 animations2.push(animation); 39387 } 39388 } 39389 if (transitionEnd) { 39390 Promise.all(animations2).then(() => { 39391 frame.update(() => { 39392 transitionEnd && setTarget(visualElement, transitionEnd); 39393 }); 39394 }); 39395 } 39396 return animations2; 39397 } 39398 function animateVariant(visualElement, variant, options2 = {}) { 39399 var _a; 39400 const resolved = resolveVariant(visualElement, variant, options2.type === "exit" ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom : void 0); 39401 let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; 39402 if (options2.transitionOverride) { 39403 transition = options2.transitionOverride; 39404 } 39405 const getAnimation = resolved ? () => Promise.all(animateTarget(visualElement, resolved, options2)) : () => Promise.resolve(); 39406 const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size ? (forwardDelay = 0) => { 39407 const { delayChildren = 0, staggerChildren, staggerDirection } = transition; 39408 return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options2); 39409 } : () => Promise.resolve(); 39410 const { when } = transition; 39411 if (when) { 39412 const [first, last] = when === "beforeChildren" ? [getAnimation, getChildAnimations] : [getChildAnimations, getAnimation]; 39413 return first().then(() => last()); 39414 } else { 39415 return Promise.all([getAnimation(), getChildAnimations(options2.delay)]); 39416 } 39417 } 39418 function animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options2) { 39419 const animations2 = []; 39420 const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; 39421 const generateStaggerDuration = staggerDirection === 1 ? (i2 = 0) => i2 * staggerChildren : (i2 = 0) => maxStaggerDuration - i2 * staggerChildren; 39422 Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach((child, i2) => { 39423 child.notify("AnimationStart", variant); 39424 animations2.push(animateVariant(child, variant, __spreadProps(__spreadValues({}, options2), { 39425 delay: delayChildren + generateStaggerDuration(i2) 39426 })).then(() => child.notify("AnimationComplete", variant))); 39427 }); 39428 return Promise.all(animations2); 39429 } 39430 function sortByTreeOrder(a2, b2) { 39431 return a2.sortNodePosition(b2); 39432 } 39433 function animateVisualElement(visualElement, definition, options2 = {}) { 39434 visualElement.notify("AnimationStart", definition); 39435 let animation; 39436 if (Array.isArray(definition)) { 39437 const animations2 = definition.map((variant) => animateVariant(visualElement, variant, options2)); 39438 animation = Promise.all(animations2); 39439 } else if (typeof definition === "string") { 39440 animation = animateVariant(visualElement, definition, options2); 39441 } else { 39442 const resolvedDefinition = typeof definition === "function" ? resolveVariant(visualElement, definition, options2.custom) : definition; 39443 animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options2)); 39444 } 39445 return animation.then(() => { 39446 visualElement.notify("AnimationComplete", definition); 39447 }); 39448 } 39449 const numVariantProps = variantProps.length; 39450 function getVariantContext(visualElement) { 39451 if (!visualElement) 39452 return void 0; 39453 if (!visualElement.isControllingVariants) { 39454 const context2 = visualElement.parent ? getVariantContext(visualElement.parent) || {} : {}; 39455 if (visualElement.props.initial !== void 0) { 39456 context2.initial = visualElement.props.initial; 39457 } 39458 return context2; 39459 } 39460 const context = {}; 39461 for (let i2 = 0; i2 < numVariantProps; i2++) { 39462 const name = variantProps[i2]; 39463 const prop = visualElement.props[name]; 39464 if (isVariantLabel(prop) || prop === false) { 39465 context[name] = prop; 39466 } 39467 } 39468 return context; 39469 } 39470 const reversePriorityOrder = [...variantPriorityOrder].reverse(); 39471 const numAnimationTypes = variantPriorityOrder.length; 39472 function animateList(visualElement) { 39473 return (animations2) => Promise.all(animations2.map(({ animation, options: options2 }) => animateVisualElement(visualElement, animation, options2))); 39474 } 39475 function createAnimationState(visualElement) { 39476 let animate = animateList(visualElement); 39477 let state = createState(); 39478 let isInitialRender = true;
39479 const buildResolvedTypeValues = (type) => (acc, definition) => { 39480 var _a; 39481 const resolved = resolveVariant(visualElement, definition, type === "exit" ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom : void 0); 39482 if (resolved) { 39483 const _a2 = resolved, { transition, transitionEnd } = _a2, target = __objRest(_a2, ["transition", "transitionEnd"]); 39484 acc = __spreadValues(__spreadValues(__spreadValues({}, acc), target), transitionEnd); 39485 } 39486 return acc; 39487 }; 39488 function setAnimateFunction(makeAnimator) { 39489 animate = makeAnimator(visualElement); 39490 } 39491 function animateChanges(changedActiveType) { 39492 const { props } = visualElement; 39493 const context = getVariantContext(visualElement.parent) || {}; 39494 const animations2 = []; 39495 const removedKeys = /* @__PURE__ */ new Set(); 39496 let encounteredKeys = {}; 39497 let removedVariantIndex = Infinity; 39498 for (let i2 = 0; i2 < numAnimationTypes; i2++) { 39499 const type = reversePriorityOrder[i2]; 39500 const typeState = state[type]; 39501 const prop = props[type] !== void 0 ? props[type] : context[type]; 39502 const propIsVariant = isVariantLabel(prop); 39503 const activeDelta = type === changedActiveType ? typeState.isActive : null; 39504 if (activeDelta === false) 39505 removedVariantIndex = i2; 39506 let isInherited = prop === context[type] && prop !== props[type] && propIsVariant; 39507 if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) { 39508 isInherited = false; 39509 } 39510 typeState.protectedKeys = __spreadValues({}, encounteredKeys); 39511 if ( 39512 // If it isn't active and hasn't *just* been set as inactive 39513 !typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type 39514 !prop && !typeState.prevProp || // Or if the prop doesn't define an animation 39515 isAnimationControls(prop) || typeof prop === "boolean" 39516 ) { 39517 continue; 39518 } 39519 const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); 39520 let shouldAnimateType = variantDidChange || // If we're making this variant active, we want to always make it active 39521 type === changedActiveType && typeState.isActive && !isInherited && propIsVariant || // If we removed a higher-priority variant (i is in reverse order) 39522 i2 > removedVariantIndex && propIsVariant; 39523 let handledRemovedValues = false; 39524 const definitionList = Array.isArray(prop) ? prop : [prop]; 39525 let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); 39526 if (activeDelta === false) 39527 resolvedValues = {}; 39528 const { prevResolvedValues = {} } = typeState; 39529 const allKeys = __spreadValues(__spreadValues({}, prevResolvedValues), resolvedValues); 39530 const markToAnimate = (key) => { 39531 shouldAnimateType = true; 39532 if (removedKeys.has(key)) { 39533 handledRemovedValues = true; 39534 removedKeys.delete(key); 39535 } 39536 typeState.needsAnimating[key] = true; 39537 const motionValue2 = visualElement.getValue(key); 39538 if (motionValue2) 39539 motionValue2.liveStyle = false; 39540 }; 39541 for (const key in allKeys) { 39542 const next2 = resolvedValues[key]; 39543 const prev2 = prevResolvedValues[key]; 39544 if (encounteredKeys.hasOwnProperty(key)) 39545 continue; 39546 let valueHasChanged = false; 39547 if (isKeyframesTarget(next2) && isKeyframesTarget(prev2)) { 39548 valueHasChanged = !shallowCompare(next2, prev2); 39549 } else { 39550 valueHasChanged = next2 !== prev2; 39551 } 39552 if (valueHasChanged) { 39553 if (next2 !== void 0 && next2 !== null) { 39554 markToAnimate(key); 39555 } else { 39556 removedKeys.add(key); 39557 } 39558 } else if (next2 !== void 0 && removedKeys.has(key)) {
39559 markToAnimate(key); 39560 } else { 39561 typeState.protectedKeys[key] = true; 39562 } 39563 } 39564 typeState.prevProp = prop; 39565 typeState.prevResolvedValues = resolvedValues; 39566 if (typeState.isActive) { 39567 encounteredKeys = __spreadValues(__spreadValues({}, encounteredKeys), resolvedValues); 39568 } 39569 if (isInitialRender && visualElement.blockInitialAnimation) { 39570 shouldAnimateType = false; 39571 } 39572 const willAnimateViaParent = isInherited && variantDidChange; 39573 const needsAnimating = !willAnimateViaParent || handledRemovedValues; 39574 if (shouldAnimateType && needsAnimating) { 39575 animations2.push(...definitionList.map((animation) => ({ 39576 animation, 39577 options: { type } 39578 }))); 39579 } 39580 } 39581 if (removedKeys.size) { 39582 const fallbackAnimation = {}; 39583 removedKeys.forEach((key) => { 39584 const fallbackTarget = visualElement.getBaseTarget(key); 39585 const motionValue2 = visualElement.getValue(key); 39586 if (motionValue2) 39587 motionValue2.liveStyle = true; 39588 fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null; 39589 }); 39590 animations2.push({ animation: fallbackAnimation }); 39591 } 39592 let shouldAnimate = Boolean(animations2.length); 39593 if (isInitialRender && (props.initial === false || props.initial === props.animate) && !visualElement.manuallyAnimateOnMount) { 39594 shouldAnimate = false; 39595 } 39596 isInitialRender = false;
39597 return shouldAnimate ? animate(animations2) : Promise.resolve(); 39598 } 39599 function setActive(type, isActive) { 39600 var _a; 39601 if (state[type].isActive === isActive) 39602 return Promise.resolve(); 39603 (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { 39604 var _a2; 39605 return (_a2 = child.animationState) === null || _a2 === void 0 ? void 0 : _a2.setActive(type, isActive); 39606 }); 39607 state[type].isActive = isActive; 39608 const animations2 = animateChanges(type); 39609 for (const key in state) { 39610 state[key].protectedKeys = {}; 39611 } 39612 return animations2; 39613 } 39614 return { 39615 animateChanges, 39616 setActive, 39617 setAnimateFunction, 39618 getState: () => state, 39619 reset: () => { 39620 state = createState(); 39621 isInitialRender = true; 39622 } 39623 }; 39624 } 39625 function checkVariantsDidChange(prev2, next2) { 39626 if (typeof next2 === "string") { 39627 return next2 !== prev2; 39628 } else if (Array.isArray(next2)) { 39629 return !shallowCompare(next2, prev2); 39630 } 39631 return false; 39632 } 39633 function createTypeState(isActive = false) { 39634 return { 39635 isActive, 39636 protectedKeys: {}, 39637 needsAnimating: {}, 39638 prevResolvedValues: {} 39639 }; 39640 } 39641 function createState() { 39642 return { 39643 animate: createTypeState(true), 39644 whileInView: createTypeState(), 39645 whileHover: createTypeState(), 39646 whileTap: createTypeState(), 39647 whileDrag: createTypeState(), 39648 whileFocus: createTypeState(), 39649 exit: createTypeState() 39650 }; 39651 } 39652 class Feature { 39653 constructor(node2) { 39654 this.isMounted = false; 39655 this.node = node2; 39656 } 39657 update() { 39658 } 39659 } 39660 class AnimationFeature extends Feature { 39661 /** 39662 * We dynamically generate the AnimationState manager as it contains a reference 39663 * to the underlying animation library. We only want to load that if we load this, 39664 * so people can optionally code split it out using the `m` component. 39665 */ 39666 constructor(node2) { 39667 super(node2); 39668 node2.animationState || (node2.animationState = createAnimationState(node2)); 39669 } 39670 updateAnimationControlsSubscription() { 39671 const { animate } = this.node.getProps(); 39672 if (isAnimationControls(animate)) { 39673 this.unmountControls = animate.subscribe(this.node); 39674 } 39675 } 39676 /** 39677 * Subscribe any provided AnimationControls to the component's VisualElement 39678 */ 39679 mount() { 39680 this.updateAnimationControlsSubscription(); 39681 } 39682 update() { 39683 const { animate } = this.node.getProps(); 39684 const { animate: prevAnimate } = this.node.prevProps || {}; 39685 if (animate !== prevAnimate) { 39686 this.updateAnimationControlsSubscription(); 39687 } 39688 } 39689 unmount() { 39690 var _a; 39691 this.node.animationState.reset(); 39692 (_a = this.unmountControls) === null || _a === void 0 ? void 0 : _a.call(this); 39693 } 39694 } 39695 let id$1 = 0; 39696 class ExitAnimationFeature extends Feature { 39697 constructor() { 39698 super(...arguments); 39699 this.id = id$1++; 39700 } 39701 update() { 39702 if (!this.node.presenceContext) 39703 return; 39704 const { isPresent, onExitComplete } = this.node.presenceContext; 39705 const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; 39706 if (!this.node.animationState || isPresent === prevIsPresent) { 39707 return; 39708 } 39709 const exitAnimation = this.node.animationState.setActive("exit", !isPresent); 39710 if (onExitComplete && !isPresent) { 39711 exitAnimation.then(() => onExitComplete(this.id)); 39712 } 39713 } 39714 mount() { 39715 const { register } = this.node.presenceContext || {}; 39716 if (register) { 39717 this.unmount = register(this.id); 39718 } 39719 } 39720 unmount() { 39721 } 39722 } 39723 const animations = { 39724 animation: { 39725 Feature: AnimationFeature 39726 }, 39727 exit: { 39728 Feature: ExitAnimationFeature 39729 } 39730 }; 39731 function addDomEvent(target, eventName, handler, options2 = { passive: true }) { 39732 target.addEventListener(eventName, handler, options2); 39733 return () => target.removeEventListener(eventName, handler); 39734 } 39735 function extractEventInfo(event) { 39736 return { 39737 point: { 39738 x: event.pageX, 39739 y: event.pageY 39740 } 39741 }; 39742 } 39743 const addPointerInfo = (handler) => { 39744 return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); 39745 }; 39746 function addPointerEvent(target, eventName, handler, options2) { 39747 return addDomEvent(target, eventName, addPointerInfo(handler), options2); 39748 } 39749 const distance = (a2, b2) => Math.abs(a2 - b2); 39750 function distance2D(a2, b2) { 39751 const xDelta = distance(a2.x, b2.x); 39752 const yDelta = distance(a2.y, b2.y); 39753 return Math.sqrt(__pow(xDelta, 2) + __pow(yDelta, 2)); 39754 } 39755 class PanSession { 39756 constructor(event, handlers2, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) { 39757 this.startEvent = null; 39758 this.lastMoveEvent = null; 39759 this.lastMoveEventInfo = null; 39760 this.handlers = {}; 39761 this.contextWindow = window; 39762 this.updatePoint = () => { 39763 if (!(this.lastMoveEvent && this.lastMoveEventInfo)) 39764 return; 39765 const info2 = getPanInfo(this.lastMoveEventInfo, this.history); 39766 const isPanStarted = this.startEvent !== null; 39767 const isDistancePastThreshold = distance2D(info2.offset, { x: 0, y: 0 }) >= 3; 39768 if (!isPanStarted && !isDistancePastThreshold) 39769 return; 39770 const { point: point2 } = info2; 39771 const { timestamp: timestamp2 } = frameData; 39772 this.history.push(__spreadProps(__spreadValues({}, point2), { timestamp: timestamp2 })); 39773 const { onStart, onMove } = this.handlers; 39774 if (!isPanStarted) { 39775 onStart && onStart(this.lastMoveEvent, info2); 39776 this.startEvent = this.lastMoveEvent; 39777 } 39778 onMove && onMove(this.lastMoveEvent, info2); 39779 }; 39780 this.handlePointerMove = (event2, info2) => { 39781 this.lastMoveEvent = event2; 39782 this.lastMoveEventInfo = transformPoint(info2, this.transformPagePoint); 39783 frame.update(this.updatePoint, true); 39784 }; 39785 this.handlePointerUp = (event2, info2) => { 39786 this.end(); 39787 const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; 39788 if (this.dragSnapToOrigin) 39789 resumeAnimation && resumeAnimation(); 39790 if (!(this.lastMoveEvent && this.lastMoveEventInfo)) 39791 return; 39792 const panInfo = getPanInfo(event2.type === "pointercancel" ? this.lastMoveEventInfo : transformPoint(info2, this.transformPagePoint), this.history); 39793 if (this.startEvent && onEnd) { 39794 onEnd(event2, panInfo); 39795 } 39796 onSessionEnd && onSessionEnd(event2, panInfo); 39797 }; 39798 if (!isPrimaryPointer(event)) 39799 return; 39800 this.dragSnapToOrigin = dragSnapToOrigin; 39801 this.handlers = handlers2; 39802 this.transformPagePoint = transformPagePoint; 39803 this.contextWindow = contextWindow || window; 39804 const info = extractEventInfo(event); 39805 const initialInfo = transformPoint(info, this.transformPagePoint); 39806 const { point } = initialInfo; 39807 const { timestamp } = frameData; 39808 this.history = [__spreadProps(__spreadValues({}, point), { timestamp })]; 39809 const { onSessionStart } = handlers2; 39810 onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
39811 this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp)); 39812 } 39813 updateHandlers(handlers2) { 39814 this.handlers = handlers2; 39815 } 39816 end() { 39817 this.removeListeners && this.removeListeners(); 39818 cancelFrame(this.updatePoint); 39819 } 39820 } 39821 function transformPoint(info, transformPagePoint) { 39822 return transformPagePoint ? { point: transformPagePoint(info.point) } : info; 39823 } 39824 function subtractPoint(a2, b2) { 39825 return { x: a2.x - b2.x, y: a2.y - b2.y }; 39826 } 39827 function getPanInfo({ point }, history) { 39828 return { 39829 point, 39830 delta: subtractPoint(point, lastDevicePoint(history)), 39831 offset: subtractPoint(point, startDevicePoint(history)), 39832 velocity: getVelocity(history, 0.1) 39833 }; 39834 } 39835 function startDevicePoint(history) { 39836 return history[0]; 39837 } 39838 function lastDevicePoint(history) { 39839 return history[history.length - 1]; 39840 } 39841 function getVelocity(history, timeDelta) { 39842 if (history.length < 2) { 39843 return { x: 0, y: 0 }; 39844 } 39845 let i2 = history.length - 1; 39846 let timestampedPoint = null; 39847 const lastPoint = lastDevicePoint(history); 39848 while (i2 >= 0) { 39849 timestampedPoint = history[i2]; 39850 if (lastPoint.timestamp - timestampedPoint.timestamp > /* @__PURE__ */ secondsToMilliseconds(timeDelta)) { 39851 break; 39852 } 39853 i2--; 39854 } 39855 if (!timestampedPoint) { 39856 return { x: 0, y: 0 }; 39857 } 39858 const time2 = /* @__PURE__ */ millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); 39859 if (time2 === 0) { 39860 return { x: 0, y: 0 }; 39861 } 39862 const currentVelocity = { 39863 x: (lastPoint.x - timestampedPoint.x) / time2, 39864 y: (lastPoint.y - timestampedPoint.y) / time2 39865 }; 39866 if (currentVelocity.x === Infinity) { 39867 currentVelocity.x = 0; 39868 } 39869 if (currentVelocity.y === Infinity) { 39870 currentVelocity.y = 0; 39871 } 39872 return currentVelocity; 39873 } 39874 const SCALE_PRECISION = 1e-4; 39875 const SCALE_MIN = 1 - SCALE_PRECISION; 39876 const SCALE_MAX = 1 + SCALE_PRECISION; 39877 const TRANSLATE_PRECISION = 0.01; 39878 const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; 39879 const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; 39880 function calcLength(axis) { 39881 return axis.max - axis.min; 39882 } 39883 function isNear(value, target, maxDistance) { 39884 return Math.abs(value - target) <= maxDistance; 39885 } 39886 function calcAxisDelta(delta, source, target, origin2 = 0.5) { 39887 delta.origin = origin2; 39888 delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); 39889 delta.scale = calcLength(target) / calcLength(source); 39890 delta.translate = mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; 39891 if (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX || isNaN(delta.scale)) { 39892 delta.scale = 1; 39893 } 39894 if (delta.translate >= TRANSLATE_MIN && delta.translate <= TRANSLATE_MAX || isNaN(delta.translate)) { 39895 delta.translate = 0; 39896 } 39897 } 39898 function calcBoxDelta(delta, source, target, origin2) { 39899 calcAxisDelta(delta.x, source.x, target.x, origin2 ? origin2.originX : void 0); 39900 calcAxisDelta(delta.y, source.y, target.y, origin2 ? origin2.originY : void 0); 39901 } 39902 function calcRelativeAxis(target, relative, parent) { 39903 target.min = parent.min + relative.min; 39904 target.max = target.min + calcLength(relative); 39905 } 39906 function calcRelativeBox(target, relative, parent) { 39907 calcRelativeAxis(target.x, relative.x, parent.x); 39908 calcRelativeAxis(target.y, relative.y, parent.y); 39909 } 39910 function calcRelativeAxisPosition(target, layout2, parent) { 39911 target.min = layout2.min - parent.min; 39912 target.max = target.min + calcLength(layout2); 39913 } 39914 function calcRelativePosition(target, layout2, parent) { 39915 calcRelativeAxisPosition(target.x, layout2.x, parent.x); 39916 calcRelativeAxisPosition(target.y, layout2.y, parent.y); 39917 } 39918 function applyConstraints(point, { min: min2, max: max2 }, elastic) { 39919 if (min2 !== void 0 && point < min2) { 39920 point = elastic ? mixNumber$1(min2, point, elastic.min) : Math.max(point, min2); 39921 } else if (max2 !== void 0 && point > max2) { 39922 point = elastic ? mixNumber$1(max2, point, elastic.max) : Math.min(point, max2); 39923 } 39924 return point; 39925 } 39926 function calcRelativeAxisConstraints(axis, min2, max2) { 39927 return { 39928 min: min2 !== void 0 ? axis.min + min2 : void 0, 39929 max: max2 !== void 0 ? axis.max + max2 - (axis.max - axis.min) : void 0 39930 }; 39931 } 39932 function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { 39933 return { 39934 x: calcRelativeAxisConstraints(layoutBox.x, left, right), 39935 y: calcRelativeAxisConstraints(layoutBox.y, top, bottom) 39936 }; 39937 } 39938 function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { 39939 let min2 = constraintsAxis.min - layoutAxis.min; 39940 let max2 = constraintsAxis.max - layoutAxis.max; 39941 if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) { 39942 [min2, max2] = [max2, min2]; 39943 } 39944 return { min: min2, max: max2 }; 39945 } 39946 function calcViewportConstraints(layoutBox, constraintsBox) { 39947 return { 39948 x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), 39949 y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y) 39950 }; 39951 } 39952 function calcOrigin(source, target) { 39953 let origin2 = 0.5; 39954 const sourceLength = calcLength(source); 39955 const targetLength = calcLength(target); 39956 if (targetLength > sourceLength) { 39957 origin2 = /* @__PURE__ */ progress(target.min, target.max - sourceLength, source.min); 39958 } else if (sourceLength > targetLength) { 39959 origin2 = /* @__PURE__ */ progress(source.min, source.max - targetLength, target.min); 39960 } 39961 return clamp(0, 1, origin2); 39962 } 39963 function rebaseAxisConstraints(layout2, constraints) { 39964 const relativeConstraints = {}; 39965 if (constraints.min !== void 0) { 39966 relativeConstraints.min = constraints.min - layout2.min; 39967 } 39968 if (constraints.max !== void 0) { 39969 relativeConstraints.max = constraints.max - layout2.min; 39970 } 39971 return relativeConstraints; 39972 } 39973 const defaultElastic = 0.35; 39974 function resolveDragElastic(dragElastic = defaultElastic) { 39975 if (dragElastic === false) { 39976 dragElastic = 0; 39977 } else if (dragElastic === true) { 39978 dragElastic = defaultElastic; 39979 } 39980 return { 39981 x: resolveAxisElastic(dragElastic, "left", "right"), 39982 y: resolveAxisElastic(dragElastic, "top", "bottom") 39983 }; 39984 } 39985 function resolveAxisElastic(dragElastic, minLabel, maxLabel) { 39986 return { 39987 min: resolvePointElastic(dragElastic, minLabel), 39988 max: resolvePointElastic(dragElastic, maxLabel) 39989 }; 39990 } 39991 function resolvePointElastic(dragElastic, label) { 39992 return typeof dragElastic === "number" ? dragElastic : dragElastic[label] || 0; 39993 } 39994 const createAxisDelta = () => ({ 39995 translate: 0, 39996 scale: 1, 39997 origin: 0, 39998 originPoint: 0 39999 }); 40000 const createDelta = () => ({ 40001 x: createAxisDelta(), 40002 y: createAxisDelta() 40003 }); 40004 const createAxis = () => ({ min: 0, max: 0 }); 40005 const createBox = () => ({ 40006 x: createAxis(), 40007 y: createAxis() 40008 }); 40009 function eachAxis(callback) { 40010 return [callback("x"), callback("y")]; 40011 } 40012 function convertBoundingBoxToBox({ top, left, right, bottom }) { 40013 return { 40014 x: { min: left, max: right }, 40015 y: { min: top, max: bottom } 40016 }; 40017 } 40018 function convertBoxToBoundingBox({ x: x2, y: y2 }) { 40019 return { top: y2.min, right: x2.max, bottom: y2.max, left: x2.min }; 40020 } 40021 function transformBoxPoints(point, transformPoint2) { 40022 if (!transformPoint2) 40023 return point; 40024 const topLeft = transformPoint2({ x: point.left, y: point.top }); 40025 const bottomRight = transformPoint2({ x: point.right, y: point.bottom }); 40026 return { 40027 top: topLeft.y, 40028 left: topLeft.x, 40029 bottom: bottomRight.y, 40030 right: bottomRight.x 40031 }; 40032 } 40033 function isIdentityScale(scale2) { 40034 return scale2 === void 0 || scale2 === 1; 40035 } 40036 function hasScale({ scale: scale2, scaleX, scaleY }) { 40037 return !isIdentityScale(scale2) || !isIdentityScale(scaleX) || !isIdentityScale(scaleY); 40038 } 40039 function hasTransform(values) { 40040 return hasScale(values) || has2DTranslate(values) || values.z || values.rotate || values.rotateX || values.rotateY || values.skewX || values.skewY; 40041 } 40042 function has2DTranslate(values) { 40043 return is2DTranslate(values.x) || is2DTranslate(values.y); 40044 } 40045 function is2DTranslate(value) { 40046 return value && value !== "0%"; 40047 } 40048 function scalePoint(point, scale2, originPoint) { 40049 const distanceFromOrigin = point - originPoint; 40050 const scaled = scale2 * distanceFromOrigin; 40051 return originPoint + scaled; 40052 } 40053 function applyPointDelta(point, translate, scale2, originPoint, boxScale) { 40054 if (boxScale !== void 0) { 40055 point = scalePoint(point, boxScale, originPoint); 40056 } 40057 return scalePoint(point, scale2, originPoint) + translate; 40058 } 40059 function applyAxisDelta(axis, translate = 0, scale2 = 1, originPoint, boxScale) { 40060 axis.min = applyPointDelta(axis.min, translate, scale2, originPoint, boxScale); 40061 axis.max = applyPointDelta(axis.max, translate, scale2, originPoint, boxScale); 40062 } 40063 function applyBoxDelta(box, { x: x2, y: y2 }) { 40064 applyAxisDelta(box.x, x2.translate, x2.scale, x2.originPoint); 40065 applyAxisDelta(box.y, y2.translate, y2.scale, y2.originPoint); 40066 } 40067 const TREE_SCALE_SNAP_MIN = 0.999999999999; 40068 const TREE_SCALE_SNAP_MAX = 1.0000000000001; 40069 function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { 40070 const treeLength = treePath.length; 40071 if (!treeLength) 40072 return; 40073 treeScale.x = treeScale.y = 1; 40074 let node2; 40075 let delta; 40076 for (let i2 = 0; i2 < treeLength; i2++) { 40077 node2 = treePath[i2]; 40078 delta = node2.projectionDelta; 40079 const { visualElement } = node2.options; 40080 if (visualElement && visualElement.props.style && visualElement.props.style.display === "contents") { 40081 continue; 40082 } 40083 if (isSharedTransition && node2.options.layoutScroll && node2.scroll && node2 !== no
40083de2.root) { 40084 transformBox(box, { 40085 x: -node2.scroll.offset.x, 40086 y: -node2.scroll.offset.y 40087 }); 40088 } 40089 if (delta) { 40090 treeScale.x *= delta.x.scale; 40091 treeScale.y *= delta.y.scale; 40092 applyBoxDelta(box, delta); 40093 } 40094 if (isSharedTransition && hasTransform(node2.latestValues)) { 40095 transformBox(box, node2.latestValues); 40096 } 40097 } 40098 if (treeScale.x < TREE_SCALE_SNAP_MAX && treeScale.x > TREE_SCALE_SNAP_MIN) { 40099 treeScale.x = 1; 40100 } 40101 if (treeScale.y < TREE_SCALE_SNAP_MAX && treeScale.y > TREE_SCALE_SNAP_MIN) { 40102 treeScale.y = 1; 40103 } 40104 } 40105 function translateAxis(axis, distance2) { 40106 axis.min = axis.min + distance2; 40107 axis.max = axis.max + distance2; 40108 } 40109 function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { 40110 const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); 40111 applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); 40112 } 40113 function transformBox(box, transform2) { 40114 transformAxis(box.x, transform2.x, transform2.scaleX, transform2.scale, transform2.originX); 40115 transformAxis(box.y, transform2.y, transform2.scaleY, transform2.scale, transform2.originY); 40116 } 40117 function measureViewportBox(instance2, transformPoint2) { 40118 return convertBoundingBoxToBox(transformBoxPoints(instance2.getBoundingClientRect(), transformPoint2)); 40119 } 40120 function measurePageBox(element, rootProjectionNode2, transformPagePoint) { 40121 const viewportBox = measureViewportBox(element, transformPagePoint); 40122 const { scroll } = rootProjectionNode2; 40123 if (scroll) { 40124 translateAxis(viewportBox.x, scroll.offset.x); 40125 translateAxis(viewportBox.y, scroll.offset.y); 40126 } 40127 return viewportBox; 40128 } 40129 const getContextWindow = ({ current }) => { 40130 return current ? current.ownerDocument.defaultView : null; 40131 }; 40132 const elementDragControls = /* @__PURE__ */ new WeakMap(); 40133 class VisualElementDragControls { 40134 constructor(visualElement) { 40135 this.openDragLock = null; 40136 this.isDragging = false; 40137 this.currentDirection = null; 40138 this.originPoint = { x: 0, y: 0 }; 40139 this.constraints = false; 40140 this.hasMutatedConstraints = false; 40141 this.elastic = createBox(); 40142 this.visualElement = visualElement; 40143 } 40144 start(originEvent, { snapToCursor = false } = {}) { 40145 const { presenceContext } = this.visualElement; 40146 if (presenceContext && presenceContext.isPresent === false) 40147 return; 40148 const onSessionStart = (event) => { 40149 const { dragSnapToOrigin: dragSnapToOrigin2 } = this.getProps(); 40150 dragSnapToOrigin2 ? this.pauseAnimation() : this.stopAnimation(); 40151 if (snapToCursor) { 40152 this.snapToCursor(extractEventInfo(event).point); 40153 } 40154 }; 40155 const onStart = (event, info) => { 40156 const { drag: drag2, dragPropagation, onDragStart } = this.getProps(); 40157 if (drag2 && !dragPropagation) { 40158 if (this.openDragLock) 40159 this.openDragLock(); 40160 this.openDragLock = setDragLock(drag2); 40161 if (!this.openDragLock) 40162 return; 40163 } 40164 this.isDragging = true; 40165 this.currentDirection = null; 40166 this.resolveConstraints(); 40167 if (this.visualElement.projection) { 40168 this.visualElement.projection.isAnimationBlocked = true; 40169 this.visualElement.projection.target = void 0; 40170 } 40171 eachAxis((axis) => { 40172 let current = this.getAxisMotionValue(axis).get() || 0; 40173 if (percent.test(current)) { 40174 const { projection } = this.visualElement; 40175 if (projection && projection.layout) { 40176 const measuredAxis = projection.layout.layoutBox[axis]; 40177 if (measuredAxis) { 40178 const length2 = calcLength(measuredAxis); 40179 current = length2 * (parseFloat(current) / 100); 40180 } 40181 } 40182 } 40183 this.originPoint[axis] = current; 40184 }); 40185 if (onDragStart) { 40186 frame.postRender(() => onDragStart(event, info)); 40187 } 40188 addValueToWillChange(this.visualElement, "transform"); 40189 const { animationState } = this.visualElement; 40190 animationState && animationState.setActive("whileDrag", true); 40191 }; 40192 const onMove = (event, info) => { 40193 const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag } = this.getProps(); 40194 if (!dragPropagation && !this.openDragLock) 40195 return; 40196 const { offset: offset2 } = info; 40197 if (dragDirectionLock && this.currentDirection === null) { 40198 this.currentDirection = getCurrentDirection(offset2); 40199 if (this.currentDirection !== null) { 40200 onDirectionLock && onDirectionLock(this.currentDirection); 40201 } 40202 return; 40203 } 40204 this.updateAxis("x", info.point, offset2); 40205 this.updateAxis("y", info.point, offset2); 40206 this.visualElement.render(); 40207 onDrag && onDrag(event, info); 40208 }; 40209 const onSessionEnd = (event, info) => this.stop(event, info); 40210 const resumeAnimation = () => eachAxis((axis) => { 40211 var _a; 40212 return this.getAnimationState(axis) === "paused" && ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play()); 40213 }); 40214 const { dragSnapToOrigin } = this.getProps(); 40215 this.panSession = new PanSession(originEvent, { 40216 onSessionStart, 40217 onStart, 40218 onMove, 40219 onSessionEnd, 40220 resumeAnimation 40221 }, { 40222 transformPagePoint: this.visualElement.getTransformPagePoint(), 40223 dragSnapToOrigin, 40224 contextWindow: getContextWindow(this.visualElement) 40225 }); 40226 } 40227 stop(event, info) { 40228 const isDragging2 = this.isDragging; 40229 this.cancel(); 40230 if (!isDragging2) 40231 return; 40232 const { velocity } = info; 40233 this.startAnimation(velocity); 40234 const { onDragEnd } = this.getProps(); 40235 if (onDragEnd) { 40236 frame.postRender(() => onDragEnd(event, info)); 40237 } 40238 } 40239 cancel() { 40240 this.isDragging = false;
vendor: 14,698 bytes, lines 40241-40593
40241 const { projection, animationState } = this.visualElement; 40242 if (projection) { 40243 projection.isAnimationBlocked = false; 40244 } 40245 this.panSession && this.panSession.end(); 40246 this.panSession = void 0; 40247 const { dragPropagation } = this.getProps(); 40248 if (!dragPropagation && this.openDragLock) { 40249 this.openDragLock(); 40250 this.openDragLock = null; 40251 } 40252 animationState && animationState.setActive("whileDrag", false); 40253 } 40254 updateAxis(axis, _point, offset2) { 40255 const { drag: drag2 } = this.getProps(); 40256 if (!offset2 || !shouldDrag(axis, drag2, this.currentDirection)) 40257 return; 40258 const axisValue = this.getAxisMotionValue(axis); 40259 let next2 = this.originPoint[axis] + offset2[axis]; 40260 if (this.constraints && this.constraints[axis]) { 40261 next2 = applyConstraints(next2, this.constraints[axis], this.elastic[axis]); 40262 } 40263 axisValue.set(next2); 40264 } 40265 resolveConstraints() { 40266 var _a; 40267 const { dragConstraints, dragElastic } = this.getProps(); 40268 const layout2 = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout; 40269 const prevConstraints = this.constraints; 40270 if (dragConstraints && isRefObject(dragConstraints)) { 40271 if (!this.constraints) { 40272 this.constraints = this.resolveRefConstraints(); 40273 } 40274 } else { 40275 if (dragConstraints && layout2) { 40276 this.constraints = calcRelativeConstraints(layout2.layoutBox, dragConstraints); 40277 } else { 40278 this.constraints = false; 40279 } 40280 } 40281 this.elastic = resolveDragElastic(dragElastic); 40282 if (prevConstraints !== this.constraints && layout2 && this.constraints && !this.hasMutatedConstraints) { 40283 eachAxis((axis) => { 40284 if (this.constraints !== false && this.getAxisMotionValue(axis)) { 40285 this.constraints[axis] = rebaseAxisConstraints(layout2.layoutBox[axis], this.constraints[axis]); 40286 } 40287 }); 40288 } 40289 } 40290 resolveRefConstraints() { 40291 const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); 40292 if (!constraints || !isRefObject(constraints)) 40293 return false; 40294 const constraintsElement = constraints.current; 40295 const { projection } = this.visualElement; 40296 if (!projection || !projection.layout) 40297 return false; 40298 const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); 40299 let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); 40300 if (onMeasureDragConstraints) { 40301 const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); 40302 this.hasMutatedConstraints = !!userConstraints; 40303 if (userConstraints) { 40304 measuredConstraints = convertBoundingBoxToBox(userConstraints); 40305 } 40306 } 40307 return measuredConstraints; 40308 } 40309 startAnimation(velocity) { 40310 const { drag: drag2, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd } = this.getProps(); 40311 const constraints = this.constraints || {}; 40312 const momentumAnimations = eachAxis((axis) => { 40313 if (!shouldDrag(axis, drag2, this.currentDirection)) { 40314 return; 40315 } 40316 let transition = constraints && constraints[axis] || {}; 40317 if (dragSnapToOrigin) 40318 transition = { min: 0, max: 0 }; 40319 const bounceStiffness = dragElastic ? 200 : 1e6; 40320 const bounceDamping = dragElastic ? 40 : 1e7; 40321 const inertia2 = __spreadValues(__spreadValues({ 40322 type: "inertia", 40323 velocity: dragMomentum ? velocity[axis] : 0, 40324 bounceStiffness, 40325 bounceDamping, 40326 timeConstant: 750, 40327 restDelta: 1, 40328 restSpeed: 10 40329 }, dragTransition), transition); 40330 return this.startAxisValueAnimation(axis, inertia2); 40331 }); 40332 return Promise.all(momentumAnimations).then(onDragTransitionEnd); 40333 } 40334 startAxisValueAnimation(axis, transition) { 40335 const axisValue = this.getAxisMotionValue(axis); 40336 addValueToWillChange(this.visualElement, axis); 40337 return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); 40338 } 40339 stopAnimation() { 40340 eachAxis((axis) => this.getAxisMotionValue(axis).stop()); 40341 } 40342 pauseAnimation() { 40343 eachAxis((axis) => { 40344 var _a; 40345 return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); 40346 }); 40347 } 40348 getAnimationState(axis) { 40349 var _a; 40350 return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state; 40351 } 40352 /** 40353 * Drag works differently depending on which props are provided. 40354 * 40355 * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. 40356 * - Otherwise, we apply the delta to the x/y motion values. 40357 */ 40358 getAxisMotionValue(axis) { 40359 const dragKey = `_drag${axis.toUpperCase()}`; 40360 const props = this.visualElement.getProps(); 40361 const externalMotionValue = props[dragKey]; 40362 return externalMotionValue ? externalMotionValue : this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : void 0) || 0); 40363 } 40364 snapToCursor(point) { 40365 eachAxis((axis) => { 40366 const { drag: drag2 } = this.getProps(); 40367 if (!shouldDrag(axis, drag2, this.currentDirection)) 40368 return; 40369 const { projection } = this.visualElement; 40370 const axisValue = this.getAxisMotionValue(axis); 40371 if (projection && projection.layout) { 40372 const { min: min2, max: max2 } = projection.layout.layoutBox[axis]; 40373 axisValue.set(point[axis] - mixNumber$1(min2, max2, 0.5)); 40374 } 40375 }); 40376 } 40377 /** 40378 * When the viewport resizes we want to check if the measured constraints 40379 * have changed and, if so, reposition the element within those new constraints 40380 * relative to where it was before the resize. 40381 */ 40382 scalePositionWithinConstraints() { 40383 if (!this.visualElement.current) 40384 return; 40385 const { drag: drag2, dragConstraints } = this.getProps(); 40386 const { projection } = this.visualElement; 40387 if (!isRefObject(dragConstraints) || !projection || !this.constraints) 40388 return; 40389 this.stopAnimation(); 40390 const boxProgress = { x: 0, y: 0 }; 40391 eachAxis((axis) => { 40392 const axisValue = this.getAxisMotionValue(axis); 40393 if (axisValue && this.constraints !== false) { 40394 const latest = axisValue.get(); 40395 boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); 40396 } 40397 }); 40398 const { transformTemplate } = this.visualElement.getProps(); 40399 this.visualElement.current.style.transform = transformTemplate ? transformTemplate({}, "") : "none"; 40400 projection.root && projection.root.updateScroll(); 40401 projection.updateLayout(); 40402 this.resolveConstraints(); 40403 eachAxis((axis) => { 40404 if (!shouldDrag(axis, drag2, null)) 40405 return; 40406 const axisValue = this.getAxisMotionValue(axis); 40407 const { min: min2, max: max2 } = this.constraints[axis]; 40408 axisValue.set(mixNumber$1(min2, max2, boxProgress[axis])); 40409 }); 40410 } 40411 addListeners() { 40412 if (!this.visualElement.current) 40413 return; 40414 elementDragControls.set(this.visualElement, this); 40415 const element = this.visualElement.current; 40416 const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { 40417 const { drag: drag2, dragListener = true } = this.getProps(); 40418 drag2 && dragListener && this.start(event); 40419 }); 40420 const measureDragConstraints = () => { 40421 const { dragConstraints } = this.getProps(); 40422 if (isRefObject(dragConstraints) && dragConstraints.current) { 40423 this.constraints = this.resolveRefConstraints(); 40424 } 40425 }; 40426 const { projection } = this.visualElement; 40427 const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); 40428 if (projection && !projection.layout) { 40429 projection.root && projection.root.updateScroll(); 40430 projection.updateLayout(); 40431 } 40432 frame.read(measureDragConstraints); 40433 const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); 40434 const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { 40435 if (this.isDragging && hasLayoutChanged) { 40436 eachAxis((axis) => { 40437 const motionValue2 = this.getAxisMotionValue(axis); 40438 if (!motionValue2) 40439 return; 40440 this.originPoint[axis] += delta[axis].translate; 40441 motionValue2.set(motionValue2.get() + delta[axis].translate); 40442 }); 40443 this.visualElement.render(); 40444 } 40445 })); 40446 return () => { 40447 stopResizeListener(); 40448 stopPointerListener(); 40449 stopMeasureLayoutListener(); 40450 stopLayoutUpdateListener && stopLayoutUpdateListener(); 40451 }; 40452 } 40453 getProps() { 40454 const props = this.visualElement.getProps(); 40455 const { drag: drag2 = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true } = props; 40456 return __spreadProps(__spreadValues({}, props), { 40457 drag: drag2, 40458 dragDirectionLock, 40459 dragPropagation, 40460 dragConstraints, 40461 dragElastic, 40462 dragMomentum 40463 }); 40464 } 40465 } 40466 function shouldDrag(direction, drag2, currentDirection) { 40467 return (drag2 === true || drag2 === direction) && (currentDirection === null || currentDirection === direction); 40468 } 40469 function getCurrentDirection(offset2, lockThreshold = 10) { 40470 let direction = null; 40471 if (Math.abs(offset2.y) > lockThreshold) { 40472 direction = "y"; 40473 } else if (Math.abs(offset2.x) > lockThreshold) { 40474 direction = "x"; 40475 } 40476 return direction; 40477 } 40478 class DragGesture extends Feature { 40479 constructor(node2) { 40480 super(node2); 40481 this.removeGroupControls = noop$3; 40482 this.removeListeners = noop$3; 40483 this.controls = new VisualElementDragControls(node2); 40484 } 40485 mount() { 40486 const { dragControls } = this.node.getProps(); 40487 if (dragControls) { 40488 this.removeGroupControls = dragControls.subscribe(this.controls); 40489 } 40490 this.removeListeners = this.controls.addListeners() || noop$3; 40491 } 40492 unmount() { 40493 this.removeGroupControls(); 40494 this.removeListeners(); 40495 } 40496 } 40497 const asyncHandler = (handler) => (event, info) => { 40498 if (handler) { 40499 frame.postRender(() => handler(event, info)); 40500 } 40501 }; 40502 class PanGesture extends Feature { 40503 constructor() { 40504 super(...arguments); 40505 this.removePointerDownListener = noop$3; 40506 } 40507 onPointerDown(pointerDownEvent) { 40508 this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { 40509 transformPagePoint: this.node.getTransformPagePoint(), 40510 contextWindow: getContextWindow(this.node) 40511 }); 40512 } 40513 createPanHandlers() { 40514 const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); 40515 return { 40516 onSessionStart: asyncHandler(onPanSessionStart), 40517 onStart: asyncHandler(onPanStart), 40518 onMove: onPan, 40519 onEnd: (event, info) => { 40520 delete this.session; 40521 if (onPanEnd) { 40522 frame.postRender(() => onPanEnd(event, info)); 40523 } 40524 } 40525 }; 40526 } 40527 mount() { 40528 this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); 40529 } 40530 update() { 40531 this.session && this.session.updateHandlers(this.createPanHandlers()); 40532 } 40533 unmount() { 40534 this.removePointerDownListener(); 40535 this.session && this.session.end(); 40536 } 40537 } 40538 const globalProjectionState = { 40539 /** 40540 * Global flag as to whether the tree has animated since the last time 40541 * we resized the window 40542 */ 40543 hasAnimatedSinceResize: true, 40544 /** 40545 * We set this to true once, on the first update. Any nodes added to the tree beyond that 40546 * update will be given a `data-projection-id` attribute. 40547 */ 40548 hasEverUpdated: false 40549 }; 40550 function pixelsToPercent(pixels, axis) { 40551 if (axis.max === axis.min) 40552 return 0; 40553 return pixels / (axis.max - axis.min) * 100; 40554 } 40555 const correctBorderRadius = { 40556 correct: (latest, node2) => { 40557 if (!node2.target) 40558 return latest; 40559 if (typeof latest === "string") { 40560 if (px.test(latest)) { 40561 latest = parseFloat(latest); 40562 } else { 40563 return latest; 40564 } 40565 } 40566 const x2 = pixelsToPercent(latest, node2.target.x); 40567 const y2 = pixelsToPercent(latest, node2.target.y); 40568 return `${x2}% ${y2}%`; 40569 } 40570 }; 40571 const correctBoxShadow = { 40572 correct: (latest, { treeScale, projectionDelta }) => { 40573 const original = latest; 40574 const shadow = complex.parse(latest); 40575 if (shadow.length > 5) 40576 return original; 40577 const template = complex.createTransformer(latest); 40578 const offset2 = typeof shadow[0] !== "number" ? 1 : 0; 40579 const xScale = projectionDelta.x.scale * treeScale.x; 40580 const yScale = projectionDelta.y.scale * treeScale.y; 40581 shadow[0 + offset2] /= xScale; 40582 shadow[1 + offset2] /= yScale; 40583 const averageScale = mixNumber$1(xScale, yScale, 0.5); 40584 if (typeof shadow[2 + offset2] === "number") 40585 shadow[2 + offset2] /= averageScale; 40586 if (typeof shadow[3 + offset2] === "number") 40587 shadow[3 + offset2] /= averageScale; 40588 return template(shadow); 40589 } 40590 }; 40591 class MeasureLayoutWithContext extends reactExports.Component { 40592 /** 40593 * This only mounts projection nodes for components that
40594 * need measuring, we might want to do it for all components 40595 * in order to incorporate transforms 40596 */ 40597 componentDidMount() { 40598 const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; 40599 const { projection } = visualElement; 40600 addScaleCorrector(defaultScaleCorrectors); 40601 if (projection) { 40602 if (layoutGroup.group) 40603 layoutGroup.group.add(projection); 40604 if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { 40605 switchLayoutGroup.register(projection); 40606 } 40607 projection.root.didUpdate(); 40608 projection.addEventListener("animationComplete", () => { 40609 this.safeToRemove(); 40610 }); 40611 projection.setOptions(__spreadProps(__spreadValues({}, projection.options), { 40612 onExitComplete: () => this.safeToRemove() 40613 })); 40614 } 40615 globalProjectionState.hasEverUpdated = true; 40616 } 40617 getSnapshotBeforeUpdate(prevProps) { 40618 const { layoutDependency, visualElement, drag: drag2, isPresent } = this.props; 40619 const projection = visualElement.projection; 40620 if (!projection) 40621 return null; 40622 projection.isPresent = isPresent; 40623 if (drag2 || prevProps.layoutDependency !== layoutDependency || layoutDependency === void 0) { 40624 projection.willUpdate(); 40625 } else { 40626 this.safeToRemove(); 40627 } 40628 if (prevProps.isPresent !== isPresent) { 40629 if (isPresent) { 40630 projection.promote(); 40631 } else if (!projection.relegate()) { 40632 frame.postRender(() => { 40633 const stack = projection.getStack(); 40634 if (!stack || !stack.members.length) { 40635 this.safeToRemove(); 40636 } 40637 }); 40638 } 40639 } 40640 return null; 40641 } 40642 componentDidUpdate() { 40643 const { projection } = this.props.visualElement; 40644 if (projection) { 40645 projection.root.didUpdate(); 40646 microtask.postRender(() => { 40647 if (!projection.currentAnimation && projection.isLead()) { 40648 this.safeToRemove(); 40649 } 40650 }); 40651 } 40652 } 40653 componentWillUnmount() { 40654 const { visualElement, layoutGroup, switchLayoutGroup: promoteContext } = this.props; 40655 const { projection } = visualElement; 40656 if (projection) { 40657 projection.scheduleCheckAfterUnmount(); 40658 if (layoutGroup && layoutGroup.group) 40659 layoutGroup.group.remove(projection); 40660 if (promoteContext && promoteContext.deregister) 40661 promoteContext.deregister(projection); 40662 } 40663 } 40664 safeToRemove() { 40665 const { safeToRemove } = this.props; 40666 safeToRemove && safeToRemove(); 40667 } 40668 render() { 40669 return null; 40670 } 40671 } 40672 function MeasureLayout(props) { 40673 const [isPresent, safeToRemove] = usePresence(); 40674 const layoutGroup = reactExports.useContext(LayoutGroupContext); 40675 return jsxRuntimeExports.jsx(MeasureLayoutWithContext, __spreadProps(__spreadValues({}, props), { layoutGroup, switchLayoutGroup: reactExports.useContext(SwitchLayoutGroupContext), isPresent, safeToRemove })); 40676 } 40677 const defaultScaleCorrectors = { 40678 borderRadius: __spreadProps(__spreadValues({}, correctBorderRadius), { 40679 applyTo: [ 40680 "borderTopLeftRadius", 40681 "borderTopRightRadius", 40682 "borderBottomLeftRadius", 40683 "borderBottomRightRadius" 40684 ] 40685 }), 40686 borderTopLeftRadius: correctBorderRadius, 40687 borderTopRightRadius: correctBorderRadius, 40688 borderBottomLeftRadius: correctBorderRadius, 40689 borderBottomRightRadius: correctBorderRadius, 40690 boxShadow: correctBoxShadow 40691 }; 40692 function animateSingleValue(value, keyframes2, options2) { 40693 const motionValue$1 = isMotionValue(value) ? value : motionValue(value); 40694 motionValue$1.start(animateMotionValue("", motionValue$1, keyframes2, options2)); 40695 return motionValue$1.animation; 40696 } 40697 function isSVGElement(element) { 40698 return element instanceof SVGElement && element.tagName !== "svg"; 40699 } 40700 const compareByDepth = (a2, b2) => a2.depth - b2.depth; 40701 class FlatTree { 40702 constructor() { 40703 this.children = []; 40704 this.isDirty = false;
40705 } 40706 add(child) { 40707 addUniqueItem(this.children, child); 40708 this.isDirty = true; 40709 } 40710 remove(child) { 40711 removeItem(this.children, child); 40712 this.isDirty = true; 40713 } 40714 forEach(callback) { 40715 this.isDirty && this.children.sort(compareByDepth); 40716 this.isDirty = false; 40717 this.children.forEach(callback); 40718 } 40719 } 40720 function delay(callback, timeout) { 40721 const start = time.now(); 40722 const checkElapsed = ({ timestamp }) => { 40723 const elapsed = timestamp - start; 40724 if (elapsed >= timeout) { 40725 cancelFrame(checkElapsed); 40726 callback(elapsed - timeout); 40727 } 40728 }; 40729 frame.read(checkElapsed, true); 40730 return () => cancelFrame(checkElapsed); 40731 } 40732 const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; 40733 const numBorders = borders.length; 40734 const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; 40735 const isPx = (value) => typeof value === "number" || px.test(value); 40736 function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOnlyMember) { 40737 if (shouldCrossfadeOpacity) { 40738 target.opacity = mixNumber$1( 40739 0, 40740 // TODO Reinstate this if only child 40741 lead.opacity !== void 0 ? lead.opacity : 1, 40742 easeCrossfadeIn(progress2) 40743 ); 40744 target.opacityExit = mixNumber$1(follow.opacity !== void 0 ? follow.opacity : 1, 0, easeCrossfadeOut(progress2)); 40745 } else if (isOnlyMember) { 40746 target.opacity = mixNumber$1(follow.opacity !== void 0 ? follow.opacity : 1, lead.opacity !== void 0 ? lead.opacity : 1, progress2); 40747 } 40748 for (let i2 = 0; i2 < numBorders; i2++) { 40749 const borderLabel = `border${borders[i2]}Radius`; 40750 let followRadius = getRadius(follow, borderLabel); 40751 let leadRadius = getRadius(lead, borderLabel); 40752 if (followRadius === void 0 && leadRadius === void 0) 40753 continue; 40754 followRadius || (followRadius = 0); 40755 leadRadius || (leadRadius = 0); 40756 const canMix = followRadius === 0 || leadRadius === 0 || isPx(followRadius) === isPx(leadRadius); 40757 if (canMix) { 40758 target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress2), 0); 40759 if (percent.test(leadRadius) || percent.test(followRadius)) { 40760 target[borderLabel] += "%"; 40761 } 40762 } else { 40763 target[borderLabel] = leadRadius; 40764 } 40765 } 40766 if (follow.rotate || lead.rotate) { 40767 target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress2); 40768 } 40769 } 40770 function getRadius(values, radiusName) { 40771 return values[radiusName] !== void 0 ? values[radiusName] : values.borderRadius; 40772 } 40773 const easeCrossfadeIn = /* @__PURE__ */ compress(0, 0.5, circOut); 40774 const easeCrossfadeOut = /* @__PURE__ */ compress(0.5, 0.95, noop$3); 40775 function compress(min2, max2, easing) { 40776 return (p2) => { 40777 if (p2 < min2) 40778 return 0; 40779 if (p2 > max2) 40780 return 1; 40781 return easing(/* @__PURE__ */ progress(min2, max2, p2)); 40782 }; 40783 } 40784 function copyAxisInto(axis, originAxis) { 40785 axis.min = originAxis.min; 40786 axis.max = originAxis.max; 40787 } 40788 function copyBoxInto(box, originBox) { 40789 copyAxisInto(box.x, originBox.x); 40790 copyAxisInto(box.y, originBox.y); 40791 } 40792 function copyAxisDeltaInto(delta, originDelta) { 40793 delta.translate = originDelta.translate; 40794 delta.scale = originDelta.scale; 40795 delta.originPoint = originDelta.originPoint; 40796 delta.origin = originDelta.origin; 40797 } 40798 function removePointDelta(point, translate, scale2, originPoint, boxScale) { 40799 point -= translate; 40800 point = scalePoint(point, 1 / scale2, originPoint); 40801 if (boxScale !== void 0) { 40802 point = scalePoint(point, 1 / boxScale, originPoint); 40803 } 40804 return point; 40805 } 40806 function removeAxisDelta(axis, translate = 0, scale2 = 1, origin2 = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { 40807 if (percent.test(translate)) { 40808 translate = parseFloat(translate); 40809 const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); 40810 translate = relativeProgress - sourceAxis.min; 40811 }
40812 if (typeof translate !== "number") 40813 return; 40814 let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin2); 40815 if (axis === originAxis) 40816 originPoint -= translate; 40817 axis.min = removePointDelta(axis.min, translate, scale2, originPoint, boxScale); 40818 axis.max = removePointDelta(axis.max, translate, scale2, originPoint, boxScale); 40819 } 40820 function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin2, sourceAxis) { 40821 removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin2, sourceAxis); 40822 } 40823 const xKeys = ["x", "scaleX", "originX"]; 40824 const yKeys = ["y", "scaleY", "originY"]; 40825 function removeBoxTransforms(box, transforms, originBox, sourceBox) { 40826 removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : void 0, sourceBox ? sourceBox.x : void 0); 40827 removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : void 0, sourceBox ? sourceBox.y : void 0); 40828 } 40829 function isAxisDeltaZero(delta) { 40830 return delta.translate === 0 && delta.scale === 1; 40831 } 40832 function isDeltaZero(delta) { 40833 return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); 40834 } 40835 function axisEquals(a2, b2) { 40836 return a2.min === b2.min && a2.max === b2.max; 40837 } 40838 function boxEquals(a2, b2) { 40839 return axisEquals(a2.x, b2.x) && axisEquals(a2.y, b2.y); 40840 } 40841 function axisEqualsRounded(a2, b2) { 40842 return Math.round(a2.min) === Math.round(b2.min) && Math.round(a2.max) === Math.round(b2.max); 40843 } 40844 function boxEqualsRounded(a2, b2) { 40845 return axisEqualsRounded(a2.x, b2.x) && axisEqualsRounded(a2.y, b2.y); 40846 } 40847 function aspectRatio(box) { 40848 return calcLength(box.x) / calcLength(box.y); 40849 } 40850 function axisDeltaEquals(a2, b2) { 40851 return a2.translate === b2.translate && a2.scale === b2.scale && a2.originPoint === b2.originPoint; 40852 } 40853 class NodeStack { 40854 constructor() { 40855 this.members = []; 40856 } 40857 add(node2) { 40858 addUniqueItem(this.members, node2); 40859 node2.scheduleRender(); 40860 } 40861 remove(node2) { 40862 removeItem(this.members, node2); 40863 if (node2 === this.prevLead) { 40864 this.prevLead = void 0; 40865 } 40866 if (node2 === this.lead) { 40867 const prevLead = this.members[this.members.length - 1]; 40868 if (prevLead) { 40869 this.promote(prevLead); 40870 } 40871 } 40872 } 40873 relegate(node2) {
40874 const indexOfNode = this.members.findIndex((member) => node2 === member); 40875 if (indexOfNode === 0) 40876 return false; 40877 let prevLead; 40878 for (let i2 = indexOfNode; i2 >= 0; i2--) { 40879 const member = this.members[i2]; 40880 if (member.isPresent !== false) { 40881 prevLead = member; 40882 break; 40883 } 40884 } 40885 if (prevLead) { 40886 this.promote(prevLead); 40887 return true; 40888 } else { 40889 return false; 40890 } 40891 } 40892 promote(node2, preserveFollowOpacity) { 40893 const prevLead = this.lead; 40894 if (node2 === prevLead) 40895 return; 40896 this.prevLead = prevLead; 40897 this.lead = node2; 40898 node2.show(); 40899 if (prevLead) { 40900 prevLead.instance && prevLead.scheduleRender(); 40901 node2.scheduleRender(); 40902 node2.resumeFrom = prevLead; 40903 if (preserveFollowOpacity) { 40904 node2.resumeFrom.preserveOpacity = true; 40905 } 40906 if (prevLead.snapshot) { 40907 node2.snapshot = prevLead.snapshot; 40908 node2.snapshot.latestValues = prevLead.animationValues || prevLead.latestValues; 40909 } 40910 if (node2.root && node2.root.isUpdating) { 40911 node2.isLayoutDirty = true; 40912 } 40913 const { crossfade } = node2.options; 40914 if (crossfade === false) { 40915 prevLead.hide(); 40916 } 40917 } 40918 } 40919 exitAnimationComplete() { 40920 this.members.forEach((node2) => { 40921 const { options: options2, resumingFrom } = node2; 40922 options2.onExitComplete && options2.onExitComplete(); 40923 if (resumingFrom) { 40924 resumingFrom.options.onExitComplete && resumingFrom.options.onExitComplete(); 40925 } 40926 }); 40927 } 40928 scheduleRender() { 40929 this.members.forEach((node2) => { 40930 node2.instance && node2.scheduleRender(false); 40931 }); 40932 } 40933 /** 40934 * Clear any leads that have been removed this render to prevent them from being 40935 * used in future animations and to prevent memory leaks 40936 */ 40937 removeLeadSnapshot() { 40938 if (this.lead && this.lead.snapshot) { 40939 this.lead.snapshot = void 0; 40940 } 40941 } 40942 } 40943 function buildProjectionTransform(delta, treeScale, latestTransform) { 40944 let transform2 = ""; 40945 const xTranslate = delta.x.translate / treeScale.x; 40946 const yTranslate = delta.y.translate / treeScale.y; 40947 const zTranslate = (latestTransform === null || latestTransform === void 0 ? void 0 : latestTransform.z) || 0; 40948 if (xTranslate || yTranslate || zTranslate) { 40949 transform2 = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; 40950 } 40951 if (treeScale.x !== 1 || treeScale.y !== 1) { 40952 transform2 += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; 40953 } 40954 if (latestTransform) { 40955 const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform; 40956 if (transformPerspective) 40957 transform2 = `perspective(${transformPerspective}px) ${transform2}`; 40958 if (rotate) 40959 transform2 += `rotate(${rotate}deg) `; 40960 if (rotateX) 40961 transform2 += `rotateX(${rotateX}deg) `; 40962 if (rotateY) 40963 transform2 += `rotateY(${rotateY}deg) `; 40964 if (skewX) 40965 transform2 += `skewX(${skewX}deg) `; 40966 if (skewY) 40967 transform2 += `skewY(${skewY}deg) `; 40968 } 40969 const elementScaleX = delta.x.scale * treeScale.x; 40970 const elementScaleY = delta.y.scale * treeScale.y; 40971 if (elementScaleX !== 1 || elementScaleY !== 1) { 40972 transform2 += `scale(${elementScaleX}, ${elementScaleY})`; 40973 } 40974 return transform2 || "none"; 40975 } 40976 const metrics = { 40977 type: "projectionFrame", 40978 totalNodes: 0, 40979 resolvedTargetDeltas: 0, 40980 recalculatedProjection: 0 40981 }; 40982 const isDebug = typeof window !== "undefined" && window.MotionDebug !== void 0; 40983 const transformAxes = ["", "X", "Y", "Z"]; 40984 const hiddenVisibility = { visibility: "hidden" }; 40985 const animationTarget = 1e3; 40986 let id = 0; 40987 function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { 40988 const { latestValues } = visualElement; 40989 if (latestValues[key]) { 40990 values[key] = latestValues[key]; 40991 visualElement.setStaticValue(key, 0); 40992 if (sharedAnimationValues) { 40993 sharedAnimationValues[key] = 0; 40994 } 40995 } 40996 } 40997 function cancelTreeOptimisedTransformAnimations(projectionNode) { 40998 projectionNode.hasCheckedOptimisedAppear = true; 40999 if (projectionNode.root === projectionNode) 41000 return; 41001 const { visualElement } = projectionNode.options; 41002 if (!visualElement) 41003 return; 41004 const appearId = getOptimisedAppearId(visualElement); 41005 if (window.MotionHasOptimisedAnimation(appearId, "transform")) { 41006 const { layout: layout2, layoutId } = projectionNode.options; 41007 window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout2 || layoutId)); 41008 } 41009 const { parent } = projectionNode; 41010 if (parent && !parent.hasCheckedOptimisedAppear) { 41011 cancelTreeOptimisedTransformAnimations(parent); 41012 } 41013 } 41014 function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform }) { 41015 return class ProjectionNode { 41016 constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) { 41017 this.id = id++; 41018 this.animationId = 0; 41019 this.children = /* @__PURE__ */ new Set(); 41020 this.options = {}; 41021 this.isTreeAnimating = false;
41022 this.isAnimationBlocked = false; 41023 this.isLayoutDirty = false; 41024 this.isProjectionDirty = false; 41025 this.isSharedProjectionDirty = false; 41026 this.isTransformDirty = false; 41027 this.updateManuallyBlocked = false; 41028 this.updateBlockedByResize = false; 41029 this.isUpdating = false; 41030 this.isSVG = false; 41031 this.needsReset = false; 41032 this.shouldResetTransform = false; 41033 this.hasCheckedOptimisedAppear = false; 41034 this.treeScale = { x: 1, y: 1 }; 41035 this.eventHandlers = /* @__PURE__ */ new Map(); 41036 this.hasTreeAnimated = false; 41037 this.updateScheduled = false; 41038 this.scheduleUpdate = () => this.update(); 41039 this.projectionUpdateScheduled = false; 41040 this.checkUpdateFailed = () => { 41041 if (this.isUpdating) { 41042 this.isUpdating = false; 41043 this.clearAllSnapshots(); 41044 } 41045 }; 41046 this.updateProjection = () => { 41047 this.projectionUpdateScheduled = false; 41048 if (isDebug) { 41049 metrics.totalNodes = metrics.resolvedTargetDeltas = metrics.recalculatedProjection = 0; 41050 } 41051 this.nodes.forEach(propagateDirtyNodes); 41052 this.nodes.forEach(resolveTargetDelta); 41053 this.nodes.forEach(calcProjection); 41054 this.nodes.forEach(cleanDirtyNodes); 41055 if (isDebug) { 41056 window.MotionDebug.record(metrics); 41057 } 41058 }; 41059 this.resolvedRelativeTargetAt = 0; 41060 this.hasProjected = false; 41061 this.isVisible = true; 41062 this.animationProgress = 0; 41063 this.sharedNodes = /* @__PURE__ */ new Map(); 41064 this.latestValues = latestValues; 41065 this.root = parent ? parent.root || parent : this; 41066 this.path = parent ? [...parent.path, parent] : []; 41067 this.parent = parent; 41068 this.depth = parent ? parent.depth + 1 : 0; 41069 for (let i2 = 0; i2 < this.path.length; i2++) { 41070 this.path[i2].shouldResetTransform = true; 41071 } 41072 if (this.root === this) 41073 this.nodes = new FlatTree(); 41074 } 41075 addEventListener(name, handler) { 41076 if (!this.eventHandlers.has(name)) { 41077 this.eventHandlers.set(name, new SubscriptionManager()); 41078 } 41079 return this.eventHandlers.get(name).add(handler); 41080 } 41081 notifyListeners(name, ...args) { 41082 const subscriptionManager = this.eventHandlers.get(name); 41083 subscriptionManager && subscriptionManager.notify(...args); 41084 } 41085 hasListeners(name) { 41086 return this.eventHandlers.has(name); 41087 } 41088 /** 41089 * Lifecycles 41090 */ 41091 mount(instance2, isLayoutDirty = this.root.hasTreeAnimated) { 41092 if (this.instance) 41093 return; 41094 this.isSVG = isSVGElement(instance2); 41095 this.instance = instance2; 41096 const { layoutId, layout: layout2, visualElement } = this.options; 41097 if (visualElement && !visualElement.current) { 41098 visualElement.mount(instance2); 41099 } 41100 this.root.nodes.add(this); 41101 this.parent && this.parent.children.add(this); 41102 if (isLayoutDirty && (layout2 || layoutId)) { 41103 this.isLayoutDirty = true; 41104 } 41105 if (attachResizeListener) { 41106 let cancelDelay; 41107 const resizeUnblockUpdate = () => this.root.updateBlockedByResize = false; 41108 attachResizeListener(instance2, () => { 41109 this.root.updateBlockedByResize = true; 41110 cancelDelay && cancelDelay(); 41111 cancelDelay = delay(resizeUnblockUpdate, 250); 41112 if (globalProjectionState.hasAnimatedSinceResize) { 41113 globalProjectionState.hasAnimatedSinceResize = false; 41114 this.nodes.forEach(finishAnimation); 41115 } 41116 }); 41117 } 41118 if (layoutId) { 41119 this.root.registerSharedNode(layoutId, this); 41120 } 41121 if (this.options.animate !== false && visualElement && (layoutId || layout2)) { 41122 this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout }) => { 41123 if (this.isTreeAnimationBlocked()) { 41124 this.target = void 0; 41125 this.relativeTarget = void 0; 41126 return; 41127 } 41128 const layoutTransition = this.options.transition || visualElement.getDefaultTransition() || defaultLayoutTransition; 41129 const { onLayoutAnimationStart, onLayoutAnimationComplete } = visualElement.getProps(); 41130 const targetChanged = !this.targetLayout || !boxEqualsRounded(this.targetLayout, newLayout) || hasRelativeTargetChanged; 41131 const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged; 41132 if (this.options.layoutRoot || this.resumeFrom && this.resumeFrom.instance || hasOnlyRelativeTargetChanged || hasLayoutChanged && (targetChanged || !this.currentAnimation)) { 41133 if (this.resumeFrom) { 41134 this.resumingFrom = this.resumeFrom; 41135 this.resumingFrom.resumingFrom = void 0; 41136 } 41137 this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); 41138 const animationOptions = __spreadProps(__spreadValues({}, getValueTransition(layoutTransition, "layout")), { 41139 onPlay: onLayoutAnimationStart, 41140 onComplete: onLayoutAnimationComplete 41141 }); 41142 if (visualElement.shouldReduceMotion || this.options.layoutRoot) { 41143 animationOptions.delay = 0; 41144 animationOptions.type = false;
41145 } 41146 this.startAnimation(animationOptions); 41147 } else { 41148 if (!hasLayoutChanged) { 41149 finishAnimation(this); 41150 } 41151 if (this.isLead() && this.options.onExitComplete) { 41152 this.options.onExitComplete(); 41153 } 41154 } 41155 this.targetLayout = newLayout; 41156 }); 41157 } 41158 } 41159 unmount() { 41160 this.options.layoutId && this.willUpdate(); 41161 this.root.nodes.remove(this); 41162 const stack = this.getStack(); 41163 stack && stack.remove(this); 41164 this.parent && this.parent.children.delete(this); 41165 this.instance = void 0; 41166 cancelFrame(this.updateProjection); 41167 } 41168 // only on the root 41169 blockUpdate() { 41170 this.updateManuallyBlocked = true; 41171 } 41172 unblockUpdate() { 41173 this.updateManuallyBlocked = false; 41174 } 41175 isUpdateBlocked() { 41176 return this.updateManuallyBlocked || this.updateBlockedByResize; 41177 } 41178 isTreeAnimationBlocked() { 41179 return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || false; 41180 } 41181 // Note: currently only running on root node 41182 startUpdate() { 41183 if (this.isUpdateBlocked()) 41184 return; 41185 this.isUpdating = true; 41186 this.nodes && this.nodes.forEach(resetSkewAndRotation); 41187 this.animationId++; 41188 } 41189 getTransformTemplate() { 41190 const { visualElement } = this.options; 41191 return visualElement && visualElement.getProps().transformTemplate; 41192 } 41193 willUpdate(shouldNotifyListeners = true) { 41194 this.root.hasTreeAnimated = true; 41195 if (this.root.isUpdateBlocked()) { 41196 this.options.onExitComplete && this.options.onExitComplete(); 41197 return; 41198 } 41199 if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear) { 41200 cancelTreeOptimisedTransformAnimations(this); 41201 } 41202 !this.root.isUpdating && this.root.startUpdate(); 41203 if (this.isLayoutDirty) 41204 return; 41205 this.isLayoutDirty = true; 41206 for (let i2 = 0; i2 < this.path.length; i2++) { 41207 const node2 = this.path[i2]; 41208 node2.shouldResetTransform = true; 41209 node2.updateScroll("snapshot"); 41210 if (node2.options.layoutRoot) { 41211 node2.willUpdate(false); 41212 } 41213 } 41214 const { layoutId, layout: layout2 } = this.options; 41215 if (layoutId === void 0 && !layout2) 41216 return; 41217 const transformTemplate = this.getTransformTemplate(); 41218 this.prevTransformTemplateValue = transformTemplate ? transformTemplate(this.latestValues, "") : void 0; 41219 this.updateSnapshot(); 41220 shouldNotifyListeners && this.notifyListeners("willUpdate"); 41221 } 41222 update() { 41223 this.updateScheduled = false; 41224 const updateWasBlocked = this.isUpdateBlocked(); 41225 if (updateWasBlocked) { 41226 this.unblockUpdate(); 41227 this.clearAllSnapshots(); 41228 this.nodes.forEach(clearMeasurements); 41229 return; 41230 } 41231 if (!this.isUpdating) { 41232 this.nodes.forEach(clearIsLayoutDirty); 41233 } 41234 this.isUpdating = false; 41235 this.nodes.forEach(resetTransformStyle); 41236 this.nodes.forEach(updateLayout); 41237 this.nodes.forEach(notifyLayoutUpdate); 41238 this.clearAllSnapshots(); 41239 const now2 = time.now(); 41240 frameData.delta = clamp(0, 1e3 / 60, now2 - frameData.timestamp); 41241 frameData.timestamp = now2; 41242 frameData.isProcessing = true; 41243 frameSteps.update.process(frameData); 41244 frameSteps.preRender.process(frameData); 41245 frameSteps.render.process(frameData); 41246 frameData.isProcessing = false; 41247 } 41248 didUpdate() { 41249 if (!this.updateScheduled) { 41250 this.updateScheduled = true; 41251 microtask.read(this.scheduleUpdate); 41252 } 41253 } 41254 clearAllSnapshots() {
41255 this.nodes.forEach(clearSnapshot); 41256 this.sharedNodes.forEach(removeLeadSnapshots); 41257 } 41258 scheduleUpdateProjection() { 41259 if (!this.projectionUpdateScheduled) { 41260 this.projectionUpdateScheduled = true; 41261 frame.preRender(this.updateProjection, false, true); 41262 } 41263 } 41264 scheduleCheckAfterUnmount() { 41265 frame.postRender(() => { 41266 if (this.isLayoutDirty) { 41267 this.root.didUpdate(); 41268 } else { 41269 this.root.checkUpdateFailed(); 41270 } 41271 }); 41272 } 41273 /** 41274 * Update measurements 41275 */ 41276 updateSnapshot() { 41277 if (this.snapshot || !this.instance) 41278 return; 41279 this.snapshot = this.measure(); 41280 } 41281 updateLayout() { 41282 if (!this.instance) 41283 return; 41284 this.updateScroll(); 41285 if (!(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty) { 41286 return; 41287 } 41288 if (this.resumeFrom && !this.resumeFrom.instance) { 41289 for (let i2 = 0; i2 < this.path.length; i2++) { 41290 const node2 = this.path[i2]; 41291 node2.updateScroll(); 41292 } 41293 } 41294 const prevLayout = this.layout; 41295 this.layout = this.measure(false); 41296 this.layoutCorrected = createBox(); 41297 this.isLayoutDirty = false; 41298 this.projectionDelta = void 0; 41299 this.notifyListeners("measure", this.layout.layoutBox); 41300 const { visualElement } = this.options; 41301 visualElement && visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : void 0); 41302 } 41303 updateScroll(phase = "measure") { 41304 let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); 41305 if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === phase) { 41306 needsMeasurement = false; 41307 } 41308 if (needsMeasurement) { 41309 const isRoot = checkIsScrollRoot(this.instance); 41310 this.scroll = { 41311 animationId: this.root.animationId, 41312 phase, 41313 isRoot, 41314 offset: measureScroll(this.instance), 41315 wasRoot: this.scroll ? this.scroll.isRoot : isRoot 41316 }; 41317 } 41318 } 41319 resetTransform() { 41320 if (!resetTransform) 41321 return; 41322 const isResetRequested = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout; 41323 const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); 41324 const transformTemplate = this.getTransformTemplate(); 41325 const transformTemplateValue = transformTemplate ? transformTemplate(this.latestValues, "") : void 0; 41326 const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; 41327 if (isResetRequested && (hasProjection || hasTransform(this.latestValues) || transformTemplateHasChanged)) { 41328 resetTransform(this.instance, transformTemplateValue); 41329 this.shouldResetTransform = false; 41330 this.scheduleRender(); 41331 } 41332 } 41333 measure(removeTransform = true) { 41334 const pageBox = this.measurePageBox(); 41335 let layoutBox = this.removeElementScroll(pageBox); 41336 if (removeTransform) { 41337 layoutBox = this.removeTransform(layoutBox); 41338 } 41339 roundBox(layoutBox); 41340 return { 41341 animationId: this.root.animationId, 41342 measuredBox: pageBox, 41343 layoutBox, 41344 latestValues: {}, 41345 source: this.id 41346 }; 41347 } 41348 measurePageBox() { 41349 var _a; 41350 const { visualElement } = this.options; 41351 if (!visualElement) 41352 return createBox(); 41353 const box = visualElement.measureViewportBox(); 41354 const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot); 41355 if (!wasInScrollRoot) { 41356 const { scroll } = this.root; 41357 if (scroll) { 41358 translateAxis(box.x, scroll.offset.x); 41359 translateAxis(box.y, scroll.offset.y); 41360 } 41361 } 41362 return box; 41363 } 41364 removeElementScroll(box) { 41365 var _a; 41366 const boxWithoutScroll = createBox(); 41367 copyBoxInto(boxWithoutScroll, box); 41368 if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) { 41369 return boxWithoutScroll; 41370 } 41371 for (let i2 = 0; i2 < this.path.length; i2++) { 41372 const node2 = this.path[i2]; 41373 const { scroll, options: options2 } = node2; 41374 if (node2 !== this.root && scroll && options2.layoutScroll) { 41375 if (scroll.wasRoot) { 41376 copyBoxInto(boxWithoutScroll, box); 41377 } 41378 translateAxis(boxWithoutScroll.x, scroll.offset.x); 41379 translateAxis(boxWithoutScroll.y, scroll.offset.y); 41380 } 41381 } 41382 return boxWithoutScroll; 41383 } 41384 applyTransform(box, transformOnly = false) { 41385 const withTransforms = createBox(); 41386 copyBoxInto(withTransforms, box); 41387 for (let i2 = 0; i2 < this.path.length; i2++) { 41388 const node2 = this.path[i2]; 41389 if (!transformOnly && node2.options.layoutScroll && node2.scroll && node2 !== no
41389de2.root) { 41390 transformBox(withTransforms, { 41391 x: -node2.scroll.offset.x, 41392 y: -node2.scroll.offset.y 41393 }); 41394 } 41395 if (!hasTransform(node2.latestValues)) 41396 continue; 41397 transformBox(withTransforms, node2.latestValues); 41398 } 41399 if (hasTransform(this.latestValues)) { 41400 transformBox(withTransforms, this.latestValues); 41401 } 41402 return withTransforms; 41403 } 41404 removeTransform(box) { 41405 const boxWithoutTransform = createBox(); 41406 copyBoxInto(boxWithoutTransform, box); 41407 for (let i2 = 0; i2 < this.path.length; i2++) { 41408 const node2 = this.path[i2]; 41409 if (!node2.instance) 41410 continue; 41411 if (!hasTransform(node2.latestValues)) 41412 continue; 41413 hasScale(node2.latestValues) && node2.updateSnapshot(); 41414 const sourceBox = createBox(); 41415 const nodeBox = node2.measurePageBox(); 41416 copyBoxInto(sourceBox, nodeBox); 41417 removeBoxTransforms(boxWithoutTransform, node2.latestValues, node2.snapshot ? node2.snapshot.layoutBox : void 0, sourceBox); 41418 } 41419 if (hasTransform(this.latestValues)) { 41420 removeBoxTransforms(boxWithoutTransform, this.latestValues); 41421 } 41422 return boxWithoutTransform; 41423 } 41424 setTargetDelta(delta) { 41425 this.targetDelta = delta; 41426 this.root.scheduleUpdateProjection(); 41427 this.isProjectionDirty = true; 41428 } 41429 setOptions(options2) { 41430 this.options = __spreadProps(__spreadValues(__spreadValues({}, this.options), options2), { 41431 crossfade: options2.crossfade !== void 0 ? options2.crossfade : true 41432 }); 41433 } 41434 clearMeasurements() { 41435 this.scroll = void 0; 41436 this.layout = void 0; 41437 this.snapshot = void 0; 41438 this.prevTransformTemplateValue = void 0; 41439 this.targetDelta = void 0; 41440 this.target = void 0; 41441 this.isLayoutDirty = false; 41442 } 41443 forceRelativeParentToResolveTarget() { 41444 if (!this.relativeParent) 41445 return; 41446 if (this.relativeParent.resolvedRelativeTargetAt !== frameData.timestamp) { 41447 this.relativeParent.resolveTargetDelta(true); 41448 } 41449 } 41450 resolveTargetDelta(forceRecalculation = false) { 41451 var _a; 41452 const lead = this.getLead(); 41453 this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); 41454 this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); 41455 this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); 41456 const isShared = Boolean(this.resumingFrom) || this !== lead; 41457 const canSkip = !(forceRecalculation || isShared && this.isSharedProjectionDirty || this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize); 41458 if (canSkip) 41459 return; 41460 const { layout: layout2, layoutId } = this.options; 41461 if (!this.layout || !(layout2 || layoutId)) 41462 return; 41463 this.resolvedRelativeTargetAt = frameData.timestamp; 41464 if (!this.targetDelta && !this.relativeTarget) { 41465 const relativeParent = this.getClosestProjectingParent(); 41466 if (relativeParent && relativeParent.layout && this.animationProgress !== 1) { 41467 this.relativeParent = relativeParent; 41468 this.forceRelativeParentToResolveTarget(); 41469 this.relativeTarget = createBox(); 41470 this.relativeTargetOrigin = createBox(); 41471 calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox); 41472 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); 41473 } else { 41474 this.relativeParent = this.relativeTarget = void 0; 41475 } 41476 } 41477 if (!this.relativeTarget && !this.targetDelta) 41478 return; 41479 if (!this.target) { 41480 this.target = createBox(); 41481 this.targetWithTransforms = createBox(); 41482 } 41483 if (this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target) { 41484 this.forceRelativeParentToResolveTarget(); 41485 calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); 41486 } else if (this.targetDelta) { 41487 if (Boolean(this.resumingFrom)) { 41488 this.target = this.applyTransform(this.layout.layoutBox); 41489 } else { 41490 copyBoxInto(this.target, this.layout.layoutBox); 41491 } 41492 applyBoxDelta(this.target, this.targetDelta); 41493 } else { 41494 copyBoxInto(this.target, this.layout.layoutBox); 41495 } 41496 if (this.attemptToResolveRelativeTarget) { 41497 this.attemptToResolveRelativeTarget = false;
41498 const relativeParent = this.getClosestProjectingParent(); 41499 if (relativeParent && Boolean(relativeParent.resumingFrom) === Boolean(this.resumingFrom) && !relativeParent.options.layoutScroll && relativeParent.target && this.animationProgress !== 1) { 41500 this.relativeParent = relativeParent; 41501 this.forceRelativeParentToResolveTarget(); 41502 this.relativeTarget = createBox(); 41503 this.relativeTargetOrigin = createBox(); 41504 calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target); 41505 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); 41506 } else { 41507 this.relativeParent = this.relativeTarget = void 0; 41508 } 41509 } 41510 if (isDebug) { 41511 metrics.resolvedTargetDeltas++; 41512 } 41513 } 41514 getClosestProjectingParent() { 41515 if (!this.parent || hasScale(this.parent.latestValues) || has2DTranslate(this.parent.latestValues)) { 41516 return void 0; 41517 } 41518 if (this.parent.isProjecting()) { 41519 return this.parent; 41520 } else { 41521 return this.parent.getClosestProjectingParent(); 41522 } 41523 } 41524 isProjecting() { 41525 return Boolean((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout); 41526 } 41527 calcProjection() { 41528 var _a; 41529 const lead = this.getLead(); 41530 const isShared = Boolean(this.resumingFrom) || this !== lead; 41531 let canSkip = true; 41532 if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) { 41533 canSkip = false; 41534 } 41535 if (isShared && (this.isSharedProjectionDirty || this.isTransformDirty)) { 41536 canSkip = false; 41537 } 41538 if (this.resolvedRelativeTargetAt === frameData.timestamp) { 41539 canSkip = false; 41540 } 41541 if (canSkip) 41542 return; 41543 const { layout: layout2, layoutId } = this.options; 41544 this.isTreeAnimating = Boolean(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation); 41545 if (!this.isTreeAnimating) { 41546 this.targetDelta = this.relativeTarget = void 0; 41547 } 41548 if (!this.layout || !(layout2 || layoutId)) 41549 return; 41550 copyBoxInto(this.layoutCorrected, this.layout.layoutBox); 41551 const prevTreeScaleX = this.treeScale.x; 41552 const prevTreeScaleY = this.treeScale.y; 41553 applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); 41554 if (lead.layout && !lead.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { 41555 lead.target = lead.layout.layoutBox; 41556 lead.targetWithTransforms = createBox(); 41557 } 41558 const { target } = lead; 41559 if (!target) { 41560 if (this.prevProjectionDelta) { 41561 this.createProjectionDeltas(); 41562 this.scheduleRender(); 41563 } 41564 return; 41565 } 41566 if (!this.projectionDelta || !this.prevProjectionDelta) { 41567 this.createProjectionDeltas(); 41568 } else { 41569 copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); 41570 copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); 41571 } 41572 calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); 41573 if (this.treeScale.x !== prevTreeScaleX || this.treeScale.y !== prevTreeScaleY || !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { 41574 this.hasProjected = true; 41575 this.scheduleRender(); 41576 this.notifyListeners("projectionUpdate", target); 41577 } 41578 if (isDebug) { 41579 metrics.recalculatedProjection++; 41580 } 41581 } 41582 hide() { 41583 this.isVisible = false; 41584 } 41585 show() { 41586 this.isVisible = true; 41587 } 41588 scheduleRender(notifyAll = true) { 41589 var _a; 41590 (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.scheduleRender(); 41591 if (notifyAll) {
41592 const stack = this.getStack(); 41593 stack && stack.scheduleRender(); 41594 } 41595 if (this.resumingFrom && !this.resumingFrom.instance) { 41596 this.resumingFrom = void 0; 41597 } 41598 } 41599 createProjectionDeltas() { 41600 this.prevProjectionDelta = createDelta(); 41601 this.projectionDelta = createDelta(); 41602 this.projectionDeltaWithTransform = createDelta(); 41603 } 41604 setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) { 41605 const snapshot = this.snapshot; 41606 const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; 41607 const mixedValues = __spreadValues({}, this.latestValues); 41608 const targetDelta = createDelta(); 41609 if (!this.relativeParent || !this.relativeParent.options.layoutRoot) { 41610 this.relativeTarget = this.relativeTargetOrigin = void 0; 41611 } 41612 this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; 41613 const relativeLayout = createBox(); 41614 const snapshotSource = snapshot ? snapshot.source : void 0; 41615 const layoutSource = this.layout ? this.layout.source : void 0; 41616 const isSharedLayoutAnimation = snapshotSource !== layoutSource; 41617 const stack = this.getStack(); 41618 const isOnlyMember = !stack || stack.members.length <= 1; 41619 const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && !isOnlyMember && this.options.crossfade === true && !this.path.some(hasOpacityCrossfade)); 41620 this.animationProgress = 0; 41621 let prevRelativeTarget; 41622 this.mixTargetDelta = (latest) => { 41623 const progress2 = latest / 1e3; 41624 mixAxisDelta(targetDelta.x, delta.x, progress2); 41625 mixAxisDelta(targetDelta.y, delta.y, progress2); 41626 this.setTargetDelta(targetDelta); 41627 if (this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout) { 41628 calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox); 41629 mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress2); 41630 if (prevRelativeTarget && boxEquals(this.relativeTarget, prevRelativeTarget)) { 41631 this.isProjectionDirty = false; 41632 } 41633 if (!prevRelativeTarget) 41634 prevRelativeTarget = createBox(); 41635 copyBoxInto(prevRelativeTarget, this.relativeTarget); 41636 } 41637 if (isSharedLayoutAnimation) { 41638 this.animationValues = mixedValues; 41639 mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress2, shouldCrossfadeOpacity, isOnlyMember); 41640 } 41641 this.root.scheduleUpdateProjection(); 41642 this.scheduleRender(); 41643 this.animationProgress = progress2; 41644 }; 41645 this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0); 41646 } 41647 startAnimation(options2) { 41648 this.notifyListeners("animationStart"); 41649 this.currentAnimation && this.currentAnimation.stop(); 41650 if (this.resumingFrom && this.resumingFrom.currentAnimation) { 41651 this.resumingFrom.currentAnimation.stop(); 41652 } 41653 if (this.pendingAnimation) { 41654 cancelFrame(this.pendingAnimation); 41655 this.pendingAnimation = void 0; 41656 } 41657 this.pendingAnimation = frame.update(() => { 41658 globalProjectionState.hasAnimatedSinceResize = true; 41659 this.currentAnimation = animateSingleValue(0, animationTarget, __spreadProps(__spreadValues({}, options2), { 41660 onUpdate: (latest) => { 41661 this.mixTargetDelta(latest); 41662 options2.onUpdate && options2.onUpdate(latest); 41663 }, 41664 onComplete: () => { 41665 options2.onComplete && options2.onComplete(); 41666 this.completeAnimation(); 41667 } 41668 })); 41669 if (this.resumingFrom) { 41670 this.resumingFrom.currentAnimation = this.currentAnimation; 41671 } 41672 this.pendingAnimation = void 0; 41673 }); 41674 } 41675 completeAnimation() { 41676 if (this.resumingFrom) { 41677 this.resumingFrom.currentAnimation = void 0; 41678 this.resumingFrom.preserveOpacity = void 0; 41679 }
41680 const stack = this.getStack(); 41681 stack && stack.exitAnimationComplete(); 41682 this.resumingFrom = this.currentAnimation = this.animationValues = void 0; 41683 this.notifyListeners("animationComplete"); 41684 } 41685 finishAnimation() { 41686 if (this.currentAnimation) { 41687 this.mixTargetDelta && this.mixTargetDelta(animationTarget); 41688 this.currentAnimation.stop(); 41689 } 41690 this.completeAnimation(); 41691 } 41692 applyTransformsToTarget() { 41693 const lead = this.getLead(); 41694 let { targetWithTransforms, target, layout: layout2, latestValues } = lead; 41695 if (!targetWithTransforms || !target || !layout2) 41696 return; 41697 if (this !== lead && this.layout && layout2 && shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout2.layoutBox)) { 41698 target = this.target || createBox(); 41699 const xLength = calcLength(this.layout.layoutBox.x); 41700 target.x.min = lead.target.x.min; 41701 target.x.max = target.x.min + xLength; 41702 const yLength = calcLength(this.layout.layoutBox.y); 41703 target.y.min = lead.target.y.min; 41704 target.y.max = target.y.min + yLength; 41705 } 41706 copyBoxInto(targetWithTransforms, target); 41707 transformBox(targetWithTransforms, latestValues); 41708 calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); 41709 } 41710 registerSharedNode(layoutId, node2) { 41711 if (!this.sharedNodes.has(layoutId)) { 41712 this.sharedNodes.set(layoutId, new NodeStack()); 41713 } 41714 const stack = this.sharedNodes.get(layoutId); 41715 stack.add(node2); 41716 const config = node2.options.initialPromotionConfig; 41717 node2.promote({ 41718 transition: config ? config.transition : void 0, 41719 preserveFollowOpacity: config && config.shouldPreserveFollowOpacity ? config.shouldPreserveFollowOpacity(node2) : void 0 41720 }); 41721 } 41722 isLead() { 41723 const stack = this.getStack(); 41724 return stack ? stack.lead === this : true; 41725 } 41726 getLead() { 41727 var _a; 41728 const { layoutId } = this.options; 41729 return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this; 41730 } 41731 getPrevLead() { 41732 var _a; 41733 const { layoutId } = this.options; 41734 return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : void 0; 41735 } 41736 getStack() { 41737 const { layoutId } = this.options; 41738 if (layoutId) 41739 return this.root.sharedNodes.get(layoutId); 41740 } 41741 promote({ needsReset, transition, preserveFollowOpacity } = {}) { 41742 const stack = this.getStack(); 41743 if (stack) 41744 stack.promote(this, preserveFollowOpacity); 41745 if (needsReset) { 41746 this.projectionDelta = void 0; 41747 this.needsReset = true; 41748 } 41749 if (transition) 41750 this.setOptions({ transition }); 41751 } 41752 relegate() { 41753 const stack = this.getStack(); 41754 if (stack) { 41755 return stack.relegate(this); 41756 } else { 41757 return false; 41758 } 41759 } 41760 resetSkewAndRotation() { 41761 const { visualElement } = this.options; 41762 if (!visualElement) 41763 return; 41764 let hasDistortingTransform = false; 41765 const { latestValues } = visualElement; 41766 if (latestValues.z || latestValues.rotate || latestValues.rotateX || latestValues.rotateY || latestValues.rotateZ || latestValues.skewX || latestValues.skewY) { 41767 hasDistortingTransform = true; 41768 } 41769 if (!hasDistortingTransform) 41770 return; 41771 const resetValues = {}; 41772 if (latestValues.z) { 41773 resetDistortingTransform("z", visualElement, resetValues, this.animationValues); 41774 } 41775 for (let i2 = 0; i2 < transformAxes.length; i2++) { 41776 resetDistortingTransform(`rotate${transformAxes[i2]}`, visualElement, resetValues, this.animationValues); 41777 resetDistortingTransform(`skew${transformAxes[i2]}`, visualElement, resetValues, this.animationValues); 41778 } 41779 visualElement.render(); 41780 for (const key in resetValues) { 41781 visualElement.setStaticValue(key, resetValues[key]); 41782 if (this.animationValues) { 41783 this.animationValues[key] = resetValues[key]; 41784 } 41785 } 41786 visualElement.scheduleRender(); 41787 } 41788 getProjectionStyles(styleProp) { 41789 var _a, _b; 41790 if (!this.instance || this.isSVG) 41791 return void 0; 41792 if (!this.isVisible) { 41793 return hiddenVisibility; 41794 } 41795 const styles = { 41796 visibility: "" 41797 }; 41798 const transformTemplate = this.getTransformTemplate(); 41799 if (this.needsReset) { 41800 this.needsReset = false;
41801 styles.opacity = ""; 41802 styles.pointerEvents = resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || ""; 41803 styles.transform = transformTemplate ? transformTemplate(this.latestValues, "") : "none"; 41804 return styles; 41805 } 41806 const lead = this.getLead(); 41807 if (!this.projectionDelta || !this.layout || !lead.target) { 41808 const emptyStyles = {}; 41809 if (this.options.layoutId) { 41810 emptyStyles.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1; 41811 emptyStyles.pointerEvents = resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || ""; 41812 } 41813 if (this.hasProjected && !hasTransform(this.latestValues)) { 41814 emptyStyles.transform = transformTemplate ? transformTemplate({}, "") : "none"; 41815 this.hasProjected = false; 41816 } 41817 return emptyStyles; 41818 } 41819 const valuesToRender = lead.animationValues || lead.latestValues; 41820 this.applyTransformsToTarget(); 41821 styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); 41822 if (transformTemplate) { 41823 styles.transform = transformTemplate(valuesToRender, styles.transform); 41824 } 41825 const { x: x2, y: y2 } = this.projectionDelta; 41826 styles.transformOrigin = `${x2.origin * 100}% ${y2.origin * 100}% 0`; 41827 if (lead.animationValues) { 41828 styles.opacity = lead === this ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit; 41829 } else { 41830 styles.opacity = lead === this ? valuesToRender.opacity !== void 0 ? valuesToRender.opacity : "" : valuesToRender.opacityExit !== void 0 ? valuesToRender.opacityExit : 0; 41831 } 41832 for (const key in scaleCorrectors) { 41833 if (valuesToRender[key] === void 0) 41834 continue; 41835 const { correct, applyTo } = scaleCorrectors[key]; 41836 const corrected = styles.transform === "none" ? valuesToRender[key] : correct(valuesToRender[key], lead); 41837 if (applyTo) { 41838 const num = applyTo.length; 41839 for (let i2 = 0; i2 < num; i2++) { 41840 styles[applyTo[i2]] = corrected; 41841 } 41842 } else { 41843 styles[key] = corrected; 41844 } 41845 } 41846 if (this.options.layoutId) { 41847 styles.pointerEvents = lead === this ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "" : "none"; 41848 } 41849 return styles; 41850 } 41851 clearSnapshot() { 41852 this.resumeFrom = this.snapshot = void 0; 41853 } 41854 // Only run on root 41855 resetTree() { 41856 this.root.nodes.forEach((node2) => { 41857 var _a; 41858 return (_a = node2.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); 41859 }); 41860 this.root.nodes.forEach(clearMeasurements); 41861 this.root.sharedNodes.clear(); 41862 } 41863 }; 41864 } 41865 function updateLayout(node2) { 41866 node2.updateLayout(); 41867 } 41868 function notifyLayoutUpdate(node2) { 41869 var _a; 41870 const snapshot = ((_a = node2.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node2.snapshot; 41871 if (node2.isLead() && node2.layout && snapshot && node2.hasListeners("didUpdate")) { 41872 const { layoutBox: layout2, measuredBox: measuredLayout } = node2.layout; 41873 const { animationType } = node2.options; 41874 const isShared = snapshot.source !== node2.layout.source; 41875 if (animationType === "size") { 41876 eachAxis((axis) => { 41877 const axisSnapshot = isShared ? snapshot.measuredBox[axis] : snapshot.layoutBox[axis]; 41878 const length2 = calcLength(axisSnapshot); 41879 axisSnapshot.min = layout2[axis].min; 41880 axisSnapshot.max = axisSnapshot.min + length2; 41881 }); 41882 } else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout2)) { 41883 eachAxis((axis) => { 41884 const axisSnapshot = isShared ? snapshot.measuredBox[axis] : snapshot.layoutBox[axis]; 41885 const length2 = calcLength(layout2[axis]); 41886 axisSnapshot.max = axisSnapshot.min + length2; 41887 if (node2.relativeTarget && !node2.currentAnimation) { 41888 node2.isProjectionDirty = true;
41889 node2.relativeTarget[axis].max = node2.relativeTarget[axis].min + length2; 41890 } 41891 }); 41892 } 41893 const layoutDelta = createDelta(); 41894 calcBoxDelta(layoutDelta, layout2, snapshot.layoutBox); 41895 const visualDelta = createDelta(); 41896 if (isShared) { 41897 calcBoxDelta(visualDelta, node2.applyTransform(measuredLayout, true), snapshot.measuredBox); 41898 } else { 41899 calcBoxDelta(visualDelta, layout2, snapshot.layoutBox); 41900 } 41901 const hasLayoutChanged = !isDeltaZero(layoutDelta); 41902 let hasRelativeTargetChanged = false; 41903 if (!node2.resumeFrom) { 41904 const relativeParent = node2.getClosestProjectingParent(); 41905 if (relativeParent && !relativeParent.resumeFrom) { 41906 const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; 41907 if (parentSnapshot && parentLayout) { 41908 const relativeSnapshot = createBox(); 41909 calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox); 41910 const relativeLayout = createBox(); 41911 calcRelativePosition(relativeLayout, layout2, parentLayout.layoutBox); 41912 if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { 41913 hasRelativeTargetChanged = true; 41914 } 41915 if (relativeParent.options.layoutRoot) { 41916 node2.relativeTarget = relativeLayout; 41917 node2.relativeTargetOrigin = relativeSnapshot; 41918 node2.relativeParent = relativeParent; 41919 } 41920 } 41921 } 41922 } 41923 node2.notifyListeners("didUpdate", { 41924 layout: layout2, 41925 snapshot, 41926 delta: visualDelta, 41927 layoutDelta, 41928 hasLayoutChanged, 41929 hasRelativeTargetChanged 41930 }); 41931 } else if (node2.isLead()) { 41932 const { onExitComplete } = node2.options; 41933 onExitComplete && onExitComplete(); 41934 } 41935 node2.options.transition = void 0; 41936 } 41937 function propagateDirtyNodes(node2) { 41938 if (isDebug) { 41939 metrics.totalNodes++; 41940 } 41941 if (!node2.parent) 41942 return; 41943 if (!node2.isProjecting()) { 41944 node2.isProjectionDirty = node2.parent.isProjectionDirty; 41945 } 41946 node2.isSharedProjectionDirty || (node2.isSharedProjectionDirty = Boolean(node2.isProjectionDirty || node2.parent.isProjectionDirty || node2.parent.isSharedProjectionDirty)); 41947 node2.isTransformDirty || (node2.isTransformDirty = node2.parent.isTransformDirty); 41948 } 41949 function cleanDirtyNodes(node2) { 41950 node2.isProjectionDirty = node2.isSharedProjectionDirty = node2.isTransformDirty = false; 41951 } 41952 function clearSnapshot(node2) { 41953 node2.clearSnapshot(); 41954 } 41955 function clearMeasurements(node2) { 41956 node2.clearMeasurements(); 41957 } 41958 function clearIsLayoutDirty(node2) { 41959 node2.isLayoutDirty = false; 41960 } 41961 function resetTransformStyle(node2) { 41962 const { visualElement } = node2.options; 41963 if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { 41964 visualElement.notify("BeforeLayoutMeasure"); 41965 } 41966 node2.resetTransform(); 41967 } 41968 function finishAnimation(node2) { 41969 node2.finishAnimation(); 41970 node2.targetDelta = node2.relativeTarget = node2.target = void 0; 41971 node2.isProjectionDirty = true; 41972 } 41973 function resolveTargetDelta(node2) { 41974 node2.resolveTargetDelta(); 41975 } 41976 function calcProjection(node2) { 41977 node2.calcProjection(); 41978 } 41979 function resetSkewAndRotation(node2) { 41980 node2.resetSkewAndRotation(); 41981 } 41982 function removeLeadSnapshots(stack) { 41983 stack.removeLeadSnapshot(); 41984 } 41985 function mixAxisDelta(output, delta, p2) { 41986 output.translate = mixNumber$1(delta.translate, 0, p2); 41987 output.scale = mixNumber$1(delta.scale, 1, p2); 41988 output.origin = delta.origin; 41989 output.originPoint = delta.originPoint; 41990 } 41991 function mixAxis(output, from2, to2, p2) { 41992 output.min = mixNumber$1(from2.min, to2.min, p2); 41993 output.max = mixNumber$1(from2.max, to2.max, p2); 41994 } 41995 function mixBox(output, from2, to2, p2) { 41996 mixAxis(output.x, from2.x, to2.x, p2); 41997 mixAxis(output.y, from2.y, to2.y, p2); 41998 } 41999 function hasOpacityCrossfade(node2) { 42000 return node2.animationValues && node2.animationValues.opacityExit !== void 0; 42001 } 42002 const defaultLayoutTransition = { 42003 duration: 0.45, 42004 ease: [0.4, 0, 0.1, 1] 42005 }; 42006 const userAgentContains = (string2) => typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(string2); 42007 const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") ? Math.round : noop$3; 42008 function roundAxis(axis) { 42009 axis.min = roundPoint(axis.min); 42010 axis.max = roundPoint(axis.max); 42011 } 42012 function roundBox(box) { 42013 roundAxis(box.x); 42014 roundAxis(box.y); 42015 } 42016 function shouldAnimatePositionOnly(animationType, snapshot, layout2) { 42017 return animationType === "position" || animationType === "preserve-aspect" && !isNear(aspectRatio(snapshot), aspectRatio(layout2), 0.2); 42018 } 42019 function checkNodeWasScrollRoot(node2) { 42020 var _a;
42021 return node2 !== node2.root && ((_a = node2.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot); 42022 } 42023 const DocumentProjectionNode = createProjectionNode({ 42024 attachResizeListener: (ref, notify2) => addDomEvent(ref, "resize", notify2), 42025 measureScroll: () => ({ 42026 x: document.documentElement.scrollLeft || document.body.scrollLeft, 42027 y: document.documentElement.scrollTop || document.body.scrollTop 42028 }), 42029 checkIsScrollRoot: () => true 42030 }); 42031 const rootProjectionNode = { 42032 current: void 0 42033 }; 42034 const HTMLProjectionNode = createProjectionNode({ 42035 measureScroll: (instance2) => ({ 42036 x: instance2.scrollLeft, 42037 y: instance2.scrollTop 42038 }), 42039 defaultParent: () => { 42040 if (!rootProjectionNode.current) { 42041 const documentNode = new DocumentProjectionNode({}); 42042 documentNode.mount(window); 42043 documentNode.setOptions({ layoutScroll: true }); 42044 rootProjectionNode.current = documentNode; 42045 } 42046 return rootProjectionNode.current; 42047 }, 42048 resetTransform: (instance2, value) => { 42049 instance2.style.transform = value !== void 0 ? value : "none"; 42050 }, 42051 checkIsScrollRoot: (instance2) => Boolean(window.getComputedStyle(instance2).position === "fixed") 42052 }); 42053 const drag = { 42054 pan: { 42055 Feature: PanGesture 42056 }, 42057 drag: { 42058 Feature: DragGesture, 42059 ProjectionNode: HTMLProjectionNode, 42060 MeasureLayout 42061 } 42062 }; 42063 function handleHoverEvent(node2, event, lifecycle) { 42064 const { props } = node2; 42065 if (node2.animationState && props.whileHover) { 42066 node2.animationState.setActive("whileHover", lifecycle === "Start"); 42067 } 42068 const eventName = "onHover" + lifecycle; 42069 const callback = props[eventName]; 42070 if (callback) { 42071 frame.postRender(() => callback(event, extractEventInfo(event))); 42072 } 42073 } 42074 class HoverGesture extends Feature { 42075 mount() { 42076 const { current } = this.node; 42077 if (!current) 42078 return; 42079 this.unmount = hover(current, (startEvent) => { 42080 handleHoverEvent(this.node, startEvent, "Start"); 42081 return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); 42082 }); 42083 } 42084 unmount() { 42085 } 42086 } 42087 class FocusGesture extends Feature { 42088 constructor() { 42089 super(...arguments); 42090 this.isActive = false; 42091 } 42092 onFocus() { 42093 let isFocusVisible = false; 42094 try { 42095 isFocusVisible = this.node.current.matches(":focus-visible"); 42096 } catch (e2) { 42097 isFocusVisible = true; 42098 } 42099 if (!isFocusVisible || !this.node.animationState) 42100 return; 42101 this.node.animationState.setActive("whileFocus", true); 42102 this.isActive = true; 42103 } 42104 onBlur() { 42105 if (!this.isActive || !this.node.animationState) 42106 return; 42107 this.node.animationState.setActive("whileFocus", false); 42108 this.isActive = false; 42109 } 42110 mount() { 42111 this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); 42112 } 42113 unmount() { 42114 } 42115 } 42116 function handlePressEvent(node2, event, lifecycle) { 42117 const { props } = node2; 42118 if (node2.animationState && props.whileTap) { 42119 node2.animationState.setActive("whileTap", lifecycle === "Start"); 42120 } 42121 const eventName = "onTap" + (lifecycle === "End" ? "" : lifecycle); 42122 const callback = props[eventName]; 42123 if (callback) { 42124 frame.postRender(() => callback(event, extractEventInfo(event))); 42125 } 42126 } 42127 class PressGesture extends Feature { 42128 mount() { 42129 const { current } = this.node; 42130 if (!current) 42131 return; 42132 this.unmount = press(current, (startEvent) => { 42133 handlePressEvent(this.node, startEvent, "Start"); 42134 return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); 42135 }, { useGlobalTarget: this.node.props.globalTapTarget }); 42136 } 42137 unmount() { 42138 } 42139 } 42140 const observerCallbacks = /* @__PURE__ */ new WeakMap(); 42141 const observers = /* @__PURE__ */ new WeakMap(); 42142 const fireObserverCallback = (entry) => { 42143 const callback = observerCallbacks.get(entry.target); 42144 callback && callback(entry); 42145 }; 42146 const fireAllObserverCallbacks = (entries2) => {
42147 entries2.forEach(fireObserverCallback); 42148 }; 42149 function initIntersectionObserver(_r2) { 42150 var _s = _r2, { root: root2 } = _s, options2 = __objRest(_s, ["root"]); 42151 const lookupRoot = root2 || document; 42152 if (!observers.has(lookupRoot)) { 42153 observers.set(lookupRoot, {}); 42154 } 42155 const rootObservers = observers.get(lookupRoot); 42156 const key = JSON.stringify(options2); 42157 if (!rootObservers[key]) { 42158 rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, __spreadValues({ root: root2 }, options2)); 42159 } 42160 return rootObservers[key]; 42161 } 42162 function observeIntersection(element, options2, callback) { 42163 const rootInteresectionObserver = initIntersectionObserver(options2); 42164 observerCallbacks.set(element, callback); 42165 rootInteresectionObserver.observe(element); 42166 return () => { 42167 observerCallbacks.delete(element); 42168 rootInteresectionObserver.unobserve(element); 42169 }; 42170 } 42171 const thresholdNames = { 42172 some: 0, 42173 all: 1 42174 }; 42175 class InViewFeature extends Feature { 42176 constructor() { 42177 super(...arguments); 42178 this.hasEnteredView = false; 42179 this.isInView = false; 42180 } 42181 startObserver() { 42182 this.unmount(); 42183 const { viewport = {} } = this.node.getProps(); 42184 const { root: root2, margin: rootMargin, amount = "some", once: once2 } = viewport; 42185 const options2 = { 42186 root: root2 ? root2.current : void 0, 42187 rootMargin, 42188 threshold: typeof amount === "number" ? amount : thresholdNames[amount] 42189 }; 42190 const onIntersectionUpdate = (entry) => { 42191 const { isIntersecting } = entry; 42192 if (this.isInView === isIntersecting) 42193 return; 42194 this.isInView = isIntersecting; 42195 if (once2 && !isIntersecting && this.hasEnteredView) { 42196 return; 42197 } else if (isIntersecting) { 42198 this.hasEnteredView = true; 42199 } 42200 if (this.node.animationState) { 42201 this.node.animationState.setActive("whileInView", isIntersecting); 42202 } 42203 const { onViewportEnter, onViewportLeave } = this.node.getProps(); 42204 const callback = isIntersecting ? onViewportEnter : onViewportLeave; 42205 callback && callback(entry); 42206 }; 42207 return observeIntersection(this.node.current, options2, onIntersectionUpdate); 42208 } 42209 mount() { 42210 this.startObserver(); 42211 } 42212 update() { 42213 if (typeof IntersectionObserver === "undefined") 42214 return; 42215 const { props, prevProps } = this.node; 42216 const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); 42217 if (hasOptionsChanged) { 42218 this.startObserver(); 42219 } 42220 } 42221 unmount() { 42222 } 42223 } 42224 function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { 42225 return (name) => viewport[name] !== prevViewport[name]; 42226 } 42227 const gestureAnimations = { 42228 inView: { 42229 Feature: InViewFeature 42230 }, 42231 tap: { 42232 Feature: PressGesture 42233 }, 42234 focus: { 42235 Feature: FocusGesture 42236 }, 42237 hover: { 42238 Feature: HoverGesture 42239 } 42240 }; 42241 const layout = { 42242 layout: { 42243 ProjectionNode: HTMLProjectionNode, 42244 MeasureLayout 42245 } 42246 }; 42247 const prefersReducedMotion = { current: null }; 42248 const hasReducedMotionListener = { current: false }; 42249 function initPrefersReducedMotion() { 42250 hasReducedMotionListener.current = true; 42251 if (!isBrowser) 42252 return; 42253 if (window.matchMedia) { 42254 const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); 42255 const setReducedMotionPreferences = () => prefersReducedMotion.current = motionMediaQuery.matches; 42256 motionMediaQuery.addListener(setReducedMotionPreferences); 42257 setReducedMotionPreferences(); 42258 } else { 42259 prefersReducedMotion.current = false; 42260 } 42261 } 42262 const valueTypes = [...dimensionValueTypes, color, complex]; 42263 const findValueType = (v2) => valueTypes.find(testValueType(v2)); 42264 const visualElementStore = /* @__PURE__ */ new WeakMap(); 42265 function updateMotionValuesFromProps(element, next2, prev2) { 42266 for (const key in next2) { 42267 const nextValue = next2[key]; 42268 const prevValue = prev2[key];
42269 if (isMotionValue(nextValue)) { 42270 element.addValue(key, nextValue); 42271 } else if (isMotionValue(prevValue)) { 42272 element.addValue(key, motionValue(nextValue, { owner: element })); 42273 } else if (prevValue !== nextValue) { 42274 if (element.hasValue(key)) { 42275 const existingValue = element.getValue(key); 42276 if (existingValue.liveStyle === true) { 42277 existingValue.jump(nextValue); 42278 } else if (!existingValue.hasAnimated) { 42279 existingValue.set(nextValue); 42280 } 42281 } else { 42282 const latestValue = element.getStaticValue(key); 42283 element.addValue(key, motionValue(latestValue !== void 0 ? latestValue : nextValue, { owner: element })); 42284 } 42285 } 42286 } 42287 for (const key in prev2) { 42288 if (next2[key] === void 0) 42289 element.removeValue(key); 42290 } 42291 return next2; 42292 } 42293 const propEventHandlers = [ 42294 "AnimationStart", 42295 "AnimationComplete", 42296 "Update", 42297 "BeforeLayoutMeasure", 42298 "LayoutMeasure", 42299 "LayoutAnimationStart", 42300 "LayoutAnimationComplete" 42301 ]; 42302 class VisualElement { 42303 /** 42304 * This method takes React props and returns found MotionValues. For example, HTML 42305 * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. 42306 * 42307 * This isn't an abstract method as it needs calling in the constructor, but it is 42308 * intended to be one. 42309 */ 42310 scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { 42311 return {}; 42312 } 42313 constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState }, options2 = {}) { 42314 this.current = null; 42315 this.children = /* @__PURE__ */ new Set(); 42316 this.isVariantNode = false; 42317 this.isControllingVariants = false; 42318 this.shouldReduceMotion = null; 42319 this.values = /* @__PURE__ */ new Map(); 42320 this.KeyframeResolver = KeyframeResolver; 42321 this.features = {}; 42322 this.valueSubscriptions = /* @__PURE__ */ new Map(); 42323 this.prevMotionValues = {}; 42324 this.events = {}; 42325 this.propEventSubscriptions = {}; 42326 this.notifyUpdate = () => this.notify("Update", this.latestValues); 42327 this.render = () => { 42328 if (!this.current) 42329 return; 42330 this.triggerBuild(); 42331 this.renderInstance(this.current, this.renderState, this.props.style, this.projection); 42332 }; 42333 this.renderScheduledAt = 0; 42334 this.scheduleRender = () => { 42335 const now2 = time.now(); 42336 if (this.renderScheduledAt < now2) { 42337 this.renderScheduledAt = now2; 42338 frame.render(this.render, false, true); 42339 } 42340 }; 42341 const { latestValues, renderState, onUpdate } = visualState; 42342 this.onUpdate = onUpdate; 42343 this.latestValues = latestValues; 42344 this.baseTarget = __spreadValues({}, latestValues); 42345 this.initialValues = props.initial ? __spreadValues({}, latestValues) : {}; 42346 this.renderState = renderState; 42347 this.parent = parent; 42348 this.props = props; 42349 this.presenceContext = presenceContext; 42350 this.depth = parent ? parent.depth + 1 : 0; 42351 this.reducedMotionConfig = reducedMotionConfig; 42352 this.options = options2; 42353 this.blockInitialAnimation = Boolean(blockInitialAnimation); 42354 this.isControllingVariants = isControllingVariants(props); 42355 this.isVariantNode = isVariantNode(props); 42356 if (this.isVariantNode) { 42357 this.variantChildren = /* @__PURE__ */ new Set(); 42358 } 42359 this.manuallyAnimateOnMount = Boolean(parent && parent.current); 42360 const _a = this.scrapeMotionValuesFromProps(props, {}, this), { willChange } = _a, initialMotionValues = __objRest(_a, ["willChange"]); 42361 for (const key in initialMotionValues) { 42362 const value = initialMotionValues[key]; 42363 if (latestValues[key] !== void 0 && isMotionValue(value)) { 42364 value.set(latestValues[key], false); 42365 } 42366 } 42367 } 42368 mount(instance2) { 42369 this.current = instance2; 42370 visualElementStore.set(instance2, this); 42371 if (this.projection && !this.projection.instance) { 42372 this.projection.mount(instance2); 42373 } 42374 if (this.parent && this.isVariantNode && !this.isControllingVariants) { 42375 this.removeFromVariantTree = this.parent.addVariantChild(this); 42376 }
42377 this.values.forEach((value, key) => this.bindToMotionValue(key, value)); 42378 if (!hasReducedMotionListener.current) { 42379 initPrefersReducedMotion(); 42380 } 42381 this.shouldReduceMotion = this.reducedMotionConfig === "never" ? false : this.reducedMotionConfig === "always" ? true : prefersReducedMotion.current; 42382 if (this.parent) 42383 this.parent.children.add(this); 42384 this.update(this.props, this.presenceContext); 42385 } 42386 unmount() { 42387 visualElementStore.delete(this.current); 42388 this.projection && this.projection.unmount(); 42389 cancelFrame(this.notifyUpdate); 42390 cancelFrame(this.render); 42391 this.valueSubscriptions.forEach((remove) => remove()); 42392 this.valueSubscriptions.clear(); 42393 this.removeFromVariantTree && this.removeFromVariantTree(); 42394 this.parent && this.parent.children.delete(this); 42395 for (const key in this.events) { 42396 this.events[key].clear(); 42397 } 42398 for (const key in this.features) { 42399 const feature = this.features[key]; 42400 if (feature) { 42401 feature.unmount(); 42402 feature.isMounted = false; 42403 } 42404 } 42405 this.current = null; 42406 } 42407 bindToMotionValue(key, value) { 42408 if (this.valueSubscriptions.has(key)) { 42409 this.valueSubscriptions.get(key)(); 42410 } 42411 const valueIsTransform = transformProps.has(key); 42412 const removeOnChange = value.on("change", (latestValue) => { 42413 this.latestValues[key] = latestValue; 42414 this.props.onUpdate && frame.preRender(this.notifyUpdate); 42415 if (valueIsTransform && this.projection) { 42416 this.projection.isTransformDirty = true; 42417 } 42418 }); 42419 const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender); 42420 let removeSyncCheck; 42421 if (window.MotionCheckAppearSync) { 42422 removeSyncCheck = window.MotionCheckAppearSync(this, key, value); 42423 } 42424 this.valueSubscriptions.set(key, () => { 42425 removeOnChange(); 42426 removeOnRenderRequest(); 42427 if (removeSyncCheck) 42428 removeSyncCheck(); 42429 if (value.owner) 42430 value.stop(); 42431 }); 42432 } 42433 sortNodePosition(other) { 42434 if (!this.current || !this.sortInstanceNodePosition || this.type !== other.type) { 42435 return 0; 42436 } 42437 return this.sortInstanceNodePosition(this.current, other.current); 42438 } 42439 updateFeatures() { 42440 let key = "animation"; 42441 for (key in featureDefinitions) { 42442 const featureDefinition = featureDefinitions[key]; 42443 if (!featureDefinition) 42444 continue; 42445 const { isEnabled: isEnabled2, Feature: FeatureConstructor } = featureDefinition; 42446 if (!this.features[key] && FeatureConstructor && isEnabled2(this.props)) { 42447 this.features[key] = new FeatureConstructor(this); 42448 } 42449 if (this.features[key]) { 42450 const feature = this.features[key]; 42451 if (feature.isMounted) { 42452 feature.update(); 42453 } else { 42454 feature.mount(); 42455 feature.isMounted = true; 42456 } 42457 } 42458 } 42459 } 42460 triggerBuild() { 42461 this.build(this.renderState, this.latestValues, this.props); 42462 } 42463 /** 42464 * Measure the current viewport box with or without transforms. 42465 * Only measures axis-aligned boxes, rotate and skew must be manually 42466 * removed with a re-render to work. 42467 */ 42468 measureViewportBox() { 42469 return this.current ? this.measureInstanceViewportBox(this.current, this.props) : createBox(); 42470 } 42471 getStaticValue(key) { 42472 return this.latestValues[key]; 42473 } 42474 setStaticValue(key, value) { 42475 this.latestValues[key] = value; 42476 } 42477 /** 42478 * Update the provided props. Ensure any newly-added motion values are 42479 * added to our map, old ones removed, and listeners updated. 42480 */ 42481 update(props, presenceContext) { 42482 if (props.transformTemplate || this.props.transformTemplate) { 42483 this.scheduleRender(); 42484 } 42485 this.prevProps = this.props; 42486 this.props = props; 42487 this.prevPresenceContext = this.presenceContext; 42488 this.presenceContext = presenceContext; 42489 for (let i2 = 0; i2 < propEventHandlers.length; i2++) {
vendor: 7,993 bytes, lines 42490-42703
42490 const key = propEventHandlers[i2]; 42491 if (this.propEventSubscriptions[key]) { 42492 this.propEventSubscriptions[key](); 42493 delete this.propEventSubscriptions[key]; 42494 } 42495 const listenerName = "on" + key; 42496 const listener = props[listenerName]; 42497 if (listener) { 42498 this.propEventSubscriptions[key] = this.on(key, listener); 42499 } 42500 } 42501 this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues); 42502 if (this.handleChildMotionValue) { 42503 this.handleChildMotionValue(); 42504 } 42505 this.onUpdate && this.onUpdate(this); 42506 } 42507 getProps() { 42508 return this.props; 42509 } 42510 /** 42511 * Returns the variant definition with a given name. 42512 */ 42513 getVariant(name) { 42514 return this.props.variants ? this.props.variants[name] : void 0; 42515 } 42516 /** 42517 * Returns the defined default transition on this component. 42518 */ 42519 getDefaultTransition() { 42520 return this.props.transition; 42521 } 42522 getTransformPagePoint() { 42523 return this.props.transformPagePoint; 42524 } 42525 getClosestVariantNode() { 42526 return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0; 42527 } 42528 /** 42529 * Add a child visual element to our set of children. 42530 */ 42531 addVariantChild(child) { 42532 const closestVariantNode = this.getClosestVariantNode(); 42533 if (closestVariantNode) { 42534 closestVariantNode.variantChildren && closestVariantNode.variantChildren.add(child); 42535 return () => closestVariantNode.variantChildren.delete(child); 42536 } 42537 } 42538 /** 42539 * Add a motion value and bind it to this visual element. 42540 */ 42541 addValue(key, value) { 42542 const existingValue = this.values.get(key); 42543 if (value !== existingValue) { 42544 if (existingValue) 42545 this.removeValue(key); 42546 this.bindToMotionValue(key, value); 42547 this.values.set(key, value); 42548 this.latestValues[key] = value.get(); 42549 } 42550 } 42551 /** 42552 * Remove a motion value and unbind any active subscriptions. 42553 */ 42554 removeValue(key) { 42555 this.values.delete(key); 42556 const unsubscribe = this.valueSubscriptions.get(key); 42557 if (unsubscribe) { 42558 unsubscribe(); 42559 this.valueSubscriptions.delete(key); 42560 } 42561 delete this.latestValues[key]; 42562 this.removeValueFromRenderState(key, this.renderState); 42563 } 42564 /** 42565 * Check whether we have a motion value for this key 42566 */ 42567 hasValue(key) { 42568 return this.values.has(key); 42569 } 42570 getValue(key, defaultValue) { 42571 if (this.props.values && this.props.values[key]) { 42572 return this.props.values[key]; 42573 } 42574 let value = this.values.get(key); 42575 if (value === void 0 && defaultValue !== void 0) { 42576 value = motionValue(defaultValue === null ? void 0 : defaultValue, { owner: this }); 42577 this.addValue(key, value); 42578 } 42579 return value; 42580 } 42581 /** 42582 * If we're trying to animate to a previously unencountered value, 42583 * we need to check for it in our state and as a last resort read it 42584 * directly from the instance (which might have performance implications). 42585 */ 42586 readValue(key, target) { 42587 var _a; 42588 let value = this.latestValues[key] !== void 0 || !this.current ? this.latestValues[key] : (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : this.readValueFromInstance(this.current, key, this.options); 42589 if (value !== void 0 && value !== null) { 42590 if (typeof value === "string" && (isNumericalString(value) || isZeroValueString(value))) { 42591 value = parseFloat(value); 42592 } else if (!findValueType(value) && complex.test(target)) { 42593 value = getAnimatableNone(key, target); 42594 } 42595 this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); 42596 } 42597 return isMotionValue(value) ? value.get() : value; 42598 } 42599 /** 42600 * Set the base target to later animate back to. This is currently 42601 * only hydrated on creation and when we first read a value. 42602 */ 42603 setBaseTarget(key, value) { 42604 this.baseTarget[key] = value; 42605 } 42606 /** 42607 * Find the base target for a value thats been removed from all animation 42608 * props. 42609 */ 42610 getBaseTarget(key) { 42611 var _a; 42612 const { initial } = this.props; 42613 let valueFromInitial; 42614 if (typeof initial === "string" || typeof initial === "object") { 42615 const variant = resolveVariantFromProps(this.props, initial, (_a = this.presenceContext) === null || _a === void 0 ? void 0 : _a.custom); 42616 if (variant) { 42617 valueFromInitial = variant[key]; 42618 } 42619 } 42620 if (initial && valueFromInitial !== void 0) { 42621 return valueFromInitial; 42622 } 42623 const target = this.getBaseTargetFromProps(this.props, key); 42624 if (target !== void 0 && !isMotionValue(target)) 42625 return target; 42626 return this.initialValues[key] !== void 0 && valueFromInitial === void 0 ? void 0 : this.baseTarget[key]; 42627 } 42628 on(eventName, callback) { 42629 if (!this.events[eventName]) { 42630 this.events[eventName] = new SubscriptionManager(); 42631 } 42632 return this.events[eventName].add(callback); 42633 } 42634 notify(eventName, ...args) { 42635 if (this.events[eventName]) { 42636 this.events[eventName].notify(...args); 42637 } 42638 } 42639 } 42640 class DOMVisualElement extends VisualElement { 42641 constructor() { 42642 super(...arguments); 42643 this.KeyframeResolver = DOMKeyframesResolver; 42644 } 42645 sortInstanceNodePosition(a2, b2) { 42646 return a2.compareDocumentPosition(b2) & 2 ? 1 : -1; 42647 } 42648 getBaseTargetFromProps(props, key) { 42649 return props.style ? props.style[key] : void 0; 42650 } 42651 removeValueFromRenderState(key, { vars, style }) { 42652 delete vars[key]; 42653 delete style[key]; 42654 } 42655 handleChildMotionValue() { 42656 if (this.childSubscription) { 42657 this.childSubscription(); 42658 delete this.childSubscription; 42659 } 42660 const { children } = this.props; 42661 if (isMotionValue(children)) { 42662 this.childSubscription = children.on("change", (latest) => { 42663 if (this.current) { 42664 this.current.textContent = `${latest}`; 42665 } 42666 }); 42667 } 42668 } 42669 } 42670 function getComputedStyle$1(element) { 42671 return window.getComputedStyle(element); 42672 } 42673 class HTMLVisualElement extends DOMVisualElement { 42674 constructor() { 42675 super(...arguments); 42676 this.type = "html"; 42677 this.renderInstance = renderHTML; 42678 } 42679 readValueFromInstance(instance2, key) { 42680 if (transformProps.has(key)) { 42681 const defaultType = getDefaultValueType(key); 42682 return defaultType ? defaultType.default || 0 : 0; 42683 } else { 42684 const computedStyle = getComputedStyle$1(instance2); 42685 const value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0; 42686 return typeof value === "string" ? value.trim() : value; 42687 } 42688 } 42689 measureInstanceViewportBox(instance2, { transformPagePoint }) { 42690 return measureViewportBox(instance2, transformPagePoint); 42691 } 42692 build(renderState, latestValues, props) { 42693 buildHTMLStyles(renderState, latestValues, props.transformTemplate); 42694 } 42695 scrapeMotionValuesFromProps(props, prevProps, visualElement) { 42696 return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); 42697 } 42698 } 42699 class SVGVisualElement extends DOMVisualElement { 42700 constructor() { 42701 super(...arguments); 42702 this.type = "svg"; 42703 this.isSVGTag = false;
42704 this.measureInstanceViewportBox = createBox; 42705 } 42706 getBaseTargetFromProps(props, key) { 42707 return props[key]; 42708 } 42709 readValueFromInstance(instance2, key) { 42710 if (transformProps.has(key)) { 42711 const defaultType = getDefaultValueType(key); 42712 return defaultType ? defaultType.default || 0 : 0; 42713 } 42714 key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; 42715 return instance2.getAttribute(key); 42716 } 42717 scrapeMotionValuesFromProps(props, prevProps, visualElement) { 42718 return scrapeMotionValuesFromProps(props, prevProps, visualElement); 42719 } 42720 build(renderState, latestValues, props) { 42721 buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate); 42722 } 42723 renderInstance(instance2, renderState, styleProp, projection) { 42724 renderSVG(instance2, renderState, styleProp, projection); 42725 } 42726 mount(instance2) { 42727 this.isSVGTag = isSVGTag(instance2.tagName); 42728 super.mount(instance2); 42729 } 42730 } 42731 const createDomVisualElement = (Component, options2) => { 42732 return isSVGComponent(Component) ? new SVGVisualElement(options2) : new HTMLVisualElement(options2, { 42733 allowProjection: Component !== reactExports.Fragment 42734 }); 42735 }; 42736 const createMotionComponent = /* @__PURE__ */ createMotionComponentFactory(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, animations), gestureAnimations), drag), layout), createDomVisualElement); 42737 const motion = /* @__PURE__ */ createDOMMotionComponentProxy(createMotionComponent); 42738 function useMotionValue(initial) { 42739 const value = useConstant(() => motionValue(initial)); 42740 const { isStatic } = reactExports.useContext(MotionConfigContext); 42741 if (isStatic) { 42742 const [, setLatest] = reactExports.useState(initial); 42743 reactExports.useEffect(() => value.on("change", setLatest), []); 42744 } 42745 return value; 42746 } 42747 function useCombineMotionValues(values, combineValues) { 42748 const value = useMotionValue(combineValues()); 42749 const updateValue = () => value.set(combineValues()); 42750 updateValue(); 42751 useIsomorphicLayoutEffect$2(() => { 42752 const scheduleUpdate = () => frame.preRender(updateValue, false, true); 42753 const subscriptions = values.map((v2) => v2.on("change", scheduleUpdate)); 42754 return () => { 42755 subscriptions.forEach((unsubscribe) => unsubscribe()); 42756 cancelFrame(updateValue); 42757 }; 42758 }); 42759 return value; 42760 } 42761 const isCustomValueType = (v2) => { 42762 return v2 && typeof v2 === "object" && v2.mix; 42763 }; 42764 const getMixer = (v2) => isCustomValueType(v2) ? v2.mix : void 0; 42765 function transform(...args) { 42766 const useImmediate = !Array.isArray(args[0]); 42767 const argOffset = useImmediate ? 0 : -1; 42768 const inputValue = args[0 + argOffset]; 42769 const inputRange = args[1 + argOffset]; 42770 const outputRange = args[2 + argOffset]; 42771 const options2 = args[3 + argOffset]; 42772 const interpolator = interpolate(inputRange, outputRange, __spreadValues({ 42773 mixer: getMixer(outputRange[0]) 42774 }, options2)); 42775 return useImmediate ? interpolator(inputValue) : interpolator; 42776 } 42777 function useComputed(compute) { 42778 collectMotionValues.current = []; 42779 compute(); 42780 const value = useCombineMotionValues(collectMotionValues.current, compute); 42781 collectMotionValues.current = void 0; 42782 return value; 42783 } 42784 function useTransform(input, inputRangeOrTransformer, outputRange, options2) { 42785 if (typeof input === "function") { 42786 return useComputed(input); 42787 } 42788 const transformer = typeof inputRangeOrTransformer === "function" ? inputRangeOrTransformer : transform(inputRangeOrTransformer, outputRange, options2); 42789 return Array.isArray(input) ? useListTransform(input, transformer) : useListTransform([input], ([latest]) => transformer(latest)); 42790 } 42791 function useListTransform(values, transformer) { 42792 const latest = useConstant(() => []); 42793 return useCombineMotionValues(values, () => { 42794 latest.length = 0; 42795 const numValues = values.length; 42796 for (let i2 = 0; i2 < numValues; i2++) { 42797 latest[i2] = values[i2].get(); 42798 } 42799 return transformer(latest); 42800 }); 42801 } 42802 class DragControls { 42803 constructor() { 42804 this.componentControls = /* @__PURE__ */ new Set(); 42805 } 42806 /** 42807 * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. 42808 * 42809 * @internal 42810 */
42811 subscribe(controls) { 42812 this.componentControls.add(controls); 42813 return () => this.componentControls.delete(controls); 42814 } 42815 /** 42816 * Start a drag gesture on every `motion` component that has this set of drag controls 42817 * passed into it via the `dragControls` prop. 42818 * 42819 * ```jsx 42820 * dragControls.start(e, { 42821 * snapToCursor: true 42822 * }) 42823 * ``` 42824 * 42825 * @param event - PointerEvent 42826 * @param options - Options 42827 * 42828 * @public 42829 */ 42830 start(event, options2) { 42831 this.componentControls.forEach((controls) => { 42832 controls.start(event.nativeEvent || event, options2); 42833 }); 42834 } 42835 } 42836 const createDragControls = () => new DragControls(); 42837 function useDragControls() { 42838 return useConstant(createDragControls); 42839 } 42840 var __assign = function() { 42841 __assign = Object.assign || function __assign2(t2) { 42842 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 42843 s2 = arguments[i2]; 42844 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; 42845 } 42846 return t2; 42847 }; 42848 return __assign.apply(this, arguments); 42849 }; 42850 function __rest(s2, e2) { 42851 var t2 = {}; 42852 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) 42853 t2[p2] = s2[p2]; 42854 if (s2 != null && typeof Object.getOwnPropertySymbols === "function") 42855 for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { 42856 if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) 42857 t2[p2[i2]] = s2[p2[i2]]; 42858 } 42859 return t2; 42860 } 42861 function __awaiter(thisArg, _arguments, P2, generator) { 42862 function adopt(value) { 42863 return value instanceof P2 ? value : new P2(function(resolve) { 42864 resolve(value); 42865 }); 42866 } 42867 return new (P2 || (P2 = Promise))(function(resolve, reject) { 42868 function fulfilled(value) { 42869 try { 42870 step(generator.next(value)); 42871 } catch (e2) { 42872 reject(e2); 42873 } 42874 } 42875 function rejected(value) { 42876 try { 42877 step(generator["throw"](value)); 42878 } catch (e2) { 42879 reject(e2); 42880 } 42881 } 42882 function step(result) { 42883 result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); 42884 } 42885 step((generator = generator.apply(thisArg, _arguments || [])).next()); 42886 }); 42887 } 42888 function __spreadArray(to2, from2, pack) { 42889 if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) { 42890 if (ar2 || !(i2 in from2)) { 42891 if (!ar2) ar2 = Array.prototype.slice.call(from2, 0, i2); 42892 ar2[i2] = from2[i2]; 42893 } 42894 } 42895 return to2.concat(ar2 || Array.prototype.slice.call(from2)); 42896 } 42897 typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { 42898 var e2 = new Error(message); 42899 return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2; 42900 }; 42901 var zeroRightClassName = "right-scroll-bar-position"; 42902 var fullWidthClassName = "width-before-scroll-bar"; 42903 var noScrollbarsClassName = "with-scroll-bars-hidden"; 42904 var removedBarSizeVariable = "--removed-body-scroll-bar-size"; 42905 function assignRef(ref, value) { 42906 if (typeof ref === "function") { 42907 ref(value); 42908 } else if (ref) { 42909 ref.current = value; 42910 } 42911 return ref; 42912 } 42913 function useCallbackRef(initialValue2, callback) { 42914 var ref = reactExports.useState(function() { 42915 return { 42916 // value 42917 value: initialValue2, 42918 // last callback 42919 callback, 42920 // "memoized" public interface 42921 facade: { 42922 get current() { 42923 return ref.value; 42924 }, 42925 set current(value) { 42926 var last = ref.value; 42927 if (last !== value) { 42928 ref.value = value; 42929 ref.callback(value, last); 42930 } 42931 } 42932 } 42933 }; 42934 })[0]; 42935 ref.callback = callback; 42936 return ref.facade; 42937 } 42938 var useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect; 42939 var currentValues = /* @__PURE__ */ new WeakMap(); 42940 function useMergeRefs(refs, defaultValue) { 42941 var callbackRef = useCallbackRef(null, function(newValue) {
vendor: 4,984 bytes, lines 42942-43085
42942 return refs.forEach(function(ref) { 42943 return assignRef(ref, newValue); 42944 }); 42945 }); 42946 useIsomorphicLayoutEffect$1(function() { 42947 var oldValue = currentValues.get(callbackRef); 42948 if (oldValue) { 42949 var prevRefs_1 = new Set(oldValue); 42950 var nextRefs_1 = new Set(refs); 42951 var current_1 = callbackRef.current; 42952 prevRefs_1.forEach(function(ref) { 42953 if (!nextRefs_1.has(ref)) { 42954 assignRef(ref, null); 42955 } 42956 }); 42957 nextRefs_1.forEach(function(ref) { 42958 if (!prevRefs_1.has(ref)) { 42959 assignRef(ref, current_1); 42960 } 42961 }); 42962 } 42963 currentValues.set(callbackRef, refs); 42964 }, [refs]); 42965 return callbackRef; 42966 } 42967 function ItoI(a2) { 42968 return a2; 42969 } 42970 function innerCreateMedium(defaults2, middleware2) { 42971 if (middleware2 === void 0) { 42972 middleware2 = ItoI; 42973 } 42974 var buffer = []; 42975 var assigned = false; 42976 var medium = { 42977 read: function() { 42978 if (assigned) { 42979 throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`."); 42980 } 42981 if (buffer.length) { 42982 return buffer[buffer.length - 1]; 42983 } 42984 return defaults2; 42985 }, 42986 useMedium: function(data) { 42987 var item = middleware2(data, assigned); 42988 buffer.push(item); 42989 return function() { 42990 buffer = buffer.filter(function(x2) { 42991 return x2 !== item; 42992 }); 42993 }; 42994 }, 42995 assignSyncMedium: function(cb) { 42996 assigned = true; 42997 while (buffer.length) { 42998 var cbs = buffer; 42999 buffer = []; 43000 cbs.forEach(cb); 43001 } 43002 buffer = { 43003 push: function(x2) { 43004 return cb(x2); 43005 }, 43006 filter: function() { 43007 return buffer; 43008 } 43009 }; 43010 }, 43011 assignMedium: function(cb) { 43012 assigned = true; 43013 var pendingQueue = []; 43014 if (buffer.length) { 43015 var cbs = buffer; 43016 buffer = []; 43017 cbs.forEach(cb); 43018 pendingQueue = buffer; 43019 } 43020 var executeQueue = function() { 43021 var cbs2 = pendingQueue; 43022 pendingQueue = []; 43023 cbs2.forEach(cb); 43024 }; 43025 var cycle = function() { 43026 return Promise.resolve().then(executeQueue); 43027 }; 43028 cycle(); 43029 buffer = { 43030 push: function(x2) { 43031 pendingQueue.push(x2); 43032 cycle(); 43033 }, 43034 filter: function(filter2) { 43035 pendingQueue = pendingQueue.filter(filter2); 43036 return buffer; 43037 } 43038 }; 43039 } 43040 }; 43041 return medium; 43042 } 43043 function createSidecarMedium(options2) { 43044 if (options2 === void 0) { 43045 options2 = {}; 43046 } 43047 var medium = innerCreateMedium(null); 43048 medium.options = __assign({ async: true, ssr: false }, options2); 43049 return medium; 43050 } 43051 var SideCar$1 = function(_a) { 43052 var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]); 43053 if (!sideCar) { 43054 throw new Error("Sidecar: please provide `sideCar` property to import the right car"); 43055 } 43056 var Target = sideCar.read(); 43057 if (!Target) { 43058 throw new Error("Sidecar medium not found"); 43059 } 43060 return reactExports.createElement(Target, __assign({}, rest)); 43061 }; 43062 SideCar$1.isSideCarExport = true; 43063 function exportSidecar(medium, exported) { 43064 medium.useMedium(exported); 43065 return SideCar$1; 43066 } 43067 var effectCar = createSidecarMedium(); 43068 var nothing = function() { 43069 return; 43070 }; 43071 var RemoveScroll = reactExports.forwardRef(function(props, parentRef) { 43072 var ref = reactExports.useRef(null); 43073 var _a = reactExports.useState({ 43074 onScrollCapture: nothing, 43075 onWheelCapture: nothing, 43076 onTouchMoveCapture: nothing 43077 }), callbacks = _a[0], setCallbacks = _a[1]; 43078 var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container2 = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]); 43079 var SideCar2 = sideCar; 43080 var containerRef = useMergeRefs([ref, parentRef]); 43081 var containerProps = __assign(__assign({}, rest), callbacks); 43082 return reactExports.createElement( 43083 reactExports.Fragment, 43084 null, 43085 enabled && reactExports.createElement(SideCar2, { sideCar: effectC
43085ar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), 43086 forwardProps ? reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : reactExports.createElement(Container2, __assign({}, containerProps, { className, ref: containerRef }), children) 43087 ); 43088 }); 43089 RemoveScroll.defaultProps = { 43090 enabled: true, 43091 removeScrollBar: true, 43092 inert: false 43093 }; 43094 RemoveScroll.classNames = { 43095 fullWidth: fullWidthClassName, 43096 zeroRight: zeroRightClassName 43097 }; 43098 var getNonce = function() { 43099 if (typeof __webpack_nonce__ !== "undefined") { 43100 return __webpack_nonce__; 43101 } 43102 return void 0; 43103 }; 43104 function makeStyleTag() { 43105 if (!document) 43106 return null; 43107 var tag = document.createElement("style"); 43108 tag.type = "text/css"; 43109 var nonce = getNonce(); 43110 if (nonce) { 43111 tag.setAttribute("nonce", nonce); 43112 } 43113 return tag; 43114 } 43115 function injectStyles(tag, css) { 43116 if (tag.styleSheet) { 43117 tag.styleSheet.cssText = css; 43118 } else { 43119 tag.appendChild(document.createTextNode(css)); 43120 } 43121 } 43122 function insertStyleTag(tag) { 43123 var head = document.head || document.getElementsByTagName("head")[0]; 43124 head.appendChild(tag); 43125 } 43126 var stylesheetSingleton = function() { 43127 var counter = 0; 43128 var stylesheet = null; 43129 return { 43130 add: function(style) { 43131 if (counter == 0) { 43132 if (stylesheet = makeStyleTag()) { 43133 injectStyles(stylesheet, style); 43134 insertStyleTag(stylesheet); 43135 } 43136 } 43137 counter++; 43138 }, 43139 remove: function() { 43140 counter--; 43141 if (!counter && stylesheet) { 43142 stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); 43143 stylesheet = null; 43144 } 43145 } 43146 }; 43147 }; 43148 var styleHookSingleton = function() { 43149 var sheet = stylesheetSingleton(); 43150 return function(styles, isDynamic) { 43151 reactExports.useEffect(function() { 43152 sheet.add(styles); 43153 return function() { 43154 sheet.remove(); 43155 }; 43156 }, [styles && isDynamic]); 43157 }; 43158 }; 43159 var styleSingleton = function() { 43160 var useStyle2 = styleHookSingleton(); 43161 var Sheet = function(_a) { 43162 var styles = _a.styles, dynamic = _a.dynamic; 43163 useStyle2(styles, dynamic); 43164 return null; 43165 }; 43166 return Sheet; 43167 }; 43168 var zeroGap = { 43169 left: 0, 43170 top: 0, 43171 right: 0, 43172 gap: 0 43173 }; 43174 var parse$1 = function(x2) { 43175 return parseInt(x2 || "", 10) || 0; 43176 }; 43177 var getOffset = function(gapMode) { 43178 var cs = window.getComputedStyle(document.body); 43179 var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"]; 43180 var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"]; 43181 var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"]; 43182 return [parse$1(left), parse$1(top), parse$1(right)]; 43183 }; 43184 var getGapWidth = function(gapMode) { 43185 if (gapMode === void 0) { 43186 gapMode = "margin"; 43187 } 43188 if (typeof window === "undefined") { 43189 return zeroGap; 43190 } 43191 var offsets = getOffset(gapMode); 43192 var documentWidth = document.documentElement.clientWidth; 43193 var windowWidth = window.innerWidth; 43194 return { 43195 left: offsets[0], 43196 top: offsets[1], 43197 right: offsets[2], 43198 gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]) 43199 }; 43200 }; 43201 var Style = styleSingleton(); 43202 var lockAttribute = "data-scroll-locked"; 43203 var getStyles = function(_a, allowRelative, gapMode, important) { 43204 var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap; 43205 if (gapMode === void 0) { 43206 gapMode = "margin"; 43207 } 43208 return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([ 43209 allowRelative && "position: relative ".concat(important, ";"), 43210 gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), 43211 gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
vendor: 9,214 bytes, lines 43212-43421
43212 ].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); 43213 }; 43214 var getCurrentUseCounter = function() { 43215 var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10); 43216 return isFinite(counter) ? counter : 0; 43217 }; 43218 var useLockAttribute = function() { 43219 reactExports.useEffect(function() { 43220 document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString()); 43221 return function() { 43222 var newCounter = getCurrentUseCounter() - 1; 43223 if (newCounter <= 0) { 43224 document.body.removeAttribute(lockAttribute); 43225 } else { 43226 document.body.setAttribute(lockAttribute, newCounter.toString()); 43227 } 43228 }; 43229 }, []); 43230 }; 43231 var RemoveScrollBar = function(_a) { 43232 var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b; 43233 useLockAttribute(); 43234 var gap = reactExports.useMemo(function() { 43235 return getGapWidth(gapMode); 43236 }, [gapMode]); 43237 return reactExports.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") }); 43238 }; 43239 var passiveSupported = false; 43240 if (typeof window !== "undefined") { 43241 try { 43242 var options = Object.defineProperty({}, "passive", { 43243 get: function() { 43244 passiveSupported = true; 43245 return true; 43246 } 43247 }); 43248 window.addEventListener("test", options, options); 43249 window.removeEventListener("test", options, options); 43250 } catch (err) { 43251 passiveSupported = false; 43252 } 43253 } 43254 var nonPassive = passiveSupported ? { passive: false } : false; 43255 var alwaysContainsScroll = function(node2) { 43256 return node2.tagName === "TEXTAREA"; 43257 }; 43258 var elementCanBeScrolled = function(node2, overflow) { 43259 if (!(node2 instanceof Element)) { 43260 return false; 43261 } 43262 var styles = window.getComputedStyle(node2); 43263 return ( 43264 // not-not-scrollable 43265 styles[overflow] !== "hidden" && // contains scroll inside self 43266 !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node2) && styles[overflow] === "visible") 43267 ); 43268 }; 43269 var elementCouldBeVScrolled = function(node2) { 43270 return elementCanBeScrolled(node2, "overflowY"); 43271 }; 43272 var elementCouldBeHScrolled = function(node2) { 43273 return elementCanBeScrolled(node2, "overflowX"); 43274 }; 43275 var locationCouldBeScrolled = function(axis, node2) { 43276 var ownerDocument = node2.ownerDocument; 43277 var current = node2; 43278 do { 43279 if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) { 43280 current = current.host; 43281 } 43282 var isScrollable = elementCouldBeScrolled(axis, current); 43283 if (isScrollable) { 43284 var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2]; 43285 if (scrollHeight > clientHeight) { 43286 return true; 43287 } 43288 } 43289 current = current.parentNode; 43290 } while (current && current !== ownerDocument.body); 43291 return false; 43292 }; 43293 var getVScrollVariables = function(_a) { 43294 var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight; 43295 return [ 43296 scrollTop, 43297 scrollHeight, 43298 clientHeight 43299 ]; 43300 }; 43301 var getHScrollVariables = function(_a) { 43302 var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth; 43303 return [ 43304 scrollLeft, 43305 scrollWidth, 43306 clientWidth 43307 ]; 43308 }; 43309 var elementCouldBeScrolled = function(axis, node2) { 43310 return axis === "v" ? elementCouldBeVScrolled(node2) : elementCouldBeHScrolled(node2); 43311 }; 43312 var getScrollVariables = function(axis, node2) { 43313 return axis === "v" ? getVScrollVariables(node2) : getHScrollVariables(node2); 43314 }; 43315 var getDirectionFactor = function(axis, direction) { 43316 return axis === "h" && direction === "rtl" ? -1 : 1; 43317 }; 43318 var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) { 43319 var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); 43320 var delta = directionFactor * sourceDelta; 43321 var target = event.target; 43322 var targetInLock = endTarget.contains(target); 43323 var shouldCancelScroll = false; 43324 var isDeltaPositive = delta > 0; 43325 var availableScroll = 0; 43326 var availableScrollTop = 0; 43327 do { 43328 var _a = getScrollVariables(axis, target), position2 = _a[0], scroll_1 = _a[1], capacity = _a[2]; 43329 var elementScroll = scroll_1 - capacity - directionFactor * position2; 43330 if (position2 || elementScroll) { 43331 if (elementCouldBeScrolled(axis, target)) { 43332 availableScroll += elementScroll; 43333 availableScrollTop += position2; 43334 } 43335 } 43336 if (target instanceof ShadowRoot) { 43337 target = target.host; 43338 } else { 43339 target = target.parentNode; 43340 } 43341 } while ( 43342 // portaled content 43343 !targetInLock && target !== document.body || // self content 43344 targetInLock && (endTarget.contains(target) || endTarget === target) 43345 ); 43346 if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) { 43347 shouldCancelScroll = true; 43348 } else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) { 43349 shouldCancelScroll = true; 43350 } 43351 return shouldCancelScroll; 43352 }; 43353 var getTouchXY = function(event) { 43354 return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; 43355 }; 43356 var getDeltaXY = function(event) { 43357 return [event.deltaX, event.deltaY]; 43358 }; 43359 var extractRef = function(ref) { 43360 return ref && "current" in ref ? ref.current : ref; 43361 }; 43362 var deltaCompare = function(x2, y2) { 43363 return x2[0] === y2[0] && x2[1] === y2[1]; 43364 }; 43365 var generateStyle = function(id2) { 43366 return "\n .block-interactivity-".concat(id2, " {pointer-events: none;}\n .allow-interactivity-").concat(id2, " {pointer-events: all;}\n"); 43367 }; 43368 var idCounter = 0; 43369 var lockStack = []; 43370 function RemoveScrollSideCar(props) { 43371 var shouldPreventQueue = reactExports.useRef([]); 43372 var touchStartRef = reactExports.useRef([0, 0]); 43373 var activeAxis = reactExports.useRef(); 43374 var id2 = reactExports.useState(idCounter++)[0]; 43375 var Style2 = reactExports.useState(styleSingleton)[0]; 43376 var lastProps = reactExports.useRef(props); 43377 reactExports.useEffect(function() { 43378 lastProps.current = props; 43379 }, [props]); 43380 reactExports.useEffect(function() { 43381 if (props.inert) { 43382 document.body.classList.add("block-interactivity-".concat(id2)); 43383 var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); 43384 allow_1.forEach(function(el) { 43385 return el.classList.add("allow-interactivity-".concat(id2)); 43386 }); 43387 return function() { 43388 document.body.classList.remove("block-interactivity-".concat(id2)); 43389 allow_1.forEach(function(el) { 43390 return el.classList.remove("allow-interactivity-".concat(id2)); 43391 }); 43392 }; 43393 } 43394 return; 43395 }, [props.inert, props.lockRef.current, props.shards]); 43396 var shouldCancelEvent = reactExports.useCallback(function(event, parent) { 43397 if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) { 43398 return !lastProps.current.allowPinchZoom; 43399 } 43400 var touch = getTouchXY(event); 43401 var touchStart = touchStartRef.current; 43402 var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0]; 43403 var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1]; 43404 var currentAxis; 43405 var target = event.target; 43406 var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v"; 43407 if ("touches" in event && moveDirection === "h" && target.type === "range") { 43408 return false; 43409 } 43410 var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 43411 if (!canBeScrolledInMainDirection) { 43412 return true; 43413 } 43414 if (canBeScrolledInMainDirection) { 43415 currentAxis = moveDirection; 43416 } else { 43417 currentAxis = moveDirection === "v" ? "h" : "v"; 43418 canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 43419 } 43420 if (!canBeScrolledInMainDirection) { 43421 return false;
43422 } 43423 if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) { 43424 activeAxis.current = currentAxis; 43425 } 43426 if (!currentAxis) { 43427 return true; 43428 } 43429 var cancelingAxis = activeAxis.current || currentAxis; 43430 return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY); 43431 }, []); 43432 var shouldPrevent = reactExports.useCallback(function(_event) { 43433 var event = _event; 43434 if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) { 43435 return; 43436 } 43437 var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event); 43438 var sourceEvent = shouldPreventQueue.current.filter(function(e2) { 43439 return e2.name === event.type && (e2.target === event.target || event.target === e2.shadowParent) && deltaCompare(e2.delta, delta); 43440 })[0]; 43441 if (sourceEvent && sourceEvent.should) { 43442 if (event.cancelable) { 43443 event.preventDefault(); 43444 } 43445 return; 43446 } 43447 if (!sourceEvent) { 43448 var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node2) { 43449 return node2.contains(event.target); 43450 }); 43451 var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; 43452 if (shouldStop) { 43453 if (event.cancelable) { 43454 event.preventDefault(); 43455 } 43456 } 43457 } 43458 }, []); 43459 var shouldCancel = reactExports.useCallback(function(name, delta, target, should) { 43460 var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) }; 43461 shouldPreventQueue.current.push(event); 43462 setTimeout(function() { 43463 shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e2) { 43464 return e2 !== event; 43465 }); 43466 }, 1); 43467 }, []); 43468 var scrollTouchStart = reactExports.useCallback(function(event) { 43469 touchStartRef.current = getTouchXY(event); 43470 activeAxis.current = void 0; 43471 }, []); 43472 var scrollWheel = reactExports.useCallback(function(event) { 43473 shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 43474 }, []); 43475 var scrollTouchMove = reactExports.useCallback(function(event) { 43476 shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 43477 }, []); 43478 reactExports.useEffect(function() { 43479 lockStack.push(Style2); 43480 props.setCallbacks({ 43481 onScrollCapture: scrollWheel, 43482 onWheelCapture: scrollWheel, 43483 onTouchMoveCapture: scrollTouchMove 43484 }); 43485 document.addEventListener("wheel", shouldPrevent, nonPassive); 43486 document.addEventListener("touchmove", shouldPrevent, nonPassive); 43487 document.addEventListener("touchstart", scrollTouchStart, nonPassive); 43488 return function() { 43489 lockStack = lockStack.filter(function(inst) { 43490 return inst !== Style2; 43491 }); 43492 document.removeEventListener("wheel", shouldPrevent, nonPassive); 43493 document.removeEventListener("touchmove", shouldPrevent, nonPassive); 43494 document.removeEventListener("touchstart", scrollTouchStart, nonPassive); 43495 }; 43496 }, []); 43497 var removeScrollBar = props.removeScrollBar, inert = props.inert; 43498 return reactExports.createElement( 43499 reactExports.Fragment, 43500 null, 43501 inert ? reactExports.createElement(Style2, { styles: generateStyle(id2) }) : null, 43502 removeScrollBar ? reactExports.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null 43503 ); 43504 } 43505 function getOutermostShadowParent(node2) { 43506 var shadowParent = null; 43507 while (node2 !== null) { 43508 if (node2 instanceof ShadowRoot) { 43509 shadowParent = node2.host; 43510 node2 = node2.host; 43511 } 43512 node2 = node2.parentNode; 43513 } 43514 return shadowParent; 43515 } 43516 const SideCar = exportSidecar(effectCar, RemoveScrollSideCar); 43517 var ReactRemoveScroll = reactExports.forwardRef(function(props, ref) { 43518 return reactExports.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: SideCar })); 43519 }); 43520 ReactRemoveScroll.classNames = RemoveScroll.classNames; 43521 const escapeStack = []; 43522 const handleKeyDown = (event) => { 43523 var _a; 43524 if (event.key !== "Escape") return; 43525 (_a = escapeStack[escapeStack.length - 1]) == null ? void 0 : _a.call(escapeStack); 43526 }; 43527 const attach = () => { 43528 if (escapeStack.length === 1) document.addEventListener("keydown", handleKeyDown); 43529 }; 43530 const detach = () => { 43531 if (escapeStack.length === 0) document.removeEventListener("keydown", handleKeyDown); 43532 }; 43533 const useEscapeKey = (isActive, onEscape) => { 43534 const onEscapeRef = reactExports.useRef(onEscape); 43535 reactExports.useEffect(() => { 43536 onEscapeRef.current = onEscape; 43537 }); 43538 reactExports.useEffect(() => { 43539 if (!isActive) return void 0; 43540 const handler = () => onEscapeRef.current(); 43541 escapeStack.push(handler); 43542 attach(); 43543 return () => { 43544 const index2 = escapeStack.indexOf(handler); 43545 if (index2 !== -1) escapeStack.splice(index2, 1); 43546 detach(); 43547 }; 43548 }, [isActive]); 43549 }; 43550 const ZOOM_TOLERANCE = 0.01; 43551 const useIsomorphicLayoutEffect = typeof document === "undefined" ? reactExports.useEffect : reactExports.useLayoutEffect; 43552 const useOverlayViewport = (isOpen) => { 43553 const ref = reactExports.useRef(null); 43554 useIsomorphicLayoutEffect(() => { 43555 const element = ref.current;
43556 const viewport = window.visualViewport; 43557 if (!isOpen || !element || !viewport) return void 0; 43558 let frameId = 0; 43559 let written = ""; 43560 const write = () => { 43561 if (viewport.scale > 1 + ZOOM_TOLERANCE) { 43562 if (!written) return; 43563 written = ""; 43564 element.style.removeProperty("--overlay-viewport-top"); 43565 element.style.removeProperty("--overlay-viewport-height"); 43566 element.style.removeProperty("--overlay-keyboard-inset-bottom"); 43567 return; 43568 } 43569 const height = Math.min(viewport.height, window.innerHeight); 43570 const top = Math.max(0, viewport.offsetTop); 43571 const keyboard = Math.max(0, window.innerHeight - top - height); 43572 const next2 = `${top}/${height}/${keyboard}`; 43573 if (next2 === written) return; 43574 written = next2; 43575 element.style.setProperty("--overlay-viewport-top", `${top}px`); 43576 element.style.setProperty("--overlay-viewport-height", `${height}px`); 43577 element.style.setProperty("--overlay-keyboard-inset-bottom", `${keyboard}px`); 43578 }; 43579 write(); 43580 const schedule = () => { 43581 cancelAnimationFrame(frameId); 43582 frameId = requestAnimationFrame(write); 43583 }; 43584 viewport.addEventListener("resize", schedule); 43585 viewport.addEventListener("scroll", schedule); 43586 return () => { 43587 cancelAnimationFrame(frameId); 43588 viewport.removeEventListener("resize", schedule); 43589 viewport.removeEventListener("scroll", schedule); 43590 }; 43591 }, [isOpen]); 43592 return ref; 43593 }; 43594 const OverlayContext = reactExports.createContext(void 0); 43595 const useOverlayRegistry = () => reactExports.useContext(OverlayContext); 43596 const useOverlayVisibility = () => { 43597 const registry = useOverlayRegistry(); 43598 const removeRef = reactExports.useRef(void 0); 43599 const set2 = reactExports.useCallback( 43600 (visible) => { 43601 var _a; 43602 if (visible === !!removeRef.current) return; 43603 if (visible) { 43604 removeRef.current = registry == null ? void 0 : registry.add(); 43605 } else { 43606 (_a = removeRef.current) == null ? void 0 : _a.call(removeRef); 43607 removeRef.current = void 0; 43608 } 43609 }, 43610 [registry] 43611 ); 43612 return { set: set2 }; 43613 }; 43614 const Backdrop$1 = dt$2(motion.div)` 43615 position: absolute; 43616 inset: 0; 43617 background: var(--color-black-alpha-1500); 43618`; 43619 const Backdrop = ({ onClick, opacity, animated = true }) => /* @__PURE__ */ jsxRuntimeExports.jsx( 43620 Backdrop$1, 43621 { 43622 style: opacity ? { opacity } : void 0, 43623 initial: opacity || !animated ? false : { opacity: 0 }, 43624 animate: opacity ? void 0 : { opacity: BACKDROP_OPACITY }, 43625 exit: opacity ? void 0 : { opacity: 0 }, 43626 transition: animated ? SPRING : { duration: 0 }, 43627 onClick: (event) => { 43628 event.stopPropagation(); 43629 onClick == null ? void 0 : onClick(); 43630 } 43631 } 43632 ); 43633 const Root$1 = dt$2.div` 43634 /* Sized to the band the browser shows rather than the layout viewport, so the on-screen 43635 keyboard can't cover the overlay's trailing edge â see docs/frontend-principles/overlays.md 43636 â The On-Screen Keyboard. Without useOverlayViewport's properties this is inset: 0. */ 43637 position: fixed; 43638 top: var(--overlay-viewport-top, 0px); 43639 left: 0; 43640 right: 0; 43641 height: var(--overlay-viewport-height, 100%); 43642 z-index: ${OVERLAY_Z_INDEX}; 43643 43644 /* Read by panels and their content through OVERLAY_BOTTOM_INSET (styles/insets.ts). */ 43645 --overlay-inset-bottom: max( 43646 0px, 43647 calc(var(--safe-area-inset-bottom, 0px) - var(--overlay-keyboard-inset-bottom, 0px)) 43648 ); 43649 43650 display: flex; 43651 43652 ${({ $align }) => $align === "bottom" && lt$2` 43653 flex-direction: column; 43654 justify-content: flex-end; 43655 `} 43656`; 43657 const OverlayShell = ({ 43658 isOpen, 43659 children, 43660 align = "fill", 43661 backdrop = true, 43662 backdropOpacity, 43663 testId, 43664 onClose, 43665 onExited 43666 }) => { 43667 const { set: setOverlayVisible } = useOverlayVisibility(); 43668 const viewportRef = useOverlayViewport(isOpen); 43669 reactExports.useEffect(() => { 43670 setOverlayVisible(isOpen); 43671 return () => setOverlayVisible(false); 43672 }, [isOpen, setOverlayVisible]); 43673 useEscapeKey(isOpen && !!onClose, () => onClose == null ? void 0 : onClose()); 43674 if (typeof document === "undefined") return null; 43675 return reactDomExports.createPortal(
43676 /* @__PURE__ */ jsxRuntimeExports.jsx(AnimatePresence, { onExitComplete: onExited, children: isOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Root$1, { ref: viewportRef, "data-testid": testId, $align: align, children: [ 43677 backdrop && /* @__PURE__ */ jsxRuntimeExports.jsx(Backdrop, { opacity: backdropOpacity, onClick: onClose }), 43678 children 43679 ] }) }) }), 43680 document.body 43681 ); 43682 }; 43683 const Grabber = dt$2.div` 43684 position: relative; 43685 flex-shrink: 0; 43686 touch-action: none; 43687 cursor: grab; 43688 43689 &:active { 43690 cursor: grabbing; 43691 } 43692`; 43693 const Handle = dt$2.div` 43694 position: absolute; 43695 top: 5px; 43696 left: 50%; 43697 transform: translateX(-50%); 43698 width: 54px; 43699 height: 2px; 43700 border-radius: var(--radius-full); 43701 background: var(--bg-transparent-strongest); 43702`; 43703 const Header$1 = dt$2.header` 43704 height: 70px; 43705 display: grid; 43706 grid-template-columns: 1fr minmax(0, auto) 1fr; 43707 column-gap: var(--space-400); 43708 align-items: center; 43709 padding: 0 var(--space-400); 43710`; 43711 const HeaderSide = dt$2.div` 43712 display: flex; 43713 min-width: var(--space-800); 43714 43715 &:last-child { 43716 grid-column: 3; 43717 justify-content: flex-end; 43718 } 43719`; 43720 const Title$2 = dt$2.div` 43721 font-family: var(--font-family-heading); 43722 font-size: var(--font-size-400); 43723 font-weight: var(--font-weight-500); 43724 line-height: var(--font-line-height-300); 43725 letter-spacing: var(--font-letter-spacing-dense); 43726 overflow: hidden; 43727 white-space: nowrap; 43728 text-overflow: ellipsis; 43729 text-align: center; 43730`; 43731 const BottomSheetHeader = ({ 43732 title, 43733 onBack, 43734 leftAction, 43735 rightAction, 43736 showHandle, 43737 onClose, 43738 onGrabberPointerDown 43739 }) => { 43740 const renderLeftAction = () => { 43741 if (leftAction) return leftAction; 43742 if (onBack) { 43743 return /* @__PURE__ */ jsxRuntimeExports.jsx( 43744 IconButton, 43745 { 43746 icon: X4, 43747 size: "small", 43748 variant: "transparent", 43749 "aria-label": "Back", 43750 onClick: onBack 43751 } 43752 ); 43753 } 43754 return /* @__PURE__ */ jsxRuntimeExports.jsx( 43755 IconButton, 43756 { 43757 icon: $4, 43758 size: "small", 43759 variant: "transparent", 43760 "aria-label": "Close", 43761 onClick: onClose 43762 } 43763 ); 43764 }; 43765 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Grabber, { onPointerDown: onGrabberPointerDown, children: [ 43766 showHandle && /* @__PURE__ */ jsxRuntimeExports.jsx(Handle, {}),
43767 /* @__PURE__ */ jsxRuntimeExports.jsxs(Header$1, { children: [ 43768 /* @__PURE__ */ jsxRuntimeExports.jsx(HeaderSide, { children: renderLeftAction() }), 43769 title && /* @__PURE__ */ jsxRuntimeExports.jsx(Title$2, { children: title }), 43770 /* @__PURE__ */ jsxRuntimeExports.jsx(HeaderSide, { children: rightAction }) 43771 ] }) 43772 ] }); 43773 }; 43774 const CLOSE_THRESHOLD = 0.5; 43775 const FLING_VELOCITY = 600; 43776 const FLING_MIN_DISTANCE = 40; 43777 const useBottomSheetDrag = (onClose) => { 43778 const panelRef = reactExports.useRef(null); 43779 const dragControls = useDragControls(); 43780 const y2 = useMotionValue("100%"); 43781 const backdropOpacity = useTransform(y2, (value) => { 43782 var _a; 43783 const progress2 = typeof value === "string" ? 1 - parseFloat(value) / 100 : 1 - value / (((_a = panelRef.current) == null ? void 0 : _a.offsetHeight) || window.innerHeight); 43784 return Math.min(Math.max(progress2, 0), 1) * BACKDROP_OPACITY; 43785 }); 43786 const handleDragEnd = (_2, info) => { 43787 var _a, _b; 43788 const height = (_b = (_a = panelRef.current) == null ? void 0 : _a.offsetHeight) != null ? _b : 0; 43789 const flings = info.offset.y > FLING_MIN_DISTANCE && info.velocity.y > FLING_VELOCITY; 43790 const passedHalf = height > 0 && info.offset.y > height * CLOSE_THRESHOLD; 43791 if (flings || passedHalf) onClose(); 43792 }; 43793 return { panelRef, dragControls, y: y2, backdropOpacity, handleDragEnd }; 43794 }; 43795 const BOTTOM_OFFSET = overlayBottomOffset("var(--space-400)"); 43796 const Panel = dt$2(motion.div)` 43797 position: relative; 43798 display: flex; 43799 flex-direction: column; 43800 max-height: calc(100% - 96px); 43801 43802 ${({ $fill }) => $fill && lt$2` 43803 height: calc(100% - 96px); 43804 `} 43805 43806 background: var(--bg-primary); 43807 border-radius: var(--panel-radius-large) var(--panel-radius-large) 0 0; 43808 color: var(--text-primary); 43809 43810 /* covers the gap under the panel when the enter spring overshoots */ 43811 &::after { 43812 display: block; 43813 content: ''; 43814 position: absolute; 43815 top: 100%; 43816 height: 50px; 43817 width: 100%; 43818 background: var(--bg-primary); 43819 } 43820`; 43821 const Content$3 = dt$2.div` 43822 flex: 1; 43823 min-height: 0; 43824 43825 ${({ $scrollable }) => $scrollable ? lt$2` 43826 overflow-y: auto; 43827 overscroll-behavior: contain; 43828 scroll-padding-bottom: ${BOTTOM_OFFSET}; 43829 ` : lt$2` 43830 display: flex; 43831 flex-direction: column; 43832 overflow: hidden; 43833 `} 43834 43835 ${({ $hasFooter }) => !$hasFooter && lt$2` 43836 padding-bottom: ${BOTTOM_OFFSET}; 43837 `} 43838`; 43839 const Footer$2 = dt$2.div` 43840 flex-shrink: 0; 43841 padding: var(--space-400) var(--space-400) ${BOTTOM_OFFSET}; 43842`; 43843 const BottomSheet = ({ 43844 isOpen, 43845 title, 43846 onBack, 43847 leftAction, 43848 rightAction, 43849 children, 43850 footer, 43851 scrollable = true, 43852 showHandle = false, 43853 onClose, 43854 onExited 43855 }) => { 43856 const { panelRef, dragControls, y: y2, backdropOpacity, handleDragEnd } = useBottomSheetDrag(onClose); 43857 return /* @__PURE__ */ jsxRuntimeExports.jsx( 43858 OverlayShell, 43859 { 43860 isOpen, 43861 align: "bottom", 43862 backdropOpacity, 43863 testId: "BottomSheet", 43864 onClose, 43865 onExited, 43866 children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 43867 Panel, 43868 { 43869 ref: panelRef, 43870 role: "dialog", 43871 "aria-modal": "true", 43872 "data-testid": "BottomSheet.Panel", 43873 $fill: !scrollable, 43874 style: { y: y2 }, 43875 initial: { y: "100%" }, 43876 animate: { y: 0 }, 43877 exit: { y: "100%" }, 43878 transition: SPRING, 43879 drag: "y", 43880 dragListener: false, 43881 dragControls, 43882 dragConstraints: { top: 0, bottom: 0 }, 43883 dragElastic: { top: 0, bottom: 1 }, 43884 onDragEnd: handleDragEnd, 43885 children: [
43886 /* @__PURE__ */ jsxRuntimeExports.jsx( 43887 BottomSheetHeader, 43888 { 43889 title, 43890 onBack, 43891 leftAction, 43892 rightAction, 43893 showHandle, 43894 onClose, 43895 onGrabberPointerDown: (event) => dragControls.start(event) 43896 } 43897 ), 43898 /* @__PURE__ */ jsxRuntimeExports.jsx(Content$3, { $scrollable: scrollable, $hasFooter: !!footer, children }), 43899 footer && /* @__PURE__ */ jsxRuntimeExports.jsx(Footer$2, { children: footer }) 43900 ] 43901 } 43902 ) 43903 } 43904 ); 43905 }; 43906 const Container$o = dt$2.h1` 43907 color: var(--text-primary); 43908 font-family: var(--font-family-heading); 43909 font-style: var(--font-style-heading); 43910 text-transform: var(--text-transform-heading); 43911 43912 ${({ $type }) => $type === "h1" && lt$2` 43913 font-weight: var(--font-weight-440); 43914 font-size: var(--font-size-800); 43915 line-height: var(--font-line-height-700); 43916 letter-spacing: var(--font-letter-spacing-densest); 43917 `}; 43918 43919 ${({ $type }) => $type === "h2" && lt$2` 43920 font-weight: var(--font-weight-460); 43921 font-size: var(--font-size-700); 43922 line-height: var(--font-line-height-600); 43923 letter-spacing: var(--font-letter-spacing-denser); 43924 `}; 43925 43926 ${({ $type }) => $type === "h3" && lt$2` 43927 font-weight: var(--font-weight-480); 43928 font-size: var(--font-size-600); 43929 line-height: var(--font-line-height-500); 43930 letter-spacing: var(--font-letter-spacing-dense); 43931 `}; 43932 43933 ${({ $type }) => $type === "h4" && lt$2` 43934 font-weight: var(--font-weight-480); 43935 font-size: var(--font-size-500); 43936 line-height: var(--font-line-height-400); 43937 letter-spacing: var(--font-letter-spacing-dense); 43938 `}; 43939 43940 ${({ $type }) => $type === "h5" && lt$2` 43941 font-weight: var(--font-weight-500); 43942 font-size: var(--font-size-400); 43943 line-height: var(--font-line-height-300); 43944 letter-spacing: var(--font-letter-spacing-dense); 43945 `}; 43946 43947 ${({ $type }) => $type === "h6" && lt$2` 43948 font-weight: var(--font-weight-500); 43949 font-size: var(--font-size-300); 43950 line-height: var(--font-line-height-200); 43951 letter-spacing: var(--font-letter-spacing-normal); 43952 `}; 43953 43954 ${({ $type }) => $type === "h7" && lt$2` 43955 font-weight: var(--font-weight-460); 43956 font-size: var(--font-size-200); 43957 line-height: var(--font-line-height-100); 43958 letter-spacing: var(--font-letter-spacing-denser); 43959 `}; 43960`; 43961 const supportedHTMLElements = ["h1", "h2", "h3", "h4", "h5", "h6", "legend"]; 43962 const Heading = (_t2) => { 43963 var _u = _t2, { type, asTag, children } = _u, props = __objRest(_u, ["type", "asTag", "children"]); 43964 const getType = () => { 43965 if (asTag) { 43966 return asTag; 43967 } 43968 if (supportedHTMLElements.find((element) => element === type)) { 43969 return type; 43970 } 43971 return "div"; 43972 }; 43973 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$o, __spreadProps(__spreadValues({ as: getType(), $type: type, "data-testid": "Heading" }, props), { children })); 43974 }; 43975 const Container$n = dt$2.div` 43976 min-height: 100vh; 43977 43978 display: flex; 43979 align-items: center; 43980 justify-content: center; 43981 43982 position: relative; 43983`; 43984 const LogoContainer = dt$2.div` 43985 position: absolute; 43986 top: 0; 43987 left: 0; 43988 padding: var(--space-600); 43989 43990 display: block; 43991`; 43992 const Main = dt$2.div` 43993 max-width: ${({ $maxWidth = 498 }) => $maxWidth}px; 43994 43995 text-align: center; 43996`; 43997 const LoaderContainer$1 = dt$2.div` 43998 margin-bottom: var(--space-400); 43999 44000 display: flex; 44001 justify-content: center; 44002`; 44003 const Description$3 = dt$2.div` 44004 margin-top: var(--space-400); 44005 44006 font-size: var(--font-size-400); 44007 color: var(--text-primary); 44008`; 44009 const ActionsContainer = dt$2.div` 44010 margin-top: var(--space-600); 44011 44012 display: flex; 44013 justify-content: center; 44014`; 44015 const ErrorPage = ({ to: to2, heading, description, actions, loader, maxWidth }) => { 44016 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$n, { children: [
44017 to2 && /* @__PURE__ */ jsxRuntimeExports.jsx(LogoContainer, { as: Link, to: to2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(u8, { height: 28, width: 28 }) }), 44018 !to2 && /* @__PURE__ */ jsxRuntimeExports.jsx(LogoContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(u8, { height: 28, width: 28 }) }), 44019 /* @__PURE__ */ jsxRuntimeExports.jsxs(Main, { $maxWidth: maxWidth, children: [ 44020 loader && /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderContainer$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "large" }) }), 44021 /* @__PURE__ */ jsxRuntimeExports.jsx(Heading, { type: "h2", children: heading }), 44022 description && /* @__PURE__ */ jsxRuntimeExports.jsx(Description$3, { children: description }), 44023 actions && /* @__PURE__ */ jsxRuntimeExports.jsx(ActionsContainer, { children: actions }) 44024 ] }) 44025 ] }); 44026 }; 44027 const Container$m = dt$2.div( 44028 ({ $variant, $flex, $alignRight, $alignCenter }) => lt$2` 44029 flex-grow: 1; 44030 flex: ${$flex}; 44031 44032 & + & { 44033 ${$variant === "small" && lt$2` 44034 margin-top: var(--space-200); 44035 `}; 44036 44037 ${$variant === "regular" && lt$2` 44038 margin-top: var(--space-300); 44039 `}; 44040 44041 ${$variant === "medium" && lt$2` 44042 margin-top: var(--space-400); 44043 `}; 44044 44045 ${$variant === "large" && lt$2` 44046 margin-top: var(--space-800); 44047 `}; 44048 44049 ${mediaQueries.tablet} { 44050 margin-top: 0; 44051 width: auto; 44052 margin-left: var(--space-400); 44053 } 44054 } 44055 44056 ${$alignRight && lt$2` 44057 display: flex; 44058 justify-content: flex-end; 44059 `}; 44060 44061 ${$alignCenter && lt$2` 44062 display: flex; 44063 align-items: center; 44064 `}; 44065 ` 44066 ); 44067 const Footer$1 = dt$2.div` 44068 margin-top: var(--space-50); 44069`; 44070 const FieldsetItem = ({ 44071 variant = "medium", 44072 flex = 1, 44073 footerContent, 44074 alignRight, 44075 alignCenter, 44076 children 44077 }) => { 44078 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 44079 Container$m, 44080 { 44081 $variant: variant, 44082 $flex: flex, 44083 $alignRight: alignRight, 44084 $alignCenter: alignCenter, 44085 children: [
44086 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }), 44087 footerContent && /* @__PURE__ */ jsxRuntimeExports.jsx(Footer$1, { children: footerContent }) 44088 ] 44089 } 44090 ); 44091 }; 44092 const Container$l = dt$2.div` 44093 ${mediaQueries.tablet} { 44094 display: flex; 44095 } 44096 44097 ${({ $inner }) => $inner && lt$2` 44098 margin-top: var(--space-300) !important; 44099 margin-left: var(--space-900); 44100 `}; 44101 44102 ${({ $variant, $noMargin }) => $variant === "small" && !$noMargin && lt$2` 44103 margin-top: var(--space-200); 44104 `}; 44105 44106 ${({ $variant, $noMargin }) => $variant === "regular" && !$noMargin && lt$2` 44107 margin-top: var(--space-300); 44108 `}; 44109 44110 ${({ $variant, $noMargin }) => $variant === "medium" && !$noMargin && lt$2` 44111 margin-top: var(--space-400); 44112 `}; 44113 44114 ${({ $variant, $noMargin }) => $variant === "large" && !$noMargin && lt$2` 44115 margin-top: var(--space-800); 44116 `}; 44117 44118 &:first-of-type { 44119 margin-top: 0; 44120 } 44121`; 44122 const FieldsetRow = ({ 44123 variant = "medium", 44124 inner, 44125 noMargin = false, 44126 children 44127 }) => { 44128 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$l, { $variant: variant, $inner: inner, $noMargin: noMargin, children }); 44129 }; 44130 const Container$k = dt$2.fieldset` 44131 padding: 0; 44132 44133 & & { 44134 padding-top: var(--space-200); 44135 padding-left: var(--space-900); 44136 } 44137`; 44138 const Fieldset = ({ children }) => { 44139 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$k, { children }); 44140 }; 44141 Fieldset.Item = FieldsetItem; 44142 Fieldset.Row = FieldsetRow; 44143 var propTypes = { exports: {} }; 44144 var ReactPropTypesSecret_1; 44145 var hasRequiredReactPropTypesSecret; 44146 function requireReactPropTypesSecret() { 44147 if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1; 44148 hasRequiredReactPropTypesSecret = 1; 44149 var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; 44150 ReactPropTypesSecret_1 = ReactPropTypesSecret; 44151 return ReactPropTypesSecret_1; 44152 } 44153 var factoryWithThrowingShims; 44154 var hasRequiredFactoryWithThrowingShims; 44155 function requireFactoryWithThrowingShims() { 44156 if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims; 44157 hasRequiredFactoryWithThrowingShims = 1; 44158 var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret(); 44159 function emptyFunction() { 44160 } 44161 function emptyFunctionWithReset() { 44162 } 44163 emptyFunctionWithReset.resetWarningCache = emptyFunction; 44164 factoryWithThrowingShims = function() { 44165 function shim2(props, propName, componentName, location, propFullName, secret) { 44166 if (secret === ReactPropTypesSecret) { 44167 return; 44168 } 44169 var err = new Error( 44170 "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" 44171 ); 44172 err.name = "Invariant Violation"; 44173 throw err; 44174 } 44175 shim2.isRequired = shim2; 44176 function getShim() { 44177 return shim2; 44178 } 44179 var ReactPropTypes = { 44180 array: shim2, 44181 bigint: shim2, 44182 bool: shim2, 44183 func: shim2, 44184 number: shim2, 44185 object: shim2, 44186 string: shim2, 44187 symbol: shim2, 44188 any: shim2, 44189 arrayOf: getShim, 44190 element: shim2, 44191 elementType: shim2, 44192 instanceOf: getShim, 44193 node: shim2, 44194 objectOf: getShim, 44195 oneOf: getShim, 44196 oneOfType: getShim, 44197 shape: getShim, 44198 exact: getShim, 44199 checkPropTypes: emptyFunctionWithReset, 44200 resetWarningCache: emptyFunction 44201 }; 44202 ReactPropTypes.PropTypes = ReactPropTypes; 44203 return ReactPropTypes; 44204 }; 44205 return factoryWithThrowingShims; 44206 } 44207 var hasRequiredPropTypes; 44208 function requirePropTypes() { 44209 if (hasRequiredPropTypes) return propTypes.exports; 44210 hasRequiredPropTypes = 1; 44211 { 44212 propTypes.exports = /* @__PURE__ */ requireFactoryWithThrowingShims()(); 44213 }
44214 return propTypes.exports; 44215 } 44216 var propTypesExports = /* @__PURE__ */ requirePropTypes(); 44217 const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports); 44218 const COMMON_MIME_TYPES = /* @__PURE__ */ new Map([ 44219 // https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php 44220 ["1km", "application/vnd.1000minds.decision-model+xml"], 44221 ["3dml", "text/vnd.in3d.3dml"], 44222 ["3ds", "image/x-3ds"], 44223 ["3g2", "video/3gpp2"], 44224 ["3gp", "video/3gp"], 44225 ["3gpp", "video/3gpp"], 44226 ["3mf", "model/3mf"], 44227 ["7z", "application/x-7z-compressed"], 44228 ["7zip", "application/x-7z-compressed"], 44229 ["123", "application/vnd.lotus-1-2-3"], 44230 ["aab", "application/x-authorware-bin"], 44231 ["aac", "audio/x-acc"], 44232 ["aam", "application/x-authorware-map"], 44233 ["aas", "application/x-authorware-seg"], 44234 ["abw", "application/x-abiword"], 44235 ["ac", "application/vnd.nokia.n-gage.ac+xml"], 44236 ["ac3", "audio/ac3"], 44237 ["acc", "application/vnd.americandynamics.acc"], 44238 ["ace", "application/x-ace-compressed"], 44239 ["acu", "application/vnd.acucobol"], 44240 ["acutc", "application/vnd.acucorp"], 44241 ["adp", "audio/adpcm"], 44242 ["aep", "application/vnd.audiograph"], 44243 ["afm", "application/x-font-type1"], 44244 ["afp", "application/vnd.ibm.modcap"], 44245 ["ahead", "application/vnd.ahead.space"], 44246 ["ai", "application/pdf"], 44247 ["aif", "audio/x-aiff"], 44248 ["aifc", "audio/x-aiff"], 44249 ["aiff", "audio/x-aiff"], 44250 ["air", "application/vnd.adobe.air-application-installer-package+zip"], 44251 ["ait", "application/vnd.dvb.ait"], 44252 ["ami", "application/vnd.amiga.ami"], 44253 ["amr", "audio/amr"], 44254 ["apk", "application/vnd.android.package-archive"], 44255 ["apng", "image/apng"], 44256 ["appcache", "text/cache-manifest"], 44257 ["application", "application/x-ms-application"], 44258 ["apr", "application/vnd.lotus-approach"], 44259 ["arc", "application/x-freearc"], 44260 ["arj", "application/x-arj"], 44261 ["asc", "application/pgp-signature"], 44262 ["asf", "video/x-ms-asf"], 44263 ["asm", "text/x-asm"], 44264 ["aso", "application/vnd.accpac.simply.aso"], 44265 ["asx", "video/x-ms-asf"], 44266 ["atc", "application/vnd.acucorp"], 44267 ["atom", "application/atom+xml"], 44268 ["atomcat", "application/atomcat+xml"], 44269 ["atomdeleted", "application/atomdeleted+xml"], 44270 ["atomsvc", "application/atomsvc+xml"], 44271 ["atx", "application/vnd.antix.game-component"], 44272 ["au", "audio/x-au"], 44273 ["avi", "video/x-msvideo"], 44274 ["avif", "image/avif"], 44275 ["aw", "application/applixware"], 44276 ["azf", "application/vnd.airzip.filesecure.azf"], 44277 ["azs", "application/vnd.airzip.filesecure.azs"], 44278 ["azv", "image/vnd.airzip.accelerator.azv"], 44279 ["azw", "application/vnd.amazon.ebook"], 44280 ["b16", "image/vnd.pco.b16"], 44281 ["bat", "application/x-msdownload"], 44282 ["bcpio", "application/x-bcpio"], 44283 ["bdf", "application/x-font-bdf"], 44284 ["bdm", "application/vnd.syncml.dm+wbxml"], 44285 ["bdoc", "application/x-bdoc"], 44286 ["bed", "application/vnd.realvnc.bed"], 44287 ["bh2", "application/vnd.fujitsu.oasysprs"], 44288 ["bin", "application/octet-stream"], 44289 ["blb", "application/x-blorb"], 44290 ["blorb", "application/x-blorb"], 44291 ["bmi", "application/vnd.bmi"], 44292 ["bmml", "application/vnd.balsamiq.bmml+xml"], 44293 ["bmp", "image/bmp"], 44294 ["book", "application/vnd.framemaker"], 44295 ["box", "application/vnd.previewsystems.box"], 44296 ["boz", "application/x-bzip2"], 44297 ["bpk", "application/octet-stream"], 44298 ["bpmn", "application/octet-stream"], 44299 ["bsp", "model/vnd.valve.source.compiled-map"], 44300 ["btif", "image/prs.btif"], 44301 ["buffer", "application/octet-stream"], 44302 ["bz", "application/x-bzip"], 44303 ["bz2", "application/x-bzip2"], 44304 ["c", "text/x-c"], 44305 ["c4d", "application/vnd.clonk.c4group"], 44306 ["c4f", "application/vnd.clonk.c4group"], 44307 ["c4g", "application/vnd.clonk.c4group"], 44308 ["c4p", "application/vnd.clonk.c4group"], 44309 ["c4u", "application/vnd.clonk.c4group"], 44310 ["c11amc", "application/vnd.cluetrust.cartomobile-config"], 44311 ["c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"], 44312 ["cab", "application/vnd.ms-cab-compressed"], 44313 ["caf", "audio/x-caf"], 44314 ["cap", "application/vnd.tcpdump.pcap"], 44315 ["car", "application/vnd.curl.car"], 44316 ["cat", "application/vnd.ms-pki.seccat"], 44317 ["cb7", "application/x-cbr"], 44318 ["cba", "application/x-cbr"], 44319 ["cbr", "application/x-cbr"], 44320 ["cbt", "application/x-cbr"], 44321 ["cbz", "application/x-cbr"], 44322 ["cc", "text/x-c"], 44323 ["cco", "application/x-cocoa"], 44324 ["cct", "application/x-director"], 44325 ["ccxml", "application/ccxml+xml"], 44326 ["cdbcmsg", "application/vnd.contact.cmsg"],
44327 ["cda", "application/x-cdf"], 44328 ["cdf", "application/x-netcdf"], 44329 ["cdfx", "application/cdfx+xml"], 44330 ["cdkey", "application/vnd.mediastation.cdkey"], 44331 ["cdmia", "application/cdmi-capability"], 44332 ["cdmic", "application/cdmi-container"], 44333 ["cdmid", "application/cdmi-domain"], 44334 ["cdmio", "application/cdmi-object"], 44335 ["cdmiq", "application/cdmi-queue"], 44336 ["cdr", "application/cdr"], 44337 ["cdx", "chemical/x-cdx"], 44338 ["cdxml", "application/vnd.chemdraw+xml"], 44339 ["cdy", "application/vnd.cinderella"], 44340 ["cer", "application/pkix-cert"], 44341 ["cfs", "application/x-cfs-compressed"], 44342 ["cgm", "image/cgm"], 44343 ["chat", "application/x-chat"], 44344 ["chm", "application/vnd.ms-htmlhelp"], 44345 ["chrt", "application/vnd.kde.kchart"], 44346 ["cif", "chemical/x-cif"], 44347 ["cii", "application/vnd.anser-web-certificate-issue-initiation"], 44348 ["cil", "application/vnd.ms-artgalry"], 44349 ["cjs", "application/node"], 44350 ["cla", "application/vnd.claymore"], 44351 ["class", "application/octet-stream"], 44352 ["clkk", "application/vnd.crick.clicker.keyboard"], 44353 ["clkp", "application/vnd.crick.clicker.palette"], 44354 ["clkt", "application/vnd.crick.clicker.template"], 44355 ["clkw", "application/vnd.crick.clicker.wordbank"], 44356 ["clkx", "application/vnd.crick.clicker"], 44357 ["clp", "application/x-msclip"], 44358 ["cmc", "application/vnd.cosmocaller"], 44359 ["cmdf", "chemical/x-cmdf"], 44360 ["cml", "chemical/x-cml"], 44361 ["cmp", "application/vnd.yellowriver-custom-menu"], 44362 ["cmx", "image/x-cmx"], 44363 ["cod", "application/vnd.rim.cod"], 44364 ["coffee", "text/coffeescript"], 44365 ["com", "application/x-msdownload"], 44366 ["conf", "text/plain"], 44367 ["cpio", "application/x-cpio"], 44368 ["cpp", "text/x-c"], 44369 ["cpt", "application/mac-compactpro"], 44370 ["crd", "application/x-mscardfile"], 44371 ["crl", "application/pkix-crl"], 44372 ["crt", "application/x-x509-ca-cert"], 44373 ["crx", "application/x-chrome-extension"], 44374 ["cryptonote", "application/vnd.rig.cryptonote"], 44375 ["csh", "application/x-csh"], 44376 ["csl", "application/vnd.citationstyles.style+xml"], 44377 ["csml", "chemical/x-csml"], 44378 ["csp", "application/vnd.commonspace"], 44379 ["csr", "application/octet-stream"], 44380 ["css", "text/css"], 44381 ["cst", "application/x-director"], 44382 ["csv", "text/csv"], 44383 ["cu", "application/cu-seeme"], 44384 ["curl", "text/vnd.curl"], 44385 ["cww", "application/prs.cww"], 44386 ["cxt", "application/x-director"], 44387 ["cxx", "text/x-c"], 44388 ["dae", "model/vnd.collada+xml"], 44389 ["daf", "application/vnd.mobius.daf"], 44390 ["dart", "application/vnd.dart"], 44391 ["dataless", "application/vnd.fdsn.seed"], 44392 ["davmount", "application/davmount+xml"], 44393 ["dbf", "application/vnd.dbf"], 44394 ["dbk", "application/docbook+xml"], 44395 ["dcr", "application/x-director"], 44396 ["dcurl", "text/vnd.curl.dcurl"], 44397 ["dd2", "application/vnd.oma.dd2+xml"], 44398 ["ddd", "application/vnd.fujixerox.ddd"], 44399 ["ddf", "application/vnd.syncml.dmddf+xml"], 44400 ["dds", "image/vnd.ms-dds"], 44401 ["deb", "application/x-debian-package"], 44402 ["def", "text/plain"], 44403 ["deploy", "application/octet-stream"], 44404 ["der", "application/x-x509-ca-cert"], 44405 ["dfac", "application/vnd.dreamfactory"], 44406 ["dgc", "application/x-dgc-compressed"], 44407 ["dic", "text/x-c"], 44408 ["dir", "application/x-director"], 44409 ["dis", "application/vnd.mobius.dis"], 44410 ["disposition-notification", "message/disposition-notification"], 44411 ["dist", "application/octet-stream"], 44412 ["distz", "application/octet-stream"], 44413 ["djv", "image/vnd.djvu"], 44414 ["djvu", "image/vnd.djvu"], 44415 ["dll", "application/octet-stream"], 44416 ["dmg", "application/x-apple-diskimage"], 44417 ["dmn", "application/octet-stream"], 44418 ["dmp", "application/vnd.tcpdump.pcap"], 44419 ["dms", "application/octet-stream"], 44420 ["dna", "application/vnd.dna"], 44421 ["doc", "application/msword"], 44422 ["docm", "application/vnd.ms-word.template.macroEnabled.12"], 44423 ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"], 44424 ["dot", "application/msword"], 44425 ["dotm", "application/vnd.ms-word.template.macroEnabled.12"], 44426 ["dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"], 44427 ["dp", "application/vnd.osgi.dp"], 44428 ["dpg", "application/vnd.dpgraph"], 44429 ["dra", "audio/vnd.dra"], 44430 ["drle", "image/dicom-rle"], 44431 ["dsc", "text/prs.lines.tag"], 44432 ["dssc", "application/dssc+der"], 44433 ["dtb", "application/x-dtbook+xml"], 44434 ["dtd", "application/xml-dtd"], 44435 ["dts", "audio/vnd.dts"], 44436 ["dtshd", "audio/vnd.dts.hd"], 44437 ["dump", "application/octet-stream"], 44438 ["dvb", "video/vnd.dvb.file"], 44439 ["dvi", "application/x-dvi"], 44440 ["dwd", "application/atsc-dwd+xml"], 44441 ["dwf", "model/vnd.dwf"], 44442 ["dwg", "image/vnd.dwg"], 44443 ["dxf", "image/vnd.dxf"], 44444 ["dxp", "application/vnd.spotfire.dxp"], 44445 ["dxr", "application/x-director"], 44446 ["ear", "application/java-archive"], 44447 ["ecelp4800", "audio/vnd.nuera.ecelp4800"], 44448 ["ecelp7470", "audio/vnd.nuera.ecelp7470"], 44449 ["ecelp9600", "audio/vnd.nuera.ecelp9600"], 44450 ["ecma", "application/ecmascript"], 44451 ["edm", "application/vnd.novadigm.edm"], 44452 ["edx", "application/vnd.novadigm.edx"], 44453 ["efif", "application/vnd.picsel"], 44454 ["ei6", "application/vnd.pg.osasli"], 44455 ["elc", "application/octet-stream"], 44456 ["emf", "image/emf"], 44457 ["eml", "message/rfc822"], 44458 ["emma", "application/emma+xml"], 44459 ["emotionml", "application/emotionml+xml"], 44460 ["emz", "application/x-msmetafile"], 44461 ["eol", "audio/vnd.digital-winds"], 44462 ["eot", "application/vnd.ms-fontobject"],
44463 ["eps", "application/postscript"], 44464 ["epub", "application/epub+zip"], 44465 ["es", "application/ecmascript"], 44466 ["es3", "application/vnd.eszigno3+xml"], 44467 ["esa", "application/vnd.osgi.subsystem"], 44468 ["esf", "application/vnd.epson.esf"], 44469 ["et3", "application/vnd.eszigno3+xml"], 44470 ["etx", "text/x-setext"], 44471 ["eva", "application/x-eva"], 44472 ["evy", "application/x-envoy"], 44473 ["exe", "application/octet-stream"], 44474 ["exi", "application/exi"], 44475 ["exp", "application/express"], 44476 ["exr", "image/aces"], 44477 ["ext", "application/vnd.novadigm.ext"], 44478 ["ez", "application/andrew-inset"], 44479 ["ez2", "application/vnd.ezpix-album"], 44480 ["ez3", "application/vnd.ezpix-package"], 44481 ["f", "text/x-fortran"], 44482 ["f4v", "video/mp4"], 44483 ["f77", "text/x-fortran"], 44484 ["f90", "text/x-fortran"], 44485 ["fbs", "image/vnd.fastbidsheet"], 44486 ["fcdt", "application/vnd.adobe.formscentral.fcdt"], 44487 ["fcs", "application/vnd.isac.fcs"], 44488 ["fdf", "application/vnd.fdf"], 44489 ["fdt", "application/fdt+xml"], 44490 ["fe_launch", "application/vnd.denovo.fcselayout-link"], 44491 ["fg5", "application/vnd.fujitsu.oasysgp"], 44492 ["fgd", "application/x-director"], 44493 ["fh", "image/x-freehand"], 44494 ["fh4", "image/x-freehand"], 44495 ["fh5", "image/x-freehand"], 44496 ["fh7", "image/x-freehand"], 44497 ["fhc", "image/x-freehand"], 44498 ["fig", "application/x-xfig"], 44499 ["fits", "image/fits"], 44500 ["flac", "audio/x-flac"], 44501 ["fli", "video/x-fli"], 44502 ["flo", "application/vnd.micrografx.flo"], 44503 ["flv", "video/x-flv"], 44504 ["flw", "application/vnd.kde.kivio"], 44505 ["flx", "text/vnd.fmi.flexstor"], 44506 ["fly", "text/vnd.fly"], 44507 ["fm", "application/vnd.framemaker"], 44508 ["fnc", "application/vnd.frogans.fnc"], 44509 ["fo", "application/vnd.software602.filler.form+xml"], 44510 ["for", "text/x-fortran"], 44511 ["fpx", "image/vnd.fpx"], 44512 ["frame", "application/vnd.framemaker"], 44513 ["fsc", "application/vnd.fsc.weblaunch"], 44514 ["fst", "image/vnd.fst"], 44515 ["ftc", "application/vnd.fluxtime.clip"], 44516 ["fti", "application/vnd.anser-web-funds-transfer-initiation"], 44517 ["fvt", "video/vnd.fvt"], 44518 ["fxp", "application/vnd.adobe.fxp"], 44519 ["fxpl", "application/vnd.adobe.fxp"], 44520 ["fzs", "application/vnd.fuzzysheet"], 44521 ["g2w", "application/vnd.geoplan"], 44522 ["g3", "image/g3fax"], 44523 ["g3w", "application/vnd.geospace"], 44524 ["gac", "application/vnd.groove-account"], 44525 ["gam", "application/x-tads"], 44526 ["gbr", "application/rpki-ghostbusters"], 44527 ["gca", "application/x-gca-compressed"], 44528 ["gdl", "model/vnd.gdl"], 44529 ["gdoc", "application/vnd.google-apps.document"], 44530 ["geo", "application/vnd.dynageo"], 44531 ["geojson", "application/geo+json"], 44532 ["gex", "application/vnd.geometry-explorer"], 44533 ["ggb", "application/vnd.geogebra.file"], 44534 ["ggt", "application/vnd.geogebra.tool"], 44535 ["ghf", "application/vnd.groove-help"], 44536 ["gif", "image/gif"], 44537 ["gim", "application/vnd.groove-identity-message"], 44538 ["glb", "model/gltf-binary"], 44539 ["gltf", "model/gltf+json"], 44540 ["gml", "application/gml+xml"], 44541 ["gmx", "application/vnd.gmx"], 44542 ["gnumeric", "application/x-gnumeric"], 44543 ["gpg", "application/gpg-keys"], 44544 ["gph", "application/vnd.flographit"], 44545 ["gpx", "application/gpx+xml"], 44546 ["gqf", "application/vnd.grafeq"], 44547 ["gqs", "application/vnd.grafeq"], 44548 ["gram", "application/srgs"], 44549 ["gramps", "application/x-gramps-xml"], 44550 ["gre", "application/vnd.geometry-explorer"], 44551 ["grv", "application/vnd.groove-injector"], 44552 ["grxml", "application/srgs+xml"], 44553 ["gsf", "application/x-font-ghostscript"], 44554 ["gsheet", "application/vnd.google-apps.spreadsheet"], 44555 ["gslides", "application/vnd.google-apps.presentation"], 44556 ["gtar", "application/x-gtar"], 44557 ["gtm", "application/vnd.groove-tool-message"], 44558 ["gtw", "model/vnd.gtw"], 44559 ["gv", "text/vnd.graphviz"], 44560 ["gxf", "application/gxf"], 44561 ["gxt", "application/vnd.geonext"], 44562 ["gz", "application/gzip"], 44563 ["gzip", "application/gzip"], 44564 ["h", "text/x-c"], 44565 ["h261", "video/h261"], 44566 ["h263", "video/h263"], 44567 ["h264", "video/h264"], 44568 ["hal", "application/vnd.hal+xml"], 44569 ["hbci", "application/vnd.hbci"], 44570 ["hbs", "text/x-handlebars-template"], 44571 ["hdd", "application/x-virtualbox-hdd"], 44572 ["hdf", "application/x-hdf"], 44573 ["heic", "image/heic"], 44574 ["heics", "image/heic-sequence"], 44575 ["heif", "image/heif"],
44576 ["heifs", "image/heif-sequence"], 44577 ["hej2", "image/hej2k"], 44578 ["held", "application/atsc-held+xml"], 44579 ["hh", "text/x-c"], 44580 ["hjson", "application/hjson"], 44581 ["hlp", "application/winhlp"], 44582 ["hpgl", "application/vnd.hp-hpgl"], 44583 ["hpid", "application/vnd.hp-hpid"], 44584 ["hps", "application/vnd.hp-hps"], 44585 ["hqx", "application/mac-binhex40"], 44586 ["hsj2", "image/hsj2"], 44587 ["htc", "text/x-component"], 44588 ["htke", "application/vnd.kenameaapp"], 44589 ["htm", "text/html"], 44590 ["html", "text/html"], 44591 ["hvd", "application/vnd.yamaha.hv-dic"], 44592 ["hvp", "application/vnd.yamaha.hv-voice"], 44593 ["hvs", "application/vnd.yamaha.hv-script"], 44594 ["i2g", "application/vnd.intergeo"], 44595 ["icc", "application/vnd.iccprofile"], 44596 ["ice", "x-conference/x-cooltalk"], 44597 ["icm", "application/vnd.iccprofile"], 44598 ["ico", "image/x-icon"], 44599 ["ics", "text/calendar"], 44600 ["ief", "image/ief"], 44601 ["ifb", "text/calendar"], 44602 ["ifm", "application/vnd.shana.informed.formdata"], 44603 ["iges", "model/iges"], 44604 ["igl", "application/vnd.igloader"], 44605 ["igm", "application/vnd.insors.igm"], 44606 ["igs", "model/iges"], 44607 ["igx", "application/vnd.micrografx.igx"], 44608 ["iif", "application/vnd.shana.informed.interchange"], 44609 ["img", "application/octet-stream"], 44610 ["imp", "application/vnd.accpac.simply.imp"], 44611 ["ims", "application/vnd.ms-ims"], 44612 ["in", "text/plain"], 44613 ["ini", "text/plain"], 44614 ["ink", "application/inkml+xml"], 44615 ["inkml", "application/inkml+xml"], 44616 ["install", "application/x-install-instructions"], 44617 ["iota", "application/vnd.astraea-software.iota"], 44618 ["ipfix", "application/ipfix"], 44619 ["ipk", "application/vnd.shana.informed.package"], 44620 ["irm", "application/vnd.ibm.rights-management"], 44621 ["irp", "application/vnd.irepository.package+xml"], 44622 ["iso", "application/x-iso9660-image"], 44623 ["itp", "application/vnd.shana.informed.formtemplate"], 44624 ["its", "application/its+xml"], 44625 ["ivp", "application/vnd.immervision-ivp"], 44626 ["ivu", "application/vnd.immervision-ivu"], 44627 ["jad", "text/vnd.sun.j2me.app-descriptor"], 44628 ["jade", "text/jade"], 44629 ["jam", "application/vnd.jam"], 44630 ["jar", "application/java-archive"], 44631 ["jardiff", "application/x-java-archive-diff"], 44632 ["java", "text/x-java-source"], 44633 ["jhc", "image/jphc"], 44634 ["jisp", "application/vnd.jisp"], 44635 ["jls", "image/jls"], 44636 ["jlt", "application/vnd.hp-jlyt"], 44637 ["jng", "image/x-jng"], 44638 ["jnlp", "application/x-java-jnlp-file"], 44639 ["joda", "application/vnd.joost.joda-archive"], 44640 ["jp2", "image/jp2"], 44641 ["jpe", "image/jpeg"], 44642 ["jpeg", "image/jpeg"], 44643 ["jpf", "image/jpx"], 44644 ["jpg", "image/jpeg"], 44645 ["jpg2", "image/jp2"], 44646 ["jpgm", "video/jpm"], 44647 ["jpgv", "video/jpeg"], 44648 ["jph", "image/jph"], 44649 ["jpm", "video/jpm"], 44650 ["jpx", "image/jpx"], 44651 ["js", "application/javascript"], 44652 ["json", "application/json"], 44653 ["json5", "application/json5"], 44654 ["jsonld", "application/ld+json"], 44655 // https://jsonlines.org/ 44656 ["jsonl", "application/jsonl"], 44657 ["jsonml", "application/jsonml+json"], 44658 ["jsx", "text/jsx"], 44659 ["jxr", "image/jxr"], 44660 ["jxra", "image/jxra"], 44661 ["jxrs", "image/jxrs"], 44662 ["jxs", "image/jxs"], 44663 ["jxsc", "image/jxsc"], 44664 ["jxsi", "image/jxsi"], 44665 ["jxss", "image/jxss"], 44666 ["kar", "audio/midi"], 44667 ["karbon", "application/vnd.kde.karbon"], 44668 ["kdb", "application/octet-stream"], 44669 ["kdbx", "application/x-keepass2"], 44670 ["key", "application/x-iwork-keynote-sffkey"], 44671 ["kfo", "application/vnd.kde.kformula"], 44672 ["kia", "application/vnd.kidspiration"], 44673 ["kml", "application/vnd.google-earth.kml+xml"], 44674 ["kmz", "application/vnd.google-earth.kmz"], 44675 ["kne", "application/vnd.kinar"], 44676 ["knp", "application/vnd.kinar"], 44677 ["kon", "application/vnd.kde.kontour"], 44678 ["kpr", "application/vnd.kde.kpresenter"], 44679 ["kpt", "application/vnd.kde.kpresenter"], 44680 ["kpxx", "application/vnd.ds-keypoint"], 44681 ["ksp", "application/vnd.kde.kspread"], 44682 ["ktr", "application/vnd.kahootz"], 44683 ["ktx", "image/ktx"], 44684 ["ktx2", "image/ktx2"], 44685 ["ktz", "application/vnd.kahootz"], 44686 ["kwd", "application/vnd.kde.kword"], 44687 ["kwt", "application/vnd.kde.kword"], 44688 ["lasxml", "application/vnd.las.las+xml"], 44689 ["latex", "application/x-latex"], 44690 ["lbd", "application/vnd.llamagraphics.life-balance.desktop"], 44691 ["lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"], 44692 ["les", "application/vnd.hhe.lesson-player"], 44693 ["less", "text/less"], 44694 ["lgr", "application/lgr+xml"], 44695 ["lha", "application/octet-stream"], 44696 ["link66", "application/vnd.route66.link66+xml"], 44697 ["list", "text/plain"], 44698 ["list3820", "application/vnd.ibm.modcap"], 44699 ["listafp", "application/vnd.ibm.modcap"], 44700 ["litcoffee", "text/coffeescript"], 44701 ["lnk", "application/x-ms-shortcut"], 44702 ["log", "text/plain"], 44703 ["lostxml", "application/lost+xml"], 44704 ["lrf", "application/octet-stream"], 44705 ["lrm", "application/vnd.ms-lrm"], 44706 ["ltf", "application/vnd.frogans.ltf"], 44707 ["lua", "text/x-lua"], 44708 ["luac", "application/x-lua-bytecode"], 44709 ["lvp", "audio/vnd.lucent.voice"], 44710 ["lwp", "application/vnd.lotus-wordpro"], 44711 ["lzh", "application/octet-stream"], 44712 ["m1v", "video/mpeg"], 44713 ["m2a", "audio/mpeg"], 44714 ["m2v", "video/mpeg"], 44715 ["m3a", "audio/mpeg"], 44716 ["m3u", "text/plain"], 44717 ["m3u8", "application/vnd.apple.mpegurl"], 44718 ["m4a", "audio/x-m4a"], 44719 ["m4p", "application/mp4"], 44720 ["m4s", "video/iso.segment"], 44721 ["m4u", "application/vnd.mpegurl"], 44722 ["m4v", "video/x-m4v"], 44723 ["m13", "application/x-msmediaview"], 44724 ["m14", "application/x-msmediaview"], 44725 ["m21", "application/mp21"], 44726 ["ma", "application/mathematica"], 44727 ["mads", "application/mads+xml"], 44728 ["maei", "application/mmt-aei+xml"], 44729 ["mag", "application/vnd.ecowin.chart"], 44730 ["maker", "application/vnd.framemaker"], 44731 ["man", "text/troff"], 44732 ["manifest", "text/cache-manifest"], 44733 ["map", "application/json"], 44734 ["mar", "application/octet-stream"], 44735 ["markdown", "text/markdown"], 44736 ["mathml", "application/mathml+xml"], 44737 ["mb", "application/mathematica"], 44738 ["mbk", "application/vnd.mobius.mbk"], 44739 ["mbox", "application/mbox"], 44740 ["mc1", "application/vnd.medcalcdata"], 44741 ["mcd", "application/vnd.mcd"], 44742 ["mcurl", "text/vnd.curl.mcurl"], 44743 ["md", "text/markdown"], 44744 ["mdb", "application/x-msaccess"], 44745 ["mdi", "image/vnd.ms-modi"], 44746 ["mdx", "text/mdx"], 44747 ["me", "text/troff"], 44748 ["mesh", "model/mesh"], 44749 ["meta4", "application/metalink4+xml"], 44750 ["metalink", "application/metalink+xml"], 44751 ["mets", "application/mets+xml"], 44752 ["mfm", "application/vnd.mfmp"], 44753 ["mft", "application/rpki-manifest"], 44754 ["mgp", "application/vnd.osgeo.mapguide.package"], 44755 ["mgz", "application/vnd.proteus.magazine"], 44756 ["mid", "audio/midi"], 44757 ["midi", "audio/midi"], 44758 ["mie", "application/x-mie"], 44759 ["mif", "application/vnd.mif"], 44760 ["mime", "message/rfc822"], 44761 ["mj2", "video/mj2"], 44762 ["mjp2", "video/mj2"], 44763 ["mjs", "application/javascript"], 44764 ["mk3d", "video/x-matroska"], 44765 ["mka", "audio/x-matroska"], 44766 ["mkd", "text/x-markdown"], 44767 ["mks", "video/x-matroska"], 44768 ["mkv", "video/x-matroska"], 44769 ["mlp", "application/vnd.dolby.mlp"], 44770 ["mmd", "application/vnd.chipnuts.karaoke-mmd"], 44771 ["mmf", "application/vnd.smaf"], 44772 ["mml", "text/mathml"],
44773 ["mmr", "image/vnd.fujixerox.edmics-mmr"], 44774 ["mng", "video/x-mng"], 44775 ["mny", "application/x-msmoney"], 44776 ["mobi", "application/x-mobipocket-ebook"], 44777 ["mods", "application/mods+xml"], 44778 ["mov", "video/quicktime"], 44779 ["movie", "video/x-sgi-movie"], 44780 ["mp2", "audio/mpeg"], 44781 ["mp2a", "audio/mpeg"], 44782 ["mp3", "audio/mpeg"], 44783 ["mp4", "video/mp4"], 44784 ["mp4a", "audio/mp4"], 44785 ["mp4s", "application/mp4"], 44786 ["mp4v", "video/mp4"], 44787 ["mp21", "application/mp21"], 44788 ["mpc", "application/vnd.mophun.certificate"], 44789 ["mpd", "application/dash+xml"], 44790 ["mpe", "video/mpeg"], 44791 ["mpeg", "video/mpeg"], 44792 ["mpg", "video/mpeg"], 44793 ["mpg4", "video/mp4"], 44794 ["mpga", "audio/mpeg"], 44795 ["mpkg", "application/vnd.apple.installer+xml"], 44796 ["mpm", "application/vnd.blueice.multipass"], 44797 ["mpn", "application/vnd.mophun.application"], 44798 ["mpp", "application/vnd.ms-project"], 44799 ["mpt", "application/vnd.ms-project"], 44800 ["mpy", "application/vnd.ibm.minipay"], 44801 ["mqy", "application/vnd.mobius.mqy"], 44802 ["mrc", "application/marc"], 44803 ["mrcx", "application/marcxml+xml"], 44804 ["ms", "text/troff"], 44805 ["mscml", "application/mediaservercontrol+xml"], 44806 ["mseed", "application/vnd.fdsn.mseed"], 44807 ["mseq", "application/vnd.mseq"], 44808 ["msf", "application/vnd.epson.msf"], 44809 ["msg", "application/vnd.ms-outlook"], 44810 ["msh", "model/mesh"], 44811 ["msi", "application/x-msdownload"], 44812 ["msl", "application/vnd.mobius.msl"], 44813 ["msm", "application/octet-stream"], 44814 ["msp", "application/octet-stream"], 44815 ["msty", "application/vnd.muvee.style"], 44816 ["mtl", "model/mtl"], 44817 ["mts", "model/vnd.mts"], 44818 ["mus", "application/vnd.musician"], 44819 ["musd", "application/mmt-usd+xml"], 44820 ["musicxml", "application/vnd.recordare.musicxml+xml"], 44821 ["mvb", "application/x-msmediaview"], 44822 ["mvt", "application/vnd.mapbox-vector-tile"], 44823 ["mwf", "application/vnd.mfer"], 44824 ["mxf", "application/mxf"], 44825 ["mxl", "application/vnd.recordare.musicxml"], 44826 ["mxmf", "audio/mobile-xmf"], 44827 ["mxml", "application/xv+xml"], 44828 ["mxs", "application/vnd.triscape.mxs"], 44829 ["mxu", "video/vnd.mpegurl"], 44830 ["n-gage", "application/vnd.nokia.n-gage.symbian.install"], 44831 ["n3", "text/n3"], 44832 ["nb", "application/mathematica"], 44833 ["nbp", "application/vnd.wolfram.player"], 44834 ["nc", "application/x-netcdf"],
44835 ["ncx", "application/x-dtbncx+xml"], 44836 ["nfo", "text/x-nfo"], 44837 ["ngdat", "application/vnd.nokia.n-gage.data"], 44838 ["nitf", "application/vnd.nitf"], 44839 ["nlu", "application/vnd.neurolanguage.nlu"], 44840 ["nml", "application/vnd.enliven"], 44841 ["nnd", "application/vnd.noblenet-directory"], 44842 ["nns", "application/vnd.noblenet-sealer"], 44843 ["nnw", "application/vnd.noblenet-web"], 44844 ["npx", "image/vnd.net-fpx"], 44845 ["nq", "application/n-quads"], 44846 ["nsc", "application/x-conference"], 44847 ["nsf", "application/vnd.lotus-notes"], 44848 ["nt", "application/n-triples"], 44849 ["ntf", "application/vnd.nitf"], 44850 ["numbers", "application/x-iwork-numbers-sffnumbers"], 44851 ["nzb", "application/x-nzb"], 44852 ["oa2", "application/vnd.fujitsu.oasys2"], 44853 ["oa3", "application/vnd.fujitsu.oasys3"], 44854 ["oas", "application/vnd.fujitsu.oasys"], 44855 ["obd", "application/x-msbinder"], 44856 ["obgx", "application/vnd.openblox.game+xml"], 44857 ["obj", "model/obj"], 44858 ["oda", "application/oda"], 44859 ["odb", "application/vnd.oasis.opendocument.database"], 44860 ["odc", "application/vnd.oasis.opendocument.chart"], 44861 ["odf", "application/vnd.oasis.opendocument.formula"], 44862 ["odft", "application/vnd.oasis.opendocument.formula-template"], 44863 ["odg", "application/vnd.oasis.opendocument.graphics"], 44864 ["odi", "application/vnd.oasis.opendocument.image"], 44865 ["odm", "application/vnd.oasis.opendocument.text-master"], 44866 ["odp", "application/vnd.oasis.opendocument.presentation"], 44867 ["ods", "application/vnd.oasis.opendocument.spreadsheet"], 44868 ["odt", "application/vnd.oasis.opendocument.text"], 44869 ["oga", "audio/ogg"], 44870 ["ogex", "model/vnd.opengex"], 44871 ["ogg", "audio/ogg"], 44872 ["ogv", "video/ogg"], 44873 ["ogx", "application/ogg"], 44874 ["omdoc", "application/omdoc+xml"], 44875 ["onepkg", "application/onenote"], 44876 ["onetmp", "application/onenote"], 44877 ["onetoc", "application/onenote"], 44878 ["onetoc2", "application/onenote"], 44879 ["opf", "application/oebps-package+xml"], 44880 ["opml", "text/x-opml"], 44881 ["oprc", "application/vnd.palm"], 44882 ["opus", "audio/ogg"], 44883 ["org", "text/x-org"], 44884 ["osf", "application/vnd.yamaha.openscoreformat"], 44885 ["osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml"], 44886 ["osm", "application/vnd.openstreetmap.data+xml"], 44887 ["otc", "application/vnd.oasis.opendocument.chart-template"], 44888 ["otf", "font/otf"], 44889 ["otg", "application/vnd.oasis.opendocument.graphics-template"], 44890 ["oth", "application/vnd.oasis.opendocument.text-web"], 44891 ["oti", "application/vnd.oasis.opendocument.image-template"], 44892 ["otp", "application/vnd.oasis.opendocument.presentation-template"], 44893 ["ots", "application/vnd.oasis.opendocument.spreadsheet-template"], 44894 ["ott", "application/vnd.oasis.opendocument.text-template"], 44895 ["ova", "application/x-virtualbox-ova"], 44896 ["ovf", "application/x-virtualbox-ovf"], 44897 ["owl", "application/rdf+xml"], 44898 ["oxps", "application/oxps"], 44899 ["oxt", "application/vnd.openofficeorg.extension"], 44900 ["p", "text/x-pascal"], 44901 ["p7a", "application/x-pkcs7-signature"], 44902 ["p7b", "application/x-pkcs7-certificates"], 44903 ["p7c", "application/pkcs7-mime"], 44904 ["p7m", "application/pkcs7-mime"], 44905 ["p7r", "application/x-pkcs7-certreqresp"], 44906 ["p7s", "application/pkcs7-signature"], 44907 ["p8", "application/pkcs8"], 44908 ["p10", "application/x-pkcs10"], 44909 ["p12", "application/x-pkcs12"], 44910 ["pac", "application/x-ns-proxy-autoconfig"], 44911 ["pages", "application/x-iwork-pages-sffpages"], 44912 ["pas", "text/x-pascal"], 44913 ["paw", "application/vnd.pawaafile"], 44914 ["pbd", "application/vnd.powerbuilder6"], 44915 ["pbm", "image/x-portable-bitmap"], 44916 ["pcap", "application/vnd.tcpdump.pcap"], 44917 ["pcf", "application/x-font-pcf"], 44918 ["pcl", "application/vnd.hp-pcl"], 44919 ["pclxl", "application/vnd.hp-pclxl"], 44920 ["pct", "image/x-pict"], 44921 ["pcurl", "application/vnd.curl.pcurl"], 44922 ["pcx", "image/x-pcx"], 44923 ["pdb", "application/x-pilot"], 44924 ["pde", "text/x-processing"], 44925 ["pdf", "application/pdf"],
44926 ["pem", "application/x-x509-user-cert"], 44927 ["pfa", "application/x-font-type1"], 44928 ["pfb", "application/x-font-type1"], 44929 ["pfm", "application/x-font-type1"], 44930 ["pfr", "application/font-tdpfr"], 44931 ["pfx", "application/x-pkcs12"], 44932 ["pgm", "image/x-portable-graymap"], 44933 ["pgn", "application/x-chess-pgn"], 44934 ["pgp", "application/pgp"], 44935 ["php", "application/x-httpd-php"], 44936 ["php3", "application/x-httpd-php"], 44937 ["php4", "application/x-httpd-php"], 44938 ["phps", "application/x-httpd-php-source"], 44939 ["phtml", "application/x-httpd-php"], 44940 ["pic", "image/x-pict"], 44941 ["pkg", "application/octet-stream"], 44942 ["pki", "application/pkixcmp"], 44943 ["pkipath", "application/pkix-pkipath"], 44944 ["pkpass", "application/vnd.apple.pkpass"], 44945 ["pl", "application/x-perl"], 44946 ["plb", "application/vnd.3gpp.pic-bw-large"], 44947 ["plc", "application/vnd.mobius.plc"], 44948 ["plf", "application/vnd.pocketlearn"], 44949 ["pls", "application/pls+xml"], 44950 ["pm", "application/x-perl"], 44951 ["pml", "application/vnd.ctc-posml"], 44952 ["png", "image/png"], 44953 ["pnm", "image/x-portable-anymap"], 44954 ["portpkg", "application/vnd.macports.portpkg"], 44955 ["pot", "application/vnd.ms-powerpoint"], 44956 ["potm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"], 44957 ["potx", "application/vnd.openxmlformats-officedocument.presentationml.template"], 44958 ["ppa", "application/vnd.ms-powerpoint"], 44959 ["ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"], 44960 ["ppd", "application/vnd.cups-ppd"], 44961 ["ppm", "image/x-portable-pixmap"], 44962 ["pps", "application/vnd.ms-powerpoint"], 44963 ["ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"], 44964 ["ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"], 44965 ["ppt", "application/powerpoint"], 44966 ["pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"], 44967 ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"], 44968 ["pqa", "application/vnd.palm"], 44969 ["prc", "application/x-pilot"], 44970 ["pre", "application/vnd.lotus-freelance"], 44971 ["prf", "application/pics-rules"], 44972 ["provx", "application/provenance+xml"], 44973 ["ps", "application/postscript"], 44974 ["psb", "application/vnd.3gpp.pic-bw-small"], 44975 ["psd", "application/x-photoshop"], 44976 ["psf", "application/x-font-linux-psf"], 44977 ["pskcxml", "application/pskc+xml"], 44978 ["pti", "image/prs.pti"], 44979 ["ptid", "application/vnd.pvi.ptid1"], 44980 ["pub", "application/x-mspublisher"], 44981 ["pvb", "application/vnd.3gpp.pic-bw-var"], 44982 ["pwn", "application/vnd.3m.post-it-notes"], 44983 ["pya", "audio/vnd.ms-playready.media.pya"], 44984 ["pyv", "video/vnd.ms-playready.media.pyv"], 44985 ["qam", "application/vnd.epson.quickanime"], 44986 ["qbo", "application/vnd.intu.qbo"], 44987 ["qfx", "application/vnd.intu.qfx"], 44988 ["qps", "application/vnd.publishare-delta-tree"], 44989 ["qt", "video/quicktime"], 44990 ["qwd", "application/vnd.quark.quarkxpress"], 44991 ["qwt", "application/vnd.quark.quarkxpress"], 44992 ["qxb", "application/vnd.quark.quarkxpress"], 44993 ["qxd", "application/vnd.quark.quarkxpress"], 44994 ["qxl", "application/vnd.quark.quarkxpress"], 44995 ["qxt", "application/vnd.quark.quarkxpress"], 44996 ["ra", "audio/x-realaudio"], 44997 ["ram", "audio/x-pn-realaudio"], 44998 ["raml", "application/raml+yaml"], 44999 ["rapd", "application/route-apd+xml"], 45000 ["rar", "application/x-rar"], 45001 ["ras", "image/x-cmu-raster"], 45002 ["rcprofile", "application/vnd.ipunplugged.rcprofile"], 45003 ["rdf", "application/rdf+xml"], 45004 ["rdz", "application/vnd.data-vision.rdz"], 45005 ["relo", "application/p2p-overlay+xml"], 45006 ["rep", "application/vnd.businessobjects"], 45007 ["res", "application/x-dtbresource+xml"], 45008 ["rgb", "image/x-rgb"], 45009 ["rif", "application/reginfo+xml"], 45010 ["rip", "audio/vnd.rip"], 45011 ["ris", "application/x-research-info-systems"], 45012 ["rl", "application/resource-lists+xml"], 45013 ["rlc", "image/vnd.fujixerox.edmics-rlc"], 45014 ["rld", "application/resource-lists-diff+xml"], 45015 ["rm", "audio/x-pn-realaudio"], 45016 ["rmi", "audio/midi"], 45017 ["rmp", "audio/x-pn-realaudio-plugin"], 45018 ["rms", "application/vnd.jcp.javame.midlet-rms"], 45019 ["rmvb", "application/vnd.rn-realmedia-vbr"], 45020 ["rnc", "application/relax-ng-compact-syntax"], 45021 ["rng", "application/xml"], 45022 ["roa", "application/rpki-roa"], 45023 ["roff", "text/troff"], 45024 ["rp9", "application/vnd.cloanto.rp9"], 45025 ["rpm", "audio/x-pn-realaudio-plugin"], 45026 ["rpss", "application/vnd.nokia.radio-presets"], 45027 ["rpst", "application/vnd.nokia.radio-preset"], 45028 ["rq", "application/sparql-query"], 45029 ["rs", "application/rls-services+xml"], 45030 ["rsa", "application/x-pkcs7"], 45031 ["rsat", "application/atsc-rsat+xml"], 45032 ["rsd", "application/rsd+xml"], 45033 ["rsheet", "application/urc-ressheet+xml"], 45034 ["rss", "application/rss+xml"], 45035 ["rtf", "text/rtf"], 45036 ["rtx", "text/richtext"], 45037 ["run", "application/x-makeself"], 45038 ["rusd", "application/route-usd+xml"], 45039 ["rv", "video/vnd.rn-realvideo"], 45040 ["s", "text/x-asm"], 45041 ["s3m", "audio/s3m"], 45042 ["saf", "application/vnd.yamaha.smaf-audio"], 45043 ["sass", "text/x-sass"], 45044 ["sbml", "application/sbml+xml"], 45045 ["sc", "application/vnd.ibm.secure-container"], 45046 ["scd", "application/x-msschedule"], 45047 ["scm", "application/vnd.lotus-screencam"], 45048 ["scq", "application/scvp-cv-request"], 45049 ["scs", "application/scvp-cv-response"], 45050 ["scss", "text/x-scss"], 45051 ["scurl", "text/vnd.curl.scurl"], 45052 ["sda", "application/vnd.stardivision.draw"], 45053 ["sdc", "application/vnd.stardivision.calc"], 45054 ["sdd", "application/vnd.stardivision.impress"], 45055 ["sdkd", "application/vnd.solent.sdkm+xml"], 45056 ["sdkm", "application/vnd.solent.sdkm+xml"], 45057 ["sdp", "application/sdp"], 45058 ["sdw", "application/vnd.stardivision.writer"], 45059 ["sea", "application/octet-stream"], 45060 ["see", "application/vnd.seemail"], 45061 ["seed", "application/vnd.fdsn.seed"], 45062 ["sema", "application/vnd.sema"], 45063 ["semd", "application/vnd.semd"], 45064 ["semf", "application/vnd.semf"], 45065 ["senmlx", "application/senml+xml"], 45066 ["sensmlx", "application/sensml+xml"], 45067 ["ser", "application/java-serialized-object"],
45068 ["setpay", "application/set-payment-initiation"], 45069 ["setreg", "application/set-registration-initiation"], 45070 ["sfd-hdstx", "application/vnd.hydrostatix.sof-data"], 45071 ["sfs", "application/vnd.spotfire.sfs"], 45072 ["sfv", "text/x-sfv"], 45073 ["sgi", "image/sgi"], 45074 ["sgl", "application/vnd.stardivision.writer-global"], 45075 ["sgm", "text/sgml"], 45076 ["sgml", "text/sgml"], 45077 ["sh", "application/x-sh"], 45078 ["shar", "application/x-shar"], 45079 ["shex", "text/shex"], 45080 ["shf", "application/shf+xml"], 45081 ["shtml", "text/html"], 45082 ["sid", "image/x-mrsid-image"], 45083 ["sieve", "application/sieve"], 45084 ["sig", "application/pgp-signature"], 45085 ["sil", "audio/silk"], 45086 ["silo", "model/mesh"], 45087 ["sis", "application/vnd.symbian.install"], 45088 ["sisx", "application/vnd.symbian.install"], 45089 ["sit", "application/x-stuffit"], 45090 ["sitx", "application/x-stuffitx"], 45091 ["siv", "application/sieve"], 45092 ["skd", "application/vnd.koan"], 45093 ["skm", "application/vnd.koan"], 45094 ["skp", "application/vnd.koan"], 45095 ["skt", "application/vnd.koan"], 45096 ["sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12"], 45097 ["sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"], 45098 ["slim", "text/slim"], 45099 ["slm", "text/slim"], 45100 ["sls", "application/route-s-tsid+xml"], 45101 ["slt", "application/vnd.epson.salt"], 45102 ["sm", "application/vnd.stepmania.stepchart"], 45103 ["smf", "application/vnd.stardivision.math"], 45104 ["smi", "application/smil"], 45105 ["smil", "application/smil"], 45106 ["smv", "video/x-smv"], 45107 ["smzip", "application/vnd.stepmania.package"], 45108 ["snd", "audio/basic"], 45109 ["snf", "application/x-font-snf"], 45110 ["so", "application/octet-stream"], 45111 ["spc", "application/x-pkcs7-certificates"], 45112 ["spdx", "text/spdx"], 45113 ["spf", "application/vnd.yamaha.smaf-phrase"], 45114 ["spl", "application/x-futuresplash"], 45115 ["spot", "text/vnd.in3d.spot"], 45116 ["spp", "application/scvp-vp-response"], 45117 ["spq", "application/scvp-vp-request"], 45118 ["spx", "audio/ogg"], 45119 ["sql", "application/x-sql"], 45120 ["src", "application/x-wais-source"], 45121 ["srt", "application/x-subrip"], 45122 ["sru", "application/sru+xml"], 45123 ["srx", "application/sparql-results+xml"], 45124 ["ssdl", "application/ssdl+xml"], 45125 ["sse", "application/vnd.kodak-descriptor"], 45126 ["ssf", "application/vnd.epson.ssf"], 45127 ["ssml", "application/ssml+xml"], 45128 ["sst", "application/octet-stream"], 45129 ["st", "application/vnd.sailingtracker.track"], 45130 ["stc", "application/vnd.sun.xml.calc.template"], 45131 ["std", "application/vnd.sun.xml.draw.template"], 45132 ["stf", "application/vnd.wt.stf"], 45133 ["sti", "application/vnd.sun.xml.impress.template"], 45134 ["stk", "application/hyperstudio"], 45135 ["stl", "model/stl"], 45136 ["stpx", "model/step+xml"], 45137 ["stpxz", "model/step-xml+zip"], 45138 ["stpz", "model/step+zip"], 45139 ["str", "application/vnd.pg.format"], 45140 ["stw", "application/vnd.sun.xml.writer.template"], 45141 ["styl", "text/stylus"], 45142 ["stylus", "text/stylus"], 45143 ["sub", "text/vnd.dvb.subtitle"], 45144 ["sus", "application/vnd.sus-calendar"], 45145 ["susp", "application/vnd.sus-calendar"], 45146 ["sv4cpio", "application/x-sv4cpio"], 45147 ["sv4crc", "application/x-sv4crc"], 45148 ["svc", "application/vnd.dvb.service"], 45149 ["svd", "application/vnd.svd"], 45150 ["svg", "image/svg+xml"], 45151 ["svgz", "image/svg+xml"], 45152 ["swa", "application/x-director"], 45153 ["swf", "application/x-shockwave-flash"], 45154 ["swi", "application/vnd.aristanetworks.swi"], 45155 ["swidtag", "application/swid+xml"], 45156 ["sxc", "application/vnd.sun.xml.calc"], 45157 ["sxd", "application/vnd.sun.xml.draw"], 45158 ["sxg", "application/vnd.sun.xml.writer.global"], 45159 ["sxi", "application/vnd.sun.xml.impress"], 45160 ["sxm", "application/vnd.sun.xml.math"], 45161 ["sxw", "application/vnd.sun.xml.writer"], 45162 ["t", "text/troff"], 45163 ["t3", "application/x-t3vm-image"], 45164 ["t38", "image/t38"], 45165 ["taglet", "application/vnd.mynfc"], 45166 ["tao", "application/vnd.tao.intent-module-archive"], 45167 ["tap", "image/vnd.tencent.tap"], 45168 ["tar", "application/x-tar"], 45169 ["tcap", "application/vnd.3gpp2.tcap"], 45170 ["tcl", "application/x-tcl"], 45171 ["td", "application/urc-targetdesc+xml"], 45172 ["teacher", "application/vnd.smart.teacher"], 45173 ["tei", "application/tei+xml"], 45174 ["teicorpus", "application/tei+xml"], 45175 ["tex", "application/x-tex"], 45176 ["texi", "application/x-texinfo"], 45177 ["texinfo", "application/x-texinfo"], 45178 ["text", "text/plain"], 45179 ["tfi", "application/thraud+xml"], 45180 ["tfm", "application/x-tex-tfm"], 45181 ["tfx", "image/tiff-fx"], 45182 ["tga", "image/x-tga"], 45183 ["tgz", "application/x-tar"], 45184 ["thmx", "application/vnd.ms-officetheme"], 45185 ["tif", "image/tiff"], 45186 ["tiff", "image/tiff"], 45187 ["tk", "application/x-tcl"], 45188 ["tmo", "application/vnd.tmobile-livetv"], 45189 ["toml", "application/toml"], 45190 ["torrent", "application/x-bittorrent"],
45191 ["tpl", "application/vnd.groove-tool-template"], 45192 ["tpt", "application/vnd.trid.tpt"], 45193 ["tr", "text/troff"], 45194 ["tra", "application/vnd.trueapp"], 45195 ["trig", "application/trig"], 45196 ["trm", "application/x-msterminal"], 45197 ["ts", "video/mp2t"], 45198 ["tsd", "application/timestamped-data"], 45199 ["tsv", "text/tab-separated-values"], 45200 ["ttc", "font/collection"], 45201 ["ttf", "font/ttf"], 45202 ["ttl", "text/turtle"], 45203 ["ttml", "application/ttml+xml"], 45204 ["twd", "application/vnd.simtech-mindmapper"], 45205 ["twds", "application/vnd.simtech-mindmapper"], 45206 ["txd", "application/vnd.genomatix.tuxedo"], 45207 ["txf", "application/vnd.mobius.txf"], 45208 ["txt", "text/plain"], 45209 ["u8dsn", "message/global-delivery-status"], 45210 ["u8hdr", "message/global-headers"], 45211 ["u8mdn", "message/global-disposition-notification"], 45212 ["u8msg", "message/global"], 45213 ["u32", "application/x-authorware-bin"], 45214 ["ubj", "application/ubjson"], 45215 ["udeb", "application/x-debian-package"], 45216 ["ufd", "application/vnd.ufdl"], 45217 ["ufdl", "application/vnd.ufdl"], 45218 ["ulx", "application/x-glulx"], 45219 ["umj", "application/vnd.umajin"], 45220 ["unityweb", "application/vnd.unity"], 45221 ["uoml", "application/vnd.uoml+xml"], 45222 ["uri", "text/uri-list"], 45223 ["uris", "text/uri-list"], 45224 ["urls", "text/uri-list"], 45225 ["usdz", "model/vnd.usdz+zip"], 45226 ["ustar", "application/x-ustar"], 45227 ["utz", "application/vnd.uiq.theme"], 45228 ["uu", "text/x-uuencode"], 45229 ["uva", "audio/vnd.dece.audio"], 45230 ["uvd", "application/vnd.dece.data"], 45231 ["uvf", "application/vnd.dece.data"], 45232 ["uvg", "image/vnd.dece.graphic"], 45233 ["uvh", "video/vnd.dece.hd"], 45234 ["uvi", "image/vnd.dece.graphic"], 45235 ["uvm", "video/vnd.dece.mobile"], 45236 ["uvp", "video/vnd.dece.pd"], 45237 ["uvs", "video/vnd.dece.sd"], 45238 ["uvt", "application/vnd.dece.ttml+xml"], 45239 ["uvu", "video/vnd.uvvu.mp4"], 45240 ["uvv", "video/vnd.dece.video"], 45241 ["uvva", "audio/vnd.dece.audio"], 45242 ["uvvd", "application/vnd.dece.data"], 45243 ["uvvf", "application/vnd.dece.data"], 45244 ["uvvg", "image/vnd.dece.graphic"], 45245 ["uvvh", "video/vnd.dece.hd"], 45246 ["uvvi", "image/vnd.dece.graphic"], 45247 ["uvvm", "video/vnd.dece.mobile"], 45248 ["uvvp", "video/vnd.dece.pd"], 45249 ["uvvs", "video/vnd.dece.sd"], 45250 ["uvvt", "application/vnd.dece.ttml+xml"], 45251 ["uvvu", "video/vnd.uvvu.mp4"], 45252 ["uvvv", "video/vnd.dece.video"], 45253 ["uvvx", "application/vnd.dece.unspecified"], 45254 ["uvvz", "application/vnd.dece.zip"], 45255 ["uvx", "application/vnd.dece.unspecified"], 45256 ["uvz", "application/vnd.dece.zip"], 45257 ["vbox", "application/x-virtualbox-vbox"], 45258 ["vbox-extpack", "application/x-virtualbox-vbox-extpack"], 45259 ["vcard", "text/vcard"], 45260 ["vcd", "application/x-cdlink"], 45261 ["vcf", "text/x-vcard"], 45262 ["vcg", "application/vnd.groove-vcard"], 45263 ["vcs", "text/x-vcalendar"], 45264 ["vcx", "application/vnd.vcx"], 45265 ["vdi", "application/x-virtualbox-vdi"], 45266 ["vds", "model/vnd.sap.vds"], 45267 ["vhd", "application/x-virtualbox-vhd"], 45268 ["vis", "application/vnd.visionary"], 45269 ["viv", "video/vnd.vivo"], 45270 ["vlc", "application/videolan"], 45271 ["vmdk", "application/x-virtualbox-vmdk"], 45272 ["vob", "video/x-ms-vob"], 45273 ["vor", "application/vnd.stardivision.writer"], 45274 ["vox", "application/x-authorware-bin"], 45275 ["vrml", "model/vrml"], 45276 ["vsd", "application/vnd.visio"], 45277 ["vsf", "application/vnd.vsf"], 45278 ["vss", "application/vnd.visio"], 45279 ["vst", "application/vnd.visio"], 45280 ["vsw", "application/vnd.visio"], 45281 ["vtf", "image/vnd.valve.source.texture"], 45282 ["vtt", "text/vtt"], 45283 ["vtu", "model/vnd.vtu"], 45284 ["vxml", "application/voicexml+xml"], 45285 ["w3d", "application/x-director"], 45286 ["wad", "application/x-doom"], 45287 ["wadl", "application/vnd.sun.wadl+xml"], 45288 ["war", "application/java-archive"], 45289 ["wasm", "application/wasm"], 45290 ["wav", "audio/x-wav"], 45291 ["wax", "audio/x-ms-wax"], 45292 ["wbmp", "image/vnd.wap.wbmp"], 45293 ["wbs", "application/vnd.criticaltools.wbs+xml"], 45294 ["wbxml", "application/wbxml"], 45295 ["wcm", "application/vnd.ms-works"], 45296 ["wdb", "application/vnd.ms-works"], 45297 ["wdp", "image/vnd.ms-photo"], 45298 ["weba", "audio/webm"], 45299 ["webapp", "application/x-web-app-manifest+json"], 45300 ["webm", "video/webm"], 45301 ["webmanifest", "application/manifest+json"], 45302 ["webp", "image/webp"], 45303 ["wg", "application/vnd.pmi.widget"], 45304 ["wgt", "application/widget"], 45305 ["wks", "application/vnd.ms-works"], 45306 ["wm", "video/x-ms-wm"], 45307 ["wma", "audio/x-ms-wma"], 45308 ["wmd", "application/x-ms-wmd"], 45309 ["wmf", "image/wmf"], 45310 ["wml", "text/vnd.wap.wml"], 45311 ["wmlc", "application/wmlc"], 45312 ["wmls", "text/vnd.wap.wmlscript"], 45313 ["wmlsc", "application/vnd.wap.wmlscriptc"], 45314 ["wmv", "video/x-ms-wmv"], 45315 ["wmx", "video/x-ms-wmx"], 45316 ["wmz", "application/x-msmetafile"], 45317 ["woff", "font/woff"], 45318 ["woff2", "font/woff2"], 45319 ["word", "application/msword"], 45320 ["wpd", "application/vnd.wordperfect"], 45321 ["wpl", "application/vnd.ms-wpl"], 45322 ["wps", "application/vnd.ms-works"], 45323 ["wqd", "application/vnd.wqd"], 45324 ["wri", "application/x-mswrite"], 45325 ["wrl", "model/vrml"], 45326 ["wsc", "message/vnd.wfa.wsc"], 45327 ["wsdl", "application/wsdl+xml"], 45328 ["wspolicy", "application/wspolicy+xml"], 45329 ["wtb", "application/vnd.webturbo"], 45330 ["wvx", "video/x-ms-wvx"], 45331 ["x3d", "model/x3d+xml"], 45332 ["x3db", "model/x3d+fastinfoset"], 45333 ["x3dbz", "model/x3d+binary"], 45334 ["x3dv", "model/x3d-vrml"], 45335 ["x3dvz", "model/x3d+vrml"], 45336 ["x3dz", "model/x3d+xml"], 45337 ["x32", "application/x-authorware-bin"], 45338 ["x_b", "model/vnd.parasolid.transmit.binary"], 45339 ["x_t", "model/vnd.parasolid.transmit.text"], 45340 ["xaml", "application/xaml+xml"], 45341 ["xap", "application/x-silverlight-app"], 45342 ["xar", "application/vnd.xara"], 45343 ["xav", "application/xcap-att+xml"], 45344 ["xbap", "application/x-ms-xbap"], 45345 ["xbd", "application/vnd.fujixerox.docuworks.binder"], 45346 ["xbm", "image/x-xbitmap"], 45347 ["xca", "application/xcap-caps+xml"], 45348 ["xcs", "application/calendar+xml"], 45349 ["xdf", "application/xcap-diff+xml"], 45350 ["xdm", "application/vnd.syncml.dm+xml"], 45351 ["xdp", "application/vnd.adobe.xdp+xml"], 45352 ["xdssc", "application/dssc+xml"], 45353 ["xdw", "application/vnd.fujixerox.docuworks"], 45354 ["xel", "application/xcap-el+xml"], 45355 ["xenc", "application/xenc+xml"], 45356 ["xer", "application/patch-ops-error+xml"], 45357 ["xfdf", "application/vnd.adobe.xfdf"], 45358 ["xfdl", "application/vnd.xfdl"], 45359 ["xht", "application/xhtml+xml"], 45360 ["xhtml", "application/xhtml+xml"], 45361 ["xhvml", "application/xv+xml"], 45362 ["xif", "image/vnd.xiff"], 45363 ["xl", "application/excel"],
45364 ["xla", "application/vnd.ms-excel"], 45365 ["xlam", "application/vnd.ms-excel.addin.macroEnabled.12"], 45366 ["xlc", "application/vnd.ms-excel"], 45367 ["xlf", "application/xliff+xml"], 45368 ["xlm", "application/vnd.ms-excel"], 45369 ["xls", "application/vnd.ms-excel"], 45370 ["xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"], 45371 ["xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"], 45372 ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"], 45373 ["xlt", "application/vnd.ms-excel"], 45374 ["xltm", "application/vnd.ms-excel.template.macroEnabled.12"], 45375 ["xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"], 45376 ["xlw", "application/vnd.ms-excel"], 45377 ["xm", "audio/xm"], 45378 ["xml", "application/xml"], 45379 ["xns", "application/xcap-ns+xml"], 45380 ["xo", "application/vnd.olpc-sugar"], 45381 ["xop", "application/xop+xml"], 45382 ["xpi", "application/x-xpinstall"], 45383 ["xpl", "application/xproc+xml"], 45384 ["xpm", "image/x-xpixmap"], 45385 ["xpr", "application/vnd.is-xpr"], 45386 ["xps", "application/vnd.ms-xpsdocument"], 45387 ["xpw", "application/vnd.intercon.formnet"], 45388 ["xpx", "application/vnd.intercon.formnet"], 45389 ["xsd", "application/xml"], 45390 ["xsl", "application/xml"], 45391 ["xslt", "application/xslt+xml"], 45392 ["xsm", "application/vnd.syncml+xml"], 45393 ["xspf", "application/xspf+xml"], 45394 ["xul", "application/vnd.mozilla.xul+xml"], 45395 ["xvm", "application/xv+xml"], 45396 ["xvml", "application/xv+xml"], 45397 ["xwd", "image/x-xwindowdump"], 45398 ["xyz", "chemical/x-xyz"], 45399 ["xz", "application/x-xz"], 45400 ["yaml", "text/yaml"], 45401 ["yang", "application/yang"], 45402 ["yin", "application/yin+xml"], 45403 ["yml", "text/yaml"], 45404 ["ymp", "text/x-suse-ymp"], 45405 ["z", "application/x-compress"], 45406 ["z1", "application/x-zmachine"], 45407 ["z2", "application/x-zmachine"], 45408 ["z3", "application/x-zmachine"], 45409 ["z4", "application/x-zmachine"], 45410 ["z5", "application/x-zmachine"], 45411 ["z6", "application/x-zmachine"], 45412 ["z7", "application/x-zmachine"], 45413 ["z8", "application/x-zmachine"], 45414 ["zaz", "application/vnd.zzazz.deck+xml"], 45415 ["zip", "application/zip"], 45416 ["zir", "application/vnd.zul"], 45417 ["zirz", "application/vnd.zul"], 45418 ["zmm", "application/vnd.handheld-entertainment+xml"], 45419 ["zsh", "text/x-scriptzsh"] 45420 ]); 45421 function toFileWithPath(file, path, h2) { 45422 const f2 = withMimeType(file); 45423 const { webkitRelativePath } = file; 45424 const p2 = typeof path === "string" ? path : typeof webkitRelativePath === "string" && webkitRelativePath.length > 0 ? webkitRelativePath : `./${file.name}`; 45425 if (typeof f2.path !== "string") { 45426 setObjProp(f2, "path", p2); 45427 } 45428 setObjProp(f2, "relativePath", p2); 45429 return f2; 45430 } 45431 function withMimeType(file) { 45432 const { name } = file; 45433 const hasExtension = name && name.lastIndexOf(".") !== -1; 45434 if (hasExtension && !file.type) { 45435 const ext = name.split(".").pop().toLowerCase(); 45436 const type = COMMON_MIME_TYPES.get(ext); 45437 if (type) { 45438 Object.defineProperty(file, "type", { 45439 value: type, 45440 writable: false, 45441 configurable: false, 45442 enumerable: true 45443 }); 45444 } 45445 } 45446 return file; 45447 } 45448 function setObjProp(f2, key, value) { 45449 Object.defineProperty(f2, key, { 45450 value, 45451 writable: false, 45452 configurable: false, 45453 enumerable: true 45454 }); 45455 } 45456 const FILES_TO_IGNORE = [ 45457 // Thumbnail cache files for macOS and Windows 45458 ".DS_Store", 45459 // macOs 45460 "Thumbs.db" 45461 // Windows 45462 ]; 45463 function fromEvent(evt) { 45464 return __awaiter(this, void 0, void 0, function* () { 45465 if (isObject$1(evt) && isDataTransfer(evt.dataTransfer)) { 45466 return getDataTransferFiles(evt.dataTransfer, evt.type); 45467 } else if (isChangeEvt(evt)) { 45468 return getInputFiles(evt); 45469 } else if (Array.isArray(evt) && evt.every((item) => "getFile" in item && typeof item.getFile === "function")) { 45470 return getFsHandleFiles(evt); 45471 } 45472 return []; 45473 }); 45474 } 45475 function isDataTransfer(value) { 45476 return isObject$1(value); 45477 } 45478 function isChangeEvt(value) { 45479 return isObject$1(value) && isObject$1(value.target); 45480 } 45481 function isObject$1(v2) { 45482 return typeof v2 === "object" && v2 !== null; 45483 } 45484 function getInputFiles(evt) { 45485 return fromList(evt.target.files).map((file) => toFileWithPath(file)); 45486 } 45487 function getFsHandleFiles(handles) { 45488 return __awaiter(this, void 0, void 0, function* () { 45489 const files = yield Promise.all(handles.map((h2) => h2.getFile())); 45490 return files.map((file) => toFileWithPath(file)); 45491 }); 45492 } 45493 function getDataTransferFiles(dt2, type) { 45494 return __awaiter(this, void 0, void 0, function* () { 45495 if (dt2.items) { 45496 const items = fromList(dt2.items).filter((item) => item.kind === "file"); 45497 if (type !== "drop") { 45498 return items; 45499 } 45500 const files = yield Promise.all(items.map(toFilePromises)); 45501 return noIgnoredFiles(flatten(files)); 45502 } 45503 return noIgnoredFiles(fromList(dt2.files).map((file) => toFileWithPath(file))); 45504 }); 45505 } 45506 function noIgnoredFiles(files) { 45507 return files.filter((file) => FILES_TO_IGNORE.indexOf(file.name) === -1); 45508 } 45509 function fromList(items) { 45510 if (items === null) { 45511 return []; 45512 } 45513 const files = []; 45514 for (let i2 = 0; i2 < items.length; i2++) { 45515 const file = items[i2]; 45516 files.push(file); 45517 } 45518 return files; 45519 } 45520 function toFilePromises(item) { 45521 if (typeof item.webkitGetAsEntry !== "function") { 45522 return fromDataTransferItem(item); 45523 } 45524 const entry = item.webkitGetAsEntry(); 45525 if (entry && entry.isDirectory) { 45526 return fromDirEntry(entry); 45527 } 45528 return fromDataTransferItem(item, entry); 45529 } 45530 function flatten(items) { 45531 return items.reduce((acc, files) => [ 45532 ...acc, 45533 ...Array.isArray(files) ? flatten(files) : [files] 45534 ], []); 45535 } 45536 function fromDataTransferItem(item, entry) { 45537 return __awaiter(this, void 0, void 0, function* () { 45538 var _a; 45539 if (globalThis.isSecureContext && typeof item.getAsFileSystemHandle === "function") { 45540 const h2 = yield item.getAsFileSystemHandle(); 45541 if (h2 === null) { 45542 throw new Error(`${item} is not a File`); 45543 } 45544 if (h2 !== void 0) { 45545 const file2 = yield h2.getFile(); 45546 file2.handle = h2; 45547 return toFileWithPath(file2); 45548 } 45549 } 45550 const file = item.getAsFile(); 45551 if (!file) { 45552 throw new Error(`${item} is not a File`); 45553 } 45554 const fwp = toFileWithPath(file, (_a = entry === null || entry === void 0 ? void 0 : entry.fullPath) !== null && _a !== void 0 ? _a : void 0); 45555 return fwp; 45556 }); 45557 }
45558 function fromEntry(entry) { 45559 return __awaiter(this, void 0, void 0, function* () { 45560 return entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry); 45561 }); 45562 } 45563 function fromDirEntry(entry) { 45564 const reader = entry.createReader(); 45565 return new Promise((resolve, reject) => { 45566 const entries2 = []; 45567 function readEntries() { 45568 reader.readEntries((batch) => __awaiter(this, void 0, void 0, function* () { 45569 if (!batch.length) { 45570 try { 45571 const files = yield Promise.all(entries2); 45572 resolve(files); 45573 } catch (err) { 45574 reject(err); 45575 } 45576 } else { 45577 const items = Promise.all(batch.map(fromEntry)); 45578 entries2.push(items); 45579 readEntries(); 45580 } 45581 }), (err) => { 45582 reject(err); 45583 }); 45584 } 45585 readEntries(); 45586 }); 45587 } 45588 function fromFileEntry(entry) { 45589 return __awaiter(this, void 0, void 0, function* () { 45590 return new Promise((resolve, reject) => { 45591 entry.file((file) => { 45592 const fwp = toFileWithPath(file, entry.fullPath); 45593 resolve(fwp); 45594 }, (err) => { 45595 reject(err); 45596 }); 45597 }); 45598 }); 45599 } 45600 var es = {}; 45601 var hasRequiredEs; 45602 function requireEs() { 45603 if (hasRequiredEs) return es; 45604 hasRequiredEs = 1; 45605 es.__esModule = true; 45606 es.default = function(file, acceptedFiles) { 45607 if (file && acceptedFiles) { 45608 var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(","); 45609 if (acceptedFilesArray.length === 0) { 45610 return true; 45611 } 45612 var fileName = file.name || ""; 45613 var mimeType = (file.type || "").toLowerCase(); 45614 var baseMimeType = mimeType.replace(/\/.*$/, ""); 45615 return acceptedFilesArray.some(function(type) { 45616 var validType = type.trim().toLowerCase(); 45617 if (validType.charAt(0) === ".") { 45618 return fileName.toLowerCase().endsWith(validType); 45619 } else if (validType.endsWith("/*")) { 45620 return baseMimeType === validType.replace(/\/.*$/, ""); 45621 } 45622 return mimeType === validType; 45623 }); 45624 } 45625 return true; 45626 }; 45627 return es; 45628 } 45629 var esExports = requireEs(); 45630 const _accepts = /* @__PURE__ */ getDefaultExportFromCjs(esExports); 45631 function _toConsumableArray$1(arr) { 45632 return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1(); 45633 } 45634 function _nonIterableSpread$1() { 45635 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 45636 } 45637 function _iterableToArray$1(iter) { 45638 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); 45639 } 45640 function _arrayWithoutHoles$1(arr) { 45641 if (Array.isArray(arr)) return _arrayLikeToArray$1(arr); 45642 } 45643 function ownKeys$1(object2, enumerableOnly) { 45644 var keys2 = Object.keys(object2); 45645 if (Object.getOwnPropertySymbols) { 45646 var symbols = Object.getOwnPropertySymbols(object2); 45647 enumerableOnly && (symbols = symbols.filter(function(sym) { 45648 return Object.getOwnPropertyDescriptor(object2, sym).enumerable; 45649 })), keys2.push.apply(keys2, symbols); 45650 } 45651 return keys2; 45652 } 45653 function _objectSpread$1(target) { 45654 for (var i2 = 1; i2 < arguments.length; i2++) { 45655 var source = null != arguments[i2] ? arguments[i2] : {}; 45656 i2 % 2 ? ownKeys$1(Object(source), true).forEach(function(key) { 45657 _defineProperty$1(target, key, source[key]); 45658 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) { 45659 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 45660 }); 45661 } 45662 return target; 45663 } 45664 function _defineProperty$1(obj, key, value) { 45665 if (key in obj) { 45666 Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); 45667 } else { 45668 obj[key] = value; 45669 } 45670 return obj; 45671 } 45672 function _slicedToArray$1(arr, i2) { 45673 return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i2) || _unsupportedIterableToArray$1(arr, i2) || _nonIterableRest$1(); 45674 } 45675 function _nonIterableRest$1() {
45676 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 45677 } 45678 function _unsupportedIterableToArray$1(o2, minLen) { 45679 if (!o2) return; 45680 if (typeof o2 === "string") return _arrayLikeToArray$1(o2, minLen); 45681 var n2 = Object.prototype.toString.call(o2).slice(8, -1); 45682 if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name; 45683 if (n2 === "Map" || n2 === "Set") return Array.from(o2); 45684 if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$1(o2, minLen); 45685 } 45686 function _arrayLikeToArray$1(arr, len) { 45687 if (len == null || len > arr.length) len = arr.length; 45688 for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) { 45689 arr2[i2] = arr[i2]; 45690 } 45691 return arr2; 45692 } 45693 function _iterableToArrayLimit$1(arr, i2) { 45694 var _i2 = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; 45695 if (_i2 == null) return; 45696 var _arr = []; 45697 var _n2 = true; 45698 var _d = false; 45699 var _s, _e2; 45700 try { 45701 for (_i2 = _i2.call(arr); !(_n2 = (_s = _i2.next()).done); _n2 = true) { 45702 _arr.push(_s.value); 45703 if (i2 && _arr.length === i2) break; 45704 } 45705 } catch (err) { 45706 _d = true; 45707 _e2 = err; 45708 } finally { 45709 try { 45710 if (!_n2 && _i2["return"] != null) _i2["return"](); 45711 } finally { 45712 if (_d) throw _e2; 45713 } 45714 } 45715 return _arr; 45716 } 45717 function _arrayWithHoles$1(arr) { 45718 if (Array.isArray(arr)) return arr; 45719 } 45720 var accepts = typeof _accepts === "function" ? _accepts : _accepts.default; 45721 var FILE_INVALID_TYPE = "file-invalid-type"; 45722 var FILE_TOO_LARGE = "file-too-large"; 45723 var FILE_TOO_SMALL = "file-too-small"; 45724 var TOO_MANY_FILES = "too-many-files"; 45725 var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr2() { 45726 var accept = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; 45727 var acceptArr = accept.split(","); 45728 var msg = acceptArr.length > 1 ? "one of ".concat(acceptArr.join(", ")) : acceptArr[0]; 45729 return { 45730 code: FILE_INVALID_TYPE, 45731 message: "File type must be ".concat(msg) 45732 }; 45733 }; 45734 var getTooLargeRejectionErr = function getTooLargeRejectionErr2(maxSize) { 45735 return { 45736 code: FILE_TOO_LARGE, 45737 message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes") 45738 }; 45739 }; 45740 var getTooSmallRejectionErr = function getTooSmallRejectionErr2(minSize) { 45741 return { 45742 code: FILE_TOO_SMALL, 45743 message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes") 45744 }; 45745 }; 45746 var TOO_MANY_FILES_REJECTION = { 45747 code: TOO_MANY_FILES, 45748 message: "Too many files" 45749 }; 45750 function fileAccepted(file, accept) { 45751 var isAcceptable = file.type === "application/x-moz-file" || accepts(file, accept); 45752 return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)]; 45753 } 45754 function fileMatchSize(file, minSize, maxSize) { 45755 if (isDefined(file.size)) { 45756 if (isDefined(minSize) && isDefined(maxSize)) { 45757 if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)]; 45758 if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)]; 45759 } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)]; 45760 else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)]; 45761 } 45762 return [true, null]; 45763 } 45764 function isDefined(value) { 45765 return value !== void 0 && value !== null; 45766 } 45767 function allFilesAccepted(_ref2) { 45768 var files = _ref2.files, accept = _ref2.accept, minSize = _ref2.minSize, maxSize = _ref2.maxSize, multiple = _ref2.multiple, maxFiles = _ref2.maxFiles, validator2 = _ref2.validator; 45769 if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) { 45770 return false;
45771 } 45772 return files.every(function(file) { 45773 var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$1(_fileAccepted, 1), accepted = _fileAccepted2[0]; 45774 var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$1(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0]; 45775 var customErrors = validator2 ? validator2(file) : null; 45776 return accepted && sizeMatch && !customErrors; 45777 }); 45778 } 45779 function isPropagationStopped(event) { 45780 if (typeof event.isPropagationStopped === "function") { 45781 return event.isPropagationStopped(); 45782 } else if (typeof event.cancelBubble !== "undefined") { 45783 return event.cancelBubble; 45784 } 45785 return false; 45786 } 45787 function isEvtWithFiles(event) { 45788 if (!event.dataTransfer) { 45789 return !!event.target && !!event.target.files; 45790 } 45791 return Array.prototype.some.call(event.dataTransfer.types, function(type) { 45792 return type === "Files" || type === "application/x-moz-file"; 45793 }); 45794 } 45795 function onDocumentDragOver(event) { 45796 event.preventDefault(); 45797 } 45798 function isIe(userAgent) { 45799 return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1; 45800 } 45801 function isEdge(userAgent) { 45802 return userAgent.indexOf("Edge/") !== -1; 45803 } 45804 function isIeOrEdge() { 45805 var userAgent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent; 45806 return isIe(userAgent) || isEdge(userAgent); 45807 } 45808 function composeEventHandlers() { 45809 for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { 45810 fns[_key] = arguments[_key]; 45811 } 45812 return function(event) { 45813 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 45814 args[_key2 - 1] = arguments[_key2]; 45815 } 45816 return fns.some(function(fn2) { 45817 if (!isPropagationStopped(event) && fn2) { 45818 fn2.apply(void 0, [event].concat(args)); 45819 } 45820 return isPropagationStopped(event); 45821 }); 45822 }; 45823 } 45824 function canUseFileSystemAccessAPI() { 45825 return "showOpenFilePicker" in window; 45826 } 45827 function pickerOptionsFromAccept(accept) { 45828 if (isDefined(accept)) { 45829 var acceptForPicker = Object.entries(accept).filter(function(_ref2) { 45830 var _ref3 = _slicedToArray$1(_ref2, 2), mimeType = _ref3[0], ext = _ref3[1]; 45831 var ok = true; 45832 if (!isMIMEType(mimeType)) { 45833 console.warn('Skipped "'.concat(mimeType, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')); 45834 ok = false; 45835 } 45836 if (!Array.isArray(ext) || !ext.every(isExt)) { 45837 console.warn('Skipped "'.concat(mimeType, '" because an invalid file extension was provided.')); 45838 ok = false; 45839 } 45840 return ok; 45841 }).reduce(function(agg, _ref4) { 45842 var _ref5 = _slicedToArray$1(_ref4, 2), mimeType = _ref5[0], ext = _ref5[1]; 45843 return _objectSpread$1(_objectSpread$1({}, agg), {}, _defineProperty$1({}, mimeType, ext)); 45844 }, {}); 45845 return [{ 45846 // description is required due to https://crbug.com/1264708 45847 description: "Files", 45848 accept: acceptForPicker 45849 }]; 45850 } 45851 return accept; 45852 } 45853 function acceptPropAsAcceptAttr(accept) { 45854 if (isDefined(accept)) { 45855 return Object.entries(accept).reduce(function(a2, _ref6) { 45856 var _ref7 = _slicedToArray$1(_ref6, 2), mimeType = _ref7[0], ext = _ref7[1]; 45857 return [].concat(_toConsumableArray$1(a2), [mimeType], _toConsumableArray$1(ext)); 45858 }, []).filter(function(v2) { 45859 return isMIMEType(v2) || isExt(v2); 45860 }).join(","); 45861 } 45862 return void 0; 45863 } 45864 function isAbort(v2) { 45865 return v2 instanceof DOMException && (v2.name === "AbortError" || v2.code === v2.ABORT_ERR); 45866 } 45867 function isSecurityError(v2) { 45868 return v2 instanceof DOMException && (v2.name === "SecurityError" || v2.code === v2.SECURITY_ERR); 45869 } 45870 function isMIMEType(v2) { 45871 return v2 === "audio/*" || v2 === "video/*" || v2 === "image/*" || v2 === "text/*" || v2 === "application/*" || /\w+\/[-+.\w]+/g.test(v2); 45872 } 45873 function isExt(v2) { 45874 return /^.*\.[\w]+$/.test(v2); 45875 } 45876 var _excluded = ["children"], _excluded2 = ["open"], _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], _excluded4 = ["refKey", "onChange", "onClick"]; 45877 function _toConsumableArray(arr) { 45878 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); 45879 } 45880 function _nonIterableSpread() { 45881 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 45882 } 45883 function _iterableToArray(iter) { 45884 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); 45885 } 45886 function _arrayWithoutHoles(arr) { 45887 if (Array.isArray(arr)) return _arrayLikeToArray(arr); 45888 } 45889 function _slicedToArray(arr, i2) { 45890 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest(); 45891 } 45892 function _nonIterableRest() {
45893 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 45894 } 45895 function _unsupportedIterableToArray(o2, minLen) { 45896 if (!o2) return; 45897 if (typeof o2 === "string") return _arrayLikeToArray(o2, minLen); 45898 var n2 = Object.prototype.toString.call(o2).slice(8, -1); 45899 if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name; 45900 if (n2 === "Map" || n2 === "Set") return Array.from(o2); 45901 if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray(o2, minLen); 45902 } 45903 function _arrayLikeToArray(arr, len) { 45904 if (len == null || len > arr.length) len = arr.length; 45905 for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) { 45906 arr2[i2] = arr[i2]; 45907 } 45908 return arr2; 45909 } 45910 function _iterableToArrayLimit(arr, i2) { 45911 var _i2 = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; 45912 if (_i2 == null) return; 45913 var _arr = []; 45914 var _n2 = true; 45915 var _d = false; 45916 var _s, _e2; 45917 try { 45918 for (_i2 = _i2.call(arr); !(_n2 = (_s = _i2.next()).done); _n2 = true) { 45919 _arr.push(_s.value); 45920 if (i2 && _arr.length === i2) break; 45921 } 45922 } catch (err) { 45923 _d = true; 45924 _e2 = err; 45925 } finally { 45926 try { 45927 if (!_n2 && _i2["return"] != null) _i2["return"](); 45928 } finally { 45929 if (_d) throw _e2; 45930 } 45931 } 45932 return _arr; 45933 } 45934 function _arrayWithHoles(arr) { 45935 if (Array.isArray(arr)) return arr; 45936 } 45937 function ownKeys(object2, enumerableOnly) { 45938 var keys2 = Object.keys(object2); 45939 if (Object.getOwnPropertySymbols) { 45940 var symbols = Object.getOwnPropertySymbols(object2); 45941 enumerableOnly && (symbols = symbols.filter(function(sym) { 45942 return Object.getOwnPropertyDescriptor(object2, sym).enumerable; 45943 })), keys2.push.apply(keys2, symbols); 45944 } 45945 return keys2; 45946 } 45947 function _objectSpread(target) { 45948 for (var i2 = 1; i2 < arguments.length; i2++) { 45949 var source = null != arguments[i2] ? arguments[i2] : {}; 45950 i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) { 45951 _defineProperty(target, key, source[key]); 45952 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { 45953 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 45954 }); 45955 } 45956 return target; 45957 } 45958 function _defineProperty(obj, key, value) { 45959 if (key in obj) { 45960 Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); 45961 } else { 45962 obj[key] = value; 45963 } 45964 return obj; 45965 } 45966 function _objectWithoutProperties(source, excluded) { 45967 if (source == null) return {}; 45968 var target = _objectWithoutPropertiesLoose$1(source, excluded); 45969 var key, i2; 45970 if (Object.getOwnPropertySymbols) { 45971 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 45972 for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) { 45973 key = sourceSymbolKeys[i2]; 45974 if (excluded.indexOf(key) >= 0) continue; 45975 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; 45976 target[key] = source[key]; 45977 } 45978 } 45979 return target; 45980 } 45981 function _objectWithoutPropertiesLoose$1(source, excluded) { 45982 if (source == null) return {}; 45983 var target = {}; 45984 var sourceKeys = Object.keys(source); 45985 var key, i2; 45986 for (i2 = 0; i2 < sourceKeys.length; i2++) { 45987 key = sourceKeys[i2]; 45988 if (excluded.indexOf(key) >= 0) continue; 45989 target[key] = source[key]; 45990 } 45991 return target; 45992 } 45993 var Dropzone = /* @__PURE__ */ reactExports.forwardRef(function(_ref2, ref) { 45994 var children = _ref2.children, params = _objectWithoutProperties(_ref2, _excluded); 45995 var _useDropzone = useDropzone(params), open = _useDropzone.open, props = _objectWithoutProperties(_useDropzone, _excluded2); 45996 reactExports.useImperativeHandle(ref, function() { 45997 return { 45998 open 45999 }; 46000 }, [open]); 46001 return /* @__PURE__ */ e$3.createElement(reactExports.Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, { 46002 open 46003 }))); 46004 }); 46005 Dropzone.displayName = "Dropzone"; 46006 var defaultProps = { 46007 disabled: false, 46008 getFilesFromEvent: fromEvent, 46009 maxSize: Infinity, 46010 minSize: 0, 46011 multiple: true, 46012 maxFiles: 0, 46013 preventDropOnDocument: true, 46014 noClick: false, 46015 noKeyboard: false, 46016 noDrag: false, 46017 noDragEventsBubbling: false, 46018 validator: null, 46019 useFsAccessApi: false, 46020 autoFocus: false 46021 }; 46022 Dropzone.defaultProps = defaultProps; 46023 Dropzone.propTypes = { 46024 /**
46025 * Render function that exposes the dropzone state and prop getter fns 46026 * 46027 * @param {object} params 46028 * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render 46029 * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render 46030 * @param {Function} params.open Open the native file selection dialog 46031 * @param {boolean} params.isFocused Dropzone area is in focus 46032 * @param {boolean} params.isFileDialogActive File dialog is opened 46033 * @param {boolean} params.isDragActive Active drag is in progress 46034 * @param {boolean} params.isDragAccept Dragged files are accepted 46035 * @param {boolean} params.isDragReject Some dragged files are rejected 46036 * @param {File[]} params.acceptedFiles Accepted files 46037 * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected 46038 */ 46039 children: PropTypes.func, 46040 /** 46041 * Set accepted file types. 46042 * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information. 46043 * Keep in mind that mime type determination is not reliable across platforms. CSV files, 46044 * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under 46045 * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276). 46046 */ 46047 accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)), 46048 /** 46049 * Allow drag 'n' drop (or selection from the file dialog) of multiple files 46050 */ 46051 multiple: PropTypes.bool, 46052 /** 46053 * If false, allow dropped items to take over the current browser window 46054 */ 46055 preventDropOnDocument: PropTypes.bool, 46056 /** 46057 * If true, disables click to open the native file selection dialog 46058 */ 46059 noClick: PropTypes.bool, 46060 /** 46061 * If true, disables SPACE/ENTER to open the native file selection dialog. 46062 * Note that it also stops tracking the focus state. 46063 */ 46064 noKeyboard: PropTypes.bool, 46065 /** 46066 * If true, disables drag 'n' drop 46067 */ 46068 noDrag: PropTypes.bool, 46069 /** 46070 * If true, stops drag event propagation to parents 46071 */ 46072 noDragEventsBubbling: PropTypes.bool, 46073 /** 46074 * Minimum file size (in bytes) 46075 */ 46076 minSize: PropTypes.number, 46077 /** 46078 * Maximum file size (in bytes) 46079 */ 46080 maxSize: PropTypes.number, 46081 /** 46082 * Maximum accepted number of files 46083 * The default value is 0 which means there is no limitation to how many files are accepted. 46084 */ 46085 maxFiles: PropTypes.number, 46086 /** 46087 * Enable/disable the dropzone 46088 */ 46089 disabled: PropTypes.bool, 46090 /** 46091 * Use this to provide a custom file aggregator 46092 * 46093 * @param {(DragEvent|Event|Array<FileSystemFileHandle>)} event A drag event or input change event (if files were selected via the file dialog) 46094 */ 46095 getFilesFromEvent: PropTypes.func, 46096 /** 46097 * Cb for when closing the file dialog with no selection 46098 */ 46099 onFileDialogCancel: PropTypes.func, 46100 /** 46101 * Cb for when opening the file dialog 46102 */ 46103 onFileDialogOpen: PropTypes.func, 46104 /** 46105 * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API 46106 * to open the file picker instead of using an `<input type="file">` click event. 46107 */ 46108 useFsAccessApi: PropTypes.bool, 46109 /** 46110 * Set to true to focus the root element on render 46111 */ 46112 autoFocus: PropTypes.bool, 46113 /** 46114 * Cb for when the `dragenter` event occurs. 46115 * 46116 * @param {DragEvent} event 46117 */ 46118 onDragEnter: PropTypes.func, 46119 /** 46120 * Cb for when the `dragleave` event occurs 46121 * 46122 * @param {DragEvent} event 46123 */ 46124 onDragLeave: PropTypes.func, 46125 /** 46126 * Cb for when the `dragover` event occurs 46127 * 46128 * @param {DragEvent} event 46129 */ 46130 onDragOver: PropTypes.func, 46131 /** 46132 * Cb for when the `drop` event occurs. 46133 * Note that this callback is invoked after the `getFilesFromEvent` callback is done. 46134 * 46135 * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props. 46136 * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension. 46137 * If `multiple` is set to false and additional files are dropped, 46138 * all files besides the first will be rejected. 46139 * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well. 46140 * 46141 * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
46142 * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props. 46143 * 46144 * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server. 46145 * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library: 46146 * 46147 * ```js 46148 * function onDrop(acceptedFiles) { 46149 * const req = request.post('/upload') 46150 * acceptedFiles.forEach(file => { 46151 * req.attach(file.name, file) 46152 * }) 46153 * req.end(callback) 46154 * } 46155 * ``` 46156 * 46157 * @param {File[]} acceptedFiles 46158 * @param {FileRejection[]} fileRejections 46159 * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog) 46160 */ 46161 onDrop: PropTypes.func, 46162 /** 46163 * Cb for when the `drop` event occurs. 46164 * Note that if no files are accepted, this callback is not invoked. 46165 * 46166 * @param {File[]} files 46167 * @param {(DragEvent|Event)} event 46168 */ 46169 onDropAccepted: PropTypes.func, 46170 /** 46171 * Cb for when the `drop` event occurs. 46172 * Note that if no files are rejected, this callback is not invoked. 46173 * 46174 * @param {FileRejection[]} fileRejections 46175 * @param {(DragEvent|Event)} event 46176 */ 46177 onDropRejected: PropTypes.func, 46178 /** 46179 * Cb for when there's some error from any of the promises. 46180 * 46181 * @param {Error} error 46182 */ 46183 onError: PropTypes.func, 46184 /** 46185 * Custom validation function. It must return null if there's no errors. 46186 * @param {File} file 46187 * @returns {FileError|FileError[]|null} 46188 */ 46189 validator: PropTypes.func 46190 }; 46191 var initialState = { 46192 isFocused: false, 46193 isFileDialogActive: false, 46194 isDragActive: false, 46195 isDragAccept: false, 46196 isDragReject: false, 46197 acceptedFiles: [], 46198 fileRejections: [] 46199 }; 46200 function useDropzone() { 46201 var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 46202 var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), accept = _defaultProps$props.accept, disabled = _defaultProps$props.disabled, getFilesFromEvent = _defaultProps$props.getFilesFromEvent, maxSize = _defaultProps$props.maxSize, minSize = _defaultProps$props.minSize, multiple = _defaultProps$props.multiple, maxFiles = _defaultProps$props.maxFiles, onDragEnter = _defaultProps$props.onDragEnter, onDragLeave = _defaultProps$props.onDragLeave, onDragOver = _defaultProps$props.onDragOver, onDrop = _defaultProps$props.onDrop, onDropAccepted = _defaultProps$props.onDropAccepted, onDropRejected = _defaultProps$props.onDropRejected, onFileDialogCancel = _defaultProps$props.onFileDialogCancel, onFileDialogOpen = _defaultProps$props.onFileDialogOpen, useFsAccessApi = _defaultProps$props.useFsAccessApi, autoFocus = _defaultProps$props.autoFocus, preventDropOnDocument = _defaultProps$props.preventDropOnDocument, noClick = _defaultProps$props.noClick, noKeyboard = _defaultProps$props.noKeyboard, noDrag = _defaultProps$props.noDrag, noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling, onError = _defaultProps$props.onError, validator2 = _defaultProps$props.validator; 46203 var acceptAttr = reactExports.useMemo(function() { 46204 return acceptPropAsAcceptAttr(accept); 46205 }, [accept]); 46206 var pickerTypes = reactExports.useMemo(function() { 46207 return pickerOptionsFromAccept(accept); 46208 }, [accept]); 46209 var onFileDialogOpenCb = reactExports.useMemo(function() { 46210 return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop$2; 46211 }, [onFileDialogOpen]); 46212 var onFileDialogCancelCb = reactExports.useMemo(function() { 46213 return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop$2; 46214 }, [onFileDialogCancel]); 46215 var rootRef = reactExports.useRef(null); 46216 var inputRef = reactExports.useRef(null); 46217 var _useReducer = reactExports.useReducer(reducer, initialState), _useReducer2 = _slicedToArray(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1]; 46218 var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive; 46219 var fsAccessApiWorksRef = reactExports.useRef(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); 46220 var onWindowFocus = function onWindowFocus2() { 46221 if (!fsAccessApiWorksRef.current && isFileDialogActive) { 46222 setTimeout(function() { 46223 if (inputRef.current) { 46224 var files = inputRef.current.files; 46225 if (!files.length) { 46226 dispatch({ 46227 type: "closeDialog" 46228 }); 46229 onFileDialogCancelCb(); 46230 } 46231 } 46232 }, 300); 46233 } 46234 }; 46235 reactExports.useEffect(function() { 46236 window.addEventListener("focus", onWindowFocus, false); 46237 return function() { 46238 window.removeEventListener("focus", onWindowFocus, false); 46239 }; 46240 }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]); 46241 var dragTargetsRef = reactExports.useRef([]); 46242 var onDocumentDrop = function onDocumentDrop2(event) { 46243 if (rootRef.current && rootRef.current.contains(event.target)) { 46244 return; 46245 } 46246 event.preventDefault(); 46247 dragTargetsRef.current = []; 46248 }; 46249 reactExports.useEffect(function() { 46250 if (preventDropOnDocument) { 46251 document.addEventListener("dragover", onDocumentDragOver, false); 46252 document.addEventListener("drop", onDocumentDrop, false); 46253 } 46254 return function() { 46255 if (preventDropOnDocument) { 46256 document.removeEventListener("dragover", onDocumentDragOver); 46257 document.removeEventListener("drop", onDocumentDrop); 46258 } 46259 }; 46260 }, [rootRef, preventDropOnDocument]); 46261 reactExports.useEffect(function() { 46262 if (!disabled && autoFocus && rootRef.current) { 46263 rootRef.current.focus(); 46264 } 46265 return function() { 46266 }; 46267 }, [rootRef, autoFocus, disabled]); 46268 var onErrCb = reactExports.useCallback(function(e2) { 46269 if (onError) { 46270 onError(e2); 46271 } else { 46272 console.error(e2); 46273 } 46274 }, [onError]); 46275 var onDragEnterCb = reactExports.useCallback(function(event) { 46276 event.preventDefault(); 46277 event.persist(); 46278 stopPropagation(event); 46279 dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]); 46280 if (isEvtWithFiles(event)) { 46281 Promise.resolve(getFilesFromEvent(event)).then(function(files) { 46282 if (isPropagationStopped(event) && !noDragEventsBubbling) { 46283 return; 46284 } 46285 var fileCount = files.length; 46286 var isDragAccept = fileCount > 0 && allFilesAccepted({ 46287 files, 46288 accept: acceptAttr, 46289 minSize, 46290 maxSize, 46291 multiple, 46292 maxFiles, 46293 validator: validator2 46294 }); 46295 var isDragReject = fileCount > 0 && !isDragAccept; 46296 dispatch({ 46297 isDragAccept, 46298 isDragReject, 46299 isDragActive: true, 46300 type: "setDraggedFiles" 46301 }); 46302 if (onDragEnter) { 46303 onDragEnter(event); 46304 } 46305 }).catch(function(e2) { 46306 return onErrCb(e2); 46307 }); 46308 } 46309 }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator2]); 46310 var onDragOverCb = reactExports.useCallback(function(event) { 46311 event.preventDefault(); 46312 event.persist(); 46313 stopPropagation(event); 46314 var hasFiles = isEvtWithFiles(event); 46315 if (hasFiles && event.dataTransfer) { 46316 try { 46317 event.dataTransfer.dropEffect = "copy"; 46318 } catch (_unused) { 46319 } 46320 } 46321 if (hasFiles && onDragOver) { 46322 onDragOver(event); 46323 } 46324 return false;
46325 }, [onDragOver, noDragEventsBubbling]); 46326 var onDragLeaveCb = reactExports.useCallback(function(event) { 46327 event.preventDefault(); 46328 event.persist(); 46329 stopPropagation(event); 46330 var targets = dragTargetsRef.current.filter(function(target) { 46331 return rootRef.current && rootRef.current.contains(target); 46332 }); 46333 var targetIdx = targets.indexOf(event.target); 46334 if (targetIdx !== -1) { 46335 targets.splice(targetIdx, 1); 46336 } 46337 dragTargetsRef.current = targets; 46338 if (targets.length > 0) { 46339 return; 46340 } 46341 dispatch({ 46342 type: "setDraggedFiles", 46343 isDragActive: false, 46344 isDragAccept: false, 46345 isDragReject: false 46346 }); 46347 if (isEvtWithFiles(event) && onDragLeave) { 46348 onDragLeave(event); 46349 } 46350 }, [rootRef, onDragLeave, noDragEventsBubbling]); 46351 var setFiles = reactExports.useCallback(function(files, event) { 46352 var acceptedFiles = []; 46353 var fileRejections = []; 46354 files.forEach(function(file) { 46355 var _fileAccepted = fileAccepted(file, acceptAttr), _fileAccepted2 = _slicedToArray(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1]; 46356 var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1]; 46357 var customErrors = validator2 ? validator2(file) : null; 46358 if (accepted && sizeMatch && !customErrors) { 46359 acceptedFiles.push(file); 46360 } else { 46361 var errors = [acceptError, sizeError]; 46362 if (customErrors) { 46363 errors = errors.concat(customErrors); 46364 } 46365 fileRejections.push({ 46366 file, 46367 errors: errors.filter(function(e2) { 46368 return e2; 46369 }) 46370 }); 46371 } 46372 }); 46373 if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) { 46374 acceptedFiles.forEach(function(file) { 46375 fileRejections.push({ 46376 file, 46377 errors: [TOO_MANY_FILES_REJECTION] 46378 }); 46379 }); 46380 acceptedFiles.splice(0); 46381 } 46382 dispatch({ 46383 acceptedFiles, 46384 fileRejections, 46385 isDragReject: fileRejections.length > 0, 46386 type: "setFiles" 46387 }); 46388 if (onDrop) { 46389 onDrop(acceptedFiles, fileRejections, event); 46390 } 46391 if (fileRejections.length > 0 && onDropRejected) { 46392 onDropRejected(fileRejections, event); 46393 } 46394 if (acceptedFiles.length > 0 && onDropAccepted) { 46395 onDropAccepted(acceptedFiles, event); 46396 } 46397 }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator2]); 46398 var onDropCb = reactExports.useCallback(function(event) { 46399 event.preventDefault(); 46400 event.persist(); 46401 stopPropagation(event); 46402 dragTargetsRef.current = []; 46403 if (isEvtWithFiles(event)) { 46404 Promise.resolve(getFilesFromEvent(event)).then(function(files) { 46405 if (isPropagationStopped(event) && !noDragEventsBubbling) { 46406 return; 46407 } 46408 setFiles(files, event); 46409 }).catch(function(e2) { 46410 return onErrCb(e2); 46411 }); 46412 } 46413 dispatch({ 46414 type: "reset" 46415 }); 46416 }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); 46417 var openFileDialog = reactExports.useCallback(function() { 46418 if (fsAccessApiWorksRef.current) { 46419 dispatch({ 46420 type: "openDialog" 46421 }); 46422 onFileDialogOpenCb(); 46423 var opts = { 46424 multiple, 46425 types: pickerTypes 46426 }; 46427 window.showOpenFilePicker(opts).then(function(handles) { 46428 return getFilesFromEvent(handles); 46429 }).then(function(files) { 46430 setFiles(files, null); 46431 dispatch({ 46432 type: "closeDialog" 46433 }); 46434 }).catch(function(e2) { 46435 if (isAbort(e2)) { 46436 onFileDialogCancelCb(e2); 46437 dispatch({ 46438 type: "closeDialog" 46439 }); 46440 } else if (isSecurityError(e2)) { 46441 fsAccessApiWorksRef.current = false;
46442 if (inputRef.current) { 46443 inputRef.current.value = null; 46444 inputRef.current.click(); 46445 } else { 46446 onErrCb(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.")); 46447 } 46448 } else { 46449 onErrCb(e2); 46450 } 46451 }); 46452 return; 46453 } 46454 if (inputRef.current) { 46455 dispatch({ 46456 type: "openDialog" 46457 }); 46458 onFileDialogOpenCb(); 46459 inputRef.current.value = null; 46460 inputRef.current.click(); 46461 } 46462 }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); 46463 var onKeyDownCb = reactExports.useCallback(function(event) { 46464 if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) { 46465 return; 46466 } 46467 if (event.key === " " || event.key === "Enter" || event.keyCode === 32 || event.keyCode === 13) { 46468 event.preventDefault(); 46469 openFileDialog(); 46470 } 46471 }, [rootRef, openFileDialog]); 46472 var onFocusCb = reactExports.useCallback(function() { 46473 dispatch({ 46474 type: "focus" 46475 }); 46476 }, []); 46477 var onBlurCb = reactExports.useCallback(function() { 46478 dispatch({ 46479 type: "blur" 46480 }); 46481 }, []); 46482 var onClickCb = reactExports.useCallback(function() { 46483 if (noClick) { 46484 return; 46485 } 46486 if (isIeOrEdge()) { 46487 setTimeout(openFileDialog, 0); 46488 } else { 46489 openFileDialog(); 46490 } 46491 }, [noClick, openFileDialog]); 46492 var composeHandler = function composeHandler2(fn2) { 46493 return disabled ? null : fn2; 46494 }; 46495 var composeKeyboardHandler = function composeKeyboardHandler2(fn2) { 46496 return noKeyboard ? null : composeHandler(fn2); 46497 }; 46498 var composeDragHandler = function composeDragHandler2(fn2) { 46499 return noDrag ? null : composeHandler(fn2); 46500 }; 46501 var stopPropagation = function stopPropagation2(event) { 46502 if (noDragEventsBubbling) { 46503 event.stopPropagation(); 46504 } 46505 }; 46506 var getRootProps = reactExports.useMemo(function() { 46507 return function() { 46508 var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties(_ref2, _excluded3); 46509 return _objectSpread(_objectSpread(_defineProperty({ 46510 onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)), 46511 onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)), 46512 onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)), 46513 onClick: composeHandler(composeEventHandlers(onClick, onClickCb)), 46514 onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter2, onDragEnterCb)), 46515 onDragOver: composeDragHandler(composeEventHandlers(onDragOver2, onDragOverCb)), 46516 onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave2, onDragLeaveCb)), 46517 onDrop: composeDragHandler(composeEventHandlers(onDrop2, onDropCb)), 46518 role: typeof role === "string" && role !== "" ? role : "presentation" 46519 }, refKey, rootRef), !disabled && !noKeyboard ? { 46520 tabIndex: 0 46521 } : {}), rest); 46522 }; 46523 }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]); 46524 var onInputElementClick = reactExports.useCallback(function(event) { 46525 event.stopPropagation(); 46526 }, []); 46527 var getInputProps = reactExports.useMemo(function() { 46528 return function() { 46529 var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties(_ref3, _excluded4); 46530 var inputProps = _defineProperty({ 46531 accept: acceptAttr, 46532 multiple, 46533 type: "file", 46534 style: { 46535 border: 0, 46536 clip: "rect(0, 0, 0, 0)", 46537 clipPath: "inset(50%)", 46538 height: "1px", 46539 margin: "0 -1px -1px 0", 46540 overflow: "hidden", 46541 padding: 0, 46542 position: "absolute", 46543 width: "1px", 46544 whiteSpace: "nowrap" 46545 }, 46546 onChange: composeHandler(composeEventHandlers(onChange, onDropCb)), 46547 onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)), 46548 tabIndex: -1 46549 }, refKey, inputRef); 46550 return _objectSpread(_objectSpread({}, inputProps), rest); 46551 }; 46552 }, [inputRef, accept, multiple, onDropCb, disabled]); 46553 return _objectSpread(_objectSpread({}, state), {}, { 46554 isFocused: isFocused && !disabled, 46555 getRootProps, 46556 getInputProps, 46557 rootRef, 46558 inputRef, 46559 open: composeHandler(openFileDialog) 46560 }); 46561 } 46562 function reducer(state, action) { 46563 switch (action.type) { 46564 case "focus": 46565 return _objectSpread(_objectSpread({}, state), {}, { 46566 isFocused: true 46567 }); 46568 case "blur": 46569 return _objectSpread(_objectSpread({}, state), {}, { 46570 isFocused: false 46571 }); 46572 case "openDialog": 46573 return _objectSpread(_objectSpread({}, initialState), {}, { 46574 isFileDialogActive: true 46575 }); 46576 case "closeDialog": 46577 return _objectSpread(_objectSpread({}, state), {}, { 46578 isFileDialogActive: false 46579 }); 46580 case "setDraggedFiles": 46581 return _objectSpread(_objectSpread({}, state), {}, { 46582 isDragActive: action.isDragActive, 46583 isDragAccept: action.isDragAccept, 46584 isDragReject: action.isDragReject 46585 }); 46586 case "setFiles": 46587 return _objectSpread(_objectSpread({}, state), {}, { 46588 acceptedFiles: action.acceptedFiles, 46589 fileRejections: action.fileRejections, 46590 isDragReject: action.isDragReject 46591 }); 46592 case "reset": 46593 return _objectSpread({}, initialState); 46594 default: 46595 return state; 46596 } 46597 } 46598 function noop$2() { 46599 } 46600 const variantStyles = { 46601 primary: lt$2` 46602 max-width: 200px; 46603 padding: var(--space-100) var(--space-200); 46604 border-radius: var(--panel-radius-normal); 46605 border: 1px solid var(--border-transparent); 46606 background: var(--bg-primary-invert); 46607 color: var(--text-primary-invert); 46608 font-size: var(--font-size-300); 46609 font-weight: var(--font-weight-500); 46610 line-height: var(--font-line-height-300); 46611 letter-spacing: var(--font-letter-spacing-loose); 46612 `, 46613 secondary: lt$2` 46614 max-width: 252px; 46615 padding: var(--space-200) var(--space-300); 46616 border-radius: var(--panel-radius-normal); 46617 border: 1px solid var(--border-secondary); 46618 background: var(--bg-primary); 46619 box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12); 46620 color: var(--text-secondary); 46621 font-size: var(--font-size-300); 46622 font-weight: var(--font-weight-400); 46623 line-height: var(--font-line-height-300); 46624 letter-spacing: var(--font-letter-spacing-loose); 46625 ` 46626 }; 46627 const Trigger = dt$2.div` 46628 display: inline-flex; 46629`; 46630 const Content$2 = dt$2.div( 46631 ({ $variant, $maxWidth }) => lt$2` 46632 display: inline-flex; 46633 justify-content: center;
46634 align-items: center; 46635 white-space: normal; 46636 text-align: left; 46637 46638 ${variantStyles[$variant]} 46639 46640 ${$maxWidth !== void 0 && lt$2` 46641 max-width: ${$maxWidth}px; 46642 `} 46643 ` 46644 ); 46645 const Tooltip = ({ 46646 content, 46647 children, 46648 variant = "primary", 46649 placement = variant === "secondary" ? "top" : "bottom", 46650 offset: offsetValue = 8, 46651 maxWidth, 46652 disabled = false, 46653 portal = true, 46654 interactive = false 46655 }) => { 46656 const [isOpen, setIsOpen] = reactExports.useState(false); 46657 const [dismissedByClick, setDismissedByClick] = reactExports.useState(false); 46658 const handleOpenChange = (open) => { 46659 setIsOpen(open); 46660 if (!open) setDismissedByClick(false); 46661 }; 46662 const { refs, floatingStyles, context } = useFloating({ 46663 open: isOpen && !disabled && !dismissedByClick, 46664 onOpenChange: handleOpenChange, 46665 placement, 46666 middleware: [ 46667 offset(offsetValue), 46668 flip({ fallbackPlacements: ["top", "bottom", "left", "right"] }), 46669 shift({ padding: 8 }) 46670 ], 46671 whileElementsMounted: autoUpdate 46672 }); 46673 const hover2 = useHover(context, { 46674 move: !interactive, 46675 handleClose: interactive ? safePolygon() : void 0 46676 }); 46677 const focus = useFocus(context); 46678 const dismiss2 = useDismiss(context, { ancestorScroll: true }); 46679 const role = useRole(context, { role: "tooltip" }); 46680 const { getReferenceProps, getFloatingProps } = useInteractions([hover2, focus, dismiss2, role]); 46681 const { isMounted, styles: transitionStyles } = useTransitionStyles(context, { 46682 duration: 150 46683 }); 46684 const floating = isMounted && content && /* @__PURE__ */ jsxRuntimeExports.jsx("div", __spreadProps(__spreadValues({ ref: refs.setFloating, style: __spreadProps(__spreadValues({}, floatingStyles), { zIndex: 1100 }) }, getFloatingProps()), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Content$2, { $variant: variant, $maxWidth: maxWidth, style: transitionStyles, children: content }) })); 46685 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
46686 /* @__PURE__ */ jsxRuntimeExports.jsx( 46687 Trigger, 46688 __spreadProps(__spreadValues({ 46689 ref: refs.setReference 46690 }, getReferenceProps({ 46691 onClick: () => setDismissedByClick(true), 46692 onMouseLeave: () => setDismissedByClick(false) 46693 })), { 46694 children 46695 }) 46696 ), 46697 portal ? /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingPortal, { children: floating }) : floating 46698 ] }); 46699 }; 46700 const Container$j = dt$2.span` 46701 display: inline-flex; 46702 align-items: center; 46703 vertical-align: middle; 46704 color: inherit; 46705 cursor: default; 46706`; 46707 const TooltipIcon = ({ 46708 size = 16, 46709 tooltipContent, 46710 placement, 46711 maxWidth 46712 }) => { 46713 if (!tooltipContent) { 46714 return null; 46715 } 46716 return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { content: tooltipContent, placement, maxWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Container$j, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(fr$2, { height: size, width: size }) }) }); 46717 }; 46718 const getDimension = (dimension) => { 46719 if (typeof dimension === "string") return dimension; 46720 if (typeof dimension === "number") return `${dimension}px`; 46721 }; 46722 const animationPulse = mt$2` 46723 0% { 46724 opacity: 1; 46725 } 46726 50% { 46727 opacity: 0.5; 46728 } 46729 100% { 46730 opacity: 1; 46731 } 46732`; 46733 const Skeleton$1 = dt$2.div` 46734 display: grid; 46735 46736 ${({ $gap }) => $gap && lt$2` 46737 gap: ${$gap}px; 46738 `} 46739 46740 ${({ $aligment }) => $aligment === "horizontal" && lt$2` 46741 grid-auto-columns: min-content; 46742 grid-auto-flow: column; 46743 `} 46744`; 46745 const Shape = dt$2.div` 46746 background-color: var(--bg-transparent-strong); 46747 background-size: 300% 300%; 46748 animation: ${animationPulse} 1s ease-in-out infinite alternate; 46749 width: ${({ $width }) => getDimension($width)}; 46750 height: ${({ $height }) => getDimension($height)}; 46751 border-radius: var(--panel-radius-normal); 46752 46753 ${({ $radius }) => $radius && lt$2` 46754 border-radius: ${$radius}; 46755 `} 46756`; 46757 const Skeleton = (_v) => { 46758 var _w = _v, { gap = 0, aligment = "vertical", children } = _w, props = __objRest(_w, ["gap", "aligment", "children"]); 46759 return /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, __spreadProps(__spreadValues({ $gap: gap, $aligment: aligment, "data-testid": "Skeleton" }, props), { children })); 46760 }; 46761 const SkeletonShape = (_x) => { 46762 var _y = _x, { 46763 variant = "rectangle", 46764 radius, 46765 width = "100%", 46766 height = "auto" 46767 } = _y, props = __objRest(_y, [ 46768 "variant", 46769 "radius", 46770 "width", 46771 "height" 46772 ]); 46773 return /* @__PURE__ */ jsxRuntimeExports.jsx( 46774 Shape, 46775 __spreadProps(__spreadValues({ 46776 $variant: variant, 46777 $radius: radius, 46778 $width: width, 46779 $height: height, 46780 "data-testid": "Skeleton.Shape" 46781 }, props), { 46782 children: "â" 46783 }) 46784 ); 46785 }; 46786 Skeleton.Shape = SkeletonShape; 46787 var FUNC_ERROR_TEXT = "Expected a function"; 46788 function negate(predicate) { 46789 if (typeof predicate != "function") { 46790 throw new TypeError(FUNC_ERROR_TEXT); 46791 } 46792 return function() { 46793 var args = arguments; 46794 switch (args.length) { 46795 case 0: 46796 return !predicate.call(this); 46797 case 1: 46798 return !predicate.call(this, args[0]); 46799 case 2: 46800 return !predicate.call(this, args[0], args[1]); 46801 case 3: 46802 return !predicate.call(this, args[0], args[1], args[2]); 46803 } 46804 return !predicate.apply(this, args); 46805 }; 46806 } 46807 function basePickBy(object2, paths, predicate) { 46808 var index2 = -1, length2 = paths.length, result = {}; 46809 while (++index2 < length2) { 46810 var path = paths[index2], value = baseGet(object2, path); 46811 if (predicate(value, path)) { 46812 baseSet(result, castPath(path, object2), value); 46813 } 46814 } 46815 return result; 46816 } 46817 function pickBy(object2, predicate) { 46818 if (object2 == null) { 46819 return {}; 46820 } 46821 var props = arrayMap(getAllKeysIn(object2), function(prop) { 46822 return [prop]; 46823 }); 46824 predicate = baseIteratee(predicate); 46825 return basePickBy(object2, props, function(value, path) { 46826 return predicate(value, path[0]); 46827 }); 46828 } 46829 function omitBy(object2, predicate) { 46830 return pickBy(object2, negate(baseIteratee(predicate))); 46831 } 46832 var lib; 46833 var hasRequiredLib;
vendor: 37,715 bytes, lines 46834-47664
46834 function requireLib() { 46835 if (hasRequiredLib) return lib; 46836 hasRequiredLib = 1; 46837 function _interopDefault(ex) { 46838 return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; 46839 } 46840 var React2 = requireReact(); 46841 var React__default = _interopDefault(React2); 46842 function _defineProperty2(obj, key, value) { 46843 if (key in obj) { 46844 Object.defineProperty(obj, key, { 46845 value, 46846 enumerable: true, 46847 configurable: true, 46848 writable: true 46849 }); 46850 } else { 46851 obj[key] = value; 46852 } 46853 return obj; 46854 } 46855 function _inheritsLoose(subClass, superClass) { 46856 subClass.prototype = Object.create(superClass.prototype); 46857 subClass.prototype.constructor = subClass; 46858 subClass.__proto__ = superClass; 46859 } 46860 var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); 46861 function withSideEffect2(reducePropsToState2, handleStateChangeOnClient, mapStateOnServer2) { 46862 if (typeof reducePropsToState2 !== "function") { 46863 throw new Error("Expected reducePropsToState to be a function."); 46864 } 46865 if (typeof handleStateChangeOnClient !== "function") { 46866 throw new Error("Expected handleStateChangeOnClient to be a function."); 46867 } 46868 if (typeof mapStateOnServer2 !== "undefined" && typeof mapStateOnServer2 !== "function") { 46869 throw new Error("Expected mapStateOnServer to either be undefined or a function."); 46870 } 46871 function getDisplayName(WrappedComponent) { 46872 return WrappedComponent.displayName || WrappedComponent.name || "Component"; 46873 } 46874 return function wrap2(WrappedComponent) { 46875 if (typeof WrappedComponent !== "function") { 46876 throw new Error("Expected WrappedComponent to be a React component."); 46877 } 46878 var mountedInstances = []; 46879 var state; 46880 function emitChange() { 46881 state = reducePropsToState2(mountedInstances.map(function(instance2) { 46882 return instance2.props; 46883 })); 46884 if (SideEffect.canUseDOM) { 46885 handleStateChangeOnClient(state); 46886 } else if (mapStateOnServer2) { 46887 state = mapStateOnServer2(state); 46888 } 46889 } 46890 var SideEffect = /* @__PURE__ */ (function(_PureComponent) { 46891 _inheritsLoose(SideEffect2, _PureComponent); 46892 function SideEffect2() { 46893 return _PureComponent.apply(this, arguments) || this; 46894 } 46895 SideEffect2.peek = function peek2() { 46896 return state; 46897 }; 46898 SideEffect2.rewind = function rewind() { 46899 if (SideEffect2.canUseDOM) { 46900 throw new Error("You may only call rewind() on the server. Call peek() to read the current state."); 46901 } 46902 var recordedState = state; 46903 state = void 0; 46904 mountedInstances = []; 46905 return recordedState; 46906 }; 46907 var _proto = SideEffect2.prototype; 46908 _proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() { 46909 mountedInstances.push(this); 46910 emitChange(); 46911 }; 46912 _proto.componentDidUpdate = function componentDidUpdate() { 46913 emitChange(); 46914 }; 46915 _proto.componentWillUnmount = function componentWillUnmount() { 46916 var index2 = mountedInstances.indexOf(this); 46917 mountedInstances.splice(index2, 1); 46918 emitChange(); 46919 }; 46920 _proto.render = function render() { 46921 return React__default.createElement(WrappedComponent, this.props); 46922 }; 46923 return SideEffect2; 46924 })(React2.PureComponent); 46925 _defineProperty2(SideEffect, "displayName", "SideEffect(" + getDisplayName(WrappedComponent) + ")"); 46926 _defineProperty2(SideEffect, "canUseDOM", canUseDOM); 46927 return SideEffect; 46928 }; 46929 } 46930 lib = withSideEffect2; 46931 return lib; 46932 } 46933 var libExports = requireLib(); 46934 const withSideEffect = /* @__PURE__ */ getDefaultExportFromCjs(libExports); 46935 var reactFastCompare; 46936 var hasRequiredReactFastCompare; 46937 function requireReactFastCompare() { 46938 if (hasRequiredReactFastCompare) return reactFastCompare; 46939 hasRequiredReactFastCompare = 1; 46940 var hasElementType = typeof Element !== "undefined"; 46941 var hasMap = typeof Map === "function"; 46942 var hasSet = typeof Set === "function"; 46943 var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView; 46944 function equal(a2, b2) { 46945 if (a2 === b2) return true; 46946 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { 46947 if (a2.constructor !== b2.constructor) return false; 46948 var length2, i2, keys2; 46949 if (Array.isArray(a2)) { 46950 length2 = a2.length; 46951 if (length2 != b2.length) return false; 46952 for (i2 = length2; i2-- !== 0; ) 46953 if (!equal(a2[i2], b2[i2])) return false; 46954 return true; 46955 } 46956 var it2; 46957 if (hasMap && a2 instanceof Map && b2 instanceof Map) { 46958 if (a2.size !== b2.size) return false; 46959 it2 = a2.entries(); 46960 while (!(i2 = it2.next()).done) 46961 if (!b2.has(i2.value[0])) return false; 46962 it2 = a2.entries(); 46963 while (!(i2 = it2.next()).done) 46964 if (!equal(i2.value[1], b2.get(i2.value[0]))) return false; 46965 return true; 46966 } 46967 if (hasSet && a2 instanceof Set && b2 instanceof Set) { 46968 if (a2.size !== b2.size) return false; 46969 it2 = a2.entries(); 46970 while (!(i2 = it2.next()).done) 46971 if (!b2.has(i2.value[0])) return false; 46972 return true; 46973 } 46974 if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { 46975 length2 = a2.length; 46976 if (length2 != b2.length) return false; 46977 for (i2 = length2; i2-- !== 0; ) 46978 if (a2[i2] !== b2[i2]) return false; 46979 return true; 46980 } 46981 if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; 46982 if (a2.valueOf !== Object.prototype.valueOf && typeof a2.valueOf === "function" && typeof b2.valueOf === "function") return a2.valueOf() === b2.valueOf(); 46983 if (a2.toString !== Object.prototype.toString && typeof a2.toString === "function" && typeof b2.toString === "function") return a2.toString() === b2.toString(); 46984 keys2 = Object.keys(a2); 46985 length2 = keys2.length; 46986 if (length2 !== Object.keys(b2).length) return false; 46987 for (i2 = length2; i2-- !== 0; ) 46988 if (!Object.prototype.hasOwnProperty.call(b2, keys2[i2])) return false; 46989 if (hasElementType && a2 instanceof Element) return false; 46990 for (i2 = length2; i2-- !== 0; ) { 46991 if ((keys2[i2] === "_owner" || keys2[i2] === "__v" || keys2[i2] === "__o") && a2.$$typeof) { 46992 continue; 46993 } 46994 if (!equal(a2[keys2[i2]], b2[keys2[i2]])) return false; 46995 } 46996 return true; 46997 } 46998 return a2 !== a2 && b2 !== b2; 46999 } 47000 reactFastCompare = function isEqual2(a2, b2) { 47001 try { 47002 return equal(a2, b2); 47003 } catch (error) { 47004 if ((error.message || "").match(/stack|recursion/i)) { 47005 console.warn("react-fast-compare cannot handle circular refs"); 47006 return false; 47007 } 47008 throw error; 47009 } 47010 }; 47011 return reactFastCompare; 47012 } 47013 var reactFastCompareExports = requireReactFastCompare(); 47014 const isEqual = /* @__PURE__ */ getDefaultExportFromCjs(reactFastCompareExports); 47015 /* 47016 object-assign 47017 (c) Sindre Sorhus 47018 @license MIT 47019 */ 47020 var objectAssign$1; 47021 var hasRequiredObjectAssign; 47022 function requireObjectAssign() { 47023 if (hasRequiredObjectAssign) return objectAssign$1; 47024 hasRequiredObjectAssign = 1; 47025 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 47026 var hasOwnProperty2 = Object.prototype.hasOwnProperty; 47027 var propIsEnumerable = Object.prototype.propertyIsEnumerable; 47028 function toObject(val) { 47029 if (val === null || val === void 0) { 47030 throw new TypeError("Object.assign cannot be called with null or undefined"); 47031 } 47032 return Object(val); 47033 } 47034 function shouldUseNative() { 47035 try { 47036 if (!Object.assign) { 47037 return false; 47038 } 47039 var test1 = new String("abc"); 47040 test1[5] = "de"; 47041 if (Object.getOwnPropertyNames(test1)[0] === "5") { 47042 return false; 47043 } 47044 var test2 = {}; 47045 for (var i2 = 0; i2 < 10; i2++) { 47046 test2["_" + String.fromCharCode(i2)] = i2; 47047 } 47048 var order2 = Object.getOwnPropertyNames(test2).map(function(n2) { 47049 return test2[n2]; 47050 }); 47051 if (order2.join("") !== "0123456789") { 47052 return false; 47053 } 47054 var test3 = {}; 47055 "abcdefghijklmnopqrst".split("").forEach(function(letter) { 47056 test3[letter] = letter; 47057 }); 47058 if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { 47059 return false; 47060 } 47061 return true; 47062 } catch (err) { 47063 return false; 47064 } 47065 } 47066 objectAssign$1 = shouldUseNative() ? Object.assign : function(target, source) { 47067 var from2; 47068 var to2 = toObject(target); 47069 var symbols; 47070 for (var s2 = 1; s2 < arguments.length; s2++) { 47071 from2 = Object(arguments[s2]); 47072 for (var key in from2) { 47073 if (hasOwnProperty2.call(from2, key)) { 47074 to2[key] = from2[key]; 47075 } 47076 } 47077 if (getOwnPropertySymbols) { 47078 symbols = getOwnPropertySymbols(from2); 47079 for (var i2 = 0; i2 < symbols.length; i2++) { 47080 if (propIsEnumerable.call(from2, symbols[i2])) { 47081 to2[symbols[i2]] = from2[symbols[i2]]; 47082 } 47083 } 47084 } 47085 } 47086 return to2; 47087 }; 47088 return objectAssign$1; 47089 } 47090 var objectAssignExports = requireObjectAssign(); 47091 const objectAssign = /* @__PURE__ */ getDefaultExportFromCjs(objectAssignExports); 47092 var ATTRIBUTE_NAMES = { 47093 BODY: "bodyAttributes", 47094 HTML: "htmlAttributes", 47095 TITLE: "titleAttributes" 47096 }; 47097 var TAG_NAMES = { 47098 BASE: "base", 47099 BODY: "body", 47100 HEAD: "head", 47101 HTML: "html", 47102 LINK: "link", 47103 META: "meta", 47104 NOSCRIPT: "noscript", 47105 SCRIPT: "script", 47106 STYLE: "style", 47107 TITLE: "title" 47108 }; 47109 Object.keys(TAG_NAMES).map(function(name) { 47110 return TAG_NAMES[name]; 47111 }); 47112 var TAG_PROPERTIES = { 47113 CHARSET: "charset", 47114 CSS_TEXT: "cssText", 47115 HREF: "href", 47116 HTTPEQUIV: "http-equiv", 47117 INNER_HTML: "innerHTML", 47118 ITEM_PROP: "itemprop", 47119 NAME: "name", 47120 PROPERTY: "property", 47121 REL: "rel", 47122 SRC: "src", 47123 TARGET: "target" 47124 }; 47125 var REACT_TAG_MAP = { 47126 accesskey: "accessKey", 47127 charset: "charSet", 47128 class: "className", 47129 contenteditable: "contentEditable", 47130 contextmenu: "contextMenu", 47131 "http-equiv": "httpEquiv", 47132 itemprop: "itemProp", 47133 tabindex: "tabIndex" 47134 }; 47135 var HELMET_PROPS = { 47136 DEFAULT_TITLE: "defaultTitle", 47137 DEFER: "defer", 47138 ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters", 47139 ON_CHANGE_CLIENT_STATE: "onChangeClientState", 47140 TITLE_TEMPLATE: "titleTemplate" 47141 }; 47142 var HTML_TAG_MAP = Object.keys(REACT_TAG_MAP).reduce(function(obj, key) { 47143 obj[REACT_TAG_MAP[key]] = key; 47144 return obj; 47145 }, {}); 47146 var SELF_CLOSING_TAGS = [TAG_NAMES.NOSCRIPT, TAG_NAMES.SCRIPT, TAG_NAMES.STYLE]; 47147 var HELMET_ATTRIBUTE = "data-react-helmet"; 47148 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { 47149 return typeof obj; 47150 } : function(obj) { 47151 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 47152 }; 47153 var classCallCheck = function(instance2, Constructor) { 47154 if (!(instance2 instanceof Constructor)) { 47155 throw new TypeError("Cannot call a class as a function"); 47156 } 47157 }; 47158 var createClass = /* @__PURE__ */ (function() { 47159 function defineProperties(target, props) { 47160 for (var i2 = 0; i2 < props.length; i2++) { 47161 var descriptor = props[i2]; 47162 descriptor.enumerable = descriptor.enumerable || false; 47163 descriptor.configurable = true; 47164 if ("value" in descriptor) descriptor.writable = true; 47165 Object.defineProperty(target, descriptor.key, descriptor); 47166 } 47167 } 47168 return function(Constructor, protoProps, staticProps) { 47169 if (protoProps) defineProperties(Constructor.prototype, protoProps); 47170 if (staticProps) defineProperties(Constructor, staticProps); 47171 return Constructor; 47172 }; 47173 })(); 47174 var _extends$5 = Object.assign || function(target) { 47175 for (var i2 = 1; i2 < arguments.length; i2++) { 47176 var source = arguments[i2]; 47177 for (var key in source) { 47178 if (Object.prototype.hasOwnProperty.call(source, key)) { 47179 target[key] = source[key]; 47180 } 47181 } 47182 } 47183 return target; 47184 }; 47185 var inherits = function(subClass, superClass) { 47186 if (typeof superClass !== "function" && superClass !== null) { 47187 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 47188 } 47189 subClass.prototype = Object.create(superClass && superClass.prototype, { 47190 constructor: { 47191 value: subClass, 47192 enumerable: false, 47193 writable: true, 47194 configurable: true 47195 } 47196 }); 47197 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 47198 }; 47199 var objectWithoutProperties = function(obj, keys2) { 47200 var target = {}; 47201 for (var i2 in obj) { 47202 if (keys2.indexOf(i2) >= 0) continue; 47203 if (!Object.prototype.hasOwnProperty.call(obj, i2)) continue; 47204 target[i2] = obj[i2]; 47205 } 47206 return target; 47207 }; 47208 var possibleConstructorReturn = function(self2, call) { 47209 if (!self2) { 47210 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 47211 } 47212 return call && (typeof call === "object" || typeof call === "function") ? call : self2; 47213 }; 47214 var encodeSpecialCharacters = function encodeSpecialCharacters2(str) { 47215 var encode2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; 47216 if (encode2 === false) { 47217 return String(str); 47218 } 47219 return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); 47220 }; 47221 var getTitleFromPropsList = function getTitleFromPropsList2(propsList) { 47222 var innermostTitle = getInnermostProperty(propsList, TAG_NAMES.TITLE); 47223 var innermostTemplate = getInnermostProperty(propsList, HELMET_PROPS.TITLE_TEMPLATE); 47224 if (innermostTemplate && innermostTitle) { 47225 return innermostTemplate.replace(/%s/g, function() { 47226 return Array.isArray(innermostTitle) ? innermostTitle.join("") : innermostTitle; 47227 }); 47228 } 47229 var innermostDefaultTitle = getInnermostProperty(propsList, HELMET_PROPS.DEFAULT_TITLE); 47230 return innermostTitle || innermostDefaultTitle || void 0; 47231 }; 47232 var getOnChangeClientState = function getOnChangeClientState2(propsList) { 47233 return getInnermostProperty(propsList, HELMET_PROPS.ON_CHANGE_CLIENT_STATE) || function() { 47234 }; 47235 }; 47236 var getAttributesFromPropsList = function getAttributesFromPropsList2(tagType, propsList) { 47237 return propsList.filter(function(props) { 47238 return typeof props[tagType] !== "undefined"; 47239 }).map(function(props) { 47240 return props[tagType]; 47241 }).reduce(function(tagAttrs, current) { 47242 return _extends$5({}, tagAttrs, current); 47243 }, {}); 47244 }; 47245 var getBaseTagFromPropsList = function getBaseTagFromPropsList2(primaryAttributes, propsList) { 47246 return propsList.filter(function(props) { 47247 return typeof props[TAG_NAMES.BASE] !== "undefined"; 47248 }).map(function(props) { 47249 return props[TAG_NAMES.BASE]; 47250 }).reverse().reduce(function(innermostBaseTag, tag) { 47251 if (!innermostBaseTag.length) { 47252 var keys2 = Object.keys(tag); 47253 for (var i2 = 0; i2 < keys2.length; i2++) { 47254 var attributeKey = keys2[i2]; 47255 var lowerCaseAttributeKey = attributeKey.toLowerCase(); 47256 if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && tag[lowerCaseAttributeKey]) { 47257 return innermostBaseTag.concat(tag); 47258 } 47259 } 47260 } 47261 return innermostBaseTag; 47262 }, []); 47263 }; 47264 var getTagsFromPropsList = function getTagsFromPropsList2(tagName, primaryAttributes, propsList) { 47265 var approvedSeenTags = {}; 47266 return propsList.filter(function(props) { 47267 if (Array.isArray(props[tagName])) { 47268 return true; 47269 } 47270 if (typeof props[tagName] !== "undefined") { 47271 warn$1("Helmet: " + tagName + ' should be of type "Array". Instead found type "' + _typeof(props[tagName]) + '"'); 47272 } 47273 return false; 47274 }).map(function(props) { 47275 return props[tagName]; 47276 }).reverse().reduce(function(approvedTags, instanceTags) { 47277 var instanceSeenTags = {}; 47278 instanceTags.filter(function(tag) { 47279 var primaryAttributeKey = void 0; 47280 var keys22 = Object.keys(tag); 47281 for (var i22 = 0; i22 < keys22.length; i22++) { 47282 var attributeKey2 = keys22[i22]; 47283 var lowerCaseAttributeKey = attributeKey2.toLowerCase(); 47284 if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === TAG_PROPERTIES.REL && tag[primaryAttributeKey].toLowerCase() === "canonical") && !(lowerCaseAttributeKey === TAG_PROPERTIES.REL && tag[lowerCaseAttributeKey].toLowerCase() === "stylesheet")) { 47285 primaryAttributeKey = lowerCaseAttributeKey; 47286 } 47287 if (primaryAttributes.indexOf(attributeKey2) !== -1 && (attributeKey2 === TAG_PROPERTIES.INNER_HTML || attributeKey2 === TAG_PROPERTIES.CSS_TEXT || attributeKey2 === TAG_PROPERTIES.ITEM_PROP)) { 47288 primaryAttributeKey = attributeKey2; 47289 } 47290 } 47291 if (!primaryAttributeKey || !tag[primaryAttributeKey]) { 47292 return false; 47293 } 47294 var value = tag[primaryAttributeKey].toLowerCase(); 47295 if (!approvedSeenTags[primaryAttributeKey]) { 47296 approvedSeenTags[primaryAttributeKey] = {}; 47297 } 47298 if (!instanceSeenTags[primaryAttributeKey]) { 47299 instanceSeenTags[primaryAttributeKey] = {}; 47300 } 47301 if (!approvedSeenTags[primaryAttributeKey][value]) { 47302 instanceSeenTags[primaryAttributeKey][value] = true; 47303 return true; 47304 } 47305 return false; 47306 }).reverse().forEach(function(tag) { 47307 return approvedTags.push(tag); 47308 }); 47309 var keys2 = Object.keys(instanceSeenTags); 47310 for (var i2 = 0; i2 < keys2.length; i2++) { 47311 var attributeKey = keys2[i2]; 47312 var tagUnion = objectAssign({}, approvedSeenTags[attributeKey], instanceSeenTags[attributeKey]); 47313 approvedSeenTags[attributeKey] = tagUnion; 47314 } 47315 return approvedTags; 47316 }, []).reverse(); 47317 }; 47318 var getInnermostProperty = function getInnermostProperty2(propsList, property2) { 47319 for (var i2 = propsList.length - 1; i2 >= 0; i2--) { 47320 var props = propsList[i2]; 47321 if (props.hasOwnProperty(property2)) { 47322 return props[property2]; 47323 } 47324 } 47325 return null; 47326 }; 47327 var reducePropsToState = function reducePropsToState2(propsList) { 47328 return { 47329 baseTag: getBaseTagFromPropsList([TAG_PROPERTIES.HREF, TAG_PROPERTIES.TARGET], propsList), 47330 bodyAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.BODY, propsList), 47331 defer: getInnermostProperty(propsList, HELMET_PROPS.DEFER), 47332 encode: getInnermostProperty(propsList, HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS), 47333 htmlAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.HTML, propsList), 47334 linkTags: getTagsFromPropsList(TAG_NAMES.LINK, [TAG_PROPERTIES.REL, TAG_PROPERTIES.HREF], propsList), 47335 metaTags: getTagsFromPropsList(TAG_NAMES.META, [TAG_PROPERTIES.NAME, TAG_PROPERTIES.CHARSET, TAG_PROPERTIES.HTTPEQUIV, TAG_PROPERTIES.PROPERTY, TAG_PROPERTIES.ITEM_PROP], propsList), 47336 noscriptTags: getTagsFromPropsList(TAG_NAMES.NOSCRIPT, [TAG_PROPERTIES.INNER_HTML], propsList), 47337 onChangeClientState: getOnChangeClientState(propsList), 47338 scriptTags: getTagsFromPropsList(TAG_NAMES.SCRIPT, [TAG_PROPERTIES.SRC, TAG_PROPERTIES.INNER_HTML], propsList), 47339 styleTags: getTagsFromPropsList(TAG_NAMES.STYLE, [TAG_PROPERTIES.CSS_TEXT], propsList), 47340 title: getTitleFromPropsList(propsList), 47341 titleAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.TITLE, propsList) 47342 }; 47343 }; 47344 var rafPolyfill = (function() { 47345 var clock = Date.now(); 47346 return function(callback) { 47347 var currentTime = Date.now(); 47348 if (currentTime - clock > 16) { 47349 clock = currentTime; 47350 callback(currentTime); 47351 } else { 47352 setTimeout(function() { 47353 rafPolyfill(callback); 47354 }, 0); 47355 } 47356 }; 47357 })(); 47358 var cafPolyfill = function cafPolyfill2(id2) { 47359 return clearTimeout(id2); 47360 }; 47361 var requestAnimationFrame$1 = typeof window !== "undefined" ? window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || rafPolyfill : global.requestAnimationFrame || rafPolyfill; 47362 var cancelAnimationFrame$1 = typeof window !== "undefined" ? window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || cafPolyfill : global.cancelAnimationFrame || cafPolyfill; 47363 var warn$1 = function warn2(msg) { 47364 return console && typeof console.warn === "function" && console.warn(msg); 47365 }; 47366 var _helmetCallback = null; 47367 var handleClientStateChange = function handleClientStateChange2(newState) { 47368 if (_helmetCallback) { 47369 cancelAnimationFrame$1(_helmetCallback); 47370 } 47371 if (newState.defer) { 47372 _helmetCallback = requestAnimationFrame$1(function() { 47373 commitTagChanges(newState, function() { 47374 _helmetCallback = null; 47375 }); 47376 }); 47377 } else { 47378 commitTagChanges(newState); 47379 _helmetCallback = null; 47380 } 47381 }; 47382 var commitTagChanges = function commitTagChanges2(newState, cb) { 47383 var baseTag = newState.baseTag, bodyAttributes = newState.bodyAttributes, htmlAttributes = newState.htmlAttributes, linkTags = newState.linkTags, metaTags = newState.metaTags, noscriptTags = newState.noscriptTags, onChangeClientState = newState.onChangeClientState, scriptTags = newState.scriptTags, styleTags = newState.styleTags, title = newState.title, titleAttributes = newState.titleAttributes; 47384 updateAttributes(TAG_NAMES.BODY, bodyAttributes); 47385 updateAttributes(TAG_NAMES.HTML, htmlAttributes); 47386 updateTitle(title, titleAttributes); 47387 var tagUpdates = { 47388 baseTag: updateTags(TAG_NAMES.BASE, baseTag), 47389 linkTags: updateTags(TAG_NAMES.LINK, linkTags), 47390 metaTags: updateTags(TAG_NAMES.META, metaTags), 47391 noscriptTags: updateTags(TAG_NAMES.NOSCRIPT, noscriptTags), 47392 scriptTags: updateTags(TAG_NAMES.SCRIPT, scriptTags), 47393 styleTags: updateTags(TAG_NAMES.STYLE, styleTags) 47394 }; 47395 var addedTags = {}; 47396 var removedTags = {}; 47397 Object.keys(tagUpdates).forEach(function(tagType) { 47398 var _tagUpdates$tagType = tagUpdates[tagType], newTags = _tagUpdates$tagType.newTags, oldTags = _tagUpdates$tagType.oldTags; 47399 if (newTags.length) { 47400 addedTags[tagType] = newTags; 47401 } 47402 if (oldTags.length) { 47403 removedTags[tagType] = tagUpdates[tagType].oldTags; 47404 } 47405 }); 47406 cb && cb(); 47407 onChangeClientState(newState, addedTags, removedTags); 47408 }; 47409 var flattenArray = function flattenArray2(possibleArray) { 47410 return Array.isArray(possibleArray) ? possibleArray.join("") : possibleArray; 47411 }; 47412 var updateTitle = function updateTitle2(title, attributes) { 47413 if (typeof title !== "undefined" && document.title !== title) { 47414 document.title = flattenArray(title); 47415 } 47416 updateAttributes(TAG_NAMES.TITLE, attributes); 47417 }; 47418 var updateAttributes = function updateAttributes2(tagName, attributes) { 47419 var elementTag = document.getElementsByTagName(tagName)[0]; 47420 if (!elementTag) { 47421 return; 47422 } 47423 var helmetAttributeString = elementTag.getAttribute(HELMET_ATTRIBUTE); 47424 var helmetAttributes = helmetAttributeString ? helmetAttributeString.split(",") : []; 47425 var attributesToRemove = [].concat(helmetAttributes); 47426 var attributeKeys = Object.keys(attributes); 47427 for (var i2 = 0; i2 < attributeKeys.length; i2++) { 47428 var attribute2 = attributeKeys[i2]; 47429 var value = attributes[attribute2] || ""; 47430 if (elementTag.getAttribute(attribute2) !== value) { 47431 elementTag.setAttribute(attribute2, value); 47432 } 47433 if (helmetAttributes.indexOf(attribute2) === -1) { 47434 helmetAttributes.push(attribute2); 47435 } 47436 var indexToSave = attributesToRemove.indexOf(attribute2); 47437 if (indexToSave !== -1) { 47438 attributesToRemove.splice(indexToSave, 1); 47439 } 47440 } 47441 for (var _i2 = attributesToRemove.length - 1; _i2 >= 0; _i2--) { 47442 elementTag.removeAttribute(attributesToRemove[_i2]); 47443 } 47444 if (helmetAttributes.length === attributesToRemove.length) { 47445 elementTag.removeAttribute(HELMET_ATTRIBUTE); 47446 } else if (elementTag.getAttribute(HELMET_ATTRIBUTE) !== attributeKeys.join(",")) { 47447 elementTag.setAttribute(HELMET_ATTRIBUTE, attributeKeys.join(",")); 47448 } 47449 }; 47450 var updateTags = function updateTags2(type, tags) { 47451 var headElement = document.head || document.querySelector(TAG_NAMES.HEAD); 47452 var tagNodes = headElement.querySelectorAll(type + "[" + HELMET_ATTRIBUTE + "]"); 47453 var oldTags = Array.prototype.slice.call(tagNodes); 47454 var newTags = []; 47455 var indexToDelete = void 0; 47456 if (tags && tags.length) { 47457 tags.forEach(function(tag) { 47458 var newElement = document.createElement(type); 47459 for (var attribute2 in tag) { 47460 if (tag.hasOwnProperty(attribute2)) { 47461 if (attribute2 === TAG_PROPERTIES.INNER_HTML) { 47462 newElement.innerHTML = tag.innerHTML; 47463 } else if (attribute2 === TAG_PROPERTIES.CSS_TEXT) { 47464 if (newElement.styleSheet) { 47465 newElement.styleSheet.cssText = tag.cssText; 47466 } else { 47467 newElement.appendChild(document.createTextNode(tag.cssText)); 47468 } 47469 } else { 47470 var value = typeof tag[attribute2] === "undefined" ? "" : tag[attribute2]; 47471 newElement.setAttribute(attribute2, value); 47472 } 47473 } 47474 } 47475 newElement.setAttribute(HELMET_ATTRIBUTE, "true"); 47476 if (oldTags.some(function(existingTag, index2) { 47477 indexToDelete = index2; 47478 return newElement.isEqualNode(existingTag); 47479 })) { 47480 oldTags.splice(indexToDelete, 1); 47481 } else { 47482 newTags.push(newElement); 47483 } 47484 }); 47485 } 47486 oldTags.forEach(function(tag) { 47487 return tag.parentNode.removeChild(tag); 47488 }); 47489 newTags.forEach(function(tag) { 47490 return headElement.appendChild(tag); 47491 }); 47492 return { 47493 oldTags, 47494 newTags 47495 }; 47496 }; 47497 var generateElementAttributesAsString = function generateElementAttributesAsString2(attributes) { 47498 return Object.keys(attributes).reduce(function(str, key) { 47499 var attr2 = typeof attributes[key] !== "undefined" ? key + '="' + attributes[key] + '"' : "" + key; 47500 return str ? str + " " + attr2 : attr2; 47501 }, ""); 47502 }; 47503 var generateTitleAsString = function generateTitleAsString2(type, title, attributes, encode2) { 47504 var attributeString = generateElementAttributesAsString(attributes); 47505 var flattenedTitle = flattenArray(title); 47506 return attributeString ? "<" + type + " " + HELMET_ATTRIBUTE + '="true" ' + attributeString + ">" + encodeSpecialCharacters(flattenedTitle, encode2) + "</" + type + ">" : "<" + type + " " + HELMET_ATTRIBUTE + '="true">' + encodeSpecialCharacters(flattenedTitle, encode2) + "</" + type + ">"; 47507 }; 47508 var generateTagsAsString = function generateTagsAsString2(type, tags, encode2) { 47509 return tags.reduce(function(str, tag) { 47510 var attributeHtml = Object.keys(tag).filter(function(attribute2) { 47511 return !(attribute2 === TAG_PROPERTIES.INNER_HTML || attribute2 === TAG_PROPERTIES.CSS_TEXT); 47512 }).reduce(function(string2, attribute2) { 47513 var attr2 = typeof tag[attribute2] === "undefined" ? attribute2 : attribute2 + '="' + encodeSpecialCharacters(tag[attribute2], encode2) + '"'; 47514 return string2 ? string2 + " " + attr2 : attr2; 47515 }, ""); 47516 var tagContent = tag.innerHTML || tag.cssText || ""; 47517 var isSelfClosing = SELF_CLOSING_TAGS.indexOf(type) === -1; 47518 return str + "<" + type + " " + HELMET_ATTRIBUTE + '="true" ' + attributeHtml + (isSelfClosing ? "/>" : ">" + tagContent + "</" + type + ">"); 47519 }, ""); 47520 }; 47521 var convertElementAttributestoReactProps = function convertElementAttributestoReactProps2(attributes) { 47522 var initProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 47523 return Object.keys(attributes).reduce(function(obj, key) { 47524 obj[REACT_TAG_MAP[key] || key] = attributes[key]; 47525 return obj; 47526 }, initProps); 47527 }; 47528 var convertReactPropstoHtmlAttributes = function convertReactPropstoHtmlAttributes2(props) { 47529 var initAttributes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 47530 return Object.keys(props).reduce(function(obj, key) { 47531 obj[HTML_TAG_MAP[key] || key] = props[key]; 47532 return obj; 47533 }, initAttributes); 47534 }; 47535 var generateTitleAsReactComponent = function generateTitleAsReactComponent2(type, title, attributes) { 47536 var _initProps; 47537 var initProps = (_initProps = { 47538 key: title 47539 }, _initProps[HELMET_ATTRIBUTE] = true, _initProps); 47540 var props = convertElementAttributestoReactProps(attributes, initProps); 47541 return [e$3.createElement(TAG_NAMES.TITLE, props, title)]; 47542 }; 47543 var generateTagsAsReactComponent = function generateTagsAsReactComponent2(type, tags) { 47544 return tags.map(function(tag, i2) { 47545 var _mappedTag; 47546 var mappedTag = (_mappedTag = { 47547 key: i2 47548 }, _mappedTag[HELMET_ATTRIBUTE] = true, _mappedTag); 47549 Object.keys(tag).forEach(function(attribute2) { 47550 var mappedAttribute = REACT_TAG_MAP[attribute2] || attribute2; 47551 if (mappedAttribute === TAG_PROPERTIES.INNER_HTML || mappedAttribute === TAG_PROPERTIES.CSS_TEXT) { 47552 var content = tag.innerHTML || tag.cssText; 47553 mappedTag.dangerouslySetInnerHTML = { __html: content }; 47554 } else { 47555 mappedTag[mappedAttribute] = tag[attribute2]; 47556 } 47557 }); 47558 return e$3.createElement(type, mappedTag); 47559 }); 47560 }; 47561 var getMethodsForTag = function getMethodsForTag2(type, tags, encode2) { 47562 switch (type) { 47563 case TAG_NAMES.TITLE: 47564 return { 47565 toComponent: function toComponent() { 47566 return generateTitleAsReactComponent(type, tags.title, tags.titleAttributes); 47567 }, 47568 toString: function toString2() { 47569 return generateTitleAsString(type, tags.title, tags.titleAttributes, encode2); 47570 } 47571 }; 47572 case ATTRIBUTE_NAMES.BODY: 47573 case ATTRIBUTE_NAMES.HTML: 47574 return { 47575 toComponent: function toComponent() { 47576 return convertElementAttributestoReactProps(tags); 47577 }, 47578 toString: function toString2() { 47579 return generateElementAttributesAsString(tags); 47580 } 47581 }; 47582 default: 47583 return { 47584 toComponent: function toComponent() { 47585 return generateTagsAsReactComponent(type, tags); 47586 }, 47587 toString: function toString2() { 47588 return generateTagsAsString(type, tags, encode2); 47589 } 47590 }; 47591 } 47592 }; 47593 var mapStateOnServer = function mapStateOnServer2(_ref2) { 47594 var baseTag = _ref2.baseTag, bodyAttributes = _ref2.bodyAttributes, encode2 = _ref2.encode, htmlAttributes = _ref2.htmlAttributes, linkTags = _ref2.linkTags, metaTags = _ref2.metaTags, noscriptTags = _ref2.noscriptTags, scriptTags = _ref2.scriptTags, styleTags = _ref2.styleTags, _ref$title = _ref2.title, title = _ref$title === void 0 ? "" : _ref$title, titleAttributes = _ref2.titleAttributes; 47595 return { 47596 base: getMethodsForTag(TAG_NAMES.BASE, baseTag, encode2), 47597 bodyAttributes: getMethodsForTag(ATTRIBUTE_NAMES.BODY, bodyAttributes, encode2), 47598 htmlAttributes: getMethodsForTag(ATTRIBUTE_NAMES.HTML, htmlAttributes, encode2), 47599 link: getMethodsForTag(TAG_NAMES.LINK, linkTags, encode2), 47600 meta: getMethodsForTag(TAG_NAMES.META, metaTags, encode2), 47601 noscript: getMethodsForTag(TAG_NAMES.NOSCRIPT, noscriptTags, encode2), 47602 script: getMethodsForTag(TAG_NAMES.SCRIPT, scriptTags, encode2), 47603 style: getMethodsForTag(TAG_NAMES.STYLE, styleTags, encode2), 47604 title: getMethodsForTag(TAG_NAMES.TITLE, { title, titleAttributes }, encode2) 47605 }; 47606 }; 47607 var Helmet = function Helmet2(Component) { 47608 var _class, _temp; 47609 return _temp = _class = (function(_React$Component) { 47610 inherits(HelmetWrapper, _React$Component); 47611 function HelmetWrapper() { 47612 classCallCheck(this, HelmetWrapper); 47613 return possibleConstructorReturn(this, _React$Component.apply(this, arguments)); 47614 } 47615 HelmetWrapper.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { 47616 return !isEqual(this.props, nextProps); 47617 }; 47618 HelmetWrapper.prototype.mapNestedChildrenToProps = function mapNestedChildrenToProps(child, nestedChildren) { 47619 if (!nestedChildren) { 47620 return null; 47621 } 47622 switch (child.type) { 47623 case TAG_NAMES.SCRIPT: 47624 case TAG_NAMES.NOSCRIPT: 47625 return { 47626 innerHTML: nestedChildren 47627 }; 47628 case TAG_NAMES.STYLE: 47629 return { 47630 cssText: nestedChildren 47631 }; 47632 } 47633 throw new Error("<" + child.type + " /> elements are self-closing and can not contain children. Refer to our API for more information."); 47634 }; 47635 HelmetWrapper.prototype.flattenArrayTypeChildren = function flattenArrayTypeChildren(_ref2) { 47636 var _babelHelpers$extends; 47637 var child = _ref2.child, arrayTypeChildren = _ref2.arrayTypeChildren, newChildProps = _ref2.newChildProps, nestedChildren = _ref2.nestedChildren; 47638 return _extends$5({}, arrayTypeChildren, (_babelHelpers$extends = {}, _babelHelpers$extends[child.type] = [].concat(arrayTypeChildren[child.type] || [], [_extends$5({}, newChildProps, this.mapNestedChildrenToProps(child, nestedChildren))]), _babelHelpers$extends)); 47639 }; 47640 HelmetWrapper.prototype.mapObjectTypeChildren = function mapObjectTypeChildren(_ref2) { 47641 var _babelHelpers$extends2, _babelHelpers$extends3; 47642 var child = _ref2.child, newProps = _ref2.newProps, newChildProps = _ref2.newChildProps, nestedChildren = _ref2.nestedChildren; 47643 switch (child.type) { 47644 case TAG_NAMES.TITLE: 47645 return _extends$5({}, newProps, (_babelHelpers$extends2 = {}, _babelHelpers$extends2[child.type] = nestedChildren, _babelHelpers$extends2.titleAttributes = _extends$5({}, newChildProps), _babelHelpers$extends2)); 47646 case TAG_NAMES.BODY: 47647 return _extends$5({}, newProps, { 47648 bodyAttributes: _extends$5({}, newChildProps) 47649 }); 47650 case TAG_NAMES.HTML: 47651 return _extends$5({}, newProps, { 47652 htmlAttributes: _extends$5({}, newChildProps) 47653 }); 47654 } 47655 return _extends$5({}, newProps, (_babelHelpers$extends3 = {}, _babelHelpers$extends3[child.type] = _extends$5({}, newChildProps), _babelHelpers$extends3)); 47656 }; 47657 HelmetWrapper.prototype.mapArrayTypeChildrenToProps = function mapArrayTypeChildrenToProps(arrayTypeChildren, newProps) { 47658 var newFlattenedProps = _extends$5({}, newProps); 47659 Object.keys(arrayTypeChildren).forEach(function(arrayChildName) { 47660 var _babelHelpers$extends4; 47661 newFlattenedProps = _extends$5({}, newFlattenedProps, (_babelHelpers$extends4 = {}, _babelHelpers$extends4[arrayChildName] = arrayTypeChildren[arrayChildName], _babelHelpers$extends4)); 47662 }); 47663 return newFlattenedProps; 47664 };
47665 HelmetWrapper.prototype.warnOnInvalidChildren = function warnOnInvalidChildren(child, nestedChildren) { 47666 return true; 47667 }; 47668 HelmetWrapper.prototype.mapChildrenToProps = function mapChildrenToProps(children, newProps) { 47669 var _this2 = this; 47670 var arrayTypeChildren = {}; 47671 e$3.Children.forEach(children, function(child) { 47672 if (!child || !child.props) { 47673 return; 47674 } 47675 var _child$props = child.props, nestedChildren = _child$props.children, childProps = objectWithoutProperties(_child$props, ["children"]); 47676 var newChildProps = convertReactPropstoHtmlAttributes(childProps); 47677 _this2.warnOnInvalidChildren(child, nestedChildren); 47678 switch (child.type) { 47679 case TAG_NAMES.LINK: 47680 case TAG_NAMES.META: 47681 case TAG_NAMES.NOSCRIPT: 47682 case TAG_NAMES.SCRIPT: 47683 case TAG_NAMES.STYLE: 47684 arrayTypeChildren = _this2.flattenArrayTypeChildren({ 47685 child, 47686 arrayTypeChildren, 47687 newChildProps, 47688 nestedChildren 47689 }); 47690 break; 47691 default: 47692 newProps = _this2.mapObjectTypeChildren({ 47693 child, 47694 newProps, 47695 newChildProps, 47696 nestedChildren 47697 }); 47698 break; 47699 } 47700 }); 47701 newProps = this.mapArrayTypeChildrenToProps(arrayTypeChildren, newProps); 47702 return newProps; 47703 }; 47704 HelmetWrapper.prototype.render = function render() { 47705 var _props = this.props, children = _props.children, props = objectWithoutProperties(_props, ["children"]); 47706 var newProps = _extends$5({}, props); 47707 if (children) { 47708 newProps = this.mapChildrenToProps(children, newProps); 47709 } 47710 return e$3.createElement(Component, newProps); 47711 }; 47712 createClass(HelmetWrapper, null, [{ 47713 key: "canUseDOM", 47714 // Component.peek comes from react-side-effect: 47715 // For testing, you may use a static peek() method available on the returned component. 47716 // It lets you get the current state without resetting the mounted instance stack. 47717 // Donât use it for anything other than testing. 47718 /** 47719 * @param {Object} base: {"target": "_blank", "href": "http://mysite.com/"} 47720 * @param {Object} bodyAttributes: {"className": "root"} 47721 * @param {String} defaultTitle: "Default Title" 47722 * @param {Boolean} defer: true 47723 * @param {Boolean} encodeSpecialCharacters: true 47724 * @param {Object} htmlAttributes: {"lang": "en", "amp": undefined} 47725 * @param {Array} link: [{"rel": "canonical", "href": "http://mysite.com/example"}] 47726 * @param {Array} meta: [{"name": "description", "content": "Test description"}] 47727 * @param {Array} noscript: [{"innerHTML": "<img src='http://mysite.com/js/test.js'"}] 47728 * @param {Function} onChangeClientState: "(newState) => console.log(newState)" 47729 * @param {Array} script: [{"type": "text/javascript", "src": "http://mysite.com/js/test.js"}] 47730 * @param {Array} style: [{"type": "text/css", "cssText": "div { display: block; color: blue; }"}] 47731 * @param {String} title: "Title" 47732 * @param {Object} titleAttributes: {"itemprop": "name"} 47733 * @param {String} titleTemplate: "MySite.com - %s" 47734 */ 47735 set: function set$$1(canUseDOM) { 47736 Component.canUseDOM = canUseDOM; 47737 } 47738 }]); 47739 return HelmetWrapper; 47740 })(e$3.Component), _class.propTypes = { 47741 base: PropTypes.object, 47742 bodyAttributes: PropTypes.object, 47743 children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]), 47744 defaultTitle: PropTypes.string, 47745 defer: PropTypes.bool, 47746 encodeSpecialCharacters: PropTypes.bool, 47747 htmlAttributes: PropTypes.object, 47748 link: PropTypes.arrayOf(PropTypes.object), 47749 meta: PropTypes.arrayOf(PropTypes.object), 47750 noscript: PropTypes.arrayOf(PropTypes.object), 47751 onChangeClientState: PropTypes.func, 47752 script: PropTypes.arrayOf(PropTypes.object), 47753 style: PropTypes.arrayOf(PropTypes.object), 47754 title: PropTypes.string, 47755 titleAttributes: PropTypes.object, 47756 titleTemplate: PropTypes.string 47757 }, _class.defaultProps = { 47758 defer: true, 47759 encodeSpecialCharacters: true 47760 }, _class.peek = Component.peek, _class.rewind = function() { 47761 var mappedState = Component.rewind(); 47762 if (!mappedState) { 47763 mappedState = mapStateOnServer({ 47764 baseTag: [], 47765 bodyAttributes: {}, 47766 htmlAttributes: {}, 47767 linkTags: [], 47768 metaTags: [], 47769 noscriptTags: [], 47770 scriptTags: [], 47771 styleTags: [], 47772 title: "", 47773 titleAttributes: {} 47774 }); 47775 } 47776 return mappedState; 47777 }, _temp; 47778 }; 47779 var NullComponent = function NullComponent2() { 47780 return null; 47781 }; 47782 var HelmetSideEffects = withSideEffect(reducePropsToState, handleClientStateChange, mapStateOnServer)(NullComponent); 47783 var HelmetExport = Helmet(HelmetSideEffects); 47784 HelmetExport.renderStatic = HelmetExport.rewind; 47785 var p$3 = "iOSFourthwall", n$1 = "AndroidFourthwall"; 47786 var f$4 = (t2) => t2.includes(p$3), c$3 = (t2) => t2.includes(n$1), O$4 = (t2) => f$4(t2) || c$3(t2); 47787 var E$4 = reactExports.createContext(void 0), z$3 = (e2, o2) => o2 ? "android" : e2 ? "ios" : null, $$4 = (e2, o2) => !e2 || !o2 ? {} : (Array.isArray(e2) ? e2 : [e2]).reduce((s2, i2) => __spreadValues(__spreadValues({}, s2), i2[o2]), {}), Q$3 = ({ userAgent: e2, methods: o2, children: t2 }) => { 47788 let s2 = f$4(e2), i2 = c$3(e2), d2 = O$4(e2); 47789 reactExports.useEffect(() => { 47790 if (d2) return document.body.classList.add("webview"), () => { 47791 document.body.classList.remove("webview"); 47792 }; 47793 }, [d2]); 47794 let p2 = reactExports.useMemo(() => ({ userAgent: e2, isWebView: d2, isIos: s2, isAndroid: i2, methods: $$4(o2, z$3(s2, i2)) }), [e2, d2, s2, i2, o2]); 47795 return jsxRuntimeExports.jsx(E$4.Provider, { value: p2, children: t2 }); 47796 }, w$6 = () => { 47797 let e2 = reactExports.useContext(E$4); 47798 if (e2 === void 0) throw new Error("useWebViewBridge must be used within a WebViewBridgeProvider"); 47799 return e2; 47800 }; 47801 const HeadContent = ({ 47802 meta, 47803 title, 47804 titleTemplate, 47805 defaultTitle, 47806 stylesUrl, 47807 children 47808 }) => { 47809 const { isWebView } = w$6(); 47810 const props = omitBy({ title, titleTemplate, defaultTitle, meta }, isEmpty); 47811 return /* @__PURE__ */ jsxRuntimeExports.jsxs(HelmetExport, __spreadProps(__spreadValues({}, props), { children: [
47812 stylesUrl && /* @__PURE__ */ jsxRuntimeExports.jsx("link", { rel: "stylesheet", href: stylesUrl }), 47813 isWebView && /* @__PURE__ */ jsxRuntimeExports.jsx( 47814 "meta", 47815 { 47816 name: "viewport", 47817 content: "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" 47818 } 47819 ), 47820 children 47821 ] })); 47822 }; 47823 const Container$i = dt$2.div` 47824 align-self: flex-start; 47825 display: flex; 47826 justify-content: center; 47827 align-items: center; 47828 background: var(--bg-primary); 47829 border: 1px solid var(--input-border, var(--border-secondary)); 47830 color: transparent; 47831 border-radius: var(--panel-radius-static); 47832 47833 ${({ $size }) => $size === "small" && lt$2` 47834 width: 20px; 47835 min-width: 20px; 47836 height: 20px; 47837 min-height: 20px; 47838 `} 47839 47840 ${({ $size }) => $size === "medium" && lt$2` 47841 width: 24px; 47842 min-width: 24px; 47843 height: 24px; 47844 min-height: 24px; 47845 `} 47846 47847 ${({ $size }) => $size === "large" && lt$2` 47848 width: 32px; 47849 min-width: 32px; 47850 height: 32px; 47851 min-height: 32px; 47852 `} 47853 47854 &:hover { 47855 border: 1px solid var(--input-border-hover); 47856 } 47857 47858 input:checked + & { 47859 background: var(--bg-brand); 47860 border-color: var(--bg-brand); 47861 color: var(--text-primary-invert); 47862 } 47863 47864 input:disabled + & { 47865 cursor: not-allowed; 47866 background: var(--bg-tertiary); 47867 border-color: var(--border-secondary); 47868 } 47869 47870 input:checked:disabled + & { 47871 background: var(--bg-tertiary); 47872 color: var(--border-secondary); 47873 } 47874 47875 input:focus-visible + & { 47876 outline: 1px solid color-mix(in oklab, var(--border-active) 40%, transparent); 47877 outline-offset: 2px; 47878 } 47879 47880 input:indeterminate + & { 47881 background: var(--bg-brand); 47882 border-color: var(--bg-brand); 47883 color: var(--text-primary-invert); 47884 } 47885`; 47886 const TICK_ICON_SIZE = { 47887 small: 10, 47888 medium: 12, 47889 large: 16 47890 }; 47891 const CheckboxIcon = ({ size = "medium", indeterminate }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Container$i, { $size: size, "aria-hidden": "true", children: indeterminate ? /* @__P
47891URE__ */ jsxRuntimeExports.jsx(wt$2, { height: TICK_ICON_SIZE[size] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(yc, { height: TICK_ICON_SIZE[size] }) }); 47892 const Container$h = dt$2.div` 47893 position: relative; 47894 user-select: none; 47895`; 47896 const TooltipWrapper = dt$2.span` 47897 display: inline-flex; 47898 vertical-align: middle; 47899 margin-left: var(--space-150); 47900 color: var(--text-primary); 47901 47902 ${({ $disabled }) => $disabled && lt$2` 47903 color: var(--text-secondary); 47904 `} 47905`; 47906 const Label$1 = dt$2.label` 47907 display: flex; 47908 47909 & > * + * { 47910 margin-left: var(--space-300); 47911 } 47912 47913 ${({ $labelAlign }) => $labelAlign === "start" && lt$2` 47914 align-items: flex-start; 47915 `} 47916 47917 ${({ $labelAlign }) => $labelAlign === "center" && lt$2` 47918 align-items: center; 47919 `} 47920 47921 ${({ $labelAlign }) => $labelAlign === "end" && lt$2` 47922 align-items: flex-end; 47923 `} 47924 47925 ${({ $disabled }) => !$disabled && lt$2` 47926 cursor: pointer; 47927 47928 &:hover:not(:has(${TooltipWrapper}:hover)) { 47929 ${Container$i} { 47930 border-color: var(--border-active); 47931 } 47932 } 47933 `} 47934 47935 ${({ $disabled }) => $disabled && lt$2` 47936 cursor: not-allowed; 47937 `} 47938`; 47939 const CheckboxLabel = dt$2.div` 47940 cursor: inherit; 47941`; 47942 const Input = dt$2.input` 47943 clip: rect(1px, 1px, 1px, 1px); 47944 47945 position: absolute; 47946`; 47947 const LabelText = dt$2.span` 47948 font-size: var(--font-size-400); 47949 line-height: var(--font-line-height-400); 47950 47951 color: var(--text-primary); 47952 47953 ${({ $disabled }) => $disabled && lt$2` 47954 color: var(--text-secondary); 47955 `} 47956`; 47957 const Description$2 = dt$2.div` 47958 color: var(--text-secondary); 47959 font-size: var(--font-size-300); 47960 47961 a { 47962 text-decoration: underline; 47963 47964 &:hover { 47965 color: var(--text-link); 47966 } 47967 } 47968`; 47969 const Container$g = dt$2.div` 47970 display: flex; 47971 flex-direction: column; 47972 align-items: center; 47973 justify-content: center; 47974 47975 width: 100vw; 47976 height: 100vh; 47977`; 47978 const LoaderSuspenseFallback = () => { 47979 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$g, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "large" }) }); 47980 }; 47981 const ShopName = dt$2.h1` 47982 color: var(--text-primary); 47983 font-size: var(--font-size-600); 47984 line-height: var(--font-line-height-500); 47985 letter-spacing: var(--font-letter-spacing-dense); 47986 47987 font-family: var(--font-family-heading); 47988 font-style: var(--font-style-heading); 47989 font-weight: var(--font-weight-480); 47990 text-transform: var(--text-transform-heading); 47991`; 47992 const Image$2 = dt$2.img` 47993 width: 100%; 47994 max-width: var(--logo-width, 350px); 47995 max-height: 100px; 47996 47997 object-fit: contain; 47998`; 47999 const ShopLogo = ({ name, url }) => { 48000 return /* @__PURE__ */ jsxRuntimeExports.jsx(ShopName, { children: url ? /* @__PURE__ */ jsxRuntimeExports.jsx(Image$2, { src: url, alt: name, "data-testid": "ShopLogo.Image" }) : name }); 48001 }; 48002 const CheckboxComponent = ({ 48003 label, 48004 labelAlign = "start", 48005 description, 48006 tooltip, 48007 size = "medium", 48008 indeterminate, 48009 id: id2, 48010 name, 48011 value, 48012 checked, 48013 disabled, 48014 native, 48015 onChange, 48016 onValueChange, 48017 onBlur 48018 }) => { 48019 const handleChange = (e2) => { 48020 if (onChange) { 48021 onChange(e2); 48022 } 48023 if (onValueChange) { 48024 onValueChange(e2.target.checked); 48025 } 48026 }; 48027 const handleBlur = (e2) => { 48028 if (onBlur) { 48029 onBlur(e2); 48030 } 48031 }; 48032 const getChecked = () => { 48033 if (native) return checked; 48034 return typeof value === "boolean" ? value : void 0; 48035 }; 48036 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$h, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { $disabled: Boolean(disabled), $labelAlign: labelAlign, "data-testid": "Checkbox", children: [
48037 /* @__PURE__ */ jsxRuntimeExports.jsxs(CheckboxLabel, { children: [ 48038 /* @__PURE__ */ jsxRuntimeExports.jsx( 48039 Input, 48040 { 48041 type: "checkbox", 48042 id: id2, 48043 name, 48044 value: typeof value === "string" ? value : void 0, 48045 checked: getChecked(), 48046 disabled, 48047 onChange: handleChange, 48048 onBlur: handleBlur 48049 } 48050 ), 48051 /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxIcon, { size, indeterminate }) 48052 ] }), 48053 (label || description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ 48054 label && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48055 /* @__PURE__ */ jsxRuntimeExports.jsx(LabelText, { $disabled: Boolean(disabled), children: label }), 48056 tooltip && /* @__PURE__ */ jsxRuntimeExports.jsx( 48057 TooltipWrapper, 48058 { 48059 $disabled: Boolean(disabled), 48060 onClick: (e2) => e2.stopPropagation(), 48061 children: /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipIcon, { tooltipContent: tooltip }) 48062 } 48063 ) 48064 ] }),
vendor: 10,350 bytes, lines 48065-48254
48065 description && /* @__PURE__ */ jsxRuntimeExports.jsx(Description$2, { children: description }) 48066 ] }) 48067 ] }) }); 48068 }; 48069 const Checkbox = Fr$2(CheckboxComponent); 48070 function r$1(e2) { 48071 var t2, f2, n2 = ""; 48072 if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; 48073 else if ("object" == typeof e2) if (Array.isArray(e2)) { 48074 var o2 = e2.length; 48075 for (t2 = 0; t2 < o2; t2++) e2[t2] && (f2 = r$1(e2[t2])) && (n2 && (n2 += " "), n2 += f2); 48076 } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); 48077 return n2; 48078 } 48079 function clsx() { 48080 for (var e2, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++) (e2 = arguments[f2]) && (t2 = r$1(e2)) && (n2 && (n2 += " "), n2 += t2); 48081 return n2; 48082 } 48083 var dayjs_min$1 = { exports: {} }; 48084 var dayjs_min = dayjs_min$1.exports; 48085 var hasRequiredDayjs_min; 48086 function requireDayjs_min() { 48087 if (hasRequiredDayjs_min) return dayjs_min$1.exports; 48088 hasRequiredDayjs_min = 1; 48089 (function(module2, exports$1) { 48090 !(function(t2, e2) { 48091 module2.exports = e2(); 48092 })(dayjs_min, (function() { 48093 var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) { 48094 var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100; 48095 return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]"; 48096 } }, m2 = function(t3, e3, n3) { 48097 var r3 = String(t3); 48098 return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3; 48099 }, v2 = { s: m2, z: function(t3) { 48100 var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60; 48101 return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0"); 48102 }, m: function t3(e3, n3) { 48103 if (e3.date() < n3.date()) return -t3(n3, e3); 48104 var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i3 = e3.clone().add(r3, c2), s3 = n3 - i3 < 0, u3 = e3.clone().add(r3 + (s3 ? -1 : 1), c2); 48105 return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0); 48106 }, a: function(t3) { 48107 return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3); 48108 }, p: function(t3) { 48109 return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, ""); 48110 }, u: function(t3) { 48111 return void 0 === t3; 48112 } }, g2 = "en", D2 = {}; 48113 D2[g2] = M2; 48114 var p2 = "$isDayjsObject", S2 = function(t3) { 48115 return t3 instanceof _2 || !(!t3 || !t3[p2]); 48116 }, w2 = function t3(e3, n3, r3) { 48117 var i3; 48118 if (!e3) return g2; 48119 if ("string" == typeof e3) { 48120 var s3 = e3.toLowerCase(); 48121 D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3); 48122 var u3 = e3.split("-"); 48123 if (!i3 && u3.length > 1) return t3(u3[0]); 48124 } else { 48125 var a3 = e3.name; 48126 D2[a3] = e3, i3 = a3; 48127 } 48128 return !r3 && i3 && (g2 = i3), i3 || !r3 && g2; 48129 }, O2 = function(t3, e3) { 48130 if (S2(t3)) return t3.clone(); 48131 var n3 = "object" == typeof e3 ? e3 : {}; 48132 return n3.date = t3, n3.args = arguments, new _2(n3); 48133 }, b2 = v2; 48134 b2.l = w2, b2.i = S2, b2.w = function(t3, e3) { 48135 return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset }); 48136 }; 48137 var _2 = (function() { 48138 function M3(t3) { 48139 this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true; 48140 } 48141 var m3 = M3.prototype; 48142 return m3.parse = function(t3) { 48143 this.$d = (function(t4) { 48144 var e3 = t4.date, n3 = t4.utc; 48145 if (null === e3) return /* @__PURE__ */ new Date(NaN); 48146 if (b2.u(e3)) return /* @__PURE__ */ new Date(); 48147 if (e3 instanceof Date) return new Date(e3); 48148 if ("string" == typeof e3 && !/Z$/i.test(e3)) { 48149 var r3 = e3.match($2); 48150 if (r3) { 48151 var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3); 48152 return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3); 48153 } 48154 } 48155 return new Date(e3); 48156 })(t3), this.init(); 48157 }, m3.init = function() { 48158 var t3 = this.$d; 48159 this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds(); 48160 }, m3.$utils = function() { 48161 return b2; 48162 }, m3.isValid = function() { 48163 return !(this.$d.toString() === l2); 48164 }, m3.isSame = function(t3, e3) { 48165 var n3 = O2(t3); 48166 return this.startOf(e3) <= n3 && n3 <= this.endOf(e3); 48167 }, m3.isAfter = function(t3, e3) { 48168 return O2(t3) < this.startOf(e3); 48169 }, m3.isBefore = function(t3, e3) { 48170 return this.endOf(e3) < O2(t3); 48171 }, m3.$g = function(t3, e3, n3) { 48172 return b2.u(t3) ? this[e3] : this.set(n3, t3); 48173 }, m3.unix = function() { 48174 return Math.floor(this.valueOf() / 1e3); 48175 }, m3.valueOf = function() { 48176 return this.$d.getTime(); 48177 }, m3.startOf = function(t3, e3) { 48178 var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) { 48179 var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3); 48180 return r3 ? i3 : i3.endOf(a2); 48181 }, $3 = function(t4, e4) { 48182 return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3); 48183 }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : ""); 48184 switch (f3) { 48185 case h2: 48186 return r3 ? l3(1, 0) : l3(31, 11); 48187 case c2: 48188 return r3 ? l3(1, M4) : l3(0, M4 + 1); 48189 case o2: 48190 var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3; 48191 return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4); 48192 case a2: 48193 case d2: 48194 return $3(v3 + "Hours", 0); 48195 case u2: 48196 return $3(v3 + "Minutes", 1); 48197 case s2: 48198 return $3(v3 + "Seconds", 2); 48199 case i2: 48200 return $3(v3 + "Milliseconds", 3); 48201 default: 48202 return this.clone(); 48203 } 48204 }, m3.endOf = function(t3) { 48205 return this.startOf(t3, false); 48206 }, m3.$set = function(t3, e3) { 48207 var n3, o3 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3; 48208 if (o3 === c2 || o3 === h2) { 48209 var y3 = this.clone().set(d2, 1); 48210 y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d; 48211 } else l3 && this.$d[l3]($3); 48212 return this.init(), this; 48213 }, m3.set = function(t3, e3) { 48214 return this.clone().$set(t3, e3); 48215 }, m3.get = function(t3) { 48216 return this[b2.p(t3)](); 48217 }, m3.add = function(r3, f3) { 48218 var d3, l3 = this; 48219 r3 = Number(r3); 48220 var $3 = b2.p(f3), y3 = function(t3) { 48221 var e3 = O2(l3); 48222 return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3); 48223 }; 48224 if ($3 === c2) return this.set(c2, this.$M + r3); 48225 if ($3 === h2) return this.set(h2, this.$y + r3); 48226 if ($3 === a2) return y3(1); 48227 if ($3 === o2) return y3(7); 48228 var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4; 48229 return b2.w(m4, this); 48230 }, m3.subtract = function(t3, e3) { 48231 return this.add(-1 * t3, e3); 48232 }, m3.format = function(t3) { 48233 var e3 = this, n3 = this.$locale(); 48234 if (!this.isValid()) return n3.invalidDate || l2; 48235 var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i4, s4) { 48236 return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4); 48237 }, d3 = function(t4) { 48238 return b2.s(s3 % 12 || 12, t4, "0"); 48239 }, $3 = f3 || function(t4, e4, n4) { 48240 var r4 = t4 < 12 ? "AM" : "PM"; 48241 return n4 ? r4.toLowerCase() : r4; 48242 }; 48243 return r3.replace(y2, (function(t4, r4) { 48244 return r4 || (function(t5) { 48245 switch (t5) { 48246 case "YY": 48247 return String(e3.$y).slice(-2); 48248 case "YYYY": 48249 return b2.s(e3.$y, 4, "0"); 48250 case "M": 48251 return a3 + 1; 48252 case "MM": 48253 return b2.s(a3 + 1, 2, "0"); 48254 case "MMM":
48255 return h3(n3.monthsShort, a3, c3, 3); 48256 case "MMMM": 48257 return h3(c3, a3); 48258 case "D": 48259 return e3.$D; 48260 case "DD": 48261 return b2.s(e3.$D, 2, "0"); 48262 case "d": 48263 return String(e3.$W); 48264 case "dd": 48265 return h3(n3.weekdaysMin, e3.$W, o3, 2); 48266 case "ddd": 48267 return h3(n3.weekdaysShort, e3.$W, o3, 3); 48268 case "dddd": 48269 return o3[e3.$W]; 48270 case "H": 48271 return String(s3); 48272 case "HH": 48273 return b2.s(s3, 2, "0"); 48274 case "h": 48275 return d3(1); 48276 case "hh": 48277 return d3(2); 48278 case "a": 48279 return $3(s3, u3, true); 48280 case "A": 48281 return $3(s3, u3, false); 48282 case "m": 48283 return String(u3); 48284 case "mm": 48285 return b2.s(u3, 2, "0"); 48286 case "s": 48287 return String(e3.$s); 48288 case "ss": 48289 return b2.s(e3.$s, 2, "0"); 48290 case "SSS": 48291 return b2.s(e3.$ms, 3, "0"); 48292 case "Z": 48293 return i3; 48294 } 48295 return null; 48296 })(t4) || i3.replace(":", ""); 48297 })); 48298 }, m3.utcOffset = function() { 48299 return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); 48300 }, m3.diff = function(r3, d3, l3) { 48301 var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() { 48302 return b2.m(y3, m4); 48303 }; 48304 switch (M4) { 48305 case h2: 48306 $3 = D3() / 12; 48307 break; 48308 case c2: 48309 $3 = D3(); 48310 break; 48311 case f2: 48312 $3 = D3() / 3; 48313 break; 48314 case o2: 48315 $3 = (g3 - v3) / 6048e5; 48316 break; 48317 case a2: 48318 $3 = (g3 - v3) / 864e5; 48319 break; 48320 case u2: 48321 $3 = g3 / n2; 48322 break; 48323 case s2: 48324 $3 = g3 / e2; 48325 break; 48326 case i2: 48327 $3 = g3 / t2; 48328 break; 48329 default: 48330 $3 = g3; 48331 } 48332 return l3 ? $3 : b2.a($3); 48333 }, m3.daysInMonth = function() { 48334 return this.endOf(c2).$D; 48335 }, m3.$locale = function() { 48336 return D2[this.$L]; 48337 }, m3.locale = function(t3, e3) { 48338 if (!t3) return this.$L; 48339 var n3 = this.clone(), r3 = w2(t3, e3, true); 48340 return r3 && (n3.$L = r3), n3; 48341 }, m3.clone = function() { 48342 return b2.w(this.$d, this); 48343 }, m3.toDate = function() { 48344 return new Date(this.valueOf()); 48345 }, m3.toJSON = function() { 48346 return this.isValid() ? this.toISOString() : null; 48347 }, m3.toISOString = function() { 48348 return this.$d.toISOString(); 48349 }, m3.toString = function() { 48350 return this.$d.toUTCString(); 48351 }, M3; 48352 })(), k2 = _2.prototype; 48353 return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach((function(t3) { 48354 k2[t3[1]] = function(e3) { 48355 return this.$g(e3, t3[0], t3[1]); 48356 }; 48357 })), O2.extend = function(t3, e3) { 48358 return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2; 48359 }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) { 48360 return O2(1e3 * t3); 48361 }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2; 48362 })); 48363 })(dayjs_min$1); 48364 return dayjs_min$1.exports; 48365 } 48366 var dayjs_minExports = requireDayjs_min(); 48367 const Un$1 = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports); 48368 const NotFoundErrorPage = ({ to: to2 }) => { 48369 return /* @__PURE__ */ jsxRuntimeExports.jsx( 48370 ErrorPage, 48371 { 48372 to: to2, 48373 heading: "404", 48374 description: "We canât seem to find the page youâre looking for." 48375 } 48376 ); 48377 }; 48378 const Container$f = dt$2.div` 48379 outline: none; 48380`; 48381 const AutoFocusableContainer = ({ id: id2, enabled = true, children }) => { 48382 const containerRef = reactExports.useRef(null); 48383 const timeoutRef = reactExports.useRef(); 48384 reactExports.useEffect(() => { 48385 if (enabled) { 48386 timeoutRef.current = setTimeout(() => { 48387 var _a; 48388 (_a = containerRef.current) == null ? void 0 : _a.focus({ preventScroll: true }); 48389 }, 0); 48390 } else { 48391 clearTimeout(timeoutRef.current); 48392 } 48393 return () => { 48394 clearTimeout(timeoutRef.current); 48395 }; 48396 }, [id2, enabled]); 48397 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$f, { ref: containerRef, tabIndex: -1, "data-testid": "AutoFocusableContainer", children }); 48398 }; 48399 const ModalContext = reactExports.createContext({ 48400 open: () => { 48401 }, 48402 close: () => { 48403 } 48404 }); 48405 const ModalAnimationContext = reactExports.createContext({ 48406 isOpen: true, 48407 onExited: void 0 48408 }); 48409 const EXIT_FALLBACK_MS = 500; 48410 const ModalProvider = ({ children }) => { 48411 const media = useMediaQueryContext(); 48412 const [modalState, setModalState] = reactExports.useState(); 48413 const [open, setOpen] = reactExports.useState(false); 48414 const exitTimer = reactExports.useRef(); 48415 const modalId = reactExports.useRef(0); 48416 const clearExitTimer = reactExports.useCallback(() => { 48417 if (exitTimer.current) clearTimeout(exitTimer.current); 48418 exitTimer.current = void 0; 48419 }, []); 48420 reactExports.useEffect(() => clearExitTimer, [clearExitTimer]); 48421 const finalizeClose = reactExports.useCallback( 48422 (id2) => { 48423 if (id2 !== modalId.current) return; 48424 clearExitTimer(); 48425 setOpen(false); 48426 setModalState({ id: id2, component: null, props: {} }); 48427 }, 48428 [clearExitTimer] 48429 ); 48430 const openModal = reactExports.useCallback( 48431 (component, props2) => { 48432 clearExitTimer(); 48433 modalId.current += 1; 48434 setModalState({ id: modalId.current, component, props: props2 }); 48435 setOpen(true); 48436 }, 48437 [clearExitTimer] 48438 ); 48439 const closeModal = reactExports.useCallback(() => { 48440 const id2 = modalId.current; 48441 if (media.tablet) { 48442 finalizeClose(id2); 48443 return; 48444 } 48445 setOpen(false); 48446 clearExitTimer(); 48447 exitTimer.current = setTimeout(() => finalizeClose(id2), EXIT_FALLBACK_MS); 48448 }, [media.tablet, finalizeClose, clearExitTimer]); 48449 const value = reactExports.useMemo( 48450 () => ({ 48451 open: openModal, 48452 close: closeModal 48453 }), 48454 [openModal, closeModal] 48455 ); 48456 const Component = modalState == null ? void 0 : modalState.component; 48457 const props = (modalState == null ? void 0 : modalState.props) || {}; 48458 const mounted = !!Component; 48459 const currentId = modalState == null ? void 0 : modalState.id; 48460 const animation = reactExports.useMemo( 48461 () => ({ 48462 isOpen: open, 48463 onExited: currentId === void 0 ? void 0 : () => finalizeClose(currentId) 48464 }), 48465 [open, finalizeClose, currentId] 48466 ); 48467 const { refs, context } = useFloating({ open: mounted }); 48468 const role = useRole(context, { role: "dialog" }); 48469 const { getFloatingProps } = useInteractions([role]); 48470 useEscapeKey(mounted && media.tablet, () => { 48471 var _a; 48472 return ((_a = props == null ? void 0 : props.onRequestClose) != null ? _a : closeModal)(); 48473 });
48474 const modal = mounted && Component && /* @__PURE__ */ jsxRuntimeExports.jsx( 48475 "div", 48476 __spreadProps(__spreadValues({ 48477 ref: refs.setFloating, 48478 style: { zIndex: 1e3 }, 48479 "aria-labelledby": "modal-box", 48480 "aria-describedby": "modal-box" 48481 }, getFloatingProps()), { 48482 children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalAnimationContext.Provider, { value: animation, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Component, __spreadValues({ close: closeModal }, props)) }) 48483 }) 48484 ); 48485 return /* @__PURE__ */ jsxRuntimeExports.jsxs(ModalContext.Provider, { value, children: [ 48486 children, 48487 /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingPortal, { children: media.tablet ? modal && /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingFocusManager, { context, modal: true, children: modal }) : modal }) 48488 ] }); 48489 }; 48490 const useModalContext = () => { 48491 return reactExports.useContext(ModalContext); 48492 }; 48493 const useModalAnimation = () => { 48494 return reactExports.useContext(ModalAnimationContext); 48495 }; 48496 const BOTTOM_SPACING = overlayBottomOffset("var(--space-600)"); 48497 const FOOTER_BOTTOM_SPACING = overlayBottomOffset("var(--space-500)"); 48498 const Container$e = dt$2.div` 48499 position: fixed; 48500 top: 0; 48501 left: 0; 48502 z-index: 10; 48503 48504 display: flex; 48505 align-items: center; 48506 justify-content: center; 48507 48508 width: 100vw; 48509 height: 100vh; 48510 padding: var(--space-400); 48511 48512 &::after { 48513 display: block; 48514 content: ''; 48515 position: absolute; 48516 height: 50px; 48517 width: 100%; 48518 top: 100%; 48519 background: var(--bg-primary); 48520 } 48521 48522 ${mediaQueries.tablet} { 48523 flex-direction: row; 48524 padding: var(--space-1200); 48525 48526 &::after { 48527 display: none; 48528 } 48529 } 48530 48531 ${({ $blurOverlay }) => $blurOverlay && lt$2` 48532 backdrop-filter: blur(100px); 48533 `}; 48534`; 48535 const Overlay = dt$2.div` 48536 position: absolute; 48537 top: 0; 48538 left: 0; 48539 right: 0; 48540 bottom: 0; 48541 48542 background: var(--color-black-alpha-1500); 48543`; 48544 const getMaxWidth = ({ $size, $maxWidth, $width }) => { 48545 const maxWidths = { 48546 small: "480px", 48547 medium: "600px", 48548 large: "800px", 48549 xlarge: "960px", 48550 fullScreen: "none" 48551 }; 48552 if ($width) return "100%"; 48553 return $maxWidth ? `${$maxWidth}px` : maxWidths[$size]; 48554 }; 48555 const Box = dt$2.div` 48556 flex: ${({ $width }) => $width ? "0 1 auto" : "1 0 auto"}; 48557 display: flex; 48558 flex-direction: column; 48559 position: fixed; 48560 bottom: 0; 48561 left: 0; 48562 right: 0; 48563 48564 padding: var(--space-600) var(--space-500); 48565 padding-bottom: ${BOTTOM_SPACING}; 48566 background: var(--bg-primary); 48567 width: ${({ $width }) => $width || "100%"}; 48568 max-height: calc(100% - 96px); 48569 overflow-y: auto; 48570 overflow-x: hidden; 48571 48572 border-radius: var(--panel-radius-normal); 48573 48574 color: var(--text-primary); 48575 48576 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48577 padding: var(--space-0); 48578 padding-bottom: ${OVERLAY_BOTTOM_INSET}; 48579 `}; 48580 48581 ${({ $size }) => $size === "fullScreen" && lt$2` 48582 max-height: none; 48583 top: 0; 48584 `}; 48585 48586 ${mediaQueries.tablet} { 48587 position: relative; 48588 padding: var(--space-600); 48589 bottom: auto; 48590 left: auto; 48591 right: auto; 48592 top: auto; 48593 overflow: auto; 48594 max-width: ${getMaxWidth}; 48595 max-height: calc(100vh - 96px); 48596 48597 ${({ $height }) => $height && lt$2` 48598 height: min(${$height}px, calc(100vh - 96px)); 48599 `}; 48600 48601 ${({ $size }) => $size === "fullScreen" && lt$2` 48602 height: 100%; 48603 `}; 48604 48605 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48606 padding: var(--space-0); 48607 `}; 48608 48609 ${({ $disableScrolling }) => $disableScrolling && lt$2` 48610 overflow: visible; 48611 `}; 48612 } 48613`; 48614 const FullscreenCoverBody = dt$2.div` 48615 flex: 1; 48616 min-height: 0; 48617 display: flex; 48618 flex-direction: column; 48619 48620 padding: var(--space-600) var(--space-500); 48621 padding-bottom: ${BOTTOM_SPACING}; 48622 overflow-y: auto; 48623 overflow-x: hidden; 48624 48625 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48626 padding: var(--space-0); 48627 padding-bottom: ${OVERLAY_BOTTOM_INSET}; 48628 `}; 48629`; 48630 const MobileBody = dt$2.div` 48631 padding: 0 var(--space-400) var(--space-600); 48632 48633 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48634 padding: 0; 48635 `}; 48636`; 48637 const MobileFooter = dt$2.div` 48638 display: flex; 48639 flex-direction: column; 48640 gap: var(--space-300); 48641`; 48642 const FormAnchor = dt$2.span` 48643 display: none; 48644`; 48645 const CloseButtonWrapper = dt$2.div` 48646 position: absolute; 48647 top: var(--space-100); 48648 right: var(--space-100); 48649 z-index: 1; 48650`; 48651 const TopContentContainer = dt$2.div` 48652 margin: var(--space-n600) var(--space-n600) var(--space-600); 48653 48654 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48655 margin: var(--space-0) var(--space-0) var(--space-600); 48656 `}; 48657`; 48658 const TitleContainer = dt$2.div` 48659 margin-bottom: var(--space-300); 48660 48661 word-break: break-word; 48662 color: var(--text-primary); 48663 48664 ${mediaQueries.tablet} { 48665 margin-bottom: var(--space-600); 48666 } 48667`; 48668 const Footer = dt$2.div` 48669 display: flex; 48670 flex-direction: column; 48671 position: sticky; 48672 z-index: 10; 48673 margin: var(--space-300) var(--space-n500) var(--space-n600); 48674 padding: var(--space-300) var(--space-500) var(--space-500); 48675 bottom: calc(-1 * ${BOTTOM_SPACING}); 48676 margin-bottom: calc(-1 * ${BOTTOM_SPACING}); 48677 padding-bottom: ${FOOTER_BOTTOM_SPACING}; 48678 background: var(--bg-primary); 48679 border-bottom-left-radius: var(--panel-radius-normal); 48680 border-bottom-right-radius: var(--panel-radius-normal); 48681 48682 ${({ $withDivider }) => $withDivider && lt$2` 48683 border-top: 1px solid var(--border-secondary); 48684 `}; 48685 48686 ${mediaQueries.tablet} { 48687 bottom: var(--space-n600); 48688 margin: var(--space-n600); 48689 margin-top: var(--space-400); 48690 padding: var(--space-300) var(--space-600) var(--space-500); 48691 z-index: 2; 48692 flex-direction: row; 48693 } 48694`; 48695 const FooterContent = dt$2.div` 48696 display: flex; 48697 padding: var(--space-400) var(--space-0); 48698 justify-content: center; 48699 width: 100%; 48700 48701 ${mediaQueries.tablet} { 48702 justify-content: flex-start;
48703 align-items: center; 48704 padding: var(--space-0); 48705 } 48706`; 48707 const ButtonsContent = dt$2.div` 48708 flex: 1; 48709`; 48710 const ChildrenContainer = dt$2.div` 48711 flex: 1; 48712 48713 flex-direction: column; 48714 display: flex; 48715 48716 /* body/md/regular */ 48717 font-size: var(--font-size-400); 48718 font-weight: var(--font-weight-400); 48719 line-height: var(--font-line-height-400); 48720 letter-spacing: var(--font-letter-spacing-normal); 48721 48722 text-underline-offset: var(--space-100); 48723 text-decoration-skip-ink: none; 48724 48725 p + p { 48726 margin-top: var(--space-400); 48727 } 48728 48729 ${({ $disableScrolling }) => $disableScrolling && lt$2` 48730 max-height: 100%; 48731 min-height: 0; 48732 `}; 48733`; 48734 const Cover = dt$2(motion.div)` 48735 position: absolute; 48736 inset: 0; 48737 display: flex; 48738 flex-direction: column; 48739 background: var(--bg-primary); 48740 color: var(--text-primary); 48741 48742 padding-top: ${OVERLAY_TOP_INSET}; 48743`; 48744 const Content$1 = dt$2.div` 48745 position: relative; 48746 flex: 1; 48747 min-height: 0; 48748 display: flex; 48749 flex-direction: column; 48750`; 48751 const OFFSCREEN = { 48752 bottom: { y: "100%" }, 48753 left: { x: "-100%" } 48754 }; 48755 const FullscreenCover = ({ 48756 children, 48757 isOpen, 48758 onClose, 48759 direction = "bottom", 48760 backdrop = true, 48761 onExited 48762 }) => { 48763 const offscreen = OFFSCREEN[direction]; 48764 return /* @__PURE__ */ jsxRuntimeExports.jsx(OverlayShell, { isOpen, backdrop, onClose, onExited, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 48765 Cover, 48766 { 48767 role: "dialog", 48768 "aria-modal": "true", 48769 "data-testid": "FullscreenCover", 48770 initial: offscreen, 48771 animate: { x: 0, y: 0 }, 48772 exit: offscreen, 48773 transition: SPRING, 48774 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Content$1, { children }) 48775 } 48776 ) }); 48777 }; 48778 const Actions = dt$2.div` 48779 display: flex; 48780 flex-direction: column-reverse; 48781 gap: var(--space-200); 48782 width: 100%; 48783 48784 ${mediaQueries.tablet} { 48785 ${({ $align }) => $align === "right" && lt$2` 48786 flex-direction: row; 48787 justify-content: flex-end; 48788 align-items: center; 48789 `} 48790 48791 ${({ $align }) => $align === "spread" && lt$2` 48792 flex-direction: row; 48793 justify-content: space-between; 48794 `} 48795 48796 ${({ $align }) => $align === "stretch" && lt$2` 48797 flex-direction: row; 48798 48799 & > * { 48800 flex: 1; 48801 } 48802 `} 48803 48804 ${({ $align }) => $align === "stack" && lt$2` 48805 flex-direction: column-reverse; 48806 `} 48807 } 48808`; 48809 const OverlayActions = ({ align = "right", children }) => { 48810 const { tablet } = useMediaQueryContext(); 48811 const items = tablet ? children : reactExports.Children.map( 48812 children, 48813 (child) => reactExports.isValidElement(child) && child.type === Button$1 ? reactExports.cloneElement(child, { size: "medium", fullWidth: true }) : child 48814 ); 48815 return /* @__PURE__ */ jsxRuntimeExports.jsx(Actions, { $align: align, children: items }); 48816 }; 48817 const ModalMobile = ({ 48818 title, 48819 mobileTitleInHeader = false, 48820 size, 48821 withoutPadding = false, 48822 withoutCloseButton = false, 48823 disableScrolling = false, 48824 topContent, 48825 withFooterDivider = false, 48826 footer, 48827 buttons, 48828 loading = false, 48829 children, 48830 isOpen, 48831 onClose, 48832 onExited 48833 }) => { 48834 const formAnchorRef = reactExports.useRef(null); 48835 const formAnchor = /* @__PURE__ */ jsxRuntimeExports.jsx(FormAnchor, { ref: formAnchorRef, "aria-hidden": true }); 48836 const withFormSubmit = (button, index2) => { 48837 const needsSubmitBridge = button.type === Button$1 && button.props.type === "submit" && !button.props.onClick; 48838 return reactExports.cloneElement(button, __spreadValues({ 48839 key: index2 48840 }, needsSubmitBridge && { 48841 onClick: () => { 48842 var _a, _b; 48843 return (_b = (_a = formAnchorRef.current) == null ? void 0 : _a.closest("form")) == null ? void 0 : _b.requestSubmit(); 48844 } 48845 })); 48846 }; 48847 const renderActions = () =>
48847 buttons && /* @__PURE__ */ jsxRuntimeExports.jsx(OverlayActions, { align: "stack", children: buttons.map(withFormSubmit) }); 48848 const renderFooter = () => buttons || footer ? /* @__PURE__ */ jsxRuntimeExports.jsxs(MobileFooter, { children: [ 48849 footer && /* @__PURE__ */ jsxRuntimeExports.jsx(FooterContent, { children: footer }), 48850 renderActions() 48851 ] }) : void 0; 48852 const titleInHeader = !!title && mobileTitleInHeader; 48853 const renderTitle = () => !!title && !titleInHeader && /* @__PURE__ */ jsxRuntimeExports.jsx(TitleContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Heading, { type: "h4", children: title }) }); 48854 const renderBody = ($disableScrolling) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48855 topContent && /* @__PURE__ */ jsxRuntimeExports.jsx(TopContentContainer, { $withoutPadding: withoutPadding, children: topContent }), 48856 renderTitle(), 48857 /* @__PURE__ */ jsxRuntimeExports.jsx(ChildrenContainer, { $disableScrolling, children }) 48858 ] }); 48859 const skeletonShapes = /* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { gap: 16, children: [
48860 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "60%", height: "24px" }), 48861 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "100%", height: "20px" }), 48862 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "80%", height: "20px" }), 48863 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "90%", height: "20px" }) 48864 ] }); 48865 if (size === "fullScreen") { 48866 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48867 formAnchor, 48868 /* @__PURE__ */ jsxRuntimeExports.jsx(FullscreenCover, { isOpen, onClose, onExited, children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(FullscreenCoverBody, { $withoutPadding: withoutPadding, children: skeletonShapes }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48869 onClose && !withoutCloseButton && /* @__PURE__ */ jsxRuntimeExports.jsx(CloseButtonWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 48870 IconButton, 48871 { 48872 icon: $4, 48873 size: "micro", 48874 variant: "transparent", 48875 "aria-label": "Close", 48876 onClick: onClose, 48877 autoFocus: true 48878 } 48879 ) }),
48880 /* @__PURE__ */ jsxRuntimeExports.jsxs(FullscreenCoverBody, { $withoutPadding: withoutPadding, children: [ 48881 renderBody(disableScrolling), 48882 (buttons || footer) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Footer, { $withDivider: withFooterDivider, children: [ 48883 footer && /* @__PURE__ */ jsxRuntimeExports.jsx(FooterContent, { children: footer }), 48884 renderActions() 48885 ] }) 48886 ] }) 48887 ] }) }) 48888 ] }); 48889 } 48890 if (!onClose) return null; 48891 if (disableScrolling) { 48892 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48893 formAnchor, 48894 /* @__PURE__ */ jsxRuntimeExports.jsx( 48895 BottomSheet, 48896 { 48897 isOpen, 48898 scrollable: false, 48899 title: titleInHeader ? title : void 0, 48900 footer: renderFooter(), 48901 onClose, 48902 onExited, 48903 children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(MobileBody, { $withoutPadding: false, children: skeletonShapes }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48904 renderTitle(), 48905 children 48906 ] }) 48907 } 48908 ) 48909 ] }); 48910 } 48911 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48912 formAnchor,
48913 /* @__PURE__ */ jsxRuntimeExports.jsx( 48914 BottomSheet, 48915 { 48916 isOpen, 48917 title: titleInHeader ? title : void 0, 48918 footer: renderFooter(), 48919 onClose, 48920 onExited, 48921 children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(MobileBody, { $withoutPadding: false, children: skeletonShapes }) : /* @__PURE__ */ jsxRuntimeExports.jsx(MobileBody, { $withoutPadding: withoutPadding, children: renderBody(true) }) 48922 } 48923 ) 48924 ] }); 48925 }; 48926 const ModalBox = (props) => { 48927 const { 48928 title, 48929 size = "medium", 48930 maxWidth, 48931 height, 48932 width, 48933 withoutPadding = false, 48934 withoutCloseButton = false, 48935 disableScrolling = false, 48936 blurOverlay = false, 48937 topContent, 48938 fullWidth, 48939 withFooterDivider = false, 48940 footer, 48941 buttons, 48942 buttonsDirection, 48943 loading = false, 48944 children, 48945 onClose 48946 } = props; 48947 const media = useMediaQueryContext(); 48948 const { set: setOverlayVisible } = useOverlayVisibility(); 48949 const { isOpen: overlayOpen, onExited } = useModalAnimation(); 48950 const rendersMobileOverlay = !media.tablet && (size === "fullScreen" || !!onClose); 48951 reactExports.useEffect(() => { 48952 if (rendersMobileOverlay) return void 0; 48953 setOverlayVisible(overlayOpen); 48954 return () => setOverlayVisible(false); 48955 }, [rendersMobileOverlay, overlayOpen, setOverlayVisible]); 48956 reactExports.useEffect(() => { 48957 if (!rendersMobileOverlay && !overlayOpen) onExited == null ? void 0 : onExited(); 48958 }, [rendersMobileOverlay, overlayOpen, onExited]); 48959 if (rendersMobileOverlay) { 48960 return /* @__PURE__ */ jsxRuntimeExports.jsx(ModalMobile, __spreadProps(__spreadValues({}, props), { isOpen: overlayOpen, onExited })); 48961 } 48962 if (loading) { 48963 return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$e, { $blurOverlay: blurOverlay, children: [
48964 /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { "data-testid": "ModalBox.Overlay", onPointerDown: onClose }), 48965 /* @__PURE__ */ jsxRuntimeExports.jsx( 48966 ModalBoxSkeleton, 48967 __spreadValues({}, { 48968 size, 48969 maxWidth, 48970 height, 48971 width, 48972 title, 48973 buttons, 48974 footer, 48975 withoutPadding, 48976 withFooterDivider 48977 }) 48978 ) 48979 ] }) }); 48980 } 48981 return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$e, { $blurOverlay: blurOverlay, children: [ 48982 /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { "data-testid": "ModalBox.Overlay", onPointerDown: onClose }), 48983 /* @__PURE__ */ jsxRuntimeExports.jsxs( 48984 Box, 48985 { 48986 $size: size, 48987 $maxWidth: maxWidth, 48988 $height: height, 48989 $width: width, 48990 $withoutPadding: withoutPadding, 48991 $disableScrolling: disableScrolling, 48992 role: "dialog", 48993 "aria-modal": "true", 48994 "data-testid": "ModalBox.Content", 48995 id: "modal-box", 48996 children: [
48997 onClose && !withoutCloseButton && /* @__PURE__ */ jsxRuntimeExports.jsx(CloseButtonWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 48998 IconButton, 48999 { 49000 icon: $4, 49001 size: media.tablet ? "small" : "micro", 49002 variant: "transparent", 49003 "aria-label": "Close", 49004 onClick: onClose, 49005 autoFocus: true 49006 } 49007 ) }), 49008 topContent && /* @__PURE__ */ jsxRuntimeExports.jsx(TopContentContainer, { $withoutPadding: withoutPadding, children: topContent }), 49009 title && /* @__PURE__ */ jsxRuntimeExports.jsx(TitleContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Heading, { type: media.tablet ? "h3" : "h4", children: title }) }), 49010 /* @__PURE__ */ jsxRuntimeExports.jsx(ChildrenContainer, { $disableScrolling: disableScrolling, children }), 49011 (buttons || footer) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Footer, { $withDivider: withFooterDivider, children: [ 49012 footer && /* @__PURE__ */ jsxRuntimeExports.jsx(FooterContent, { children: footer }),
49013 buttons && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonsContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 49014 ButtonGroup, 49015 { 49016 justify: "right", 49017 align: "center", 49018 space: media.tablet ? "large" : "medium", 49019 fullWidth: fullWidth || !media.tablet, 49020 direction: buttonsDirection || (media.tablet ? "row" : "column-reverse"), 49021 children: buttons.map( 49022 (button, index2) => button.type === Button$1 ? reactExports.cloneElement(button, { 49023 key: index2, 49024 fullWidth: fullWidth || !media.tablet, 49025 size: "medium" 49026 }) : reactExports.cloneElement(button, { key: index2 }) 49027 ) 49028 } 49029 ) }) 49030 ] }) 49031 ] 49032 } 49033 ) 49034 ] }) }); 49035 }; 49036 const ModalBoxSkeleton = ({ 49037 size = "medium", 49038 maxWidth, 49039 height, 49040 width, 49041 title, 49042 buttons, 49043 footer, 49044 withoutPadding, 49045 withFooterDivider 49046 }) => { 49047 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 49048 Box, 49049 { 49050 $size: size, 49051 $maxWidth: maxWidth, 49052 $height: height, 49053 $withoutPadding: withoutPadding, 49054 $width: width, 49055 role: "dialog", 49056 "aria-modal": "true", 49057 "data-testid": "ModalBox.Content", 49058 $disableScrolling: true, 49059 id: "modal-box", 49060 children: [ 49061 title && /* @__PURE__ */ jsxRuntimeExports.jsx(TitleContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { gap: 12, children: [
49062 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "100%", height: "25px" }), 49063 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "100%", height: "25px" }) 49064 ] }) }), 49065 /* @__PURE__ */ jsxRuntimeExports.jsx(ChildrenContainer, { $disableScrolling: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { gap: 16, children: [ 49066 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "0", height: "20px" }), 49067 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "80%", height: "20px" }), 49068 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "70%", height: "20px" }), 49069 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "100%", height: "20px" }) 49070 ] }) }), 49071 (buttons || footer) && /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, { $withDivider: withFooterDivider, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FooterContent, {}) }) 49072 ] 49073 } 49074 ); 49075 }; 49076 const Container$d = dt$2.div` 49077 position: relative; 49078 49079 ${({ $fullWidth }) => $fullWidth && lt$2` 49080 width: 100%; 49081 `} 49082`; 49083 dt$2.select``; 49084 const getSelectHeight = ({ $inputSize }) => { 49085 if ($inputSize === "large") { 49086 return "56px"; 49087 } 49088 if ($inputSize === "medium") { 49089 return "48px"; 49090 } 49091 if ($inputSize === "small") { 49092 return "40px"; 49093 } 49094 }; 49095 const Select$1 = dt$2.select` 49096 position: absolute; 49097 top: 0; 49098 left: 0; 49099 width: 100%; 49100 height: ${getSelectHeight}; 49101 opacity: 0; 49102 cursor: pointer; 49103 appearance: none; // NOTE: Fix height on Safari 49104 49105 ${({ disabled }) => disabled && lt$2` 49106 cursor: not-allowed; 49107 `} 49108`; 49109 const ActionIconsContainer = dt$2.div` 49110 display: flex; 49111 gap: var(--space-400); 49112`; 49113 const ArrowIconContainer = dt$2.div` 49114 color: var(--text-secondary); 49115 49116 ${({ $hovered }) => $hovered && lt$2` 49117 color: var(--text-primary); 49118 `} 49119`; 49120 const ClearIcon = dt$2.button` 49121 position: relative; 49122 z-index: 1; 49123 cursor: pointer; 49124 width: 18px; 49125 height: 18px; 49126 border-radius: 50%; 49127 display: flex; 49128 align-items: center; 49129 justify-content: center; 49130 background-color: var(--text-primary); 49131 color: var(--bg-primary); 49132`; 49133 const SelectComponent = ({ 49134 options: options2, 49135 name, 49136 disabled, 49137 invalid, 49138 label, 49139 value = "", 49140 error, 49141 displayError = true, 49142 submitCount, 49143 autoComplete, 49144 prepend, 49145 suggestion, 49146 size = "large", 49147 transparent = false, 49148 fullWidth = false, 49149 onClear, 49150 onChange, 49151 onBlur, 49152 onValueChange 49153 }) => { 49154 const [isFocused, setIsFocused] = reactExports.useState(false); 49155 const [isHovered, setIsHovered] = reactExports.useState(false); 49156 const renderOptions = () => { 49157 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
49158 /* @__PURE__ */ jsxRuntimeExports.jsx("option", { hidden: true, disabled: true, value: "" }), 49159 options2.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx( 49160 "option", 49161 { 49162 value: item.value, 49163 disabled: item.disabled, 49164 children: item.label 49165 }, 49166 !isNil(item.key) ? item.key : item.value 49167 )) 49168 ] }); 49169 }; 49170 const getInputValue = () => { 49171 if (!value) return ""; 49172 const selectedOption = options2.find((item) => item.value === value); 49173 return selectedOption ? selectedOption.label : ""; 49174 }; 49175 const handleFocus = () => { 49176 setIsFocused(true); 49177 }; 49178 const handleBlur = (e2) => { 49179 if (onBlur) { 49180 onBlur(e2); 49181 } 49182 setIsFocused(false); 49183 }; 49184 const handleChange = (e2) => { 49185 if (onChange) { 49186 onChange(e2); 49187 } 49188 if (onValueChange) { 49189 onValueChange(e2.target.value); 49190 } 49191 }; 49192 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$d, { $fullWidth: fullWidth, children: [
49193 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx( 49194 Input$1, 49195 { 49196 disabled, 49197 label, 49198 value: getInputValue(), 49199 error, 49200 displayError, 49201 submitCount, 49202 prepend, 49203 suggestion, 49204 size, 49205 transparent, 49206 invalid, 49207 focused: isFocused, 49208 hovered: isHovered, 49209 fullWidth, 49210 tabIndex: -1, 49211 autoComplete: "off", 49212 actionIcon: /* @__PURE__ */ jsxRuntimeExports.jsxs(ActionIconsContainer, { children: [ 49213 !!getInputValue() && onClear && /* @__PURE__ */ jsxRuntimeExports.jsx(ClearIcon, { onClick: onClear, children: /* @__PURE__ */ jsxRuntimeExports.jsx($4, { height: 10 }) }), 49214 (!transparent || isFocused) && /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowIconContainer, { $hovered: isHovered, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Z4, { height: size === "small" ? 12 : 15 }) }) 49215 ] }) 49216 } 49217 ) }),
49218 /* @__PURE__ */ jsxRuntimeExports.jsx( 49219 Select$1, 49220 { 49221 name, 49222 disabled, 49223 value: value != null ? value : "", 49224 $inputSize: size, 49225 autoComplete, 49226 "aria-label": label, 49227 "data-testid": "Select.Select", 49228 onFocus: handleFocus, 49229 onBlur: handleBlur, 49230 onChange: handleChange, 49231 onMouseEnter: () => setIsHovered(true), 49232 onMouseLeave: () => setIsHovered(false), 49233 children: renderOptions() 49234 } 49235 ) 49236 ] }); 49237 }; 49238 const Select = Fr$2(SelectComponent); 49239 const Container$c = dt$2.div` 49240 position: relative; 49241 49242 width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"}; 49243`; 49244 const Textarea$1 = dt$2.textarea` 49245 width: 100%; 49246 padding: var(--space-350); 49247 background: transparent; 49248 border: 0; 49249 outline: 0; 49250 49251 font-size: var(--font-size-400); 49252 color: var(--text-primary); 49253 line-height: var(--font-line-height-400); 49254 vertical-align: top; 49255 resize: ${({ $resize }) => $resize ? "vertical" : "none"}; 49256 49257 &::placeholder { 49258 color: var(--text-secondary); 49259 } 49260 49261 :disabled { 49262 cursor: not-allowed; 49263 } 49264 49265 // https://css-tricks.com/snippets/css/change-autocomplete-styles-webkit-browsers/ 49266 &:-webkit-autofill, 49267 &:-webkit-autofill:focus, 49268 &:-webkit-autofill:hover { 49269 -webkit-text-fill-color: var(--text-primary); 49270 -webkit-background-clip: text; 49271 caret-color: var(--text-primary); 49272 } 49273`; 49274 const Label = dt$2.label` 49275 clip: rect(1px, 1px, 1px, 1px); 49276 49277 position: absolute; 49278`; 49279 const TextareaComponent = ({ 49280 placeholder, 49281 disabled, 49282 focused, 49283 tabIndex, 49284 fullWidth, 49285 label, 49286 name, 49287 value = "", 49288 rows = 2, 49289 resize = false, 49290 invalid = false, 49291 required, 49292 maxLength, 49293 info, 49294 error, 49295 displayError = true, 49296 submitCount, 49297 suggestion, 49298 onChange, 49299 onValueChange, 49300 onBlur, 49301 onFocus 49302 }) => { 49303 const [isFocused, setIsFocused] = reactExports.useState(false); 49304 reactExports.useLayoutEffect(() => { 49305 if (!isUndefined(focused)) { 49306 setIsFocused(focused); 49307 } 49308 }, [focused]); 49309 const handleChange = (e2) => { 49310 if (onChange) { 49311 onChange(e2); 49312 } 49313 if (onValueChange) { 49314 onValueChange(e2.target.value); 49315 } 49316 }; 49317 const handleFocus = (e2) => { 49318 setIsFocused(true); 49319 if (onFocus) { 49320 onFocus(e2); 49321 } 49322 }; 49323 const handleBlur = (e2) => { 49324 setIsFocused(false); 49325 if (onBlur) { 49326 onBlur(e2); 49327 } 49328 }; 49329 const getTextareaId = () => { 49330 if (!name) { 49331 return void 0; 49332 } 49333 return `${name}__textarea`; 49334 }; 49335 const charactersLeft = (maxLength || Infinity) - ((value == null ? void 0 : value.length) || 0); 49336 const showSuggestion = (!displayError || !error) && !!suggestion; 49337 const showInfo = !!maxLength || !!info; 49338 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$c, { $fullWidth: fullWidth, children: [
49339 /* @__PURE__ */ jsxRuntimeExports.jsxs( 49340 Box$1, 49341 { 49342 $invalid: invalid, 49343 $fullWidth: fullWidth, 49344 $fullHeight: true, 49345 $disabled: disabled, 49346 $focused: isFocused, 49347 children: [ 49348 /* @__PURE__ */ jsxRuntimeExports.jsx( 49349 Textarea$1, 49350 { 49351 rows, 49352 $resize: resize, 49353 placeholder, 49354 disabled, 49355 required, 49356 name, 49357 tabIndex, 49358 id: getTextareaId(), 49359 value, 49360 "aria-invalid": invalid ? "true" : "false", 49361 maxLength, 49362 onChange: handleChange, 49363 onFocus: handleFocus, 49364 onBlur: handleBlur, 49365 "data-testid": "Textarea" 49366 } 49367 ), 49368 /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { htmlFor: getTextareaId(), children: label }) 49369 ] 49370 } 49371 ), 49372 (showSuggestion || showInfo) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Footer$3, { children: [
49373 showSuggestion && /* @__PURE__ */ jsxRuntimeExports.jsx(Suggestion, { $withoutMargin: true, children: suggestion }), 49374 showInfo && /* @__PURE__ */ jsxRuntimeExports.jsx(Info, { children: info || `${charactersLeft} ${I$2(charactersLeft, "character")} left` }) 49375 ] }), 49376 displayError && !!error && /* @__PURE__ */ jsxRuntimeExports.jsx(Error$1, { errorTimestampKey: submitCount, children: error }) 49377 ] }); 49378 }; 49379 const Textarea = Fr$2(TextareaComponent); 49380 const c$2 = (e2) => "number" == typeof e2 && !isNaN(e2), d$1 = (e2) => "string" == typeof e2, u$3 = (e2) => "function" == typeof e2, p$2 = (e2) => d$1(e2) || u$3(e2) ? e2 : null, m$2 = (e2) => reactExports.isValidElement(e2) || d$1(e2) || u$3(e2) || c$2(e2); 49381 function f$3(e2, t2, n2) { 49382 void 0 === n2 && (n2 = 300); 49383 const { scrollHeight: o2, style: s2 } = e2; 49384 requestAnimationFrame(() => { 49385 s2.minHeight = "initial", s2.height = o2 + "px", s2.transition = `all ${n2}ms`, requestAnimationFrame(() => { 49386 s2.height = "0", s2.padding = "0", s2.margin = "0", setTimeout(t2, n2); 49387 }); 49388 }); 49389 } 49390 function g$2(t2) { 49391 let { enter: a2, exit: r2, appendPosition: i2 = false, collapse: l2 = true, collapseDuration: c2 = 300 } = t2; 49392 return function(t3) { 49393 let { children: d2, position: u2, preventExitTransition: p2, done: m2, nodeRef: g2, isIn: y2, playToast: v2 } = t3; 49394 const h2 = i2 ? `${a2}--${u2}` : a2, T2 = i2 ? `${r2}--${u2}` : r2, E2 = reactExports.useRef(0); 49395 return reactExports.useLayoutEffect(() => { 49396 const e2 = g2.current, t4 = h2.split(" "), n2 = (o2) => { 49397 o2.target === g2.current && (v2(), e2.removeEventListener("animationend", n2), e2.removeEventListener("animationcancel", n2), 0 === E2.current && "animationcancel" !== o2.type && e2.classList.remove(...t4)); 49398 }; 49399 e2.classList.add(...t4), e2.addEventListener("animationend", n2), e2.addEventListener("animationcancel", n2); 49400 }, []), reactExports.useEffect(() => { 49401 const e2 = g2.current, t4 = () => { 49402 e2.removeEventListener("animationend", t4), l2 ? f$3(e2, m2, c2) : m2(); 49403 }; 49404 y2 || (p2 ? t4() : (E2.current = 1, e2.className += ` ${T2}`, e2.addEventListener("animationend", t4))); 49405 }, [y2]), e$3.createElement(e$3.Fragment, null, d2); 49406 }; 49407 } 49408 function y$3(e2, t2) { 49409 return null != e2 ? { content: e2.content, containerId: e2.props.containerId, id: e2.props.toastId, theme: e2.props.theme, type: e2.props.type, data: e2.props.data || {}, isLoading: e2.props.isLoading, icon: e2.props.icon, status: t2 } : {}; 49410 } 49411 const v$4 = /* @__PURE__ */ new Map(); 49412 let h$2 = []; 49413 const T$3 = /* @__PURE__ */ new Set(), E$3 = (e2) => T$3.forEach((t2) => t2(e2)), b$3 = () => v$4.size > 0; 49414 function I$1(e2, t2) { 49415 var n2; 49416 if (t2) return !(null == (n2 = v$4.get(t2)) || !n2.isToastActive(e2)); 49417 let o2 = false; 49418 return v$4.forEach((t3) => { 49419 t3.isToastActive(e2) && (o2 = true); 49420 }), o2; 49421 } 49422 function _$3(e2, t2) { 49423 m$2(e2) && (b$3() || h$2.push({ content: e2, options: t2 }), v$4.forEach((n2) => { 49424 n2.buildToast(e2, t2); 49425 })); 49426 } 49427 function C$4(e2, t2) { 49428 v$4.forEach((n2) => { 49429 null != t2 && null != t2 && t2.containerId ? (null == t2 ? void 0 : t2.containerId) === n2.id && n2.toggle(e2, null == t2 ? void 0 : t2.id) : n2.toggle(e2, null == t2 ? void 0 : t2.id); 49430 }); 49431 } 49432 function L$3(e2) { 49433 const { subscribe: o2, getSnapshot: s2, setProps: i2 } = reactExports.useRef((function(e3) { 49434 const n2 = e3.containerId || 1; 49435 return { subscribe(o3) { 49436 const s3 = /* @__PURE__ */ (function(e4, n3, o4) { 49437 let s4 = 1, r3 = 0, i3 = [], l3 = [], f2 = [], g2 = n3; 49438 const v2 = /* @__PURE__ */ new Map(), h2 = /* @__PURE__ */ new Set(), T2 = () => { 49439 f2 = Array.from(v2.values()), h2.forEach((e5) => e5()); 49440 }, E2 = (e5) => { 49441 l3 = null == e5 ? [] : l3.filter((t2) => t2 !== e5), T2(); 49442 }, b2 = (e5) => { 49443 const { toastId: n4, onOpen: s5, updateId: a2, children: r4 } = e5.props, i4 = null == a2; 49444 e5.staleId && v2.delete(e5.staleId), v2.set(n4, e5), l3 = [...l3, e5.props.toastId].filter((t2) => t2 !== e5.staleId), T2(), o4(y$3(e5, i4 ? "added" : "updated")), i4 && u$3(s5) && s5(reactExports.isValidElement(r4) && r4.props); 49445 }; 49446 return { id: e4, props: g2, observe: (e5) => (h2.add(e5), () => h2.delete(e5)), toggle: (e5, t2) => { 49447 v2.forEach((n4) => { 49448 null != t2 && t2 !== n4.props.toastId || u$3(n4.toggle) && n4.toggle(e5); 49449 }); 49450 }, removeToast: E2, toasts: v2, clearQueue: () => { 49451 r3 -= i3.length, i3 = []; 49452 }, buildToast: (n4, l4) => { 49453 if (((t2) => { 49454 let { containerId: n5, toastId: o5, updateId: s5 } = t2; 49455 const a2 = n5 ? n5 !== e4 : 1 !== e4, r4 = v2.has(o5) && null == s5; 49456 return a2 || r4; 49457 })(l4)) return; 49458 const { toastId: f3, updateId: h3, data: I2, staleId: _2, delay: C2 } = l4, L2 = () => { 49459 E2(f3); 49460 }, N2 = null == h3; 49461 N2 && r3++; 49462 const $2 = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, g2), { style: g2.toastStyle, key: s4++ }), Object.fromEntries(Object.entries(l4).filter((e5) => { 49463 let [t2, n5] = e5; 49464 return null != n5; 49465 }))), { toastId: f3, updateId: h3, data: I2, closeToast: L2, isIn: false, className: p$2(l4.className || g2.toastClassName), bodyClassName: p$2(l4.bodyClassName || g2.bodyClassName), progressClassName: p$2(l4.progressClassName || g2.progressClassName), autoClose: !l4.isLoading && (w2 = l4.autoClose, k2 = g2.autoClose, false === w2 || c$2(w2) && w2 > 0 ? w2 : k2), deleteToast() { 49466 const e5 = v2.get(f3), { onClose: n5, children: s5 } = e5.props; 49467 u$3(n5) && n5(reactExports.isValidElement(s5) && s5.props), o4
49467(y$3(e5, "removed")), v2.delete(f3), r3--, r3 < 0 && (r3 = 0), i3.length > 0 ? b2(i3.shift()) : T2(); 49468 } }); 49469 var w2, k2; 49470 $2.closeButton = g2.closeButton, false === l4.closeButton || m$2(l4.closeButton) ? $2.closeButton = l4.closeButton : true === l4.closeButton && ($2.closeButton = !m$2(g2.closeButton) || g2.closeButton); 49471 let P2 = n4; 49472 reactExports.isValidElement(n4) && !d$1(n4.type) ? P2 = reactExports.cloneElement(n4, { closeToast: L2, toastProps: $2, data: I2 }) : u$3(n4) && (P2 = n4({ closeToast: L2, toastProps: $2, data: I2 })); 49473 const M2 = { content: P2, props: $2, staleId: _2 }; 49474 g2.limit && g2.limit > 0 && r3 > g2.limit && N2 ? i3.push(M2) : c$2(C2) ? setTimeout(() => { 49475 b2(M2); 49476 }, C2) : b2(M2); 49477 }, setProps(e5) { 49478 g2 = e5; 49479 }, setToggle: (e5, t2) => { 49480 v2.get(e5).toggle = t2; 49481 }, isToastActive: (e5) => l3.some((t2) => t2 === e5), getSnapshot: () => f2 }; 49482 })(n2, e3, E$3); 49483 v$4.set(n2, s3); 49484 const r2 = s3.observe(o3); 49485 return h$2.forEach((e4) => _$3(e4.content, e4.options)), h$2 = [], () => { 49486 r2(), v$4.delete(n2); 49487 }; 49488 }, setProps(e4) { 49489 var t2; 49490 null == (t2 = v$4.get(n2)) || t2.setProps(e4); 49491 }, getSnapshot() { 49492 var e4; 49493 return null == (e4 = v$4.get(n2)) ? void 0 : e4.getSnapshot(); 49494 } }; 49495 })(e2)).current; 49496 i2(e2); 49497 const l2 = reactExports.useSyncExternalStore(o2, s2, s2); 49498 return { getToastToRender: function(t2) { 49499 if (!l2) return []; 49500 const n2 = /* @__PURE__ */ new Map(); 49501 return e2.newestOnTop && l2.reverse(), l2.forEach((e3) => { 49502 const { position: t3 } = e3.props; 49503 n2.has(t3) || n2.set(t3, []), n2.get(t3).push(e3); 49504 }), Array.from(n2, (e3) => t2(e3[0], e3[1])); 49505 }, isToastActive: I$1, count: null == l2 ? void 0 : l2.length }; 49506 } 49507 function N$2(e2) { 49508 const [t2, o2] = reactExports.useState(false), [a2, r2] = reactExports.useState(false), l2 = reactExports.useRef(null), c2 = reactExports.useRef({ start: 0, delta: 0, removalDistance: 0, canCloseOnClick: true, canDrag: false, didMove: false }).current, { autoClose: d2, pauseOnHover: u2, closeToast: p2, onClick: m2, closeOnClick: f2 } = e2; 49509 var g2, y2; 49510 function h2() { 49511 o2(true); 49512 } 49513 function T2() { 49514 o2(false); 49515 } 49516 function E2(n2) { 49517 const o3 = l2.current; 49518 c2.canDrag && o3 && (c2.didMove = true, t2 && T2(), c2.delta = "x" === e2.draggableDirection ? n2.clientX - c2.start : n2.clientY - c2.start, c2.start !== n2.clientX && (c2.canCloseOnClick = false), o3.style.transform = `translate3d(${"x" === e2.draggableDirection ? `${c2.delta}px, var(--y)` : `0, calc(${c2.delta}px + var(--y))`},0)`, o3.style.opacity = "" + (1 - Math.abs(c2.delta / c2.removalDistance))); 49519 } 49520 function b2() { 49521 document.removeEventListener("pointermove", E2), document.removeEventListener("pointerup", b2); 49522 const t3 = l2.current; 49523 if (c2.canDrag && c2.didMove && t3) { 49524 if (c2.canDrag = false, Math.abs(c2.delta) > c2.removalDistance) return r2(true), e2.closeToast(), void e2.collapseAll(); 49525 t3.style.transition = "transform 0.2s, opacity 0.2s", t3.style.removeProperty("transform"), t3.style.removeProperty("opacity"); 49526 } 49527 } 49528 null == (y2 = v$4.get((g2 = { id: e2.toastId, containerId: e2.containerId, fn: o2 }).containerId || 1)) || y2.setToggle(g2.id, g2.fn), reactExports.useEffect(() => { 49529 if (e2.pauseOnFocusLoss) return document.hasFocus() || T2(), window.addEventListener("focus", h2), window.addEventListener("blur", T2), () => { 49530 window.removeEventListener("focus", h2), window.removeEventListener("blur", T2); 49531 }; 49532 }, [e2.pauseOnFocusLoss]); 49533 const I2 = { onPointerDown: function(t3) { 49534 if (true === e2.draggable || e2.draggable === t3.pointerType) { 49535 c2.didMove = false, document.addEventListener("pointermove", E2), document.addEventListener("pointerup", b2); 49536 const n2 = l2.current; 49537 c2.canCloseOnClick = true, c2.canDrag = true, n2.style.transition = "none", "x" === e2.draggableDirection ? (c2.start = t3.clientX, c2.removalDistance = n2.offsetWidth * (e2.draggablePercent / 100)) : (c2.start = t3.clientY, c2.removalDistance = n2.offsetHeight * (80 === e2.draggablePercent ? 1.5 * e2.draggablePercent : e2.draggablePercent) / 100); 49538 } 49539 }, onPointerUp: function(t3) { 49540 const { top: n2, bottom: o3, left: s2, right: a3 } = l2.current.getBoundingClientRect(); 49541 "touchend" !== t3.nativeEvent.type && e2.pauseOnHover && t3.clientX >= s2 && t3.clientX <= a3 && t3.clientY >= n2 && t3.clientY <= o3 ? T2() : h2(); 49542 } }; 49543 return d2 && u2 && (I2.onMouseEnter = T2, e2.stacked || (I2.onMouseLeave = h2)), f2 && (I2.onClick = (e3) => { 49544 m2 && m2(e3), c2.canCloseOnClick && p2(); 49545 }), { playToast: h2, pauseToast: T2, isRunning: t2, preventExitTransition: a2, toastRef: l2, eventHandlers: I2 }; 49546 } 49547 function $$3(t2) { 49548 let { delay: n2, isRunning: o2, closeToast: s2, type: a2 = "default", hide: r2, className: i2, style: c2, controlledProgress: d2, progress: p2, rtl: m2, isIn: f2, theme: g2 } = t2; 49549 const y2 = r2 || d2 && 0 === p2, v2 = __spreadProps(__spreadValues({}, c2), { animationDuration: `${n2}ms`, animationPlayState: o2 ? "running" : "paused" }); 49550 d2 && (v2.transform = `scaleX(${p2})`); 49551 const h2 = clsx("Toastify__progress-bar", d2 ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${g2}`, `Toastify__progress-bar--${a2}`, { "Toastify__progress-bar--rtl": m2 }), T2 = u$3(i2) ? i2({ rtl: m2, type: a2, defaultClassName: h2 }) : clsx(h2, i2), E2 = { [d2 && p2 >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: d2 && p2 < 1 ? null : () => { 49552 f2 && s2(); 49553 } }; 49554 return e$3.createElement("div", { className: "Toastify__progress-bar--wrp", "data-hidden": y2 }, e$3.createElement("div", { className: `Toastify__progress-bar--bg Toastify__progress-bar-theme--${g2} Toastify__progress-bar--${a2}` }), e$3.createElement("div", __spreadValues({ role: "progressbar", "aria-hidden": y2 ? "true" : "false", "aria-label": "notification timer", className: T2, style: v2 }, E2))); 49555 } 49556 let w$5 = 1;
49557 const k$3 = () => "" + w$5++; 49558 function P$2(e2) { 49559 return e2 && (d$1(e2.toastId) || c$2(e2.toastId)) ? e2.toastId : k$3(); 49560 } 49561 function M$5(e2, t2) { 49562 return _$3(e2, t2), t2.toastId; 49563 } 49564 function x$3(e2, t2) { 49565 return __spreadProps(__spreadValues({}, t2), { type: t2 && t2.type || e2, toastId: P$2(t2) }); 49566 } 49567 function A$3(e2) { 49568 return (t2, n2) => M$5(t2, x$3(e2, n2)); 49569 } 49570 function B$1(e2, t2) { 49571 return M$5(e2, x$3("default", t2)); 49572 } 49573 B$1.loading = (e2, t2) => M$5(e2, x$3("default", __spreadValues({ isLoading: true, autoClose: false, closeOnClick: false, closeButton: false, draggable: false }, t2))), B$1.promise = function(e2, t2, n2) { 49574 let o2, { pending: s2, error: a2, success: r2 } = t2; 49575 s2 && (o2 = d$1(s2) ? B$1.loading(s2, n2) : B$1.loading(s2.render, __spreadValues(__spreadValues({}, n2), s2))); 49576 const i2 = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, l2 = (e3, t3, s3) => { 49577 if (null == t3) return void B$1.dismiss(o2); 49578 const a3 = __spreadProps(__spreadValues(__spreadValues({ type: e3 }, i2), n2), { data: s3 }), r3 = d$1(t3) ? { render: t3 } : t3; 49579 return o2 ? B$1.update(o2, __spreadValues(__spreadValues({}, a3), r3)) : B$1(r3.render, __spreadValues(__spreadValues({}, a3), r3)), s3; 49580 }, c2 = u$3(e2) ? e2() : e2; 49581 return c2.then((e3) => l2("success", r2, e3)).catch((e3) => l2("error", a2, e3)), c2; 49582 }, B$1.success = A$3("success"), B$1.info = A$3("info"), B$1.error = A$3("error"), B$1.warning = A$3("warning"), B$1.warn = B$1.warning, B$1.dark = (e2, t2) => M$5(e2, x$3("default", __spreadValues({ theme: "dark" }, t2))), B$1.dismiss = function(e2) { 49583 !(function(e3) { 49584 var t2; 49585 if (b$3()) { 49586 if (null == e3 || d$1(t2 = e3) || c$2(t2)) v$4.forEach((t3) => { 49587 t3.removeToast(e3); 49588 }); 49589 else if (e3 && ("containerId" in e3 || "id" in e3)) { 49590 const t3 = v$4.get(e3.containerId); 49591 t3 ? t3.removeToast(e3.id) : v$4.forEach((t4) => { 49592 t4.removeToast(e3.id); 49593 }); 49594 } 49595 } else h$2 = h$2.filter((t3) => null != e3 && t3.options.toastId !== e3); 49596 })(e2); 49597 }, B$1.clearWaitingQueue = function(e2) { 49598 void 0 === e2 && (e2 = {}), v$4.forEach((t2) => { 49599 !t2.props.limit || e2.containerId && t2.id !== e2.containerId || t2.clearQueue(); 49600 }); 49601 }, B$1.isActive = I$1, B$1.update = function(e2, t2) { 49602 void 0 === t2 && (t2 = {}); 49603 const n2 = ((e3, t3) => { 49604 var n3; 49605 let { containerId: o2 } = t3; 49606 return null == (n3 = v$4.get(o2 || 1)) ? void 0 : n3.toasts.get(e3); 49607 })(e2, t2); 49608 if (n2) { 49609 const { props: o2, content: s2 } = n2, a2 = __spreadProps(__spreadValues(__spreadValues({ delay: 100 }, o2), t2), { toastId: t2.toastId || e2, updateId: k$3() }); 49610 a2.toastId !== e2 && (a2.staleId = e2); 49611 const r2 = a2.render || s2; 49612 delete a2.render, M$5(r2, a2); 49613 } 49614 }, B$1.done = (e2) => { 49615 B$1.update(e2, { progress: 1 }); 49616 }, B$1.onChange = function(e2) { 49617 return T$3.add(e2), () => { 49618 T$3.delete(e2); 49619 }; 49620 }, B$1.play = (e2) => C$4(true, e2), B$1.pause = (e2) => C$4(false, e2); 49621 const O$3 = "undefined" != typeof window ? reactExports.useLayoutEffect : reactExports.useEffect, D$4 = (t2) => { 49622 let _a = t2, { theme: n2, type: o2, isLoading: s2 } = _a, a2 = __objRest(_a, ["theme", "type", "isLoading"]); 49623 return e$3.createElement("svg", __spreadValues({ viewBox: "0 0 24 24", width: "100%", height: "100%", fill: "colored" === n2 ? "currentColor" : `var(--toastify-icon-color-${o2})` }, a2)); 49624 }, z$2 = { info: function(t2) { 49625 return e$3.createElement(D$4, __spreadValues({}, t2), e$3.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" })); 49626 }, warning: function(t2) { 49627 return e$3.createElement(D$4, __spreadValues({}, t2), e$3.createElement("path", { d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z" })); 49628 }, success: function(t2) { 49629 return e$3.createElement(D$4, __spreadValues({}, t2), e$3.createElement("path", { d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" })); 49630 }, error: function(t2) { 49631 return e$3.createElement(D$4, __spreadValues({}, t2), e$3.createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" })); 49632 }, spinner: function() { 49633 return e$3.createElement("div", { className: "Toastify__spinner" }); 49634 } }, R$4 = (n2) => { 49635 const { isRunning: o2, preventExitTransition: s2, toastRef: r2, eventHandlers: i2, playToast: c2 } = N$2(n2), { closeButton: d2, children: p2, autoClose: m2, onClick: f2, type: g2, hideProgressBar: y2, closeToast: v2, transition: h2, position: T2, className: E2, style: b2, bodyClassName: I2, bodyStyle: _2, progressClassName: C2, progressStyle: L2, updateId: w2, role: k2, progress: P2, rtl: M2, toastId: x2, deleteToast: A2, isIn: B2, isLoading: O2, closeOnClick: D2, theme: R2 } = n2, S2 = clsx("Toastify__toast", `Toastify__toast-theme--${R2}`, `Toastify__toast--${g2}`, { "Toastify__toast--rtl": M2 }, { "Toastify__toast--close-on-click": D2 }), H2 = u$3(E2) ? E2({ rtl: M2, position: T2, type: g2, defaultClassName: S2 }) : clsx(S2, E2), F2 = (function(e2) { 49636 let { theme: n3, type: o3, isLoading: s3, icon: r3 } = e2, i3 = null; 49637 const l2 = { theme: n3, type: o3 }; 49638 return false === r3 || (u$3(r3) ? i3 = r3(__spreadProps(__spreadValues({}, l2), { isLoading: s3 })) : reactExports.isValidElement(r3) ? i3 = reactExports.cloneElement(r3, l2) : s3 ? i3 = z$2.spinner() : ((e3) => e3 in z$2)(o3) && (i3 = z$2[o3](l2))), i3; 49639 })(n2), X2 = !!P2 || !m2, Y2 = { closeToast: v2, type: g2, theme: R2 }; 49640 let q2 = null; 49641 return false === d2 || (q2 = u$3(d2) ? d2(Y2) : reactExports.isValidElement(d2) ? reactExports.cloneElement(d2, Y2) : (function(t2) { 49642 let { closeToast: n3, theme: o3, ariaLabel: s3 = "close" } = t2; 49643 return e$3.createElement("button", { className: `Toastify__close-button Toastify__close-button--${o3}`, type: "button", onClick: (e2) => { 49644 e2.stopPropagation(), n3(e2); 49645 }, "aria-label": s3 }, e$3.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, e$3.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" }))); 49646 })(Y2)), e$3.createElement(h2, { isIn: B2, done: A2, position: T2, preventExitTransition: s2, nodeRef: r2, playToast: c2 }, e$3.createElement("div", __spreadProps(__spreadValues({ id: x2, onClick: f2, "data-in": B2, className: H2 }, i2), { style: b2, ref: r2 }), e$3.createElement("div", __spreadProps(__spreadValues({}, B2 && { role: k2 }), { className: u$3(I2) ? I2({ type: g2 }) : clsx("Toastify__toast-body", I2), style: _2 }), null != F2 && e$3.createElement("div", { className: clsx("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter"
49646: !O2 }) }, F2), e$3.createElement("div", null, p2)), q2, e$3.createElement($$3, __spreadProps(__spreadValues({}, w2 && !X2 ? { key: `pb-${w2}` } : {}), { rtl: M2, theme: R2, delay: m2, isRunning: o2, isIn: B2, closeToast: v2, hide: y2, type: g2, style: L2, className: C2, controlledProgress: X2, progress: P2 || 0 })))); 49647 }, S$1 = function(e2, t2) { 49648 return void 0 === t2 && (t2 = false), { enter: `Toastify--animate Toastify__${e2}-enter`, exit: `Toastify--animate Toastify__${e2}-exit`, appendPosition: t2 }; 49649 }, H$2 = g$2(S$1("bounce", true)), F$2 = g$2(S$1("slide", true)); 49650 g$2(S$1("zoom")); 49651 g$2(S$1("flip")); 49652 const q$2 = { position: "top-right", transition: H$2, autoClose: 5e3, closeButton: true, pauseOnHover: true, pauseOnFocusLoss: true, draggable: "touch", draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" }; 49653 function Q$2(t2) { 49654 let o2 = __spreadValues(__spreadValues({}, q$2), t2); 49655 const s2 = t2.stacked, [a2, r2] = reactExports.useState(true), c2 = reactExports.useRef(null), { getToastToRender: d2, isToastActive: m2, count: f2 } = L$3(o2), { className: g2, style: y2, rtl: v2, containerId: h2 } = o2; 49656 function T2(e2) { 49657 const t3 = clsx("Toastify__toast-container", `Toastify__toast-container--${e2}`, { "Toastify__toast-container--rtl": v2 }); 49658 return u$3(g2) ? g2({ position: e2, rtl: v2, defaultClassName: t3 }) : clsx(t3, p$2(g2)); 49659 } 49660 function E2() { 49661 s2 && (r2(true), B$1.play()); 49662 } 49663 return O$3(() => { 49664 if (s2) { 49665 var e2; 49666 const t3 = c2.current.querySelectorAll('[data-in="true"]'), n2 = 12, s3 = null == (e2 = o2.position) ? void 0 : e2.includes("top"); 49667 let r3 = 0, i2 = 0; 49668 Array.from(t3).reverse().forEach((e3, t4) => { 49669 const o3 = e3; 49670 o3.classList.add("Toastify__toast--stacked"), t4 > 0 && (o3.dataset.collapsed = `${a2}`), o3.dataset.pos || (o3.dataset.pos = s3 ? "top" : "bot"); 49671 const l2 = r3 * (a2 ? 0.2 : 1) + (a2 ? 0 : n2 * t4); 49672 o3.style.setProperty("--y", `${s3 ? l2 : -1 * l2}px`), o3.style.setProperty("--g", `${n2}`), o3.style.setProperty("--s", "" + (1 - (a2 ? i2 : 0))), r3 += o3.offsetHeight, i2 += 0.025; 49673 }); 49674 } 49675 }, [a2, f2, s2]), e$3.createElement("div", { ref: c2, className: "Toastify", id: h2, onMouseEnter: () => { 49676 s2 && (r2(false), B$1.pause()); 49677 }, onMouseLeave: E2 }, d2((t3, n2) => { 49678 const o3 = n2.length ? __spreadValues({}, y2) : __spreadProps(__spreadValues({}, y2), { pointerEvents: "none" }); 49679 return e$3.createElement("div", { className: T2(t3), style: o3, key: `container-${t3}` }, n2.map((t4) => { 49680 let { content: n3, props: o4 } = t4; 49681 return e$3.createElement(R$4, __spreadProps(__spreadValues({}, o4), { stacked: s2, collapseAll: E2, isIn: m2(o4.toastId, o4.containerId), style: o4.style, key: `toast-${o4.key}` }), n3); 49682 })); 49683 })); 49684 } 49685 const notify = (message, options2) => { 49686 return B$1( 49687 ({ closeToast }) => { 49688 var _a; 49689 return /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { message, type: (_a = options2 == null ? void 0 : options2.type) != null ? _a : "error", onClose: closeToast }); 49690 }, 49691 options2 49692 ); 49693 }; 49694 const update = (toastId, options2) => { 49695 B$1.update(toastId, options2); 49696 }; 49697 const dismiss = (toastId) => { 49698 B$1.dismiss(toastId); 49699 }; 49700 const dismissAll = () => { 49701 B$1.dismiss(); 49702 }; 49703 function injectStyle() { 49704 var style = `:root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-offset:16px;
49704--toastify-toast-top:max(var(--toastify-toast-offset),env(safe-area-inset-top));--toastify-toast-right:max(var(--toastify-toast-offset),env(safe-area-inset-right));--toastify-toast-left:max(var(--toastify-toast-offset),env(safe-area-inset-left));--toastify-toast-bottom:max(var(--toastify-toast-offset),env(safe-area-inset-bottom));--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-toast-bd-radius:6px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error);--toastify-color-progress-bgo:0.2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translateX(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:auto}}.Toastify__toast{--y:0;position:relative;-ms-touch-action:none;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__close-button,.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}
49704.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right;border-bottom-left-radius:0;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}
49704}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}`; 49705 var css = document.createElement("style"); 49706 css.innerText = style; 49707 document.head.appendChild(css); 49708 } 49709 const GlobalStyles = ft$2` 49710 .Toastify__toast-container { 49711 ${mediaQueries.tablet} { 49712 width: auto !important; 49713 } 49714 } 49715 49716 .Toastify__toast { 49717 padding: 0 !important; 49718 box-shadow: none !important; 49719 background: none !important; 49720 } 49721 49722 /* body prefix only to outrank react-toastify's own bottom: 1em */ 49723 body .Toastify__toast-container--bottom-left, 49724 body .Toastify__toast-container--bottom-center, 49725 body .Toastify__toast-container--bottom-right { 49726 bottom: ${pageBottomOffset("var(--space-400)")}; 49727 } 49728`; 49729 const toastContainerPositionMap = { 49730 bottom: "bottom-center", 49731 top: "top-center", 49732 "top-right": "top-right", 49733 "top-left": "top-left", 49734 "bottom-right": "bottom-right", 49735 "bottom-left": "bottom-left" 49736 }; 49737 const ToastsContext = reactExports.createContext({ 49738 notify, 49739 update,
49740 dismiss, 49741 dismissAll, 49742 toast: B$1 49743 }); 49744 const ToastsProvider = ({ 49745 position: position2 = "bottom", 49746 autoClose = 5e3, 49747 children 49748 }) => { 49749 const value = reactExports.useMemo(() => ({ notify, update, dismiss, dismissAll, toast: B$1 }), []); 49750 reactExports.useEffect(() => { 49751 injectStyle(); 49752 }, []); 49753 return /* @__PURE__ */ jsxRuntimeExports.jsxs(ToastsContext.Provider, { value, children: [ 49754 /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalStyles, {}), 49755 children, 49756 /* @__PURE__ */ jsxRuntimeExports.jsx( 49757 Q$2, 49758 { 49759 autoClose, 49760 hideProgressBar: true, 49761 closeButton: false, 49762 closeOnClick: false, 49763 draggable: false, 49764 icon: false, 49765 position: toastContainerPositionMap[position2], 49766 role: void 0, 49767 transition: F$2 49768 } 49769 ) 49770 ] }); 49771 }; 49772 var a = { shippableRegions: [{ country: "US" }] }; 49773 var s$2 = { shippableRegions: [{ country: "US" }] }; 49774 var p$1 = { productsWithShippableRegions: { "3accbf28-7684-479a-9a2f-40963b8812d8": [{ country: "US" }], "1bff2f75-3c5d-4491-9b07-98c7026737ff": [{ country: "US" }], "6896df8c-b735-4795-9e9a-e0cf1f1684fa": [{ country: "US" }] } }; 49775 var b$2 = { productsWithShippableRegions: { "c939e8a1-c4f7-4f25-a4bd-82fd94bdd42c": [{ country: "US" }] } }; 49776 var n = { productsWithShippableRegions: { "0f018477-173c-421d-839b-cd4984b657fb": [{ country: "US" }] } }; 49777 var i$1 = { productsWithShippableRegions: { "c7e1d90c-51ad-4345-ad8a-9b842b393216": [{ country: "US" }], "122981aa-015f-4724-91ca-29c6dd3b3cdd": [{ country: "US" }] } }; 49778 var f$2 = { membershipPerks: ["access to private feed, community, and exclusive content (ab pics, tweet drafts, crazy dms, BTS, singing covers, and other funny shenanigans)"] }; 49779 var y$2 = { productsWithNonShippableRegions: { "3a286f08-d30f-46ea-a0b1-6a79b0d17b98": [{ country: "AF" }, { country: "BY" }, { country: "CF" }, { country: "CU" }, { country: "EH" }, { country: "FK" }, { country: "GQ" }, { country: "GW" }, { country: "HM" }, { country: "IR" }, { country: "KI" }, { country: "KM" }, { country: "KP" }, { country: "MM" }, { country: "NR" }, { country: "NU" }, { country: "PM" }, { country: "RU" }, { country: "SB" }, { country: "SD" }, { country: "SH" }, { country: "SL" }, { country: "SO" }, { country: "ST" }, { country: "SY" }, { country: "TJ" }, { country: "TK" }, { country: "TM" }, { country: "TV" }, { country: "UA" }, { country: "UM" }, { country: "VE" }, { country: "YE" }] } }; 49780 var u$2 = { productsWithShippableRegions: { "eb8b31b5-5d83-4673-8294-758751ab0d8e": [{ country: "US" }], "e3d1a1af-aa3b-40cd-8fcb-2bbc43882ce3": [{ country: "US" }], "1baed108-3bf0-41c9-a1a3-6426b8201dc9": [{ country: "US" }], "4331253e-e651-4c88-af63-549255653c6e": [{ country: "US" }], "e2d330c0-d7e8-4d29-82fc-daf72ba8260f": [{ country: "US" }], "dfe88db0-9612-48e1-a299-55b53a3a8de3": [{ country: "US" }], "9b1a117d-0885-4dfe-ab8c-9ced58d5f612": [{ country: "US" }], "295ca860-cfdb-4fea-877b-16ce9202b4c9": [{ country: "US" }], "54ad1784-8340-4061-8b47-2cfe8e17b489": [{ country: "US" }] } }; 49781 var o = [{ country: "US" }, { country: "CA" }, { country: "AU" }, { country: "NZ" }, { country: "AT" }, { country: "BE" }, { country: "BG" }, { country: "HR" }, { country: "CY" }, { country: "CZ" }, { country: "DK" }, { country: "EE" }, { country: "FI" }, { country: "FR" }, { country: "DE" }, { country: "GB" }, { country: "GR" }, { country: "HU" }, { country: "IS" }, { country: "IT" }, { country: "IE" }, { country: "LV" }, { country: "LT" }, { country: "LU" }, { country: "MT" }, { country: "NL" }, { country: "NO" }, { country: "PL" }, { country: "PT" }, { country: "RO" }, { country: "SK" }, { country: "SI" }, { country: "ES" }, { country: "SE" }], h$1 = { productsWithShippableRegions: { "a3b721e3-2b30-4b18-b99e-c0dcc7320ffe": o, "79f3acb6-ec84
49781-412b-82c4-2ac89b49c6e8": o, "8eba7465-770b-4744-855e-f6356cb93c8f": o, "c9551902-181c-4fc6-97ee-a4ba04b049af": o, "84e93e79-7717-49fd-be7e-6f9f15b82ddd": o, "0849323e-9864-4cb4-a13b-527bd5e7d265": o, "e4542e30-3c7a-425e-a0b4-be59216fb440": o, "0fb48dab-17f0-428f-ad9f-617755b5b182": o, "b71f60a2-12c8-49da-b505-4a5d70ce17b6": o } }; 49782 var S = { productsWithShippableRegions: { "7dab841e-ab6e-48a6-bb51-77ebcb7838a1": [{ country: "US" }] } }; 49783 var m$1 = { productsWithShippableRegions: { "516a97b1-05f6-418b-9a54-077595949c0a": [{ country: "US" }] } }; 49784 var v$3 = { disablePayPalWithMembershipsUpselling: true }; 49785 var t$1 = { layout: { platformLogo: true } }; 49786 var e$1 = { shippableRegions: [{ country: "US" }, { country: "CA" }], productsWithShippableRegions: { "6ef896a4-eb9b-407f-b585-0957ed55d193": [{ country: "US" }], "3045ee52-9768-40e2-afbe-a4a7698fec64": [{ country: "US" }] }, disableAddressAutocomplete: true, formAccessibilityMode: true }; 49787 var l = { productsWithShippableRegions: { "ba5fbdd4-a701-4100-a3cd-7a9e4daff991": [{ country: "US" }], "6497a337-1f0b-4d48-99e0-a5bec9912ca0": [{ country: "US" }], "a9bf82aa-e55a-4c21-88e8-e71b85631682": [{ country: "US" }] } }; 49788 var O$2 = [{ country: "US" }, { country: "CA" }, { country: "MX" }], g$1 = { productsWithShippableRegions: { "0e344ee5-d14e-4805-8740-b653998888d1": O$2, "4d7f5325-d01e-4f96-8658-9c19139e43dc": O$2 } }; 49789 var U$2 = { membershipPerks: ["Access to all TMG Studios shows - Ad Free!", "Exclusive Access to T.I.T. & Insanely Chill", "Bonus episodes every week", "Members-only Discord", "Immediate access to the full archive of all shows", "Discounts, early access, & exclusive merch drops", "Members Only Ad Free RSS Feed", "Insanely Chill RSS Feed"] }; 49790 var _$2 = { productsWithShippableRegions: { "13d44df7-3744-43a0-a410-6c597a267966": [{ country: "US" }], "811e9152-ce14-4c79-9933-571791ba0723": [{ country: "US" }], "38093b19-54a7-412b-8cfb-a376dfc745e4": [{ country: "US" }], "acdeb6a1-21f0-4ae8-b43d-b819c883dca0": [{ country: "US" }], "969dc0d3-a690-4fdd-a738-192824be8739": [{ country: "US" }], "3fac0491-381a-4c40-8e9a-3b1059575430": [{ country: "US" }], "68af6865-7ee3-44fd-a3a6-f682fde55767": [{ country: "US" }], "22090df3-c490-4881-8846-e6449371c37f": [{ country: "US" }] } }; 49791 var R$3 = { dialects: ["latin", "japanese"] }; 49792 var r = { nonShippableRegions: [{ country: "CN" }, { country: "BR" }, { country: "TW" }, { country: "HK" }, { country: "MO" }] }; 49793 var x$2 = { shippableRegions: [{ country: "US", states: ["CA"] }] }; 49794 var c$1 = [{ country: "US" }, { country: "CA" }, { country: "MX" }], M$4 = { productsWithShippableRegions: { "9f13f09a-c851-4eb6-a5fa-27ea8a08c786": c$1, "2a6860e3-ee9b-40da-9d9a-a6563b87aa6a": c$1, "d416a635-3a61-447c-8000-c92a2757c052": [{ country: "US" }], "7269c3ef-9b2c-4d9f-a190-ea914e0db0cd": [{ country: "US" }], "a506c773-f3aa-4a55-ad47-16b0a368897b": [{ country: "US" }], "230c68e4-275d-49ad-97fc-b0b62d3d2f9d": c$1, "d064488b-c437-48fa-878c-eadc244f4633": c$1, "29bb8000-c081-4880-af8c-50e601587c36": c$1, "1e14dd15-1ff1-44cb-b24e-e496be9d28cd": c$1, "2e18665c-b9e9-4572-8cb9-acc975227787": c$1 }, productsWithNonShippableRegions: { "cb94f788-a28e-4e32-ae17-3383846dffa2": c$1, "d57863af-e5a0-4bbe-bc54-111aa90a007a": [{ country: "UA" }, { country: "BM" }], "63394731-bdd0-4c39-966b-3707b978bff6": [{ country: "UA" }, { country: "BM" }], "0b335d61-955b-4e56-ab1e-670c76532a13": [{ country: "UA" }, { country: "BM" }], "10bea90e-6a3b-453d-a036-18fe4e4e4be2": [{ country: "UA" }, { country: "BM" }], "806e6e62-b695-4861-8d40-f63232ae99c7": [{ country: "UA" }, { country: "BM" }] } }; 49795 var T$2 = { "sh_00dced06-a45b-4aa6-89e3-c917a6155a79": a, "sh_93110e49-77b4-4d22-a09a-330354fd0c46": s$2, "sh_12c8d857-6660-4c55-83b2-0248b1c07792": p$1, "sh_d8553b21-8dab-4e74-9de4-0d09ca7d7d0e": b$2, "sh_d33d2b15-2819-4a9e-a7a2-bd3c27cea93c": n, "sh_269a39fe-32c3-4295-b26f-4be57a8ed3be": i$1, "sh_7978d999-c742-4bc4-9ec4-b96434102d5c": y$2, "sh_bc9e3a6d-03d3-4546-b03c-46f8dfd9d79f": u$2, "sh_6cdb0a1a-8619-4490-913b-2d1d0cee48d5": S, "sh_1b053ca4-73d6-431c-bd9a-5b0253026c47": h$1, "sh_9dbbc8ed-b585-4978-a865-713b1876bd2a": m$1, "sh_91cf8dd7-d4f0-4d19-9145-d31ac2bf5163": e$1, "sh_a149996b-6470-4779-89a3-291019d301fe": e$1, "sh_4c0e1c35-39b8-41b2-b143-fd009e1734b5": e$1, "sh_3bfdf06e-78e7-4f76-b617-2ed453ea062c": e$1, "sh_216afd99-30a2-44c3-8dd1-8db7938e5058": e$1, "sh_d2d05da6-4d8a-4a17-bf16-8dadc845fbbe": e$1, "sh_760fff51-2df9-4055-910d-b48fe4c0698f": e$1, "sh_f29ebb5c-7578-475f-b1f4-8797b944ddd3": e$1, "sh_b34403e9-427e-46a0-afca-72e018c39909": e$1, "sh_780f70e2-40e0-4f3b-92d2-f3920a480b3b": e$1, "sh_06e7a31d-9c2b-4fb0-945d-5e727c241555": e$1, "sh_ae7374ce-770f-4430-ba21-ac3afb64d80b": e$1, "sh_7d739f1c-cf5e-4a1f-8886-a22bc107e59c": l, "sh_f787d79d-e3f8-4234-a59a-2258d183270d": g$1, "sh_e6aa97a7-cbc8-4852-935f-cac743960953": _$2, "sh_d935a9f8-c5df-4bb3-ad20-456f717fefe4": R$3, "sh_c6758292-c0eb-4354-9588-e577e859ccba": r, "sh_2ba6ff5a-fb08-4bd9-89c6-3084cf0adaeb": r, "sh_baa9ba65-b453-48d2-9b66-b445bea4cd58": r, "sh_5508ffc0-fe93-4d82-b9ea-f5bb4abd629c": r, "sh_2047147f-7dfd-4510-b09d-a3ce5d52d9ab": r, "sh_742f04ea-50bb-4a4b-b71f-407ac13f253e": r, "sh_7a484f64-e468-4a20-84c6-ffe77dbebe96": r, "sh_ef07a63c-d4be-4c6e-bdde-e64f4c8afdd6": r, "sh_87d0ebf3-4cd2-4241-bc51-d7b274466f83": M$4, "sh_01e38772-32e8-4476-832c-cb4c94de74ea": x$2, "sh_9c17c8d8-a2e7-45ab-8e02-7dee57366b2b": v$3, "sh_e3c48072-ff77-49ca-840a-5c72ee2519b0": t$1, "sh_1f2fcdc8-2842-479d-b3d9-b2e0a1f51f14": t$1, "sh_10a20816-d098-4f06-b2f7-ec47a4d5602f": U$2, "sh_ea6d124d-8b50-4d5b-ba2e-87818220e248": f$2, "sh_94e99f91-3c93-4c4a-b843-3f527f4c4ca3": { dialects: ["latin", "japanese"] } }, A$2 = reactExports.createContext({}), E$2 = ({ shopId: d2, children: C2 }) => { 49796 var _a; 49797 let P2 = (_a = d2 ? T$2[d2] : void 0) != null ? _a : {}; 49798 return jsxRuntimeExports.jsx(A$2.Provider, { value: P2, children: C2 }); 49799 }, w$4 = () => reactExports.useContext(A$2); 49800 const Container$b = dt$2.div` 49801 display: flex; 49802 align-items: center; 49803 justify-content: center; 49804 padding: var(--space-800) 0; 49805`; 49806 const LayoutLoader = () => { 49807 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$b, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "large" }) }); 49808 }; 49809 const Container$a = dt$2.div` 49810 display: flex; 49811 gap: var(--space-400); 49812 flex-direction: column; 49813 49814 ${mediaQueries.tablet} { 49815 flex-direction: row; 49816 } 49817`; 49818 const LayoutTabs = ({ children }) => { 49819 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$a, { children }); 49820 }; 49821 const BackButton = dt$2.button` 49822 margin-bottom: var(--space-200); 49823`; 49824 const Container$9 = dt$2.h1` 49825 color: var(--text-primary); 49826 49827 font-size: var(--font-size-600); 49828 font-family: var(--font-family-heading); 49829 font-weight: var(--font-weight-480); 49830 line-height: var(--font-line-height-500); 49831 letter-spacing: var(--font-letter-spacing-dense); 49832 font-style: var(--font-style-heading); 49833 text-transform: var(--text-transform-heading); 49834 49835 ${mediaQueries.laptop} { 49836 font-size: var(--font-size-700); 49837 font-weight: var(--font-weight-460); 49838 line-height: var(--font-line-height-600); 49839 letter-spacing: var(--font-letter-spacing-denser); 49840 } 49841`; 49842 const LayoutTitle = ({ children, backLocation }) => { 49843 const { t: t2 }
49843 = useTranslation("components", { keyPrefix: "layout" }); 49844 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ 49845 backLocation && /* @__PURE__ */ jsxRuntimeExports.jsx(BackButton, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BackButton$1, { label: t2("back_label"), to: backLocation }) }), 49846 /* @__PURE__ */ jsxRuntimeExports.jsx(Container$9, { children }) 49847 ] }); 49848 }; 49849 const Container$8 = dt$2.div``; 49850 const Inner = dt$2.div` 49851 display: flex; 49852 flex-direction: column; 49853 position: relative; 49854 gap: var(--space-400); 49855 padding: 0 var(--space-600); 49856 margin-bottom: var(--space-600); 49857 49858 ${mediaQueries.laptop} { 49859 max-width: 664px; 49860 padding: 0 var(--space-800); 49861 margin: 0 auto var(--space-800); 49862 gap: var(--space-600); 49863 } 49864`; 49865 const Top = dt$2.nav` 49866 padding: var(--space-500) var(--space-600) 0; 49867 margin-bottom: var(--space-1000); 49868 display: flex; 49869 justify-content: center; 49870 align-items: center; 49871 49872 ${mediaQueries.tablet} { 49873 padding: var(--space-500) var(--space-800) 0; 49874 } 49875 49876 ${mediaQueries.laptop} { 49877 padding-left: 0; 49878 padding-right: 0; 49879 } 49880`; 49881 const PlatformLogo = dt$2.h1` 49882 display: inline-flex; 49883 align-items: center; 49884 color: var(--text-primary); 49885`; 49886 const Layout = ({ logoName, logoUrl, externalStoreUrl, children }) => { 49887 const { t: t2 } = useTranslation("components", { keyPrefix: "layout" }); 49888 const { layout: layout2 } = w$4(); 49889 const renderLogo = () => { 49890 if (layout2 == null ? void 0 : layout2.platformLogo) { 49891 return /* @__PURE__ */ jsxRuntimeExports.jsx(PlatformLogo, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(P8, { width: 113, height: 20, "aria-label": "Fourthwall" }) }); 49892 } 49893 return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: externalStoreUrl || "/", title: t2("logo_title"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ShopLogo, { name: logoName, url: logoUrl }) }); 49894 }; 49895 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$8, { children: [
49896 /* @__PURE__ */ jsxRuntimeExports.jsx(Top, { children: renderLogo() }), 49897 /* @__PURE__ */ jsxRuntimeExports.jsx(Inner, { children }) 49898 ] }); 49899 }; 49900 Layout.Title = LayoutTitle; 49901 Layout.Loader = LayoutLoader; 49902 Layout.Tabs = LayoutTabs; 49903 const buildContactMetaTags = ({ 49904 title, 49905 description, 49906 siteName, 49907 url, 49908 imageUrl 49909 }) => [ 49910 { name: "description", content: description }, 49911 { property: "og:site_name", content: siteName }, 49912 { property: "og:url", content: url }, 49913 { property: "og:title", content: title }, 49914 { property: "og:type", content: "website" }, 49915 { property: "og:description", content: description }, 49916 ...imageUrl ? [ 49917 { property: "og:image", content: imageUrl }, 49918 { property: "og:image:secure_url", content: imageUrl }, 49919 { name: "twitter:image", content: imageUrl } 49920 ] : [], 49921 { name: "twitter:card", content: "summary_large_image" }, 49922 { name: "twitter:title", content: title }, 49923 { name: "twitter:description", content: description } 49924 ]; 49925 const buildOrganizationSchema = ({ 49926 name, 49927 url, 49928 contactUrl, 49929 logoUrl, 49930 contactEmail 49931 }) => __spreadProps(__spreadValues({ 49932 "@context": "https://schema.org", 49933 "@type": "Organization", 49934 name, 49935 url 49936 }, logoUrl ? { logo: logoUrl } : {}), { 49937 contactPoint: __spreadValues({ 49938 "@type": "ContactPoint", 49939 contactType: "customer support", 49940 url: contactUrl 49941 }, contactEmail ? { email: contactEmail } : {}) 49942 }); 49943 const TITLE_SEPARATOR = " â "; 49944 const ContactHead = ({ 49945 shopName, 49946 contactEmail, 49947 logoUrl, 49948 externalStoreUrl 49949 }) => { 49950 const { t: t2 } = useTranslation("modules", { keyPrefix: "contact" }); 49951 const title = t2("page_title"); 49952 if (!shopName) { 49953 return /* @__PURE__ */ jsxRuntimeExports.jsx(HeadContent, { title }); 49954 } 49955 const pageUrl = `${window.location.origin}/contact`; 49956 const fullTitle = `${title}${TITLE_SEPARATOR}${shopName}`; 49957 const description = t2("meta_description", { shopName, interpolation: { escapeValue: false } }); 49958 const metaTags = buildContactMetaTags({ 49959 title: fullTitle, 49960 description, 49961 siteName: shopName, 49962 url: pageUrl, 49963 imageUrl: logoUrl 49964 }); 49965 const organizationSchema = buildOrganizationSchema({ 49966 name: shopName, 49967 url: externalStoreUrl != null ? externalStoreUrl : window.location.origin, 49968 contactUrl: pageUrl, 49969 logoUrl, 49970 contactEmail 49971 }); 49972 return /* @__PURE__ */ jsxRuntimeExports.jsxs(HeadContent, { title, titleTemplate: `%s${TITLE_SEPARATOR}${shopName}`, children: [
49973 /* @__PURE__ */ jsxRuntimeExports.jsx("link", { rel: "canonical", href: pageUrl }), 49974 metaTags.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx("meta", __spreadValues({}, tag), "name" in tag ? tag.name : tag.property)), 49975 /* @__PURE__ */ jsxRuntimeExports.jsx("script", { type: "application/ld+json", children: me$2(JSON.stringify(organizationSchema)) }) 49976 ] }); 49977 }; 49978 var warn = {}; 49979 var hasRequiredWarn; 49980 function requireWarn() { 49981 if (hasRequiredWarn) return warn; 49982 hasRequiredWarn = 1; 49983 Object.defineProperty(warn, "__esModule", { 49984 value: true 49985 }); 49986 var warn$12 = function warn2(s2) { 49987 console.warn("[react-gtm]", s2); 49988 }; 49989 warn.default = warn$12; 49990 return warn; 49991 } 49992 var Snippets_1; 49993 var hasRequiredSnippets; 49994 function requireSnippets() { 49995 if (hasRequiredSnippets) return Snippets_1; 49996 hasRequiredSnippets = 1; 49997 var _warn = requireWarn(); 49998 var _warn2 = _interopRequireDefault(_warn); 49999 function _interopRequireDefault(obj) { 50000 return obj && obj.__esModule ? obj : { default: obj }; 50001 } 50002 var Snippets = { 50003 tags: function tags(_ref2) { 50004 var id2 = _ref2.id, events = _ref2.events, dataLayer = _ref2.dataLayer, dataLayerName = _ref2.dataLayerName, preview = _ref2.preview, auth = _ref2.auth; 50005 var gtm_auth = ">m_auth=" + auth; 50006 var gtm_preview = ">m_preview=" + preview; 50007 if (!id2) (0, _warn2.default)("GTM Id is required"); 50008 var iframe = '\n <iframe src="https://www.googletagmanager.com/ns.html?id=' + id2 + gtm_auth + gtm_preview + '>m_cookies_win=x"\n height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>'; 50009 var script = "\n (function(w,d,s,l,i){w[l]=w[l]||[];\n w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', " + JSON.stringify(events).slice(1, -1) + "});\n var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';\n j.async=true;
50009j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'" + gtm_auth + gtm_preview + ">m_cookies_win=x';\n f.parentNode.insertBefore(j,f);\n })(window,document,'script','" + dataLayerName + "','" + id2 + "');"; 50010 var dataLayerVar = this.dataLayer(dataLayer, dataLayerName); 50011 return { 50012 iframe, 50013 script, 50014 dataLayerVar 50015 }; 50016 }, 50017 dataLayer: function dataLayer(_dataLayer, dataLayerName) { 50018 return "\n window." + dataLayerName + " = window." + dataLayerName + " || [];\n window." + dataLayerName + ".push(" + JSON.stringify(_dataLayer) + ")"; 50019 } 50020 }; 50021 Snippets_1 = Snippets; 50022 return Snippets_1; 50023 } 50024 var TagManager_1; 50025 var hasRequiredTagManager; 50026 function requireTagManager() { 50027 if (hasRequiredTagManager) return TagManager_1; 50028 hasRequiredTagManager = 1; 50029 var _Snippets = requireSnippets(); 50030 var _Snippets2 = _interopRequireDefault(_Snippets); 50031 function _interopRequireDefault(obj) { 50032 return obj && obj.__esModule ? obj : { default: obj }; 50033 } 50034 var TagManager2 = { 50035 dataScript: function dataScript(dataLayer) { 50036 var script = document.createElement("script"); 50037 script.innerHTML = dataLayer; 50038 return script; 50039 }, 50040 gtm: function gtm(args) { 50041 var snippets = _Snippets2.default.tags(args); 50042 var noScript = function noScript2() { 50043 var noscript = document.createElement("noscript"); 50044 noscript.innerHTML = snippets.iframe; 50045 return noscript; 50046 }; 50047 var script = function script2() { 50048 var script3 = document.createElement("script"); 50049 script3.innerHTML = snippets.script; 50050 return script3; 50051 }; 50052 var dataScript = this.dataScript(snippets.dataLayerVar); 50053 return { 50054 noScript, 50055 script, 50056 dataScript 50057 }; 50058 }, 50059 initialize: function initialize(_ref2) { 50060 var gtmId = _ref2.gtmId, _ref$events = _ref2.events, events = _ref$events === void 0 ? {} : _ref$events, dataLayer = _ref2.dataLayer, _ref$dataLayerName = _ref2.dataLayerName, dataLayerName = _ref$dataLayerName === void 0 ? "dataLayer" : _ref$dataLayerName, _ref$auth = _ref2.auth, auth = _ref$auth === void 0 ? "" : _ref$auth, _ref$preview = _ref2.preview, preview = _ref$preview === void 0 ? "" : _ref$preview; 50061 var gtm = this.gtm({ 50062 id: gtmId, 50063 events, 50064 dataLayer: dataLayer || void 0, 50065 dataLayerName, 50066 auth, 50067 preview 50068 }); 50069 if (dataLayer) document.head.appendChild(gtm.dataScript); 50070 document.head.insertBefore(gtm.script(), document.head.childNodes[0]); 50071 document.body.insertBefore(gtm.noScript(), document.body.childNodes[0]); 50072 }, 50073 dataLayer: function dataLayer(_ref2) { 50074 var _dataLayer = _ref2.dataLayer, _ref2$dataLayerName = _ref2.dataLayerName, dataLayerName = _ref2$dataLayerName === void 0 ? "dataLayer" : _ref2$dataLayerName; 50075 if (window[dataLayerName]) return window[dataLayerName].push(_dataLayer); 50076 var snippets = _Snippets2.default.dataLayer(_dataLayer, dataLayerName); 50077 var dataScript = this.dataScript(snippets); 50078 document.head.insertBefore(dataScript, document.head.childNodes[0]); 50079 } 50080 }; 50081 TagManager_1 = TagManager2; 50082 return TagManager_1; 50083 } 50084 var dist$1; 50085 var hasRequiredDist$1; 50086 function requireDist$1() { 50087 if (hasRequiredDist$1) return dist$1; 50088 hasRequiredDist$1 = 1; 50089 var _TagManager = requireTagManager(); 50090 var _TagManager2 = _interopRequireDefault(_TagManager); 50091 function _interopRequireDefault(obj) { 50092 return obj && obj.__esModule ? obj : { default: obj }; 50093 } 50094 dist$1 = _TagManager2.default; 50095 return dist$1; 50096 } 50097 var distExports = requireDist$1(); 50098 const TagManager = /* @__PURE__ */ getDefaultExportFromCjs(distExports); 50099 class Subscribable { 50100 constructor() { 50101 this.listeners = /* @__PURE__ */ new Set(); 50102 this.subscribe = this.subscribe.bind(this); 50103 } 50104 subscribe(listener) { 50105 const identity2 = { 50106 listener 50107 }; 50108 this.listeners.add(identity2); 50109 this.onSubscribe(); 50110 return () => { 50111 this.listeners.delete(identity2); 50112 this.onUnsubscribe(); 50113 }; 50114 } 50115 hasListeners() { 50116 return this.listeners.size > 0; 50117 } 50118 onSubscribe() { 50119 } 50120 onUnsubscribe() { 50121 } 50122 } 50123 const isServer = typeof window === "undefined" || "Deno" in window; 50124 function noop$1() { 50125 return void 0; 50126 } 50127 function functionalUpdate(updater, input) { 50128 return typeof updater === "function" ? updater(input) : updater; 50129 } 50130 function isValidTimeout(value) { 50131 return typeof value === "number" && value >= 0 && value !== Infinity; 50132 } 50133 function timeUntilStale(updatedAt, staleTime) { 50134 return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); 50135 } 50136 function parseQueryArgs(arg1, arg2, arg3) { 50137 if (!isQueryKey(arg1)) { 50138 return arg1; 50139 } 50140 if (typeof arg2 === "function") { 50141 return __spreadProps(__spreadValues({}, arg3), { 50142 queryKey: arg1, 50143 queryFn: arg2 50144 }); 50145 } 50146 return __spreadProps(__spreadValues({}, arg2), { 50147 queryKey: arg1 50148 }); 50149 } 50150 function parseMutationArgs(arg1, arg2, arg3) { 50151 if (isQueryKey(arg1)) { 50152 return __spreadProps(__spreadValues({}, arg2), { 50153 mutationKey: arg1 50154 }); 50155 } 50156 if (typeof arg1 === "function") { 50157 return __spreadProps(__spreadValues({}, arg2), { 50158 mutationFn: arg1 50159 }); 50160 } 50161 return __spreadValues({}, arg1); 50162 } 50163 function parseFilterArgs(arg1, arg2, arg3) { 50164 return isQueryKey(arg1) ? [__spreadProps(__spreadValues({}, arg2), { 50165 queryKey: arg1 50166 }), arg3] : [arg1 || {}, arg2]; 50167 } 50168 function parseMutationFilterArgs(arg1, arg2, arg3) { 50169 return isQueryKey(arg1) ? [__spreadProps(__spreadValues({}, arg2), { 50170 mutationKey: arg1 50171 }), arg3] : [arg1 || {}, arg2]; 50172 }
50173 function matchQuery(filters, query) { 50174 const { 50175 type = "all", 50176 exact, 50177 fetchStatus, 50178 predicate, 50179 queryKey, 50180 stale 50181 } = filters; 50182 if (isQueryKey(queryKey)) { 50183 if (exact) { 50184 if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { 50185 return false; 50186 } 50187 } else if (!partialMatchKey(query.queryKey, queryKey)) { 50188 return false; 50189 } 50190 } 50191 if (type !== "all") { 50192 const isActive = query.isActive(); 50193 if (type === "active" && !isActive) { 50194 return false; 50195 } 50196 if (type === "inactive" && isActive) { 50197 return false; 50198 } 50199 } 50200 if (typeof stale === "boolean" && query.isStale() !== stale) { 50201 return false; 50202 } 50203 if (typeof fetchStatus !== "undefined" && fetchStatus !== query.state.fetchStatus) { 50204 return false; 50205 } 50206 if (predicate && !predicate(query)) { 50207 return false; 50208 } 50209 return true; 50210 } 50211 function matchMutation(filters, mutation) { 50212 const { 50213 exact, 50214 fetching, 50215 predicate, 50216 mutationKey 50217 } = filters; 50218 if (isQueryKey(mutationKey)) { 50219 if (!mutation.options.mutationKey) { 50220 return false; 50221 } 50222 if (exact) { 50223 if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) { 50224 return false; 50225 } 50226 } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { 50227 return false; 50228 } 50229 } 50230 if (typeof fetching === "boolean" && mutation.state.status === "loading" !== fetching) { 50231 return false; 50232 } 50233 if (predicate && !predicate(mutation)) { 50234 return false; 50235 } 50236 return true; 50237 } 50238 function hashQueryKeyByOptions(queryKey, options2) { 50239 const hashFn = (options2 == null ? void 0 : options2.queryKeyHashFn) || hashQueryKey; 50240 return hashFn(queryKey); 50241 } 50242 function hashQueryKey(queryKey) { 50243 return JSON.stringify(queryKey, (_2, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { 50244 result[key] = val[key]; 50245 return result; 50246 }, {}) : val); 50247 } 50248 function partialMatchKey(a2, b2) { 50249 return partialDeepEqual(a2, b2); 50250 } 50251 function partialDeepEqual(a2, b2) { 50252 if (a2 === b2) { 50253 return true; 50254 } 50255 if (typeof a2 !== typeof b2) { 50256 return false; 50257 } 50258 if (a2 && b2 && typeof a2 === "object" && typeof b2 === "object") { 50259 return !Object.keys(b2).some((key) => !partialDeepEqual(a2[key], b2[key])); 50260 } 50261 return false; 50262 } 50263 function replaceEqualDeep(a2, b2) { 50264 if (a2 === b2) { 50265 return a2; 50266 } 50267 const array2 = isPlainArray(a2) && isPlainArray(b2); 50268 if (array2 || isPlainObject(a2) && isPlainObject(b2)) { 50269 const aSize = array2 ? a2.length : Object.keys(a2).length; 50270 const bItems = array2 ? b2 : Object.keys(b2); 50271 const bSize = bItems.length; 50272 const copy2 = array2 ? [] : {}; 50273 let equalItems = 0; 50274 for (let i2 = 0; i2 < bSize; i2++) { 50275 const key = array2 ? i2 : bItems[i2]; 50276 copy2[key] = replaceEqualDeep(a2[key], b2[key]); 50277 if (copy2[key] === a2[key]) { 50278 equalItems++; 50279 } 50280 } 50281 return aSize === bSize && equalItems === aSize ? a2 : copy2; 50282 } 50283 return b2; 50284 } 50285 function shallowEqualObjects(a2, b2) { 50286 if (a2 && !b2 || b2 && !a2) { 50287 return false; 50288 } 50289 for (const key in a2) { 50290 if (a2[key] !== b2[key]) { 50291 return false; 50292 } 50293 } 50294 return true; 50295 } 50296 function isPlainArray(value) { 50297 return Array.isArray(value) && value.length === Object.keys(value).length; 50298 } 50299 function isPlainObject(o2) { 50300 if (!hasObjectPrototype(o2)) { 50301 return false; 50302 } 50303 const ctor = o2.constructor; 50304 if (typeof ctor === "undefined") { 50305 return true; 50306 } 50307 const prot = ctor.prototype; 50308 if (!hasObjectPrototype(prot)) { 50309 return false;
50310 } 50311 if (!prot.hasOwnProperty("isPrototypeOf")) { 50312 return false; 50313 } 50314 return true; 50315 } 50316 function hasObjectPrototype(o2) { 50317 return Object.prototype.toString.call(o2) === "[object Object]"; 50318 } 50319 function isQueryKey(value) { 50320 return Array.isArray(value); 50321 } 50322 function sleep(timeout) { 50323 return new Promise((resolve) => { 50324 setTimeout(resolve, timeout); 50325 }); 50326 } 50327 function scheduleMicrotask(callback) { 50328 sleep(0).then(callback); 50329 } 50330 function getAbortController() { 50331 if (typeof AbortController === "function") { 50332 return new AbortController(); 50333 } 50334 return; 50335 } 50336 function replaceData(prevData, data, options2) { 50337 if (options2.isDataEqual != null && options2.isDataEqual(prevData, data)) { 50338 return prevData; 50339 } else if (typeof options2.structuralSharing === "function") { 50340 return options2.structuralSharing(prevData, data); 50341 } else if (options2.structuralSharing !== false) { 50342 return replaceEqualDeep(prevData, data); 50343 } 50344 return data; 50345 } 50346 class FocusManager extends Subscribable { 50347 constructor() { 50348 super(); 50349 this.setup = (onFocus) => { 50350 if (!isServer && window.addEventListener) { 50351 const listener = () => onFocus(); 50352 window.addEventListener("visibilitychange", listener, false); 50353 window.addEventListener("focus", listener, false); 50354 return () => { 50355 window.removeEventListener("visibilitychange", listener); 50356 window.removeEventListener("focus", listener); 50357 }; 50358 } 50359 return; 50360 }; 50361 } 50362 onSubscribe() { 50363 if (!this.cleanup) { 50364 this.setEventListener(this.setup); 50365 } 50366 } 50367 onUnsubscribe() { 50368 if (!this.hasListeners()) { 50369 var _this$cleanup; 50370 (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this); 50371 this.cleanup = void 0; 50372 } 50373 } 50374 setEventListener(setup) { 50375 var _this$cleanup2; 50376 this.setup = setup; 50377 (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this); 50378 this.cleanup = setup((focused) => { 50379 if (typeof focused === "boolean") { 50380 this.setFocused(focused); 50381 } else { 50382 this.onFocus(); 50383 } 50384 }); 50385 } 50386 setFocused(focused) { 50387 const changed = this.focused !== focused; 50388 if (changed) { 50389 this.focused = focused; 50390 this.onFocus(); 50391 } 50392 } 50393 onFocus() { 50394 this.listeners.forEach(({ 50395 listener 50396 }) => { 50397 listener(); 50398 }); 50399 } 50400 isFocused() { 50401 if (typeof this.focused === "boolean") { 50402 return this.focused; 50403 } 50404 if (typeof document === "undefined") { 50405 return true; 50406 } 50407 return [void 0, "visible", "prerender"].includes(document.visibilityState); 50408 } 50409 } 50410 const focusManager = new FocusManager(); 50411 const onlineEvents = ["online", "offline"]; 50412 class OnlineManager extends Subscribable { 50413 constructor() { 50414 super(); 50415 this.setup = (onOnline) => { 50416 if (!isServer && window.addEventListener) { 50417 const listener = () => onOnline(); 50418 onlineEvents.forEach((event) => { 50419 window.addEventListener(event, listener, false); 50420 }); 50421 return () => { 50422 onlineEvents.forEach((event) => { 50423 window.removeEventListener(event, listener); 50424 }); 50425 }; 50426 } 50427 return; 50428 }; 50429 } 50430 onSubscribe() { 50431 if (!this.cleanup) { 50432 this.setEventListener(this.setup); 50433 } 50434 } 50435 onUnsubscribe() { 50436 if (!this.hasListeners()) { 50437 var _this$cleanup; 50438 (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this); 50439 this.cleanup = void 0; 50440 } 50441 } 50442 setEventListener(setup) { 50443 var _this$cleanup2; 50444 this.setup = setup; 50445 (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this); 50446 this.cleanup = setup((online) => { 50447 if (typeof online === "boolean") { 50448 this.setOnline(online); 50449 } else { 50450 this.onOnline(); 50451 } 50452 }); 50453 } 50454 setOnline(online) { 50455 const changed = this.online !== online; 50456 if (changed) { 50457 this.online = online; 50458 this.onOnline(); 50459 } 50460 } 50461 onOnline() {
50462 this.listeners.forEach(({ 50463 listener 50464 }) => { 50465 listener(); 50466 }); 50467 } 50468 isOnline() { 50469 if (typeof this.online === "boolean") { 50470 return this.online; 50471 } 50472 if (typeof navigator === "undefined" || typeof navigator.onLine === "undefined") { 50473 return true; 50474 } 50475 return navigator.onLine; 50476 } 50477 } 50478 const onlineManager = new OnlineManager(); 50479 function defaultRetryDelay(failureCount) { 50480 return Math.min(1e3 * __pow(2, failureCount), 3e4); 50481 } 50482 function canFetch(networkMode) { 50483 return (networkMode != null ? networkMode : "online") === "online" ? onlineManager.isOnline() : true; 50484 } 50485 class CancelledError { 50486 constructor(options2) { 50487 this.revert = options2 == null ? void 0 : options2.revert; 50488 this.silent = options2 == null ? void 0 : options2.silent; 50489 } 50490 } 50491 function isCancelledError(value) { 50492 return value instanceof CancelledError; 50493 } 50494 function createRetryer(config) { 50495 let isRetryCancelled = false; 50496 let failureCount = 0; 50497 let isResolved = false; 50498 let continueFn; 50499 let promiseResolve;
50500 let promiseReject; 50501 const promise = new Promise((outerResolve, outerReject) => { 50502 promiseResolve = outerResolve; 50503 promiseReject = outerReject; 50504 }); 50505 const cancel = (cancelOptions) => { 50506 if (!isResolved) { 50507 reject(new CancelledError(cancelOptions)); 50508 config.abort == null ? void 0 : config.abort(); 50509 } 50510 }; 50511 const cancelRetry = () => { 50512 isRetryCancelled = true; 50513 }; 50514 const continueRetry = () => { 50515 isRetryCancelled = false; 50516 }; 50517 const shouldPause = () => !focusManager.isFocused() || config.networkMode !== "always" && !onlineManager.isOnline(); 50518 const resolve = (value) => { 50519 if (!isResolved) { 50520 isResolved = true; 50521 config.onSuccess == null ? void 0 : config.onSuccess(value); 50522 continueFn == null ? void 0 : continueFn(); 50523 promiseResolve(value); 50524 } 50525 }; 50526 const reject = (value) => { 50527 if (!isResolved) { 50528 isResolved = true; 50529 config.onError == null ? void 0 : config.onError(value); 50530 continueFn == null ? void 0 : continueFn(); 50531 promiseReject(value); 50532 } 50533 }; 50534 const pause = () => { 50535 return new Promise((continueResolve) => { 50536 continueFn = (value) => { 50537 const canContinue = isResolved || !shouldPause(); 50538 if (canContinue) { 50539 continueResolve(value); 50540 } 50541 return canContinue; 50542 }; 50543 config.onPause == null ? void 0 : config.onPause(); 50544 }).then(() => { 50545 continueFn = void 0; 50546 if (!isResolved) { 50547 config.onContinue == null ? void 0 : config.onContinue(); 50548 } 50549 }); 50550 }; 50551 const run = () => { 50552 if (isResolved) { 50553 return; 50554 } 50555 let promiseOrValue; 50556 try { 50557 promiseOrValue = config.fn(); 50558 } catch (error) { 50559 promiseOrValue = Promise.reject(error); 50560 } 50561 Promise.resolve(promiseOrValue).then(resolve).catch((error) => { 50562 var _config$retry, _config$retryDelay; 50563 if (isResolved) { 50564 return; 50565 } 50566 const retry = (_config$retry = config.retry) != null ? _config$retry : 3; 50567 const retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay; 50568 const delay2 = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; 50569 const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); 50570 if (isRetryCancelled || !shouldRetry) { 50571 reject(error); 50572 return; 50573 } 50574 failureCount++; 50575 config.onFail == null ? void 0 : config.onFail(failureCount, error); 50576 sleep(delay2).then(() => { 50577 if (shouldPause()) { 50578 return pause(); 50579 } 50580 return; 50581 }).then(() => { 50582 if (isRetryCancelled) { 50583 reject(error); 50584 } else { 50585 run(); 50586 } 50587 }); 50588 }); 50589 }; 50590 if (canFetch(config.networkMode)) { 50591 run(); 50592 } else { 50593 pause().then(run); 50594 } 50595 return { 50596 promise, 50597 cancel, 50598 continue: () => { 50599 const didContinue = continueFn == null ? void 0 : continueFn(); 50600 return didContinue ? promise : Promise.resolve(); 50601 }, 50602 cancelRetry, 50603 continueRetry 50604 }; 50605 } 50606 const defaultLogger = console; 50607 function createNotifyManager() { 50608 let queue = []; 50609 let transactions = 0; 50610 let notifyFn = (callback) => { 50611 callback(); 50612 }; 50613 let batchNotifyFn = (callback) => { 50614 callback(); 50615 }; 50616 const batch = (callback) => { 50617 let result; 50618 transactions++; 50619 try { 50620 result = callback(); 50621 } finally { 50622 transactions--; 50623 if (!transactions) { 50624 flush(); 50625 } 50626 } 50627 return result; 50628 }; 50629 const schedule = (callback) => { 50630 if (transactions) { 50631 queue.push(callback); 50632 } else { 50633 scheduleMicrotask(() => { 50634 notifyFn(callback); 50635 }); 50636 } 50637 }; 50638 const batchCalls = (callback) => { 50639 return (...args) => { 50640 schedule(() => { 50641 callback(...args); 50642 }); 50643 }; 50644 }; 50645 const flush = () => { 50646 const originalQueue = queue; 50647 queue = []; 50648 if (originalQueue.length) { 50649 scheduleMicrotask(() => { 50650 batchNotifyFn(() => { 50651 originalQueue.forEach((callback) => { 50652 notifyFn(callback); 50653 }); 50654 }); 50655 }); 50656 } 50657 }; 50658 const setNotifyFunction = (fn2) => { 50659 notifyFn = fn2; 50660 }; 50661 const setBatchNotifyFunction = (fn2) => { 50662 batchNotifyFn = fn2; 50663 }; 50664 return { 50665 batch, 50666 batchCalls, 50667 schedule, 50668 setNotifyFunction, 50669 setBatchNotifyFunction 50670 }; 50671 } 50672 const notifyManager = createNotifyManager(); 50673 class Removable { 50674 destroy() { 50675 this.clearGcTimeout(); 50676 } 50677 scheduleGc() { 50678 this.clearGcTimeout(); 50679 if (isValidTimeout(this.cacheTime)) { 50680 this.gcTimeout = setTimeout(() => { 50681 this.optionalRemove(); 50682 }, this.cacheTime); 50683 } 50684 } 50685 updateCacheTime(newCacheTime) { 50686 this.cacheTime = Math.max(this.cacheTime || 0, newCacheTime != null ? newCacheTime : isServer ? Infinity : 5 * 60 * 1e3); 50687 } 50688 clearGcTimeout() { 50689 if (this.gcTimeout) { 50690 clearTimeout(this.gcTimeout); 50691 this.gcTimeout = void 0; 50692 } 50693 } 50694 } 50695 class Query extends Removable { 50696 constructor(config) { 50697 super();
50698 this.abortSignalConsumed = false; 50699 this.defaultOptions = config.defaultOptions; 50700 this.setOptions(config.options); 50701 this.observers = []; 50702 this.cache = config.cache; 50703 this.logger = config.logger || defaultLogger; 50704 this.queryKey = config.queryKey; 50705 this.queryHash = config.queryHash; 50706 this.initialState = config.state || getDefaultState$1(this.options); 50707 this.state = this.initialState; 50708 this.scheduleGc(); 50709 } 50710 get meta() { 50711 return this.options.meta; 50712 } 50713 setOptions(options2) { 50714 this.options = __spreadValues(__spreadValues({}, this.defaultOptions), options2); 50715 this.updateCacheTime(this.options.cacheTime); 50716 } 50717 optionalRemove() { 50718 if (!this.observers.length && this.state.fetchStatus === "idle") { 50719 this.cache.remove(this); 50720 } 50721 } 50722 setData(newData, options2) { 50723 const data = replaceData(this.state.data, newData, this.options); 50724 this.dispatch({ 50725 data, 50726 type: "success", 50727 dataUpdatedAt: options2 == null ? void 0 : options2.updatedAt, 50728 manual: options2 == null ? void 0 : options2.manual 50729 }); 50730 return data; 50731 } 50732 setState(state, setStateOptions) { 50733 this.dispatch({ 50734 type: "setState", 50735 state, 50736 setStateOptions 50737 }); 50738 } 50739 cancel(options2) { 50740 var _this$retryer; 50741 const promise = this.promise; 50742 (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options2); 50743 return promise ? promise.then(noop$1).catch(noop$1) : Promise.resolve(); 50744 } 50745 destroy() { 50746 super.destroy(); 50747 this.cancel({ 50748 silent: true 50749 }); 50750 } 50751 reset() { 50752 this.destroy(); 50753 this.setState(this.initialState); 50754 } 50755 isActive() { 50756 return this.observers.some((observer) => observer.options.enabled !== false); 50757 } 50758 isDisabled() { 50759 return this.getObserversCount() > 0 && !this.isActive(); 50760 } 50761 isStale() { 50762 return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some((observer) => observer.getCurrentResult().isStale); 50763 } 50764 isStaleByTime(staleTime = 0) { 50765 return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime); 50766 } 50767 onFocus() { 50768 var _this$retryer2; 50769 const observer = this.observers.find((x2) => x2.shouldFetchOnWindowFocus()); 50770 if (observer) { 50771 observer.refetch({ 50772 cancelRefetch: false 50773 }); 50774 } 50775 (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue(); 50776 } 50777 onOnline() { 50778 var _this$retryer3; 50779 const observer = this.observers.find((x2) => x2.shouldFetchOnReconnect()); 50780 if (observer) { 50781 observer.refetch({ 50782 cancelRefetch: false 50783 }); 50784 } 50785 (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue(); 50786 } 50787 addObserver(observer) { 50788 if (!this.observers.includes(observer)) { 50789 this.observers.push(observer); 50790 this.clearGcTimeout(); 50791 this.cache.notify({ 50792 type: "observerAdded", 50793 query: this, 50794 observer 50795 }); 50796 } 50797 } 50798 removeObserver(observer) { 50799 if (this.observers.includes(observer)) { 50800 this.observers = this.observers.filter((x2) => x2 !== observer); 50801 if (!this.observers.length) { 50802 if (this.retryer) { 50803 if (this.abortSignalConsumed) { 50804 this.retryer.cancel({ 50805 revert: true 50806 }); 50807 } else { 50808 this.retryer.cancelRetry(); 50809 } 50810 } 50811 this.scheduleGc(); 50812 } 50813 this.cache.notify({ 50814 type: "observerRemoved", 50815 query: this, 50816 observer 50817 }); 50818 } 50819 } 50820 getObserversCount() { 50821 return this.observers.length; 50822 } 50823 invalidate() { 50824 if (!this.state.isInvalidated) { 50825 this.dispatch({
50826 type: "invalidate" 50827 }); 50828 } 50829 } 50830 fetch(options2, fetchOptions) { 50831 var _this$options$behavio, _context$fetchOptions; 50832 if (this.state.fetchStatus !== "idle") { 50833 if (this.state.dataUpdatedAt && fetchOptions != null && fetchOptions.cancelRefetch) { 50834 this.cancel({ 50835 silent: true 50836 }); 50837 } else if (this.promise) { 50838 var _this$retryer4; 50839 (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); 50840 return this.promise; 50841 } 50842 } 50843 if (options2) { 50844 this.setOptions(options2); 50845 } 50846 if (!this.options.queryFn) { 50847 const observer = this.observers.find((x2) => x2.options.queryFn); 50848 if (observer) { 50849 this.setOptions(observer.options); 50850 } 50851 } 50852 const abortController = getAbortController(); 50853 const queryFnContext = { 50854 queryKey: this.queryKey, 50855 pageParam: void 0, 50856 meta: this.meta 50857 }; 50858 const addSignalProperty = (object2) => { 50859 Object.defineProperty(object2, "signal", { 50860 enumerable: true, 50861 get: () => { 50862 if (abortController) { 50863 this.abortSignalConsumed = true; 50864 return abortController.signal; 50865 } 50866 return void 0; 50867 } 50868 }); 50869 }; 50870 addSignalProperty(queryFnContext); 50871 const fetchFn = () => { 50872 if (!this.options.queryFn) { 50873 return Promise.reject("Missing queryFn for queryKey '" + this.options.queryHash + "'"); 50874 } 50875 this.abortSignalConsumed = false; 50876 return this.options.queryFn(queryFnContext); 50877 }; 50878 const context = { 50879 fetchOptions, 50880 options: this.options, 50881 queryKey: this.queryKey, 50882 state: this.state, 50883 fetchFn 50884 }; 50885 addSignalProperty(context); 50886 (_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch(context); 50887 this.revertState = this.state; 50888 if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) { 50889 var _context$fetchOptions2; 50890 this.dispatch({ 50891 type: "fetch", 50892 meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta 50893 }); 50894 } 50895 const onError = (error) => { 50896 if (!(isCancelledError(error) && error.silent)) { 50897 this.dispatch({ 50898 type: "error", 50899 error 50900 }); 50901 } 50902 if (!isCancelledError(error)) { 50903 var _this$cache$config$on, _this$cache$config, _this$cache$config$on2, _this$cache$config2; 50904 (_this$cache$config$on = (_this$cache$config = this.cache.config).onError) == null ? void 0 : _this$cache$config$on.call(_this$cache$config, error, this); 50905 (_this$cache$config$on2 = (_this$cache$config2 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on2.call(_this$cache$config2, this.state.data, error, this); 50906 } 50907 if (!this.isFetchingOptimistic) { 50908 this.scheduleGc(); 50909 } 50910 this.isFetchingOptimistic = false; 50911 }; 50912 this.retryer = createRetryer({ 50913 fn: context.fetchFn, 50914 abort: abortController == null ? void 0 : abortController.abort.bind(abortController), 50915 onSuccess: (data) => { 50916 var _this$cache$config$on3, _this$cache$config3, _this$cache$config$on4, _this$cache$config4; 50917 if (typeof data === "undefined") { 50918 onError(new Error(this.queryHash + " data is undefined")); 50919 return; 50920 } 50921 this.setData(data); 50922 (_this$cache$config$on3 = (_this$cache$config3 = this.cache.config).onSuccess) == null ? void 0 : _this$cache$config$on3.call(_this$cache$config3, data, this); 50923 (_this$cache$config$on4 = (_this$cache$config4 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on4.call(_this$cache$config4, data, this.state.error, this); 50924 if (!this.isFetchingOptimistic) { 50925 this.scheduleGc(); 50926 } 50927 this.isFetchingOptimistic = false;
50928 }, 50929 onError, 50930 onFail: (failureCount, error) => { 50931 this.dispatch({ 50932 type: "failed", 50933 failureCount, 50934 error 50935 }); 50936 }, 50937 onPause: () => { 50938 this.dispatch({ 50939 type: "pause" 50940 }); 50941 }, 50942 onContinue: () => { 50943 this.dispatch({ 50944 type: "continue" 50945 }); 50946 }, 50947 retry: context.options.retry, 50948 retryDelay: context.options.retryDelay, 50949 networkMode: context.options.networkMode 50950 }); 50951 this.promise = this.retryer.promise; 50952 return this.promise; 50953 } 50954 dispatch(action) { 50955 const reducer2 = (state) => { 50956 var _action$meta, _action$dataUpdatedAt; 50957 switch (action.type) { 50958 case "failed": 50959 return __spreadProps(__spreadValues({}, state), { 50960 fetchFailureCount: action.failureCount, 50961 fetchFailureReason: action.error 50962 }); 50963 case "pause": 50964 return __spreadProps(__spreadValues({}, state), { 50965 fetchStatus: "paused" 50966 }); 50967 case "continue": 50968 return __spreadProps(__spreadValues({}, state), { 50969 fetchStatus: "fetching" 50970 }); 50971 case "fetch": 50972 return __spreadValues(__spreadProps(__spreadValues({}, state), { 50973 fetchFailureCount: 0, 50974 fetchFailureReason: null, 50975 fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null, 50976 fetchStatus: canFetch(this.options.networkMode) ? "fetching" : "paused" 50977 }), !state.dataUpdatedAt && { 50978 error: null, 50979 status: "loading" 50980 }); 50981 case "success": 50982 return __spreadValues(__spreadProps(__spreadValues({}, state), { 50983 data: action.data, 50984 dataUpdateCount: state.dataUpdateCount + 1, 50985 dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(), 50986 error: null, 50987 isInvalidated: false, 50988 status: "success" 50989 }), !action.manual && { 50990 fetchStatus: "idle", 50991 fetchFailureCount: 0, 50992 fetchFailureReason: null 50993 }); 50994 case "error": 50995 const error = action.error; 50996 if (isCancelledError(error) && error.revert && this.revertState) { 50997 return __spreadProps(__spreadValues({}, this.revertState), { 50998 fetchStatus: "idle" 50999 }); 51000 } 51001 return __spreadProps(__spreadValues({}, state), { 51002 error, 51003 errorUpdateCount: state.errorUpdateCount + 1, 51004 errorUpdatedAt: Date.now(), 51005 fetchFailureCount: state.fetchFailureCount + 1, 51006 fetchFailureReason: error, 51007 fetchStatus: "idle", 51008 status: "error" 51009 }); 51010 case "invalidate": 51011 return __spreadProps(__spreadValues({}, state), { 51012 isInvalidated: true 51013 }); 51014 case "setState": 51015 return __spreadValues(__spreadValues({}, state), action.state); 51016 } 51017 }; 51018 this.state = reducer2(this.state); 51019 notifyManager.batch(() => { 51020 this.observers.forEach((observer) => { 51021 observer.onQueryUpdate(action); 51022 }); 51023 this.cache.notify({ 51024 query: this, 51025 type: "updated", 51026 action 51027 }); 51028 }); 51029 } 51030 } 51031 function getDefaultState$1(options2) { 51032 const data = typeof options2.initialData === "function" ? options2.initialData() : options2.initialData; 51033 const hasData = typeof data !== "undefined"; 51034 const initialDataUpdatedAt = hasData ? typeof options2.initialDataUpdatedAt === "function" ? options2.initialDataUpdatedAt() : options2.initialDataUpdatedAt : 0; 51035 return { 51036 data, 51037 dataUpdateCount: 0, 51038 dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0, 51039 error: null,
51040 errorUpdateCount: 0, 51041 errorUpdatedAt: 0, 51042 fetchFailureCount: 0, 51043 fetchFailureReason: null, 51044 fetchMeta: null, 51045 isInvalidated: false, 51046 status: hasData ? "success" : "loading", 51047 fetchStatus: "idle" 51048 }; 51049 } 51050 class QueryCache extends Subscribable { 51051 constructor(config) { 51052 super(); 51053 this.config = config || {}; 51054 this.queries = []; 51055 this.queriesMap = {}; 51056 } 51057 build(client2, options2, state) { 51058 var _options$queryHash; 51059 const queryKey = options2.queryKey; 51060 const queryHash = (_options$queryHash = options2.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options2); 51061 let query = this.get(queryHash); 51062 if (!query) { 51063 query = new Query({ 51064 cache: this, 51065 logger: client2.getLogger(), 51066 queryKey, 51067 queryHash, 51068 options: client2.defaultQueryOptions(options2), 51069 state, 51070 defaultOptions: client2.getQueryDefaults(queryKey) 51071 }); 51072 this.add(query); 51073 } 51074 return query; 51075 } 51076 add(query) { 51077 if (!this.queriesMap[query.queryHash]) { 51078 this.queriesMap[query.queryHash] = query; 51079 this.queries.push(query); 51080 this.notify({ 51081 type: "added", 51082 query 51083 }); 51084 } 51085 } 51086 remove(query) { 51087 const queryInMap = this.queriesMap[query.queryHash]; 51088 if (queryInMap) { 51089 query.destroy(); 51090 this.queries = this.queries.filter((x2) => x2 !== query); 51091 if (queryInMap === query) { 51092 delete this.queriesMap[query.queryHash]; 51093 } 51094 this.notify({ 51095 type: "removed", 51096 query 51097 }); 51098 } 51099 } 51100 clear() { 51101 notifyManager.batch(() => { 51102 this.queries.forEach((query) => { 51103 this.remove(query); 51104 }); 51105 }); 51106 } 51107 get(queryHash) { 51108 return this.queriesMap[queryHash]; 51109 } 51110 getAll() { 51111 return this.queries; 51112 } 51113 find(arg1, arg2) { 51114 const [filters] = parseFilterArgs(arg1, arg2); 51115 if (typeof filters.exact === "undefined") { 51116 filters.exact = true; 51117 } 51118 return this.queries.find((query) => matchQuery(filters, query)); 51119 } 51120 findAll(arg1, arg2) { 51121 const [filters] = parseFilterArgs(arg1, arg2); 51122 return Object.keys(filters).length > 0 ? this.queries.filter((query) => matchQuery(filters, query)) : this.queries; 51123 } 51124 notify(event) { 51125 notifyManager.batch(() => { 51126 this.listeners.forEach(({ 51127 listener 51128 }) => { 51129 listener(event); 51130 }); 51131 }); 51132 } 51133 onFocus() { 51134 notifyManager.batch(() => { 51135 this.queries.forEach((query) => { 51136 query.onFocus(); 51137 }); 51138 }); 51139 } 51140 onOnline() { 51141 notifyManager.batch(() => { 51142 this.queries.forEach((query) => { 51143 query.onOnline(); 51144 }); 51145 }); 51146 } 51147 } 51148 class Mutation extends Removable { 51149 constructor(config) { 51150 super(); 51151 this.defaultOptions = config.defaultOptions; 51152 this.mutationId = config.mutationId; 51153 this.mutationCache = config.mutationCache; 51154 this.logger = config.logger || defaultLogger; 51155 this.observers = []; 51156 this.state = config.state || getDefaultState(); 51157 this.setOptions(config.options); 51158 this.scheduleGc(); 51159 } 51160 setOptions(options2) { 51161 this.options = __spreadValues(__spreadValues({}, this.defaultOptions), options2); 51162 this.updateCacheTime(this.options.cacheTime); 51163 } 51164 get meta() { 51165 return this.options.meta; 51166 } 51167 setState(state) { 51168 this.dispatch({ 51169 type: "setState", 51170 state 51171 }); 51172 } 51173 addObserver(observer) { 51174 if (!this.observers.includes(observer)) { 51175 this.observers.push(observer); 51176 this.clearGcTimeout(); 51177 this.mutationCache.notify({ 51178 type: "observerAdded", 51179 mutation: this, 51180 observer 51181 }); 51182 } 51183 } 51184 removeObserver(observer) { 51185 this.observers = this.observers.filter((x2) => x2 !== observer); 51186 this.scheduleGc(); 51187 this.mutationCache.notify({ 51188 type: "observerRemoved", 51189 mutation: this, 51190 observer 51191 }); 51192 } 51193 optionalRemove() { 51194 if (!this.observers.length) { 51195 if (this.state.status === "loading") { 51196 this.scheduleGc(); 51197 } else { 51198 this.mutationCache.remove(this); 51199 } 51200 } 51201 } 51202 continue() { 51203 var _this$retryer$continu, _this$retryer; 51204 return (_this$retryer$continu = (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.continue()) != null ? _this$retryer$continu : this.execute(); 51205 } 51206 execute() { 51207 return __async(this, null, function* () { 51208 const executeMutation = () => { 51209 var _this$options$retry; 51210 this.retryer = createRetryer({ 51211 fn: () => { 51212 if (!this.options.mutationFn) { 51213 return Promise.reject("No mutationFn found"); 51214 } 51215 return this.options.mutationFn(this.state.variables); 51216 }, 51217 onFail: (failureCount, error) => { 51218 this.dispatch({ 51219 type: "failed", 51220 failureCount, 51221 error 51222 }); 51223 }, 51224 onPause: () => { 51225 this.dispatch({ 51226 type: "pause" 51227 }); 51228 }, 51229 onContinue: () => { 51230 this.dispatch({ 51231 type: "continue" 51232 }); 51233 }, 51234 retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0, 51235 retryDelay: this.options.retryDelay, 51236 networkMode: this.options.networkMode 51237 }); 51238 return this.retryer.promise; 51239 }; 51240 const restored = this.state.status === "loading"; 51241 try { 51242 var _this$mutationCache$c3, _this$mutationCache$c4, _this$options$onSucce, _this$options2, _this$mutationCache$c5, _this$mutationCache$c6, _this$options$onSettl, _this$options3; 51243 if (!restored) { 51244 var _this$mutationCache$c, _this$mutationCache$c2, _this$options$onMutat, _this$options; 51245 this.dispatch({ 51246 type: "loading", 51247 variables: this.options.variables 51248 }); 51249 yield (_this$mutationCache$c = (_this$mutationCache$c2 = this.mutationCache.config).onMutate) == null ? void 0 : _this$mutationCache$c.call(_this$mutationCache$c2, this.state.variables, this); 51250 const context = yield (_this$options$onMutat = (_this$options = this.options).onMutate) == null ? void 0 : _this$options$onMutat.call(_this$options, this.state.variables); 51251 if (context !== this.state.context) { 51252 this.dispatch({ 51253 type: "loading", 51254 context, 51255 variables: this.state.variables 51256 }); 51257 } 51258 } 51259 const data = yield executeMutation(); 51260 yield (_this$mutationCache$c3 = (_this$mutationCache$c4 = this.mutationCache.config).onSuccess) == null ? void 0 : _this$mutationCache$c3.call(_this$mutationCache$c4, data, this.state.variables, this.state.context, this); 51261 yield (_this$options$onSucce = (_this$options2 = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options2, data, this.state.variables, this.state.context); 51262 yield (_this$mutationCache$c5 = (_this$mutationCache$c6 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c5.call(_this$mutationCache$c6, data, null, this.state.variables, this.state.context, this); 51263 yield (_this$options$onSettl = (_this$options3 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options3, data, null, this.state.variables, this.state.context); 51264 this.dispatch({ 51265 type: "success", 51266 data 51267 }); 51268 return data; 51269 } catch (error) { 51270 try { 51271 var _this$mutationCache$c7, _this$mutationCache$c8, _this$options$onError, _this$options4, _this$mutationCache$c9, _this$mutationCache$c10, _this$options$onSettl2, _this$options5; 51272 yield (_this$mutationCache$c7 = (_this$mutationCache$c8 = this.mutationCache.config).onError) == null ? void 0 : _this$mutationCache$c7.call(_this$mutationCache$c8, error, this.state.variables, this.state.context, this); 51273 if (false) ; 51274 yield (_this$options$onError = (_this$options4 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options4, error, this.state.variables, this.state.context); 51275 yield (_this$mutationCache$c9 = (_this$mutationCache$c10 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c9.call(_this$mutationCache$c10, void 0, error, this.state.variables, this.state.context, this); 51276 yield (_this$options$onSettl2 = (_this$options5 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options5, void 0, error, this.state.variables, this.state.context); 51277 throw error; 51278 } finally { 51279 this.dispatch({ 51280 type: "error", 51281 error 51282 }); 51283 } 51284 } 51285 }); 51286 } 51287 dispatch(action) { 51288 const reducer2 = (state) => { 51289 switch (action.type) { 51290 case "failed": 51291 return __spreadProps(__spreadValues({}, state), { 51292 failureCount: action.failureCount, 51293 failureReason: action.error 51294 }); 51295 case "pause": 51296 return __spreadProps(__spreadValues({}, state), { 51297 isPaused: true 51298 }); 51299 case "continue": 51300 return __spreadProps(__spreadValues({}, state), { 51301 isPaused: false 51302 }); 51303 case "loading": 51304 return __spreadProps(__spreadValues({}, state), { 51305 context: action.context, 51306 data: void 0, 51307 failureCount: 0, 51308 failureReason: null, 51309 error: null, 51310 isPaused: !canFetch(this.options.networkMode), 51311 status: "loading", 51312 variables: action.variables 51313 }); 51314 case "success": 51315 return __spreadProps(__spreadValues({}, state), { 51316 data: action.data, 51317 failureCount: 0, 51318 failureReason: null, 51319 error: null, 51320 status: "success", 51321 isPaused: false 51322 }); 51323 case "error": 51324 return __spreadProps(__spreadValues({}, state), { 51325 data: void 0, 51326 error: action.error, 51327 failureCount: state.failureCount + 1, 51328 failureReason: action.error, 51329 isPaused: false, 51330 status: "error" 51331 }); 51332 case "setState": 51333 return __spreadValues(__spreadValues({}, state), action.state); 51334 } 51335 }; 51336 this.state = reducer2(this.state); 51337 notifyManager.batch(() => {
51338 this.observers.forEach((observer) => { 51339 observer.onMutationUpdate(action); 51340 }); 51341 this.mutationCache.notify({ 51342 mutation: this, 51343 type: "updated", 51344 action 51345 }); 51346 }); 51347 } 51348 } 51349 function getDefaultState() { 51350 return { 51351 context: void 0, 51352 data: void 0, 51353 error: null, 51354 failureCount: 0, 51355 failureReason: null, 51356 isPaused: false, 51357 status: "idle", 51358 variables: void 0 51359 }; 51360 } 51361 class MutationCache extends Subscribable { 51362 constructor(config) { 51363 super(); 51364 this.config = config || {}; 51365 this.mutations = []; 51366 this.mutationId = 0; 51367 } 51368 build(client2, options2, state) { 51369 const mutation = new Mutation({ 51370 mutationCache: this, 51371 logger: client2.getLogger(), 51372 mutationId: ++this.mutationId, 51373 options: client2.defaultMutationOptions(options2), 51374 state, 51375 defaultOptions: options2.mutationKey ? client2.getMutationDefaults(options2.mutationKey) : void 0 51376 }); 51377 this.add(mutation); 51378 return mutation; 51379 } 51380 add(mutation) { 51381 this.mutations.push(mutation); 51382 this.notify({ 51383 type: "added", 51384 mutation 51385 }); 51386 } 51387 remove(mutation) { 51388 this.mutations = this.mutations.filter((x2) => x2 !== mutation); 51389 this.notify({ 51390 type: "removed", 51391 mutation 51392 }); 51393 } 51394 clear() { 51395 notifyManager.batch(() => { 51396 this.mutations.forEach((mutation) => { 51397 this.remove(mutation); 51398 }); 51399 }); 51400 } 51401 getAll() { 51402 return this.mutations; 51403 } 51404 find(filters) { 51405 if (typeof filters.exact === "undefined") { 51406 filters.exact = true; 51407 } 51408 return this.mutations.find((mutation) => matchMutation(filters, mutation)); 51409 } 51410 findAll(filters) { 51411 return this.mutations.filter((mutation) => matchMutation(filters, mutation)); 51412 } 51413 notify(event) { 51414 notifyManager.batch(() => { 51415 this.listeners.forEach(({ 51416 listener 51417 }) => { 51418 listener(event); 51419 }); 51420 }); 51421 } 51422 resumePausedMutations() { 51423 var _this$resuming; 51424 this.resuming = ((_this$resuming = this.resuming) != null ? _this$resuming : Promise.resolve()).then(() => { 51425 const pausedMutations = this.mutations.filter((x2) =>
51425 x2.state.isPaused); 51426 return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop$1)), Promise.resolve())); 51427 }).then(() => { 51428 this.resuming = void 0; 51429 }); 51430 return this.resuming; 51431 } 51432 } 51433 function infiniteQueryBehavior() { 51434 return { 51435 onFetch: (context) => { 51436 context.fetchFn = () => { 51437 var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2; 51438 const refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage; 51439 const fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore; 51440 const pageParam = fetchMore == null ? void 0 : fetchMore.pageParam; 51441 const isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === "forward"; 51442 const isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === "backward"; 51443 const oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || []; 51444 const oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || []; 51445 let newPageParams = oldPageParams; 51446 let cancelled = false; 51447 const addSignalProperty = (object2) => { 51448 Object.defineProperty(object2, "signal", { 51449 enumerable: true, 51450 get: () => { 51451 var _context$signal; 51452 if ((_context$signal = context.signal) != null && _context$signal.aborted) { 51453 cancelled = true; 51454 } else { 51455 var _context$signal2; 51456 (_context$signal2 = context.signal) == null ? void 0 : _context$signal2.addEventListener("abort", () => { 51457 cancelled = true; 51458 }); 51459 } 51460 return context.signal; 51461 } 51462 }); 51463 }; 51464 const queryFn = context.options.queryFn || (() => Promise.reject("Missing queryFn for queryKey '" + context.options.queryHash + "'")); 51465 const buildNewPages = (pages, param, page, previous) => { 51466 newPageParams = previous ? [param, ...newPageParams] : [...newPageParams, param]; 51467 return previous ? [page, ...pages] : [...pages, page]; 51468 }; 51469 const fetchPage = (pages, manual, param, previous) => { 51470 if (cancelled) { 51471 return Promise.reject("Cancelled"); 51472 } 51473 if (typeof param === "undefined" && !manual && pages.length) { 51474 return Promise.resolve(pages); 51475 } 51476 const queryFnContext = { 51477 queryKey: context.queryKey, 51478 pageParam: param, 51479 meta: context.options.meta 51480 }; 51481 addSignalProperty(queryFnContext); 51482 const queryFnResult = queryFn(queryFnContext); 51483 const promise2 = Promise.resolve(queryFnResult).then((page) => buildNewPages(pages, param, page, previous)); 51484 return promise2; 51485 }; 51486 let promise; 51487 if (!oldPages.length) { 51488 promise = fetchPage([]); 51489 } else if (isFetchingNextPage) { 51490 const manual = typeof pageParam !== "undefined"; 51491 const param = manual ? pageParam : getNextPageParam(context.options, oldPages); 51492 promise = fetchPage(oldPages, manual, param); 51493 } else if (isFetchingPreviousPage) { 51494 const manual = typeof pageParam !== "undefined"; 51495 const param = manual ? pageParam : getPreviousPageParam(context.options, oldPages); 51496 promise = fetchPage(oldPages, manual, param, true); 51497 } else { 51498 newPageParams = []; 51499 const manual = typeof context.options.getNextPageParam === "undefined"; 51500 const shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; 51501 promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); 51502 for (let i2 = 1; i2 < oldPages.length; i2++) { 51503 promise = promise.then((pages) => { 51504 const shouldFetchNextPage = refetchPage && oldPages[i2] ? refetchPage(oldPages[i2], i2, oldPages) : true; 51505 if (shouldFetchNextPage) { 51506 const param = manual ? oldPageParams[i2] : getNextPageParam(context.options, pages); 51507 return fetchPage(pages, manual, param); 51508 } 51509 return Promise.resolve(buildNewPages(pages, oldPageParams[i2], oldPages[i2])); 51510 }); 51511 } 51512 } 51513 const finalPromise = promise.then((pages) => ({ 51514 pages, 51515 pageParams: newPageParams 51516 })); 51517 return finalPromise; 51518 }; 51519 } 51520 }; 51521 } 51522 function getNextPageParam(options2, pages) { 51523 return options2.getNextPageParam == null ? void 0 : options2.getNextPageParam(pages[pages.length - 1], pages); 51524 } 51525 function getPreviousPageParam(options2, pages) { 51526 return options2.getPreviousPageParam == null ? void 0 : options2.getPreviousPageParam(pages[0], pages); 51527 } 51528 class QueryClient { 51529 constructor(config = {}) { 51530 this.queryCache = config.queryCache || new QueryCache(); 51531 this.mutationCache = config.mutationCache || new MutationCache(); 51532 this.logger = config.logger || defaultLogger; 51533 this.defaultOptions = config.defaultOptions || {}; 51534 this.queryDefaults = []; 51535 this.mutationDefaults = []; 51536 this.mountCount = 0; 51537 } 51538 mount() { 51539 this.mountCount++; 51540 if (this.mountCount !== 1) return;
51541 this.unsubscribeFocus = focusManager.subscribe(() => { 51542 if (focusManager.isFocused()) { 51543 this.resumePausedMutations(); 51544 this.queryCache.onFocus(); 51545 } 51546 }); 51547 this.unsubscribeOnline = onlineManager.subscribe(() => { 51548 if (onlineManager.isOnline()) { 51549 this.resumePausedMutations(); 51550 this.queryCache.onOnline(); 51551 } 51552 }); 51553 } 51554 unmount() { 51555 var _this$unsubscribeFocu, _this$unsubscribeOnli; 51556 this.mountCount--; 51557 if (this.mountCount !== 0) return; 51558 (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this); 51559 this.unsubscribeFocus = void 0; 51560 (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this); 51561 this.unsubscribeOnline = void 0; 51562 } 51563 isFetching(arg1, arg2) { 51564 const [filters] = parseFilterArgs(arg1, arg2); 51565 filters.fetchStatus = "fetching"; 51566 return this.queryCache.findAll(filters).length; 51567 } 51568 isMutating(filters) { 51569 return this.mutationCache.findAll(__spreadProps(__spreadValues({}, filters), { 51570 fetching: true 51571 })).length; 51572 } 51573 getQueryData(queryKey, filters) { 51574 var _this$queryCache$find; 51575 return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data; 51576 } 51577 ensureQueryData(arg1, arg2, arg3) { 51578 const parsedOptions = parseQueryArgs(arg1, arg2, arg3); 51579 const cachedData = this.getQueryData(parsedOptions.queryKey); 51580 return cachedData ? Promise.resolve(cachedData) : this.fetchQuery(parsedOptions); 51581 } 51582 getQueriesData(queryKeyOrFilters) { 51583 return this.getQueryCache().findAll(queryKeyOrFilters).map(({ 51584 queryKey, 51585 state 51586 }) => { 51587 const data = state.data; 51588 return [queryKey, data]; 51589 }); 51590 } 51591 setQueryData(queryKey, updater, options2) { 51592 const query = this.queryCache.find(queryKey); 51593 const prevData = query == null ? void 0 : query.state.data; 51594 const data = functionalUpdate(updater, prevData); 51595 if (typeof data === "undefined") { 51596 return void 0; 51597 } 51598 const parsedOptions = parseQueryArgs(queryKey); 51599 const defaultedOptions = this.defaultQueryOptions(parsedOptions); 51600 return this.queryCache.build(this, defaultedOptions).setData(data, __spreadProps(__spreadValues({}, options2), { 51601 manual: true 51602 })); 51603 } 51604 setQueriesData(queryKeyOrFilters, updater, options2) { 51605 return notifyManager.batch(() => this.getQueryCache().findAll(queryKeyOrFilters).map(({ 51606 queryKey 51607 }) => [queryKey, this.setQueryData(queryKey, updater, options2)])); 51608 } 51609 getQueryState(queryKey, filters) { 51610 var _this$queryCache$find2; 51611 return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state; 51612 } 51613 removeQueries(arg1, arg2) { 51614 const [filters] = parseFilterArgs(arg1, arg2); 51615 const queryCache = this.queryCache; 51616 notifyManager.batch(() => { 51617 queryCache.findAll(filters).forEach((query) => { 51618 queryCache.remove(query); 51619 }); 51620 }); 51621 } 51622 resetQueries(arg1, arg2, arg3) { 51623 const [filters, options2] = parseFilterArgs(arg1, arg2, arg3); 51624 const queryCache = this.queryCache; 51625 const refetchFilters = __spreadValues({ 51626 type: "active" 51627 }, filters); 51628 return notifyManager.batch(() => { 51629 queryCache.findAll(filters).forEach((query) => { 51630 query.reset(); 51631 }); 51632 return this.refetchQueries(refetchFilters, options2); 51633 }); 51634 } 51635 cancelQueries(arg1, arg2, arg3) { 51636 const [filters, cancelOptions = {}] = parseFilterArgs(arg1, arg2, arg3); 51637 if (typeof cancelOptions.revert === "undefined") { 51638 cancelOptions.revert = true; 51639 } 51640 const promises = notifyManager.batch(() => this.queryCache.findAll(filters).map((query) => query.cancel(cancelOptions))); 51641 return Promise.all(promises).then(noop$1).catch(noop$1); 51642 } 51643 invalidateQueries(arg1, arg2, arg3) { 51644 const [filters, options2] = parseFilterArgs(arg1, arg2, arg3); 51645 return notifyManager.batch(() => { 51646 var _ref2, _filters$refetchType;
51647 this.queryCache.findAll(filters).forEach((query) => { 51648 query.invalidate(); 51649 }); 51650 if (filters.refetchType === "none") { 51651 return Promise.resolve(); 51652 } 51653 const refetchFilters = __spreadProps(__spreadValues({}, filters), { 51654 type: (_ref2 = (_filters$refetchType = filters.refetchType) != null ? _filters$refetchType : filters.type) != null ? _ref2 : "active" 51655 }); 51656 return this.refetchQueries(refetchFilters, options2); 51657 }); 51658 } 51659 refetchQueries(arg1, arg2, arg3) { 51660 const [filters, options2] = parseFilterArgs(arg1, arg2, arg3); 51661 const promises = notifyManager.batch(() => this.queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => { 51662 var _options$cancelRefetc; 51663 return query.fetch(void 0, __spreadProps(__spreadValues({}, options2), { 51664 cancelRefetch: (_options$cancelRefetc = options2 == null ? void 0 : options2.cancelRefetch) != null ? _options$cancelRefetc : true, 51665 meta: { 51666 refetchPage: filters.refetchPage 51667 } 51668 })); 51669 })); 51670 let promise = Promise.all(promises).then(noop$1); 51671 if (!(options2 != null && options2.throwOnError)) { 51672 promise = promise.catch(noop$1); 51673 } 51674 return promise; 51675 } 51676 fetchQuery(arg1, arg2, arg3) { 51677 const parsedOptions = parseQueryArgs(arg1, arg2, arg3); 51678 const defaultedOptions = this.defaultQueryOptions(parsedOptions); 51679 if (typeof defaultedOptions.retry === "undefined") { 51680 defaultedOptions.retry = false; 51681 } 51682 const query = this.queryCache.build(this, defaultedOptions); 51683 return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); 51684 } 51685 prefetchQuery(arg1, arg2, arg3) { 51686 return this.fetchQuery(arg1, arg2, arg3).then(noop$1).catch(noop$1); 51687 } 51688 fetchInfiniteQuery(arg1, arg2, arg3) { 51689 const parsedOptions = parseQueryArgs(arg1, arg2, arg3); 51690 parsedOptions.behavior = infiniteQueryBehavior(); 51691 return this.fetchQuery(parsedOptions); 51692 } 51693 prefetchInfiniteQuery(arg1, arg2, arg3) { 51694 return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop$1).catch(noop$1); 51695 } 51696 resumePausedMutations() { 51697 return this.mutationCache.resumePausedMutations(); 51698 } 51699 getQueryCache() { 51700 return this.queryCache; 51701 } 51702 getMutationCache() { 51703 return this.mutationCache; 51704 } 51705 getLogger() { 51706 return this.logger; 51707 } 51708 getDefaultOptions() { 51709 return this.defaultOptions; 51710 } 51711 setDefaultOptions(options2) { 51712 this.defaultOptions = options2; 51713 } 51714 setQueryDefaults(queryKey, options2) { 51715 const result = this.queryDefaults.find((x2) => hashQueryKey(queryKey) === hashQueryKey(x2.queryKey)); 51716 if (result) { 51717 result.defaultOptions = options2; 51718 } else { 51719 this.queryDefaults.push({ 51720 queryKey, 51721 defaultOptions: options2 51722 }); 51723 } 51724 } 51725 getQueryDefaults(queryKey) { 51726 if (!queryKey) { 51727 return void 0; 51728 } 51729 const firstMatchingDefaults = this.queryDefaults.find((x2) => partialMatchKey(queryKey, x2.queryKey)); 51730 return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions; 51731 } 51732 setMutationDefaults(mutationKey, options2) { 51733 const result = this.mutationDefaults.find((x2) => hashQueryKey(mutationKey) === hashQueryKey(x2.mutationKey)); 51734 if (result) { 51735 result.defaultOptions = options2; 51736 } else { 51737 this.mutationDefaults.push({ 51738 mutationKey, 51739 defaultOptions: options2 51740 }); 51741 } 51742 } 51743 getMutationDefaults(mutationKey) { 51744 if (!mutationKey) { 51745 return void 0; 51746 } 51747 const firstMatchingDefaults = this.mutationDefaults.find((x2) => partialMatchKey(mutationKey, x2.mutationKey)); 51748 return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions; 51749 } 51750 defaultQueryOptions(options2) { 51751 if (options2 != null && options2._defaulted) { 51752 return options2; 51753 } 51754 const defaultedOptions = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, this.defaultOptions.queries), this.getQueryDefaults(options2 == null ? void 0 : options2.queryKey)), options2), { 51755 _defaulted: true 51756 }); 51757 if (!defaultedOptions.queryHash && defaultedOptions.queryKey) { 51758 defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions); 51759 } 51760 if (typeof defaultedOptions.refetchOnReconnect === "undefined") { 51761 defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; 51762 } 51763 if (typeof defaultedOptions.useErrorBoundary === "undefined") { 51764 defaultedOptions.useErrorBoundary = !!defaultedOptions.suspense; 51765 } 51766 return defaultedOptions; 51767 } 51768 defaultMutationOptions(options2) { 51769 if (options2 != null && options2._defaulted) { 51770 return options2; 51771 } 51772 return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, this.defaultOptions.mutations), this.getMutationDefaults(options2 == null ? void 0 : options2.mutationKey)), options2), { 51773 _defaulted: true 51774 }); 51775 } 51776 clear() { 51777 this.queryCache.clear(); 51778 this.mutationCache.clear(); 51779 } 51780 } 51781 class QueryObserver extends Subscribable { 51782 constructor(client2, options2) { 51783 super(); 51784 this.client = client2; 51785 this.options = options2; 51786 this.trackedProps = /* @__PURE__ */ new Set(); 51787 this.selectError = null; 51788 this.bindMethods(); 51789 this.setOptions(options2); 51790 } 51791 bindMethods() { 51792 this.remove = this.remove.bind(this); 51793 this.refetch = this.refetch.bind(this); 51794 } 51795 onSubscribe() { 51796 if (this.listeners.size === 1) { 51797 this.currentQuery.addObserver(this); 51798 if (shouldFetchOnMount(this.currentQuery, this.options)) { 51799 this.executeFetch(); 51800 } 51801 this.updateTimers(); 51802 } 51803 } 51804 onUnsubscribe() { 51805 if (!this.hasListeners()) { 51806 this.destroy(); 51807 } 51808 } 51809 shouldFetchOnReconnect() { 51810 return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect); 51811 } 51812 shouldFetchOnWindowFocus() { 51813 return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus); 51814 } 51815 destroy() { 51816 this.listeners = /* @__PURE__ */ new Set(); 51817 this.clearStaleTimeout(); 51818 this.clearRefetchInterval(); 51819 this.currentQuery.removeObserver(this); 51820 } 51821 setOptions(options2, notifyOptions) { 51822 const prevOptions = this.options; 51823 const prevQuery = this.currentQuery; 51824 this.options = this.client.defaultQueryOptions(options2); 51825 if (!shallowEqualObjects(prevOptions, this.options)) { 51826 this.client.getQueryCache().notify({ 51827 type: "observerOptionsUpdated", 51828 query: this.currentQuery, 51829 observer: this 51830 }); 51831 } 51832 if (typeof this.options.enabled !== "undefined" && typeof this.options.enabled !== "boolean") { 51833 throw new Error("Expected enabled to be a boolean"); 51834 } 51835 if (!this.options.queryKey) { 51836 this.options.queryKey = prevOptions.queryKey; 51837 } 51838 this.updateQuery(); 51839 const mounted = this.hasListeners(); 51840 if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) { 51841 this.executeFetch(); 51842 } 51843 this.updateResult(notifyOptions); 51844 if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) { 51845 this.updateStaleTimeout(); 51846 } 51847 const nextRefetchInterval = this.computeRefetchInterval(); 51848 if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) { 51849 this.updateRefetchInterval(nextRefetchInterval); 51850 } 51851 } 51852 getOptimisticResult(options2) { 51853 const query = this.client.getQueryCache().build(this.client, options2); 51854 const result = this.createResult(query, options2); 51855 if (shouldAssignObserverCurrentProperties(this, result, options2)) { 51856 this.currentResult = result; 51857 this.currentResultOptions = this.options; 51858 this.currentResultState = this.currentQuery.state; 51859 } 51860 return result; 51861 } 51862 getCurrentResult() { 51863 return this.currentResult; 51864 } 51865 trackResult(result) { 51866 const trackedResult = {}; 51867 Object.keys(result).forEach((key) => { 51868 Object.defineProperty(trackedResult, key, { 51869 configurable: false, 51870 enumerable: true, 51871 get: () => { 51872 this.trackedProps.add(key); 51873 return result[key]; 51874 } 51875 }); 51876 }); 51877 return trackedResult; 51878 } 51879 getCurrentQuery() { 51880 return this.currentQuery; 51881 } 51882 remove() { 51883 this.client.getQueryCache().remove(this.currentQuery); 51884 } 51885 refetch(_z = {}) { 51886 var _A = _z, { 51887 refetchPage 51888 } = _A, options2 = __objRest(_A, [ 51889 "refetchPage" 51890 ]); 51891 return this.fetch(__spreadProps(__spreadValues({}, options2), { 51892 meta: { 51893 refetchPage 51894 } 51895 })); 51896 } 51897 fetchOptimistic(options2) { 51898 const defaultedOptions = this.client.defaultQueryOptions(options2); 51899 const query = this.client.getQueryCache().build(this.client, defaultedOptions); 51900 query.isFetchingOptimistic = true; 51901 return query.fetch().then(() => this.createResult(query, defaultedOptions)); 51902 } 51903 fetch(fetchOptions) { 51904 var _fetchOptions$cancelR; 51905 return this.executeFetch(__spreadProps(__spreadValues({}, fetchOptions), { 51906 cancelRefetch: (_fetchOptions$cancelR = fetchOptions.cancelRefetch) != null ? _fetchOptions$cancelR : true 51907 })).then(() => { 51908 this.updateResult(); 51909 return this.currentResult; 51910 }); 51911 } 51912 executeFetch(fetchOptions) { 51913 this.updateQuery(); 51914 let promise = this.currentQuery.fetch(this.options, fetchOptions); 51915 if (!(fetchOptions != null && fetchOptions.throwOnError)) { 51916 promise = promise.catch(noop$1); 51917 } 51918 return promise; 51919 } 51920 updateStaleTimeout() { 51921 this.clearStaleTimeout(); 51922 if (isServer || this.currentResult.isStale || !isValidTimeout(this.options.staleTime)) { 51923 return; 51924 } 51925 const time2 = timeUntilStale(this.currentResult.dataUpdatedAt, this.options.staleTime); 51926 const timeout = time2 + 1; 51927 this.staleTimeoutId = setTimeout(() => { 51928 if (!this.currentResult.isStale) { 51929 this.updateResult(); 51930 } 51931 }, timeout); 51932 } 51933 computeRefetchInterval() { 51934 var _this$options$refetch; 51935 return typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false;
51936 } 51937 updateRefetchInterval(nextInterval) { 51938 this.clearRefetchInterval(); 51939 this.currentRefetchInterval = nextInterval; 51940 if (isServer || this.options.enabled === false || !isValidTimeout(this.currentRefetchInterval) || this.currentRefetchInterval === 0) { 51941 return; 51942 } 51943 this.refetchIntervalId = setInterval(() => { 51944 if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { 51945 this.executeFetch(); 51946 } 51947 }, this.currentRefetchInterval); 51948 } 51949 updateTimers() { 51950 this.updateStaleTimeout(); 51951 this.updateRefetchInterval(this.computeRefetchInterval()); 51952 } 51953 clearStaleTimeout() { 51954 if (this.staleTimeoutId) { 51955 clearTimeout(this.staleTimeoutId); 51956 this.staleTimeoutId = void 0; 51957 } 51958 } 51959 clearRefetchInterval() { 51960 if (this.refetchIntervalId) { 51961 clearInterval(this.refetchIntervalId); 51962 this.refetchIntervalId = void 0; 51963 } 51964 } 51965 createResult(query, options2) { 51966 const prevQuery = this.currentQuery; 51967 const prevOptions = this.options; 51968 const prevResult = this.currentResult; 51969 const prevResultState = this.currentResultState; 51970 const prevResultOptions = this.currentResultOptions; 51971 const queryChange = query !== prevQuery; 51972 const queryInitialState = queryChange ? query.state : this.currentQueryInitialState; 51973 const prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult; 51974 const { 51975 state 51976 } = query; 51977 let { 51978 dataUpdatedAt, 51979 error, 51980 errorUpdatedAt, 51981 fetchStatus, 51982 status 51983 } = state; 51984 let isPreviousData = false; 51985 let isPlaceholderData = false; 51986 let data; 51987 if (options2._optimisticResults) { 51988 const mounted = this.hasListeners(); 51989 const fetchOnMount = !mounted && shouldFetchOnMount(query, options2); 51990 const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options2, prevOptions); 51991 if (fetchOnMount || fetchOptionally) { 51992 fetchStatus = canFetch(query.options.networkMode) ? "fetching" : "paused"; 51993 if (!dataUpdatedAt) { 51994 status = "loading"; 51995 } 51996 } 51997 if (options2._optimisticResults === "isRestoring") { 51998 fetchStatus = "idle"; 51999 } 52000 } 52001 if (options2.keepPreviousData && !state.dataUpdatedAt && prevQueryResult != null && prevQueryResult.isSuccess && status !== "error") { 52002 data = prevQueryResult.data; 52003 dataUpdatedAt = prevQueryResult.dataUpdatedAt; 52004 status = prevQueryResult.status; 52005 isPreviousData = true; 52006 } else if (options2.select && typeof state.data !== "undefined") { 52007 if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options2.select === this.selectFn) { 52008 data = this.selectResult; 52009 } else { 52010 try { 52011 this.selectFn = options2.select; 52012 data = options2.select(state.data); 52013 data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options2); 52014 this.selectResult = data; 52015 this.selectError = null; 52016 } catch (selectError) { 52017 this.selectError = selectError; 52018 } 52019 } 52020 } else { 52021 data = state.data; 52022 } 52023 if (typeof options2.placeholderData !== "undefined" && typeof data === "undefined" && status === "loading") { 52024 let placeholderData; 52025 if (prevResult != null && prevResult.isPlaceholderData && options2.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { 52026 placeholderData = prevResult.data; 52027 } else { 52028 placeholderData = typeof options2.placeholderData === "function" ? options2.placeholderData() : options2.placeholderData; 52029 if (options2.select && typeof placeholderData !== "undefined") { 52030 try { 52031 placeholderData = options2.select(placeholderData); 52032 this.selectError = null; 52033 } catch (selectError) { 52034 this.selectError = selectError; 52035 } 52036 } 52037 } 52038 if (typeof placeholderData !== "undefined") { 52039 status = "success"; 52040 data = replaceData(prevResult == null ? void 0 : prevResult.data, placeholderData, options2); 52041 isPlaceholderData = true; 52042 } 52043 } 52044 if (this.selectError) { 52045 error = this.selectError; 52046 data = this.selectResult; 52047 errorUpdatedAt = Date.now(); 52048 status = "error"; 52049 } 52050 const isFetching = fetchStatus === "fetching"; 52051 const isLoading = status === "loading"; 52052 const isError2 = status === "error"; 52053 const result = { 52054 status, 52055 fetchStatus, 52056 isLoading, 52057 isSuccess: status === "success", 52058 isError: isError2, 52059 isInitialLoading: isLoading && isFetching, 52060 data, 52061 dataUpdatedAt, 52062 error, 52063 errorUpdatedAt, 52064 failureCount: state.fetchFailureCount, 52065 failureReason: state.fetchFailureReason,
52066 errorUpdateCount: state.errorUpdateCount, 52067 isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0, 52068 isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount, 52069 isFetching, 52070 isRefetching: isFetching && !isLoading, 52071 isLoadingError: isError2 && state.dataUpdatedAt === 0, 52072 isPaused: fetchStatus === "paused", 52073 isPlaceholderData, 52074 isPreviousData, 52075 isRefetchError: isError2 && state.dataUpdatedAt !== 0, 52076 isStale: isStale(query, options2), 52077 refetch: this.refetch, 52078 remove: this.remove 52079 }; 52080 return result; 52081 } 52082 updateResult(notifyOptions) { 52083 const prevResult = this.currentResult; 52084 const nextResult = this.createResult(this.currentQuery, this.options); 52085 this.currentResultState = this.currentQuery.state; 52086 this.currentResultOptions = this.options; 52087 if (shallowEqualObjects(nextResult, prevResult)) { 52088 return; 52089 } 52090 this.currentResult = nextResult; 52091 const defaultNotifyOptions = { 52092 cache: true 52093 }; 52094 const shouldNotifyListeners = () => { 52095 if (!prevResult) { 52096 return true; 52097 } 52098 const { 52099 notifyOnChangeProps 52100 } = this.options; 52101 const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; 52102 if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.trackedProps.size) { 52103 return true; 52104 } 52105 const includedProps = new Set(notifyOnChangePropsValue != null ? notifyOnChangePropsValue : this.trackedProps); 52106 if (this.options.useErrorBoundary) { 52107 includedProps.add("error"); 52108 } 52109 return Object.keys(this.currentResult).some((key) => { 52110 const typedKey = key; 52111 const changed = this.currentResult[typedKey] !== prevResult[typedKey]; 52112 return changed && includedProps.has(typedKey); 52113 }); 52114 }; 52115 if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && shouldNotifyListeners()) { 52116 defaultNotifyOptions.listeners = true; 52117 } 52118 this.notify(__spreadValues(__spreadValues({}, defaultNotifyOptions), notifyOptions)); 52119 } 52120 updateQuery() { 52121 const query = this.client.getQueryCache().build(this.client, this.options); 52122 if (query === this.currentQuery) { 52123 return; 52124 } 52125 const prevQuery = this.currentQuery; 52126 this.currentQuery = query; 52127 this.currentQueryInitialState = query.state; 52128 this.previousQueryResult = this.currentResult; 52129 if (this.hasListeners()) { 52130 prevQuery == null ? void 0 : prevQuery.removeObserver(this); 52131 query.addObserver(this); 52132 } 52133 } 52134 onQueryUpdate(action) { 52135 const notifyOptions = {}; 52136 if (action.type === "success") { 52137 notifyOptions.onSuccess = !action.manual; 52138 } else if (action.type === "error" && !isCancelledError(action.error)) { 52139 notifyOptions.onError = true; 52140 } 52141 this.updateResult(notifyOptions); 52142 if (this.hasListeners()) { 52143 this.updateTimers(); 52144 } 52145 } 52146 notify(notifyOptions) { 52147 notifyManager.batch(() => { 52148 if (notifyOptions.onSuccess) { 52149 var _this$options$onSucce, _this$options, _this$options$onSettl, _this$options2; 52150 (_this$options$onSucce = (_this$options = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options, this.currentResult.data); 52151 (_this$options$onSettl = (_this$options2 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options2, this.currentResult.data, null); 52152 } else if (notifyOptions.onError) { 52153 var _this$options$onError, _this$options3, _this$options$onSettl2, _this$options4; 52154 (_this$options$onError = (_this$options3 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options3, this.currentResult.error); 52155 (_this$options$onSettl2 = (_this$options4 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options4, void 0, this.currentResult.error); 52156 } 52157 if (notifyOptions.listeners) {
52158 this.listeners.forEach(({ 52159 listener 52160 }) => { 52161 listener(this.currentResult); 52162 }); 52163 } 52164 if (notifyOptions.cache) { 52165 this.client.getQueryCache().notify({ 52166 query: this.currentQuery, 52167 type: "observerResultsUpdated" 52168 }); 52169 } 52170 }); 52171 } 52172 } 52173 function shouldLoadOnMount(query, options2) { 52174 return options2.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === "error" && options2.retryOnMount === false); 52175 } 52176 function shouldFetchOnMount(query, options2) { 52177 return shouldLoadOnMount(query, options2) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options2, options2.refetchOnMount); 52178 } 52179 function shouldFetchOn(query, options2, field) { 52180 if (options2.enabled !== false) { 52181 const value = typeof field === "function" ? field(query) : field; 52182 return value === "always" || value !== false && isStale(query, options2); 52183 } 52184 return false; 52185 } 52186 function shouldFetchOptionally(query, prevQuery, options2, prevOptions) { 52187 return options2.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options2.suspense || query.state.status !== "error") && isStale(query, options2); 52188 } 52189 function isStale(query, options2) { 52190 return query.isStaleByTime(options2.staleTime); 52191 } 52192 function shouldAssignObserverCurrentProperties(observer, optimisticResult, options2) { 52193 if (options2.keepPreviousData) { 52194 return false; 52195 } 52196 if (options2.placeholderData !== void 0) { 52197 return optimisticResult.isPlaceholderData; 52198 } 52199 if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { 52200 return true; 52201 } 52202 return false; 52203 } 52204 let MutationObserver$1 = class MutationObserver extends Subscribable { 52205 constructor(client2, options2) { 52206 super(); 52207 this.client = client2; 52208 this.setOptions(options2); 52209 this.bindMethods(); 52210 this.updateResult(); 52211 } 52212 bindMethods() { 52213 this.mutate = this.mutate.bind(this); 52214 this.reset = this.reset.bind(this); 52215 } 52216 setOptions(options2) { 52217 var _this$currentMutation; 52218 const prevOptions = this.options; 52219 this.options = this.client.defaultMutationOptions(options2); 52220 if (!shallowEqualObjects(prevOptions, this.options)) { 52221 this.client.getMutationCache().notify({ 52222 type: "observerOptionsUpdated", 52223 mutation: this.currentMutation, 52224 observer: this 52225 }); 52226 } 52227 (_this$currentMutation = this.currentMutation) == null ? void 0 : _this$currentMutation.setOptions(this.options); 52228 } 52229 onUnsubscribe() { 52230 if (!this.hasListeners()) { 52231 var _this$currentMutation2; 52232 (_this$currentMutation2 = this.currentMutation) == null ? void 0 : _this$currentMutation2.removeObserver(this); 52233 } 52234 } 52235 onMutationUpdate(action) { 52236 this.updateResult(); 52237 const notifyOptions = { 52238 listeners: true 52239 }; 52240 if (action.type === "success") { 52241 notifyOptions.onSuccess = true; 52242 } else if (action.type === "error") { 52243 notifyOptions.onError = true; 52244 } 52245 this.notify(notifyOptions); 52246 } 52247 getCurrentResult() { 52248 return this.currentResult; 52249 } 52250 reset() { 52251 this.currentMutation = void 0; 52252 this.updateResult(); 52253 this.notify({ 52254 listeners: true 52255 }); 52256 } 52257 mutate(variables, options2) { 52258 this.mutateOptions = options2; 52259 if (this.currentMutation) { 52260 this.currentMutation.removeObserver(this); 52261 } 52262 this.currentMutation = this.client.getMutationCache().build(this.client, __spreadProps(__spreadValues({}, this.options), { 52263 variables: typeof variables !== "undefined" ? variables : this.options.variables 52264 })); 52265 this.currentMutation.addObserver(this); 52266 return this.currentMutation.execute(); 52267 } 52268 updateResult() { 52269 const state = this.currentMutation ? this.currentMutation.state : getDefaultState(); 52270 const result = __spreadProps(__spreadValues({}, state), { 52271 isLoading: state.status === "loading", 52272 isSuccess: state.status === "success", 52273 isError: state.status === "error", 52274 isIdle: state.status === "idle", 52275 mutate: this.mutate, 52276 reset: this.reset 52277 }); 52278 this.currentResult = result; 52279 } 52280 notify(options2) { 52281 notifyManager.batch(() => { 52282 if (this.mutateOptions && this.hasListeners()) { 52283 if (options2.onSuccess) { 52284 var _this$mutateOptions$o, _this$mutateOptions, _this$mutateOptions$o2, _this$mutateOptions2; 52285 (_this$mutateOptions$o = (_this$mutateOptions = this.mutateOptions).onSuccess) == null ? void 0 : _this$mutateOptions$o.call(_this$mutateOptions, this.currentResult.data, this.currentResult.variables, this.currentResult.context); 52286 (_this$mutateOptions$o2 = (_this$mutateOptions2 = this.mutateOptions).onSettled) == null ? void 0 : _this$mutateOptions$o2.call(_this$mutateOptions2, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context); 52287 } else if (options2.onError) { 52288 var _this$mutateOptions$o3, _this$mutateOptions3, _this$mutateOptions$o4, _this$mutateOptions4; 52289 (_this$mutateOptions$o3 = (_this$mutateOptions3 = this.mutateOptions).onError) == null ? void 0 : _this$mutateOptions$o3.call(_this$mutateOptions3, this.currentResult.error, this.currentResult.variables, this.currentResult.context); 52290 (_this$mutateOptions$o4 = (_this$mutateOptions4 = this.mutateOptions).onSettled) == null ? void 0 : _this$mutateOptions$o4.call(_this$mutateOptions4, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context); 52291 } 52292 } 52293 if (options2.listeners) {
52294 this.listeners.forEach(({ 52295 listener 52296 }) => { 52297 listener(this.currentResult); 52298 }); 52299 } 52300 }); 52301 } 52302 }; 52303 const useSyncExternalStore = shimExports.useSyncExternalStore; 52304 const defaultContext = /* @__PURE__ */ reactExports.createContext(void 0); 52305 const QueryClientSharingContext = /* @__PURE__ */ reactExports.createContext(false); 52306 function getQueryClientContext(context, contextSharing) { 52307 if (context) { 52308 return context; 52309 } 52310 if (contextSharing && typeof window !== "undefined") { 52311 if (!window.ReactQueryClientContext) { 52312 window.ReactQueryClientContext = defaultContext; 52313 } 52314 return window.ReactQueryClientContext; 52315 } 52316 return defaultContext; 52317 } 52318 const useQueryClient = ({ 52319 context 52320 } = {}) => { 52321 const queryClient2 = reactExports.useContext(getQueryClientContext(context, reactExports.useContext(QueryClientSharingContext))); 52322 if (!queryClient2) { 52323 throw new Error("No QueryClient set, use QueryClientProvider to set one"); 52324 } 52325 return queryClient2; 52326 }; 52327 const QueryClientProvider = ({ 52328 client: client2, 52329 children, 52330 context, 52331 contextSharing = false 52332 }) => { 52333 reactExports.useEffect(() => { 52334 client2.mount(); 52335 return () => { 52336 client2.unmount(); 52337 }; 52338 }, [client2]); 52339 const Context = getQueryClientContext(context, contextSharing); 52340 return /* @__PURE__ */ reactExports.createElement(QueryClientSharingContext.Provider, { 52341 value: !context && contextSharing 52342 }, /* @__PURE__ */ reactExports.createElement(Context.Provider, { 52343 value: client2 52344 }, children)); 52345 }; 52346 const IsRestoringContext = /* @__PURE__ */ reactExports.createContext(false); 52347 const useIsRestoring = () => reactExports.useContext(IsRestoringContext); 52348 IsRestoringContext.Provider; 52349 function createValue() { 52350 let isReset = false; 52351 return { 52352 clearReset: () => { 52353 isReset = false; 52354 }, 52355 reset: () => { 52356 isReset = true; 52357 }, 52358 isReset: () => { 52359 return isReset; 52360 } 52361 }; 52362 } 52363 const QueryErrorResetBoundaryContext = /* @__PURE__ */ reactExports.createContext(createValue()); 52364 const useQueryErrorResetBoundary = () => reactExports.useContext(QueryErrorResetBoundaryContext); 52365 function shouldThrowError(_useErrorBoundary, params) { 52366 if (typeof _useErrorBoundary === "function") { 52367 return _useErrorBoundary(...params); 52368 } 52369 return !!_useErrorBoundary; 52370 } 52371 const ensurePreventErrorBoundaryRetry = (options2, errorResetBoundary) => { 52372 if (options2.suspense || options2.useErrorBoundary) { 52373 if (!errorResetBoundary.isReset()) { 52374 options2.retryOnMount = false; 52375 } 52376 } 52377 }; 52378 const useClearResetErrorBoundary = (errorResetBoundary) => { 52379 reactExports.useEffect(() => { 52380 errorResetBoundary.clearReset(); 52381 }, [errorResetBoundary]); 52382 }; 52383 const getHasError = ({ 52384 result, 52385 errorResetBoundary, 52386 useErrorBoundary, 52387 query 52388 }) => { 52389 return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(useErrorBoundary, [result.error, query]); 52390 }; 52391 const ensureStaleTime = (defaultedOptions) => { 52392 if (defaultedOptions.suspense) { 52393 if (typeof defaultedOptions.staleTime !== "number") { 52394 defaultedOptions.staleTime = 1e3; 52395 } 52396 } 52397 }; 52398 const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; 52399 const shouldSuspend = (defaultedOptions, result, isRestoring) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && willFetch(result, isRestoring); 52400 const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).then(({ 52401 data 52402 }) => { 52403 defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data); 52404 defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null); 52405 }).catch((error) => { 52406 errorResetBoundary.clearReset(); 52407 defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error); 52408 defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(void 0, error); 52409 }); 52410 function useBaseQuery(options2, Observer) { 52411 const queryClient2 = useQueryClient({ 52412 context: options2.context 52413 }); 52414 const isRestoring = useIsRestoring(); 52415 const errorResetBoundary = useQueryErrorResetBoundary(); 52416 const defaultedOptions = queryClient2.defaultQueryOptions(options2); 52417 defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; 52418 if (defaultedOptions.onError) { 52419 defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError); 52420 } 52421 if (defaultedOptions.onSuccess) { 52422 defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess); 52423 } 52424 if (defaultedOptions.onSettled) { 52425 defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled); 52426 } 52427 ensureStaleTime(defaultedOptions); 52428 ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary); 52429 useClearResetErrorBoundary(errorResetBoundary); 52430 const [observer] = reactExports.useState(() => new Observer(queryClient2, defaultedOptions)); 52431 const result = observer.getOptimisticResult(defaultedOptions); 52432 useSyncExternalStore(reactExports.useCallback((onStoreChange) => { 52433 const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange)); 52434 observer.updateResult(); 52435 return unsubscribe; 52436 }, [observer, isRestoring]), () => observer.getCurrentResult(), () => observer.getCurrentResult()); 52437 reactExports.useEffect(() => { 52438 observer.setOptions(defaultedOptions, { 52439 listeners: false 52440 }); 52441 }, [defaultedOptions, observer]); 52442 if (shouldSuspend(defaultedOptions, result, isRestoring)) { 52443 throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); 52444 } 52445 if (getHasError({ 52446 result, 52447 errorResetBoundary, 52448 useErrorBoundary: defaultedOptions.useErrorBoundary, 52449 query: observer.getCurrentQuery() 52450 })) { 52451 throw result.error; 52452 } 52453 return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; 52454 } 52455 function useQuery(arg1, arg2, arg3) { 52456 const parsedOptions = parseQueryArgs(arg1, arg2, arg3); 52457 return useBaseQuery(parsedOptions, QueryObserver); 52458 } 52459 function useIsMutating(arg1, arg2, arg3) { 52460 const [filters, options2 = {}] = parseMutationFilterArgs(arg1, arg2, arg3); 52461 const queryClient2 = useQueryClient({ 52462 context: options2.context 52463 }); 52464 const mutationCache = queryClient2.getMutationCache(); 52465 return useSyncExternalStore(reactExports.useCallback((onStoreChange) => mutationCache.subscribe(notifyManager.batchCalls(onStoreChange)), [mutationCache]), () => queryClient2.isMutating(filters), () => queryClient2.isMutating(filters)); 52466 } 52467 function useMutation(arg1, arg2, arg3) { 52468 const options2 = parseMutationArgs(arg1, arg2); 52469 const queryClient2 = useQueryClient({ 52470 context: options2.context 52471 }); 52472 const [observer] = reactExports.useState(() => new MutationObserver$1(queryClient2, options2)); 52473 reactExports.useEffect(() => { 52474 observer.setOptions(options2); 52475 }, [observer, options2]); 52476 const result = useSyncExternalStore(reactExports.useCallback((onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult()); 52477 const mutate = reactExports.useCallback((variables, mutateOptions) => { 52478 observer.mutate(variables, mutateOptions).catch(noop); 52479 }, [observer]); 52480 if (result.error && shouldThrowError(observer.options.useErrorBoundary, [result.error])) { 52481 throw result.error; 52482 } 52483 return __spreadProps(__spreadValues({}, result), { 52484 mutate, 52485 mutateAsync: result.mutate 52486 }); 52487 } 52488 function noop() { 52489 } 52490 function baseSlice(array2, start, end) { 52491 var index2 = -1, length2 = array2.length; 52492 if (start < 0) { 52493 start = -start > length2 ? 0 : length2 + start; 52494 } 52495 end = end > length2 ? length2 : end; 52496 if (end < 0) { 52497 end += length2; 52498 } 52499 length2 = start > end ? 0 : end - start >>> 0; 52500 start >>>= 0; 52501 var result = Array(length2); 52502 while (++index2 < length2) { 52503 result[index2] = array2[index2 + start]; 52504 } 52505 return result; 52506 } 52507 function castSlice(array2, start, end) { 52508 var length2 = array2.length; 52509 end = end === void 0 ? length2 : end; 52510 return !start && end >= length2 ? array2 : baseSlice(array2, start, end); 52511 } 52512 var rsAstralRange$2 = "\\ud800-\\udfff", rsComboMarksRange$3 = "\\u0300-\\u036f", reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f", rsComboSymbol
52512sRange$3 = "\\u20d0-\\u20ff", rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3, rsVarRange$2 = "\\ufe0e\\ufe0f"; 52513 var rsZWJ$2 = "\\u200d"; 52514 var reHasUnicode = RegExp("[" + rsZWJ$2 + rsAstralRange$2 + rsComboRange$3 + rsVarRange$2 + "]"); 52515 function hasUnicode(string2) { 52516 return reHasUnicode.test(string2); 52517 } 52518 function asciiToArray(string2) { 52519 return string2.split(""); 52520 } 52521 var rsAstralRange$1 = "\\ud800-\\udfff", rsComboMarksRange$2 = "\\u0300-\\u036f", reComboHalfMarksRange$2 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$2 = "\\u20d0-\\u20ff", rsComboRange$2 = rsComboMarksRange$2 + reComboHalfMarksRange$2 + rsComboSymbolsRange$2, rsVarRange$1 = "\\ufe0e\\ufe0f"; 52522 var rsAstral = "[" + rsAstralRange$1 + "]", rsCombo$2 = "[" + rsComboRange$2 + "]", rsFitz$1 = "\\ud83c[\\udffb-\\udfff]", rsModifier$1 = "(?:" + rsCombo$2 + "|" + rsFitz$1 + ")", rsNonAstral$1 = "[^" + rsAstralRange$1 + "]", rsRegional$1 = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair$1 = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ$1 = "\\u200d"; 52523 var reOptMod$1 = rsModifier$1 + "?", rsOptVar$1 = "[" + rsVarRange$1 + "]?", rsOptJoin$1 = "(?:" + rsZWJ$1 + "(?:" + [rsNonAstral$1, rsRegional$1, rsSurrPair$1].join("|") + ")" + rsOptVar$1 + reOptMod$1 + ")*", rsSeq$1 = rsOptVar$1 + reOptMod$1 + rsOptJoin$1, rsSymbol = "(?:" + [rsNonAstral$1 + rsCombo$2 + "?", rsCombo$2, rsRegional$1, rsSurrPair$1, rsAstral].join("|") + ")"; 52524 var reUnicode = RegExp(rsFitz$1 + "(?=" + rsFitz$1 + ")|" + rsSymbol + rsSeq$1, "g"); 52525 function unicodeToArray(string2) { 52526 return string2.match(reUnicode) || []; 52527 } 52528 function stringToArray(string2) { 52529 return hasUnicode(string2) ? unicodeToArray(string2) : asciiToArray(string2); 52530 } 52531 function createCaseFirst(methodName) { 52532 return function(string2) { 52533 string2 = toString$1(string2); 52534 var strSymbols = hasUnicode(string2) ? stringToArray(string2) : void 0; 52535 var chr = strSymbols ? strSymbols[0] : string2.charAt(0); 52536 var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string2.slice(1); 52537 return chr[methodName]() + trailing; 52538 }; 52539 } 52540 var upperFirst = createCaseFirst("toUpperCase"); 52541 var T$1 = (e2, t2) => (t2 == null ? void 0 : t2.length) ? t2.reduceRight((a2, r2) => r2(a2), e2) : e2; 52542 var C$3 = (e2, t2) => { 52543 let _a = t2, { middlewares: a2 } = _a, r2 = __objRest(_a, ["middlewares"]), u2 = T$1(e2, a2), n2 = (s2) => { 52544 let o2 = [...r2.queryKey, s2]; 52545 return __spreadProps(__spreadValues({}, r2), { queryKey: o2, queryFn: () => __async(null, null, function* () { 52546 let { data: i2 } = yield u2(...s2 || []); 52547 return i2; 52548 }) }); 52549 }, m2 = (s2, o2) => { 52550 let y2 = useQueryClient(), { queryKey: i2, queryFn: f2 } = n2(s2), d2 = i2[0], g2 = __spreadProps(__spreadValues(__spreadValues({}, r2), o2), { queryKey: i2 }), h2 = useQuery(__spreadValues({ queryFn: f2 }, g2)), c2 = () => __async(null, null, function* () { 52551 yield y2.invalidateQueries({ queryKey: i2 }); 52552 }), p2 = (x2) => { 52553 y2.setQueryData(i2, x2); 52554 }; 52555 return { [`${d2}Query`]: h2, [`${d2}QueryKey`]: i2, [`set${upperFirst(d2)}Data`]: p2, [`invalidate${upperFirst(d2)}Query`]: c2 }; 52556 }; 52557 return m2.getQueryOptions = n2, m2; 52558 }, R$2 = (e2, t2) => { 52559 let _a = t2, { middlewares: a2 } = _a, r2 = __objRest(_a, ["middlewares"]), u2 = T$1(e2, a2); 52560 return (n2) => { 52561 let m2 = (f2) => __async(null, null, function* () { 52562 let { data: d2 } = yield u2(...f2); 52563 return d2; 52564 }), s2 = __spreadValues(__spreadValues({}, r2), n2), o2 = s2.mutationKey[0], y2 = s2.mutationKey, i2 = useMutation(__spreadValues({ mutationFn: m2 }, s2)); 52565 return { [`${o2}Mutation`]: i2, [`${o2}MutationKey`]: y2 }; 52566 }; 52567 }; 52568 var v$2 = (e2) => e2 instanceof Error && e2.name === "ReauthCancelledError", M$3 = (e2, t2) => { 52569 var _a, _b; 52570 return axios.isAxiosError(t2) && (((_a = t2.response) == null ? void 0 : _a.status) === 403 || ((_b = t2.response) == null ? void 0 : _b.status) === 404) || v$2(t2) ? false : e2 < 2; 52571 }, w$3 = (e2) => { 52572 var _a, _b, _c, _d, _e2, _f; 52573 let t2 = "Something went wrong."; 52574 return axios.isAxiosError(e2) && ((_a = e2.response) == null ? void 0 : _a.data.title) ? t2 = (_b = e2.response) == null ? void 0 : _b.data.title : axios.isAxiosError(e2) && ((_c = e2.response) == null ? void 0 : _c.data.body) ? t2 = b$1((_d = e2.response) == null ? void 0 : _d.data.body) : axios.isAxiosError(e2) && ((_e2 = e2.response) == null ? void 0 : _e2.data.message) ? t2 = (_f = e2.response) == null ? void 0 : _f.data.message : e2 instanceof Error && e2.message && (t2 = e2.message), t2; 52575 }, D$3 = (e2) => (t2) => { 52576 e2(w$3(t2)); 52577 }, K$2 = (e2) => (t2, a2) => { 52578 var _a, _b; 52579 if (!("onError" in a2.options)) { 52580 if (axios.isAxiosError(t2) && (((_a = t2.response) == null ? void 0 : _a.status) === 401 || ((_b = t2.response) == null ? void 0 : _b.status) === 403)) { 52581 console.error(t2); 52582 return; 52583 } 52584 return D$3(e2)(t2); 52585 } 52586 }, b$1 = (e2) => { 52587 let t2 = /* @__PURE__ */ new Set(), a2 = (r2) => { 52588 Object.keys(r2).forEach((u2) => { 52589 let n2 = r2[u2]; 52590 Array.isArray(n2) ? t2.add(`${u2}: ${n2.join(",")}`) : n2 !== null && typeof n2 == "object" ? a2(n2) : t2.add(`${u2}: ${String(n2)}`); 52591 }); 52592 }; 52593 return a2(e2), Array.from(t2).join(` 52594`); 52595 }; 52596 var E$1 = ({ notify: e2 }) => new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, retry: M$3 }, mutations: { onError: D$3(e2) } }, queryCache: new QueryCache({ onError: K$2(e2) }) }); 52597 const usePlatformSettingsQuery = C$3( 52598 () => __async(null, null, function* () { 52599 return yield axios.get("/platform/settings.json"); 52600 }), 52601 { 52602 queryKey: ["platformSettings"], 52603 // Analytics setup must never surface an error toast to customers. 52604 onError: () => { 52605 } 52606 } 52607 ); 52608 const findProvider = (providers, name) => providers.find( 52609 (provider) => provider.name === name 52610 ); 52611 const getCreatorAnalyticsGlobals = (settings) => { 52612 var _a, _b, _c, _d, _e2, _f; 52613 const providers = ((_a = settings == null ? void 0 : settings.analytics) == null ? void 0 : _a.webAnalytics) === "Enabled" ? (_b = settings.analytics.providers) != null ? _b : [] : []; 52614 return { 52615 creatorFbPixelId: (_c = findProvider(providers, "facebook")) == null ? void 0 : _c.settings.pixelId, 52616 creatorGa4Id: (_d = findProvider(providers, "ga4")) == null ? void 0 : _d.settings.id, 52617 creatorKlaviyoAnalyticsId: (_e2 = findProvider(providers, "klaviyo")) == null ? void 0 : _e2.settings.publicApiKey,
vendor: 4,220 bytes, lines 52618-52741
52618 creatorTiktokAnalyticsId: (_f = findProvider(providers, "tiktok")) == null ? void 0 : _f.settings.id, 52619 cookie_policy: settings == null ? void 0 : settings.cookiePolicy 52620 }; 52621 }; 52622 var dist = {}; 52623 function lexer(str) { 52624 var tokens = []; 52625 var i2 = 0; 52626 while (i2 < str.length) { 52627 var char2 = str[i2]; 52628 if (char2 === "*" || char2 === "+" || char2 === "?") { 52629 tokens.push({ type: "MODIFIER", index: i2, value: str[i2++] }); 52630 continue; 52631 } 52632 if (char2 === "\\") { 52633 tokens.push({ type: "ESCAPED_CHAR", index: i2++, value: str[i2++] }); 52634 continue; 52635 } 52636 if (char2 === "{") { 52637 tokens.push({ type: "OPEN", index: i2, value: str[i2++] }); 52638 continue; 52639 } 52640 if (char2 === "}") { 52641 tokens.push({ type: "CLOSE", index: i2, value: str[i2++] }); 52642 continue; 52643 } 52644 if (char2 === ":") { 52645 var name = ""; 52646 var j2 = i2 + 1; 52647 while (j2 < str.length) { 52648 var code = str.charCodeAt(j2); 52649 if ( 52650 // `0-9` 52651 code >= 48 && code <= 57 || // `A-Z` 52652 code >= 65 && code <= 90 || // `a-z` 52653 code >= 97 && code <= 122 || // `_` 52654 code === 95 52655 ) { 52656 name += str[j2++]; 52657 continue; 52658 } 52659 break; 52660 } 52661 if (!name) 52662 throw new TypeError("Missing parameter name at ".concat(i2)); 52663 tokens.push({ type: "NAME", index: i2, value: name }); 52664 i2 = j2; 52665 continue; 52666 } 52667 if (char2 === "(") { 52668 var count2 = 1; 52669 var pattern = ""; 52670 var j2 = i2 + 1; 52671 if (str[j2] === "?") { 52672 throw new TypeError('Pattern cannot start with "?" at '.concat(j2)); 52673 } 52674 while (j2 < str.length) { 52675 if (str[j2] === "\\") { 52676 pattern += str[j2++] + str[j2++]; 52677 continue; 52678 } 52679 if (str[j2] === ")") { 52680 count2--; 52681 if (count2 === 0) { 52682 j2++; 52683 break; 52684 } 52685 } else if (str[j2] === "(") { 52686 count2++; 52687 if (str[j2 + 1] !== "?") { 52688 throw new TypeError("Capturing groups are not allowed at ".concat(j2)); 52689 } 52690 } 52691 pattern += str[j2++]; 52692 } 52693 if (count2) 52694 throw new TypeError("Unbalanced pattern at ".concat(i2)); 52695 if (!pattern) 52696 throw new TypeError("Missing pattern at ".concat(i2)); 52697 tokens.push({ type: "PATTERN", index: i2, value: pattern }); 52698 i2 = j2; 52699 continue; 52700 } 52701 tokens.push({ type: "CHAR", index: i2, value: str[i2++] }); 52702 } 52703 tokens.push({ type: "END", index: i2, value: "" }); 52704 return tokens; 52705 } 52706 function parse(str, options2) { 52707 if (options2 === void 0) { 52708 options2 = {}; 52709 } 52710 var tokens = lexer(str); 52711 var _a = options2.prefixes, prefixes2 = _a === void 0 ? "./" : _a, _b = options2.delimiter, delimiter2 = _b === void 0 ? "/#?" : _b; 52712 var result = []; 52713 var key = 0; 52714 var i2 = 0; 52715 var path = ""; 52716 var tryConsume = function(type) { 52717 if (i2 < tokens.length && tokens[i2].type === type) 52718 return tokens[i2++].value; 52719 }; 52720 var mustConsume = function(type) { 52721 var value2 = tryConsume(type); 52722 if (value2 !== void 0) 52723 return value2; 52724 var _a2 = tokens[i2], nextType = _a2.type, index2 = _a2.index; 52725 throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index2, ", expected ").concat(type)); 52726 }; 52727 var consumeText = function() { 52728 var result2 = ""; 52729 var value2; 52730 while (value2 = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR")) { 52731 result2 += value2; 52732 } 52733 return result2; 52734 }; 52735 var isSafe = function(value2) { 52736 for (var _i2 = 0, delimiter_1 = delimiter2; _i2 < delimiter_1.length; _i2++) { 52737 var char3 = delimiter_1[_i2]; 52738 if (value2.indexOf(char3) > -1) 52739 return true; 52740 } 52741 return false;
vendor: 5,213 bytes, lines 52742-52881
52742 }; 52743 var safePattern = function(prefix3) { 52744 var prev2 = result[result.length - 1]; 52745 var prevText = prefix3 || (prev2 && typeof prev2 === "string" ? prev2 : ""); 52746 if (prev2 && !prevText) { 52747 throw new TypeError('Must have text between two parameters, missing text after "'.concat(prev2.name, '"')); 52748 } 52749 if (!prevText || isSafe(prevText)) 52750 return "[^".concat(escapeString(delimiter2), "]+?"); 52751 return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter2), "])+?"); 52752 }; 52753 while (i2 < tokens.length) { 52754 var char2 = tryConsume("CHAR"); 52755 var name = tryConsume("NAME"); 52756 var pattern = tryConsume("PATTERN"); 52757 if (name || pattern) { 52758 var prefix2 = char2 || ""; 52759 if (prefixes2.indexOf(prefix2) === -1) { 52760 path += prefix2; 52761 prefix2 = ""; 52762 } 52763 if (path) { 52764 result.push(path); 52765 path = ""; 52766 } 52767 result.push({ 52768 name: name || key++, 52769 prefix: prefix2, 52770 suffix: "", 52771 pattern: pattern || safePattern(prefix2), 52772 modifier: tryConsume("MODIFIER") || "" 52773 }); 52774 continue; 52775 } 52776 var value = char2 || tryConsume("ESCAPED_CHAR"); 52777 if (value) { 52778 path += value; 52779 continue; 52780 } 52781 if (path) { 52782 result.push(path); 52783 path = ""; 52784 } 52785 var open = tryConsume("OPEN"); 52786 if (open) { 52787 var prefix2 = consumeText(); 52788 var name_1 = tryConsume("NAME") || ""; 52789 var pattern_1 = tryConsume("PATTERN") || ""; 52790 var suffix = consumeText(); 52791 mustConsume("CLOSE"); 52792 result.push({ 52793 name: name_1 || (pattern_1 ? key++ : ""), 52794 pattern: name_1 && !pattern_1 ? safePattern(prefix2) : pattern_1, 52795 prefix: prefix2, 52796 suffix, 52797 modifier: tryConsume("MODIFIER") || "" 52798 }); 52799 continue; 52800 } 52801 mustConsume("END"); 52802 } 52803 return result; 52804 } 52805 function compile(str, options2) { 52806 return tokensToFunction(parse(str, options2), options2); 52807 } 52808 function tokensToFunction(tokens, options2) { 52809 if (options2 === void 0) { 52810 options2 = {}; 52811 } 52812 var reFlags2 = flags(options2); 52813 var _a = options2.encode, encode2 = _a === void 0 ? function(x2) { 52814 return x2; 52815 } : _a, _b = options2.validate, validate = _b === void 0 ? true : _b; 52816 var matches2 = tokens.map(function(token2) { 52817 if (typeof token2 === "object") { 52818 return new RegExp("^(?:".concat(token2.pattern, ")$"), reFlags2); 52819 } 52820 }); 52821 return function(data) { 52822 var path = ""; 52823 for (var i2 = 0; i2 < tokens.length; i2++) { 52824 var token2 = tokens[i2]; 52825 if (typeof token2 === "string") { 52826 path += token2; 52827 continue; 52828 } 52829 var value = data ? data[token2.name] : void 0; 52830 var optional = token2.modifier === "?" || token2.modifier === "*"; 52831 var repeat = token2.modifier === "*" || token2.modifier === "+"; 52832 if (Array.isArray(value)) { 52833 if (!repeat) { 52834 throw new TypeError('Expected "'.concat(token2.name, '" to not repeat, but got an array')); 52835 } 52836 if (value.length === 0) { 52837 if (optional) 52838 continue; 52839 throw new TypeError('Expected "'.concat(token2.name, '" to not be empty')); 52840 } 52841 for (var j2 = 0; j2 < value.length; j2++) { 52842 var segment = encode2(value[j2], token2); 52843 if (validate && !matches2[i2].test(segment)) { 52844 throw new TypeError('Expected all "'.concat(token2.name, '" to match "').concat(token2.pattern, '", but got "').concat(segment, '"')); 52845 } 52846 path += token2.prefix + segment + token2.suffix; 52847 } 52848 continue; 52849 } 52850 if (typeof value === "string" || typeof value === "number") { 52851 var segment = encode2(String(value), token2); 52852 if (validate && !matches2[i2].test(segment)) { 52853 throw new TypeError('Expected "'.concat(token2.name, '" to match "').concat(token2.pattern, '", but got "').concat(segment, '"')); 52854 } 52855 path += token2.prefix + segment + token2.suffix; 52856 continue; 52857 } 52858 if (optional) 52859 continue; 52860 var typeOfMessage = repeat ? "an array" : "a string"; 52861 throw new TypeError('Expected "'.concat(token2.name, '" to be ').concat(typeOfMessage)); 52862 } 52863 return path; 52864 }; 52865 } 52866 function match(str, options2) { 52867 var keys2 = []; 52868 var re2 = pathToRegexp(str, keys2, options2); 52869 return regexpToFunction(re2, keys2, options2); 52870 } 52871 function regexpToFunction(re2, keys2, options2) { 52872 if (options2 === void 0) { 52873 options2 = {}; 52874 } 52875 var _a = options2.decode, decode2 = _a === void 0 ? function(x2) { 52876 return x2; 52877 } : _a; 52878 return function(pathname) { 52879 var m2 = re2.exec(pathname); 52880 if (!m2) 52881 return false;
vendor: 6,174 bytes, lines 52882-53030
52882 var path = m2[0], index2 = m2.index; 52883 var params = /* @__PURE__ */ Object.create(null); 52884 var _loop_1 = function(i3) { 52885 if (m2[i3] === void 0) 52886 return "continue"; 52887 var key = keys2[i3 - 1]; 52888 if (key.modifier === "*" || key.modifier === "+") { 52889 params[key.name] = m2[i3].split(key.prefix + key.suffix).map(function(value) { 52890 return decode2(value, key); 52891 }); 52892 } else { 52893 params[key.name] = decode2(m2[i3], key); 52894 } 52895 }; 52896 for (var i2 = 1; i2 < m2.length; i2++) { 52897 _loop_1(i2); 52898 } 52899 return { path, index: index2, params }; 52900 }; 52901 } 52902 function escapeString(str) { 52903 return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); 52904 } 52905 function flags(options2) { 52906 return options2 && options2.sensitive ? "" : "i"; 52907 } 52908 function regexpToRegexp(path, keys2) { 52909 if (!keys2) 52910 return path; 52911 var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g; 52912 var index2 = 0; 52913 var execResult = groupsRegex.exec(path.source); 52914 while (execResult) { 52915 keys2.push({ 52916 // Use parenthesized substring match if available, index otherwise 52917 name: execResult[1] || index2++, 52918 prefix: "", 52919 suffix: "", 52920 modifier: "", 52921 pattern: "" 52922 }); 52923 execResult = groupsRegex.exec(path.source); 52924 } 52925 return path; 52926 } 52927 function arrayToRegexp(paths, keys2, options2) { 52928 var parts = paths.map(function(path) { 52929 return pathToRegexp(path, keys2, options2).source; 52930 }); 52931 return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options2)); 52932 } 52933 function stringToRegexp(path, keys2, options2) { 52934 return tokensToRegexp(parse(path, options2), keys2, options2); 52935 } 52936 function tokensToRegexp(tokens, keys2, options2) { 52937 if (options2 === void 0) { 52938 options2 = {}; 52939 } 52940 var _a = options2.strict, strict2 = _a === void 0 ? false : _a, _b = options2.start, start = _b === void 0 ? true : _b, _c = options2.end, end = _c === void 0 ? true : _c, _d = options2.encode, encode2 = _d === void 0 ? function(x2) { 52941 return x2; 52942 } : _d, _e2 = options2.delimiter, delimiter2 = _e2 === void 0 ? "/#?" : _e2, _f = options2.endsWith, endsWith2 = _f === void 0 ? "" : _f; 52943 var endsWithRe = "[".concat(escapeString(endsWith2), "]|$"); 52944 var delimiterRe = "[".concat(escapeString(delimiter2), "]"); 52945 var route = start ? "^" : ""; 52946 for (var _i2 = 0, tokens_1 = tokens; _i2 < tokens_1.length; _i2++) { 52947 var token2 = tokens_1[_i2]; 52948 if (typeof token2 === "string") { 52949 route += escapeString(encode2(token2)); 52950 } else { 52951 var prefix2 = escapeString(encode2(token2.prefix)); 52952 var suffix = escapeString(encode2(token2.suffix)); 52953 if (token2.pattern) { 52954 if (keys2) 52955 keys2.push(token2); 52956 if (prefix2 || suffix) { 52957 if (token2.modifier === "+" || token2.modifier === "*") { 52958 var mod = token2.modifier === "*" ? "?" : ""; 52959 route += "(?:".concat(prefix2, "((?:").concat(token2.pattern, ")(?:").concat(suffix).concat(prefix2, "(?:").concat(token2.pattern, "))*)").concat(suffix, ")").concat(mod); 52960 } else { 52961 route += "(?:".concat(prefix2, "(").concat(token2.pattern, ")").concat(suffix, ")").concat(token2.modifier); 52962 } 52963 } else { 52964 if (token2.modifier === "+" || token2.modifier === "*") { 52965 throw new TypeError('Can not repeat "'.concat(token2.name, '" without a prefix and suffix')); 52966 } 52967 route += "(".concat(token2.pattern, ")").concat(token2.modifier); 52968 } 52969 } else { 52970 route += "(?:".concat(prefix2).concat(suffix, ")").concat(token2.modifier); 52971 } 52972 } 52973 } 52974 if (end) { 52975 if (!strict2) 52976 route += "".concat(delimiterRe, "?"); 52977 route += !options2.endsWith ? "$" : "(?=".concat(endsWithRe, ")"); 52978 } else { 52979 var endToken = tokens[tokens.length - 1]; 52980 var isEndDelimited = typeof endToken === "string" ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 : endToken === void 0; 52981 if (!strict2) { 52982 route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?"); 52983 } 52984 if (!isEndDelimited) { 52985 route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")"); 52986 } 52987 } 52988 return new RegExp(route, flags(options2)); 52989 } 52990 function pathToRegexp(path, keys2, options2) { 52991 if (path instanceof RegExp) 52992 return regexpToRegexp(path, keys2); 52993 if (Array.isArray(path)) 52994 return arrayToRegexp(path, keys2, options2); 52995 return stringToRegexp(path, keys2, options2); 52996 } 52997 const dist_es2015 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 52998 __proto__: null, 52999 compile, 53000 match, 53001 parse, 53002 pathToRegexp, 53003 regexpToFunction, 53004 tokensToFunction, 53005 tokensToRegexp 53006 }, Symbol.toStringTag, { value: "Module" })); 53007 const require$$0 = /* @__PURE__ */ getAugmentedNamespace(dist_es2015); 53008 var hasRequiredDist; 53009 function requireDist() { 53010 if (hasRequiredDist) return dist; 53011 hasRequiredDist = 1; 53012 Object.defineProperty(dist, "__esModule", { value: true }); 53013 var pathToRegexp2 = require$$0; 53014 var include = function include2(base, routes2) { 53015 var mappedRoutes = { 53016 toString: function toString2() { 53017 return base; 53018 } 53019 }; 53020 Object.keys(routes2).forEach(function(route) { 53021 var url = routes2[route]; 53022 if (typeof url === "function" && route === "toString") { 53023 mappedRoutes.toString = function() { 53024 return base + routes2.toString(); 53025 }; 53026 } else if (typeof url === "object") { 53027 mappedRoutes[route] = include2(base, url); 53028 } else if (typeof url === "string") { 53029 mappedRoutes[route] = url.indexOf("/") === 0 ? url : [base, url].join("/").replace("//", "/"); 53030 } else {
53031 throw new TypeError('"' + route + '" is not valid. A routes object can only contain a string, an object or the "toString" method as values.'); 53032 } 53033 }); 53034 return mappedRoutes; 53035 }; 53036 function compileWithParams(pattern, params) { 53037 var reversed = pathToRegexp2.compile(pattern); 53038 return reversed(params); 53039 } 53040 var reverse = function reverse2(pattern, params) { 53041 if (params === void 0) { 53042 params = {}; 53043 } 53044 try { 53045 return compileWithParams(pattern, params); 53046 } catch (err) { 53047 return pattern; 53048 } 53049 }; 53050 var reverseForce = function reverseForce2(pattern, params) { 53051 if (params === void 0) { 53052 params = {}; 53053 } 53054 try { 53055 return compileWithParams(pattern, params); 53056 } catch (err) { 53057 var tokens = pathToRegexp2.parse(pattern); 53058 return tokens.filter(function(token2) { 53059 return typeof token2 === "string"; 53060 }).join(""); 53061 } 53062 }; 53063 dist.include = include; 53064 dist.reverse = reverse; 53065 dist.reverseForce = reverseForce; 53066 return dist; 53067 } 53068 requireDist(); 53069 const routes = { 53070 contact: { 53071 self: "/contact", 53072 orderPlaced: { 53073 self: "/contact/order-placed", 53074 variants: "/contact/order-placed/variants", 53075 details: "/contact/order-placed/details", 53076 somethingElse: "/contact/order-placed/something-else" 53077 }, 53078 somethingElse: "/contact/something-else", 53079 success: "/contact/success", 53080 logout: "/contact/logout" 53081 } 53082 }; 53083 const getScreenId = (pathname) => { 53084 if (pathname === routes.contact.orderPlaced.details) { 53085 return "ORDER_ITEMS_FORM"; 53086 } 53087 if (pathname === routes.contact.orderPlaced.somethingElse) { 53088 return "ORDER_OTHER"; 53089 } 53090 if (pathname === routes.contact.orderPlaced.variants) { 53091 return "ORDER_ITEMS_SELECTION"; 53092 } 53093 if (pathname === routes.contact.orderPlaced.self) { 53094 return "START_ORDER"; 53095 } 53096 if (pathname === routes.contact.somethingElse) { 53097 return "START_OTHER"; 53098 } 53099 if (pathname === routes.contact.success) { 53100 return "SUCCESS"; 53101 } 53102 return null; 53103 }; 53104 const GTM_MASTER_PROD_ID = "GTM-PV2BBNN"; 53105 const GTM_MASTER_STG_ID = "GTM-W8XP9DK"; 53106 const AnalyticsContext = reactExports.createContext(null); 53107 const AnalyticsProvider = ({ children }) => { 53108 const { pathname } = useLocation(); 53109 const { platformSettingsQuery } = usePlatformSettingsQuery(); 53110 const isPlatformSettingsSettled = platformSettingsQuery.isSuccess || platformSettingsQuery.isError; 53111 const isTagManagerInitializedRef = reactExports.useRef(false); 53112 reactExports.useEffect(() => { 53113 const env = getCurrentEnvironment(); 53114 if (env === "development" || !isPlatformSettingsSettled) return; 53115 if (isTagManagerInitializedRef.current) return; 53116 isTagManagerInitializedRef.current = true; 53117 Object.assign(window, getCreatorAnalyticsGlobals(platformSettingsQuery.data)); 53118 TagManager.initialize({ gtmId: env === "production" ? GTM_MASTER_PROD_ID : GTM_MASTER_STG_ID }); 53119 }, [isPlatformSettingsSettled, platformSettingsQuery.data]); 53120 const screenId = getScreenId(pathname); 53121 const value = reactExports.useMemo( 53122 () => ({ 53123 trackEvent: (eventName, params) => { 53124 if (getCurrentEnvironment() === "development") return; 53125 TagManager.dataLayer({ 53126 dataLayer: __spreadValues({ 53127 event: eventName 53128 }, params) 53129 }); 53130 }, 53131 screenId 53132 }), 53133 [screenId] 53134 ); 53135 return /* @__PURE__ */ jsxRuntimeExports.jsx(AnalyticsContext.Provider, { value, children }); 53136 }; 53137 const useAnalytics = () => { 53138 const context = reactExports.useContext(AnalyticsContext); 53139 if (!context) { 53140 throw new Error("useAnalytics must be used within an AnalyticsProvider"); 53141 } 53142 return context; 53143 }; 53144 const OrderAuthContext = reactExports.createContext({ 53145 isAuthorized: false, 53146 login: () => { 53147 }, 53148 logout: () => { 53149 } 53150 }); 53151 const LOCAL_STORAGE_KEY = "fourthwall.com:contact-login"; 53152 const OrderAuthProvider = ({ children }) => { 53153 const [searchParams, setSearchParams] = useSearchParams(); 53154 const [credentials, setCredentials] = reactExports.useState(null); 53155 const { localStorage: localStorage2 } = H$3(LOCAL_STORAGE_KEY); 53156 const readCredentials = () => { 53157 const email = localStorage2.get("email"); 53158 const friendlyId = localStorage2.get("friendlyId"); 53159 if (email && friendlyId) { 53160 setCredentials({ email, friendlyId }); 53161 } 53162 }; 53163 const login = reactExports.useCallback( 53164 (orderAuthCredentials) => { 53165 localStorage2.set("email", orderAuthCredentials.email); 53166 localStorage2.set("friendlyId", orderAuthCredentials.friendlyId); 53167 setCredentials(orderAuthCredentials); 53168 }, 53169 [localStorage2] 53170 ); 53171 const logout = reactExports.useCallback(() => { 53172 localStorage2.clear(); 53173 setCredentials(null); 53174 }, [localStorage2]); 53175 reactExports.useEffect(() => { 53176 const email = searchParams.get("email"); 53177 const friendlyId = searchParams.get("friendlyId"); 53178 if (email && friendlyId) { 53179 login({ email, friendlyId }); 53180 searchParams.delete("email"); 53181 searchParams.delete("friendlyId"); 53182 setSearchParams(searchParams); 53183 } else { 53184 readCredentials(); 53185 } 53186 }, []); 53187 const value = reactExports.useMemo( 53188 () => ({ 53189 isAuthorized: !!(credentials == null ? void 0 : credentials.email) && !!(credentials == null ? void 0 : credentials.friendlyId), 53190 email: credentials == null ? void 0 : credentials.email, 53191 friendlyId: credentials == null ? void 0 : credentials.friendlyId, 53192 login, 53193 logout 53194 }), 53195 [credentials, login, logout] 53196 ); 53197 return /* @__PURE__ */ jsxRuntimeExports.jsx(OrderAuthContext.Provider, { value, children }); 53198 }; 53199 const useOrderAuth = () => { 53200 return reactExports.useContext(OrderAuthContext); 53201 }; 53202 class CXContactApiClientModel extends ApiBase { 53203 constructor() { 53204 super(...arguments); 53205 __publicField(this, "getOrderData", (payload) => { 53206 return this.post("/cx-contact/order-data", payload); 53207 }); 53208 __publicField(this, "getShopContext", () => { 53209 return this.get("/cx-contact/shop-context"); 53210 }); 53211 __publicField(this, "getTopicTree", (params) => { 53212 return this.get("/cx-contact/topics/tree", params); 53213 }); 53214 __publicField(this, "createReport", (payload) => { 53215 return this.post("/cx-contact/reports", payload); 53216 }); 53217 __publicField(this, "uploadAttachment", (file) => __async(this, null, function* () { 53218 const fileType = file.type || "application/octet-stream"; 53219 const response = yield this.post(`/cx-contact/attachments/upload`, { 53220 fileName: encodeURI(file.name), 53221 contentType: fileType, 53222 size: file.size 53223 }); 53224 const { uploadUrl } = response.data; 53225 yield axios.put(uploadUrl, file, { 53226 headers: { 53227 "Content-Disposition": `attachment; filename="${encodeURI(file.name)}"`, 53228 "Content-Type": fileType, 53229 "x-goog-content-length-range": `0,${file.size}` 53230 } 53231 }); 53232 return response; 53233 })); 53234 } 53235 } 53236 const CXContactApiClient = new CXContactApiClientModel("/api"); 53237 const useGetOrderDataMutation = R$2(CXContactApiClient.getOrderData, { 53238 mutationKey: ["getOrderData"] 53239 }); 53240 const formatVariant = (variant) => __spreadProps(__spreadValues({}, variant), { 53241 name: fe$2(variant.name), 53242 description: variant.description ? fe$2(variant.description) : void 0 53243 }); 53244 const getIndividualGiftCardVariants = (giftCardVariants) => giftCardVariants.flatMap( 53245 (variant) => Array.from({ length: variant.quantity }, (_2, index2) => __spreadProps(__spreadValues({}, formatVariant(variant)), { 53246 quantity: 1, 53247 id: index2 > 0 ? `${variant.id}_${index2}` : variant.id, 53248 giftCardIds: variant.giftCardIds[index2] ? [variant.giftCardIds[index2]] : variant.giftCardIds 53249 })) 53250 ); 53251 const formatOrderData = (orderData) => __spreadProps(__spreadValues({}, orderData), { 53252 commonOrder: orderData.commonOrder ? __spreadProps(__spreadValues({}, orderData.commonOrder), {
53253 shipments: orderData.commonOrder.shipments.map((shipment) => __spreadProps(__spreadValues({}, shipment), { 53254 variants: shipment.variants.map(formatVariant) 53255 })), 53256 digitalVariants: orderData.commonOrder.digitalVariants.map(formatVariant), 53257 giftCardVariants: getIndividualGiftCardVariants(orderData.commonOrder.giftCardVariants) 53258 }) : void 0 53259 }); 53260 const sanitizeEmail = (email) => { 53261 return email.trim(); 53262 }; 53263 const sanitizeFriendlyId = (friendlyId) => { 53264 const trimmedFriendlyId = friendlyId.trim(); 53265 return trimmedFriendlyId.startsWith("#") ? trimmedFriendlyId.slice(1) : trimmedFriendlyId; 53266 }; 53267 const OrderDataContext = reactExports.createContext({ 53268 orderData: void 0, 53269 isLoading: false, 53270 selectedVariants: [], 53271 selectedVariantIds: [], 53272 selectedVariantsData: [], 53273 fetchOrderData: () => __async(null, null, function* () { 53274 }), 53275 handleVariantSelectionChange: () => { 53276 } 53277 }); 53278 const OrderDataProvider = ({ children }) => { 53279 const { getOrderDataMutation } = useGetOrderDataMutation({ 53280 onError: void 0 53281 }); 53282 const [orderData, setOrderData] = reactExports.useState(); 53283 const [selectedVariants, setSelectedVariants] = reactExports.useState([]); 53284 const fetchOrderData = reactExports.useCallback( 53285 (_0) => __async(null, [_0], function* ({ email, friendlyId }) { 53286 const data = yield getOrderDataMutation.mutateAsync([ 53287 { supporterEmail: sanitizeEmail(email), friendlyId: sanitizeFriendlyId(friendlyId) } 53288 ]); 53289 setOrderData(formatOrderData(data)); 53290 }), 53291 [getOrderDataMutation] 53292 ); 53293 reactExports.useEffect(() => { 53294 var _a, _b; 53295 if (!(orderData == null ? void 0 : orderData.commonOrder)) return; 53296 const shipmentVariants = orderData.commonOrder.shipments.flatMap( 53297 (shipment) => shipment.variants.map((variant) => ({ shipmentId: shipment.id, variantId: variant.id })) 53298 ); 53299 const digitalVariants = ((_a = orderData.commonOrder.digitalVariants) != null ? _a : []).map((variant) => ({ 53300 shipmentId: "digital_items", 53301 variantId: variant.id 53302 })); 53303 const giftCardVariants = ((_b = orderData.commonOrder.giftCardVariants) != null ? _b : []).map((variant) => ({ 53304 shipmentId: "gift_cards", 53305 variantId: variant.id 53306 })); 53307 const allVariants2 = [...shipmentVariants, ...digitalVariants, ...giftCardVariants]; 53308 if (allVariants2.length === 1) { 53309 setSelectedVariants(allVariants2); 53310 } 53311 }, [orderData]); 53312 const handleVariantSelectionChange = reactExports.useCallback( 53313 (shipmentId, variantId, isSelected) => { 53314 setSelectedVariants((prev2) => { 53315 if (isSelected) { 53316 return [...prev2, { shipmentId, variantId }]; 53317 } 53318 return prev2.filter((item) => item.shipmentId !== shipmentId || item.variantId !== variantId); 53319 }); 53320 }, 53321 [] 53322 ); 53323 const allVariants = reactExports.useMemo( 53324 () => { 53325 var _a, _b, _c; 53326 return [ 53327 ...((_a = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a.shipments.flatMap((shipment) =>
53327 shipment.variants)) || [], 53328 ...((_b = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _b.digitalVariants) || [], 53329 ...((_c = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _c.giftCardVariants) || [] 53330 ]; 53331 }, 53332 [orderData] 53333 ); 53334 const selectedVariantIds = reactExports.useMemo( 53335 () => [...new Set(selectedVariants.map(({ variantId }) => variantId))], 53336 [selectedVariants] 53337 ); 53338 const selectedVariantsData = reactExports.useMemo( 53339 () => selectedVariantIds.map((variantId) => allVariants == null ? void 0 : allVariants.find((variant) => variant.id === variantId)).filter((variant) => variant !== void 0), 53340 [selectedVariantIds, allVariants] 53341 ); 53342 const value = reactExports.useMemo( 53343 () => ({ 53344 orderData, 53345 isLoading: getOrderDataMutation.isLoading || !orderData, 53346 selectedVariants, 53347 selectedVariantIds, 53348 selectedVariantsData, 53349 fetchOrderData, 53350 handleVariantSelectionChange 53351 }), 53352 [ 53353 orderData, 53354 getOrderDataMutation.isLoading, 53355 selectedVariants, 53356 selectedVariantIds, 53357 selectedVariantsData, 53358 fetchOrderData, 53359 handleVariantSelectionChange 53360 ] 53361 ); 53362 return /* @__PURE__ */ jsxRuntimeExports.jsx(OrderDataContext.Provider, { value, children }); 53363 }; 53364 const useOrderData = () => { 53365 return reactExports.useContext(OrderDataContext); 53366 }; 53367 const useScreenTracking = ({ shopId }) => { 53368 const { trackEvent, screenId } = useAnalytics(); 53369 const { isAuthorized } = useOrderAuth(); 53370 const { orderData } = useOrderData(); 53371 const trackedScreenIdRef = reactExports.useRef(null); 53372 reactExports.useEffect(() => { 53373 if (!shopId) return; 53374 if (isAuthorized && !orderData) return; 53375 if (!screenId) return; 53376 if (trackedScreenIdRef.current === screenId) return; 53377 trackedScreenIdRef.current = screenId; 53378 trackEvent("cf_screen_viewed", { 53379 screen_id: screenId, 53380 shop_id: shopId, 53381 order_id: orderData == null ? void 0 : orderData.id 53382 }); 53383 }, [screenId, shopId, isAuthorized, orderData, trackEvent]); 53384 }; 53385 const useShopContextQuery = C$3(CXContactApiClient.getShopContext, { 53386 queryKey: ["shopContext"], 53387 select: (data) => __spreadProps(__spreadValues({}, data), { 53388 shopName: fe$2(data.shopName) 53389 }) 53390 }); 53391 const Contact = () => { 53392 var _a, _b, _c, _d, _e2, _f, _g, _h; 53393 const { pathname } = useLocation(); 53394 const { shopContextQuery } = useShopContextQuery(); 53395 useScreenTracking({ shopId: (_a = shopContextQuery.data) == null ? void 0 : _a.shopId }); 53396 const shopName = ((_b = shopContextQuery.data) == null ? void 0 : _b.shopName) || ""; 53397 if (shopContextQuery.isInitialLoading) { 53398 return /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderSuspenseFallback, {}); 53399 } 53400 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53401 /* @__PURE__ */ jsxRuntimeExports.jsx( 53402 ContactHead, 53403 { 53404 shopName, 53405 contactEmail: (_c = shopContextQuery.data) == null ? void 0 : _c.contactEmail, 53406 logoUrl: (_d = shopContextQuery.data) == null ? void 0 : _d.logoUrl, 53407 externalStoreUrl: (_e2 = shopContextQuery.data) == null ? void 0 : _e2.externalStoreUrl 53408 } 53409 ), 53410 /* @__PURE__ */ jsxRuntimeExports.jsx(E$2, { shopId: (_f = shopContextQuery.data) == null ? void 0 : _f.shopId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AutoFocusableContainer, { id: pathname, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 53411 Layout, 53412 { 53413 logoName: shopName, 53414 logoUrl: (_g = shopContextQuery.data) == null ? void 0 : _g.logoUrl, 53415 externalStoreUrl: (_h = shopContextQuery.data) == null ? void 0 : _h.externalStoreUrl, 53416 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}) 53417 } 53418 ) }) }) 53419 ] }); 53420 }; 53421 const Logout = () => { 53422 const { logout } = useOrderAuth(); 53423 const navigate = useNavigate(); 53424 reactExports.useEffect(() => { 53425 logout(); 53426 navigate(routes.contact.self, { replace: true }); 53427 }, [logout, navigate]); 53428 return null; 53429 }; 53430 /*! 53431 * paypal-js v9.7.0 (2026-04-27T17:34:27.064Z) 53432 * Copyright 2020-present, PayPal, Inc. All rights reserved. 53433 * 53434 * Licensed under the Apache License, Version 2.0 (the "License"); 53435 * you may not use this file except in compliance with the License. 53436 * You may obtain a copy of the License at 53437 * 53438 * http://www.apache.org/licenses/LICENSE-2.0 53439 * 53440 * Unless required by applicable law or agreed to in writing, software 53441 * distributed under the License is distributed on an "AS IS" BASIS, 53442 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 53443 * See the License for the specific language governing permissions and 53444 * limitations under the License. 53445 */ 53446 typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { 53447 var e2 = new Error(message); 53448 return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2; 53449 }; 53450 var Am = ["US", "GB", "CA", "AU", "DE"]; 53451 function Rr$1(a2, e2) { 53452 for (var r2 = -1, t2 = e2.length, n2 = a2.length; ++r2 < t2; ) a2[n2 + r2] = e2[r2]; 53453 return a2; 53454 } 53455 var na$1 = Rr$1; 53456 var Dr$1 = typeof global == "object" && global && global.Object === Object && global, oa = Dr$1; 53457 var Hr$2 = typeof self == "object" && self && self.Object === Object && self, Ur$1 = oa || Hr$2 || Function("return this")(), f$1 = Ur$1; 53458 var jr$1 = f$1.Symbol, v$1 = jr$1; 53459 var Oa = Object.prototype, zr$1 = Oa.hasOwnProperty, Vr$2 = Oa.toString, X = v$1 ? v$1.toStringTag : void 0; 53460 function Wr$1(a2) { 53461 var e2 = zr$1.call(a2, X), r2 = a2[X]; 53462 try { 53463 a2[X] = void 0; 53464 var t2 = true; 53465 } catch (e3) { 53466 } 53467 var n2 = Vr$2.call(a2); 53468 return t2 && (e2 ? a2[X] = r2 : delete a2[X]), n2; 53469 } 53470 var Ia = Wr$1; 53471 var Yr$1 = Object.prototype, Jr$1 = Yr$1.toString; 53472 function qr$1(a2) { 53473 return Jr$1.call(a2); 53474 } 53475 var Ba = qr$1; 53476 var Zr$1 = "[object Null]", Qr$1 = "[object Undefined]", La = v$1 ? v$1.toStringTag : void 0; 53477 function $r$1(a2) { 53478 return a2 == null ? a2 === void 0 ? Qr$1 : Zr$1 : La && La in Object(a2) ? Ia(a2) : Ba(a2); 53479 } 53480 var A$1 = $r$1; 53481 function Xr$1(a2) { 53482 return a2 != null && typeof a2 == "object"; 53483 } 53484 var M$2 = Xr$1; 53485 var at = "[object Arguments]"; 53486 function et(a2) { 53487 return M$2(a2) && A$1(a2) == at; 53488 } 53489 var Sa = et; 53490 var Ka = Object.prototype, rt = Ka.hasOwnProperty, tt = Ka.propertyIsEnumerable, it = Sa(/* @__PURE__ */ (function() { 53491 return arguments; 53492 })()) ? Sa : function(a2) { 53493 return M$2(a2) && rt.call(a2, "callee") && !tt.call(a2, "callee"); 53494 }, R$1 = it; 53495 var nt = Array.isArray, u$1 = nt; 53496 var Ra = v$1 ? v$1.isConcatSpreadable : void 0; 53497 function ot(a2) { 53498 return u$1(a2) || R$1(a2) || !!(Ra && a2 && a2[Ra]); 53499 } 53500 var Da = ot; 53501 function Ha(a2, e2, r2, t2, n2) { 53502 var i2 = -1, o2 = a2.length; 53503 for (r2 || (r2 = Da), n2 || (n2 = []); ++i2 < o2; ) { 53504 var m2 = a2[i2]; 53505 e2 > 0 && r2(m2) ? e2 > 1 ? Ha(m2, e2 - 1, r2, t2, n2) : na$1(n2, m2) : t2 || (n2[n2.length] = m2); 53506 } 53507 return n2; 53508 } 53509 var Ua = Ha; 53510 function mt$1(a2, e2) { 53511 for (var r2 = -1, t2 = a2 == null ? 0 : a2.length, n2 = Array(t2); ++r2 < t2; ) n2[r2] = e2(a2[r2], r2, a2); 53512 return n2; 53513 } 53514 var D$2 = mt$1; 53515 var lt$1 = "[object Symbol]"; 53516 function st(a2) { 53517 return typeof a2 == "symbol" || M$2(a2) && A$1(a2) == lt$1; 53518 } 53519 var y$1 = st; 53520 var bt$1 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ut = /^\w*$/; 53521 function pt$1(a2, e2) { 53522 if (u$1(a2)) return false;
53523 var r2 = typeof a2; 53524 return r2 == "number" || r2 == "symbol" || r2 == "boolean" || a2 == null || y$1(a2) ? true : ut.test(a2) || !bt$1.test(a2) || e2 != null && a2 in Object(e2); 53525 } 53526 var H$1 = pt$1; 53527 function ft$1(a2) { 53528 var e2 = typeof a2; 53529 return a2 != null && (e2 == "object" || e2 == "function"); 53530 } 53531 var N$1 = ft$1; 53532 var Tt$1 = "[object AsyncFunction]", vt = "[object Function]", ct = "[object GeneratorFunction]", dt$1 = "[object Proxy]"; 53533 function ht$2(a2) { 53534 if (!N$1(a2)) return false; 53535 var e2 = A$1(a2); 53536 return e2 == vt || e2 == ct || e2 == Tt$1 || e2 == dt$1; 53537 } 53538 var ma = ht$2; 53539 var gt$1 = f$1["__core-js_shared__"], la$1 = gt$1; 53540 var ja = (function() { 53541 var a2 = /[^.]+$/.exec(la$1 && la$1.keys && la$1.keys.IE_PROTO || ""); 53542 return a2 ? "Symbol(src)_1." + a2 : ""; 53543 })(); 53544 function At$1(a2) { 53545 return !!ja && ja in a2; 53546 } 53547 var za = At$1; 53548 var Mt$1 = Function.prototype, St$1 = Mt$1.toString; 53549 function yt$1(a2) { 53550 if (a2 != null) { 53551 try { 53552 return St$1.call(a2); 53553 } catch (e2) { 53554 } 53555 try { 53556 return a2 + ""; 53557 } catch (e2) { 53558 } 53559 } 53560 return ""; 53561 } 53562 var C$2 = yt$1; 53563 var Ct$1 = /[\\^$.*+?()[\]{}|]/g, wt$1 = /^\[object .+?Constructor\]$/, Et$1 = Function.prototype, Nt$1 = Object.prototype, Gt$1 = Et$1.toString, Pt$1 = Nt$1.hasOwnProperty, xt$1 = RegExp("^" + Gt$1.call(Pt$1).replace(Ct$1, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); 53564 function kt$1(a2) { 53565 if (!N$1(a2) || za(a2)) return false; 53566 var e2 = ma(a2) ? xt$1 : wt$1; 53567 return e2.test(C$2(a2)); 53568 }
vendor: 8,032 bytes, lines 53569-53830
53569 var Va = kt$1; 53570 function Ft$1(a2, e2) { 53571 return a2 == null ? void 0 : a2[e2]; 53572 } 53573 var Wa = Ft$1; 53574 function _t$1(a2, e2) { 53575 var r2 = Wa(a2, e2); 53576 return Va(r2) ? r2 : void 0; 53577 } 53578 var c = _t$1; 53579 var Ot$1 = c(Object, "create"), w$2 = Ot$1; 53580 function It$1() { 53581 this.__data__ = w$2 ? w$2(null) : {}, this.size = 0; 53582 } 53583 var Ya = It$1; 53584 function Bt$1(a2) { 53585 var e2 = this.has(a2) && delete this.__data__[a2]; 53586 return this.size -= e2 ? 1 : 0, e2; 53587 } 53588 var Ja = Bt$1; 53589 var Lt$1 = "__lodash_hash_undefined__", Kt$1 = Object.prototype, Rt$1 = Kt$1.hasOwnProperty; 53590 function Dt$1(a2) { 53591 var e2 = this.__data__; 53592 if (w$2) { 53593 var r2 = e2[a2]; 53594 return r2 === Lt$1 ? void 0 : r2; 53595 } 53596 return Rt$1.call(e2, a2) ? e2[a2] : void 0; 53597 } 53598 var qa = Dt$1; 53599 var Ht$1 = Object.prototype, Ut$1 = Ht$1.hasOwnProperty; 53600 function jt$2(a2) { 53601 var e2 = this.__data__; 53602 return w$2 ? e2[a2] !== void 0 : Ut$1.call(e2, a2); 53603 } 53604 var Za = jt$2; 53605 var zt$1 = "__lodash_hash_undefined__"; 53606 function Vt$1(a2, e2) { 53607 var r2 = this.__data__; 53608 return this.size += this.has(a2) ? 0 : 1, r2[a2] = w$2 && e2 === void 0 ? zt$1 : e2, this; 53609 } 53610 var Qa = Vt$1; 53611 function U$1(a2) { 53612 var e2 = -1, r2 = a2 == null ? 0 : a2.length; 53613 for (this.clear(); ++e2 < r2; ) { 53614 var t2 = a2[e2]; 53615 this.set(t2[0], t2[1]); 53616 } 53617 } 53618 U$1.prototype.clear = Ya; 53619 U$1.prototype.delete = Ja; 53620 U$1.prototype.get = qa; 53621 U$1.prototype.has = Za; 53622 U$1.prototype.set = Qa; 53623 var ya = U$1; 53624 function Wt$2() { 53625 this.__data__ = [], this.size = 0; 53626 } 53627 var $a = Wt$2; 53628 function Yt$2(a2, e2) { 53629 return a2 === e2 || a2 !== a2 && e2 !== e2; 53630 } 53631 var j$1 = Yt$2; 53632 function Jt$1(a2, e2) { 53633 for (var r2 = a2.length; r2--; ) if (j$1(a2[r2][0], e2)) return r2; 53634 return -1; 53635 } 53636 var G$1 = Jt$1; 53637 var qt$1 = Array.prototype, Zt$1 = qt$1.splice; 53638 function Qt$2(a2) { 53639 var e2 = this.__data__, r2 = G$1(e2, a2); 53640 if (r2 < 0) return false; 53641 var t2 = e2.length - 1; 53642 return r2 == t2 ? e2.pop() : Zt$1.call(e2, r2, 1), --this.size, true; 53643 } 53644 var Xa = Qt$2; 53645 function $t$1(a2) { 53646 var e2 = this.__data__, r2 = G$1(e2, a2); 53647 return r2 < 0 ? void 0 : e2[r2][1]; 53648 } 53649 var ae = $t$1; 53650 function Xt$1(a2) { 53651 return G$1(this.__data__, a2) > -1; 53652 } 53653 var ee = Xt$1; 53654 function ai$1(a2, e2) { 53655 var r2 = this.__data__, t2 = G$1(r2, a2); 53656 return t2 < 0 ? (++this.size, r2.push([a2, e2])) : r2[t2][1] = e2, this; 53657 } 53658 var re = ai$1; 53659 function z$1(a2) { 53660 var e2 = -1, r2 = a2 == null ? 0 : a2.length; 53661 for (this.clear(); ++e2 < r2; ) { 53662 var t2 = a2[e2]; 53663 this.set(t2[0], t2[1]); 53664 } 53665 } 53666 z$1.prototype.clear = $a; 53667 z$1.prototype.delete = Xa; 53668 z$1.prototype.get = ae; 53669 z$1.prototype.has = ee; 53670 z$1.prototype.set = re; 53671 var P$1 = z$1; 53672 var ei$1 = c(f$1, "Map"), x$1 = ei$1; 53673 function ri$1() { 53674 this.size = 0, this.__data__ = { hash: new ya(), map: new (x$1 || P$1)(), string: new ya() }; 53675 } 53676 var te = ri$1; 53677 function ti$1(a2) { 53678 var e2 = typeof a2; 53679 return e2 == "string" || e2 == "number" || e2 == "symbol" || e2 == "boolean" ? a2 !== "__proto__" : a2 === null; 53680 } 53681 var ie = ti$1; 53682 function ii$1(a2, e2) { 53683 var r2 = a2.__data__; 53684 return ie(e2) ? r2[typeof e2 == "string" ? "string" : "hash"] : r2.map; 53685 } 53686 var k$2 = ii$1; 53687 function ni$1(a2) { 53688 var e2 = k$2(this, a2).delete(a2); 53689 return this.size -= e2 ? 1 : 0, e2; 53690 } 53691 var ne = ni$1; 53692 function oi$1(a2) { 53693 return k$2(this, a2).get(a2); 53694 } 53695 var oe = oi$1; 53696 function mi$1(a2) { 53697 return k$2(this, a2).has(a2); 53698 } 53699 var me$1 = mi$1; 53700 function li$1(a2, e2) { 53701 var r2 = k$2(this, a2), t2 = r2.size; 53702 return r2.set(a2, e2), this.size += r2.size == t2 ? 0 : 1, this; 53703 } 53704 var le = li$1; 53705 function V$1(a2) { 53706 var e2 = -1, r2 = a2 == null ? 0 : a2.length; 53707 for (this.clear(); ++e2 < r2; ) { 53708 var t2 = a2[e2]; 53709 this.set(t2[0], t2[1]); 53710 } 53711 } 53712 V$1.prototype.clear = te; 53713 V$1.prototype.delete = ne; 53714 V$1.prototype.get = oe; 53715 V$1.prototype.has = me$1; 53716 V$1.prototype.set = le; 53717 var L$2 = V$1; 53718 var si = "Expected a function"; 53719 function Ca(a2, e2) { 53720 if (typeof a2 != "function" || e2 != null && typeof e2 != "function") throw new TypeError(si); 53721 var r2 = function() { 53722 var t2 = arguments, n2 = e2 ? e2.apply(this, t2) : t2[0], i2 = r2.cache; 53723 if (i2.has(n2)) return i2.get(n2); 53724 var o2 = a2.apply(this, t2); 53725 return r2.cache = i2.set(n2, o2) || i2, o2; 53726 }; 53727 return r2.cache = new (Ca.Cache || L$2)(), r2; 53728 } 53729 Ca.Cache = L$2; 53730 var se = Ca; 53731 var bi = 500; 53732 function ui$1(a2) { 53733 var e2 = se(a2, function(t2) { 53734 return r2.size === bi && r2.clear(), t2; 53735 }), r2 = e2.cache; 53736 return e2; 53737 } 53738 var be$1 = ui$1; 53739 var pi$1 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, fi = /\\(\\)?/g, Ti = be$1(function(a2) { 53740 var e2 = []; 53741 return a2.charCodeAt(0) === 46 && e2.push(""), a2.replace(pi$1, function(r2, t2, n2, i2) { 53742 e2.push(n2 ? i2.replace(fi, "$1") : t2 || r2); 53743 }), e2; 53744 }), ue = Ti; 53745 var pe$1 = v$1 ? v$1.prototype : void 0, fe$1 = pe$1 ? pe$1.toString : void 0; 53746 function Te$1(a2) { 53747 if (typeof a2 == "string") return a2; 53748 if (u$1(a2)) return D$2(a2, Te$1) + ""; 53749 if (y$1(a2)) return fe$1 ? fe$1.call(a2) : ""; 53750 var e2 = a2 + ""; 53751 return e2 == "0" && 1 / a2 == -Infinity ? "-0" : e2; 53752 } 53753 var ve$1 = Te$1; 53754 function ci$1(a2) { 53755 return a2 == null ? "" : ve$1(a2); 53756 } 53757 var ce = ci$1; 53758 function di(a2, e2) { 53759 return u$1(a2) ? a2 : H$1(a2, e2) ? [a2] : ue(ce(a2)); 53760 } 53761 var sa = di; 53762 function gi(a2) { 53763 if (typeof a2 == "string" || y$1(a2)) return a2; 53764 var e2 = a2 + ""; 53765 return e2 == "0" && 1 / a2 == -Infinity ? "-0" : e2; 53766 } 53767 var F$1 = gi; 53768 function Ai(a2, e2) { 53769 e2 = sa(e2, a2); 53770 for (var r2 = 0, t2 = e2.length; a2 != null && r2 < t2; ) a2 = a2[F$1(e2[r2++])]; 53771 return r2 && r2 == t2 ? a2 : void 0; 53772 } 53773 var W = Ai; 53774 function Mi() { 53775 this.__data__ = new P$1(), this.size = 0; 53776 } 53777 var de$1 = Mi; 53778 function Si(a2) { 53779 var e2 = this.__data__, r2 = e2.delete(a2); 53780 return this.size = e2.size, r2; 53781 } 53782 var he$1 = Si; 53783 function yi$1(a2) { 53784 return this.__data__.get(a2); 53785 } 53786 var ge$1 = yi$1; 53787 function Ci(a2) { 53788 return this.__data__.has(a2); 53789 } 53790 var Ae$1 = Ci; 53791 var wi = 200; 53792 function Ei(a2, e2) { 53793 var r2 = this.__data__; 53794 if (r2 instanceof P$1) { 53795 var t2 = r2.__data__; 53796 if (!x$1 || t2.length < wi - 1) return t2.push([a2, e2]), this.size = ++r2.size, this; 53797 r2 = this.__data__ = new L$2(t2); 53798 } 53799 return r2.set(a2, e2), this.size = r2.size, this; 53800 } 53801 var Me$1 = Ei; 53802 function Y$1(a2) { 53803 var e2 = this.__data__ = new P$1(a2); 53804 this.size = e2.size; 53805 } 53806 Y$1.prototype.clear = de$1; 53807 Y$1.prototype.delete = he$1; 53808 Y$1.prototype.get = ge$1; 53809 Y$1.prototype.has = Ae$1; 53810 Y$1.prototype.set = Me$1; 53811 var J$1 = Y$1; 53812 var Ni = "__lodash_hash_undefined__"; 53813 function Gi(a2) { 53814 return this.__data__.set(a2, Ni), this; 53815 } 53816 var Se$1 = Gi; 53817 function Pi(a2) { 53818 return this.__data__.has(a2); 53819 } 53820 var ye$1 = Pi; 53821 function ba(a2) { 53822 var e2 = -1, r2 = a2 == null ? 0 : a2.length; 53823 for (this.__data__ = new L$2(); ++e2 < r2; ) this.add(a2[e2]); 53824 } 53825 ba.prototype.add = ba.prototype.push = Se$1; 53826 ba.prototype.has = ye$1; 53827 var Ce$1 = ba; 53828 function xi(a2, e2) { 53829 for (var r2 = -1, t2 = a2 == null ? 0 : a2.length; ++r2 < t2; ) if (e2(a2[r2], r2, a2)) return true; 53830 return false;
53831 } 53832 var we$1 = xi; 53833 function ki(a2, e2) { 53834 return a2.has(e2); 53835 } 53836 var Ee$1 = ki; 53837 var Fi = 1, _i$1 = 2; 53838 function Oi(a2, e2, r2, t2, n2, i2) { 53839 var o2 = r2 & Fi, m2 = a2.length, s2 = e2.length; 53840 if (m2 != s2 && !(o2 && s2 > m2)) return false; 53841 var l2 = i2.get(a2), d2 = i2.get(e2); 53842 if (l2 && d2) return l2 == e2 && d2 == a2; 53843 var T2 = -1, p2 = true, S2 = r2 & _i$1 ? new Ce$1() : void 0; 53844 for (i2.set(a2, e2), i2.set(e2, a2); ++T2 < m2; ) { 53845 var h2 = a2[T2], g2 = e2[T2]; 53846 if (t2) var E2 = o2 ? t2(g2, h2, T2, e2, a2, i2) : t2(h2, g2, T2, a2, e2, i2); 53847 if (E2 !== void 0) { 53848 if (E2) continue; 53849 p2 = false; 53850 break; 53851 } 53852 if (S2) { 53853 if (!we$1(e2, function(I2, B2) { 53854 if (!Ee$1(S2, B2) && (h2 === I2 || n2(h2, I2, r2, t2, i2))) return S2.push(B2); 53855 })) { 53856 p2 = false; 53857 break; 53858 } 53859 } else if (!(h2 === g2 || n2(h2, g2, r2, t2, i2))) { 53860 p2 = false; 53861 break; 53862 } 53863 } 53864 return i2.delete(a2), i2.delete(e2), p2; 53865 } 53866 var ua = Oi; 53867 var Ii = f$1.Uint8Array, wa = Ii; 53868 function Bi(a2) { 53869 var e2 = -1, r2 = Array(a2.size); 53870 return a2.forEach(function(t2, n2) { 53871 r2[++e2] = [n2, t2]; 53872 }), r2; 53873 } 53874 var Ne$1 = Bi; 53875 function Li(a2) { 53876 var e2 = -1, r2 = Array(a2.size); 53877 return a2.forEach(function(t2) { 53878 r2[++e2] = t2; 53879 }), r2; 53880 } 53881 var Ge$1 = Li; 53882 var Ki = 1, Ri = 2, Di = "[object Boolean]", Hi = "[object Date]", Ui = "[object Error]", ji = "[object Map]", zi = "[object Number]",
53882Vi = "[object RegExp]", Wi = "[object Set]", Yi = "[object String]", Ji = "[object Symbol]", qi$1 = "[object ArrayBuffer]", Zi = "[object DataView]", Pe$1 = v$1 ? v$1.prototype : void 0, Ea = Pe$1 ? Pe$1.valueOf : void 0; 53883 function Qi(a2, e2, r2, t2, n2, i2, o2) { 53884 switch (r2) { 53885 case Zi: 53886 if (a2.byteLength != e2.byteLength || a2.byteOffset != e2.byteOffset) return false; 53887 a2 = a2.buffer, e2 = e2.buffer; 53888 case qi$1: 53889 return !(a2.byteLength != e2.byteLength || !i2(new wa(a2), new wa(e2))); 53890 case Di: 53891 case Hi: 53892 case zi: 53893 return j$1(+a2, +e2); 53894 case Ui: 53895 return a2.name == e2.name && a2.message == e2.message; 53896 case Vi: 53897 case Yi: 53898 return a2 == e2 + ""; 53899 case ji: 53900 var m2 = Ne$1; 53901 case Wi: 53902 var s2 = t2 & Ki; 53903 if (m2 || (m2 = Ge$1), a2.size != e2.size && !s2) return false; 53904 var l2 = o2.get(a2); 53905 if (l2) return l2 == e2; 53906 t2 |= Ri, o2.set(a2, e2); 53907 var d2 = ua(m2(a2), m2(e2), t2, n2, i2, o2); 53908 return o2.delete(a2), d2; 53909 case Ji: 53910 if (Ea) return Ea.call(a2) == Ea.call(e2); 53911 } 53912 return false; 53913 } 53914 var xe$1 = Qi; 53915 function $i$1(a2, e2, r2) { 53916 var t2 = e2(a2); 53917 return u$1(a2) ? t2 : na$1(t2, r2(a2)); 53918 } 53919 var ke$1 = $i$1; 53920 function Xi$1(a2, e2) { 53921 for (var r2 = -1, t2 = a2 == null ? 0 : a2.length, n2 = 0, i2 = []; ++r2 < t2; ) { 53922 var o2 = a2[r2]; 53923 e2(o2, r2, a2) && (i2[n2++] = o2); 53924 } 53925 return i2; 53926 } 53927 var Fe$2 = Xi$1; 53928 function an() { 53929 return []; 53930 } 53931 var _e$1 = an; 53932 var en = Object.prototype, rn = en.propertyIsEnumerable, Oe$1 = Object.getOwnPropertySymbols, tn = Oe$1 ? function(a2) { 53933 return a2 == null ? [] : (a2 = Object(a2), Fe$2(Oe$1(a2), function(e2) { 53934 return rn.call(a2, e2); 53935 })); 53936 } : _e$1, Ie$1 = tn; 53937 function nn(a2, e2) { 53938 for (var r2 = -1, t2 = Array(a2); ++r2 < a2; ) t2[r2] = e2(r2); 53939 return t2; 53940 } 53941 var Be$1 = nn; 53942 function on() { 53943 return false; 53944 } 53945 var Le$1 = on; 53946 var De$1 = typeof exports == "object" && exports && !exports.nodeType && exports, Ke$1 = De$1 && typeof module == "object" && module && !module.nodeType && module, mn = Ke$1 && Ke$1.exports === De$1, Re$1 = mn ? f$1.Buffer : void 0, ln$1 = Re$1 ? Re$1.isBuffer : void 0, sn$1 = ln$1 || Le$1, aa$1 = sn$1; 53947 var bn = 9007199254740991, un$1 = /^(?:0|[1-9]\d*)$/; 53948 function pn$1(a2, e2) { 53949 var r2 = typeof a2; 53950 return e2 = e2 != null ? e2 : bn, !!e2 && (r2 == "number" || r2 != "symbol" && un$1.test(a2)) && a2 > -1 && a2 % 1 == 0 && a2 < e2; 53951 } 53952 var q$1 = pn$1; 53953 var fn = 9007199254740991; 53954 function Tn(a2) { 53955 return typeof a2 == "number" && a2 > -1 && a2 % 1 == 0 && a2 <= fn; 53956 } 53957 var Z$1 = Tn; 53958 var vn$1 = "[object Arguments]", cn$1 = "[object Array]", dn$1 = "[object Boolean]", hn = "[object Date]", gn = "[object Error]", An = "[object Function]", Mn = "[object Map]", Sn$1 = "[object Number]", yn = "[object Object]", Cn = "[object RegExp]", wn = "[object Set]", En = "[object String]", Nn$1 = "[object WeakMap]", Gn = "[object ArrayBuffer]", Pn = "[object DataView]", xn = "[object Float32Array]", kn = "[object Float64Array]", Fn = "[object Int8Array]", _n = "[object Int16Array]", On = "[object Int32Array]", In = "[object Uint8Array]", Bn = "[object Uint8ClampedArray]", Ln = "[object Uint16Array]", Kn = "[object Uint32Array]", b = {}; 53959 b[xn] = b[kn] = b[Fn] = b[_n] = b[On] = b[In] = b[Bn] = b[Ln] = b[Kn] = true; 53960 b[vn$1] = b[cn$1] = b[Gn] = b[dn$1] = b[Pn] = b[hn] = b[gn] = b[An] = b[Mn] = b[Sn$1] = b[yn] = b[Cn] = b[wn] = b[En] = b[Nn$1] = false; 53961 function Rn(a2) { 53962 return M$2(a2) && Z$1(a2.length) && !!b[A$1(a2)]; 53963 } 53964 var He$1 = Rn; 53965 function Dn(a2) { 53966 return function(e2) { 53967 return a2(e2); 53968 }; 53969 } 53970 var pa = Dn; 53971 var Ue$1 = typeof exports == "object" && exports && !exports.nodeType && exports, ea$1 = Ue$1 && typeof module == "object" && module && !module.nodeType && module, Hn
53971= ea$1 && ea$1.exports === Ue$1, Na = Hn && oa.process, Un = (function() { 53972 try { 53973 var a2 = ea$1 && ea$1.require && ea$1.require("util").types; 53974 return a2 || Na && Na.binding && Na.binding("util"); 53975 } catch (e2) { 53976 } 53977 })(), Ga = Un; 53978 var je$1 = Ga && Ga.isTypedArray, jn = je$1 ? pa(je$1) : He$1, fa = jn; 53979 var zn = Object.prototype, Vn = zn.hasOwnProperty; 53980 function Wn(a2, e2) { 53981 var r2 = u$1(a2), t2 = !r2 && R$1(a2), n2 = !r2 && !t2 && aa$1(a2), i2 = !r2 && !t2 && !n2 && fa(a2), o2 = r2 || t2 || n2 || i2, m2 = o2 ? Be$1(a2.length, String) : [], s2 = m2.length; 53982 for (var l2 in a2) (e2 || Vn.call(a2, l2)) && !(o2 && (l2 == "length" || n2 && (l2 == "offset" || l2 == "parent") || i2 && (l2 == "buffer" || l2 == "byteLength" || l2 == "byteOffset") || q$1(l2, s2))) && m2.push(l2); 53983 return m2; 53984 } 53985 var ze$1 = Wn; 53986 var Yn = Object.prototype; 53987 function Jn(a2) { 53988 var e2 = a2 && a2.constructor, r2 = typeof e2 == "function" && e2.prototype || Yn; 53989 return a2 === r2; 53990 } 53991 var Ve$1 = Jn; 53992 function qn(a2, e2) { 53993 return function(r2) { 53994 return a2(e2(r2)); 53995 }; 53996 } 53997 var We$1 = qn; 53998 var Zn = We$1(Object.keys, Object), Ye$1 = Zn; 53999 var Qn = Object.prototype, $n = Qn.hasOwnProperty; 54000 function Xn(a2) { 54001 if (!Ve$1(a2)) return Ye$1(a2); 54002 var e2 = []; 54003 for (var r2 in Object(a2)) $n.call(a2, r2) && r2 != "constructor" && e2.push(r2); 54004 return e2; 54005 } 54006 var Je$1 = Xn; 54007 function ao(a2) { 54008 return a2 != null && Z$1(a2.length) && !ma(a2); 54009 } 54010 var _$1 = ao; 54011 function eo(a2) { 54012 return _$1(a2) ? ze$1(a2) : Je$1(a2); 54013 } 54014 var Q$1 = eo; 54015 function ro(a2) { 54016 return ke$1(a2, Q$1, Ie$1); 54017 } 54018 var Pa = ro; 54019 var to = 1, io = Object.prototype, no = io.hasOwnProperty; 54020 function oo(a2, e2, r2, t2, n2, i2) { 54021 var o2 = r2 & to, m2 = Pa(a2), s2 = m2.length, l2 = Pa(e2), d2 = l2.length; 54022 if (s2 != d2 && !o2) return false; 54023 for (var T2 = s2; T2--; ) { 54024 var p2 = m2[T2]; 54025 if (!(o2 ? p2 in e2 : no.call(e2, p2))) return false; 54026 } 54027 var S2 = i2.get(a2), h2 = i2.get(e2); 54028 if (S2 && h2) return S2 == e2 && h2 == a2; 54029 var g2 = true; 54030 i2.set(a2, e2), i2.set(e2, a2); 54031 for (var E2 = o2; ++T2 < s2; ) { 54032 p2 = m2[T2]; 54033 var I2 = a2[p2], B2 = e2[p2]; 54034 if (t2) var _a = o2 ? t2(B2, I2, p2, e2, a2, i2) : t2(I2, B2, p2, a2, e2, i2); 54035 if (!(_a === void 0 ? I2 === B2 || n2(I2, B2, r2, t2, i2) : _a)) { 54036 g2 = false; 54037 break; 54038 } 54039 E2 || (E2 = p2 == "constructor"); 54040 } 54041 if (g2 && !E2) { 54042 var ta = a2.constructor, ia = e2.constructor; 54043 ta != ia && "constructor" in a2 && "constructor" in e2 && !(typeof ta == "function" && ta instanceof ta && typeof ia == "function" && ia instanceof ia) && (g2 = false); 54044 } 54045 return i2.delete(a2), i2.delete(e2), g2; 54046 } 54047 var qe$1 = oo; 54048 var mo = c(f$1, "DataView"), Ta = mo; 54049 var lo = c(f$1, "Promise"), va = lo; 54050 var so = c(f$1, "Set"), ca = so; 54051 var bo = c(f$1, "WeakMap"), da = bo; 54052 var Ze$1 = "[object Map]", uo = "[object Object]", Qe = "[object Promise]", $e$1 = "[object Set]", Xe$1 = "[object WeakMap]", ar$1 = "[object DataView]", po = C$2(Ta), fo = C$2(x$1), To = C$2(va), vo = C$2(ca), co = C$2(da), K$1 = A$1; 54053 (Ta && K$1(new Ta(new ArrayBuffer(1))) != ar$1 || x$1 && K$1(new x$1()) != Ze$1 || va && K$1(va.resolve()) != Qe || ca && K$1(new ca()) != $e$1 || da && K$1(new da()) != Xe$1) && (K$1 = function(a2) { 54054 var e2 = A$1(a2), r2 = e2 == uo ? a2.constructor : void 0, t2 = r2 ? C$2(r2) : ""; 54055 if (t2) switch (t2) { 54056 case po: 54057 return ar$1; 54058 case fo: 54059 return Ze$1; 54060 case To: 54061 return Qe; 54062 case vo: 54063 return $e$1; 54064 case co: 54065 return Xe$1; 54066 } 54067 return e2; 54068 }); 54069 var xa = K$1; 54070 var ho = 1, er$1 = "[object Arguments]", rr$1 = "[object Array]", ha = "[object Object]", go = Object.prototype, tr$1 = go.hasOwnProperty; 54071 function Ao(a2, e2, r2, t2, n2, i2) { 54072 var o2 = u$1(a2), m2 = u$1(e2), s2 = o2 ? rr$1 : xa(a2), l2 = m2 ? rr$1 : xa(e2); 54073 s2 = s2 == er$1 ? ha : s2, l2 = l2 == er$1 ? ha : l2; 54074 var d2 = s2 == ha, T2 = l2 == ha, p2 = s2 == l2; 54075 if (p2 && aa$1(a2)) { 54076 if (!aa$1(e2)) return false;
54077 o2 = true, d2 = false; 54078 } 54079 if (p2 && !d2) return i2 || (i2 = new J$1()), o2 || fa(a2) ? ua(a2, e2, r2, t2, n2, i2) : xe$1(a2, e2, s2, r2, t2, n2, i2); 54080 if (!(r2 & ho)) { 54081 var S2 = d2 && tr$1.call(a2, "__wrapped__"), h2 = T2 && tr$1.call(e2, "__wrapped__"); 54082 if (S2 || h2) { 54083 var g2 = S2 ? a2.value() : a2, E2 = h2 ? e2.value() : e2; 54084 return i2 || (i2 = new J$1()), n2(g2, E2, r2, t2, i2); 54085 } 54086 } 54087 return p2 ? (i2 || (i2 = new J$1()), qe$1(a2, e2, r2, t2, n2, i2)) : false; 54088 } 54089 var ir$1 = Ao; 54090 function nr$1(a2, e2, r2, t2, n2) { 54091 return a2 === e2 ? true : a2 == null || e2 == null || !M$2(a2) && !M$2(e2) ? a2 !== a2 && e2 !== e2 : ir$1(a2, e2, r2, t2, nr$1, n2); 54092 } 54093 var ga = nr$1; 54094 var Mo = 1, So = 2; 54095 function yo(a2, e2, r2, t2) { 54096 var n2 = r2.length, i2 = n2, o2 = !t2; 54097 if (a2 == null) return !i2; 54098 for (a2 = Object(a2); n2--; ) { 54099 var m2 = r2[n2]; 54100 if (o2 && m2[2] ? m2[1] !== a2[m2[0]] : !(m2[0] in a2)) return false; 54101 } 54102 for (; ++n2 < i2; ) { 54103 m2 = r2[n2]; 54104 var s2 = m2[0], l2 = a2[s2], d2 = m2[1]; 54105 if (o2 && m2[2]) { 54106 if (l2 === void 0 && !(s2 in a2)) return false; 54107 } else { 54108 var T2 = new J$1(); 54109 if (t2) var p2 = t2(l2, d2, s2, a2, e2, T2); 54110 if (!(p2 === void 0 ? ga(d2, l2, Mo | So, t2, T2) : p2)) return false; 54111 } 54112 } 54113 return true; 54114 } 54115 var or$1 = yo; 54116 function Co(a2) { 54117 return a2 === a2 && !N$1(a2); 54118 } 54119 var Aa = Co; 54120 function wo(a2) { 54121 for (var e2 = Q$1(a2), r2 = e2.length; r2--; ) { 54122 var t2 = e2[r2], n2 = a2[t2]; 54123 e2[r2] = [t2, n2, Aa(n2)]; 54124 } 54125 return e2; 54126 } 54127 var mr$1 = wo; 54128 function Eo(a2, e2) { 54129 return function(r2) { 54130 return r2 == null ? false : r2[a2] === e2 && (e2 !== void 0 || a2 in Object(r2)); 54131 }; 54132 } 54133 var Ma = Eo; 54134 function No(a2) { 54135 var e2 = mr$1(a2); 54136 return e2.length == 1 && e2[0][2] ? Ma(e2[0][0], e2[0][1]) : function(r2) { 54137 return r2 === a2 || or$1(r2, a2, e2); 54138 }; 54139 } 54140 var lr$1 = No; 54141 function Go(a2, e2, r2) { 54142 var t2 = a2 == null ? void 0 : W(a2, e2); 54143 return t2 === void 0 ? r2 : t2; 54144 } 54145 var sr$1 = Go; 54146 function Po(a2, e2) { 54147 return a2 != null && e2 in Object(a2); 54148 } 54149 var br$1 = Po; 54150 function xo(a2, e2, r2) { 54151 e2 = sa(e2, a2); 54152 for (var t2 = -1, n2 = e2.length, i2 = false; ++t2 < n2; ) { 54153 var o2 = F$1(e2[t2]); 54154 if (!(i2 = a2 != null && r2(a2, o2))) break; 54155 a2 = a2[o2]; 54156 } 54157 return i2 || ++t2 != n2 ? i2 : (n2 = a2 == null ? 0 : a2.length, !!n2 && Z$1(n2) && q$1(o2, n2) && (u$1(a2) || R$1(a2))); 54158 } 54159 var ur$1 = xo; 54160 function ko(a2, e2) { 54161 return a2 != null && ur$1(a2, e2, br$1); 54162 } 54163 var pr$2 = ko; 54164 var Fo = 1, _o = 2; 54165 function Oo(a2, e2) { 54166 return H$1(a2) && Aa(e2) ? Ma(F$1(a2), e2) : function(r2) { 54167 var t2 = sr$1(r2, a2); 54168 return t2 === void 0 && t2 === e2 ? pr$2(r2, a2) : ga(e2, t2, Fo | _o); 54169 }; 54170 } 54171 var fr$1 = Oo; 54172 function Io(a2) { 54173 return a2; 54174 } 54175 var O$1 = Io; 54176 function Bo(a2) { 54177 return function(e2) { 54178 return e2 == null ? void 0 : e2[a2]; 54179 }; 54180 } 54181 var Tr$1 = Bo; 54182 function Lo(a2) { 54183 return function(e2) { 54184 return W(e2, a2); 54185 }; 54186 } 54187 var vr$1 = Lo; 54188 function Ko(a2) { 54189 return H$1(a2) ? Tr$1(F$1(a2)) : vr$1(a2); 54190 } 54191 var cr$1 = Ko; 54192 function Ro(a2) { 54193 return typeof a2 == "function" ? a2 : a2 == null ? O$1 : typeof a2 == "object" ? u$1(a2) ? fr$1(a2[0], a2[1]) : lr$1(a2) : cr$1(a2); 54194 } 54195 var dr$1 = Ro; 54196 function Do(a2) { 54197 return function(e2, r2, t2) { 54198 for (var n2 = -1, i2 = Object(e2), o2 = t2(e2), m2 = o2.length; m2--; ) { 54199 var s2 = o2[a2 ? m2 : ++n2]; 54200 if (r2(i2[s2], s2, i2) === false) break; 54201 } 54202 return e2; 54203 }; 54204 } 54205 var hr$1 = Do; 54206 var Ho = hr$1(), gr$1 = Ho; 54207 function Uo(a2, e2) { 54208 return a2 && gr$1(a2, e2, Q$1); 54209 } 54210 var Ar$1 = Uo; 54211 function jo(a2, e2) { 54212 return function(r2, t2) { 54213 if (r2 == null) return r2; 54214 if (!_$1(r2)) return a2(r2, t2); 54215 for (var n2 = r2.length, i2 = e2 ? n2 : -1, o2 = Object(r2); (e2 ? i2-- : ++i2 < n2) && t2(o2[i2], i2, o2) !== false; ) ; 54216 return r2; 54217 }; 54218 } 54219 var Mr$1 = jo; 54220 var zo = Mr$1(Ar$1), Sr$1 = zo; 54221 function Vo(a2, e2) { 54222 var r2 = -1, t2 = _$1(a2) ? Array(a2.length) : []; 54223 return Sr$1(a2, function(n2, i2, o2) { 54224 t2[++r2] = e2(n2, i2, o2); 54225 }), t2; 54226 } 54227 var yr$1 = Vo; 54228 function Wo(a2, e2) { 54229 var r2 = a2.length; 54230 for (a2.sort(e2); r2--; ) a2[r2] = a2[r2].value; 54231 return a2; 54232 } 54233 var Cr$1 = Wo; 54234 function Yo(a2, e2) { 54235 if (a2 !== e2) { 54236 var r2 = a2 !== void 0, t2 = a2 === null, n2 = a2 === a2, i2 =
54236y$1(a2), o2 = e2 !== void 0, m2 = e2 === null, s2 = e2 === e2, l2 = y$1(e2); 54237 if (!m2 && !l2 && !i2 && a2 > e2 || i2 && o2 && s2 && !m2 && !l2 || t2 && o2 && s2 || !r2 && s2 || !n2) return 1; 54238 if (!t2 && !i2 && !l2 && a2 < e2 || l2 && r2 && n2 && !t2 && !i2 || m2 && r2 && n2 || !o2 && n2 || !s2) return -1; 54239 } 54240 return 0; 54241 } 54242 var wr$1 = Yo; 54243 function Jo(a2, e2, r2) { 54244 for (var t2 = -1, n2 = a2.criteria, i2 = e2.criteria, o2 = n2.length, m2 = r2.length; ++t2 < o2; ) { 54245 var s2 = wr$1(n2[t2], i2[t2]); 54246 if (s2) { 54247 if (t2 >= m2) return s2; 54248 var l2 = r2[t2]; 54249 return s2 * (l2 == "desc" ? -1 : 1); 54250 } 54251 } 54252 return a2.index - e2.index; 54253 } 54254 var Er$1 = Jo; 54255 function qo(a2, e2, r2) { 54256 e2.length ? e2 = D$2(e2, function(i2) { 54257 return u$1(i2) ? function(o2) { 54258 return W(o2, i2.length === 1 ? i2[0] : i2); 54259 } : i2; 54260 }) : e2 = [O$1]; 54261 var t2 = -1; 54262 e2 = D$2(e2, pa(dr$1)); 54263 var n2 = yr$1(a2, function(i2, o2, m2) { 54264 var s2 = D$2(e2, function(l2) { 54265 return l2(i2); 54266 }); 54267 return { criteria: s2, index: ++t2, value: i2 }; 54268 }); 54269 return Cr$1(n2, function(i2, o2) { 54270 return Er$1(i2, o2, r2); 54271 }); 54272 } 54273 var Nr$1 = qo; 54274 function Zo(a2, e2, r2) { 54275 switch (r2.length) { 54276 case 0: 54277 return a2.call(e2); 54278 case 1: 54279 return a2.call(e2, r2[0]); 54280 case 2: 54281 return a2.call(e2, r2[0], r2[1]); 54282 case 3: 54283 return a2.call(e2, r2[0], r2[1], r2[2]); 54284 } 54285 return a2.apply(e2, r2); 54286 } 54287 var Gr$2 = Zo; 54288 var Pr$1 = Math.max; 54289 function Qo(a2, e2, r2) { 54290 return e2 = Pr$1(e2 === void 0 ? a2.length - 1 : e2, 0), function() { 54291 for (var t2 = arguments, n2 = -1, i2 = Pr$1(t2.length - e2, 0), o2 = Array(i2); ++n2 < i2; ) o2[n2] = t2[e2 + n2]; 54292 n2 = -1; 54293 for (var m2 = Array(e2 + 1); ++n2 < e2; ) m2[n2] = t2[n2]; 54294 return m2[e2] = r2(o2), Gr$2(a2, this, m2); 54295 }; 54296 } 54297 var xr$1 = Qo; 54298 function $o(a2) { 54299 return function() { 54300 return a2; 54301 }; 54302 } 54303 var kr$1 = $o; 54304 var Xo = (function() { 54305 try { 54306 var a2 = c(Object, "defineProperty"); 54307 return a2({}, "", {}), a2; 54308 } catch (e2) { 54309 } 54310 })(), ka = Xo; 54311 var am = ka ? function(a2, e2) { 54312 return ka(a2, "toString", { configurable: true, enumerable: false, value: kr$1(e2), writable: true }); 54313 } : O$1, Fr$1 = am; 54314 var em = 800, rm = 16, tm = Date.now; 54315 function im(a2) { 54316 var e2 = 0, r2 = 0; 54317 return function() { 54318 var t2 = tm(), n2 = rm - (t2 - r2); 54319 if (r2 = t2, n2 > 0) { 54320 if (++e2 >= em) return arguments[0]; 54321 } else e2 = 0; 54322 return a2.apply(void 0, arguments); 54323 }; 54324 } 54325 var _r$1 = im; 54326 var nm = _r$1(Fr$1), Or$1 = nm; 54327 function om(a2, e2) { 54328 return Or$1(xr$1(a2, e2, O$1), a2 + ""); 54329 } 54330 var Ir$1 = om; 54331 function mm(a2, e2, r2) { 54332 if (!N$1(r2)) return false; 54333 var t2 = typeof e2; 54334 return (t2 == "number" ? _$1(r2) && q$1(e2, r2.length) : t2 == "string" && e2 in r2) ? j$1(r2[e2], a2) : false; 54335 } 54336 var Fa = mm; 54337 var lm = Ir$1(function(a2, e2) { 54338 if (a2 == null) return []; 54339 var r2 = e2.length; 54340 return r2 > 1 && Fa(a2, e2[0], e2[1]) ? e2 = [] : r2 > 2 && Fa(e2[0], e2[1], e2[2]) && (e2 = [e2[0]]), Nr$1(a2, Ua(e2, 1), []); 54341 }), $$2 = lm; 54342 var sm = [{ name: "Alabama", abbreviation: "AL" }, { name: "Alaska", abbreviation: "AK" }, { name: "American Samoa", abbreviation: "AS" }, { name: "Arizona", abbreviation: "AZ" }, { name: "Arkansas", abbreviation: "AR" }, { name: "California", abbreviation: "CA" }, { name: "Colorado", abbreviation: "CO" }, { name: "Connecticut", abbreviation: "CT" }, { name: "Delaware", abbreviation: "DE" }, { name: "District of Columbia", abbreviation: "DC" }, { name: "Florida", abbreviation: "FL" }, { name: "Georgia", abbreviation: "GA" }, { name: "Guam", abbreviation: "GU" }, { name: "Hawaii", abbreviation: "HI" }, { name: "Idaho", abbreviation: "ID" }, { name: "Illinois", abbreviation: "IL" }, { name: "Indiana", abbreviation: "IN" }, { name: "Iowa", abbreviation: "IA" }, { name: "Kansas", abbreviation: "KS" }, { name: "Kentucky", abbreviation: "KY" }, { name: "Louisiana", abbreviation: "LA" }, { name: "Maine", abbreviation: "ME" }, { name: "Maryland", abbreviation: "MD" }, { name: "Massachusetts", abbreviation: "MA" }, { name: "Michigan", abbreviation: "MI" }, { name: "Minnesota", abbreviation: "MN" }, { name: "Mississippi", abbreviation: "MS" }, { name: "Missouri", abbreviation: "MO" }, { name: "Montana", abbreviation: "MT" }, { name: "Nebraska", abbreviation: "NE" }, { name: "Nevada", abbreviation: "NV" }, { name: "New Hampshire", abbreviation: "NH" }, { name: "New Jersey", abbreviation: "NJ" }, { name: "New Mexico", abbreviation: "NM" }, { name: "New York", abbreviation: "NY" }, { name: "North Carolina", abbreviation: "NC" }, { name: "North Dakota", abbreviation: "ND" }, { name: "Northern Mariana Islands", abbreviation: "MP" }, { name: "Ohio", abbreviation: "OH" }, { name: "Oklahoma", abbreviation: "OK" }, { name: "Oregon", abbreviation: "OR" }, { name: "Pennsylvania", abbreviation: "PA" }, { name: "Puerto Rico", abbreviation: "PR" }, { name: "Rhode Island", abbreviation: "RI" }, { name: "South Carolina", abbreviation: "SC" }, { name: "South Dakota", abbreviation: "SD" }, { name: "Tennessee", abbreviation: "TN" }, { name: "Texas", abbreviation: "TX" }, { name: "Utah", abbreviation: "UT" }, { name: "Vermont", abbreviation: "VT" }, { name: "Virgin Islands", abbreviation: "VI" }, { name: "Virginia", abbreviation: "VA" }, { name: "Washington", abbreviation: "WA" }, { name: "West Virginia", abbreviation: "WV" }, { name: "Wisconsin", abbreviation: "WI" }, { name: "Wyoming", abbreviation: "WY" }], bm = [{ name: "Armed Forces America", abbreviation: "AA" }, { name: "Armed Forces Europe", abbreviation: "AE" }, { name: "Armed Forces Pacific", abbreviation: "AP" }], um = [{ name: "Alberta", abbreviation: "AB" }, { name: "British Columbia", abbreviation: "BC" }, { name: "Manitoba", abbreviation: "MB" }, { name: "New Brunswick", abbreviation: "NB" }, { name: "Newfoundland and Labrador", abbreviation: "NL" }, { name: "Northwest Territories", abbreviation: "NT" }, { name: "Nova Scotia", abbreviation: "NS" }, { name: "Nunavut", abbreviation: "NU" }, { name: "Ontario", abbreviation: "ON" }, { name: "Prince Edward Island", abbreviation: "PE" }, { name: "Quebec", abbreviation: "QC" }, { name: "Saskatchewan", abbreviation: "SK" }, { name: "Yukon", abbreviation: "YT" }], pm = [{ name: "Hokkaido", abbreviation: "Hokkaido" }, { name: "Aomori", abbreviation: "Aomori" }, { name: "Iwate", abbreviation: "Iwate" }, { name: "Miyagi", abbreviation: "Miyagi" }, { name: "Akita", abbreviation: "Akita" }, { name: "Yamagata", abbreviation: "Yamagata" }, { name: "Fukushima", abbreviation: "Fukushima" }, { name: "Ibaraki", abbreviation: "Ibaraki" }, { name: "Tochigi", abbreviation: "Tochigi" }, { name: "Gunma", abbreviation: "Gunma" }, { name: "Saitama", abbreviation: "Saitama" }, { name: "Chiba", abbreviation: "Chiba" }, { name: "Tokyo", abbreviation: "Tokyo" }, { name: "Kanagawa", abbreviation: "Kanagawa" }, { name: "Niigata", abbreviation: "Niigata" }, { name: "Toyama", abbreviation: "Toyama" }, { name: "Ishikawa", abbreviation: "Ishikawa" }, { name: "Fukui", abbreviation: "Fukui" }, { name: "Yamanashi", abbreviation: "Yamanashi" }, { name: "Nagano", abbreviation: "Nagano" }, { name: "Gifu", abbreviation: "Gifu" }, { name: "Shizuoka", abbreviation: "Shizuoka" }, { name: "Aichi", abbreviation: "Aichi" }, { name: "Mie", abbreviation: "Mie" }, { name: "Shiga", abbreviation: "Shiga" }, { name: "Kyoto", abbreviation: "Kyoto" }, { name: "Osaka", abbreviation: "Osaka" }, { name: "Hyogo", abbreviation: "Hyogo" }, { name: "Nara", abbreviation: "Nara" }, { name: "Wakayama", abbreviation: "Wakayama" }, { name: "Tottori", abbreviation: "Tottori" }, { name: "Shimane", abbreviation: "Shimane" }, { name: "Okayama", abbreviation: "Okayama" }, { name: "Hiroshima", abbreviation: "Hiroshima" }, { name: "Yamaguchi", abbreviation: "Yamaguchi" }
54342, { name: "Tokushima", abbreviation: "Tokushima" }, { name: "Kagawa", abbreviation: "Kagawa" }, { name: "Ehime", abbreviation: "Ehime" }, { name: "Kochi", abbreviation: "Kochi" }, { name: "Fukuoka", abbreviation: "Fukuoka" }, { name: "Saga", abbreviation: "Saga" }, { name: "Nagasaki", abbreviation: "Nagasaki" }, { name: "Kumamoto", abbreviation: "Kumamoto" }, { name: "Oita", abbreviation: "Oita" }, { name: "Miyazaki", abbreviation: "Miyazaki" }, { name: "Kagoshima", abbreviation: "Kagoshima" }, { name: "Okinawa", abbreviation: "Okinawa" }], fm = [{ name: "Australian Capital Territory", abbreviation: "ACT" }, { name: "New South Wales", abbreviation: "NSW" }, { name: "Northern Territory", abbreviation: "NT" }, { name: "Queensland", abbreviation: "QLD" }, { name: "South Australia", abbreviation: "SA" }, { name: "Tasmania", abbreviation: "TAS" }, { name: "Victoria", abbreviation: "VIC" }, { name: "Western Australia", abbreviation: "WA" }], Tm = [{ name: "Acre", abbreviation: "AC" }, { name: "Alagoas", abbreviation: "AL" }, { name: "Amazonas", abbreviation: "AM" }, { name: "Amapá", abbreviation: "AP" }, { name: "Bahia", abbreviation: "BA" }, { name: "Ceará", abbreviation: "CE" }, { name: "Distrito Federal", abbreviation: "DF" }, { name: "EspÃrito Santo", abbreviation: "ES" }, { name: "Goiás", abbreviation: "GO" }, { name: "Maranhão", abbreviation: "MA" }, { name: "Minas Gerais", abbreviation: "MG" }, { name: "Mato Grosso do Sul", abbreviation: "MS" }, { name: "Mato Grosso", abbreviation: "MT" }, { name: "Pará", abbreviation: "PA" }, { name: "ParaÃba", abbreviation: "PB" }, { name: "Pernambuco", abbreviation: "PE" }, { name: "PiauÃ", abbreviation: "PI" }, { name: "Paraná", abbreviation: "PR" }, { name: "Rio de Janeiro", abbreviation: "RJ" }, { name: "Rio Grande do Norte", abbreviation: "RN" }, { name: "Rondônia", abbreviation: "RO" }, { name: "Roraima", abbreviation: "RR" }, { name: "Rio Grande do Sul", abbreviation: "RS" }, { name: "Santa Catarina", abbreviation: "SC" }, { name: "Sergipe", abbreviation: "SE" }, { name: "São Paulo", abbreviation: "SP" }, { name: "Tocantins", abbreviation: "TO" }], ra = ({ name: a2, abbreviation: e2 }) => ({ label: a2, value: e2 }); 54343 ({ US: $$2([...sm, ...bm].map(ra), ["label"]), CA: $$2(um.map(ra), ["label"]), JP: $$2(pm.map(ra), ["label"]), AU: $$2(fm.map(ra), ["label"]), BR: $$2(Tm.map(ra), ["label"]) }); 54344 var timezone$1 = { exports: {} }; 54345 var timezone = timezone$1.exports; 54346 var hasRequiredTimezone; 54347 function requireTimezone() { 54348 if (hasRequiredTimezone) return timezone$1.exports; 54349 hasRequiredTimezone = 1; 54350 (function(module2, exports$1) { 54351 !(function(t2, e2) { 54352 module2.exports = e2(); 54353 })(timezone, (function() { 54354 var t2 = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e2 = {}; 54355 return function(n2, i2, o2) { 54356 var r2, a2 = function(t3, n3, i3) { 54357 void 0 === i3 && (i3 = {}); 54358 var o3 = new Date(t3), r3 = (function(t4, n4) { 54359 void 0 === n4 && (n4 = {}); 54360 var i4 = n4.timeZoneName || "short", o4 = t4 + "|" + i4, r4 = e2[o4]; 54361 return r4 || (r4 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t4, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i4 }), e2[o4] = r4), r4; 54362 })(n3, i3); 54363 return r3.formatToParts(o3); 54364 }, u2 = function(e3, n3) { 54365 for (var i3 = a2(e3, n3), r3 = [], u3 = 0; u3 < i3.length; u3 += 1) { 54366 var f3 = i3[u3], s3 = f3.type, m2 = f3.value, c2 = t2[s3]; 54367 c2 >= 0 && (r3[c2] = parseInt(m2, 10)); 54368 } 54369 var d2 = r3[3], l2 = 24 === d2 ? 0 : d2, h2 = r3[0] + "-" + r3[1] + "-" + r3[2] + " " + l2 + ":" + r3[4] + ":" + r3[5] + ":000", v2 = +e3; 54370 return (o2.utc(h2).valueOf() - (v2 -= v2 % 1e3)) / 6e4; 54371 }, f2 = i2.prototype; 54372 f2.tz = function(t3, e3) { 54373 void 0 === t3 && (t3 = r2); 54374 var n3, i3 = this.utcOffset(), a3 = this.toDate(), u3 = a3.toLocaleStr
54374ing("en-US", { timeZone: t3 }), f3 = Math.round((a3 - new Date(u3)) / 1e3 / 60), s3 = 15 * -Math.round(a3.getTimezoneOffset() / 15) - f3; 54375 if (!Number(s3)) n3 = this.utcOffset(0, e3); 54376 else if (n3 = o2(u3, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s3, true), e3) { 54377 var m2 = n3.utcOffset(); 54378 n3 = n3.add(i3 - m2, "minute"); 54379 } 54380 return n3.$x.$timezone = t3, n3; 54381 }, f2.offsetName = function(t3) { 54382 var e3 = this.$x.$timezone || o2.tz.guess(), n3 = a2(this.valueOf(), e3, { timeZoneName: t3 }).find((function(t4) { 54383 return "timezonename" === t4.type.toLowerCase(); 54384 })); 54385 return n3 && n3.value; 54386 }; 54387 var s2 = f2.startOf; 54388 f2.startOf = function(t3, e3) { 54389 if (!this.$x || !this.$x.$timezone) return s2.call(this, t3, e3); 54390 var n3 = o2(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L }); 54391 return s2.call(n3, t3, e3).tz(this.$x.$timezone, true); 54392 }, o2.tz = function(t3, e3, n3) { 54393 var i3 = n3 && e3, a3 = n3 || e3 || r2, f3 = u2(+o2(), a3); 54394 if ("string" != typeof t3) return o2(t3).tz(a3); 54395 var s3 = (function(t4, e4, n4) { 54396 var i4 = t4 - 60 * e4 * 1e3, o3 = u2(i4, n4); 54397 if (e4 === o3) return [i4, e4]; 54398 var r3 = u2(i4 -= 60 * (o3 - e4) * 1e3, n4); 54399 return o3 === r3 ? [i4, o3] : [t4 - 60 * Math.min(o3, r3) * 1e3, Math.max(o3, r3)]; 54400 })(o2.utc(t3, i3).valueOf(), f3, a3), m2 = s3[0], c2 = s3[1], d2 = o2(m2).utcOffset(c2); 54401 return d2.$x.$timezone = a3, d2; 54402 }, o2.tz.guess = function() { 54403 return Intl.DateTimeFormat().resolvedOptions().timeZone; 54404 }, o2.tz.setDefault = function(t3) { 54405 r2 = t3; 54406 }; 54407 }; 54408 })); 54409 })(timezone$1); 54410 return timezone$1.exports; 54411 } 54412 var timezoneExports = requireTimezone(); 54413 const yi = /* @__PURE__ */ getDefaultExportFromCjs(timezoneExports); 54414 var utc$1 = { exports: {} }; 54415 var utc = utc$1.exports; 54416 var hasRequiredUtc; 54417 function requireUtc() { 54418 if (hasRequiredUtc) return utc$1.exports; 54419 hasRequiredUtc = 1; 54420 (function(module2, exports$1) { 54421 !(function(t2, i2) { 54422 module2.exports = i2(); 54423 })(utc, (function() { 54424 var t2 = "minute", i2 = /[+-]\d\d(?::?\d\d)?/g, e2 = /([+-]|\d\d)/g; 54425 return function(s2, f2, n2) { 54426 var u2 = f2.prototype; 54427 n2.utc = function(t3) { 54428 var i3 = { date: t3, utc: true, args: arguments }; 54429 return new f2(i3); 54430 }, u2.utc = function(i3) { 54431 var e3 = n2(this.toDate(), { locale: this.$L, utc: true }); 54432 return i3 ? e3.add(this.utcOffset(), t2) : e3; 54433 }, u2.local = function() { 54434 return n2(this.toDate(), { locale: this.$L, utc: false }); 54435 }; 54436 var r2 = u2.parse; 54437 u2.parse = function(t3) { 54438 t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), r2.call(this, t3); 54439 }; 54440 var o2 = u2.init; 54441 u2.init = function() { 54442 if (this.$u) { 54443 var t3 = this.$d; 54444 this.$y = t3.getUTCFullYear(), this.$M = t3.getUTCMonth(), this.$D = t3.getUTCDate(), this.$W = t3.getUTCDay(), this.$H = t3.getUTCHours(), this.$m = t3.getUTCMinutes(), this.$s = t3.getUTCSeconds(), this.$ms = t3.getUTCMilliseconds(); 54445 } else o2.call(this); 54446 }; 54447 var a2 = u2.utcOffset; 54448 u2.utcOffset = function(s3, f3) { 54449 var n3 = this.$utils().u; 54450 if (n3(s3)) return this.$u ? 0 : n3(this.$offset) ? a2.call(this) : this.$offset; 54451 if ("string" == typeof s3 && (s3 = (function(t3) { 54452 void 0 === t3 && (t3 = ""); 54453 var s4 = t3.match(i2); 54454 if (!s4) return null; 54455 var f4 = ("" + s4[0]).match(e2) || ["-", 0, 0], n4 = f4[0], u4 = 60 * +f4[1] + +f4[2]; 54456 return 0 === u4 ? 0 : "+" === n4 ? u4 : -u4; 54457 })(s3), null === s3)) return this; 54458 var u3 = Math.abs(s3) <= 16 ? 60 * s3 : s3; 54459 if (0 === u3) return this.utc(f3); 54460 var r3 = this.clone(); 54461 if (f3) return r3.$offset = u3, r3.$u = false, r3; 54462 var o3 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset(); 54463 return (r3 = this.local().add(u3 + o3, t2)).$offset = u3, r3.$x.$localOffset = o3, r3; 54464 }; 54465 var h2 = u2.format; 54466 u2.format = function(t3) { 54467 var i3 = t3 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : ""); 54468 return h2.call(this, i3); 54469 }, u2.valueOf = function() { 54470 var t3 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset()); 54471 return this.$d.valueOf() - 6e4 * t3; 54472 }, u2.isUTC = function() { 54473 return !!this.$u; 54474 }, u2.toISOString = function() { 54475 return this.toDate().toISOString(); 54476 }, u2.toString = function() { 54477 return this.toDate().toUTCString(); 54478 }; 54479 var l2 = u2.toDate; 54480 u2.toDate = function(t3) { 54481 return "s" === t3 && this.$offset ? n2(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l2.call(this); 54482 }; 54483 var c2 = u2.diff; 54484 u2.diff = function(t3, i3, e3) { 54485 if (t3 && this.$u === t3.$u) return c2.call(this, t3, i3, e3); 54486 var s3 = this.local(), f3 = n2(t3).local(); 54487 return c2.call(s3, f3, i3, e3); 54488 }; 54489 }; 54490 })); 54491 })(utc$1); 54492 return utc$1.exports; 54493 } 54494 var utcExports = requireUtc(); 54495 const $i = /* @__PURE__ */ getDefaultExportFromCjs(utcExports); 54496 var advancedFormat$1 = { exports: {} }; 54497 var advancedFormat = advancedFormat$1.exports; 54498 var hasRequiredAdvancedFormat; 54499 function requireAdvancedFormat() { 54500 if (hasRequiredAdvancedFormat) return advancedFormat$1.exports; 54501 hasRequiredAdvancedFormat = 1; 54502 (function(module2, exports$1) { 54503 !(function(e2, t2) { 54504 module2.exports = t2(); 54505 })(advancedFormat, (function() { 54506 return function(e2, t2) { 54507 var r2 = t2.prototype, n2 = r2.format; 54508 r2.format = function(e3) { 54509 var t3 = this, r3 = this.$locale(); 54510 if (!this.isValid()) return n2.bind(this)(e3); 54511 var s2 = this.$utils(), a2 = (e3 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e4) { 54512 switch (e4) { 54513 case "Q": 54514 return Math.ceil((t3.$M + 1) / 3); 54515 case "Do": 54516 return r3.ordinal(t3.$D); 54517 case "gggg": 54518 return t3.weekYear(); 54519 case "GGGG": 54520 return t3.isoWeekYear(); 54521 case "wo": 54522 return r3.ordinal(t3.week(), "W"); 54523 case "w": 54524 case "ww": 54525 return s2.s(t3.week(), "w" === e4 ? 1 : 2, "0"); 54526 case "W": 54527 case "WW":
54528 return s2.s(t3.isoWeek(), "W" === e4 ? 1 : 2, "0"); 54529 case "k": 54530 case "kk": 54531 return s2.s(String(0 === t3.$H ? 24 : t3.$H), "k" === e4 ? 1 : 2, "0"); 54532 case "X": 54533 return Math.floor(t3.$d.getTime() / 1e3); 54534 case "x": 54535 return t3.$d.getTime(); 54536 case "z": 54537 return "[" + t3.offsetName() + "]"; 54538 case "zzz": 54539 return "[" + t3.offsetName("long") + "]"; 54540 default: 54541 return e4; 54542 } 54543 })); 54544 return n2.bind(this)(a2); 54545 }; 54546 }; 54547 })); 54548 })(advancedFormat$1); 54549 return advancedFormat$1.exports; 54550 } 54551 var advancedFormatExports = requireAdvancedFormat(); 54552 const Xi = /* @__PURE__ */ getDefaultExportFromCjs(advancedFormatExports); 54553 var weekOfYear$1 = { exports: {} }; 54554 var weekOfYear = weekOfYear$1.exports; 54555 var hasRequiredWeekOfYear; 54556 function requireWeekOfYear() { 54557 if (hasRequiredWeekOfYear) return weekOfYear$1.exports; 54558 hasRequiredWeekOfYear = 1; 54559 (function(module2, exports$1) { 54560 !(function(e2, t2) { 54561 module2.exports = t2(); 54562 })(weekOfYear, (function() { 54563 var e2 = "week", t2 = "year"; 54564 return function(i2, n2, r2) { 54565 var f2 = n2.prototype; 54566 f2.week = function(i3) { 54567 if (void 0 === i3 && (i3 = null), null !== i3) return this.add(7 * (i3 - this.week()), "day"); 54568 var n3 = this.$locale().yearStart || 1; 54569 if (11 === this.month() && this.date() > 25) { 54570 var f3 = r2(this).startOf(t2).add(1, t2).date(n3), s2 = r2(this).endOf(e2); 54571 if (f3.isBefore(s2)) return 1; 54572 } 54573 var a2 = r2(this).startOf(t2).date(n3).startOf(e2).subtract(1, "millisecond"), o2 = this.diff(a2, e2, true); 54574 return o2 < 0 ? r2(this).startOf("week").week() : Math.ceil(o2); 54575 }, f2.weeks = function(e3) { 54576 return void 0 === e3 && (e3 = null), this.week(e3); 54577 }; 54578 }; 54579 })); 54580 })(weekOfYear$1); 54581 return weekOfYear$1.exports; 54582 } 54583 var weekOfYearExports = requireWeekOfYear(); 54584 const _i = /* @__PURE__ */ getDefaultExportFromCjs(weekOfYearExports); 54585 var e = { heading2xl: lt$2` 54586 font-family: var(--font-family-heading); 54587 font-size: var(--font-size-800); 54588 font-weight: var(--font-weight-440); 54589 line-height: var(--font-line-height-700); 54590 letter-spacing: var(--font-letter-spacing-densest); 54591 `, headingXl: lt$2` 54592 font-family: var(--font-family-heading); 54593 font-size: var(--font-size-700); 54594 font-weight: var(--font-weight-460); 54595 line-height: var(--font-line-height-600); 54596 letter-spacing: var(--font-letter-spacing-denser); 54597 `, headingLg: lt$2` 54598 font-family: var(--font-family-heading); 54599 font-size: var(--font-size-600); 54600 font-weight: var(--font-weight-480); 54601 line-height: var(--font-line-height-500); 54602 letter-spacing: var(--font-letter-spacing-dense); 54603 `, headingMd: lt$2` 54604 font-family: var(--font-family-heading); 54605 font-size: var(--font-size-500); 54606 font-weight: var(--font-weight-480); 54607 line-height: var(--font-line-height-400); 54608 letter-spacing: var(--font-letter-spacing-dense); 54609 `, headingSm: lt$2` 54610 font-family: var(--font-family-heading); 54611 font-size: var(--font-size-400); 54612 font-weight: var(--font-weight-500); 54613 line-height: var(--font-line-height-300); 54614 letter-spacing: var(--font-letter-spacing-dense); 54615 `, headingXs: lt$2` 54616 font-family: var(--font-family-heading); 54617 font-size: var(--font-size-300); 54618 font-weight: var(--font-weight-500); 54619 line-height: var(--font-line-height-200); 54620 letter-spacing: var(--font-letter-spacing-normal); 54621 `, bodyMdRegular: lt$2` 54622 font-family: var(--font-family-body); 54623 font-size: var(--font-size-400); 54624 font-weight: var(--font-weight-400); 54625 line-height: var(--font-line-height-400); 54626 letter-spacing: var(--font-letter-spacing-normal); 54627 `, bodyMdMedium: lt$2` 54628 font-family: var(--font-family-body); 54629 font-size: var(--font-size-400); 54630 font-weight: var(--font-weight-500); 54631 line-height: var(--font-line-height-400); 54632 letter-spacing: var(--font-letter-spacing-normal); 54633 `, bodyMdSemibold: lt$2` 54634 font-family: var(--font-family-body); 54635 font-size: var(--font-size-400); 54636 font-weight: var(--font-weight-600); 54637 line-height: var(--font-line-height-400); 54638 letter-spacing: var(--font-letter-spacing-normal); 54639 `, bodySmRegular: lt$2` 54640 font-family: var(--font-family-body); 54641 font-size: var(--font-size-300); 54642 font-weight: var(--font-weight-400); 54643 line-height: var(--font-line-height-300); 54644 letter-spacing: var(--font-letter-spacing-loose); 54645 `, bodySmMedium: lt$2` 54646 font-family: var(--font-family-body); 54647 font-size: var(--font-size-300); 54648 font-weight: var(--font-weight-500); 54649 line-height: var(--font-line-height-300); 54650 letter-spacing: var(--font-letter-spacing-loose); 54651 `, bodySmSemibold: lt$2` 54652 font-family: var(--font-family-body); 54653 font-size: var(--font-size-300); 54654 font-weight: var(--font-weight-600); 54655 line-height: var(--font-line-height-300); 54656 letter-spacing: var(--font-letter-spacing-loose); 54657 `, bodyXsRegular: lt$2` 54658 font-family: var(--font-family-body); 54659 font-size: var(--font-size-200); 54660 font-weight: var(--font-weight-400); 54661 line-height: var(--font-line-height-200); 54662 letter-spacing: var(--font-letter-spacing-looser); 54663 `, bodyXsMedium: lt$2` 54664 font-family: var(--font-family-body); 54665 font-size: var(--font-size-200); 54666 font-weight: var(--font-weight-500); 54667 line-height: var(--font-line-height-200); 54668 letter-spacing: var(--font-letter-spacing-looser); 54669 `, bodyXsSemibold: lt$2` 54670 font-family: var(--font-family-body); 54671 font-size: var(--font-size-200); 54672 font-weight: var(--font-weight-600); 54673 line-height: var(--font-line-height-200); 54674 letter-spacing: var(--font-letter-spacing-looser); 54675 `, body2xsRegular: lt$2` 54676 font-family: var(--font-family-body); 54677 font-size: var(--font-size-100); 54678 font-weight: var(--font-weight-400); 54679 line-height: var(--font-line-height-100); 54680 letter-spacing: var(--font-letter-spacing-loosest); 54681 `, body2xsMedium: lt$2` 54682 font-family: var(--font-family-body); 54683 font-size: var(--font-size-100); 54684 font-weight: var(--font-weight-500); 54685 line-height: var(--font-line-height-100); 54686 letter-spacing: var(--font-letter-spacing-loosest); 54687 `, body2xsSemibold: lt$2` 54688 font-family: var(--font-family-body); 54689 font-size: var(--font-size-100); 54690 font-weight: var(--font-weight-600); 54691 line-height: var(--font-line-height-100); 54692 letter-spacing: var(--font-letter-spacing-loosest); 54693 `, monoMdRegular: lt$2` 54694 font-family: var(--font-family-mono); 54695 font-size: var(--font-size-400); 54696 font-weight: var(--font-weight-400); 54697 line-height: var(--font-line-height-400); 54698 letter-spacing: var(--font-letter-spacing-densest); 54699 `, monoMdMedium: lt$2` 54700 font-family: var(--font-family-mono); 54701 font-size: var(--font-size-400); 54702 font-weight: var(--font-weight-500); 54703 line-height: var(--font-line-height-400); 54704 letter-spacing: var(--font-letter-spacing-densest); 54705 `, monoMdSemibold: lt$2` 54706 font-family: var(--font-family-mono); 54707 font-size: var(--font-size-400); 54708 font-weight: var(--font-weight-600); 54709 line-height: var(--font-line-height-400); 54710 letter-spacing: var(--font-letter-spacing-densest); 54711 `, monoSmRegular: lt$2` 54712 font-family: var(--font-family-mono); 54713 font-size: var(--font-size-300); 54714 font-weight: var(--font-weight-400); 54715 line-height: var(--font-line-height-300); 54716 letter-spacing: var(--font-letter-spacing-denser); 54717 `, monoSmMedium: lt$2` 54718 font-family: var(--font-family-mono); 54719 font-size: var(--font-size-300); 54720 font-weight: var(--font-weight-500); 54721 line-height: var(--font-line-height-300); 54722 letter-spacing: var(--font-letter-spacing-denser); 54723 `, monoSmSemibold: lt$2` 54724 font-family: var(--font-family-mono); 54725 font-size: var(--font-size-300); 54726 font-weight: var(--font-weight-600); 54727 line-height: var(--font-line-height-300); 54728 letter-spacing: var(--font-letter-spacing-denser); 54729 `, monoXsRegular: lt$2` 54730 font-family: var(--font-family-mono); 54731 font-size: var(--font-size-200); 54732 font-weight: var(--font-weight-400); 54733 line-height: var(--font-line-height-200); 54734 letter-spacing: var(--font-letter-spacing-dense); 54735 `, monoXsMedium: lt$2` 54736 font-family: var(--font-family-mono); 54737 font-size: var(--font-size-200); 54738 font-weight: var(--font-weight-500); 54739 line-height: var(--font-line-height-200); 54740 letter-spacing: var(--font-letter-spacing-dense); 54741 `, monoXsSemibold: lt$2` 54742 font-family: var(--font-family-mono); 54743 font-size: var(--font-size-200); 54744 font-weight: var(--font-weight-600); 54745 line-height: var(--font-line-height-200); 54746 letter-spacing: var(--font-letter-spacing-dense); 54747 `, mono2xsRegular: lt$2` 54748 font-family: var(--font-family-mono); 54749 font-size: var(--font-size-100); 54750 font-weight: var(--font-weight-400); 54751 line-height: var(--font-line-height-100); 54752 letter-spacing: var(--font-letter-spacing-normal); 54753 `, mono2xsMedium: lt$2` 54754 font-family: var(--font-family-mono); 54755 font-size: var(--font-size-100); 54756 font-weight: var(--font-weight-500); 54757 line-height: var(--font-line-height-100); 54758 letter-spacing: var(--font-letter-spacing-normal); 54759 `, mono2xsSemibold: lt$2` 54760 font-family: var(--font-family-mono); 54761 font-size: var(--font-size-100); 54762 font-weight: var(--font-weight-600); 54763 line-height: var(--font-line-height-100); 54764 letter-spacing: var(--font-letter-spacing-normal); 54765 ` }; 54766 var Y = { AD: { name: "Andorra", native: "Andorra", phone: [376], continent: "EU", capital: "Andorra la Vella", currency: ["EUR"], languages: ["ca"] }, AE: { name: "United Arab Emirates", native: "دÙÙØ© Ø§ÙØ¥Ù ارات Ø§ÙØ¹Ø±Ø¨ÙØ© اÙÙ ØªØØ¯Ø©", phone: [971], continent: "AS", capital: "Abu Dhabi", currency: ["AED"], languages: ["ar"] }, AF: { name: "Afghanistan", native: "Ø§ÙØºØ§ÙستاÙ", phone: [93], c
54766ontinent: "AS", capital: "Kabul", currency: ["AFN"], languages: ["ps", "uz", "tk"] }, AG: { name: "Antigua and Barbuda", native: "Antigua and Barbuda", phone: [1268], continent: "NA", capital: "Saint John's", currency: ["XCD"], languages: ["en"] }, AI: { name: "Anguilla", native: "Anguilla", phone: [1264], continent: "NA", capital: "The Valley", currency: ["XCD"], languages: ["en"] }, AL: { name: "Albania", native: "Shqipëria", phone: [355], continent: "EU", capital: "Tirana", currency: ["ALL"], languages: ["sq"] }, AM: { name: "Armenia", native: "ÕÕ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶", phone: [374], continent: "AS", capital: "Yerevan", currency: ["AMD"], languages: ["hy", "ru"] }, AO: { name: "Angola", native: "Angola", phone: [244], continent: "AF", capital: "Luanda", currency: ["AOA"], languages: ["pt"] }, AQ: { name: "Antarctica", native: "Antarctica", phone: [672], continent: "AN", capital: "", currency: [], languages: [] }, AR: { name: "Argentina", native: "Argentina", phone: [54], continent: "SA", capital: "Buenos Aires", currency: ["ARS"], languages: ["es", "gn"] }, AS: { name: "American Samoa", native: "American Samoa", phone: [1684], continent: "OC", capital: "Pago Pago", currency: ["USD"], languages: ["en", "sm"] }, AT: { name: "Austria", native: "Ãsterreich", phone: [43], continent: "EU", capital: "Vienna", currency: ["EUR"], languages: ["de"] }, AU: { name: "Australia", native: "Australia", phone: [61], continent: "OC", capital: "Canberra", currency: ["AUD"], languages: ["en"] }, AW: { name: "Aruba", native: "Aruba", phone: [297], continent: "NA", capital: "Oranjestad", currency: ["AWG"], languages: ["nl", "pa"] }, AX: { name: "Aland", native: "Ã
land", phone: [358], continent: "EU", capital: "Mariehamn", currency: ["EUR"], languages: ["sv"], partOf: "FI" }, AZ: { name: "Azerbaijan", native: "AzÉrbaycan", phone: [994], continent: "AS", continents: ["AS", "EU"], capital: "Baku", currency: ["AZN"], languages: ["az"] }, BA: { name: "Bosnia and Herzegovina", native: "Bosna i Hercegovina", phone: [387], continent: "EU", capital: "Sarajevo", currency: ["BAM"], languages: ["bs", "hr", "sr"] }, BB: { name: "Barbados", native: "Barbados", phone: [1246], continent: "NA", capital: "Bridgetown", currency: ["BBD"], languages: ["en"] }, BD: { name: "Bangladesh", native: "Bangladesh", phone: [880], continent: "AS", capital: "Dhaka", currency: ["BDT"], languages: ["bn"] }, BE: { name: "Belgium", native: "België", phone: [32], continent: "EU", capital: "Brussels", currency: ["EUR"], languages: ["nl", "fr", "de"] }, BF: { name: "Burkina Faso", native: "Burkina Faso", phone: [226], continent: "AF", capital: "Ouagadougou", currency: ["XOF"], languages: ["fr", "ff"] }, BG: { name: "Bulgaria", native: "ÐÑлгаÑиÑ", phone: [359], continent: "EU", capital: "Sofia", currency: ["BGN"], languages: ["bg"] }, BH: { name: "Bahrain", native: "âØ§ÙØ¨ØØ±ÙÙ", phone: [973], continent: "AS", capital: "Manama", currency: ["BHD"], languages: ["ar"] }, BI: { name: "Burundi", native: "Burundi", phone: [257], continent: "AF", capital: "Bujumbura", currency: ["BIF"], languages: ["fr", "rn"] }, BJ: { name: "Benin", native: "Bénin", phone: [229], continent: "AF", capital: "Porto-Novo", currency: ["XOF"], languages: ["fr"] }, BL: { name: "Saint Barthelemy", native: "Saint-Barthélemy", phone: [590], continent: "NA", capital: "Gustavia", currency: ["EUR"], languages: ["fr"] }, BM: { name: "Bermuda", native: "Bermuda", phone: [1441], continent: "NA", capital: "Hamilton", currency: ["BMD"], languages: ["en"] }, BN: { name: "Brunei", native: "Negara Brunei Darussalam", phone: [673], continent: "AS", capital: "Bandar Seri Begawan", currency: ["BND"], languages: ["ms"] }, BO: { name: "Bolivia", native: "Bolivia", phone: [591], continent: "SA", capital: "Sucre", currency: ["BOB", "BOV"], languages: ["es", "ay", "qu"] }, BQ: { name: "Bonaire", native: "Bonaire", phone: [5997], continent: "NA", capital: "Kralendijk", currency: ["USD"], languages: ["nl"] }, BR: { name: "Brazil", native: "Brasil", phone: [55], continent: "SA", capital: "BrasÃlia", currency: ["BRL"], languages: ["pt"] }, BS: { name: "Bahamas", native: "Bahamas", phone: [1242], continent: "NA", capital: "Nassau",
54766currency: ["BSD"], languages: ["en"] }, BT: { name: "Bhutan", native: "ʼbrug-yul", phone: [975], continent: "AS", capital: "Thimphu", currency: ["BTN", "INR"], languages: ["dz"] }, BV: { name: "Bouvet Island", native: "Bouvetøya", phone: [47], continent: "AN", capital: "", currency: ["NOK"], languages: ["no", "nb", "nn"] }, BW: { name: "Botswana", native: "Botswana", phone: [267], continent: "AF", capital: "Gaborone", currency: ["BWP"], languages: ["en", "tn"] }, BY: { name: "Belarus", native: "ÐелаÑÑÌÑÑ", phone: [375], continent: "EU", capital: "Minsk", currency: ["BYN"], languages: ["be", "ru"] }, BZ: { name: "Belize", native: "Belize", phone: [501], continent: "NA", capital: "Belmopan", currency: ["BZD"], languages: ["en", "es"] }, CA: { name: "Canada", native: "Canada", phone: [1], continent: "NA", capital: "Ottawa", currency: ["CAD"], languages: ["en", "fr"] }, CC: { name: "Cocos (Keeling) Islands", native: "Cocos (Keeling) Islands", phone: [61], continent: "AS", capital: "West Island", currency: ["AUD"], languages: ["en"] }, CD: { name: "Democratic Republic of the Congo", native: "République démocratique du Congo", phone: [243], continent: "AF", capital: "Kinshasa", currency: ["CDF"], languages: ["fr", "ln", "kg", "sw", "lu"] }, CF: { name: "Central African Republic", native: "Ködörösêse tî Bêafrîka", phone: [236], continent: "AF", capital: "Bangui", currency: ["XAF"], languages: ["fr", "sg"] }, CG: { name: "Republic of the Congo", native: "République du Congo", phone: [242], continent: "AF", capital: "Brazzaville", currency: ["XAF"], languages: ["fr", "ln"] }, CH: { name: "Switzerland", native: "Schweiz", phone: [41], continent: "EU", capital: "Bern", currency: ["CHE", "CHF", "CHW"], languages: ["de", "fr", "it"] }, CI: { name: "Ivory Coast", native: "Côte d'Ivoire", phone: [225], continent: "AF", capital: "Yamoussoukro", currency: ["XOF"], languages: ["fr"] }, CK: { name: "Cook Islands", native: "Cook Islands", phone: [682], continent: "OC", capital: "Avarua", currency: ["NZD"], languages: ["en"] }, CL: { name: "Chile", native: "Chile", phone: [56], continent: "SA", capital: "Santiago", currency: ["CLF", "CLP"], languages: ["es"] }, CM: { name: "Cameroon", native: "Cameroon", phone: [237], continent: "AF", capital: "Yaoundé", currency: ["XAF"], languages: ["en", "fr"] }, CN: { name: "China", native: "ä¸å½", phone: [86], continent: "AS", capital: "Beijing", currency: ["CNY"], languages: ["zh"] }, CO: { name: "Colombia", native: "Colombia", phone: [57], continent: "SA", capital: "Bogotá", currency: ["COP"], languages: ["es"] }, CR: { name: "Costa Rica", native: "Costa Rica", phone: [506], continent: "NA", capital: "San José", currency: ["CRC"], languages: ["es"] }, CU: { name: "Cuba", native: "Cuba", phone: [53], continent: "NA", capital: "Havana", currency: ["CUC", "CUP"], languages: ["es"] }, CV: { name: "Cape Verde", native: "Cabo Verde", phone: [238], continent: "AF", capital: "Praia", currency: ["CVE"], languages: ["pt"] }, CW: { name: "Curacao", native: "Curaçao", phone: [5999], continent: "NA", capital: "Willemstad", currency: ["ANG"], languages: ["nl", "pa", "en"] }, CX: { name: "Christmas Island", native: "Christmas Island", phone: [61], continent: "AS", capital: "Flying Fish Cove", currency: ["AUD"], languages: ["en"] }, CY: { name: "Cyprus", native: "ÎÏÏÏοÏ", phone: [357], continent: "EU", capital: "Nicosia", currency: ["EUR"], languages: ["el", "tr", "hy"] }, CZ: { name: "Czech Republic", native: "Äeská republika", phone: [420], continent: "EU", capital: "Prague", currency: ["CZK"], languages: ["cs"] }, DE: { name: "Germany", native: "Deutschland", phone: [49], continent: "EU", capital: "Berlin", currency: ["EUR"], languages: ["de"] }, DJ: { name: "Djibouti", native: "Djibouti", phone: [253], continent: "AF", capital: "Djibouti", currency: ["DJF"], languages: ["fr", "ar"] }, DK: { name: "Denmark", native: "Danmark", phone: [45], continent: "EU", continents: ["EU", "NA"], capital: "Copenhagen", currency: ["DKK"], languages: ["da"] }, DM: { name: "Dominica", native: "Dominica", phone: [1767], continent: "NA", capital: "Roseau", currency: ["XCD"], languages: ["en"] }, DO: { name: "Dominican Republic", native: "República Dominicana", phone: [1809, 1829, 1849], c
54766ontinent: "NA", capital: "Santo Domingo", currency: ["DOP"], languages: ["es"] }, DZ: { name: "Algeria", native: "Ø§ÙØ¬Ø²Ø§Ø¦Ø±", phone: [213], continent: "AF", capital: "Algiers", currency: ["DZD"], languages: ["ar"] }, EC: { name: "Ecuador", native: "Ecuador", phone: [593], continent: "SA", capital: "Quito", currency: ["USD"], languages: ["es"] }, EE: { name: "Estonia", native: "Eesti", phone: [372], continent: "EU", capital: "Tallinn", currency: ["EUR"], languages: ["et"] }, EG: { name: "Egypt", native: "Ù
صرâ", phone: [20], continent: "AF", continents: ["AF", "AS"], capital: "Cairo", currency: ["EGP"], languages: ["ar"] }, EH: { name: "Western Sahara", native: "Ø§ÙØµØØ±Ø§Ø¡ Ø§ÙØºØ±Ø¨ÙØ©", phone: [212], continent: "AF", capital: "El Aaiún", currency: ["MAD", "DZD", "MRU"], languages: ["es"] }, ER: { name: "Eritrea", native: "á¤ááµá«", phone: [291], continent: "AF", capital: "Asmara", currency: ["ERN"], languages: ["ti", "ar", "en"] }, ES: { name: "Spain", native: "España", phone: [34], continent: "EU", capital: "Madrid", currency: ["EUR"], languages: ["es", "eu", "ca", "gl", "oc"] }, ET: { name: "Ethiopia", native: "á¢áµá®áµá«", phone: [251], continent: "AF", capital: "Addis Ababa", currency: ["ETB"], languages: ["am"] }, FI: { name: "Finland", native: "Suomi", phone: [358], continent: "EU", capital: "Helsinki", currency: ["EUR"], languages: ["fi", "sv"] }, FJ: { name: "Fiji", native: "Fiji", phone: [679], continent: "OC", capital: "Suva", currency: ["FJD"], languages: ["en", "fj", "hi", "ur"] }, FK: { name: "Falkland Islands", native: "Falkland Islands", phone: [500], continent: "SA", capital: "Stanley", currency: ["FKP"], languages: ["en"] }, FM: { name: "Micronesia", native: "Micronesia", phone: [691], continent: "OC", capital: "Palikir", currency: ["USD"], languages: ["en"] }, FO: { name: "Faroe Islands", native: "Føroyar", phone: [298], continent: "EU", capital: "Tórshavn", currency: ["DKK"], languages: ["fo"] }, FR: { name: "France", native: "France", phone: [33], continent: "EU", capital: "Paris", currency: ["EUR"], languages: ["fr"] }, GA: { name: "Gabon", native: "Gabon", phone: [241], continent: "AF", capital: "Libreville", currency: ["XAF"], languages: ["fr"] }, GB: { name: "United Kingdom", native: "United Kingdom", phone: [44], continent: "EU", capital: "London", currency: ["GBP"], languages: ["en"] }, GD: { name: "Grenada", native: "Grenada", phone: [1473], continent: "NA", capital: "St. George's", currency: ["XCD"], languages: ["en"] }, GE: { name: "Georgia", native: "á¡áá¥áá ááááá", phone: [995], continent: "AS", continents: ["AS", "EU"], capital: "Tbilisi", currency: ["GEL"], languages: ["ka"] }, GF: { name: "French Guiana", native: "Guyane française", phone: [594], continent: "SA", capital: "Cayenne", currency: ["EUR"], languages: ["fr"] }, GG: { name: "Guernsey", native: "Guernsey", phone: [44], continent: "EU", capital: "St. Peter Port", currency: ["GBP"], languages: ["en", "fr"] }, GH: { name: "Ghana", native: "Ghana", phone: [233], continent: "AF", capital: "Accra", currency: ["GHS"], languages: ["en"] }, GI: { name: "Gibraltar", native: "Gibraltar", phone: [350], continent: "EU", capital: "Gibraltar", currency: ["GIP"], languages: ["en"] }, GL: { name: "Greenland", native: "Kalaallit Nunaat", phone: [299], continent: "NA", capital: "Nuuk", currency: ["DKK"], languages: ["kl"] }, GM: { name: "Gambia", native: "Gambia", phone: [220], continent: "AF", capital: "Banjul", currency: ["GMD"], languages: ["en"] }, GN: { name: "Guinea", native: "Guinée", phone: [224], continent: "AF", capital: "Conakry", currency: ["GNF"], languages: ["fr", "ff"] }, GP: { name: "Guadeloupe", native: "Guadeloupe", phone: [590], continent: "NA", capital: "Basse-Terre", currency: ["EUR"], languages: ["fr"] }, GQ: { name: "Equatorial Guinea", native: "Guinea Ecuatorial", phone: [240], continent: "AF", capital: "Malabo", currency: ["XAF"], languages: ["es", "fr"] }, GR: { name: "Greece", native: "Îλλάδα", phone: [30], continent: "EU", capital: "Athens", currency: ["EUR"], languages: ["el"] }, GS: { name: "South Georgia and the South Sandwich Islands", native: "South Georgia", phone: [500], continent: "AN", capital: "King Edward Point", currency: ["GBP"], languages: ["en"] }, GT: { name: "Guatemala", native: "Guatemala", phone: [502], continent: "NA", capital: "Guatemala City", currency: ["GTQ"], languages: ["es"] }, GU: { name: "Guam", native: "Guam", phone: [1671], continent: "OC", capital: "HagÃ¥tña", currency: ["USD"], languages: ["en", "ch", "es"] }, GW: { name: "Guinea-Bissau", native: "Guiné-Bissau", phone: [245], continent: "AF", capital: "Bissau", currency: ["XOF"], languages: ["pt"] }, GY: { name: "Guyana", native: "Guyana", phone: [592], continent: "SA", capital: "Georgetown", currency: ["GYD"], languages: ["en"] }, HK: { name: "Hong Kong", native: "馿¸¯", phone: [852], continent: "AS", capital: "City of Victoria", currency: ["HKD"], languages: ["zh", "en"] }, HM: { name: "Heard Island and McDonald Islands", native: "Heard Island and McDonald Islands", phone: [61], continent: "AN", capital: "", currency: ["AUD"], languages: ["en"] }, HN: { name: "Honduras", native: "Honduras", phone: [504], continent: "NA", capital: "Tegucigalpa", currency: ["HNL"], languages: ["es"] }, HR: { name: "Croatia", native: "Hrvatska", phone: [385], continent: "EU", capital: "Zagreb", currency: ["EUR"], languages: ["hr"] }, HT: { name: "Haiti", native: "Haïti", phone: [509], continent: "NA", capital: "Port-au-Prince", currency: ["HTG", "USD"], languages: ["fr", "ht"] }, HU: { name: "Hungary", native: "Magyarország", phone: [36], continent: "EU", capital: "Budapest", currency: ["HUF"], languages: ["hu"] }, ID: { name: "Indonesia", native: "Indonesia", phone: [62], continent: "AS", capital: "Jakarta", currency: ["IDR"], languages: ["id"] }, IE: { name: "Ireland", native: "Ãire", phone: [353], continent: "EU", capital: "Dublin", currency: ["EUR"], languages: ["ga", "en"] }, IL: { name: "Israel", native: "×ִשְ×רָ×Öµ×", phone: [972], continent: "AS", capital: "Jerusalem", currency: ["ILS"], languages: ["he", "ar"] }, IM: { name: "Isle of Man", native: "Isle of Man", phone: [44], continent: "EU", capital: "Douglas", currency: ["GBP"], languages: ["en", "gv"] }, IN: { name: "India", native: "à¤à¤¾à¤°à¤¤", phone: [91], continent: "AS", capital: "New Delhi", currency: ["INR"], languages: ["hi", "en"] }, IO: { name: "British Indian Ocean Territory", native: "British Indian Ocean Territory", phone: [246], continent: "AS", capital: "Diego Garcia", currency: ["USD"], languages: ["en"] }, IQ: { name: "Iraq", native: "Ø§ÙØ¹Ø±Ø§Ù", phone: [964], continent: "AS", capital: "Baghdad", currency: ["IQD"], languages: ["ar", "ku"] }, IR: { name: "Iran", native: "Ø§ÛØ±Ø§Ù", phone: [98], continent: "AS", capital: "Tehran", currency: ["IRR"], languages: ["fa"] }, IS: { name: "Iceland", native: "Ãsland", phone: [354], continent: "EU", capital: "Reykjavik", currency: ["ISK"], languages: ["is"] }, IT: { name: "Italy", native: "Italia", phone: [39], continent: "EU", capital: "Rome", currency: ["EUR"], languages: ["it"] }, JE: { name: "Jersey", native: "Jersey", phone: [44], continent: "EU", capital: "Saint Helier", currency: ["GBP"], languages: ["en", "fr"] }, JM: { name: "Jamaica", native: "Jamaica", phone: [1876], continent: "NA", capital: "Kingston", currency: ["JMD"], languages: ["en"] }, JO: { name: "Jordan", native: "Ø§ÙØ£Ø±Ø¯Ù", phone: [962], continent: "AS", capital: "Amman", currency: ["JOD"], languages: ["ar"] }, JP: { name: "Japan", native: "æ¥æ¬", phone: [81], continent: "AS", capital: "Tokyo", currency: ["JPY"], languages: ["ja"] }, KE: { name: "Kenya", native: "Kenya", phone: [254], continent: "AF", capital: "Nairobi", currency: ["KES"], languages: ["en", "sw"] }, KG: { name: "Kyrgyzstan", native: "ÐÑÑгÑзÑÑан", phone: [99
547666], continent: "AS", capital: "Bishkek", currency: ["KGS"], languages: ["ky", "ru"] }, KH: { name: "Cambodia", native: "KâmpÅchéa", phone: [855], continent: "AS", capital: "Phnom Penh", currency: ["KHR"], languages: ["km"] }, KI: { name: "Kiribati", native: "Kiribati", phone: [686], continent: "OC", capital: "South Tarawa", currency: ["AUD"], languages: ["en"] }, KM: { name: "Comoros", native: "Komori", phone: [269], continent: "AF", capital: "Moroni", currency: ["KMF"], languages: ["ar", "fr"] }, KN: { name: "Saint Kitts and Nevis", native: "Saint Kitts and Nevis", phone: [1869], continent: "NA", capital: "Basseterre", currency: ["XCD"], languages: ["en"] }, KP: { name: "North Korea", native: "ë¶í", phone: [850], continent: "AS", capital: "Pyongyang", currency: ["KPW"], languages: ["ko"] }, KR: { name: "South Korea", native: "ëí민êµ", phone: [82], continent: "AS", capital: "Seoul", currency: ["KRW"], languages: ["ko"] }, KW: { name: "Kuwait", native: "اÙÙÙÙØª", phone: [965], continent: "AS", capital: "Kuwait City", currency: ["KWD"], languages: ["ar"] }, KY: { name: "Cayman Islands", native: "Cayman Islands", phone: [1345], continent: "NA", capital: "George Town", currency: ["KYD"], languages: ["en"] }, KZ: { name: "Kazakhstan", native: "ÒазаÒÑÑан", phone: [7], continent: "AS", continents: ["AS", "EU"], capital: "Astana", currency: ["KZT"], languages: ["kk", "ru"] }, LA: { name: "Laos", native: "ສàºàºàº¥àº²àº§", phone: [856], continent: "AS", capital: "Vientiane", currency: ["LAK"], languages: ["lo"] }, LB: { name: "Lebanon", native: "ÙØ¨ÙاÙ", phone: [961], continent: "AS", capital: "Beirut", currency: ["LBP"], languages: ["ar", "fr"] }, LC: { name: "Saint Lucia", native: "Saint Lucia", phone: [1758], continent: "NA", capital: "Castries", currency: ["XCD"], languages: ["en"] }, LI: { name: "Liechtenstein", native: "Liechtenstein", phone: [423], continent: "EU", capital: "Vaduz", currency: ["CHF"], languages: ["de"] }, LK: { name: "Sri Lanka", native: "ÅrÄ« laá¹kÄva", phone: [94], continent: "AS", capital: "Colombo", currency: ["LKR"], languages: ["si", "ta"] }, LR: { name: "Liberia", native: "Liberia", phone: [231], continent: "AF", capital: "Monrovia", currency: ["LRD"], languages: ["en"] }, LS: { name: "Lesotho", native: "Lesotho", phone: [266], continent: "AF", capital: "Maseru", currency: ["LSL", "ZAR"], languages: ["en", "st"] }, LT: { name: "Lithuania", native: "Lietuva", phone: [370], continent: "EU", capital: "Vilnius", currency: ["EUR"], languages: ["lt"] }, LU: { name: "Luxembourg", native: "Luxembourg", phone: [352], continent: "EU", capital: "Luxembourg", currency: ["EUR"], languages: ["fr", "de", "lb"] }, LV: { name: "Latvia", native: "Latvija", phone: [371], continent: "EU", capital: "Riga", currency: ["EUR"], languages: ["lv"] }, LY: { name: "Libya", native: "âÙÙØ¨Ùا", phone: [218], continent: "AF", capital: "Tripoli", currency: ["LYD"], languages: ["ar"] }, MA: { name: "Morocco", native: "اÙÙ
غرب", phone: [212], continent: "AF", capital: "Rabat", currency: ["MAD"], languages: ["ar"] }, MC: { name: "Monaco", native: "Monaco", phone: [377], continent: "EU", capital: "Monaco", currency: ["EUR"], languages: ["fr"] }, MD: { name: "Moldova", native: "Moldova", phone: [373], continent: "EU", capital: "ChiÈinÄu", currency: ["MDL"], languages: ["ro"] }, ME: { name: "Montenegro", native: "ЦÑна ÐоÑа", phone: [382], continent: "EU", capital: "Podgorica", currency: ["EUR"], languages: ["sr", "bs", "sq", "hr"] }, MF: { name: "Saint Martin", native: "Saint-Martin", phone: [590], continent: "NA", capital: "Marigot", currency: ["EUR"], languages: ["en", "fr", "nl"] }, MG: { name: "Madagascar", native: "Madagasikara", phone: [261], continent: "AF", capital: "Antananarivo", currency: ["MGA"], languages: ["fr", "mg"] }, MH: { name: "Marshall Islands", native: "M̧ajeļ", phone: [692], continent: "OC", capital: "Majuro", currency: ["USD"], languages: ["en", "mh"] }, MK: { name: "North Macedonia", native: "СевеÑна ÐакедониÑа", phone: [389], continent: "EU", capital: "Skopje", currency: ["MKD"], languages: ["mk"] }, ML: { name: "Mali", native: "Mali", phone: [223], continent: "AF", capital: "Bamako", currency: ["XOF"], languages: ["fr"] }, MM: { name: "Myanmar (Burma)", native: "áá¼ááºáá¬", phone: [95], continent: "AS", capital: "Naypyidaw", currency: ["MMK"], languages: ["my"] }, MN: { name: "Mongolia", native: "Ðонгол ÑлÑ", phone: [976], continent: "AS", capital: "Ulan Bator", currency: ["MNT"], languages: ["mn"] }, MO: { name: "Macao", native: "æ¾³é", phone: [853], continent: "AS", capital: "", currency: ["MOP"], languages: ["zh", "pt"] }, MP: { name: "Northern Mariana Islands", native: "Northern Mariana Islands", phone: [1670], continent: "OC", capital: "Saipan", currency: ["USD"], languages: ["en", "ch"] }
54766, MQ: { name: "Martinique", native: "Martinique", phone: [596], continent: "NA", capital: "Fort-de-France", currency: ["EUR"], languages: ["fr"] }, MR: { name: "Mauritania", native: "Ù
ÙØ±ÙتاÙÙØ§", phone: [222], continent: "AF", capital: "Nouakchott", currency: ["MRU"], languages: ["ar"] }, MS: { name: "Montserrat", native: "Montserrat", phone: [1664], continent: "NA", capital: "Plymouth", currency: ["XCD"], languages: ["en"] }, MT: { name: "Malta", native: "Malta", phone: [356], continent: "EU", capital: "Valletta", currency: ["EUR"], languages: ["mt", "en"] }, MU: { name: "Mauritius", native: "Maurice", phone: [230], continent: "AF", capital: "Port Louis", currency: ["MUR"], languages: ["en"] }, MV: { name: "Maldives", native: "Maldives", phone: [960], continent: "AS", capital: "Malé", currency: ["MVR"], languages: ["dv"] }, MW: { name: "Malawi", native: "Malawi", phone: [265], continent: "AF", capital: "Lilongwe", currency: ["MWK"], languages: ["en", "ny"] }, MX: { name: "Mexico", native: "México", phone: [52], continent: "NA", capital: "Mexico City", currency: ["MXN"], languages: ["es"] }, MY: { name: "Malaysia", native: "Malaysia", phone: [60], continent: "AS", capital: "Kuala Lumpur", currency: ["MYR"], languages: ["ms"] }, MZ: { name: "Mozambique", native: "Moçambique", phone: [258], continent: "AF", capital: "Maputo", currency: ["MZN"], languages: ["pt"] }, NA: { name: "Namibia", native: "Namibia", phone: [264], continent: "AF", capital: "Windhoek", currency: ["NAD", "ZAR"], languages: ["en", "af"] }, NC: { name: "New Caledonia", native: "Nouvelle-Calédonie", phone: [687], continent: "OC", capital: "Nouméa", currency: ["XPF"], languages: ["fr"] }, NE: { name: "Niger", native: "Niger", phone: [227], continent: "AF", capital: "Niamey", currency: ["XOF"], languages: ["fr"] }, NF: { name: "Norfolk Island", native: "Norfolk Island", phone: [672], continent: "OC", capital: "Kingston", currency: ["AUD"], languages: ["en"] }, NG: { name: "Nigeria", native: "Nigeria", phone: [234], continent: "AF", capital: "Abuja", currency: ["NGN"], languages: ["en"] }, NI: { name: "Nicaragua", native: "Nicaragua", phone: [505], continent: "NA", capital: "Managua", currency: ["NIO"], languages: ["es"] }, NL: { name: "Netherlands", native: "Nederland", phone: [31], continent: "EU", capital: "Amsterdam", currency: ["EUR"], languages: ["nl"] }, NO: { name: "Norway", native: "Norge", phone: [47], continent: "EU", capital: "Oslo", currency: ["NOK"], languages: ["no", "nb", "nn"] }, NP: { name: "Nepal", native: "नà¥à¤ªà¤¾à¤²", phone: [977], continent: "AS", capital: "Kathmandu", currency: ["NPR"], languages: ["ne"] }, NR: { name: "Nauru", native: "Nauru", phone: [674], continent: "OC", capital: "Yaren", currency: ["AUD"], languages: ["en", "na"] }, NU: { name: "Niue", native: "NiuÄ", phone: [683], continent: "OC", capital: "Alofi", currency: ["NZD"], languages: ["en"] }, NZ: { name: "New Zealand", native: "New Zealand", phone: [64], continent: "OC", capital: "Wellington", currency: ["NZD"], languages: ["en", "mi"] }, OM: { name: "Oman", native: "عÙ
اÙ", phone: [968], continent: "AS", capital: "Muscat", currency: ["OMR"], languages: ["ar"] }, PA: { name: "Panama", native: "Panamá", phone: [507], continent: "NA", capital: "Panama City", currency: ["PAB", "USD"], languages: ["es"] }, PE: { name: "Peru", native: "Perú", phone: [51], continent: "SA", capital: "Lima", currency: ["PEN"], languages: ["es"] }, PF: { name: "French Polynesia", native: "Polynésie française", phone: [689], continent: "OC", capital: "PapeetÄ", currency: ["XPF"], languages: ["fr"] }, PG: { name: "Papua New Guinea", native: "Papua Niugini", phone: [675], continent: "OC", capital: "Port Moresby", currency: ["PGK"], languages: ["en"] }, PH: { name: "Philippines", native: "Pilipinas", phone: [63], continent: "AS", capital: "Manila", currency: ["PHP"], languages: ["en"] }, PK: { name: "Pakistan", native: "Pakistan", phone: [92], continent: "AS", capital: "Islamabad", currency: ["PKR"], languages: ["en", "ur"] }, PL: { name: "Poland", native: "Polska", phone: [48], continent: "EU", capital: "Warsaw", currency: ["PLN"], languages: ["pl"] }, PM: { name: "Saint Pierre and Miquelon", native: "Saint-Pierre-et-Miquelon", phone: [508], continent: "NA", capital: "Saint-Pierre", currency: ["EUR"], languages: ["fr"] }, PN: { name: "Pitcairn Islands", native: "Pitcairn Islands", phone: [64], continent: "OC", capital: "Adamstown", currency: ["NZD"], languages: ["en"] }, PR: { name: "Puerto Rico", native: "Puerto Rico", phone: [1787, 1939], continent: "NA", capital: "San Juan", currency: ["USD"], languages: ["es", "en"] }, PS: { name: "Palestine", native: "ÙÙØ³Ø·ÙÙ", phone: [970], continent: "AS", capital: "Ramallah", currency: ["ILS"], languages: ["ar"] }, PT: { name: "Portugal", native: "Portugal", phone: [351], continent: "EU", capital: "Lisbon", currency: ["EUR"], languages: ["pt"] }, PW: { name: "Palau", native: "Palau", phone: [680], continent: "OC", capital: "Ngerulmud", currency: ["USD"], languages: ["en"] }, PY: { name: "Paraguay", native: "Paraguay", phone: [595], continent: "SA", capital: "Asunción", currency: ["PYG"], languages: ["es", "gn"] }, QA: { name: "Qatar", native: "ÙØ·Ø±", phone: [974], continent: "AS", capital: "Doha", currency: ["QAR"], languages: ["ar"] }, RE: { name: "Reunion", native: "La Réunion", phone: [262], continent: "AF", capital: "Saint-Denis", currency: ["EUR"], languages: ["fr"] }, RO: { name: "Romania", native: "România", phone: [40], continent: "EU", capital: "Bucharest", currency: ["RON"], languages: ["ro"] }, RS: { name: "Serbia", native: "СÑбиÑа", phone: [381], continent: "EU", capital: "Belgrade", currency: ["RSD"], languages: ["sr"] }, RU: { name: "Russia", native: "РоÑÑиÑ", phone: [7], continent: "AS", continents: ["AS", "EU"], capital: "Moscow", currency: ["RUB"], languages: ["ru"] }, RW: { name: "Rwanda", native: "Rwanda", phone: [250], continent: "AF", capital: "Kigali", currency: ["RWF"], languages: ["rw", "en", "fr"] }, SA: { name: "Saudi Arabia", native: "Ø§ÙØ¹Ø±Ø¨ÙØ© Ø§ÙØ³Ø¹ÙØ¯ÙØ©", phone: [966], continent: "AS", capital: "Riyadh", currency: ["SAR"], languages: ["ar"] }, SB: { name: "Solomon Islands", native: "Solomon Islands", phone: [677], continent: "OC", capital: "Honiara", currency: ["SBD"], languages: ["en"] }, SC: { name: "Seychelles", native: "Seychelles", phone: [248], continent: "AF", capital: "Victoria", currency: ["SCR"], languages: ["fr", "en"] }, SD: { name: "Sudan", native: "Ø§ÙØ³ÙداÙ", phone: [249], continent: "AF", capital: "Khartoum", currency: ["SDG"], languages: ["ar", "en"] }
54766, SE: { name: "Sweden", native: "Sverige", phone: [46], continent: "EU", capital: "Stockholm", currency: ["SEK"], languages: ["sv"] }, SG: { name: "Singapore", native: "Singapore", phone: [65], continent: "AS", capital: "Singapore", currency: ["SGD"], languages: ["en", "ms", "ta", "zh"] }, SH: { name: "Saint Helena", native: "Saint Helena", phone: [290], continent: "AF", capital: "Jamestown", currency: ["SHP"], languages: ["en"] }, SI: { name: "Slovenia", native: "Slovenija", phone: [386], continent: "EU", capital: "Ljubljana", currency: ["EUR"], languages: ["sl"] }, SJ: { name: "Svalbard and Jan Mayen", native: "Svalbard og Jan Mayen", phone: [4779], continent: "EU", capital: "Longyearbyen", currency: ["NOK"], languages: ["no"] }, SK: { name: "Slovakia", native: "Slovensko", phone: [421], continent: "EU", capital: "Bratislava", currency: ["EUR"], languages: ["sk"] }, SL: { name: "Sierra Leone", native: "Sierra Leone", phone: [232], continent: "AF", capital: "Freetown", currency: ["SLL"], languages: ["en"] }, SM: { name: "San Marino", native: "San Marino", phone: [378], continent: "EU", capital: "City of San Marino", currency: ["EUR"], languages: ["it"] }, SN: { name: "Senegal", native: "Sénégal", phone: [221], continent: "AF", capital: "Dakar", currency: ["XOF"], languages: ["fr"] }, SO: { name: "Somalia", native: "Soomaaliya", phone: [252], continent: "AF", capital: "Mogadishu", currency: ["SOS"], languages: ["so", "ar"] }, SR: { name: "Suriname", native: "Suriname", phone: [597], continent: "SA", capital: "Paramaribo", currency: ["SRD"], languages: ["nl"] }, SS: { name: "South Sudan", native: "South Sudan", phone: [211], continent: "AF", capital: "Juba", currency: ["SSP"], languages: ["en"] }, ST: { name: "Sao Tome and Principe", native: "São Tomé e PrÃncipe", phone: [239], continent: "AF", capital: "São Tomé", currency: ["STN"], languages: ["pt"] }, SV: { name: "El Salvador", native: "El Salvador", phone: [503], continent: "NA", capital: "San Salvador", currency: ["SVC", "USD"], languages: ["es"] }, SX: { name: "Sint Maarten", native: "Sint Maarten", phone: [1721], continent: "NA", capital: "Philipsburg", currency: ["ANG"], languages: ["nl", "en"] }, SY: { name: "Syria", native: "Ø³ÙØ±Ùا", phone: [963], continent: "AS", capital: "Damascus", currency: ["SYP"], languages: ["ar"] }, SZ: { name: "Eswatini", native: "Eswatini", phone: [268], continent: "AF", capital: "Lobamba", currency: ["SZL"], languages: ["en", "ss"] }, TC: { name: "Turks and Caicos Islands", native: "Turks and Caicos Islands", phone: [1649], continent: "NA", capital: "Cockburn Town", currency: ["USD"], languages: ["en"] }, TD: { name: "Chad", native: "Tchad", phone: [235], continent: "AF", capital: "N'Djamena", currency: ["XAF"], languages: ["fr", "ar"] }, TF: { name: "French Southern Territories", native: "Territoire des Terres australes et antarctiques fr", phone: [262], continent: "AN", capital: "Port-aux-Français", currency: ["EUR"], languages: ["fr"] }, TG: { name: "Togo", native: "Togo", phone: [228], continent: "AF", capital: "Lomé", currency: ["XOF"], languages: ["fr"] }, TH: { name: "Thailand", native: "à¸à¸£à¸°à¹à¸à¸¨à¹à¸à¸¢", phone: [66], continent: "AS", capital: "Bangkok", currency: ["THB"], languages: ["th"] }, TJ: { name: "Tajikistan", native: "ТоҷикиÑÑон", phone: [992], continent: "AS", capital: "Dushanbe", currency: ["TJS"], languages: ["tg", "ru"] }, TK: { name: "Tokelau", native: "Tokelau", phone: [690], continent: "OC", capital: "Fakaofo", currency: ["NZD"], languages: ["en"] }, TL: { name: "East Timor", native: "Timor-Leste", phone: [670], continent: "OC", capital: "Dili", currency: ["USD"], languages: ["pt"] }, TM: { name: "Turkmenistan", native: "Türkmenistan", phone: [993], continent: "AS", capital: "Ashgabat", currency: ["TMT"], languages: ["tk", "ru"] }, TN: { name: "Tunisia", native: "تÙÙØ³", phone: [216], continent: "AF", capital: "Tunis", currency: ["TND"], languages: ["ar"] }, TO: { name: "Tonga", native: "Tonga", phone: [676], continent: "OC", capital: "Nuku'alofa", currency: ["TOP"], languages: ["en", "to"] }, TR: { name: "Turkey", native: "Türkiye", phone: [90], continent: "AS", continents: ["AS", "EU"], capital: "Ankara", currency: ["TRY"], languages: ["tr"] }, TT: { name: "Trinidad and Tobago", native: "Trinidad and Tobago", phone: [1868], continent: "NA", capital: "Port of Spain", currency: ["TTD"], languages: ["en"] }, TV: { name: "Tuvalu", native: "Tuvalu", phone: [688], continent: "OC", capital: "Funafuti", currency: ["AUD"], languages: ["en"] }, TW: { name: "Taiwan", native: "èºç£", phone: [886], continent: "AS", capital: "Taipei", currency: ["TWD"], languages: ["zh"] }, TZ: { name: "Tanzania", native: "Tanzania", phone: [255], continent: "AF", capital: "Dodoma", currency: ["TZS"], languages: ["sw", "en"] }, UA: { name: "Ukraine", native: "УкÑаÑна", phone: [380], continent: "EU", capital: "Kyiv", currency: ["UAH"], languages: ["uk"] }, UG: { name: "Uganda", native: "Uganda", phone: [256], continent: "AF", capital: "K
54766ampala", currency: ["UGX"], languages: ["en", "sw"] }, UM: { name: "U.S. Minor Outlying Islands", native: "United States Minor Outlying Islands", phone: [1], continent: "OC", capital: "", currency: ["USD"], languages: ["en"] }, US: { name: "United States", native: "United States", phone: [1], continent: "NA", capital: "Washington D.C.", currency: ["USD", "USN", "USS"], languages: ["en"] }, UY: { name: "Uruguay", native: "Uruguay", phone: [598], continent: "SA", capital: "Montevideo", currency: ["UYI", "UYU"], languages: ["es"] }, UZ: { name: "Uzbekistan", native: "O'zbekiston", phone: [998], continent: "AS", capital: "Tashkent", currency: ["UZS"], languages: ["uz", "ru"] }, VA: { name: "Vatican City", native: "Vaticano", phone: [379], continent: "EU", capital: "Vatican City", currency: ["EUR"], languages: ["it", "la"] }, VC: { name: "Saint Vincent and the Grenadines", native: "Saint Vincent and the Grenadines", phone: [1784], continent: "NA", capital: "Kingstown", currency: ["XCD"], languages: ["en"] }, VE: { name: "Venezuela", native: "Venezuela", phone: [58], continent: "SA", capital: "Caracas", currency: ["VES"], languages: ["es"] }, VG: { name: "British Virgin Islands", native: "British Virgin Islands", phone: [1284], continent: "NA", capital: "Road Town", currency: ["USD"], languages: ["en"] }, VI: { name: "U.S. Virgin Islands", native: "United States Virgin Islands", phone: [1340], continent: "NA", capital: "Charlotte Amalie", currency: ["USD"], languages: ["en"] }, VN: { name: "Vietnam", native: "Viá»t Nam", phone: [84], continent: "AS", capital: "Hanoi", currency: ["VND"], languages: ["vi"] }, VU: { name: "Vanuatu", native: "Vanuatu", phone: [678], continent: "OC", capital: "Port Vila", currency: ["VUV"], languages: ["bi", "en", "fr"] }, WF: { name: "Wallis and Futuna", native: "Wallis et Futuna", phone: [681], continent: "OC", capital: "Mata-Utu", currency: ["XPF"], languages: ["fr"] }, WS: { name: "Samoa", native: "Samoa", phone: [685], continent: "OC", capital: "Apia", currency: ["WST"], languages: ["sm", "en"] }, XK: { name: "Kosovo", native: "Republika e Kosovës", phone: [377, 381, 383, 386], continent: "EU", capital: "Pristina", currency: ["EUR"], languages: ["sq", "sr"], userAssigned: true }, YE: { name: "Yemen", native: "اÙÙÙÙ ÙÙ", phone: [967], continent: "AS", capital: "Sana'a", currency: ["YER"], languages: ["ar"] }, YT: { name: "Mayotte", native: "Mayotte", phone: [262], continent: "AF", capital: "Mamoudzou", currency: ["EUR"], languages: ["fr"] }, ZA: { name: "South Africa", native: "South Africa", phone: [27], continent: "AF", capital: "Pretoria", currency: ["ZAR"], languages: ["af", "en", "nr", "st", "ss", "tn", "ts", "ve", "xh", "zu"] }, ZM: { name: "Zambia", native: "Zambia", phone: [260], continent: "AF", capital: "Lusaka", currency: ["ZMW"], languages: ["en"] }, ZW: { name: "Zimbabwe", native: "Zimbabwe", phone: [263], continent: "AF", capital: "Harare", currency: ["USD", "ZAR", "BWP", "GBP", "AUD", "CNY", "INR", "JPY"], languages: ["en", "sn", "nd"] } }; 54767 var lt = { AD: "AND", AE: "ARE", AF: "AFG", AG: "ATG", AI: "AIA", AL: "ALB", AM: "ARM", AO: "AGO", AQ: "ATA", AR: "ARG", AS: "ASM", AT: "AUT", AU: "AUS", AW: "ABW", AX: "ALA", AZ: "AZE", BA: "BIH", BB: "BRB", BD: "BGD", BE: "BEL", BF: "BFA", BG: "BGR", BH: "BHR", BI: "BDI", BJ: "BEN", BL: "BLM", BM: "BMU", BN: "BRN", BO: "BOL", BQ: "BES", BR: "BRA", BS: "BHS", BT: "BTN", BV: "BVT", BW: "BWA", BY: "BLR", BZ: "BLZ", CA: "CAN", CC: "CCK", CD: "COD", CF: "CAF", CG: "COG", CH: "CHE", CI: "CIV", CK: "COK", CL: "CHL", CM: "CMR", CN: "CHN", CO: "COL", CR: "CRI", CU: "CUB", CV: "CPV", CW: "CUW", CX: "CXR", CY: "CYP", CZ: "CZE", DE: "DEU", DJ: "DJI", DK: "DNK", DM: "DMA", DO: "DOM", DZ: "DZA", EC: "ECU", EE: "EST", EG: "EGY", EH: "ESH", ER: "ERI", ES: "ESP", ET: "ETH", FI: "FIN", FJ: "FJI", FK: "FLK", FM: "FSM", FO: "FRO", FR: "FRA", GA: "GAB", GB: "GBR", GD: "GRD", GE: "GEO", GF: "GUF", GG: "GGY", GH: "GHA", GI: "GIB", GL: "GRL", GM: "GMB", GN: "GIN", GP: "GLP", GQ: "GNQ", GR: "GRC", GS: "SGS", GT: "GTM", GU: "GUM", GW: "GNB", GY: "GUY", HK: "HKG", HM: "HMD", HN: "HND", HR: "HRV", HT: "HTI", HU: "HUN", ID: "IDN", IE: "IRL", IL: "ISR", IM: "IMN", IN: "IND", IO: "IOT", IQ: "IRQ", IR: "IRN", IS: "ISL", IT: "ITA", JE: "JEY", JM: "JAM", JO: "JOR", JP: "JPN", KE: "KEN", KG: "KGZ", KH: "KHM", KI: "KIR", KM: "COM", KN: "KNA", KP: "PRK", KR: "KOR", KW: "KWT", KY: "CYM", KZ: "KAZ", LA: "LAO", LB: "LBN", LC: "LCA", LI: "LIE", LK: "LKA", LR: "LBR", LS: "LSO", LT: "LTU", LU: "LUX", LV: "LVA", LY: "LBY", MA: "MAR", MC: "MCO", MD: "MDA", ME: "MNE", MF: "MAF", MG: "MDG", MH: "MHL", MK: "MKD", ML: "MLI", MM: "MMR", MN: "MNG", MO: "MAC", MP: "MNP", MQ: "MTQ", MR: "MRT", MS: "MSR", MT
54767: "MLT", MU: "MUS", MV: "MDV", MW: "MWI", MX: "MEX", MY: "MYS", MZ: "MOZ", NA: "NAM", NC: "NCL", NE: "NER", NF: "NFK", NG: "NGA", NI: "NIC", NL: "NLD", NO: "NOR", NP: "NPL", NR: "NRU", NU: "NIU", NZ: "NZL", OM: "OMN", PA: "PAN", PE: "PER", PF: "PYF", PG: "PNG", PH: "PHL", PK: "PAK", PL: "POL", PM: "SPM", PN: "PCN", PR: "PRI", PS: "PSE", PT: "PRT", PW: "PLW", PY: "PRY", QA: "QAT", RE: "REU", RO: "ROU", RS: "SRB", RU: "RUS", RW: "RWA", SA: "SAU", SB: "SLB", SC: "SYC", SD: "SDN", SE: "SWE", SG: "SGP", SH: "SHN", SI: "SVN", SJ: "SJM", SK: "SVK", SL: "SLE", SM: "SMR", SN: "SEN", SO: "SOM", SR: "SUR", SS: "SSD", ST: "STP", SV: "SLV", SX: "SXM", SY: "SYR", SZ: "SWZ", TC: "TCA", TD: "TCD", TF: "ATF", TG: "TGO", TH: "THA", TJ: "TJK", TK: "TKL", TL: "TLS", TM: "TKM", TN: "TUN", TO: "TON", TR: "TUR", TT: "TTO", TV: "TUV", TW: "TWN", TZ: "TZA", UA: "UKR", UG: "UGA", UM: "UMI", US: "USA", UY: "URY", UZ: "UZB", VA: "VAT", VC: "VCT", VE: "VEN", VG: "VGB", VI: "VIR", VN: "VNM", VU: "VUT", WF: "WLF", WS: "WSM", XK: "XKX", YE: "YEM", YT: "MYT", ZA: "ZAF", ZM: "ZMB", ZW: "ZWE" }, pt = (n2) => __spreadProps(__spreadValues({}, Y[n2]), { iso2: n2, iso3: lt[n2] }), mt = () => Object.keys(Y).map((n2) => pt(n2)); 54768 mt(); 54769 function dt(n2, e2) { 54770 for (var a2 = -1, t2 = n2 == null ? 0 : n2.length; ++a2 < t2 && e2(n2[a2], a2, n2) !== false; ) ; 54771 return n2; 54772 } 54773 var pe = dt; 54774 function ht$1(n2, e2, a2) { 54775 e2 == "__proto__" && ka ? ka(n2, e2, { configurable: true, enumerable: true, value: a2, writable: true }) : n2[e2] = a2; 54776 } 54777 var un = ht$1; 54778 var yt = Object.prototype, At = yt.hasOwnProperty; 54779 function St(n2, e2, a2) { 54780 var t2 = n2[e2]; 54781 (!(At.call(n2, e2) && j$1(t2, a2)) || a2 === void 0 && !(e2 in n2)) && un(n2, e2, a2); 54782 } 54783 var L$1 = St; 54784 function Ct(n2, e2, a2, t2) { 54785 var r2 = !a2; 54786 a2 || (a2 = {}); 54787 for (var u2 = -1, o2 = e2.length; ++u2 < o2; ) { 54788 var i2 = e2[u2], c2 = t2 ? t2(a2[i2], n2[i2], i2, a2, n2) : void 0; 54789 c2 === void 0 && (c2 = n2[i2]), r2 ? un(a2, i2, c2) : L$1(a2, i2, c2); 54790 } 54791 return a2; 54792 } 54793 var D$1 = Ct; 54794 function Et(n2, e2) { 54795 return n2 && D$1(e2, Q$1(e2), n2); 54796 } 54797 var me = Et; 54798 function bt(n2) { 54799 var e2 = []; 54800 if (n2 != null) for (var a2 in Object(n2)) e2.push(a2); 54801 return e2; 54802 } 54803 var ge = bt; 54804 var Dt = Object.prototype, Mt = Dt.hasOwnProperty; 54805 function Bt(n2) { 54806 if (!N$1(n2)) return ge(n2); 54807 var e2 = Ve$1(n2), a2 = []; 54808 for (var t2 in n2) t2 == "constructor" && (e2 || !Mt.call(n2, t2)) || a2.push(t2); 54809 return a2; 54810 } 54811 var fe = Bt; 54812 function Tt(n2) { 54813 return _$1(n2) ? ze$1(n2, true) : fe(n2); 54814 } 54815 var w$1 = Tt; 54816 function xt(n2, e2) { 54817 return n2 && D$1(e2, w$1(e2), n2); 54818 } 54819 var ve = xt; 54820 var Ae = typeof exports == "object" && exports && !exports.nodeType && exports, de = Ae && typeof module == "object" && module && !module.nodeType && module, Pt = de && de.exports === Ae, he = Pt ? f$1.Buffer : void 0, ye = he ? he.allocUnsafe : void 0; 54821 function Ft(n2, e2) { 54822 if (e2) return n2.slice(); 54823 var a2 = n2.length, t2 = ye ? ye(a2) : new n2.constructor(a2); 54824 return n2.copy(t2), t2; 54825 } 54826 var Se = Ft; 54827 function Nt(n2, e2) { 54828 var a2 = -1, t2 = n2.length; 54829 for (e2 || (e2 = Array(t2)); ++a2 < t2; ) e2[a2] = n2[a2]; 54830 return e2; 54831 } 54832 var Ce = Nt; 54833 function It(n2, e2) { 54834 return D$1(n2, Ie$1(n2), e2); 54835 } 54836 var Ee = It; 54837 var Ut = We$1(Object.getPrototypeOf, Object), K = Ut; 54838 var Ot = Object.getOwnPropertySymbols, Rt = Ot ? function(n2) { 54839 for (var e2 = []; n2; ) na$1(e2, Ie$1(n2)), n2 = K(n2); 54840 return e2; 54841 } : _e$1, cn = Rt; 54842 function Gt(n2, e2) { 54843 return D$1(n2, cn(n2), e2); 54844 } 54845 var be = Gt; 54846 function Lt(n2) { 54847 return ke$1(n2, w$1, cn); 54848 } 54849 var sn = Lt; 54850 var wt = Object.prototype, Kt = wt.hasOwnProperty; 54851 function kt(n2) { 54852 var e2 = n2.length, a2 = new n2.constructor(e2); 54853 return e2 && typeof n2[0] == "string" && Kt.call(n2, "index") && (a2.index = n2.index, a2.input = n2.input), a2; 54854 } 54855 var De = kt; 54856 function Ht(n2) { 54857 var e2 = new n2.constructor(n2.byteLength); 54858 return new wa(e2).set(new wa(n2)), e2; 54859 } 54860 var k$1 = Ht; 54861 function Vt(n2, e2) {
54862 var a2 = e2 ? k$1(n2.buffer) : n2.buffer; 54863 return new n2.constructor(a2, n2.byteOffset, n2.byteLength); 54864 } 54865 var Me = Vt; 54866 var jt$1 = /\w*$/; 54867 function zt(n2) { 54868 var e2 = new n2.constructor(n2.source, jt$1.exec(n2)); 54869 return e2.lastIndex = n2.lastIndex, e2; 54870 } 54871 var Be = zt; 54872 var Te = v$1 ? v$1.prototype : void 0, xe = Te ? Te.valueOf : void 0; 54873 function Zt(n2) { 54874 return xe ? Object(xe.call(n2)) : {}; 54875 } 54876 var Pe = Zt; 54877 function Yt$1(n2, e2) { 54878 var a2 = e2 ? k$1(n2.buffer) : n2.buffer; 54879 return new n2.constructor(a2, n2.byteOffset, n2.length); 54880 } 54881 var Fe$1 = Yt$1; 54882 var Wt$1 = "[object Boolean]", Jt = "[object Date]", Xt = "[object Map]", $t = "[object Number]", _t = "[object RegExp]", qt = "[object Set]", Qt$1 = "[object String]", nr = "[object Symbol]", er = "[object ArrayBuffer]", ar = "[object DataView]", tr = "[object Float32Array]", rr = "[object Float64Array]", ir = "[object Int8Array]", or = "[object Int16Array]", ur = "[object Int32Array]", cr = "[object Uint8Array]", sr = "[object Uint8ClampedArray]", lr = "[object Uint16Array]", pr$1 = "[object Uint32Array]"; 54883 function mr(n2, e2, a2) { 54884 var t2 = n2.constructor; 54885 switch (e2) { 54886 case er: 54887 return k$1(n2); 54888 case Wt$1: 54889 case Jt: 54890 return new t2(+n2); 54891 case ar: 54892 return Me(n2, a2); 54893 case tr: 54894 case rr: 54895 case ir: 54896 case or: 54897 case ur: 54898 case cr: 54899 case sr: 54900 case lr: 54901 case pr$1: 54902 return Fe$1(n2, a2); 54903 case Xt: 54904 return new t2(); 54905 case $t: 54906 case Qt$1: 54907 return new t2(n2); 54908 case _t: 54909 return Be(n2); 54910 case qt: 54911 return new t2(); 54912 case nr: 54913 return Pe(n2); 54914 } 54915 } 54916 var Ne = mr; 54917 var Ie = Object.create, gr = /* @__PURE__ */ (function() { 54918 function n2() { 54919 } 54920 return function(e2) { 54921 if (!N$1(e2)) return {}; 54922 if (Ie) return Ie(e2); 54923 n2.prototype = e2; 54924 var a2 = new n2(); 54925 return n2.prototype = void 0, a2; 54926 }; 54927 })(), Ue = gr; 54928 function fr(n2) { 54929 return typeof n2.constructor == "function" && !Ve$1(n2) ? Ue(K(n2)) : {}; 54930 } 54931 var Oe = fr; 54932 var vr = "[object Map]"; 54933 function dr(n2) { 54934 return M$2(n2) && xa(n2) == vr; 54935 } 54936 var Re = dr; 54937 var Ge = Ga && Ga.isMap, hr = Ge ? pa(Ge) : Re, Le = hr; 54938 var yr = "[object Set]"; 54939 function Ar(n2) { 54940 return M$2(n2) && xa(n2) == yr; 54941 } 54942 var we = Ar; 54943 var Ke = Ga && Ga.isSet, Sr = Ke ? pa(Ke) : we, ke = Sr; 54944 var Cr = 1, Er = 2, br = 4, He = "[object Arguments]", Dr = "[object Array]", Mr = "[object Boolean]", Br = "[object Date]", Tr = "[object Error]", Ve = "[object Function]", xr = "[object GeneratorFunction]", Pr = "[object Map]", Fr = "[object Number]", je = "[object Object]", Nr = "[object RegExp]", Ir = "[object Set]", Ur = "[object String]", Or = "[object Symbol]", Rr = "[object WeakMap]", Gr$1 = "[object ArrayBuffer]", Lr = "[object DataView]", wr = "[object Float32Array]", Kr = "[object Float64Array]", kr = "[object Int8Array]", Hr$1 = "[object Int16Array]", Vr$1 = "[object Int32Array]", jr = "[object Uint8Array]", zr = "[object Uint8ClampedArray]", Zr = "[object Uint16Array]", Yr = "[object Uint32Array]", s$1 = {}; 54945 s$1[He] = s$1[Dr] = s$1[Gr$1] = s$1[Lr] = s$1[Mr] = s$1[Br] = s$1[wr] = s$1[Kr] = s$1[kr] = s$1[Hr$1] = s$1[Vr$1] = s$1[Pr] = s$1[Fr] = s$1[je] = s$1[Nr]
54945= s$1[Ir] = s$1[Ur] = s$1[Or] = s$1[jr] = s$1[zr] = s$1[Zr] = s$1[Yr] = true; 54946 s$1[Tr] = s$1[Ve] = s$1[Rr] = false; 54947 function ln(n2, e2, a2, t2, r2, u2) { 54948 var o2, i2 = e2 & Cr, c2 = e2 & Er, p2 = e2 & br; 54949 if (a2 && (o2 = r2 ? a2(n2, t2, r2, u2) : a2(n2)), o2 !== void 0) return o2; 54950 if (!N$1(n2)) return n2; 54951 var g2 = u$1(n2); 54952 if (g2) { 54953 if (o2 = De(n2), !i2) return Ce(n2, o2); 54954 } else { 54955 var S2 = xa(n2), C2 = S2 == Ve || S2 == xr; 54956 if (aa$1(n2)) return Se(n2, i2); 54957 if (S2 == je || S2 == He || C2 && !r2) { 54958 if (o2 = c2 || C2 ? {} : Oe(n2), !i2) return c2 ? be(n2, ve(o2, n2)) : Ee(n2, me(o2, n2)); 54959 } else { 54960 if (!s$1[S2]) return r2 ? n2 : {}; 54961 o2 = Ne(n2, S2, i2); 54962 } 54963 } 54964 u2 || (u2 = new J$1()); 54965 var T2 = u2.get(n2); 54966 if (T2) return T2; 54967 u2.set(n2, o2), ke(n2) ? n2.forEach(function(v2) { 54968 o2.add(ln(v2, e2, a2, v2, n2, u2)); 54969 }) : Le(n2) && n2.forEach(function(v2, E2) { 54970 o2.set(E2, ln(v2, e2, a2, E2, n2, u2)); 54971 }); 54972 var d2 = p2 ? c2 ? sn : Pa : c2 ? w$1 : Q$1, y2 = g2 ? void 0 : d2(n2); 54973 return pe(y2 || n2, function(v2, E2) { 54974 y2 && (E2 = v2, v2 = n2[E2]), L$1(o2, E2, ln(v2, e2, a2, E2, n2, u2)); 54975 }), o2; 54976 } 54977 var ze = ln; 54978 function Wr(n2) { 54979 var e2 = n2 == null ? 0 : n2.length; 54980 return e2 ? n2[e2 - 1] : void 0; 54981 } 54982 var Ze = Wr; 54983 function Jr(n2, e2, a2) { 54984 var t2 = -1, r2 = n2.length; 54985 e2 < 0 && (e2 = -e2 > r2 ? 0 : r2 + e2), a2 = a2 > r2 ? r2 : a2, a2 < 0 && (a2 += r2), r2 = e2 > a2 ? 0 : a2 - e2 >>> 0, e2 >>>= 0; 54986 for (var u2 = Array(r2); ++t2 < r2; ) u2[t2] = n2[t2 + e2]; 54987 return u2; 54988 } 54989 var Ye = Jr; 54990 function Xr(n2, e2) { 54991 return e2.length < 2 ? n2 : W(n2, Ye(e2, 0, -1)); 54992 } 54993 var We = Xr; 54994 function $r(n2, e2) { 54995 return e2 = sa(e2, n2), n2 = We(n2, e2), n2 == null || delete n2[F$1(Ze(e2))]; 54996 } 54997 var Je = $r; 54998 var _r = "[object Object]", qr = Function.prototype, Qr = Object.prototype, Xe = qr.toString, ni = Qr.hasOwnProperty, ei = Xe.call(Object); 54999 function ai(n2) { 55000 if (!M$2(n2) || A$1(n2) != _r) return false; 55001 var e2 = K(n2); 55002 if (e2 === null) return true; 55003 var a2 = ni.call(e2, "constructor") && e2.constructor; 55004 return typeof a2 == "function" && a2 instanceof a2 && Xe.call(a2) == ei; 55005 } 55006 var $e = ai; 55007 function ti(n2) { 55008 return $e(n2) ? void 0 : n2; 55009 } 55010 var _e = ti; 55011 function ri(n2) { 55012 var e2 = n2 == null ? 0 : n2.length; 55013 return e2 ? Ua(n2, 1) : []; 55014 } 55015 var qe = ri; 55016 function ii(n2) { 55017 return Or$1(xr$1(n2, void 0, qe), n2 + ""); 55018 } 55019 var pn = ii; 55020 var oi = 1, ui = 2, ci = 4; 55021 pn(function(n2, e2) { 55022 var a2 = {}; 55023 if (n2 == null) return a2; 55024 var t2 = false; 55025 e2 = D$2(e2, function(u2) { 55026 return u2 = sa(u2, n2), t2 || (t2 = u2.length > 1), u2; 55027 }), D$1(n2, sn(n2), a2), t2 && (a2 = ze(a2, oi | ui | ci, _e)); 55028 for (var r2 = e2.length; r2--; ) Je(a2, e2[r2]); 55029 return a2; 55030 }); 55031 function li(n2, e2, a2, t2) { 55032 if (!N$1(n2)) return n2; 55033 e2 = sa(e2, n2); 55034 for (var r2 = -1, u2 = e2.length, o2 = u2 - 1, i2 = n2; i2 != null && ++r2 < u2; ) { 55035 var c2 = F$1(e2[r2]), p2 = a2; 55036 if (c2 === "__proto__" || c2 === "constructor" || c2 === "prototype") return n2; 55037 if (r2 != o2) { 55038 var g2 = i2[c2]; 55039 p2 = t2 ? t2(g2, c2, i2) : void 0, p2 === void 0 && (p2 = N$1(g2) ? g2 : q$1(e2[r2 + 1]) ? [] : {}); 55040 } 55041 L$1(i2, c2, p2), i2 = i2[c2]; 55042 } 55043 return n2; 55044 } 55045 var na = li; 55046 function pi(n2, e2, a2) { 55047 for (var t2 = -1, r2 = e2.length, u2 = {}; ++t2 < r2; ) { 55048 var o2 = e2[t2], i2 = W(n2, o2); 55049 a2(i2, o2) && na(u2, sa(o2, n2), i2); 55050 } 55051 return u2; 55052 } 55053 var ea = pi; 55054 function mi(n2, e2) { 55055 return ea(n2, e2, function(a2, t2) { 55056 return pr$2(n2, t2); 55057 }); 55058 } 55059 var aa = mi; 55060 pn(function(n2, e2) { 55061 return n2 == null ? {} : aa(n2, e2); 55062 }); 55063 Un$1.extend($i); 55064 Un$1.extend(yi); 55065 var la = (n2) => typeof n2 == "string" || n2 instanceof Date ? Un$1(n2) : n2; 55066 reactExports.createContext(void 0); 55067 dt$2.div` 55068 position: relative; 55069`; 55070 dt$2.div` 55071 position: absolute; 55072 top: calc(100% + 8px); 55073 z-index: 1; 55074 55075 width: 100%; 55076`; 55077 dt$2.span` 55078 max-width: 70%; 55079 55080 overflow: hidden; 55081 text-overflow: ellipsis; 55082 white-space: nowrap; 55083`; 55084 dt$2.span` 55085 margin-left: 8px; 55086 55087 white-space: nowrap; 55088 text-overflow: ellipsis; 55089 font-size: 14px; 55090 color: var(--text-secondary); 55091 overflow: hidden; 55092`; 55093 dt$2.div` 55094 display: flex; 55095 align-items: center; 55096`; 55097 dt$2.div` 55098 aspect-ratio: 20/14; 55099 width: ${({ $size: n2 }) => n2}px; 55100 max-height: fit-content; 55101 background-color: var(--bg-quaternary); 55102 display: flex; 55103 align-items: center; 55104 justify-content: center; 55105 color: var(--text-primary-invert); 55106 font-size: calc(${({ $size: n2 }) => n2}px / 2); 55107 font-weight: var(--font-weight-600); 55108`; 55109 dt$2.div` 55110 margin-left: var(--space-300); 55111 55112 font-size: var(--font-size-400); 55113 line-height: 150%; 55114`; 55115 dt$2.span` 55116 font-size: ${({ $size: n2 }) => n2}px; 55117 /* NOTE: This font is provided by "country-flag-emoji-polyfill" package when unicode emoji flags are not supported */ 55118 font-family: 'Twemoji Country Flags', 'Helvetica', 'Comic Sans', serif; 55119`; 55120 Un$1.extend(_i); 55121 Un$1.extend(Xi); 55122 Un$1.extend($i); 55123 var qi = ({ date: n2, format: e2 = "DD MMM YYYY", utc: a2 = false }) => { 55124 let t2 = la(n2); 55125 return t2.isValid() ? (a2 && (t2 = t2.utc()), jsxRuntimeExports.jsx("time", { dateTime: t2.toISOString(), children: t2.format(e2) })) : null; 55126 }; 55127 dt$2.span` 55128 font-size: 0.75em; 55129 color: var(--text-secondary); 55130`; 55131 dt$2.span` 55132 ${({ $value: n2 }) => n2 > 0 && lt$2` 55133 color: var(--text-success); 55134 `} 55135 55136 ${({ $value: n2 }) => n2 < 0 && lt$2` 55137 color: var(--text-critical); 55138 `} 55139`; 55140 dt$2.span` 55141 ${({ $value: n2 }) => n2 < 0 && lt$2` 55142 color: var(--text-critical); 55143 `} 55144`; 55145 var dn = 41; 55146 dt$2.div` 55147 cursor: pointer; 55148 position: relative; 55149`; 55150 dt$2(Input$2)` 55151 pointer-events: ${({ $isSearching: n2 }) => n2 ? "auto" : "none"}; 55152 padding-left: ${dn}px; 55153 padding-right: ${dn}px; 55154`; 55155 dt$2.div` 55156 height: 50vh; 55157 overflow-y: auto; 55158 55159 -ms-overflow-style: none; 55160 scrollbar-width: none; 55161 55162 &::-webkit-scrollbar {
55163 display: none; 55164 } 55165 55166 ${mediaQueries.tablet} { 55167 height: auto; 55168 max-height: 300px; 55169 } 55170`; 55171 dt$2.div` 55172 display: flex; 55173 align-items: center; 55174 justify-content: center; 55175 padding: var(--space-600); 55176 color: var(--text-secondary); 55177`; 55178 dt$2.span` 55179 display: flex; 55180 align-items: center; 55181 gap: var(--space-300); 55182`; 55183 dt$2.div` 55184 &:not(:first-child) { 55185 border-top: 1px solid var(--bg-tertiary); 55186 } 55187`; 55188 dt$2.div` 55189 ${e.body2xsMedium}; 55190 padding: var(--space-300) var(--space-400); 55191 color: var(--text-secondary); 55192 text-transform: uppercase; 55193`; 55194 dt$2(Root$2)` 55195 padding: 0 var(--space-300) var(--space-300); 55196 border-bottom: 1px solid var(--bg-tertiary); 55197 55198 ${mediaQueries.tablet} { 55199 display: none; 55200 } 55201`; 55202 dt$2(Box$1)` 55203 cursor: text; 55204 position: relative; 55205`; 55206 dt$2(Input$2)` 55207 padding-left: ${dn}px; 55208 padding-right: ${dn}px; 55209`; 55210 new Set(Am); 55211 /*! Bundled license information: 55212 55213 countries-list/mjs/index.js: 55214 (*! countries-list v3.1.1 by Annexare | MIT *) 55215 */ 55216 /*! ***************************************************************************** 55217 Copyright (c) Microsoft Corporation. 55218 55219 Permission to use, copy, modify, and/or distribute this software for any 55220 purpose with or without fee is hereby granted. 55221 55222 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 55223 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 55224 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 55225 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 55226 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 55227 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 55228 PERFORMANCE OF THIS SOFTWARE. 55229 ***************************************************************************** */ 55230 var s = function() { 55231 return s = Object.assign || function(e3) { 55232 for (var t2, r2 = 1, o2 = arguments.length; r2 < o2; r2++) for (var n2 in t2 = arguments[r2]) Object.prototype.hasOwnProperty.call(t2, n2) && (e3[n2] = t2[n2]); 55233 return e3; 55234 }, s.apply(this, arguments); 55235 }; 55236 var f, p = function(e3) { 55237 var t2; 55238 e3 ? (function(e4) { 55239 if (e4) for (; e4.lastChild; ) e4.lastChild.remove(); 55240 })("string" == typeof e3 ? document.getElementById(e3) : e3) : (t2 = document.querySelector(".grecaptcha-badge")) && t2.parentNode && document.body.removeChild(t2.parentNode); 55241 }, d = function(e3, t2) { 55242 p(t2), window.___grecaptcha_cfg = void 0; 55243 var r2 = document.querySelector("#" + e3); 55244 r2 && r2.remove(), (function() { 55245 var e4 = document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'); 55246 e4 && e4.remove(); 55247 })(); 55248 }, y = function(e3) { 55249 var t2 = e3.render, r2 = e3.onLoadCallbackName, o2 = e3.language, n2 = e3.onLoad, a2 = e3.useRecaptchaNet, c2 = e3.useEnterprise, i2 = e3.scriptProps, s2 = void 0 === i2 ? {} : i2, u2 = s2.nonce, l2 = void 0 === u2 ? "" : u2, f2 = s2.defer, p2 = void 0 !== f2 && f2, d2 = s2.async, y2 = void 0 !== d2 && d2, m2 = s2.id, v2 = void 0 === m2 ? "" : m2, b2 = s2.appendTo, h2 = v2 || "google-recaptcha-v3"; 55250 if ((function(e4) { 55251 return !!document.querySelector("#" + e4); 55252 })(h2)) n2(); 55253 else { 55254 var g2 = (function(e4) { 55255 return "https://www." + (e4.useRecaptchaNet ? "recaptcha.net" : "google.com") + "/recaptcha/" + (e4.useEnterprise ? "enterprise.js" : "api.js"); 55256 })({ useEnterprise: c2, useRecaptchaNet: a2 }), S2 = document.createElement("script"); 55257 S2.id = h2, S2.src = g2 + "?render=" + t2 + ("explicit" === t2 ? "&onload=" + r2 : "") + (o2 ? "&hl=" + o2 : ""), l2 && (S2.nonce = l2), S2.defer = !!p2, S2.async = !!y2, S2.onload = n2, ("body" === b2 ? document.body : document.getElementsByTagName("head")[0]).appendChild(S2); 55258 } 55259 }, m = function(e3) { 55260 console.warn(e3); 55261 }; 55262 !(function(e3) { 55263 e3.SCRIPT_NOT_AVAILABLE = "Recaptcha script is not available"; 55264 })(f || (f = {})); 55265 var v = reactExports.createContext({ executeRecaptcha: function() { 55266 throw Error("GoogleReCaptcha Context has not yet been implemented, if you are using useGoogleReCaptcha hook, make sure the hook is called
55266inside component wrapped by GoogleRecaptchaProvider"); 55267 } }); 55268 v.Consumer; 55269 function h(t2) { 55270 var i2 = t2.reCaptchaKey, u2 = t2.useEnterprise, l2 = void 0 !== u2 && u2, p2 = t2.useRecaptchaNet, b2 = void 0 !== p2 && p2, h2 = t2.scriptProps, g2 = t2.language, S2 = t2.container, w2 = t2.children, $2 = reactExports.useState(null), C2 = $2[0], P2 = $2[1], x2 = reactExports.useRef(i2), E2 = JSON.stringify(h2), R2 = JSON.stringify(null == S2 ? void 0 : S2.parameters); 55271 reactExports.useEffect((function() { 55272 if (i2) { 55273 var e3 = (null == h2 ? void 0 : h2.id) || "google-recaptcha-v3", t3 = (null == h2 ? void 0 : h2.onLoadCallbackName) || "onRecaptchaLoadCallback"; 55274 window[t3] = function() { 55275 var e4 = l2 ? window.grecaptcha.enterprise : window.grecaptcha, t4 = s({ badge: "inline", size: "invisible", sitekey: i2 }, (null == S2 ? void 0 : S2.parameters) || {}); 55276 x2.current = e4.render(null == S2 ? void 0 : S2.element, t4); 55277 }; 55278 return y({ render: (null == S2 ? void 0 : S2.element) ? "explicit" : i2, onLoadCallbackName: t3, useEnterprise: l2, useRecaptchaNet: b2, scriptProps: h2, language: g2, onLoad: function() { 55279 if (window && window.grecaptcha) { 55280 var e4 = l2 ? window.grecaptcha.enterprise : window.grecaptcha; 55281 e4.ready((function() { 55282 P2(e4); 55283 })); 55284 } else m("<GoogleRecaptchaProvider /> " + f.SCRIPT_NOT_AVAILABLE); 55285 } }), function() { 55286 d(e3, null == S2 ? void 0 : S2.element); 55287 }; 55288 } 55289 m("<GoogleReCaptchaProvider /> recaptcha key not provided"); 55290 }), [l2, b2, E2, R2, g2, i2, null == S2 ? void 0 : S2.element]); 55291 var M2 = reactExports.useCallback((function(e3) { 55292 if (!C2 || !C2.execute) throw new Error("<GoogleReCaptchaProvider /> Google Recaptcha has not been loaded"); 55293 return C2.execute(x2.current, { action: e3 }); 55294 }), [C2, x2]), N2 = reactExports.useMemo((function() { 55295 return { executeRecaptcha: C2 ? M2 : void 0, container: null == S2 ? void 0 : S2.element }; 55296 }), [M2, C2, null == S2 ? void 0 : S2.element]); 55297 return e$3.createElement(v.Provider, { value: N2 }, w2); 55298 } 55299 var g = function() { 55300 return reactExports.useContext(v); 55301 }; 55302 function w(e3, t2) { 55303 return e3(t2 = { exports: {} }, t2.exports), t2.exports; 55304 /** @license React v16.13.1 55305 * react-is.production.min.js 55306 * 55307 * Copyright (c) Facebook, Inc. and its affiliates. 55308 * 55309 * This source code is licensed under the MIT license found in the 55310 * LICENSE file in the root directory of this source tree. 55311 */ 55312 } 55313 var $$1 = "function" == typeof Symbol && Symbol.for, C$1 = $$1 ? Symbol.for("react.element") : 60103, P = $$1 ? Symbol.for("react.portal") : 60106, x = $$1 ? Symbol.for("react.fragment") : 60107, E = $$1 ? Symbol.for("react.strict_mode") : 60108, R = $$1 ? Symbol.for("react.profiler") : 60114, M$1 = $$1 ? Symbol.for("react.provider") : 60109, N = $$1 ? Symbol.for("react.context") : 60110, O = $$1 ? Symbol.for("react.async_mode") : 60111, _ = $$1 ? Symbol.for("react.concurrent_mode") : 60111, T = $$1 ? Symbol.for("react.forward_ref") : 60112, j = $$1 ? Symbol.for("react.suspense")
vendor: 1,122 bytes, lines 55313-55346
55313: 60113, L = $$1 ? Symbol.for("react.suspense_list") : 60120, k = $$1 ? Symbol.for("react.memo") : 60115, F = $$1 ? Symbol.for("react.lazy") : 60116, A = $$1 ? Symbol.for("react.block") : 60121, V = $$1 ? Symbol.for("react.fundamental") : 60117, z = $$1 ? Symbol.for("react.responder") : 60118, G = $$1 ? Symbol.for("react.scope") : 60119; 55314 function I(e3) { 55315 if ("object" == typeof e3 && null !== e3) { 55316 var t2 = e3.$$typeof; 55317 switch (t2) { 55318 case C$1: 55319 switch (e3 = e3.type) { 55320 case O: 55321 case _: 55322 case x: 55323 case R: 55324 case E: 55325 case j: 55326 return e3; 55327 default: 55328 switch (e3 = e3 && e3.$$typeof) { 55329 case N: 55330 case T: 55331 case F: 55332 case k: 55333 case M$1: 55334 return e3; 55335 default: 55336 return t2; 55337 } 55338 } 55339 case P: 55340 return t2; 55341 } 55342 } 55343 } 55344 function D(e3) { 55345 return I(e3) === _; 55346 }
55347 var q = { AsyncMode: O, ConcurrentMode: _, ContextConsumer: N, ContextProvider: M$1, Element: C$1, ForwardRef: T, Fragment: x, Lazy: F, Memo: k, Portal: P, Profiler: R, StrictMode: E, Suspense: j, isAsyncMode: function(e3) { 55348 return D(e3) || I(e3) === O; 55349 }, isConcurrentMode: D, isContextConsumer: function(e3) { 55350 return I(e3) === N; 55351 }, isContextProvider: function(e3) { 55352 return I(e3) === M$1; 55353 }, isElement: function(e3) { 55354 return "object" == typeof e3 && null !== e3 && e3.$$typeof === C$1; 55355 }, isForwardRef: function(e3) { 55356 return I(e3) === T; 55357 }, isFragment: function(e3) { 55358 return I(e3) === x; 55359 }, isLazy: function(e3) { 55360 return I(e3) === F; 55361 }, isMemo: function(e3) { 55362 return I(e3) === k; 55363 }, isPortal: function(e3) { 55364 return I(e3) === P; 55365 }, isProfiler: function(e3) { 55366 return I(e3) === R; 55367 }, isStrictMode: function(e3) { 55368 return I(e3) === E; 55369 }, isSuspense: function(e3) { 55370 return I(e3) === j; 55371 }, isValidElementType: function(e3) { 55372 return "string" == typeof e3 || "function" == typeof e3 || e3 === x || e3 === _ || e3 === R || e3 === E || e3 === j || e3 === L || "object" == typeof e3 && null !== e3 && (e3.$$typeof === F || e3.$$typeof === k || e3.$$typeof === M$1 || e3.$$typeof === N || e3.$$typeof === T || e3.$$typeof === V || e3.$$typeof === z || e3.$$typeof === G || e3.$$typeof === A); 55373 }, typeOf: I }, B = w((function(e3, t2) { 55374 })), J = (B.AsyncMode, B.ConcurrentMode, B.ContextConsumer, B.ContextProvider, B.Element, B.ForwardRef, B.Fragment, B.Lazy, B.Memo, B.Portal, B.Profiler, B.StrictMode, B.Suspense, B.isAsyncMode, B.isConcurrentMode, B.isContextConsumer, B.isContextProvider, B.isElement, B.isForwardRef, B.isFragment, B.isLazy, B.isMemo, B.isPortal, B.isProfiler, B.isStrictMode, B.isSuspense, B.isValidElementType, B.typeOf, w((function(e3) { 55375 e3.exports = q; 55376 }))), H = { $$typeof: true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }, Q = {}; 55377 Q[J.ForwardRef] = { $$typeof: true, render: true, defaultProps: true, displayName: true, propTypes: true }, Q[J.Memo] = H; 55378 var Z = "stripe-element"; 55379 reactExports.createContext(void 0); 55380 var vn = 200, Sn = mt$2` 55381 0%, 100% { background-color: var(--bg-secondary); } 55382 50% { background-color: var(--bg-tertiary); } 55383`, C = dt$2.div` 55384 background: var(--bg-secondary); 55385 border-radius: var(--panel-radius-normal); 55386 height: ${({ $height: e2 }) => e2 != null ? e2 : 56}px; 55387 animation: ${Sn} 1.5s ease-in-out infinite; 55388 will-change: background-color; 55389`, U = dt$2.div` 55390 display: grid; 55391 gap: 12px; 55392 ${({ $columns: e2 }) => e2 && `grid-template-columns: ${e2};`} 55393`, M = dt$2.div` 55394 display: grid; 55395 align-items: start; 55396 55397 > * { 55398 grid-area: 1 / 1; 55399 } 55400`, $ = dt$2.div` 55401 // PayPal's Smart Button iframe promotes itself to its own paint layer, so 55402 // relying on source-order stacking lets it bleed through. Match the same 55403 // ceiling the PayPal disable overlay uses (PAYPAL_Z_INDEX + 1). 55404 position: relative; 55405 z-index: ${vn + 1}; 55406 max-height: ${({ $isReady: e2 }) => e2 ? 0 : 600}px; 55407 overflow: hidden; 55408 opacity: ${({ $isReady: e2 }) => e2 ? 0 : 1}; 55409 pointer-events: ${({ $isReady: e2 }) => e2 ? "none" : "auto"}; 55410 transition: 55411 opacity 0.2s ease, 55412 max-height 0s linear 0.2s; 55413`; 55414 dt$2.div` 55415 position: relative; 55416 top: 2px; 55417 55418 line-height: var(--font-line-height-400); 55419 text-align: center; 55420 font-weight: var(--font-weight-600); 55421`; 55422 dt$2.label` 55423 display: block; 55424 padding: var(--space-100); 55425 55426 ${mediaQueries.tablet} { 55427 padding: var(--space-150); 55428 } 55429`; 55430 dt$2.input` 55431 clip: rect(1px, 1px, 1px, 1px); 55432 55433 position: absolute; 55434`; 55435 dt$2.div` 55436 position: relative; 55437 display: flex; 55438 align-items: center; 55439 justify-content: center; 55440 55441 height: 48px; 55442 padding: 0 var(--space-200); 55443 55444 color: var(--text-primary); 55445 background: var(--bg-secondary); 55446 border-radius: var(--input-radius-normal); 55447 cursor: pointer; 55448 55449 input:hover + & { 55450 background: var(--bg-secondary-hover); 55451 } 55452 55453 input:focus-visible + & { 55454 background: var(--bg-secondary-hover); 55455 } 55456 55457 input:checked + & { 55458 background: var(--bg-secondary-hover); 55459 border: 2px solid var(--text-primary); 55460 } 55461 55462 ${mediaQueries.tablet} { 55463 padding: 0 var(--space-400); 55464 } 55465`; 55466 dt$2.div` 55467 display: flex; 55468 flex-direction: column; 55469 55470 ${mediaQueries.tablet} { 55471 flex-direction: row; 55472 } 55473`; 55474 dt$2.div` 55475 width: calc(100% / 2); 55476 55477 ${mediaQueries.tablet} { 55478 width: auto; 55479 flex: 1; 55480 } 55481`; 55482 dt$2.div` 55483 padding: 0; 55484 margin-top: var(--space-400); 55485 55486 ${mediaQueries.tablet} { 55487 padding: var(--space-200); 55488 margin-top: 0; 55489 } 55490`; 55491 dt$2.div` 55492 display: flex; 55493 flex-direction: row; 55494 justify-content: flex-start; 55495 flex: 1; 55496 flex-wrap: wrap; 55497 55498 margin: var(--space-n100); 55499 55500 ${mediaQueries.tablet} { 55501 margin: var(--space-n150); 55502 } 55503`; 55504 var Nn = 200; 55505 dt$2.div` 55506 position: relative; 55507 55508 ${({ $visible: e2 }) => e2 && lt$2` 55509 width: 100%; 55510 `} 55511 55512 paypal-button { 55513 --paypal-button-border-radius: var(--button-radius-normal); 55514 55515 display: block; 55516 width: 100%; 55517 max-width: none; 55518 height: 54px; 55519 margin: var(--space-50) 0; 55520 vertical-align: top; 55521 } 55522 55523 paypal-button[hidden] { 55524 display: none; 55525 } 55526`; 55527 dt$2.div` 55528 position: absolute; 55529 z-index: ${Nn + 1}; 55530 width: 100%; 55531 height: 100%; 55532 background-color: var(--bg-primary); 55533 opacity: 0.8;
55534 cursor: not-allowed; 55535 display: flex; 55536 justify-content: center; 55537 align-items: center; 55538`; 55539 var ft = () => jsxRuntimeExports.jsxs(U, { children: [jsxRuntimeExports.jsx(C, { $height: 200 }), jsxRuntimeExports.jsx(C, {}), jsxRuntimeExports.jsx(C, {})] }); 55540 var gt = dt$2.div` 55541 margin-bottom: var(--space-100); 55542`, ht = dt$2.div` 55543 width: 100%; 55544`; 55545 reactExports.forwardRef(({ isLoading: e2 }, t2) => jsxRuntimeExports.jsxs(M, { children: [jsxRuntimeExports.jsx(gt, { children: jsxRuntimeExports.jsx(ht, { id: Z, ref: t2, "data-testid": "StripePaymentElement.StripeContainer" }) }), jsxRuntimeExports.jsx($, { $isReady: !e2, children: jsxRuntimeExports.jsx(ft, {}) })] })); 55546 dt$2.div` 55547 position: relative; 55548 flex: 1; 55549 display: flex; 55550 flex-direction: column; 55551 margin-top: var(--space-1100); 55552 justify-content: flex-end; 55553`; 55554 var pr = 48; 55555 dt$2.div` 55556 position: relative; 55557 flex: 2; 55558 display: flex; 55559 flex-direction: column; 55560 55561 padding: ${32 + pr}px 0 16px; 55562 margin: 0 16px; 55563 55564 ${mediaQueries.tablet} { 55565 padding: var(--space-800) 0; 55566 margin: 0 var(--space-400); 55567 } 55568 55569 ${mediaQueries.laptopS} { 55570 max-width: 600px; 55571 margin: 0 var(--space-800) 0 var(--space-400); 55572 } 55573 55574 ${mediaQueries.laptop} { 55575 margin: 0 var(--space-1400) 0 var(--space-400); 55576 } 55577`; 55578 dt$2.div` 55579 display: flex; 55580 flex-direction: column-reverse; 55581 margin-top: var(--space-800); 55582 55583 ${mediaQueries.tablet} { 55584 flex-direction: column; 55585 } 55586`; 55587 dt$2.div` 55588 display: flex; 55589 flex-direction: column-reverse; 55590 width: 100%; 55591 55592 ${mediaQueries.tablet} { 55593 flex-direction: row; 55594 align-items: center; 55595 justify-content: space-between; 55596 } 55597`; 55598 dt$2.div` 55599 display: flex; 55600 justify-content: center; 55601 flex-shrink: 0; 55602 margin-right: var(--space-400); 55603`; 55604 dt$2.div` 55605 margin-bottom: var(--space-400); 55606 55607 ${mediaQueries.tablet} { 55608 margin-bottom: 0; 55609 margin-left: auto; 55610 min-width: 230px; 55611 } 55612`; 55613 dt$2.div` 55614 margin-bottom: var(--space-400); 55615 font-size: var(--font-size-200); 55616 text-align: center; 55617 color: var(--text-secondary); 55618 55619 ${mediaQueries.tablet} { 55620 margin-top: var(--space-400); 55621 margin-bottom: 0; 55622 text-align: right; 55623 } 55624`; 55625 dt$2.header` 55626 overflow: hidden; 55627`; 55628 dt$2.div` 55629 display: flex; 55630 justify-content: center; 55631 align-items: flex-start; 55632 margin-bottom: var(--space-800); 55633 55634 ${mediaQueries.tablet} { 55635 margin-bottom: var(--space-1000); 55636 } 55637`; 55638 dt$2.h1` 55639 display: inline-flex; 55640 align-items: center; 55641 color: var(--text-primary); 55642`; 55643 dt$2.div` 55644 position: fixed; 55645 display: flex; 55646 flex-direction: column; 55647 align-items: center; 55648 justify-content: flex-start; 55649 top: 0; 55650 left: 0; 55651 z-index: 2; 55652 55653 width: 100%; 55654 55655 background-color: var(--bg-secondary); 55656 font-size: var(--font-size-300); 55657 color: var(--text-primary); 55658 55659 ${({ $isOpen: e2 }) => e2 && lt$2` 55660 height: 100vh; 55661 55662 overflow-y: auto; 55663 -webkit-overflow-scrolling: touch; 55664 `}; 55665`; 55666 dt$2.div` 55667 display: flex; 55668 align-items: center; 55669 justify-content: space-between; 55670 cursor: pointer; 55671 padding: var(--space-300) var(--space-600); 55672 55673 width: 100%; 55674`; 55675 dt$2.div` 55676 margin-right: var(--space-200); 55677`; 55678 dt$2.div` 55679 flex: 1; 55680 display: flex; 55681 align-items: center; 55682 55683 font-size: var(--font-size-300); 55684 line-height: var(--font-line-height-400); 55685`; 55686 dt$2.div` 55687 margin-left: var(--space-250); 55688`; 55689 dt$2.div` 55690 padding: var(--space-800) 0 var(--space-200); 55691 width: 100%; 55692`; 55693 dt$2.div` 55694 display: none; 55695 55696 ${mediaQueries.tablet} { 55697 position: relative; 55698 display: block; 55699 55700 width: 100%; 55701 } 55702 55703 ${mediaQueries.laptopS} { 55704 margin-right: var(--space-400); 55705 max-width: 400px; 55706 min-width: 400px; 55707 flex: 1; 55708 } 55709`; 55710 dt$2.div` 55711 margin-left: auto; 55712 margin-right: auto; 55713 min-height: 100vh; 55714 55715 ${mediaQueries.laptopS} { 55716 display: flex; 55717 justify-content: center; 55718 55719 max-width: 1180px; 55720 } 55721`; 55722 var Wt = { development: "6Ldg--IqAAAAAEDTR39qTXmZ96hKrap-MwPiO-_h", staging: "6Ldg--IqAAAAAEDTR39qTXmZ96hKrap-MwPiO-_h", production: "6LcUIoYlAAAAALE9OrjdIcUfeYTpTq5RlXh5HuZt" }[getCurrentEnvironment()], Fe = "recaptcha-container", Yt = "x-recaptcha-token"; 55723 var jt = dt$2.div` 55724 display: none; 55725`; 55726 var Qt = reactExports.createContext({ executeRecaptcha: () => Promise.resolve(""), addRecaptchaRequestInterceptor: () => Promise.resolve(false), removeRecaptchaRequestInterceptor: () => Promise.resolve(false) }), Vr = ({ children: e2 }) => { 55727 let t2 = g(), r2 = reactExports.useRef(), n2 = !isNil(r2.current), a2 = (p2) => (y2) => __async(null, null, function* () { 55728 if (t2.executeRecaptcha && y2.headers) try { 55729 let u2 = yield t2.executeRecaptcha(p2); 55730 y2.headers[Yt] = u2; 55731 } catch (e3) { 55732 return y2; 55733 } 55734 return y2; 55735 }), o2 = (p2, y2) => __async(null, null, function* () { 55736 return n2 ? false : (r2.current = p2.addRequestInterceptor(a2(y2)), true); 55737 }), d2 = (p2) => __async(null, null, function* () { 55738 return n2 ? (p2.removeRequestInterceptor(r2.current), r2.current = null, true) : false;
vendor: 45,385 bytes, lines 55739-56993
55739 }), l2 = reactExports.useMemo(() => __spreadProps(__spreadValues({}, t2), { addRecaptchaRequestInterceptor: o2, removeRecaptchaRequestInterceptor: d2 }), [t2]); 55740 return jsxRuntimeExports.jsx(Qt.Provider, { value: l2, children: e2 }); 55741 }, Hr = ({ children: e2 }) => jsxRuntimeExports.jsxs(h, { reCaptchaKey: Wt, useEnterprise: true, scriptProps: { defer: true }, container: { element: Fe, parameters: {} }, children: [jsxRuntimeExports.jsx(jt, { id: Fe }), jsxRuntimeExports.jsx(Vr, { children: e2 })] }), Gr = () => reactExports.useContext(Qt); 55742 reactExports.createContext(void 0); 55743 var map; 55744 try { 55745 map = Map; 55746 } catch (_2) { 55747 } 55748 var set; 55749 try { 55750 set = Set; 55751 } catch (_2) { 55752 } 55753 function baseClone(src, circulars, clones) { 55754 if (!src || typeof src !== "object" || typeof src === "function") { 55755 return src; 55756 } 55757 if (src.nodeType && "cloneNode" in src) { 55758 return src.cloneNode(true); 55759 } 55760 if (src instanceof Date) { 55761 return new Date(src.getTime()); 55762 } 55763 if (src instanceof RegExp) { 55764 return new RegExp(src); 55765 } 55766 if (Array.isArray(src)) { 55767 return src.map(clone); 55768 } 55769 if (map && src instanceof map) { 55770 return new Map(Array.from(src.entries())); 55771 } 55772 if (set && src instanceof set) { 55773 return new Set(Array.from(src.values())); 55774 } 55775 if (src instanceof Object) { 55776 circulars.push(src); 55777 var obj = Object.create(src); 55778 clones.push(obj); 55779 for (var key in src) { 55780 var idx = circulars.findIndex(function(i2) { 55781 return i2 === src[key]; 55782 }); 55783 obj[key] = idx > -1 ? clones[idx] : baseClone(src[key], circulars, clones); 55784 } 55785 return obj; 55786 } 55787 return src; 55788 } 55789 function clone(src) { 55790 return baseClone(src, [], []); 55791 } 55792 const toString = Object.prototype.toString; 55793 const errorToString = Error.prototype.toString; 55794 const regExpToString = RegExp.prototype.toString; 55795 const symbolToString = typeof Symbol !== "undefined" ? Symbol.prototype.toString : () => ""; 55796 const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/; 55797 function printNumber(val) { 55798 if (val != +val) return "NaN"; 55799 const isNegativeZero = val === 0 && 1 / val < 0; 55800 return isNegativeZero ? "-0" : "" + val; 55801 } 55802 function printSimpleValue(val, quoteStrings = false) { 55803 if (val == null || val === true || val === false) return "" + val; 55804 const typeOf = typeof val; 55805 if (typeOf === "number") return printNumber(val); 55806 if (typeOf === "string") return quoteStrings ? `"${val}"` : val; 55807 if (typeOf === "function") return "[Function " + (val.name || "anonymous") + "]"; 55808 if (typeOf === "symbol") return symbolToString.call(val).replace(SYMBOL_REGEXP, "Symbol($1)"); 55809 const tag = toString.call(val).slice(8, -1); 55810 if (tag === "Date") return isNaN(val.getTime()) ? "" + val : val.toISOString(val); 55811 if (tag === "Error" || val instanceof Error) return "[" + errorToString.call(val) + "]"; 55812 if (tag === "RegExp") return regExpToString.call(val); 55813 return null; 55814 } 55815 function printValue(value, quoteStrings) { 55816 let result = printSimpleValue(value, quoteStrings); 55817 if (result !== null) return result; 55818 return JSON.stringify(value, function(key, value2) { 55819 let result2 = printSimpleValue(this[key], quoteStrings); 55820 if (result2 !== null) return result2; 55821 return value2; 55822 }, 2); 55823 } 55824 let mixed = { 55825 default: "${path} is invalid", 55826 required: "${path} is a required field", 55827 oneOf: "${path} must be one of the following values: ${values}", 55828 notOneOf: "${path} must not be one of the following values: ${values}", 55829 notType: ({ 55830 path, 55831 type, 55832 value, 55833 originalValue 55834 }) => { 55835 let isCast = originalValue != null && originalValue !== value; 55836 let msg = `${path} must be a \`${type}\` type, but the final value was: \`${printValue(value, true)}\`` + (isCast ? ` (cast from the value \`${printValue(originalValue, true)}\`).` : "."); 55837 if (value === null) { 55838 msg += ` 55839 If "null" is intended as an empty value be sure to mark the schema as \`.nullable()\``; 55840 } 55841 return msg; 55842 }, 55843 defined: "${path} must be defined" 55844 }; 55845 let string = { 55846 length: "${path} must be exactly ${length} characters", 55847 min: "${path} must be at least ${min} characters", 55848 max: "${path} must be at most ${max} characters", 55849 matches: '${path} must match the following: "${regex}"', 55850 email: "${path} must be a valid email", 55851 url: "${path} must be a valid URL", 55852 uuid: "${path} must be a valid UUID", 55853 trim: "${path} must be a trimmed string", 55854 lowercase: "${path} must be a lowercase string", 55855 uppercase: "${path} must be a upper case string" 55856 }; 55857 let number = { 55858 min: "${path} must be greater than or equal to ${min}", 55859 max: "${path} must be less than or equal to ${max}", 55860 lessThan: "${path} must be less than ${less}", 55861 moreThan: "${path} must be greater than ${more}", 55862 positive: "${path} must be a positive number", 55863 negative: "${path} must be a negative number", 55864 integer: "${path} must be an integer" 55865 }; 55866 let date = { 55867 min: "${path} field must be later than ${min}", 55868 max: "${path} field must be at earlier than ${max}" 55869 }; 55870 let boolean = { 55871 isValue: "${path} field must be ${value}" 55872 }; 55873 let object = { 55874 noUnknown: "${path} field has unspecified keys: ${unknown}" 55875 }; 55876 let array = { 55877 min: "${path} field must have at least ${min} items", 55878 max: "${path} field must have less than or equal to ${max} items", 55879 length: "${path} must have ${length} items" 55880 }; 55881 const locale = Object.assign(/* @__PURE__ */ Object.create(null), { 55882 mixed, 55883 string, 55884 number, 55885 date, 55886 object, 55887 array, 55888 boolean 55889 }); 55890 var objectProto = Object.prototype; 55891 var hasOwnProperty = objectProto.hasOwnProperty; 55892 function baseHas(object2, key) { 55893 return object2 != null && hasOwnProperty.call(object2, key); 55894 } 55895 function has(object2, path) { 55896 return object2 != null && hasPath(object2, path, baseHas); 55897 } 55898 const isSchema = (obj) => obj && obj.__isYupSchema__; 55899 class Condition { 55900 constructor(refs, options2) { 55901 this.fn = void 0; 55902 this.refs = refs; 55903 this.refs = refs; 55904 if (typeof options2 === "function") { 55905 this.fn = options2; 55906 return; 55907 } 55908 if (!has(options2, "is")) throw new TypeError("`is:` is required for `when()` conditions"); 55909 if (!options2.then && !options2.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions"); 55910 let { 55911 is, 55912 then, 55913 otherwise 55914 } = options2; 55915 let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is); 55916 this.fn = function(...args) { 55917 let options3 = args.pop(); 55918 let schema = args.pop(); 55919 let branch = check(...args) ? then : otherwise; 55920 if (!branch) return void 0; 55921 if (typeof branch === "function") return branch(schema); 55922 return schema.concat(branch.resolve(options3)); 55923 }; 55924 } 55925 resolve(base, options2) { 55926 let values = this.refs.map((ref) => ref.getValue(options2 == null ? void 0 : options2.value, options2 == null ? void 0 : options2.parent, options2 == null ? void 0 : options2.context)); 55927 let schema = this.fn.apply(base, values.concat(base, options2)); 55928 if (schema === void 0 || schema === base) return base; 55929 if (!isSchema(schema)) throw new TypeError("conditions must return a schema object"); 55930 return schema.resolve(options2); 55931 } 55932 } 55933 function toArray(value) { 55934 return value == null ? [] : [].concat(value); 55935 } 55936 function _extends$4() { 55937 _extends$4 = Object.assign || function(target) { 55938 for (var i2 = 1; i2 < arguments.length; i2++) { 55939 var source = arguments[i2]; 55940 for (var key in source) { 55941 if (Object.prototype.hasOwnProperty.call(source, key)) { 55942 target[key] = source[key]; 55943 } 55944 } 55945 } 55946 return target; 55947 }; 55948 return _extends$4.apply(this, arguments); 55949 } 55950 let strReg = /\$\{\s*(\w+)\s*\}/g; 55951 class ValidationError extends Error { 55952 static formatError(message, params) { 55953 const path = params.label || params.path || "this"; 55954 if (path !== params.path) params = _extends$4({}, params, { 55955 path 55956 }); 55957 if (typeof message === "string") return message.replace(strReg, (_2, key) => printValue(params[key])); 55958 if (typeof message === "function") return message(params); 55959 return message; 55960 } 55961 static isError(err) { 55962 return err && err.name === "ValidationError"; 55963 } 55964 constructor(errorOrErrors, value, field, type) { 55965 super(); 55966 this.value = void 0; 55967 this.path = void 0; 55968 this.type = void 0; 55969 this.errors = void 0; 55970 this.params = void 0; 55971 this.inner = void 0; 55972 this.name = "ValidationError"; 55973 this.value = value; 55974 this.path = field; 55975 this.type = type; 55976 this.errors = []; 55977 this.inner = []; 55978 toArray(errorOrErrors).forEach((err) => { 55979 if (ValidationError.isError(err)) { 55980 this.errors.push(...err.errors); 55981 this.inner = this.inner.concat(err.inner.length ? err.inner : err); 55982 } else { 55983 this.errors.push(err); 55984 } 55985 }); 55986 this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0]; 55987 if (Error.captureStackTrace) Error.captureStackTrace(this, ValidationError); 55988 } 55989 } 55990 const once = (cb) => { 55991 let fired = false; 55992 return (...args) => { 55993 if (fired) return; 55994 fired = true; 55995 cb(...args); 55996 }; 55997 }; 55998 function runTests(options2, cb) { 55999 let { 56000 endEarly, 56001 tests, 56002 args, 56003 value, 56004 errors, 56005 sort, 56006 path 56007 } = options2; 56008 let callback = once(cb); 56009 let count2 = tests.length; 56010 const nestedErrors = []; 56011 errors = errors ? errors : []; 56012 if (!count2) return errors.length ? callback(new ValidationError(errors, value, path)) : callback(null, value); 56013 for (let i2 = 0; i2 < tests.length; i2++) { 56014 const test2 = tests[i2]; 56015 test2(args, function finishTestRun(err) { 56016 if (err) { 56017 if (!ValidationError.isError(err)) { 56018 return callback(err, value); 56019 } 56020 if (endEarly) { 56021 err.value = value; 56022 return callback(err, value); 56023 } 56024 nestedErrors.push(err); 56025 } 56026 if (--count2 <= 0) { 56027 if (nestedErrors.length) { 56028 if (sort) nestedErrors.sort(sort); 56029 if (errors.length) nestedErrors.push(...errors); 56030 errors = nestedErrors; 56031 } 56032 if (errors.length) { 56033 callback(new ValidationError(errors, value, path), value); 56034 return; 56035 } 56036 callback(null, value); 56037 } 56038 }); 56039 } 56040 } 56041 var propertyExpr; 56042 var hasRequiredPropertyExpr; 56043 function requirePropertyExpr() { 56044 if (hasRequiredPropertyExpr) return propertyExpr; 56045 hasRequiredPropertyExpr = 1; 56046 function Cache(maxSize) { 56047 this._maxSize = maxSize; 56048 this.clear(); 56049 } 56050 Cache.prototype.clear = function() { 56051 this._size = 0; 56052 this._values = /* @__PURE__ */ Object.create(null); 56053 }; 56054 Cache.prototype.get = function(key) { 56055 return this._values[key]; 56056 }; 56057 Cache.prototype.set = function(key, value) { 56058 this._size >= this._maxSize && this.clear(); 56059 if (!(key in this._values)) this._size++; 56060 return this._values[key] = value; 56061 }; 56062 var SPLIT_REGEX = /[^.^\]^[]+|(?=\[\]|\.\.)/g, DIGIT_REGEX = /^\d+$/, LEAD_DIGIT_REGEX = /^\d/, SPEC_CHAR_REGEX = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, CLEAN_QUOTES_REGEX = /^\s*(['"]?)(.*?)(\1)\s*$/, MAX_CACHE_SIZE = 512; 56063 var pathCache = new Cache(MAX_CACHE_SIZE), setCache = new Cache(MAX_CACHE_SIZE), getCache = new Cache(MAX_CACHE_SIZE); 56064 propertyExpr = { 56065 Cache, 56066 split, 56067 normalizePath, 56068 setter: function(path) { 56069 var parts = normalizePath(path); 56070 return setCache.get(path) || setCache.set(path, function setter(obj, value) { 56071 var index2 = 0; 56072 var len = parts.length; 56073 var data = obj; 56074 while (index2 < len - 1) { 56075 var part = parts[index2]; 56076 if (part === "__proto__" || part === "constructor" || part === "prototype") { 56077 return obj; 56078 } 56079 data = data[parts[index2++]]; 56080 } 56081 data[parts[index2]] = value; 56082 }); 56083 }, 56084 getter: function(path, safe) { 56085 var parts = normalizePath(path); 56086 return getCache.get(path) || getCache.set(path, function getter(data) { 56087 var index2 = 0, len = parts.length; 56088 while (index2 < len) { 56089 if (data != null || !safe) data = data[parts[index2++]]; 56090 else return; 56091 } 56092 return data; 56093 }); 56094 }, 56095 join: function(segments) { 56096 return segments.reduce(function(path, part) { 56097 return path + (isQuoted(part) || DIGIT_REGEX.test(part) ? "[" + part + "]" : (path ? "." : "") + part); 56098 }, ""); 56099 }, 56100 forEach: function(path, cb, thisArg) { 56101 forEach2(Array.isArray(path) ? path : split(path), cb, thisArg); 56102 } 56103 }; 56104 function normalizePath(path) { 56105 return pathCache.get(path) || pathCache.set( 56106 path, 56107 split(path).map(function(part) { 56108 return part.replace(CLEAN_QUOTES_REGEX, "$2"); 56109 }) 56110 ); 56111 } 56112 function split(path) { 56113 return path.match(SPLIT_REGEX) || [""]; 56114 } 56115 function forEach2(parts, iter, thisArg) { 56116 var len = parts.length, part, idx, isArray2, isBracket; 56117 for (idx = 0; idx < len; idx++) { 56118 part = parts[idx]; 56119 if (part) { 56120 if (shouldBeQuoted(part)) { 56121 part = '"' + part + '"'; 56122 } 56123 isBracket = isQuoted(part); 56124 isArray2 = !isBracket && /^\d+$/.test(part); 56125 iter.call(thisArg, part, isBracket, isArray2, idx, parts); 56126 } 56127 } 56128 } 56129 function isQuoted(str) { 56130 return typeof str === "string" && str && ["'", '"'].indexOf(str.charAt(0)) !== -1; 56131 } 56132 function hasLeadingNumber(part) { 56133 return part.match(LEAD_DIGIT_REGEX) && !part.match(DIGIT_REGEX); 56134 } 56135 function hasSpecialChars(part) { 56136 return SPEC_CHAR_REGEX.test(part); 56137 } 56138 function shouldBeQuoted(part) { 56139 return !isQuoted(part) && (hasLeadingNumber(part) || hasSpecialChars(part)); 56140 } 56141 return propertyExpr; 56142 } 56143 var propertyExprExports = requirePropertyExpr(); 56144 const prefixes = { 56145 context: "$", 56146 value: "." 56147 }; 56148 function create$8(key, options2) { 56149 return new Reference(key, options2); 56150 } 56151 class Reference { 56152 constructor(key, options2 = {}) { 56153 this.key = void 0; 56154 this.isContext = void 0; 56155 this.isValue = void 0; 56156 this.isSibling = void 0; 56157 this.path = void 0; 56158 this.getter = void 0; 56159 this.map = void 0; 56160 if (typeof key !== "string") throw new TypeError("ref must be a string, got: " + key); 56161 this.key = key.trim(); 56162 if (key === "") throw new TypeError("ref must be a non-empty string"); 56163 this.isContext = this.key[0] === prefixes.context; 56164 this.isValue = this.key[0] === prefixes.value; 56165 this.isSibling = !this.isContext && !this.isValue; 56166 let prefix2 = this.isContext ? prefixes.context : this.isValue ? prefixes.value : ""; 56167 this.path = this.key.slice(prefix2.length); 56168 this.getter = this.path && propertyExprExports.getter(this.path, true); 56169 this.map = options2.map; 56170 } 56171 getValue(value, parent, context) { 56172 let result = this.isContext ? context : this.isValue ? value : parent; 56173 if (this.getter) result = this.getter(result || {}); 56174 if (this.map) result = this.map(result); 56175 return result; 56176 } 56177 /** 56178 * 56179 * @param {*} value 56180 * @param {Object} options 56181 * @param {Object=} options.context 56182 * @param {Object=} options.parent 56183 */ 56184 cast(value, options2) { 56185 return this.getValue(value, options2 == null ? void 0 : options2.parent, options2 == null ? void 0 : options2.context); 56186 } 56187 resolve() { 56188 return this; 56189 } 56190 describe() { 56191 return { 56192 type: "ref", 56193 key: this.key 56194 }; 56195 } 56196 toString() { 56197 return `Ref(${this.key})`; 56198 } 56199 static isRef(value) { 56200 return value && value.__isYupRef; 56201 } 56202 } 56203 Reference.prototype.__isYupRef = true; 56204 function _extends$3() { 56205 _extends$3 = Object.assign || function(target) { 56206 for (var i2 = 1; i2 < arguments.length; i2++) { 56207 var source = arguments[i2]; 56208 for (var key in source) { 56209 if (Object.prototype.hasOwnProperty.call(source, key)) { 56210 target[key] = source[key]; 56211 } 56212 } 56213 } 56214 return target; 56215 }; 56216 return _extends$3.apply(this, arguments); 56217 } 56218 function _objectWithoutPropertiesLoose(source, excluded) { 56219 if (source == null) return {}; 56220 var target = {}; 56221 var sourceKeys = Object.keys(source); 56222 var key, i2; 56223 for (i2 = 0; i2 < sourceKeys.length; i2++) { 56224 key = sourceKeys[i2]; 56225 if (excluded.indexOf(key) >= 0) continue; 56226 target[key] = source[key]; 56227 } 56228 return target; 56229 } 56230 function createValidation(config) { 56231 function validate(_ref2, cb) { 56232 let { 56233 value, 56234 path = "", 56235 label, 56236 options: options2, 56237 originalValue, 56238 sync 56239 } = _ref2, rest = _objectWithoutPropertiesLoose(_ref2, ["value", "path", "label", "options", "originalValue", "sync"]); 56240 const { 56241 name, 56242 test: test2, 56243 params, 56244 message 56245 } = config; 56246 let { 56247 parent, 56248 context 56249 } = options2; 56250 function resolve(item) { 56251 return Reference.isRef(item) ? item.getValue(value, parent, context) : item; 56252 } 56253 function createError(overrides = {}) { 56254 const nextParams = mapValues(_extends$3({ 56255 value, 56256 originalValue, 56257 label, 56258 path: overrides.path || path 56259 }, params, overrides.params), resolve); 56260 const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name); 56261 error.params = nextParams; 56262 return error; 56263 } 56264 let ctx = _extends$3({ 56265 path, 56266 parent, 56267 type: name, 56268 createError, 56269 resolve, 56270 options: options2, 56271 originalValue 56272 }, rest); 56273 if (!sync) { 56274 try { 56275 Promise.resolve(test2.call(ctx, value, ctx)).then((validOrError) => { 56276 if (ValidationError.isError(validOrError)) cb(validOrError); 56277 else if (!validOrError) cb(createError()); 56278 else cb(null, validOrError); 56279 }).catch(cb); 56280 } catch (err) { 56281 cb(err); 56282 } 56283 return; 56284 } 56285 let result; 56286 try { 56287 var _ref22; 56288 result = test2.call(ctx, value, ctx); 56289 if (typeof ((_ref22 = result) == null ? void 0 : _ref22.then) === "function") { 56290 throw new Error(`Validation test of type: "${ctx.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`); 56291 } 56292 } catch (err) { 56293 cb(err); 56294 return; 56295 } 56296 if (ValidationError.isError(result)) cb(result); 56297 else if (!result) cb(createError()); 56298 else cb(null, result); 56299 } 56300 validate.OPTIONS = config; 56301 return validate; 56302 } 56303 let trim = (part) => part.substr(0, part.length - 1).substr(1); 56304 function getIn(schema, path, value, context = value) { 56305 let parent, lastPart, lastPartDebug; 56306 if (!path) return { 56307 parent, 56308 parentPath: path, 56309 schema 56310 }; 56311 propertyExprExports.forEach(path, (_part, isBracket, isArray2) => { 56312 let part = isBracket ? trim(_part) : _part; 56313 schema = schema.resolve({ 56314 context, 56315 parent, 56316 value 56317 }); 56318 if (schema.innerType) { 56319 let idx = isArray2 ? parseInt(part, 10) : 0; 56320 if (value && idx >= value.length) { 56321 throw new Error(`Yup.reach cannot resolve an array item at index: ${_part}, in the path: ${path}. because there is no value at that index. `); 56322 } 56323 parent = value; 56324 value = value && value[idx]; 56325 schema = schema.innerType; 56326 } 56327 if (!isArray2) { 56328 if (!schema.fields || !schema.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema._type}")`); 56329 parent = value; 56330 value = value && value[part]; 56331 schema = schema.fields[part]; 56332 } 56333 lastPart = part; 56334 lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part; 56335 }); 56336 return { 56337 schema, 56338 parent, 56339 parentPath: lastPart 56340 }; 56341 } 56342 const reach = (obj, path, value, context) => getIn(obj, path, value, context).schema; 56343 class ReferenceSet { 56344 constructor() { 56345 this.list = void 0; 56346 this.refs = void 0; 56347 this.list = /* @__PURE__ */ new Set(); 56348 this.refs = /* @__PURE__ */ new Map(); 56349 } 56350 get size() { 56351 return this.list.size + this.refs.size; 56352 } 56353 describe() { 56354 const description = []; 56355 for (const item of this.list) description.push(item); 56356 for (const [, ref] of this.refs) description.push(ref.describe()); 56357 return description; 56358 } 56359 toArray() { 56360 return Array.from(this.list).concat(Array.from(this.refs.values())); 56361 } 56362 resolveAll(resolve) { 56363 return this.toArray().reduce((acc, e2) => acc.concat(Reference.isRef(e2) ? resolve(e2) : e2), []); 56364 } 56365 add(value) { 56366 Reference.isRef(value) ? this.refs.set(value.key, value) : this.list.add(value); 56367 } 56368 delete(value) { 56369 Reference.isRef(value) ? this.refs.delete(value.key) : this.list.delete(value); 56370 } 56371 clone() { 56372 const next2 = new ReferenceSet(); 56373 next2.list = new Set(this.list); 56374 next2.refs = new Map(this.refs); 56375 return next2; 56376 } 56377 merge(newItems, removeItems) { 56378 const next2 = this.clone(); 56379 newItems.list.forEach((value) => next2.add(value)); 56380 newItems.refs.forEach((value) => next2.add(value)); 56381 removeItems.list.forEach((value) => next2.delete(value)); 56382 removeItems.refs.forEach((value) => next2.delete(value)); 56383 return next2; 56384 } 56385 } 56386 function _extends$2() { 56387 _extends$2 = Object.assign || function(target) { 56388 for (var i2 = 1; i2 < arguments.length; i2++) { 56389 var source = arguments[i2]; 56390 for (var key in source) { 56391 if (Object.prototype.hasOwnProperty.call(source, key)) { 56392 target[key] = source[key]; 56393 } 56394 } 56395 } 56396 return target; 56397 }; 56398 return _extends$2.apply(this, arguments); 56399 } 56400 class BaseSchema { 56401 constructor(options2) { 56402 this.deps = []; 56403 this.tests = void 0; 56404 this.transforms = void 0; 56405 this.conditions = []; 56406 this._mutate = void 0; 56407 this._typeError = void 0; 56408 this._whitelist = new ReferenceSet(); 56409 this._blacklist = new ReferenceSet(); 56410 this.exclusiveTests = /* @__PURE__ */ Object.create(null); 56411 this.spec = void 0; 56412 this.tests = []; 56413 this.transforms = []; 56414 this.withMutation(() => { 56415 this.typeError(mixed.notType); 56416 }); 56417 this.type = (options2 == null ? void 0 : options2.type) || "mixed"; 56418 this.spec = _extends$2({ 56419 strip: false, 56420 strict: false, 56421 abortEarly: true, 56422 recursive: true, 56423 nullable: false, 56424 presence: "optional" 56425 }, options2 == null ? void 0 : options2.spec); 56426 } 56427 // TODO: remove 56428 get _type() { 56429 return this.type; 56430 } 56431 _typeCheck(_value) { 56432 return true; 56433 } 56434 clone(spec) { 56435 if (this._mutate) { 56436 if (spec) Object.assign(this.spec, spec); 56437 return this; 56438 } 56439 const next2 = Object.create(Object.getPrototypeOf(this)); 56440 next2.type = this.type; 56441 next2._typeError = this._typeError; 56442 next2._whitelistError = this._whitelistError; 56443 next2._blacklistError = this._blacklistError; 56444 next2._whitelist = this._whitelist.clone(); 56445 next2._blacklist = this._blacklist.clone(); 56446 next2.exclusiveTests = _extends$2({}, this.exclusiveTests); 56447 next2.deps = [...this.deps]; 56448 next2.conditions = [...this.conditions]; 56449 next2.tests = [...this.tests]; 56450 next2.transforms = [...this.transforms]; 56451 next2.spec = clone(_extends$2({}, this.spec, spec)); 56452 return next2; 56453 } 56454 label(label) { 56455 let next2 = this.clone(); 56456 next2.spec.label = label; 56457 return next2; 56458 } 56459 meta(...args) { 56460 if (args.length === 0) return this.spec.meta; 56461 let next2 = this.clone(); 56462 next2.spec.meta = Object.assign(next2.spec.meta || {}, args[0]); 56463 return next2; 56464 } 56465 // withContext<TContext extends AnyObject>(): BaseSchema< 56466 // TCast, 56467 // TContext, 56468 // TOutput 56469 // > { 56470 // return this as any; 56471 // } 56472 withMutation(fn2) { 56473 let before = this._mutate; 56474 this._mutate = true; 56475 let result = fn2(this); 56476 this._mutate = before; 56477 return result; 56478 } 56479 concat(schema) { 56480 if (!schema || schema === this) return this; 56481 if (schema.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema.type}`); 56482 let base = this; 56483 let combined = schema.clone(); 56484 const mergedSpec = _extends$2({}, base.spec, combined.spec); 56485 combined.spec = mergedSpec; 56486 combined._typeError || (combined._typeError = base._typeError); 56487 combined._whitelistError || (combined._whitelistError = base._whitelistError); 56488 combined._blacklistError || (combined._blacklistError = base._blacklistError); 56489 combined._whitelist = base._whitelist.merge(schema._whitelist, schema._blacklist); 56490 combined._blacklist = base._blacklist.merge(schema._blacklist, schema._whitelist); 56491 combined.tests = base.tests; 56492 combined.exclusiveTests = base.exclusiveTests; 56493 combined.withMutation((next2) => { 56494 schema.tests.forEach((fn2) => { 56495 next2.test(fn2.OPTIONS); 56496 }); 56497 }); 56498 combined.transforms = [...base.transforms, ...combined.transforms]; 56499 return combined; 56500 } 56501 isType(v2) { 56502 if (this.spec.nullable && v2 === null) return true; 56503 return this._typeCheck(v2); 56504 } 56505 resolve(options2) { 56506 let schema = this; 56507 if (schema.conditions.length) { 56508 let conditions = schema.conditions; 56509 schema = schema.clone(); 56510 schema.conditions = []; 56511 schema = conditions.reduce((schema2, condition) => condition.resolve(schema2, options2), schema); 56512 schema = schema.resolve(options2); 56513 } 56514 return schema; 56515 } 56516 /** 56517 * 56518 * @param {*} value 56519 * @param {Object} options 56520 * @param {*=} options.parent 56521 * @param {*=} options.context 56522 */ 56523 cast(value, options2 = {}) { 56524 let resolvedSchema = this.resolve(_extends$2({ 56525 value 56526 }, options2)); 56527 let result = resolvedSchema._cast(value, options2); 56528 if (value !== void 0 && options2.assert !== false && resolvedSchema.isType(result) !== true) { 56529 let formattedValue = printValue(value); 56530 let formattedResult = printValue(result); 56531 throw new TypeError(`The value of ${options2.path || "field"} could not be cast to a value that satisfies the schema type: "${resolvedSchema._type}". 56532 56533attempted value: ${formattedValue} 56534` + (formattedResult !== formattedValue ? `result of cast: ${formattedResult}` : "")); 56535 } 56536 return result; 56537 } 56538 _cast(rawValue, _options) { 56539 let value = rawValue === void 0 ? rawValue : this.transforms.reduce((value2, fn2) => fn2.call(this, value2, rawValue, this), rawValue); 56540 if (value === void 0) { 56541 value = this.getDefault(); 56542 } 56543 return value; 56544 } 56545 _validate(_value, options2 = {}, cb) { 56546 let { 56547 sync, 56548 path, 56549 from: from2 = [], 56550 originalValue = _value, 56551 strict: strict2 = this.spec.strict, 56552 abortEarly = this.spec.abortEarly 56553 } = options2; 56554 let value = _value; 56555 if (!strict2) { 56556 value = this._cast(value, _extends$2({ 56557 assert: false 56558 }, options2)); 56559 } 56560 let args = { 56561 value, 56562 path, 56563 options: options2, 56564 originalValue, 56565 schema: this, 56566 label: this.spec.label, 56567 sync, 56568 from: from2 56569 }; 56570 let initialTests = []; 56571 if (this._typeError) initialTests.push(this._typeError); 56572 let finalTests = []; 56573 if (this._whitelistError) finalTests.push(this._whitelistError); 56574 if (this._blacklistError) finalTests.push(this._blacklistError); 56575 runTests({ 56576 args, 56577 value, 56578 path, 56579 tests: initialTests, 56580 endEarly: abortEarly 56581 }, (err) => { 56582 if (err) return void cb(err, value); 56583 runTests({ 56584 tests: this.tests.concat(finalTests), 56585 args, 56586 path, 56587 sync, 56588 value, 56589 endEarly: abortEarly 56590 }, cb); 56591 }); 56592 } 56593 validate(value, options2, maybeCb) { 56594 let schema = this.resolve(_extends$2({}, options2, { 56595 value 56596 })); 56597 return typeof maybeCb === "function" ? schema._validate(value, options2, maybeCb) : new Promise((resolve, reject) => schema._validate(value, options2, (err, value2) => { 56598 if (err) reject(err); 56599 else resolve(value2); 56600 })); 56601 } 56602 validateSync(value, options2) { 56603 let schema = this.resolve(_extends$2({}, options2, { 56604 value 56605 })); 56606 let result; 56607 schema._validate(value, _extends$2({}, options2, { 56608 sync: true 56609 }), (err, value2) => { 56610 if (err) throw err; 56611 result = value2; 56612 }); 56613 return result; 56614 } 56615 isValid(value, options2) { 56616 return this.validate(value, options2).then(() => true, (err) => { 56617 if (ValidationError.isError(err)) return false; 56618 throw err; 56619 }); 56620 } 56621 isValidSync(value, options2) { 56622 try { 56623 this.validateSync(value, options2); 56624 return true; 56625 } catch (err) { 56626 if (ValidationError.isError(err)) return false; 56627 throw err; 56628 } 56629 } 56630 _getDefault() { 56631 let defaultValue = this.spec.default; 56632 if (defaultValue == null) { 56633 return defaultValue; 56634 } 56635 return typeof defaultValue === "function" ? defaultValue.call(this) : clone(defaultValue); 56636 } 56637 getDefault(options2) { 56638 let schema = this.resolve(options2 || {}); 56639 return schema._getDefault(); 56640 } 56641 default(def) { 56642 if (arguments.length === 0) { 56643 return this._getDefault(); 56644 } 56645 let next2 = this.clone({ 56646 default: def 56647 }); 56648 return next2; 56649 } 56650 strict(isStrict = true) { 56651 let next2 = this.clone(); 56652 next2.spec.strict = isStrict; 56653 return next2; 56654 } 56655 _isPresent(value) { 56656 return value != null; 56657 } 56658 defined(message = mixed.defined) { 56659 return this.test({ 56660 message, 56661 name: "defined", 56662 exclusive: true, 56663 test(value) { 56664 return value !== void 0; 56665 } 56666 }); 56667 } 56668 required(message = mixed.required) { 56669 return this.clone({ 56670 presence: "required" 56671 }).withMutation((s2) => s2.test({ 56672 message, 56673 name: "required", 56674 exclusive: true, 56675 test(value) { 56676 return this.schema._isPresent(value); 56677 } 56678 })); 56679 } 56680 notRequired() { 56681 let next2 = this.clone({ 56682 presence: "optional" 56683 }); 56684 next2.tests = next2.tests.filter((test2) => test2.OPTIONS.name !== "required"); 56685 return next2; 56686 } 56687 nullable(isNullable = true) { 56688 let next2 = this.clone({ 56689 nullable: isNullable !== false 56690 }); 56691 return next2; 56692 } 56693 transform(fn2) { 56694 let next2 = this.clone(); 56695 next2.transforms.push(fn2); 56696 return next2; 56697 } 56698 /** 56699 * Adds a test function to the schema's queue of tests. 56700 * tests can be exclusive or non-exclusive. 56701 * 56702 * - exclusive tests, will replace any existing tests of the same name. 56703 * - non-exclusive: can be stacked 56704 * 56705 * If a non-exclusive test is added to a schema with an exclusive test of the same name 56706 * the exclusive test is removed and further tests of the same name will be stacked. 56707 * 56708 * If an exclusive test is added to a schema with non-exclusive tests of the same name 56709 * the previous tests are removed and further tests of the same name will replace each other. 56710 */ 56711 test(...args) { 56712 let opts; 56713 if (args.length === 1) { 56714 if (typeof args[0] === "function") { 56715 opts = { 56716 test: args[0] 56717 }; 56718 } else { 56719 opts = args[0]; 56720 } 56721 } else if (args.length === 2) { 56722 opts = { 56723 name: args[0], 56724 test: args[1] 56725 }; 56726 } else { 56727 opts = { 56728 name: args[0], 56729 message: args[1], 56730 test: args[2] 56731 }; 56732 } 56733 if (opts.message === void 0) opts.message = mixed.default; 56734 if (typeof opts.test !== "function") throw new TypeError("`test` is a required parameters"); 56735 let next2 = this.clone(); 56736 let validate = createValidation(opts); 56737 let isExclusive = opts.exclusive || opts.name && next2.exclusiveTests[opts.name] === true; 56738 if (opts.exclusive) { 56739 if (!opts.name) throw new TypeError("Exclusive tests must provide a unique `name` identifying the test"); 56740 } 56741 if (opts.name) next2.exclusiveTests[opts.name] = !!opts.exclusive; 56742 next2.tests = next2.tests.filter((fn2) => { 56743 if (fn2.OPTIONS.name === opts.name) { 56744 if (isExclusive) return false; 56745 if (fn2.OPTIONS.test === validate.OPTIONS.test) return false; 56746 } 56747 return true; 56748 }); 56749 next2.tests.push(validate); 56750 return next2; 56751 } 56752 when(keys2, options2) { 56753 if (!Array.isArray(keys2) && typeof keys2 !== "string") { 56754 options2 = keys2; 56755 keys2 = "."; 56756 } 56757 let next2 = this.clone(); 56758 let deps = toArray(keys2).map((key) => new Reference(key)); 56759 deps.forEach((dep) => { 56760 if (dep.isSibling) next2.deps.push(dep.key); 56761 }); 56762 next2.conditions.push(new Condition(deps, options2)); 56763 return next2; 56764 } 56765 typeError(message) { 56766 let next2 = this.clone(); 56767 next2._typeError = createValidation({ 56768 message, 56769 name: "typeError", 56770 test(value) { 56771 if (value !== void 0 && !this.schema.isType(value)) return this.createError({ 56772 params: { 56773 type: this.schema._type 56774 } 56775 }); 56776 return true; 56777 } 56778 }); 56779 return next2; 56780 } 56781 oneOf(enums, message = mixed.oneOf) { 56782 let next2 = this.clone(); 56783 enums.forEach((val) => { 56784 next2._whitelist.add(val); 56785 next2._blacklist.delete(val); 56786 }); 56787 next2._whitelistError = createValidation({ 56788 message, 56789 name: "oneOf", 56790 test(value) { 56791 if (value === void 0) return true; 56792 let valids = this.schema._whitelist; 56793 let resolved = valids.resolveAll(this.resolve); 56794 return resolved.includes(value) ? true : this.createError({ 56795 params: { 56796 values: valids.toArray().join(", "), 56797 resolved 56798 } 56799 }); 56800 } 56801 }); 56802 return next2; 56803 } 56804 notOneOf(enums, message = mixed.notOneOf) { 56805 let next2 = this.clone(); 56806 enums.forEach((val) => { 56807 next2._blacklist.add(val); 56808 next2._whitelist.delete(val); 56809 }); 56810 next2._blacklistError = createValidation({ 56811 message, 56812 name: "notOneOf", 56813 test(value) { 56814 let invalids = this.schema._blacklist; 56815 let resolved = invalids.resolveAll(this.resolve); 56816 if (resolved.includes(value)) return this.createError({ 56817 params: { 56818 values: invalids.toArray().join(", "), 56819 resolved 56820 } 56821 }); 56822 return true; 56823 } 56824 }); 56825 return next2; 56826 } 56827 strip(strip = true) { 56828 let next2 = this.clone(); 56829 next2.spec.strip = strip; 56830 return next2; 56831 } 56832 describe() { 56833 const next2 = this.clone(); 56834 const { 56835 label, 56836 meta 56837 } = next2.spec; 56838 const description = { 56839 meta, 56840 label, 56841 type: next2.type, 56842 oneOf: next2._whitelist.describe(), 56843 notOneOf: next2._blacklist.describe(), 56844 tests: next2.tests.map((fn2) => ({ 56845 name: fn2.OPTIONS.name, 56846 params: fn2.OPTIONS.params 56847 })).filter((n2, idx, list) => list.findIndex((c2) => c2.name === n2.name) === idx) 56848 }; 56849 return description; 56850 } 56851 } 56852 BaseSchema.prototype.__isYupSchema__ = true; 56853 for (const method of ["validate", "validateSync"]) BaseSchema.prototype[`${method}At`] = function(path, value, options2 = {}) { 56854 const { 56855 parent, 56856 parentPath, 56857 schema 56858 } = getIn(this, path, value, options2.context); 56859 return schema[method](parent && parent[parentPath], _extends$2({}, options2, { 56860 parent, 56861 path 56862 })); 56863 }; 56864 for (const alias of ["equals", "is"]) BaseSchema.prototype[alias] = BaseSchema.prototype.oneOf; 56865 for (const alias of ["not", "nope"]) BaseSchema.prototype[alias] = BaseSchema.prototype.notOneOf; 56866 BaseSchema.prototype.optional = BaseSchema.prototype.notRequired; 56867 const Mixed = BaseSchema; 56868 function create$7() { 56869 return new Mixed(); 56870 } 56871 create$7.prototype = Mixed.prototype; 56872 const isAbsent = (value) => value == null; 56873 function create$6() { 56874 return new BooleanSchema(); 56875 } 56876 class BooleanSchema extends BaseSchema { 56877 constructor() { 56878 super({ 56879 type: "boolean" 56880 }); 56881 this.withMutation(() => { 56882 this.transform(function(value) { 56883 if (!this.isType(value)) { 56884 if (/^(true|1)$/i.test(String(value))) return true; 56885 if (/^(false|0)$/i.test(String(value))) return false; 56886 } 56887 return value; 56888 }); 56889 }); 56890 } 56891 _typeCheck(v2) { 56892 if (v2 instanceof Boolean) v2 = v2.valueOf(); 56893 return typeof v2 === "boolean"; 56894 } 56895 isTrue(message = boolean.isValue) { 56896 return this.test({ 56897 message, 56898 name: "is-value", 56899 exclusive: true, 56900 params: { 56901 value: "true" 56902 }, 56903 test(value) { 56904 return isAbsent(value) || value === true; 56905 } 56906 }); 56907 } 56908 isFalse(message = boolean.isValue) { 56909 return this.test({ 56910 message, 56911 name: "is-value", 56912 exclusive: true, 56913 params: { 56914 value: "false" 56915 }, 56916 test(value) { 56917 return isAbsent(value) || value === false; 56918 } 56919 }); 56920 } 56921 } 56922 create$6.prototype = BooleanSchema.prototype; 56923 let rEmail = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; 56924 let rUrl = /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i; 56925 let rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; 56926 let isTrimmed = (value) => isAbsent(value) || value === value.trim(); 56927 let objStringTag = {}.toString(); 56928 function create$5() { 56929 return new StringSchema(); 56930 } 56931 class StringSchema extends BaseSchema { 56932 constructor() { 56933 super({ 56934 type: "string" 56935 }); 56936 this.withMutation(() => { 56937 this.transform(function(value) { 56938 if (this.isType(value)) return value; 56939 if (Array.isArray(value)) return value; 56940 const strValue = value != null && value.toString ? value.toString() : value; 56941 if (strValue === objStringTag) return value; 56942 return strValue; 56943 }); 56944 }); 56945 } 56946 _typeCheck(value) { 56947 if (value instanceof String) value = value.valueOf(); 56948 return typeof value === "string"; 56949 } 56950 _isPresent(value) { 56951 return super._isPresent(value) && !!value.length; 56952 } 56953 length(length2, message = string.length) { 56954 return this.test({ 56955 message, 56956 name: "length", 56957 exclusive: true, 56958 params: { 56959 length: length2 56960 }, 56961 test(value) { 56962 return isAbsent(value) || value.length === this.resolve(length2); 56963 } 56964 }); 56965 } 56966 min(min2, message = string.min) { 56967 return this.test({ 56968 message, 56969 name: "min", 56970 exclusive: true, 56971 params: { 56972 min: min2 56973 }, 56974 test(value) { 56975 return isAbsent(value) || value.length >= this.resolve(min2); 56976 } 56977 }); 56978 } 56979 max(max2, message = string.max) { 56980 return this.test({ 56981 name: "max", 56982 exclusive: true, 56983 message, 56984 params: { 56985 max: max2 56986 }, 56987 test(value) { 56988 return isAbsent(value) || value.length <= this.resolve(max2); 56989 } 56990 }); 56991 } 56992 matches(regex, options2) { 56993 let excludeEmptyString = false;
56994 let message; 56995 let name; 56996 if (options2) { 56997 if (typeof options2 === "object") { 56998 ({ 56999 excludeEmptyString = false, 57000 message, 57001 name 57002 } = options2); 57003 } else { 57004 message = options2; 57005 } 57006 } 57007 return this.test({ 57008 name: name || "matches", 57009 message: message || string.matches, 57010 params: { 57011 regex 57012 }, 57013 test: (value) => isAbsent(value) || value === "" && excludeEmptyString || value.search(regex) !== -1 57014 }); 57015 } 57016 email(message = string.email) { 57017 return this.matches(rEmail, { 57018 name: "email", 57019 message, 57020 excludeEmptyString: true 57021 }); 57022 } 57023 url(message = string.url) { 57024 return this.matches(rUrl, { 57025 name: "url", 57026 message, 57027 excludeEmptyString: true 57028 }); 57029 } 57030 uuid(message = string.uuid) { 57031 return this.matches(rUUID, { 57032 name: "uuid", 57033 message, 57034 excludeEmptyString: false 57035 }); 57036 } 57037 //-- transforms -- 57038 ensure() { 57039 return this.default("").transform((val) => val === null ? "" : val); 57040 } 57041 trim(message = string.trim) { 57042 return this.transform((val) => val != null ? val.trim() : val).test({ 57043 message, 57044 name: "trim", 57045 test: isTrimmed 57046 }); 57047 } 57048 lowercase(message = string.lowercase) { 57049 return this.transform((value) => !isAbsent(value) ? value.toLowerCase() : value).test({ 57050 message, 57051 name: "string_case", 57052 exclusive: true, 57053 test: (value) => isAbsent(value) || value === value.toLowerCase() 57054 }); 57055 } 57056 uppercase(message = string.uppercase) { 57057 return this.transform((value) => !isAbsent(value) ? value.toUpperCase() : value).test({ 57058 message, 57059 name: "string_case", 57060 exclusive: true, 57061 test: (value) => isAbsent(value) || value === value.toUpperCase() 57062 }); 57063 } 57064 } 57065 create$5.prototype = StringSchema.prototype; 57066 let isNaN$1 = (value) => value != +value; 57067 function create$4() { 57068 return new NumberSchema(); 57069 } 57070 class NumberSchema extends BaseSchema { 57071 constructor() { 57072 super({ 57073 type: "number" 57074 }); 57075 this.withMutation(() => { 57076 this.transform(function(value) { 57077 let parsed = value; 57078 if (typeof parsed === "string") { 57079 parsed = parsed.replace(/\s/g, ""); 57080 if (parsed === "") return NaN; 57081 parsed = +parsed; 57082 } 57083 if (this.isType(parsed)) return parsed; 57084 return parseFloat(parsed); 57085 }); 57086 }); 57087 } 57088 _typeCheck(value) { 57089 if (value instanceof Number) value = value.valueOf(); 57090 return typeof value === "number" && !isNaN$1(value); 57091 } 57092 min(min2, message = number.min) { 57093 return this.test({ 57094 message, 57095 name: "min", 57096 exclusive: true, 57097 params: { 57098 min: min2 57099 }, 57100 test(value) { 57101 return isAbsent(value) || value >= this.resolve(min2); 57102 } 57103 }); 57104 } 57105 max(max2, message = number.max) { 57106 return this.test({ 57107 message, 57108 name: "max", 57109 exclusive: true, 57110 params: { 57111 max: max2 57112 }, 57113 test(value) { 57114 return isAbsent(value) || value <= this.resolve(max2); 57115 } 57116 }); 57117 } 57118 lessThan(less, message = number.lessThan) { 57119 return this.test({ 57120 message, 57121 name: "max", 57122 exclusive: true, 57123 params: { 57124 less 57125 }, 57126 test(value) { 57127 return isAbsent(value) || value < this.resolve(less); 57128 } 57129 }); 57130 } 57131 moreThan(more, message = number.moreThan) { 57132 return this.test({ 57133 message, 57134 name: "min", 57135 exclusive: true, 57136 params: { 57137 more 57138 }, 57139 test(value) { 57140 return isAbsent(value) || value > this.resolve(more); 57141 } 57142 }); 57143 } 57144 positive(msg = number.positive) { 57145 return this.moreThan(0, msg); 57146 } 57147 negative(msg = number.negative) { 57148 return this.lessThan(0, msg); 57149 } 57150 integer(message = number.integer) { 57151 return this.test({ 57152 name: "integer", 57153 message, 57154 test: (val) => isAbsent(val) || Number.isInteger(val) 57155 }); 57156 } 57157 truncate() { 57158 return this.transform((value) => !isAbsent(value) ? value | 0 : value); 57159 }
vendor: 7,033 bytes, lines 57160-57447
57160 round(method) { 57161 var _method; 57162 let avail = ["ceil", "floor", "round", "trunc"]; 57163 method = ((_method = method) == null ? void 0 : _method.toLowerCase()) || "round"; 57164 if (method === "trunc") return this.truncate(); 57165 if (avail.indexOf(method.toLowerCase()) === -1) throw new TypeError("Only valid options for round() are: " + avail.join(", ")); 57166 return this.transform((value) => !isAbsent(value) ? Math[method](value) : value); 57167 } 57168 } 57169 create$4.prototype = NumberSchema.prototype; 57170 var isoReg = /^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/; 57171 function parseIsoDate(date2) { 57172 var numericKeys = [1, 4, 5, 6, 7, 10, 11], minutesOffset = 0, timestamp, struct; 57173 if (struct = isoReg.exec(date2)) { 57174 for (var i2 = 0, k2; k2 = numericKeys[i2]; ++i2) struct[k2] = +struct[k2] || 0; 57175 struct[2] = (+struct[2] || 1) - 1; 57176 struct[3] = +struct[3] || 1; 57177 struct[7] = struct[7] ? String(struct[7]).substr(0, 3) : 0; 57178 if ((struct[8] === void 0 || struct[8] === "") && (struct[9] === void 0 || struct[9] === "")) timestamp = +new Date(struct[1], struct[2], struct[3], struct[4], struct[5], struct[6], struct[7]); 57179 else { 57180 if (struct[8] !== "Z" && struct[9] !== void 0) { 57181 minutesOffset = struct[10] * 60 + struct[11]; 57182 if (struct[9] === "+") minutesOffset = 0 - minutesOffset; 57183 } 57184 timestamp = Date.UTC(struct[1], struct[2], struct[3], struct[4], struct[5] + minutesOffset, struct[6], struct[7]); 57185 } 57186 } else timestamp = Date.parse ? Date.parse(date2) : NaN; 57187 return timestamp; 57188 } 57189 let invalidDate = /* @__PURE__ */ new Date(""); 57190 let isDate = (obj) => Object.prototype.toString.call(obj) === "[object Date]"; 57191 function create$3() { 57192 return new DateSchema(); 57193 } 57194 class DateSchema extends BaseSchema { 57195 constructor() { 57196 super({ 57197 type: "date" 57198 }); 57199 this.withMutation(() => { 57200 this.transform(function(value) { 57201 if (this.isType(value)) return value; 57202 value = parseIsoDate(value); 57203 return !isNaN(value) ? new Date(value) : invalidDate; 57204 }); 57205 }); 57206 } 57207 _typeCheck(v2) { 57208 return isDate(v2) && !isNaN(v2.getTime()); 57209 } 57210 prepareParam(ref, name) { 57211 let param; 57212 if (!Reference.isRef(ref)) { 57213 let cast = this.cast(ref); 57214 if (!this._typeCheck(cast)) throw new TypeError(`\`${name}\` must be a Date or a value that can be \`cast()\` to a Date`); 57215 param = cast; 57216 } else { 57217 param = ref; 57218 } 57219 return param; 57220 } 57221 min(min2, message = date.min) { 57222 let limit = this.prepareParam(min2, "min"); 57223 return this.test({ 57224 message, 57225 name: "min", 57226 exclusive: true, 57227 params: { 57228 min: min2 57229 }, 57230 test(value) { 57231 return isAbsent(value) || value >= this.resolve(limit); 57232 } 57233 }); 57234 } 57235 max(max2, message = date.max) { 57236 let limit = this.prepareParam(max2, "max"); 57237 return this.test({ 57238 message, 57239 name: "max", 57240 exclusive: true, 57241 params: { 57242 max: max2 57243 }, 57244 test(value) { 57245 return isAbsent(value) || value <= this.resolve(limit); 57246 } 57247 }); 57248 } 57249 } 57250 DateSchema.INVALID_DATE = invalidDate; 57251 create$3.prototype = DateSchema.prototype; 57252 create$3.INVALID_DATE = invalidDate; 57253 var deburredLetters = { 57254 // Latin-1 Supplement block. 57255 "Ã": "A", 57256 "Ã": "A", 57257 "Ã": "A", 57258 "Ã": "A", 57259 "Ã": "A", 57260 "à ": "A", 57261 "à ": "a", 57262 "á": "a", 57263 "â": "a", 57264 "ã": "a", 57265 "ä": "a", 57266 "Ã¥": "a", 57267 "Ã": "C", 57268 "ç": "c", 57269 "Ã": "D", 57270 "ð": "d", 57271 "Ã": "E", 57272 "Ã": "E", 57273 "Ã": "E", 57274 "Ã": "E", 57275 "è": "e", 57276 "é": "e", 57277 "ê": "e", 57278 "ë": "e", 57279 "Ã": "I", 57280 "Ã": "I", 57281 "Ã": "I", 57282 "Ã": "I", 57283 "ì": "i", 57284 "Ã": "i", 57285 "î": "i", 57286 "ï": "i", 57287 "Ã": "N", 57288 "ñ": "n", 57289 "Ã": "O", 57290 "Ã": "O", 57291 "Ã": "O", 57292 "Ã": "O", 57293 "Ã": "O", 57294 "Ã": "O", 57295 "ò": "o", 57296 "ó": "o", 57297 "ô": "o", 57298 "õ": "o", 57299 "ö": "o", 57300 "ø": "o", 57301 "Ã": "U", 57302 "Ã": "U", 57303 "Ã": "U", 57304 "Ã": "U", 57305 "ù": "u", 57306 "ú": "u", 57307 "û": "u", 57308 "ü": "u", 57309 "Ã": "Y", 57310 "ý": "y", 57311 "ÿ": "y", 57312 "Ã": "Ae", 57313 "æ": "ae", 57314 "Ã": "Th", 57315 "þ": "th", 57316 "Ã": "ss", 57317 // Latin Extended-A block. 57318 "Ä": "A", 57319 "Ä": "A", 57320 "Ä": "A", 57321 "Ä": "a", 57322 "Ä": "a", 57323 "Ä ": "a", 57324 "Ä": "C", 57325 "Ä": "C", 57326 "Ä": "C", 57327 "Ä": "C", 57328 "Ä": "c", 57329 "Ä": "c", 57330 "Ä": "c", 57331 "Ä": "c", 57332 "Ä": "D", 57333 "Ä": "D", 57334 "Ä": "d", 57335 "Ä": "d", 57336 "Ä": "E", 57337 "Ä": "E", 57338 "Ä": "E", 57339 "Ä": "E", 57340 "Ä": "E", 57341 "Ä": "e", 57342 "Ä": "e", 57343 "Ä": "e", 57344 "Ä": "e", 57345 "Ä": "e", 57346 "Ä": "G", 57347 "Ä": "G", 57348 "Ä ": "G", 57349 "Ä¢": "G", 57350 "Ä": "g", 57351 "Ä": "g", 57352 "Ä¡": "g", 57353 "Ä£": "g", 57354 "Ĥ": "H", 57355 "Ħ": "H", 57356 "Ä¥": "h", 57357 "ħ": "h", 57358 "Ĩ": "I", 57359 "Ī": "I", 57360 "Ĭ": "I", 57361 "Ä®": "I", 57362 "İ": "I", 57363 "Ä©": "i", 57364 "Ä«": "i", 57365 "Ä": "i", 57366 "į": "i", 57367 "ı": "i", 57368 "Ä´": "J", 57369 "ĵ": "j", 57370 "Ķ": "K", 57371 "Ä·": "k", 57372 "ĸ": "k", 57373 "Ĺ": "L", 57374 "Ä»": "L", 57375 "Ľ": "L", 57376 "Ä¿": "L", 57377 "Å": "L", 57378 "ĺ": "l", 57379 "ļ": "l", 57380 "ľ": "l", 57381 "Å": "l", 57382 "Å": "l", 57383 "Å": "N", 57384 "Å ": "N", 57385 "Å": "N", 57386 "Å": "N", 57387 "Å": "n", 57388 "Å": "n", 57389 "Å": "n", 57390 "Å": "n", 57391 "Å": "O", 57392 "Å": "O", 57393 "Å": "O", 57394 "Å": "o", 57395 "Å": "o", 57396 "Å": "o", 57397 "Å": "R", 57398 "Å": "R", 57399 "Å": "R", 57400 "Å": "r", 57401 "Å": "r", 57402 "Å": "r", 57403 "Å": "S", 57404 "Å": "S", 57405 "Å": "S", 57406 "Å ": "S", 57407 "Å": "s", 57408 "Å": "s", 57409 "Å": "s", 57410 "Å¡": "s", 57411 "Å¢": "T", 57412 "Ť": "T", 57413 "Ŧ": "T", 57414 "Å£": "t", 57415 "Å¥": "t", 57416 "ŧ": "t", 57417 "Ũ": "U", 57418 "Ū": "U", 57419 "Ŭ": "U", 57420 "Å®": "U", 57421 "Ű": "U", 57422 "Ų": "U", 57423 "Å©": "u", 57424 "Å«": "u", 57425 "Å": "u", 57426 "ů": "u", 57427 "ű": "u", 57428 "ų": "u", 57429 "Å´": "W", 57430 "ŵ": "w", 57431 "Ŷ": "Y", 57432 "Å·": "y", 57433 "Ÿ": "Y", 57434 "Ź": "Z", 57435 "Å»": "Z", 57436 "Ž": "Z", 57437 "ź": "z", 57438 "ż": "z", 57439 "ž": "z", 57440 "IJ": "IJ", 57441 "ij": "ij", 57442 "Å": "Oe", 57443 "Å": "oe", 57444 "Å": "'n", 57445 "Å¿": "s" 57446 }; 57447 var deburrLetter = basePropertyOf(deburredLetters);
vendor: 4,247 bytes, lines 57448-57500
57448 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 57449 var rsComboMarksRange$1 = "\\u0300-\\u036f", reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$1 = "\\u20d0-\\u20ff", rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1; 57450 var rsCombo$1 = "[" + rsComboRange$1 + "]"; 57451 var reComboMark = RegExp(rsCombo$1, "g"); 57452 function deburr(string2) { 57453 string2 = toString$1(string2); 57454 return string2 && string2.replace(reLatin, deburrLetter).replace(reComboMark, ""); 57455 } 57456 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 57457 function asciiWords(string2) { 57458 return string2.match(reAsciiWord) || []; 57459 } 57460 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; 57461 function hasUnicodeWord(string2) { 57462 return reHasUnicodeWord.test(string2); 57463 } 57464 var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 57465 var rsApos$1 = "['â]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; 57466 var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos$1 + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos$1 + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq; 57467 var reUnicodeWord = RegExp([ 57468 rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", 57469 rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", 57470 rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, 57471 rsUpper + "+" + rsOptContrUpper, 57472 rsOrdUpper, 57473 rsOrdLower, 57474 rsDigits, 57475 rsEmoji 57476 ].join("|"), "g"); 57477 function unicodeWords(string2) { 57478 return string2.match(reUnicodeWord) || []; 57479 } 57480 function words(string2, pattern, guard) { 57481 string2 = toString$1(string2); 57482 pattern = pattern; 57483 if (pattern === void 0) { 57484 return hasUnicodeWord(string2) ? unicodeWords(string2) : asciiWords(string2); 57485 } 57486 return string2.match(pattern) || []; 57487 } 57488 var rsApos = "['â]"; 57489 var reApos = RegExp(rsApos, "g"); 57490 function createCompounder(callback) { 57491 return function(string2) { 57492 return arrayReduce(words(deburr(string2).replace(reApos, "")), callback, ""); 57493 }; 57494 } 57495 var snakeCase = createCompounder(function(result, word, index2) { 57496 return result + (index2 ? "_" : "") + word.toLowerCase(); 57497 }); 57498 function capitalize(string2) { 57499 return upperFirst(toString$1(string2).toLowerCase()); 57500 }
vendor: 15,871 bytes, lines 57501-57951
57501 var camelCase = createCompounder(function(result, word, index2) { 57502 word = word.toLowerCase(); 57503 return result + (index2 ? capitalize(word) : word); 57504 }); 57505 function mapKeys(object2, iteratee) { 57506 var result = {}; 57507 iteratee = baseIteratee(iteratee); 57508 baseForOwn(object2, function(value, key, object3) { 57509 baseAssignValue(result, iteratee(value, key, object3), value); 57510 }); 57511 return result; 57512 } 57513 var toposort$1 = { exports: {} }; 57514 var hasRequiredToposort; 57515 function requireToposort() { 57516 if (hasRequiredToposort) return toposort$1.exports; 57517 hasRequiredToposort = 1; 57518 toposort$1.exports = function(edges) { 57519 return toposort2(uniqueNodes(edges), edges); 57520 }; 57521 toposort$1.exports.array = toposort2; 57522 function toposort2(nodes, edges) { 57523 var cursor = nodes.length, sorted = new Array(cursor), visited = {}, i2 = cursor, outgoingEdges = makeOutgoingEdges(edges), nodesHash = makeNodesHash(nodes); 57524 edges.forEach(function(edge) { 57525 if (!nodesHash.has(edge[0]) || !nodesHash.has(edge[1])) { 57526 throw new Error("Unknown node. There is an unknown node in the supplied edges."); 57527 } 57528 }); 57529 while (i2--) { 57530 if (!visited[i2]) visit2(nodes[i2], i2, /* @__PURE__ */ new Set()); 57531 } 57532 return sorted; 57533 function visit2(node2, i3, predecessors) { 57534 if (predecessors.has(node2)) { 57535 var nodeRep; 57536 try { 57537 nodeRep = ", node was:" + JSON.stringify(node2); 57538 } catch (e2) { 57539 nodeRep = ""; 57540 } 57541 throw new Error("Cyclic dependency" + nodeRep); 57542 } 57543 if (!nodesHash.has(node2)) { 57544 throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(node2)); 57545 } 57546 if (visited[i3]) return; 57547 visited[i3] = true; 57548 var outgoing = outgoingEdges.get(node2) || /* @__PURE__ */ new Set(); 57549 outgoing = Array.from(outgoing); 57550 if (i3 = outgoing.length) { 57551 predecessors.add(node2); 57552 do { 57553 var child = outgoing[--i3]; 57554 visit2(child, nodesHash.get(child), predecessors); 57555 } while (i3); 57556 predecessors.delete(node2); 57557 } 57558 sorted[--cursor] = node2; 57559 } 57560 } 57561 function uniqueNodes(arr) { 57562 var res = /* @__PURE__ */ new Set(); 57563 for (var i2 = 0, len = arr.length; i2 < len; i2++) { 57564 var edge = arr[i2]; 57565 res.add(edge[0]); 57566 res.add(edge[1]); 57567 } 57568 return Array.from(res); 57569 } 57570 function makeOutgoingEdges(arr) { 57571 var edges = /* @__PURE__ */ new Map(); 57572 for (var i2 = 0, len = arr.length; i2 < len; i2++) { 57573 var edge = arr[i2]; 57574 if (!edges.has(edge[0])) edges.set(edge[0], /* @__PURE__ */ new Set()); 57575 if (!edges.has(edge[1])) edges.set(edge[1], /* @__PURE__ */ new Set()); 57576 edges.get(edge[0]).add(edge[1]); 57577 } 57578 return edges; 57579 } 57580 function makeNodesHash(arr) { 57581 var res = /* @__PURE__ */ new Map(); 57582 for (var i2 = 0, len = arr.length; i2 < len; i2++) { 57583 res.set(arr[i2], i2); 57584 } 57585 return res; 57586 } 57587 return toposort$1.exports; 57588 } 57589 var toposortExports = requireToposort(); 57590 const toposort = /* @__PURE__ */ getDefaultExportFromCjs(toposortExports); 57591 function sortFields(fields, excludedEdges = []) { 57592 let edges = []; 57593 let nodes = /* @__PURE__ */ new Set(); 57594 let excludes = new Set(excludedEdges.map(([a2, b2]) => `${a2}-${b2}`)); 57595 function addNode(depPath, key) { 57596 let node2 = propertyExprExports.split(depPath)[0]; 57597 nodes.add(node2); 57598 if (!excludes.has(`${key}-${node2}`)) edges.push([key, node2]); 57599 } 57600 for (const key in fields) if (has(fields, key)) { 57601 let value = fields[key]; 57602 nodes.add(key); 57603 if (Reference.isRef(value) && value.isSibling) addNode(value.path, key); 57604 else if (isSchema(value) && "deps" in value) value.deps.forEach((path) => addNode(path, key)); 57605 } 57606 return toposort.array(Array.from(nodes), edges).reverse(); 57607 } 57608 function findIndex(arr, err) { 57609 let idx = Infinity; 57610 arr.some((key, ii2) => { 57611 var _err$path; 57612 if (((_err$path = err.path) == null ? void 0 : _err$path.indexOf(key)) !== -1) { 57613 idx = ii2; 57614 return true; 57615 } 57616 }); 57617 return idx; 57618 } 57619 function sortByKeyOrder(keys2) { 57620 return (a2, b2) => { 57621 return findIndex(keys2, a2) - findIndex(keys2, b2); 57622 }; 57623 } 57624 function _extends$1() { 57625 _extends$1 = Object.assign || function(target) { 57626 for (var i2 = 1; i2 < arguments.length; i2++) { 57627 var source = arguments[i2]; 57628 for (var key in source) { 57629 if (Object.prototype.hasOwnProperty.call(source, key)) { 57630 target[key] = source[key]; 57631 } 57632 } 57633 } 57634 return target; 57635 }; 57636 return _extends$1.apply(this, arguments); 57637 } 57638 let isObject = (obj) => Object.prototype.toString.call(obj) === "[object Object]"; 57639 function unknown(ctx, value) { 57640 let known = Object.keys(ctx.fields); 57641 return Object.keys(value).filter((key) => known.indexOf(key) === -1); 57642 } 57643 const defaultSort = sortByKeyOrder([]); 57644 class ObjectSchema extends BaseSchema { 57645 constructor(spec) { 57646 super({ 57647 type: "object" 57648 }); 57649 this.fields = /* @__PURE__ */ Object.create(null); 57650 this._sortErrors = defaultSort; 57651 this._nodes = []; 57652 this._excludedEdges = []; 57653 this.withMutation(() => { 57654 this.transform(function coerce(value) { 57655 if (typeof value === "string") { 57656 try { 57657 value = JSON.parse(value); 57658 } catch (err) { 57659 value = null; 57660 } 57661 } 57662 if (this.isType(value)) return value; 57663 return null; 57664 }); 57665 if (spec) { 57666 this.shape(spec); 57667 } 57668 }); 57669 } 57670 _typeCheck(value) { 57671 return isObject(value) || typeof value === "function"; 57672 } 57673 _cast(_value, options2 = {}) { 57674 var _options$stripUnknown; 57675 let value = super._cast(_value, options2); 57676 if (value === void 0) return this.getDefault(); 57677 if (!this._typeCheck(value)) return value; 57678 let fields = this.fields; 57679 let strip = (_options$stripUnknown = options2.stripUnknown) != null ? _options$stripUnknown : this.spec.noUnknown; 57680 let props = this._nodes.concat(Object.keys(value).filter((v2) => this._nodes.indexOf(v2) === -1)); 57681 let intermediateValue = {}; 57682 let innerOptions = _extends$1({}, options2, { 57683 parent: intermediateValue, 57684 __validating: options2.__validating || false 57685 }); 57686 let isChanged = false; 57687 for (const prop of props) { 57688 let field = fields[prop]; 57689 let exists = has(value, prop); 57690 if (field) { 57691 let fieldValue; 57692 let inputValue = value[prop]; 57693 innerOptions.path = (options2.path ? `${options2.path}.` : "") + prop; 57694 field = field.resolve({ 57695 value: inputValue, 57696 context: options2.context, 57697 parent: intermediateValue 57698 }); 57699 let fieldSpec = "spec" in field ? field.spec : void 0; 57700 let strict2 = fieldSpec == null ? void 0 : fieldSpec.strict; 57701 if (fieldSpec == null ? void 0 : fieldSpec.strip) { 57702 isChanged = isChanged || prop in value; 57703 continue; 57704 } 57705 fieldValue = !options2.__validating || !strict2 ? ( 57706 // TODO: use _cast, this is double resolving 57707 field.cast(value[prop], innerOptions) 57708 ) : value[prop]; 57709 if (fieldValue !== void 0) { 57710 intermediateValue[prop] = fieldValue; 57711 } 57712 } else if (exists && !strip) { 57713 intermediateValue[prop] = value[prop]; 57714 } 57715 if (intermediateValue[prop] !== value[prop]) { 57716 isChanged = true; 57717 } 57718 } 57719 return isChanged ? intermediateValue : value; 57720 } 57721 _validate(_value, opts = {}, callback) { 57722 let errors = []; 57723 let { 57724 sync, 57725 from: from2 = [], 57726 originalValue = _value, 57727 abortEarly = this.spec.abortEarly, 57728 recursive = this.spec.recursive 57729 } = opts; 57730 from2 = [{ 57731 schema: this, 57732 value: originalValue 57733 }, ...from2]; 57734 opts.__validating = true; 57735 opts.originalValue = originalValue; 57736 opts.from = from2; 57737 super._validate(_value, opts, (err, value) => { 57738 if (err) { 57739 if (!ValidationError.isError(err) || abortEarly) { 57740 return void callback(err, value); 57741 } 57742 errors.push(err); 57743 } 57744 if (!recursive || !isObject(value)) { 57745 callback(errors[0] || null, value); 57746 return; 57747 } 57748 originalValue = originalValue || value; 57749 let tests = this._nodes.map((key) => (_2, cb) => { 57750 let path = key.indexOf(".") === -1 ? (opts.path ? `${opts.path}.` : "") + key : `${opts.path || ""}["${key}"]`; 57751 let field = this.fields[key]; 57752 if (field && "validate" in field) { 57753 field.validate(value[key], _extends$1({}, opts, { 57754 // @ts-ignore 57755 path, 57756 from: from2, 57757 // inner fields are always strict: 57758 // 1. this isn't strict so the casting will also have cast inner values 57759 // 2. this is strict in which case the nested values weren't cast either 57760 strict: true, 57761 parent: value, 57762 originalValue: originalValue[key] 57763 }), cb); 57764 return; 57765 } 57766 cb(null); 57767 }); 57768 runTests({ 57769 tests, 57770 value, 57771 errors, 57772 endEarly: abortEarly, 57773 sort: this._sortErrors, 57774 path: opts.path 57775 }, callback); 57776 }); 57777 } 57778 clone(spec) { 57779 const next2 = super.clone(spec); 57780 next2.fields = _extends$1({}, this.fields); 57781 next2._nodes = this._nodes; 57782 next2._excludedEdges = this._excludedEdges; 57783 next2._sortErrors = this._sortErrors; 57784 return next2; 57785 } 57786 concat(schema) { 57787 let next2 = super.concat(schema); 57788 let nextFields = next2.fields; 57789 for (let [field, schemaOrRef] of Object.entries(this.fields)) { 57790 const target = nextFields[field]; 57791 if (target === void 0) { 57792 nextFields[field] = schemaOrRef; 57793 } else if (target instanceof BaseSchema && schemaOrRef instanceof BaseSchema) { 57794 nextFields[field] = schemaOrRef.concat(target); 57795 } 57796 } 57797 return next2.withMutation(() => next2.shape(nextFields, this._excludedEdges)); 57798 } 57799 getDefaultFromShape() { 57800 let dft = {}; 57801 this._nodes.forEach((key) => { 57802 const field = this.fields[key]; 57803 dft[key] = "default" in field ? field.getDefault() : void 0; 57804 }); 57805 return dft; 57806 } 57807 _getDefault() { 57808 if ("default" in this.spec) { 57809 return super._getDefault(); 57810 } 57811 if (!this._nodes.length) { 57812 return void 0; 57813 } 57814 return this.getDefaultFromShape(); 57815 } 57816 shape(additions, excludes = []) { 57817 let next2 = this.clone(); 57818 let fields = Object.assign(next2.fields, additions); 57819 next2.fields = fields; 57820 next2._sortErrors = sortByKeyOrder(Object.keys(fields)); 57821 if (excludes.length) { 57822 if (!Array.isArray(excludes[0])) excludes = [excludes]; 57823 next2._excludedEdges = [...next2._excludedEdges, ...excludes]; 57824 } 57825 next2._nodes = sortFields(fields, next2._excludedEdges); 57826 return next2; 57827 } 57828 pick(keys2) { 57829 const picked = {}; 57830 for (const key of keys2) { 57831 if (this.fields[key]) picked[key] = this.fields[key]; 57832 } 57833 return this.clone().withMutation((next2) => { 57834 next2.fields = {}; 57835 return next2.shape(picked); 57836 }); 57837 } 57838 omit(keys2) { 57839 const next2 = this.clone(); 57840 const fields = next2.fields; 57841 next2.fields = {}; 57842 for (const key of keys2) { 57843 delete fields[key]; 57844 } 57845 return next2.withMutation(() => next2.shape(fields)); 57846 } 57847 from(from2, to2, alias) { 57848 let fromGetter = propertyExprExports.getter(from2, true); 57849 return this.transform((obj) => { 57850 if (obj == null) return obj; 57851 let newObj = obj; 57852 if (has(obj, from2)) { 57853 newObj = _extends$1({}, obj); 57854 if (!alias) delete newObj[from2]; 57855 newObj[to2] = fromGetter(obj); 57856 } 57857 return newObj; 57858 }); 57859 } 57860 noUnknown(noAllow = true, message = object.noUnknown) { 57861 if (typeof noAllow === "string") { 57862 message = noAllow; 57863 noAllow = true; 57864 } 57865 let next2 = this.test({ 57866 name: "noUnknown", 57867 exclusive: true, 57868 message, 57869 test(value) { 57870 if (value == null) return true; 57871 const unknownKeys = unknown(this.schema, value); 57872 return !noAllow || unknownKeys.length === 0 || this.createError({ 57873 params: { 57874 unknown: unknownKeys.join(", ") 57875 } 57876 }); 57877 } 57878 }); 57879 next2.spec.noUnknown = noAllow; 57880 return next2; 57881 } 57882 unknown(allow = true, message = object.noUnknown) { 57883 return this.noUnknown(!allow, message); 57884 } 57885 transformKeys(fn2) { 57886 return this.transform((obj) => obj && mapKeys(obj, (_2, key) => fn2(key))); 57887 } 57888 camelCase() { 57889 return this.transformKeys(camelCase); 57890 } 57891 snakeCase() { 57892 return this.transformKeys(snakeCase); 57893 } 57894 constantCase() { 57895 return this.transformKeys((key) => snakeCase(key).toUpperCase()); 57896 } 57897 describe() { 57898 let base = super.describe(); 57899 base.fields = mapValues(this.fields, (value) => value.describe()); 57900 return base; 57901 } 57902 } 57903 function create$2(spec) { 57904 return new ObjectSchema(spec); 57905 } 57906 create$2.prototype = ObjectSchema.prototype; 57907 function _extends() { 57908 _extends = Object.assign || function(target) { 57909 for (var i2 = 1; i2 < arguments.length; i2++) { 57910 var source = arguments[i2]; 57911 for (var key in source) { 57912 if (Object.prototype.hasOwnProperty.call(source, key)) { 57913 target[key] = source[key]; 57914 } 57915 } 57916 } 57917 return target; 57918 }; 57919 return _extends.apply(this, arguments); 57920 } 57921 function create$1(type) { 57922 return new ArraySchema(type); 57923 } 57924 class ArraySchema extends BaseSchema { 57925 constructor(type) { 57926 super({ 57927 type: "array" 57928 }); 57929 this.innerType = void 0; 57930 this.innerType = type; 57931 this.withMutation(() => { 57932 this.transform(function(values) { 57933 if (typeof values === "string") try { 57934 values = JSON.parse(values); 57935 } catch (err) { 57936 values = null; 57937 } 57938 return this.isType(values) ? values : null; 57939 }); 57940 }); 57941 } 57942 _typeCheck(v2) { 57943 return Array.isArray(v2); 57944 } 57945 get _subType() { 57946 return this.innerType; 57947 } 57948 _cast(_value, _opts) { 57949 const value = super._cast(_value, _opts); 57950 if (!this._typeCheck(value) || !this.innerType) return value; 57951 let isChanged = false;
57952 const castArray = value.map((v2, idx) => { 57953 const castElement = this.innerType.cast(v2, _extends({}, _opts, { 57954 path: `${_opts.path || ""}[${idx}]` 57955 })); 57956 if (castElement !== v2) { 57957 isChanged = true; 57958 } 57959 return castElement; 57960 }); 57961 return isChanged ? castArray : value; 57962 } 57963 _validate(_value, options2 = {}, callback) { 57964 var _options$abortEarly, _options$recursive; 57965 let errors = []; 57966 options2.sync; 57967 let path = options2.path; 57968 let innerType = this.innerType; 57969 let endEarly = (_options$abortEarly = options2.abortEarly) != null ? _options$abortEarly : this.spec.abortEarly; 57970 let recursive = (_options$recursive = options2.recursive) != null ? _options$recursive : this.spec.recursive; 57971 let originalValue = options2.originalValue != null ? options2.originalValue : _value; 57972 super._validate(_value, options2, (err, value) => { 57973 if (err) { 57974 if (!ValidationError.isError(err) || endEarly) { 57975 return void callback(err, value); 57976 } 57977 errors.push(err); 57978 } 57979 if (!recursive || !innerType || !this._typeCheck(value)) { 57980 callback(errors[0] || null, value); 57981 return; 57982 } 57983 originalValue = originalValue || value; 57984 let tests = new Array(value.length); 57985 for (let idx = 0; idx < value.length; idx++) { 57986 let item = value[idx]; 57987 let path2 = `${options2.path || ""}[${idx}]`; 57988 let innerOptions = _extends({}, options2, { 57989 path: path2, 57990 strict: true, 57991 parent: value, 57992 index: idx, 57993 originalValue: originalValue[idx] 57994 }); 57995 tests[idx] = (_2, cb) => innerType.validate(item, innerOptions, cb); 57996 } 57997 runTests({ 57998 path, 57999 value, 58000 errors, 58001 endEarly, 58002 tests 58003 }, callback); 58004 }); 58005 } 58006 clone(spec) { 58007 const next2 = super.clone(spec); 58008 next2.innerType = this.innerType; 58009 return next2; 58010 } 58011 concat(schema) { 58012 let next2 = super.concat(schema); 58013 next2.innerType = this.innerType; 58014 if (schema.innerType) next2.innerType = next2.innerType ? ( 58015 // @ts-expect-error Lazy doesn't have concat() 58016 next2.innerType.concat(schema.innerType) 58017 ) : schema.innerType; 58018 return next2; 58019 } 58020 of(schema) { 58021 let next2 = this.clone(); 58022 if (!isSchema(schema)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema)); 58023 next2.innerType = schema; 58024 return next2; 58025 } 58026 length(length2, message = array.length) { 58027 return this.test({ 58028 message, 58029 name: "length", 58030 exclusive: true, 58031 params: { 58032 length: length2 58033 }, 58034 test(value) { 58035 return isAbsent(value) || value.length === this.resolve(length2); 58036 } 58037 }); 58038 } 58039 min(min2, message) { 58040 message = message || array.min; 58041 return this.test({ 58042 message, 58043 name: "min", 58044 exclusive: true, 58045 params: { 58046 min: min2 58047 }, 58048 // FIXME(ts): Array<typeof T> 58049 test(value) { 58050 return isAbsent(value) || value.length >= this.resolve(min2); 58051 } 58052 }); 58053 } 58054 max(max2, message) { 58055 message = message || array.max; 58056 return this.test({ 58057 message, 58058 name: "max", 58059 exclusive: true, 58060 params: { 58061 max: max2 58062 }, 58063 test(value) { 58064 return isAbsent(value) || value.length <= this.resolve(max2); 58065 } 58066 }); 58067 } 58068 ensure() { 58069 return this.default(() => []).transform((val, original) => { 58070 if (this._typeCheck(val)) return val; 58071 return original == null ? [] : [].concat(original); 58072 }); 58073 } 58074 compact(rejector) {
58075 let reject = !rejector ? (v2) => !!v2 : (v2, i2, a2) => !rejector(v2, i2, a2); 58076 return this.transform((values) => values != null ? values.filter(reject) : values); 58077 } 58078 describe() { 58079 let base = super.describe(); 58080 if (this.innerType) base.innerType = this.innerType.describe(); 58081 return base; 58082 } 58083 nullable(isNullable = true) { 58084 return super.nullable(isNullable); 58085 } 58086 defined() { 58087 return super.defined(); 58088 } 58089 required(msg) { 58090 return super.required(msg); 58091 } 58092 } 58093 create$1.prototype = ArraySchema.prototype; 58094 function create(builder) { 58095 return new Lazy(builder); 58096 } 58097 class Lazy { 58098 constructor(builder) { 58099 this.type = "lazy"; 58100 this.__isYupSchema__ = true; 58101 this.__inputType = void 0; 58102 this.__outputType = void 0; 58103 this._resolve = (value, options2 = {}) => { 58104 let schema = this.builder(value, options2); 58105 if (!isSchema(schema)) throw new TypeError("lazy() functions must return a valid schema"); 58106 return schema.resolve(options2); 58107 }; 58108 this.builder = builder; 58109 } 58110 resolve(options2) { 58111 return this._resolve(options2.value, options2); 58112 } 58113 cast(value, options2) { 58114 return this._resolve(value, options2).cast(value, options2); 58115 } 58116 validate(value, options2, maybeCb) { 58117 return this._resolve(value, options2).validate(value, options2, maybeCb); 58118 } 58119 validateSync(value, options2) { 58120 return this._resolve(value, options2).validateSync(value, options2); 58121 } 58122 validateAt(path, value, options2) { 58123 return this._resolve(value, options2).validateAt(path, value, options2); 58124 } 58125 validateSyncAt(path, value, options2) { 58126 return this._resolve(value, options2).validateSyncAt(path, value, options2); 58127 } 58128 describe() { 58129 return null; 58130 } 58131 isValid(value, options2) { 58132 return this._resolve(value, options2).isValid(value, options2); 58133 } 58134 isValidSync(value, options2) { 58135 return this._resolve(value, options2).isValidSync(value, options2); 58136 } 58137 } 58138 function setLocale(custom) { 58139 Object.keys(custom).forEach((type) => { 58140 Object.keys(custom[type]).forEach((method) => { 58141 locale[type][method] = custom[type][method]; 58142 }); 58143 }); 58144 } 58145 function addMethod(schemaType, name, fn2) { 58146 if (!schemaType || !isSchema(schemaType.prototype)) throw new TypeError("You must provide a yup schema constructor function"); 58147 if (typeof name !== "string") throw new TypeError("A Method name must be provided"); 58148 if (typeof fn2 !== "function") throw new TypeError("Method function must be provided"); 58149 schemaType.prototype[name] = fn2; 58150 } 58151 const t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 58152 __proto__: null, 58153 ArraySchema, 58154 BaseSchema, 58155 BooleanSchema, 58156 DateSchema, 58157 MixedSchema: Mixed, 58158 NumberSchema, 58159 ObjectSchema, 58160 StringSchema, 58161 ValidationError, 58162 addMethod, 58163 array: create$1, 58164 bool: create$6, 58165 boolean: create$6, 58166 date: create$3, 58167 isSchema, 58168 lazy: create, 58169 mixed: create$7, 58170 number: create$4, 58171 object: create$2, 58172 reach, 58173 ref: create$8, 58174 setLocale, 58175 string: create$5 58176 }, Symbol.toStringTag, { value: "Module" })); 58177 setLocale({ mixed: { required: "This field is required." }, string: { email: "Email must be valid.", min: "Must have more than ${min} characters.", max: "Must have less than ${max} characters." }, number: { positive: "Must be greater than 0.", min: "Must not be lower than ${min}.", max: "Must not be higher than ${max}.", integer: "Must be an integer." } }); 58178 addMethod(create$5, "fullName", function(i2) { 58179 return this.test("fullName", i2, function(n2) { 58180 return !n2 || n2.trim().includes(" ") || this.createError({ path: this.path, message: i2 }); 58181 }); 58182 }); 58183 addMethod(create$5, "latin", function(i2) { 58184 return this.test("latin", i2, function(n2) { 58185 return !n2 || m$3(n2) || this.createError({ path: this.path, message: i2 }); 58186 }); 58187 }); 58188 addMethod(create$5, "notEmail", function(i2) { 58189 return this.test("notEmail", i2, function(n2) { 58190 return !create$5().email().isValidSync(n2) || this.createError({ path: this.path, message: i2 }); 58191 }); 58192 }); 58193 addMethod(create$5, "notPOBox", function(i2) { 58194 return this.test("notPOBox", i2, function(n2) { 58195 return !n2 || !d$3(n2) || this.createError({ path: this.path, message: i2 }); 58196 }); 58197 }); 58198 addMethod(create$5, "noHTML", function(i2 = "Must not include HTML tags.") { 58199 return this.test("noHTML", i2, function(n2) { 58200 return !n2 || !V$2(n2) || this.createError({ path: this.path, message: i2 }); 58201 }); 58202 }); 58203 var u = t; 58204 const useFormValidation = ({ topics }) => { 58205 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm" }); 58206 const validationSchema = reactExports.useMemo( 58207 () => u.object().shape({ 58208 email: u.string().required(t2("email_required_error")).email(t2("email_invalid_error")), 58209 fullName: u.string().required(t2("full_name_required_error")), 58210 topic: u.string().required(t2("topic_required_error")), 58211 subTopic: u.string().test( 58212 "isRequired", 58213 t2("sub_topic_required_error"), 58214 (value, { parent, options: options2 }) => { 58215 var _a, _b; 58216 const selectedTopicId = parent.topic; 58217 const selectedTopic = ((_a = options2.context) == null ? void 0 : _a.topics).find( 58218 ({ root: root2 }) => root2.id === selectedTopicId 58219 ); 58220 if (((_b = selectedTopic == null ? void 0 : selectedTopic.children) == null ? void 0 : _b.length) && !value) { 58221 return false;
58222 } 58223 return true; 58224 } 58225 ), 58226 message: u.string().required(t2("message_required_error")).min(15, ({ min: min2 }) => t2("message_min_length_error", { count: min2 })) 58227 }), 58228 [t2] 58229 ); 58230 const validate = (values) => { 58231 try { 58232 validateYupSchema(values, validationSchema, true, { 58233 topics 58234 }); 58235 } catch (err) { 58236 return yupToFormErrors(err); 58237 } 58238 return {}; 58239 }; 58240 return { 58241 validate 58242 }; 58243 }; 58244 const TranslatableForm = ({ children }) => { 58245 const { i18n } = useTranslation(); 58246 const { errors, touched, setFieldTouched } = y$4(); 58247 reactExports.useEffect(() => { 58248 const handleLanguageChanged = () => { 58249 Object.keys(errors).forEach((fieldName) => { 58250 if (Object.keys(touched).includes(fieldName)) { 58251 setFieldTouched(fieldName); 58252 } 58253 }); 58254 }; 58255 i18n.on("languageChanged", handleLanguageChanged); 58256 return () => { 58257 i18n.off("languageChanged", handleLanguageChanged); 58258 }; 58259 }, [errors, touched, setFieldTouched, i18n]); 58260 return /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { children }); 58261 }; 58262 const Container$7 = dt$2.div` 58263 padding: var(--space-300); 58264 border-radius: var(--panel-radius-normal); 58265 background: var(--bg-secondary); 58266 font-size: var(--font-size-300); 58267 line-height: var(--font-line-height-300); 58268`; 58269 const Title$1 = dt$2.div` 58270 color: var(--text-primary); 58271 font-weight: var(--font-weight-500); 58272 margin-bottom: var(--space-150); 58273`; 58274 const Text = dt$2.div` 58275 color: var(--text-secondary); 58276 58277 a { 58278 text-decoration: underline; 58279 58280 &:hover { 58281 color: var(--text-primary); 58282 } 58283 } 58284 58285 b, 58286 strong { 58287 font-weight: var(--font-weight-500); 58288 } 58289 58290 i { 58291 font-style: italic; 58292 } 58293 58294 ul, 58295 ol { 58296 margin: var(--space-150) 0; 58297 margin-left: var(--space-200); 58298 padding-left: var(--space-300); 58299 } 58300 58301 ul { 58302 list-style-type: disc; 58303 } 58304 58305 ol { 58306 list-style-type: decimal; 58307 } 58308 58309 li { 58310 margin-bottom: var(--space-100); 58311 58312 &:last-child { 58313 margin-bottom: 0; 58314 } 58315 } 58316`; 58317 const TopicAdditionalInfo = ({ title, children }) => { 58318 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$7, { children: [ 58319 title && /* @__PURE__ */ jsxRuntimeExports.jsx(Title$1, { children: title }), 58320 children && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { dangerouslySetInnerHTML: { __html: children } }) 58321 ] }); 58322 }; 58323 const getTopicById = (topics, id2) => { 58324 const topic = topics.find((topic2) => topic2.root.id === id2); 58325 if (topic) return topic.root; 58326 return topics.flatMap((topic2) => topic2.children).find((child) => child.id === id2); 58327 }; 58328 const getTopicOptions = (topics, parentId) => { 58329 var _a; 58330 const topicData = parentId === void 0 ? topics.map((topic) => topic.root) : (_a = topics.find((topic) => topic.root.id === parentId)) == null ? void 0 : _a.children; 58331 return (topicData == null ? void 0 : topicData.map((topic) => ({ label: topic.value, value: topic.id }))) || []; 58332 }; 58333 const List = dt$2.ul` 58334 display: flex; 58335 flex-direction: column; 58336 gap: var(--space-200); 58337 margin: 0; 58338 padding: 0; 58339 list-style: none; 58340`; 58341 const Item = dt$2.li` 58342 display: flex; 58343 align-items: center; 58344 gap: var(--space-200); 58345`; 58346 const Name$2 = dt$2.span` 58347 font-size: var(--font-size-400); 58348 line-height: var(--font-line-height-400); 58349 letter-spacing: var(--font-letter-spacing-normal); 58350`; 58351 const LoaderContainer = dt$2.div` 58352 display: flex; 58353 align-items: center; 58354 justify-content: center; 58355 width: 12px; 58356 height: 12px; 58357`; 58358 const FileListItem = ({ name, status, onRemove }) => { 58359 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm.attachments" }); 58360 const isLoading = status === "LOADING"; 58361 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Item, { children: [
58362 isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "small" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: onRemove, "aria-label": t2("remove_file_label"), children: /* @__PURE__ */ jsxRuntimeExports.jsx($4, { height: 12 }) }), 58363 /* @__PURE__ */ jsxRuntimeExports.jsx(Name$2, { children: name }) 58364 ] }); 58365 }; 58366 const FileList = ({ children }) => { 58367 return /* @__PURE__ */ jsxRuntimeExports.jsx(List, { children }); 58368 }; 58369 FileList.Item = FileListItem; 58370 const useUploadAttachmentMutation = R$2(CXContactApiClient.uploadAttachment, { 58371 mutationKey: ["uploadAttachment"] 58372 }); 58373 const useAttachmentFiles = () => { 58374 const [files, setFiles] = reactExports.useState([]); 58375 const { uploadAttachmentMutation } = useUploadAttachmentMutation(); 58376 const { addRecaptchaRequestInterceptor, removeRecaptchaRequestInterceptor } = Gr(); 58377 const updateFile = (file) => { 58378 setFiles((prev2) => prev2.map((oldFile) => oldFile.id === file.id ? file : oldFile)); 58379 }; 58380 const removeFile = (id2) => { 58381 setFiles((prev2) => prev2.filter((file) => file.id !== id2)); 58382 }; 58383 const uploadFiles = (acceptedFiles) => __async(null, null, function* () { 58384 const newFiles = acceptedFiles.map((file) => ({ 58385 id: crypto.randomUUID(), 58386 name: file.name, 58387 status: "LOADING" 58388 })); 58389 setFiles((prev2) => [...prev2, ...newFiles]); 58390 yield addRecaptchaRequestInterceptor(CXContactApiClient, "attachment_upload"); 58391 yield Promise.all( 58392 acceptedFiles.map((file, index2) => __async(null, null, function* () { 58393 try { 58394 const data = yield uploadAttachmentMutation.mutateAsync([file]); 58395 updateFile(__spreadProps(__spreadValues({}, newFiles[index2]), { status: "SUCCESS", url: data.fileUrl })); 58396 } catch (e2) { 58397 removeFile(newFiles[index2].id); 58398 } 58399 })) 58400 ); 58401 yield removeRecaptchaRequestInterceptor(CXContactApiClient); 58402 }); 58403 return { 58404 files, 58405 uploadFiles, 58406 removeFile 58407 }; 58408 }; 58409 const Container$6 = dt$2.div` 58410 display: flex; 58411 flex-direction: column; 58412 gap: var(--space-200); 58413 margin-top: var(--space-400); 58414`; 58415 const Attachments = ({ onChange }) => { 58416 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm.attachments" }); 58417 const { files, uploadFiles, removeFile } = useAttachmentFiles(); 58418 const { open, getInputProps } = useDropzone({ 58419 onDropAccepted: uploadFiles, 58420 maxSize: 10 * 1024 * 1024, 58421 // 10MB 58422 accept: { 58423 // Images 58424 "image/jpeg": [], 58425 "image/png": [], 58426 "image/gif": [], 58427 "image/webp": [], 58428 // Documents 58429 "application/pdf": [], 58430 "application/msword": [], 58431 "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [], 58432 "text/plain": [], 58433 // CSV/Excel 58434 "text/csv": [], 58435 "application/vnd.ms-excel": [], 58436 "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [] 58437 } 58438 }); 58439 reactExports.useEffect(() => { 58440 const fileUrls = files.filter((file) => file.status === "SUCCESS" && file.url).map((file) => file.url); 58441 onChange == null ? void 0 : onChange(fileUrls); 58442 }, [files]); 58443 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$6, { children: [
58444 /* @__PURE__ */ jsxRuntimeExports.jsx("input", __spreadValues({}, getInputProps())), 58445 /* @__PURE__ */ jsxRuntimeExports.jsx( 58446 ButtonClean, 58447 { 58448 appearance: "inherit", 58449 withUnderline: false, 58450 icon: ps, 58451 label: t2("add_button_label"), 58452 onClick: open 58453 } 58454 ), 58455 /* @__PURE__ */ jsxRuntimeExports.jsx(FileList, { children: files.map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx( 58456 FileList.Item, 58457 { 58458 name: file.name, 58459 status: file.status, 58460 onRemove: () => removeFile(file.id) 58461 }, 58462 file.id 58463 )) }) 58464 ] }); 58465 }; 58466 const useIsUploadingAttachment = () => { 58467 const isUploading = useIsMutating({ mutationKey: ["uploadAttachment"] }) > 0; 58468 return { isUploading }; 58469 }; 58470 const useReportFormTracking = ({ 58471 currentTopicId, 58472 firstAnswer 58473 }) => { 58474 const { trackEvent, screenId } = useAnalytics(); 58475 const { shopContextQuery } = useShopContextQuery(); 58476 const { orderData } = useOrderData(); 58477 reactExports.useEffect(() => { 58478 var _a; 58479 if (!currentTopicId) return; 58480 trackEvent("cf_topic_selected", { 58481 topic_id: currentTopicId, 58482 screen_id: screenId, 58483 shop_id: (_a = shopContextQuery.data) == null ? void 0 : _a.shopId, 58484 order_id: orderData == null ? void 0 : orderData.id 58485 }); 58486 }, [currentTopicId]); 58487 reactExports.useEffect(() => { 58488 var _a; 58489 if (!firstAnswer) return; 58490 trackEvent("cf_first_answer_displayed", { 58491 topic_id: currentTopicId, 58492 screen_id: screenId, 58493 shop_id: (_a = shopContextQuery.data) == null ? void 0 : _a.shopId, 58494 order_id: orderData == null ? void 0 : orderData.id 58495 }); 58496 }, [firstAnswer]); 58497 }; 58498 const ReportFormContent = ({ topics, showEmailField }) => { 58499 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm" }); 58500 const { values, isSubmitting, setFieldValue } = y$4(); 58501 const { isUploading: isUploadingAttachment } = useIsUploadingAttachment(); 58502 const currentTopicId = values.subTopic || values.topic; 58503 const selectedTopic = getTopicById(topics, currentTopicId); 58504 useReportFormTracking({ currentTopicId, firstAnswer: selectedTopic == null ? void 0 : selectedTopic.firstAnswer }); 58505 const topicOptions = getTopicOptions(topics); 58506 const subTopicOptions = getTopicOptions(topics, values.topic); 58507 const renderSubTopic = () => { 58508 if (!subTopicOptions.length) return null; 58509 return /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 58510 Field, 58511 { 58512 component: Select, 58513 name: "subTopic", 58514 label: t2("sub_topic_label"), 58515 options: subTopicOptions 58516 } 58517 ) }) }); 58518 }; 58519 const renderSelectedTopicAdditionalInfo = () => { 58520 if (!(selectedTopic == null ? void 0 : selectedTopic.firstAnswer)) { 58521 return null; 58522 } 58523 return /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TopicAdditionalInfo, { title: selectedTopic.firstAnswer.headerPlainString, children: selectedTopic.firstAnswer.bodyHtml }) }) }); 58524 }; 58525 return /* @__PURE__ */ jsxRuntimeExports.jsx(TranslatableForm, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Fieldset, { children: [
58526 showEmailField && /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { component: Input$1, name: "email", label: t2("email_label") }) }) }), 58527 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { component: Input$1, name: "fullName", label: t2("full_name_label") }) }) }), 58528 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 58529 Field, 58530 { 58531 component: Select, 58532 name: "topic", 58533 label: t2("topic_label"), 58534 options: topicOptions, 58535 onChange: () => setFieldValue("subTopic", "") 58536 } 58537 ) }) }), 58538 renderSubTopic(), 58539 renderSelectedTopicAdditionalInfo(),
58540 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 58541 Field, 58542 { 58543 component: Textarea, 58544 rows: 5, 58545 name: "message", 58546 label: t2("message_label"), 58547 placeholder: t2("message_label") 58548 } 58549 ) }) }), 58550 /* @__PURE__ */ jsxRuntimeExports.jsx(Attachments, { onChange: (fileUrls) => setFieldValue("attachments", fileUrls) }), 58551 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 58552 Button$1, 58553 { 58554 label: t2("submit_label"), 58555 loading: isSubmitting, 58556 disabled: isUploadingAttachment, 58557 type: "submit", 58558 appearance: "primary", 58559 fullWidth: true 58560 } 58561 ) }) }) 58562 ] }) }); 58563 }; 58564 const useCreateReportMutation = R$2(CXContactApiClient.createReport, { 58565 mutationKey: ["createReport"] 58566 }); 58567 const useTopicTreeQuery = C$3(CXContactApiClient.getTopicTree, { 58568 queryKey: ["topicTree"] 58569 }); 58570 const isVisibleByAllowedValues = (allowedValues, selectedValues) => { 58571 if (allowedValues === void 0 || allowedValues === null) { 58572 return true; 58573 } 58574 if (allowedValues.length === 0) { 58575 return false; 58576 } 58577 return selectedValues.some((value) => allowedValues.includes(value)); 58578 }; 58579 const isTopicVisible = (topic, context) => { 58580 const passesFulfillmentFilter = isVisibleByAllowedValues( 58581 topic.allowedFulfillmentServices, 58582 context.selectedFulfillmentServices 58583 ); 58584 const passesShopFeaturesFilter = isVisibleByAllowedValues( 58585 topic.allowedShopFeatures, 58586 context.enabledShopFeatures 58587 ); 58588 return passesFulfillmentFilter && passesShopFeaturesFilter; 58589 }; 58590 const filterTopics = (topics, context) => { 58591 return topics.filter((topic) => isTopicVisible(topic, context)).map((topic) => __spreadProps(__spreadValues({}, topic), { 58592 children: topic.children.filter((child) => isTopicVisible(child, context)) 58593 })); 58594 }; 58595 /*! js-cookie v3.0.5 | MIT */ 58596 function assign(target) { 58597 for (var i2 = 1; i2 < arguments.length; i2++) { 58598 var source = arguments[i2]; 58599 for (var key in source) { 58600 target[key] = source[key]; 58601 } 58602 } 58603 return target; 58604 } 58605 var defaultConverter = { 58606 read: function(value) { 58607 if (value[0] === '"') { 58608 value = value.slice(1, -1); 58609 } 58610 return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); 58611 }, 58612 write: function(value) { 58613 return encodeURIComponent(value).replace( 58614 /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, 58615 decodeURIComponent 58616 ); 58617 } 58618 }; 58619 function init(converter, defaultAttributes) { 58620 function set2(name, value, attributes) { 58621 if (typeof document === "undefined") { 58622 return; 58623 } 58624 attributes = assign({}, defaultAttributes, attributes); 58625 if (typeof attributes.expires === "number") { 58626 attributes.expires = new Date(Date.now() + attributes.expires * 864e5); 58627 } 58628 if (attributes.expires) { 58629 attributes.expires = attributes.expires.toUTCString(); 58630 } 58631 name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); 58632 var stringifiedAttributes = ""; 58633 for (var attributeName in attributes) { 58634 if (!attributes[attributeName]) { 58635 continue; 58636 } 58637 stringifiedAttributes += "; " + attributeName; 58638 if (attributes[attributeName] === true) { 58639 continue; 58640 } 58641 stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; 58642 } 58643 return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes; 58644 } 58645 function get2(name) { 58646 if (typeof document === "undefined" || arguments.length && !name) { 58647 return; 58648 } 58649 var cookies2 = document.cookie ? document.cookie.split("; ") : []; 58650 var jar = {}; 58651 for (var i2 = 0;
58651 i2 < cookies2.length; i2++) { 58652 var parts = cookies2[i2].split("="); 58653 var value = parts.slice(1).join("="); 58654 try { 58655 var found = decodeURIComponent(parts[0]); 58656 jar[found] = converter.read(value, found); 58657 if (name === found) { 58658 break; 58659 } 58660 } catch (e2) { 58661 } 58662 } 58663 return name ? jar[name] : jar; 58664 } 58665 return Object.create( 58666 { 58667 set: set2, 58668 get: get2, 58669 remove: function(name, attributes) { 58670 set2( 58671 name, 58672 "", 58673 assign({}, attributes, { 58674 expires: -1 58675 }) 58676 ); 58677 }, 58678 withAttributes: function(attributes) { 58679 return init(this.converter, assign({}, this.attributes, attributes)); 58680 }, 58681 withConverter: function(converter2) { 58682 return init(assign({}, this.converter, converter2), this.attributes); 58683 } 58684 }, 58685 { 58686 attributes: { value: Object.freeze(defaultAttributes) }, 58687 converter: { value: Object.freeze(converter) } 58688 } 58689 ); 58690 } 58691 init(defaultConverter, { path: "/" }); 58692 var i = "core_dashboard_visited"; 58693 reactExports.createContext(void 0); 58694 const getIsCreator = () => { 58695 return document.cookie.split("; ").some((cookie) => cookie.startsWith(`${i}=`)); 58696 }; 58697 const getTopicByFriendlyId = (topics, friendlyId) => { 58698 const topic = topics.find((topic2) => topic2.root.friendlyId === friendlyId); 58699 if (topic) return topic.root; 58700 return topics.flatMap((topic2) => topic2.children).find((child) => child.friendlyId === friendlyId); 58701 }; 58702 const ReportForm = ({ topicPath, showEmailField = true }) => { 58703 var _a, _b, _c; 58704 const { orderData, selectedVariantIds, selectedVariantsData } = useOrderData(); 58705 const location = useLocation(); 58706 const isOrderPlaced = location.pathname.includes(routes.contact.orderPlaced.self); 58707 const orderId = isOrderPlaced ? orderData == null ? void 0 : orderData.id : void 0; 58708 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm" }); 58709 const { isAuthorized, email, friendlyId, logout } = useOrderAuth(); 58710 const navigate = useNavigate(); 58711 const [searchParams] = useSearchParams(); 58712 const { shopContextQuery } = useShopContextQuery(); 58713 const orderParams = isAuthorized && orderId && friendlyId && email ? { orderId, orderFriendlyId: friendlyId, supporterEmail: email } : {}; 58714 const { topicTreeQuery } = useTopicTreeQuery([ 58715 __spreadValues({ 58716 path: topicPath, 58717 isCreator: getIsCreator() 58718 }, orderParams) 58719 ]); 58720 const { createReportMutation } = useCreateReportMutation({ 58721 // NOTE: remove default error handling, because we handle it in the formik level 58722 onError: void 0 58723 }); 58724 const { addRecaptchaRequestInterceptor, removeRecaptchaRequestInterceptor } = Gr(); 58725 const contactEmail = (_a = shopContextQuery.data) == null ? void 0 : _a.contactEmail; 58726 const topics = reactExports.useMemo(() => { 58727 var _a2, _b2; 58728 return (_b2 = (_a2 = topicTreeQuery.data) == null ? void 0 : _a2.topics) != null ? _b2 : []; 58729 }, [topicTreeQuery.data]); 58730 const selectedFulfillmentServices = reactExports.useMemo( 58731 () => [ 58732 ...new Set( 58733 selectedVariantsData.map((variant) => variant.fulfillmentService).filter((service) => service !== void 0) 58734 ) 58735 ], 58736 [selectedVariantsData] 58737 ); 58738 const enabledShopFeatures = reactExports.useMemo( 58739 () => { 58740 var _a2, _b2; 58741 return (_b2 = (_a2 = shopContextQuery.data) == null ? void 0 : _a2.enabledFeatures) != null ? _b2 : []; 58742 }, 58743 [(_b = shopContextQuery.data) == null ? void 0 : _b.enabledFeatures] 58744 ); 58745 const filteredTopics = reactExports.useMemo( 58746 () => filterTopics(topics, { selectedFulfillmentServices, enabledShopFeatures }), 58747 [topics, selectedFulfillmentServices, enabledShopFeatures] 58748 ); 58749 const { validate } = useFormValidation({ topics: filteredTopics }); 58750 const topicFriendlyIdParam = searchParams.get("topicId"); 58751 const initialTopicFromUrl = reactExports.useMemo(() => { 58752 if (!topicFriendlyIdParam) return void 0;
58753 return getTopicByFriendlyId(filteredTopics, topicFriendlyIdParam); 58754 }, [filteredTopics, topicFriendlyIdParam]); 58755 const initialTopicId = reactExports.useMemo(() => { 58756 if (!initialTopicFromUrl) return ""; 58757 if (!initialTopicFromUrl.parentId) return initialTopicFromUrl.id; 58758 return initialTopicFromUrl.parentId; 58759 }, [initialTopicFromUrl]); 58760 const initialSubTopicId = reactExports.useMemo(() => { 58761 if (!initialTopicFromUrl) return ""; 58762 if (!initialTopicFromUrl.parentId) return ""; 58763 return initialTopicFromUrl.friendlyId; 58764 }, [initialTopicFromUrl]); 58765 const initialValues = reactExports.useMemo( 58766 () => { 58767 var _a2; 58768 return { 58769 email: email != null ? email : "", 58770 fullName: ((_a2 = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a2.shippingFullName) || "", 58771 topic: initialTopicId, 58772 subTopic: initialSubTopicId, 58773 message: "", 58774 attachments: [] 58775 }; 58776 }, 58777 [email, (_c = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _c.shippingFullName, initialTopicId, initialSubTopicId] 58778 ); 58779 const handleSubmit = (values) => __async(null, null, function* () { 58780 yield addRecaptchaRequestInterceptor(CXContactApiClient, "report_add"); 58781 try { 58782 yield createReportMutation.mutateAsync([ 58783 { 58784 orderId, 58785 topicId: values.subTopic || values.topic, 58786 isCreator: getIsCreator(), 58787 offerVariantIds: selectedVariantIds, 58788 supporterEmail: values.email, 58789 supporterFullName: values.fullName, 58790 message: values.message, 58791 attachmentUrls: values.attachments 58792 } 58793 ]); 58794 logout(); 58795 navigate(routes.contact.success); 58796 } catch (e2) { 58797 notify( 58798 contactEmail ? /* @__PURE__ */ jsxRuntimeExports.jsx( 58799 Trans, 58800 { 58801 t: t2, 58802 i18nKey: "submit_error", 58803 components: { 58804 emailLink: /* @__PURE__ */ jsxRuntimeExports.jsx( 58805 ButtonClean, 58806 { 58807 appearance: "inherit", 58808 label: contactEmail, 58809 href: `mailto:${contactEmail}` 58810 } 58811 ) 58812 } 58813 } 58814 ) : t2("submit_error_no_email"), 58815 { type: "error" } 58816 ); 58817 } finally { 58818 yield removeRecaptchaRequestInterceptor(CXContactApiClient); 58819 } 58820 }); 58821 if (topicTreeQuery.isInitialLoading) { 58822 return /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Loader, {}); 58823 } 58824 return /* @__PURE__ */ jsxRuntimeExports.jsx(Formik, { initialValues, validate, onSubmit: handleSubmit, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ReportFormContent, { topics: filteredTopics, showEmailField }) }); 58825 }; 58826 const Container$5 = dt$2.div` 58827 display: flex; 58828 gap: var(--space-200); 58829`; 58830 const ItemContainer$1 = dt$2.div` 58831 display: flex; 58832 align-items: center; 58833 gap: var(--space-200); 58834 background: var(--bg-secondary); 58835 border-radius: var(--panel-radius-normal); 58836 padding: var(--space-100) var(--space-200) var(--space-100) var(--space-100); 58837`; 58838 const ImageContainer$1 = dt$2.div` 58839 flex-shrink: 0; 58840 height: 40px; 58841 aspect-ratio: 3/4; 58842 background-color: var(--bg-secondary); 58843`; 58844 const Image$1 = dt$2.img` 58845 width: 100%; 58846 height: auto; 58847 object-fit: contain; 58848 border-radius: var(--image-radius-normal); 58849`; 58850 const ImagePlaceholder$1 = dt$2.div` 58851 width: 100%; 58852 height: 100%; 58853 display: flex; 58854 align-items: center; 58855 justify-content: center; 58856 border-radius: var(--image-radius-normal); 58857 color: var(--pale, var(--icon-secondary)); 58858`; 58859 const Name$1 = dt$2.span` 58860 color: var(--text-primary); 58861 font-size: var(--font-size-300); 58862 line-height: var(--font-line-height-300); 58863 letter-spacing: var(--font-letter-spacing-loose); 58864`; 58865 const ProductsThumbnailsItem = ({ imageUrl, name }) => { 58866 const renderPhoto = () => { 58867 if (!imageUrl) { 58868 return /* @__PURE__ */ jsxRuntimeExports.jsx(ImagePlaceholder$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(D9, { height: 20 }) }); 58869 } 58870 return /* @__PURE__ */ jsxRuntimeExports.jsx(Image$1, { src: imageUrl, alt: name }); 58871 }; 58872 return /* @__PURE__ */ jsxRuntimeExports.jsxs(ItemContainer$1, { children: [
58873 /* @__PURE__ */ jsxRuntimeExports.jsx(ImageContainer$1, { children: renderPhoto() }), 58874 /* @__PURE__ */ jsxRuntimeExports.jsx(Name$1, { children: name }) 58875 ] }); 58876 }; 58877 const ProductsThumbnails = ({ children }) => { 58878 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$5, { children }); 58879 }; 58880 ProductsThumbnails.Item = ProductsThumbnailsItem; 58881 const OrderDetails = () => { 58882 const { selectedVariants, selectedVariantsData } = useOrderData(); 58883 const navigate = useNavigate(); 58884 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderDetails" }); 58885 reactExports.useEffect(() => { 58886 if (!selectedVariants.length) { 58887 navigate(routes.contact.orderPlaced.self); 58888 } 58889 }, [selectedVariants, navigate]); 58890 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 58891 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { backLocation: routes.contact.orderPlaced.variants, children: t2("title") }), 58892 /* @__PURE__ */ jsxRuntimeExports.jsx(ProductsThumbnails, { children: selectedVariantsData.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx( 58893 ProductsThumbnails.Item, 58894 { 58895 imageUrl: variant.imageUrl, 58896 name: variant == null ? void 0 : variant.name 58897 }, 58898 variant.id 58899 )) }),
58900 /* @__PURE__ */ jsxRuntimeExports.jsx(ReportForm, { topicPath: "ORDER_ITEMS", showEmailField: false }) 58901 ] }); 58902 }; 58903 const Container$4 = dt$2(Link)` 58904 flex: 1; 58905 58906 border: 1px solid var(--input-border, var(--border-secondary)); 58907 border-radius: var(--button-radius-normal); 58908 padding: var(--space-400); 58909 color: var(--text-secondary); 58910 font-size: var(--font-size-400); 58911 line-height: var(--font-line-height-400); 58912 letter-spacing: var(--font-letter-spacing-normal, 0); 58913 text-align: center; 58914 58915 &:hover { 58916 color: var(--text-primary); 58917 border-color: var(--text-primary); 58918 } 58919 58920 ${({ $active }) => $active && lt$2` 58921 cursor: default; 58922 color: var(--text-primary); 58923 border-color: var(--text-primary); 58924 font-weight: var(--font-weight-600); 58925 box-shadow: inset 0 0 0 1px var(--text-primary); 58926 `} 58927`; 58928 const TabButton = ({ active = false, to: to2, children }) => { 58929 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$4, { $active: active, to: to2, children }); 58930 }; 58931 const Paragraph = dt$2.p` 58932 line-height: var(--font-line-height-400); 58933 letter-spacing: var(--font-letter-spacing-normal); 58934 margin: 0; 58935 58936 & + & { 58937 margin-top: var(--space-200); 58938 } 58939`; 58940 const OrderNumberSuggestionModal = () => { 58941 const { close } = useModalContext(); 58942 const navigate = useNavigate(); 58943 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderLogin" }); 58944 const handleSupportClick = () => { 58945 navigate(`${routes.contact.somethingElse}?topicId=ORDER_CONFIRMATION_ISSUE`); 58946 close(); 58947 }; 58948 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 58949 ModalBox, 58950 { 58951 title: t2("order_number_suggestion_modal_title"), 58952 onClose: close, 58953 fullWidth: true, 58954 buttonsDirection: "column", 58955 buttons: [
58956 /* @__PURE__ */ jsxRuntimeExports.jsx( 58957 Button$1, 58958 { 58959 label: t2("order_number_suggestion_modal_support_button"), 58960 appearance: "semi-transparent", 58961 fullWidth: true, 58962 onClick: handleSupportClick 58963 }, 58964 "support" 58965 ), 58966 /* @__PURE__ */ jsxRuntimeExports.jsx( 58967 Button$1, 58968 { 58969 label: t2("order_number_suggestion_modal_close_button"), 58970 appearance: "primary", 58971 fullWidth: true, 58972 onClick: close 58973 }, 58974 "close" 58975 ) 58976 ], 58977 children: [ 58978 /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, { t: t2, i18nKey: "order_number_suggestion_modal_paragraph_1" }) }), 58979 /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, { t: t2, i18nKey: "order_number_suggestion_modal_paragraph_2" }) }) 58980 ] 58981 } 58982 ); 58983 }; 58984 const Instructions = dt$2.div` 58985 color: var(--text-primary); 58986 line-height: var(--font-line-height-400); 58987 letter-spacing: var(--font-letter-spacing-normal); 58988 58989 margin-bottom: var(--space-400); 58990`; 58991 const OrderLogin = () => { 58992 const { email, friendlyId, login } = useOrderAuth(); 58993 const { fetchOrderData } = useOrderData(); 58994 const navigate = useNavigate(); 58995 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderLogin" }); 58996 const { open } = useModalContext(); 58997 const initialValues = reactExports.useMemo( 58998 () => ({ email: email != null ? email : "", friendlyId: friendlyId != null ? friendlyId : "" }), 58999 [email, friendlyId] 59000 ); 59001 const validationSchema = reactExports.useMemo( 59002 () => u.object().shape({ 59003 friendlyId: u.string().trim().required(t2("friendly_id_required_error")).matches(/^#?[A-Za-z0-9]{8}$/, t2("friendly_id_invalid_error")), 59004 email: u.string().trim().required(t2("email_required_error")).email(t2("email_invalid_error")) 59005 }), 59006 [t2] 59007 ); 59008 const handleSubmit = (values) => __async(null, null, function* () { 59009 try { 59010 yield fetchOrderData(values); 59011 login({ 59012 email: values.email, 59013 friendlyId: values.friendlyId 59014 }); 59015 navigate(routes.contact.orderPlaced.variants); 59016 } catch (e2) { 59017 notify(t2("invalid_order_error"), { type: "error" }); 59018 } 59019 }); 59020 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59021 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { children: t2("title") }), 59022 /* @__PURE__ */ jsxRuntimeExports.jsxs(Layout.Tabs, { children: [ 59023 /* @__PURE__ */ jsxRuntimeExports.jsx(TabButton, { to: routes.contact.orderPlaced.self, active: true, children: t2("primary_tab_button_label") }), 59024 /* @__PURE__ */ jsxRuntimeExports.jsx(TabButton, { to: routes.contact.somethingElse, children: t2("secondary_tab_button_label") }) 59025 ] }), 59026 /* @__PURE__ */ jsxRuntimeExports.jsx( 59027 Formik, 59028 { 59029 initialValues, 59030 validationSchema, 59031 onSubmit: handleSubmit, 59032 children: ({ isSubmitting }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(TranslatableForm, { children: [ 59033 /* @__PURE__ */ jsxRuntimeExports.jsx(Instructions, { children: t2("instructions") }), 59034 /* @__PURE__ */ jsxRuntimeExports.jsxs(Fieldset, { children: [ 59035 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Fieldset.Item, { children: [
59036 /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { component: Input$1, name: "friendlyId", label: t2("friendly_id_label") }), 59037 /* @__PURE__ */ jsxRuntimeExports.jsx(Suggestion, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 59038 ButtonClean, 59039 { 59040 label: t2("friendly_id_suggestion"), 59041 onClick: () => open(OrderNumberSuggestionModal) 59042 } 59043 ) }) 59044 ] }) }), 59045 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { component: Input$1, name: "email", label: t2("email_label") }) }) }), 59046 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 59047 Button$1, 59048 { 59049 label: t2("submit_label"), 59050 loading: isSubmitting, 59051 type: "submit", 59052 appearance: "primary", 59053 fullWidth: true 59054 } 59055 ) }) }) 59056 ] }) 59057 ] }) 59058 } 59059 ) 59060 ] }); 59061 }; 59062 const OrderPlaced = () => { 59063 const { isAuthorized, email, friendlyId, logout } = useOrderAuth(); 59064 const { fetchOrderData, orderData } = useOrderData(); 59065 const navigate = useNavigate(); 59066 const location = useLocation(); 59067 const getInitialUrl = () => { 59068 if (!isAuthorized) { 59069 return routes.contact.orderPlaced.self; 59070 } 59071 return routes.contact.orderPlaced.variants; 59072 }; 59073 const initializeOrderData = (email2, friendlyId2) => __async(null, null, function* () { 59074 try { 59075 yield fetchOrderData({ email: email2, friendlyId: friendlyId2 }); 59076 } catch (e2) { 59077 logout(); 59078 navigate(routes.contact.orderPlaced.self); 59079 } 59080 }); 59081 reactExports.useEffect(() => { 59082 if (isAuthorized && email && friendlyId && !orderData) { 59083 initializeOrderData(email, friendlyId); 59084 } 59085 }, [isAuthorized, email, friendlyId, orderData]); 59086 reactExports.useEffect(() => { 59087 const initialUrl = getInitialUrl(); 59088 if (location.pathname !== initialUrl) { 59089 navigate(initialUrl); 59090 } 59091 }, []); 59092 return /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}); 59093 }; 59094 const Container$3 = dt$2.div` 59095 display: flex; 59096 flex-direction: column; 59097 gap: var(--space-300); 59098`; 59099 const ItemContainer = dt$2.div` 59100 display: flex; 59101 align-items: center; 59102 gap: var(--space-400); 59103 border: 1px solid var(--input-border, var(--border-secondary)); 59104 border-radius: var(--panel-radius-normal); 59105 padding: var(--space-200) var(--space-400); 59106 cursor: pointer; 59107 59108 &:hover { 59109 border-color: var(--text-primary); 59110 } 59111`; 59112 const ImageContainer = dt$2.div` 59113 flex-shrink: 0; 59114 height: 80px; 59115 aspect-ratio: 3/4; 59116 background-color: var(--bg-secondary); 59117`; 59118 const CheckboxWrapper = dt$2.div``; 59119 const Image = dt$2.img` 59120 width: 100%; 59121 height: auto; 59122 object-fit: contain; 59123 border-radius: var(--image-radius-normal); 59124`; 59125 const ImagePlaceholder = dt$2.div` 59126 width: 100%; 59127 height: 100%; 59128 display: flex; 59129 align-items: center; 59130 justify-content: center; 59131 border-radius: var(--image-radius-normal); 59132 color: var(--pale, var(--border-primary)); 59133`; 59134 const Content = dt$2.div` 59135 display: flex; 59136 flex-direction: column; 59137 min-width: 0; 59138`; 59139 const Name = dt$2.span` 59140 font-size: var(--font-size-400); 59141 line-height: var(--font-line-height-400, 24px); 59142 letter-spacing: var(--font-letter-spacing-normal); 59143`; 59144 const Description$1 = dt$2.span` 59145 font-size: var(--font-size-200); 59146 line-height: var(--font-line-height-200); 59147 color: var(--text-secondary); 59148`; 59149 const DownloadLinks = dt$2.div` 59150 display: flex; 59151 flex-wrap: wrap; 59152 margin-top: var(--space-100); 59153`; 59154 const DownloadButton = dt$2.button` 59155 display: flex; 59156 align-items: center; 59157 gap: var(--space-200); 59158 font-size: var(--font-size-200); 59159 line-height: var(--font-line-height-200); 59160 color: var(--text-secondary); 59161 cursor: pointer; 59162 59163 margin-right: var(--space-400); 59164 59165 &:last-child { 59166 margin-right: 0; 59167 } 59168 59169 &:hover { 59170 color: var(--text-primary); 59171 text-decoration: underline; 59172 } 59173`; 59174 const ActionLink = dt$2.a` 59175 display: flex; 59176 align-items: center; 59177 gap: var(--space-200); 59178 margin-top: var(--space-200); 59179 font-size: var(--font-size-200); 59180 line-height: var(--font-line-height-200); 59181 color: var(--text-secondary); 59182 cursor: pointer; 59183 59184 &:hover { 59185 color: var(--text-primary); 59186 text-decoration: underline; 59187 } 59188`; 59189 const BannerWrapper = dt$2.div` 59190 margin: var(--space-200) 0; 59191`; 59192 const ProductsListItem = ({ 59193 imageUrl, 59194 name, 59195 description, 59196 digitalItems, 59197 actionLink, 59198 isSelected, 59199 onSelectionChange, 59200 onFileDownload 59201 }) => { 59202 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants" }); 59203 const renderPhoto = (imageUrl2) => { 59204 if (!imageUrl2) { 59205 return /* @__PURE__ */ jsxRuntimeExports.jsx(ImagePlaceholder, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(D9, { height: 32 }) }); 59206 } 59207 return /* @__PURE__ */ jsxRuntimeExports.jsx(Image, { src: imageUrl2 }); 59208 }; 59209 const renderDigitalItems = () => { 59210 if (!(digitalItems == null ? void 0 : digitalItems.length)) return null; 59211 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59212 /* @__PURE__ */ jsxRuntimeExports.jsx(BannerWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Banner, { appearance: "inherit", size: "small", children: t2("digital_refund_banner") }) }), 59213 /* @__PURE__ */ jsxRuntimeExports.jsx(DownloadLinks, { children: digitalItems.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsxs( 59214 DownloadButton, 59215 { 59216 type: "button", 59217 disabled: item.isLoading, 59218 onClick: (e2) => { 59219 e2.stopPropagation(); 59220 onFileDownload == null ? void 0 : onFileDownload(item.uri); 59221 }, 59222 children: [ 59223 item.isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "small" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Me$3, { height: 12 }), 59224 item.name 59225 ] 59226 }, 59227 item.uri 59228 )) }) 59229 ] }); 59230 }; 59231 return /* @__PURE__ */ jsxRuntimeExports.jsxs(ItemContainer, { onClick: onSelectionChange, children: [
59232 /* @__PURE__ */ jsxRuntimeExports.jsx( 59233 CheckboxWrapper, 59234 { 59235 onClick: (e2) => { 59236 e2.stopPropagation(); 59237 }, 59238 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: isSelected, onValueChange: onSelectionChange }) 59239 } 59240 ), 59241 /* @__PURE__ */ jsxRuntimeExports.jsx(ImageContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AspectBox, { ratio: "3:4", children: renderPhoto(imageUrl) }) }), 59242 /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ 59243 /* @__PURE__ */ jsxRuntimeExports.jsx(Name, { children: name }), 59244 renderDigitalItems(), 59245 description && /* @__PURE__ */ jsxRuntimeExports.jsx(Description$1, { children: description }), 59246 actionLink && /* @__PURE__ */ jsxRuntimeExports.jsx( 59247 ActionLink, 59248 { 59249 href: actionLink.href, 59250 target: "_blank", 59251 rel: "noreferrer", 59252 onClick: (e2) => e2.stopPropagation(), 59253 children: actionLink.label 59254 } 59255 ) 59256 ] }) 59257 ] }); 59258 }; 59259 const ProductsList = ({ children }) => { 59260 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$3, { children }); 59261 }; 59262 ProductsList.Item = ProductsListItem; 59263 const Container$2 = dt$2.div` 59264 display: inline-flex; 59265 gap: var(--space-150); 59266`; 59267 const ShipmentCarrier = ({ carrier, trackingUrl }) => { 59268 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants.components.shipmentCarrier" }); 59269 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$2, { children: [ 59270 t2("shipped_via", { carrier }), 59271 " ", 59272 trackingUrl && /* @__PURE__ */ jsxRuntimeExports.jsx( 59273 ButtonClean, 59274 { 59275 href: trackingUrl, 59276 target: "_blank", 59277 label: t2("track_shipment"), 59278 appearance: "inherit" 59279 } 59280 ) 59281 ] }); 59282 }; 59283 const Container$1 = dt$2.div` 59284 display: flex; 59285 flex-direction: column; 59286 gap: var(--space-150); 59287 margin-bottom: var(--space-300); 59288`; 59289 const Subheader = dt$2.div` 59290 color: var(--text-secondary); 59291 59292 font-size: var(--font-size-200); 59293 line-height: var(--font-line-height-200); 59294 letter-spacing: var(--font-letter-spacing-looser); 59295`; 59296 const Title = dt$2.h3` 59297 color: var(--text-primary); 59298 59299 font-family: var(--font-family-heading); 59300 font-size: var(--font-size-400); 59301 font-weight: var(--font-weight-500); 59302 line-height: var(--font-line-height-300); 59303 letter-spacing: var(--font-letter-spacing-dense); 59304 59305 ${mediaQueries.laptop} { 59306 font-size: var(--font-size-500); 59307 font-weight: var(--font-weight-480); 59308 line-height: var(--font-line-height-400); 59309 } 59310`; 59311 const Subtitle = dt$2.div` 59312 color: var(--text-secondary); 59313 59314 font-size: var(--font-size-300); 59315 line-height: var(--font-line-height-300); 59316 letter-spacing: var(--font-letter-spacing-looser); 59317`; 59318 const ShipmentHeader = ({ title, subheader, subtitle }) => { 59319 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$1, { children: [ 59320 subheader && /* @__PURE__ */ jsxRuntimeExports.jsx(Subheader, { children: subheader }),
59321 /* @__PURE__ */ jsxRuntimeExports.jsx(Title, { children: title }), 59322 subtitle && /* @__PURE__ */ jsxRuntimeExports.jsx(Subtitle, { children: subtitle }) 59323 ] }); 59324 }; 59325 const DATE_FORMAT = "MMM D, YYYY"; 59326 const hasDateRange = (status) => { 59327 return "dateFrom" in status && "dateTo" in status; 59328 }; 59329 const hasSingleDate = (status) => { 59330 return "date" in status; 59331 }; 59332 const ShipmentTitle = ({ status }) => { 59333 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants.components.shipmentTitle" }); 59334 const renderDeliveryDate = () => { 59335 if (hasDateRange(status)) { 59336 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59337 /* @__PURE__ */ jsxRuntimeExports.jsx(qi, { date: status.dateFrom, format: DATE_FORMAT }), 59338 " -", 59339 " ", 59340 /* @__PURE__ */ jsxRuntimeExports.jsx(qi, { date: status.dateTo, format: DATE_FORMAT }) 59341 ] }); 59342 } 59343 if (hasSingleDate(status)) { 59344 return /* @__PURE__ */ jsxRuntimeExports.jsx(qi, { date: status.date, format: DATE_FORMAT }); 59345 } 59346 return null; 59347 }; 59348 switch (status.type) { 59349 case "DeliveredAt": 59350 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59351 t2("status_delivered_on"), 59352 renderDeliveryDate() 59353 ] }); 59354 case "DeliveryEstimationDateRange": 59355 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59356 t2("status_estimated_delivery"), 59357 renderDeliveryDate() 59358 ] }); 59359 case "ShippedOn": 59360 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59361 t2("status_shipped_on"), 59362 renderDeliveryDate() 59363 ] }); 59364 case "ArrivesOn": 59365 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59366 t2("status_arrives_on"), 59367 renderDeliveryDate() 59368 ] }); 59369 case "ArrivesBetween": 59370 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59371 t2("status_arrives"), 59372 renderDeliveryDate() 59373 ] }); 59374 case "Unknown": 59375 default: 59376 return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: t2("status_order_placed") }); 59377 } 59378 }; 59379 const getProgressPercentage = (doneItemsCount, itemsCount) => { 59380 const MIN_PERCENTAGE = 12; 59381 if (itemsCount === 0) { 59382 return MIN_PERCENTAGE; 59383 } 59384 if (itemsCount === 1) { 59385 return Math.max(doneItemsCount * 100, MIN_PERCENTAGE); 59386 } 59387 return Math.max((doneItemsCount - 1) / (itemsCount - 1) * 100, MIN_PERCENTAGE); 59388 }; 59389 const mapTimelineEventToProgressItem = (event) => { 59390 return { 59391 done: !!event.occurredAt, 59392 type: event.type, 59393 date: event.occurredAt 59394 }; 59395 }; 59396 const Container = dt$2.div` 59397 margin: var(--space-400) 0; 59398`; 59399 const ProgressContainer = dt$2.div` 59400 margin-bottom: var(--space-150); 59401`; 59402 const Progress = dt$2.div` 59403 height: 6px; 59404 background: color-mix(in srgb, var(--bg-brand) 20%, transparent); 59405 border-radius: var(--panel-radius-normal); 59406 overflow: hidden; 59407`; 59408 const ProgressBar = dt$2.div` 59409 height: 100%; 59410 width: ${({ $width }) => $width}; 59411 background: var(--bg-brand); 59412 border-radius: var(--panel-radius-normal); 59413`; 59414 const Events = dt$2.ul` 59415 display: flex; 59416`; 59417 const Event$1 = dt$2.li` 59418 flex: 1; 59419 59420 font-size: var(--font-size-200); 59421 line-height: var(--font-line-height-200); 59422 letter-spacing: var(--font-letter-spacing-looser); 59423 color: var(--text-secondary); 59424 text-align: center; 59425 59426 &:first-child { 59427 text-align: left; 59428 } 59429 59430 &:last-child { 59431 text-align: right; 59432 } 59433 59434 ${({ $active }) => $active && lt$2` 59435 font-weight: var(--font-weight-600); 59436 color: var(--text-primary); 59437 `} 59438`; 59439 const TimelineEvents = ({ timeline }) => { 59440 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants.components.timelineEvents" }); 59441 const getEventName = (type) => { 59442 return t2(type.toLowerCase(), { defaultValue: type }); 59443 }; 59444 const progressItems = timeline.map(mapTimelineEventToProgressItem); 59445 const doneItems = progressItems.filter(({ done }) => done); 59446 const percentage = getProgressPercentage(doneItems.length, progressItems.length); 59447 const renderProgressItem = (progressItem, index2) => { 59448 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Event$1, { $active: progressItem.done, children: [
59449 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: getEventName(progressItem.type) }), 59450 progressItem.date && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(qi, { date: progressItem.date, format: "MMM D" }) }) 59451 ] }, `${progressItem.type}-${index2}`); 59452 }; 59453 if (progressItems.length === 0) { 59454 return null; 59455 } 59456 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, { children: [ 59457 /* @__PURE__ */ jsxRuntimeExports.jsx(ProgressContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Progress, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProgressBar, { $width: `${percentage}%` }) }) }), 59458 /* @__PURE__ */ jsxRuntimeExports.jsx(Events, { children: progressItems.map(renderProgressItem) }) 59459 ] }); 59460 }; 59461 class DownloadsApiClientModel extends ApiBase { 59462 constructor() { 59463 super(...arguments); 59464 __publicField(this, "getOrderFile", (orderId, file) => { 59465 return this.get(`/media/downloads/order/${orderId}`, { file }); 59466 }); 59467 } 59468 } 59469 const DownloadsApiClient = new DownloadsApiClientModel(getBaseApiUrl()); 59470 const useOrderFileMutation = R$2(DownloadsApiClient.getOrderFile, { 59471 mutationKey: ["getOrderFile"] 59472 }); 59473 const useFileDownload = (orderId) => { 59474 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants" }); 59475 const { getOrderFileMutation } = useOrderFileMutation(); 59476 const [loadingFiles, setLoadingFiles] = reactExports.useState([]); 59477 const removeLoadingFile = (file) => { 59478 setLoadingFiles((prev2) => prev2.filter((f2) => f2 !== file)); 59479 }; 59480 const downloadFile = (file) => { 59481 setLoadingFiles((prev2) => [...prev2, file]); 59482 getOrderFileMutation.mutate([orderId, file], { 59483 onSuccess: (data) => { 59484 window.location.href = data.url; 59485 removeLoadingFile(file); 59486 }, 59487 onError: (error) => { 59488 var _a, _b; 59489 removeLoadingFile(file); 59490 if (isAxiosError(error) && ((_a = error.response) == null ? void 0 : _a.data.code) === "DOWNLOAD_LIMIT_EXCEEDED_ERROR") { 59491 notify(t2("download_limit_exceeded_error"), { toastId: file, type: "error" }); 59492 return; 59493 } 59494 if (isAxiosError(error) && ((_b = error.response) == null ? void 0 : _b.data.code) === "DOWNLOAD_EXPIRED_ERROR") { 59495 notify(t2("download_expired_error"), { toastId: file, type: "error" }); 59496 return; 59497 } 59498 notify(t2("download_pending_info"), { toastId: file, type: "info" }); 59499 } 59500 }); 59501 }; 59502 return { downloadFile, loadingFiles }; 59503 }; 59504 const OrderVariants = () => { 59505 var _a; 59506 const { orderData, isLoading, selectedVariants, handleVariantSelectionChange } = useOrderData(); 59507 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants" }); 59508 const navigate = useNavigate(); 59509 const { downloadFile, loadingFiles } = useFileDownload((_a = orderData == null ? void 0 : orderData.id) != null ? _a : ""); 59510 const isVariantSelected = (shipmentId, variantId) => { 59511 return selectedVariants.some( 59512 (item) => item.shipmentId === shipmentId && item.variantId === variantId 59513 ); 59514 }; 59515 const getDigitalItemsWithLoadingState = (digitalItems) => { 59516 return digitalItems == null ? void 0 : digitalItems.map((item) => __spreadProps(__spreadValues({}, item), { 59517 isLoading: loadingFiles.includes(item.uri) 59518 })); 59519 }; 59520 const getSubmitLabel = () => { 59521 if (!selectedVariants.length) { 59522 return t2("submit_label_empty"); 59523 } 59524 return t2("submit_label"); 59525 }; 59526 const renderShipments = () => { 59527 var _a2, _b; 59528 const shipments = (_b = (_a2 = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a2.shipments) != null ? _b : []; 59529 const hasMultipleShipments = shipments.length > 1; 59530 return shipments.map((shipment, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
59531 /* @__PURE__ */ jsxRuntimeExports.jsx( 59532 ShipmentHeader, 59533 { 59534 title: /* @__PURE__ */ jsxRuntimeExports.jsx(ShipmentTitle, { status: shipment.status }), 59535 subheader: hasMultipleShipments ? t2("shipment_subheader", { current: index2 + 1, total: shipments.length }) : void 0, 59536 subtitle: shipment.carrier ? /* @__PURE__ */ jsxRuntimeExports.jsx(ShipmentCarrier, { carrier: shipment.carrier, trackingUrl: shipment.trackingUrl }) : void 0 59537 } 59538 ), 59539 /* @__PURE__ */ jsxRuntimeExports.jsx(TimelineEvents, { timeline: shipment.timeline }), 59540 /* @__PURE__ */ jsxRuntimeExports.jsx(ProductsList, { children: shipment.variants.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx( 59541 ProductsList.Item, 59542 { 59543 imageUrl: variant.imageUrl, 59544 name: variant.name, 59545 description: variant.description, 59546 digitalItems: getDigitalItemsWithLoadingState(variant.digitalItems), 59547 isSelected: isVariantSelected(shipment.id, variant.id), 59548 onSelectionChange: () => handleVariantSelectionChange( 59549 shipment.id, 59550 variant.id, 59551 !isVariantSelected(shipment.id, variant.id) 59552 ), 59553 onFileDownload: downloadFile 59554 }, 59555 variant.id 59556 )) }) 59557 ] }, shipment.id)); 59558 }; 59559 const renderDigitalItems = () => { 59560 var _a2, _b, _c; 59561 const shipmentId = "digital_items"; 59562 if (!((_b = (_a2 = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a2.digitalVariants) == null ? void 0 : _b.length)) return null; 59563 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
59564 /* @__PURE__ */ jsxRuntimeExports.jsx(ShipmentHeader, { title: t2("digital_shipment_title") }), 59565 /* @__PURE__ */ jsxRuntimeExports.jsx(ProductsList, { children: (_c = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _c.digitalVariants.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx( 59566 ProductsList.Item, 59567 { 59568 imageUrl: variant.imageUrl, 59569 name: variant.name, 59570 description: variant.description, 59571 digitalItems: getDigitalItemsWithLoadingState(variant.digitalItems), 59572 isSelected: isVariantSelected(shipmentId, variant.id), 59573 onSelectionChange: () => handleVariantSelectionChange( 59574 shipmentId, 59575 variant.id, 59576 !isVariantSelected(shipmentId, variant.id) 59577 ), 59578 onFileDownload: downloadFile 59579 }, 59580 variant.id 59581 )) }) 59582 ] }); 59583 }; 59584 const renderGiftCards = () => { 59585 var _a2, _b; 59586 const shipmentId = "gift_cards"; 59587 const individualGiftCards = (_b = (_a2 = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a2.giftCardVariants) != null ? _b : []; 59588 if (!individualGiftCards.length) return null; 59589 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
59590 /* @__PURE__ */ jsxRuntimeExports.jsx(ShipmentHeader, { title: t2("gift_cards_shipment_title") }), 59591 /* @__PURE__ */ jsxRuntimeExports.jsx(ProductsList, { children: individualGiftCards.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx( 59592 ProductsList.Item, 59593 { 59594 imageUrl: variant.imageUrl, 59595 name: variant.name, 59596 description: variant.description, 59597 digitalItems: getDigitalItemsWithLoadingState(variant.digitalItems), 59598 actionLink: variant.giftCardIds[0] ? { href: `/gift_cards/${variant.giftCardIds[0]}`, label: t2("view_gift_card") } : void 0, 59599 isSelected: isVariantSelected(shipmentId, variant.id), 59600 onSelectionChange: () => handleVariantSelectionChange( 59601 shipmentId, 59602 variant.id, 59603 !isVariantSelected(shipmentId, variant.id) 59604 ), 59605 onFileDownload: downloadFile 59606 }, 59607 variant.id 59608 )) }) 59609 ] }); 59610 }; 59611 const renderData = () => { 59612 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59613 renderShipments(), 59614 renderDigitalItems(), 59615 renderGiftCards() 59616 ] }); 59617 }; 59618 const renderLoader = () => { 59619 return /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Loader, {}); 59620 }; 59621 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59622 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { backLocation: routes.contact.orderPlaced.self, children: t2("title") }), 59623 /* @__PURE__ */ jsxRuntimeExports.jsxs(Layout.Tabs, { children: [ 59624 /* @__PURE__ */ jsxRuntimeExports.jsx(TabButton, { to: routes.contact.orderPlaced.self, active: true, children: t2("primary_tab_button_label") }), 59625 /* @__PURE__ */ jsxRuntimeExports.jsx(TabButton, { to: routes.contact.orderPlaced.somethingElse, children: t2("secondary_tab_button_label") }) 59626 ] }), 59627 isLoading ? renderLoader() : renderData(), 59628 /* @__PURE__ */ jsxRuntimeExports.jsx( 59629 Button$1, 59630 { 59631 label: getSubmitLabel(), 59632 disabled: isLoading || selectedVariants.length === 0, 59633 type: "button", 59634 appearance: "primary", 59635 fullWidth: true, 59636 onClick: () => navigate(routes.contact.orderPlaced.details) 59637 } 59638 ) 59639 ] }); 59640 }; 59641 const SomethingElse = () => { 59642 const { t: t2 } = useTranslation("modules", { keyPrefix: "somethingElse" }); 59643 const location = useLocation(); 59644 const isOrderPlaced = location.pathname.includes(routes.contact.orderPlaced.self); 59645 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59646 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { backLocation: isOrderPlaced ? routes.contact.orderPlaced.self : void 0, children: isOrderPlaced ? t2("order_placed_title") : t2("title") }), 59647 /* @__PURE__ */ jsxRuntimeExports.jsxs(Layout.Tabs, { children: [ 59648 /* @__PURE__ */ jsxRuntimeExports.jsx( 59649 TabButton, 59650 { 59651 to: isOrderPlaced ? routes.contact.orderPlaced.variants : routes.contact.orderPlaced.self, 59652 children: isOrderPlaced ? t2("order_placed_primary_tab_button_label") : t2("primary_tab_button_label") 59653 } 59654 ), 59655 /* @__PURE__ */ jsxRuntimeExports.jsx( 59656 TabButton, 59657 { 59658 to: isOrderPlaced ? routes.contact.orderPlaced.somethingElse : routes.contact.somethingElse, 59659 active: true, 59660 children: t2("secondary_tab_button_label") 59661 } 59662 ) 59663 ] }), 59664 /* @__PURE__ */ jsxRuntimeExports.jsx(ReportForm, { topicPath: isOrderPlaced ? "ORDER_OTHER" : "OTHER" }) 59665 ] }); 59666 }; 59667 const Header = dt$2.div` 59668 display: flex; 59669 flex-direction: column; 59670 gap: var(--space-300); 59671`; 59672 const Description = dt$2.p` 59673 font-size: var(--font-size-400); 59674 line-height: var(--font-line-height-400); 59675 letter-spacing: var(--font-letter-spacing-normal); 59676`; 59677 const Success = () => { 59678 var _a; 59679 const { t: t2 } = useTranslation("modules", { keyPrefix: "success" }); 59680 const { shopContextQuery } = useShopContextQuery(); 59681 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59682 /* @__PURE__ */ jsxRuntimeExports.jsxs(Header, { children: [ 59683 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { children: t2("title") }), 59684 /* @__PURE__ */ jsxRuntimeExports.jsx(Description, { children: t2("subtitle") }) 59685 ] }), 59686 /* @__PURE__ */ jsxRuntimeExports.jsx( 59687 Button$1, 59688 { 59689 label: t2("back_label"), 59690 href: ((_a = shopContextQuery.data) == null ? void 0 : _a.externalStoreUrl) || "/", 59691 appearance: "primary" 59692 } 59693 ) 59694 ] }); 59695 }; 59696 const queryClient = E$1({ 59697 notify: (message) => notify(message, { type: "error" }) 59698 }); 59699 const Root = () => /* @__PURE__ */ jsxRuntimeExports.jsx(MediaQueryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ToastsProvider, { position: "top", autoClose: 1e4, children: /* @__PURE__ */ jsxRuntimeExports.jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Hr, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrowserRouter, { future: { v7_startTransition: true, v7_relativeSplatPath: true }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnalyticsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderAuthProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderDataProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Q$3, { userAgent: window.navigator.userAgent, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderSuspenseFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Routes, { children: [
59700 /* @__PURE__ */ jsxRuntimeExports.jsxs(Route, { path: routes.contact.self, element: /* @__PURE__ */ jsxRuntimeExports.jsx(Contact, {}), children: [ 59701 /* @__PURE__ */ jsxRuntimeExports.jsx( 59702 Route, 59703 { 59704 index: true, 59705 element: /* @__PURE__ */ jsxRuntimeExports.jsx(Navigate, { to: routes.contact.orderPlaced.self }) 59706 } 59707 ), 59708 /* @__PURE__ */ jsxRuntimeExports.jsxs(Route, { path: routes.contact.orderPlaced.self, element: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderPlaced, {}), children: [ 59709 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { index: true, element: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderLogin, {}) }), 59710 /* @__PURE__ */ jsxRuntimeExports.jsx( 59711 Route, 59712 { 59713 path: routes.contact.orderPlaced.variants, 59714 element: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderVariants, {}) 59715 } 59716 ), 59717 /* @__PURE__ */ jsxRuntimeExports.jsx( 59718 Route, 59719 { 59720 path: routes.contact.orderPlaced.details, 59721 element: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderDetails, {}) 59722 } 59723 ),
59724 /* @__PURE__ */ jsxRuntimeExports.jsx( 59725 Route, 59726 { 59727 path: routes.contact.orderPlaced.somethingElse, 59728 element: /* @__PURE__ */ jsxRuntimeExports.jsx(SomethingElse, {}) 59729 } 59730 ) 59731 ] }), 59732 /* @__PURE__ */ jsxRuntimeExports.jsx( 59733 Route, 59734 { 59735 path: routes.contact.somethingElse, 59736 element: /* @__PURE__ */ jsxRuntimeExports.jsx(SomethingElse, {}) 59737 } 59738 ), 59739 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: routes.contact.success, element: /* @__PURE__ */ jsxRuntimeExports.jsx(Success, {}) }), 59740 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: routes.contact.logout, element: /* @__PURE__ */ jsxRuntimeExports.jsx(Logout, {}) }) 59741 ] }), 59742 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "*", element: /* @__PURE__ */ jsxRuntimeExports.jsx(NotFoundErrorPage, {}) }) 59743 ] }) }) }) }) }) }) }) }) }) }) }) }); 59744 b$5({ 59745 appName: "contact", 59746 options: { 59747 tracesSampleRate: 0.1, 59748 integrations: [ 59749 reactRouterV6BrowserTracingIntegration({ 59750 useEffect: reactExports.useEffect, 59751 createRoutesFromChildren, 59752 matchRoutes, 59753 useLocation, 59754 useNavigationType 59755 }) 59756 ] 59757 } 59758 }); 59759 if (getCurrentEnvironment() !== "development") { 59760 const interceptor = errorLoggerInterceptor(s$4); 59761 OrderStatusClient.addErrorResponseInterceptor(interceptor); 59762 } 59763 const root = clientExports.createRoot(document.getElementById("root")); 59764 root.render(/* @__PURE__ */ jsxRuntimeExports.jsx(Root, {})); 59765 } 59766}); 59767export default require_index_001();
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.