1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3
vendor: 177,753 bytes, lines 4-5809
4/***/ "./node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js": 5/*!***************************************************************************!*\ 6 !*** ./node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js ***! 7 \***************************************************************************/ 8/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9 10"use strict"; 11__webpack_require__.r(__webpack_exports__); 12/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13/* harmony export */ BASE_TRANSITION: () => (/* binding */ BASE_TRANSITION), 14/* harmony export */ BindingTypes: () => (/* binding */ BindingTypes), 15/* harmony export */ CAMELIZE: () => (/* binding */ CAMELIZE), 16/* harmony export */ CAPITALIZE: () => (/* binding */ CAPITALIZE), 17/* harmony export */ CREATE_BLOCK: () => (/* binding */ CREATE_BLOCK), 18/* harmony export */ CREATE_COMMENT: () => (/* binding */ CREATE_COMMENT), 19/* harmony export */ CREATE_ELEMENT_BLOCK: () => (/* binding */ CREATE_ELEMENT_BLOCK), 20/* harmony export */ CREATE_ELEMENT_VNODE: () => (/* binding */ CREATE_ELEMENT_VNODE), 21/* harmony export */ CREATE_SLOTS: () => (/* binding */ CREATE_SLOTS), 22/* harmony export */ CREATE_STATIC: () => (/* binding */ CREATE_STATIC), 23/* harmony export */ CREATE_TEXT: () => (/* binding */ CREATE_TEXT), 24/* harmony export */ CREATE_VNODE: () => (/* binding */ CREATE_VNODE), 25/* harmony export */ CompilerDeprecationTypes: () => (/* binding */ CompilerDeprecationTypes), 26/* harmony export */ ConstantTypes: () => (/* binding */ ConstantTypes), 27/* harmony export */ ElementTypes: () => (/* binding */ ElementTypes), 28/* harmony export */ ErrorCodes: () => (/* binding */ ErrorCodes), 29/* harmony export */ FRAGMENT: () => (/* binding */ FRAGMENT), 30/* harmony export */ GUARD_REACTIVE_PROPS: () => (/* binding */ GUARD_REACTIVE_PROPS), 31/* harmony export */ IS_MEMO_SAME: () => (/* binding */ IS_MEMO_SAME), 32/* harmony export */ IS_REF: () => (/* binding */ IS_REF), 33/* harmony export */ KEEP_ALIVE: () => (/* binding */ KEEP_ALIVE), 34/* harmony export */ MERGE_PROPS: () => (/* binding */ MERGE_PROPS), 35/* harmony export */ NORMALIZE_CLASS: () => (/* binding */ NORMALIZE_CLASS), 36/* harmony export */ NORMALIZE_PROPS: () => (/* binding */ NORMALIZE_PROPS), 37/* harmony export */ NORMALIZE_STYLE: () => (/* binding */ NORMALIZE_STYLE), 38/* harmony export */ Namespaces: () => (/* binding */ Namespaces), 39/* harmony export */ NodeTypes: () => (/* binding */ NodeTypes), 40/* harmony export */ OPEN_BLOCK: () => (/* binding */ OPEN_BLOCK), 41/* harmony export */ POP_SCOPE_ID: () => (/* binding */ POP_SCOPE_ID), 42/* harmony export */ PUSH_SCOPE_ID: () => (/* binding */ PUSH_SCOPE_ID), 43/* harmony export */ RENDER_LIST: () => (/* binding */ RENDER_LIST), 44/* harmony export */ RENDER_SLOT: () => (/* binding */ RENDER_SLOT), 45/* harmony export */ RESOLVE_COMPONENT: () => (/* binding */ RESOLVE_COMPONENT), 46/* harmony export */ RESOLVE_DIRECTIVE: () => (/* binding */ RESOLVE_DIRECTIVE), 47/* harmony export */ RESOLVE_DYNAMIC_COMPONENT: () => (/* binding */ RESOLVE_DYNAMIC_COMPONENT), 48/* harmony export */ RESOLVE_FILTER: () => (/* binding */ RESOLVE_FILTER), 49/* harmony export */ SET_BLOCK_TRACKING: () => (/* binding */ SET_BLOCK_TRACKING), 50/* harmony export */ SUSPENSE: () => (/* binding */ SUSPENSE), 51/* harmony export */ TELEPORT: () => (/* binding */ TELEPORT), 52/* harmony export */ TO_DISPLAY_STRING: () => (/* binding */ TO_DISPLAY_STRING), 53/* harmony export */ TO_HANDLERS: () => (/* binding */ TO_HANDLERS), 54/* harmony export */ TO_HANDLER_KEY: () => (/* binding */ TO_HANDLER_KEY), 55/* harmony export */ TS_NODE_TYPES: () => (/* binding */ TS_NODE_TYPES), 56/* harmony export */ UNREF: () => (/* binding */ UNREF), 57/* harmony export */ WITH_CTX: () => (/* binding */ WITH_CTX), 58/* harmony export */ WITH_DIRECTIVES: () => (/* binding */ WITH_DIRECTIVES), 59/* harmony export */ WITH_MEMO: () => (/* binding */ WITH_MEMO), 60/* harmony export */ advancePositionWithClone: () => (/* binding */ advancePositionWithClone), 61/* harmony export */ advancePositionWithMutation: () => (/* binding */ advancePositionWithMutation), 62/* harmony export */ assert: () => (/* binding */ assert), 63/* harmony export */ baseCompile: () => (/* binding */ baseCompile), 64/* harmony export */ baseParse: () => (/* binding */ baseParse), 65/* harmony export */ buildDirectiveArgs: () => (/* binding */ buildDirectiveArgs), 66/* harmony export */ buildProps: () => (/* binding */ buildProps), 67/* harmony export */ buildSlots: () => (/* binding */ buildSlots), 68/* harmony export */ checkCompatEnabled: () => (/* binding */ checkCompatEnabled), 69/* harmony export */ convertToBlock: () => (/* binding */ convertToBlock), 70/* harmony export */ createArrayExpression: () => (/* binding */ createArrayExpression), 71/* harmony export */ createAssignmentExpression: () => (/* binding */ createAssignmentExpression), 72/* harmony export */ createBlockStatement: () => (/* binding */ createBlockStatement), 73/* harmony export */ createCacheExpression: () => (/* binding */ createCacheExpression), 74/* harmony export */ createCallExpression: () => (/* binding */ createCallExpression), 75/* harmony export */ createCompilerError: () => (/* binding */ createCompilerError), 76/* harmony export */ createCompoundExpression: () => (/* binding */ createCompoundExpression), 77/* harmony export */ createConditionalExpression: () => (/* binding */ createConditionalExpression), 78/* harmony export */ createForLoopParams: () => (/* binding */ createForLoopParams), 79/* harmony export */ createFunctionExpression: () => (/* binding */ createFunctionExpression), 80/* harmony export */ createIfStatement: () => (/* binding */ createIfStatement), 81/* harmony export */ createInterpolation: () => (/* binding */ createInterpolation), 82/* harmony export */ createObjectExpression: () => (/* binding */ createObjectExpression), 83/* harmony export */ createObjectProperty: () => (/* binding */ createObjectProperty), 84/* harmony export */ createReturnStatement: () => (/* binding */ createReturnStatement), 85/* harmony export */ createRoot: () => (/* binding */ createRoot), 86/* harmony export */ createSequenceExpression: () => (/* binding */ createSequenceExpression), 87/* harmony export */ createSimpleExpression: () => (/* binding */ createSimpleExpression), 88/* harmony export */ createStructuralDirectiveTransform: () => (/* binding */ createStructuralDirectiveTransform), 89/* harmony export */ createTemplateLiteral: () => (/* binding */ createTemplateLiteral), 90/* harmony export */ createTransformContext: () => (/* binding */ createTransformContext), 91/* harmony export */ createVNodeCall: () => (/* binding */ createVNodeCall), 92/* harmony export */ errorMessages: () => (/* binding */ errorMessages), 93/* harmony export */ extractIdentifiers: () => (/* binding */ extractIdentifiers), 94/* harmony export */ findDir: () => (/* binding */ findDir), 95/* harmony export */ findProp: () => (/* binding */ findProp), 96/* harmony export */ forAliasRE: () => (/* binding */ forAliasRE), 97/* harmony export */ generate: () => (/* binding */ generate), 98/* harmony export */ generateCodeFrame: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_0__.generateCodeFrame), 99/* harmony export */ getBaseTransformPreset: () => (/* binding */ getBaseTransformPreset), 100/* harmony export */ getConstantType: () => (/* binding */ getConstantType), 101/* harmony export */ getMemoedVNodeCall: () => (/* binding */ getMemoedVNodeCall), 102/* harmony export */ getVNodeBlockHelper: () => (/* binding */ getVNodeBlockHelper), 103/* harmony export */ getVNodeHelper: () => (/* binding */ getVNodeHelper), 104/* harmony export */ hasDynamicKeyVBind: () => (/* binding */ hasDynamicKeyVBind), 105/* harmony export */ hasScopeRef: () => (/* binding */ hasScopeRef), 106/* harmony export */ helperNameMap: () => (/* binding */ helperNameMap), 107/* harmony export */ injectProp: () => (/* binding */ injectProp), 108/* harmony export */ isCoreComponent: () => (/* binding */ isCoreComponent), 109/* harmony export */ isFunctionType: () => (/* binding */ isFunctionType), 110/* harmony export */ isInDestructureAssignment: () => (/* binding */ isInDestructureAssignment), 111/* harmony export */ isInNewExpression: () => (/* binding */ isInNewExpression), 112/* harmony export */ isMemberExpression: () => (/* binding */ isMemberExpression), 113/* harmony export */ isMemberExpressionBrowser: () => (/* binding */ isMemberExpressionBrowser), 114/* harmony export */ isMemberExpressionNode: () => (/* binding */ isMemberExpressionNode), 115/* harmony export */ isReferencedIdentifier: () => (/* binding */ isReferencedIdentifier), 116/* harmony export */ isSimpleIdentifier: () => (/* binding */ isSimpleIdentifier), 117/* harmony export */ isSlotOutlet: () => (/* binding */ isSlotOutlet), 118/* harmony export */ isStaticArgOf: () => (/* binding */ isStaticArgOf), 119/* harmony export */ isStaticExp: () => (/* binding */ isStaticExp), 120/* harmony export */ isStaticProperty: () => (/* binding */ isStaticProperty), 121/* harmony export */ isStaticPropertyKey: () => (/* binding */ isStaticPropertyKey), 122/* harmony export */ isTemplateNode: () => (/* binding */ isTemplateNode), 123/* harmony export */ isText: () => (/* binding */ isText$1), 124/* harmony export */ isVSlot: () => (/* binding */ isVSlot), 125/* harmony export */ locStub: () => (/* binding */ locStub), 126/* harmony export */ noopDirectiveTransform: () => (/* binding */ noopDirectiveTransform), 127/* harmony export */ processExpression: () => (/* binding */ processExpression), 128/* harmony export */ processFor: () => (/* binding */ processFor), 129/* harmony export */ processIf: () => (/* binding */ processIf), 130/* harmony export */ processSlotOutlet: () => (/* binding */ processSlotOutlet), 131/* harmony export */ registerRuntimeHelpers: () => (/* binding */ registerRuntimeHelpers), 132/* harmony export */ resolveComponentType: () => (/* binding */ resolveComponentType), 133/* harmony export */ stringifyExpression: () => (/* binding */ stringifyExpression), 134/* harmony export */ toValidAssetId: () => (/* binding */ toValidAssetId), 135/* harmony export */ trackSlotScopes: () => (/* binding */ trackSlotScopes), 136/* harmony export */ trackVForSlotScopes: () => (/* binding */ trackVForSlotScopes), 137/* harmony export */ transform: () => (/* binding */ transform), 138/* harmony export */ transformBind: () => (/* binding */ transformBind), 139/* harmony export */ transformElement: () => (/* binding */ transformElement), 140/* harmony export */ transformExpression: () => (/* binding */ transformExpression), 141/* harmony export */ transformModel: () => (/* binding */ transformModel), 142/* harmony export */ transformOn: () => (/* binding */ transformOn), 143/* harmony export */ traverseNode: () => (/* binding */ traverseNode), 144/* harmony export */ unwrapTSNode: () => (/* binding */ unwrapTSNode), 145/* harmony export */ walkBlockDeclarations: () => (/* binding */ walkBlockDeclarations), 146/* harmony export */ walkFunctionParams: () => (/* binding */ walkFunctionParams), 147/* harmony export */ walkIdentifiers: () => (/* binding */ walkIdentifiers), 148/* harmony export */ warnDeprecation: () => (/* binding */ warnDeprecation) 149/* harmony export */ }); 150/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); 151 152 153 154const FRAGMENT = Symbol( true ? `Fragment` : 0); 155const TELEPORT = Symbol( true ? `Teleport` : 0); 156const SUSPENSE = Symbol( true ? `Suspense` : 0); 157const KEEP_ALIVE = Symbol( true ? `KeepAlive` : 0); 158const BASE_TRANSITION = Symbol( true ? `BaseTransition` : 0); 159const OPEN_BLOCK = Symbol( true ? `openBlock` : 0); 160const CREATE_BLOCK = Symbol( true ? `createBlock` : 0); 161const CREATE_ELEMENT_BLOCK = Symbol( true ? `createElementBlock` : 0); 162const CREATE_VNODE = Symbol( true ? `createVNode` : 0); 163const CREATE_ELEMENT_VNODE = Symbol( true ? `createElementVNode` : 0); 164const CREATE_COMMENT = Symbol( true ? `createCommentVNode` : 0); 165const CREATE_TEXT = Symbol( true ? `createTextVNode` : 0); 166const CREATE_STATIC = Symbol( true ? `createStaticVNode` : 0); 167const RESOLVE_COMPONENT = Symbol( true ? `resolveComponent` : 0); 168const RESOLVE_DYNAMIC_COMPONENT = Symbol( 169 true ? `resolveDynamicComponent` : 0 170); 171const RESOLVE_DIRECTIVE = Symbol( true ? `resolveDirective` : 0); 172const RESOLVE_FILTER = Symbol( true ? `resolveFilter` : 0); 173const WITH_DIRECTIVES = Symbol( true ? `withDirectives` : 0); 174const RENDER_LIST = Symbol( true ? `renderList` : 0); 175const RENDER_SLOT = Symbol( true ? `renderSlot` : 0); 176const CREATE_SLOTS = Symbol( true ? `createSlots` : 0); 177const TO_DISPLAY_STRING = Symbol( true ? `toDisplayString` : 0); 178const MERGE_PROPS = Symbol( true ? `mergeProps` : 0); 179const NORMALIZE_CLASS = Symbol( true ? `normalizeClass` : 0); 180const NORMALIZE_STYLE = Symbol( true ? `normalizeStyle` : 0); 181const NORMALIZE_PROPS = Symbol( true ? `normalizeProps` : 0); 182const GUARD_REACTIVE_PROPS = Symbol( true ? `guardReactiveProps` : 0); 183const TO_HANDLERS = Symbol( true ? `toHandlers` : 0); 184const CAMELIZE = Symbol( true ? `camelize` : 0); 185const CAPITALIZE = Symbol( true ? `capitalize` : 0); 186const TO_HANDLER_KEY = Symbol( true ? `toHandlerKey` : 0); 187const SET_BLOCK_TRACKING = Symbol( true ? `setBlockTracking` : 0); 188const PUSH_SCOPE_ID = Symbol( true ? `pushScopeId` : 0); 189const POP_SCOPE_ID = Symbol( true ? `popScopeId` : 0); 190const WITH_CTX = Symbol( true ? `withCtx` : 0); 191const UNREF = Symbol( true ? `unref` : 0); 192const IS_REF = Symbol( true ? `isRef` : 0); 193const WITH_MEMO = Symbol( true ? `withMemo` : 0); 194const IS_MEMO_SAME = Symbol( true ? `isMemoSame` : 0); 195const helperNameMap = { 196 [FRAGMENT]: `Fragment`, 197 [TELEPORT]: `Teleport`, 198 [SUSPENSE]: `Suspense`, 199 [KEEP_ALIVE]: `KeepAlive`, 200 [BASE_TRANSITION]: `BaseTransition`, 201 [OPEN_BLOCK]: `openBlock`, 202 [CREATE_BLOCK]: `createBlock`, 203 [CREATE_ELEMENT_BLOCK]: `createElementBlock`, 204 [CREATE_VNODE]: `createVNode`, 205 [CREATE_ELEMENT_VNODE]: `createElementVNode`, 206 [CREATE_COMMENT]: `createCommentVNode`, 207 [CREATE_TEXT]: `createTextVNode`, 208 [CREATE_STATIC]: `createStaticVNode`, 209 [RESOLVE_COMPONENT]: `resolveComponent`, 210 [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`, 211 [RESOLVE_DIRECTIVE]: `resolveDirective`, 212 [RESOLVE_FILTER]: `resolveFilter`, 213 [WITH_DIRECTIVES]: `withDirectives`, 214 [RENDER_LIST]: `renderList`, 215 [RENDER_SLOT]: `renderSlot`, 216 [CREATE_SLOTS]: `createSlots`, 217 [TO_DISPLAY_STRING]: `toDisplayString`, 218 [MERGE_PROPS]: `mergeProps`, 219 [NORMALIZE_CLASS]: `normalizeClass`, 220 [NORMALIZE_STYLE]: `normalizeStyle`, 221 [NORMALIZE_PROPS]: `normalizeProps`, 222 [GUARD_REACTIVE_PROPS]: `guardReactiveProps`, 223 [TO_HANDLERS]: `toHandlers`, 224 [CAMELIZE]: `camelize`, 225 [CAPITALIZE]: `capitalize`, 226 [TO_HANDLER_KEY]: `toHandlerKey`, 227 [SET_BLOCK_TRACKING]: `setBlockTracking`, 228 [PUSH_SCOPE_ID]: `pushScopeId`, 229 [POP_SCOPE_ID]: `popScopeId`, 230 [WITH_CTX]: `withCtx`, 231 [UNREF]: `unref`, 232 [IS_REF]: `isRef`, 233 [WITH_MEMO]: `withMemo`, 234 [IS_MEMO_SAME]: `isMemoSame` 235}; 236function registerRuntimeHelpers(helpers) { 237 Object.getOwnPropertySymbols(helpers).forEach((s) => { 238 helperNameMap[s] = helpers[s]; 239 }); 240} 241 242const Namespaces = { 243 "HTML": 0, 244 "0": "HTML", 245 "SVG": 1, 246 "1": "SVG", 247 "MATH_ML": 2, 248 "2": "MATH_ML" 249}; 250const NodeTypes = { 251 "ROOT": 0, 252 "0": "ROOT", 253 "ELEMENT": 1, 254 "1": "ELEMENT", 255 "TEXT": 2, 256 "2": "TEXT", 257 "COMMENT": 3, 258 "3": "COMMENT", 259 "SIMPLE_EXPRESSION": 4, 260 "4": "SIMPLE_EXPRESSION", 261 "INTERPOLATION": 5, 262 "5": "INTERPOLATION", 263 "ATTRIBUTE": 6, 264 "6": "ATTRIBUTE", 265 "DIRECTIVE": 7, 266 "7": "DIRECTIVE", 267 "COMPOUND_EXPRESSION": 8, 268 "8": "COMPOUND_EXPRESSION", 269 "IF": 9, 270 "9": "IF", 271 "IF_BRANCH": 10, 272 "10": "IF_BRANCH", 273 "FOR": 11, 274 "11": "FOR", 275 "TEXT_CALL": 12, 276 "12": "TEXT_CALL", 277 "VNODE_CALL": 13, 278 "13": "VNODE_CALL", 279 "JS_CALL_EXPRESSION": 14, 280 "14": "JS_CALL_EXPRESSION", 281 "JS_OBJECT_EXPRESSION": 15, 282 "15": "JS_OBJECT_EXPRESSION", 283 "JS_PROPERTY": 16, 284 "16": "JS_PROPERTY", 285 "JS_ARRAY_EXPRESSION": 17, 286 "17": "JS_ARRAY_EXPRESSION", 287 "JS_FUNCTION_EXPRESSION": 18, 288 "18": "JS_FUNCTION_EXPRESSION", 289 "JS_CONDITIONAL_EXPRESSION": 19, 290 "19": "JS_CONDITIONAL_EXPRESSION", 291 "JS_CACHE_EXPRESSION": 20, 292 "20": "JS_CACHE_EXPRESSION", 293 "JS_BLOCK_STATEMENT": 21, 294 "21": "JS_BLOCK_STATEMENT", 295 "JS_TEMPLATE_LITERAL": 22, 296 "22": "JS_TEMPLATE_LITERAL", 297 "JS_IF_STATEMENT": 23, 298 "23": "JS_IF_STATEMENT", 299 "JS_ASSIGNMENT_EXPRESSION": 24, 300 "24": "JS_ASSIGNMENT_EXPRESSION", 301 "JS_SEQUENCE_EXPRESSION": 25, 302 "25": "JS_SEQUENCE_EXPRESSION", 303 "JS_RETURN_STATEMENT": 26, 304 "26": "JS_RETURN_STATEMENT" 305}; 306const ElementTypes = { 307 "ELEMENT": 0, 308 "0": "ELEMENT", 309 "COMPONENT": 1, 310 "1": "COMPONENT", 311 "SLOT": 2, 312 "2": "SLOT", 313 "TEMPLATE": 3, 314 "3": "TEMPLATE" 315}; 316const ConstantTypes = { 317 "NOT_CONSTANT": 0, 318 "0": "NOT_CONSTANT", 319 "CAN_SKIP_PATCH": 1, 320 "1": "CAN_SKIP_PATCH", 321 "CAN_HOIST": 2, 322 "2": "CAN_HOIST", 323 "CAN_STRINGIFY": 3, 324 "3": "CAN_STRINGIFY" 325}; 326const locStub = { 327 start: { line: 1, column: 1, offset: 0 }, 328 end: { line: 1, column: 1, offset: 0 }, 329 source: "" 330}; 331function createRoot(children, source = "") { 332 return { 333 type: 0, 334 source, 335 children, 336 helpers: /* @__PURE__ */ new Set(), 337 components: [], 338 directives: [], 339 hoists: [], 340 imports: [], 341 cached: 0, 342 temps: 0, 343 codegenNode: void 0, 344 loc: locStub 345 }; 346} 347function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) { 348 if (context) { 349 if (isBlock) { 350 context.helper(OPEN_BLOCK); 351 context.helper(getVNodeBlockHelper(context.inSSR, isComponent)); 352 } else { 353 context.helper(getVNodeHelper(context.inSSR, isComponent)); 354 } 355 if (directives) { 356 context.helper(WITH_DIRECTIVES); 357 } 358 } 359 return { 360 type: 13, 361 tag, 362 props, 363 children, 364 patchFlag, 365 dynamicProps, 366 directives, 367 isBlock, 368 disableTracking, 369 isComponent, 370 loc 371 }; 372} 373function createArrayExpression(elements, loc = locStub) { 374 return { 375 type: 17, 376 loc, 377 elements 378 }; 379} 380function createObjectExpression(properties, loc = locStub) { 381 return { 382 type: 15, 383 loc, 384 properties 385 }; 386} 387function createObjectProperty(key, value) { 388 return { 389 type: 16, 390 loc: locStub, 391 key: (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(key) ? createSimpleExpression(key, true) : key, 392 value 393 }; 394} 395function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) { 396 return { 397 type: 4, 398 loc, 399 content, 400 isStatic, 401 constType: isStatic ? 3 : constType 402 }; 403} 404function createInterpolation(content, loc) { 405 return { 406 type: 5, 407 loc, 408 content: (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(content) ? createSimpleExpression(content, false, loc) : content 409 }; 410} 411function createCompoundExpression(children, loc = locStub) { 412 return { 413 type: 8, 414 loc, 415 children 416 }; 417} 418function createCallExpression(callee, args = [], loc = locStub) { 419 return { 420 type: 14, 421 loc, 422 callee, 423 arguments: args 424 }; 425} 426function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) { 427 return { 428 type: 18, 429 params, 430 returns, 431 newline, 432 isSlot, 433 loc 434 }; 435} 436function createConditionalExpression(test, consequent, alternate, newline = true) { 437 return { 438 type: 19, 439 test, 440 consequent, 441 alternate, 442 newline, 443 loc: locStub 444 }; 445} 446function createCacheExpression(index, value, isVNode = false) { 447 return { 448 type: 20, 449 index, 450 value, 451 isVNode, 452 loc: locStub 453 }; 454} 455function createBlockStatement(body) { 456 return { 457 type: 21, 458 body, 459 loc: locStub 460 }; 461} 462function createTemplateLiteral(elements) { 463 return { 464 type: 22, 465 elements, 466 loc: locStub 467 }; 468} 469function createIfStatement(test, consequent, alternate) { 470 return { 471 type: 23, 472 test, 473 consequent, 474 alternate, 475 loc: locStub 476 }; 477} 478function createAssignmentExpression(left, right) { 479 return { 480 type: 24, 481 left, 482 right, 483 loc: locStub 484 }; 485} 486function createSequenceExpression(expressions) { 487 return { 488 type: 25, 489 expressions, 490 loc: locStub 491 }; 492} 493function createReturnStatement(returns) { 494 return { 495 type: 26, 496 returns, 497 loc: locStub 498 }; 499} 500function getVNodeHelper(ssr, isComponent) { 501 return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE; 502} 503function getVNodeBlockHelper(ssr, isComponent) { 504 return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK; 505} 506function convertToBlock(node, { helper, removeHelper, inSSR }) { 507 if (!node.isBlock) { 508 node.isBlock = true; 509 removeHelper(getVNodeHelper(inSSR, node.isComponent)); 510 helper(OPEN_BLOCK); 511 helper(getVNodeBlockHelper(inSSR, node.isComponent)); 512 } 513} 514 515const defaultDelimitersOpen = new Uint8Array([123, 123]); 516const defaultDelimitersClose = new Uint8Array([125, 125]); 517function isTagStartChar(c) { 518 return c >= 97 && c <= 122 || c >= 65 && c <= 90; 519} 520function isWhitespace(c) { 521 return c === 32 || c === 10 || c === 9 || c === 12 || c === 13; 522} 523function isEndOfTagSection(c) { 524 return c === 47 || c === 62 || isWhitespace(c); 525} 526function toCharCodes(str) { 527 const ret = new Uint8Array(str.length); 528 for (let i = 0; i < str.length; i++) { 529 ret[i] = str.charCodeAt(i); 530 } 531 return ret; 532} 533const Sequences = { 534 Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), 535 // CDATA[ 536 CdataEnd: new Uint8Array([93, 93, 62]), 537 // ]]> 538 CommentEnd: new Uint8Array([45, 45, 62]), 539 // `-->` 540 ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), 541 // `<\/script` 542 StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), 543 // `</style` 544 TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]), 545 // `</title` 546 TextareaEnd: new Uint8Array([ 547 60, 548 47, 549 116, 550 101, 551 120, 552 116, 553 97, 554 114, 555 101, 556 97 557 ]) 558 // `</textarea 559}; 560class Tokenizer { 561 constructor(stack, cbs) { 562 this.stack = stack; 563 this.cbs = cbs; 564 /** The current state the tokenizer is in. */ 565 this.state = 1; 566 /** The read buffer. */ 567 this.buffer = ""; 568 /** The beginning of the section that is currently being read. */ 569 this.sectionStart = 0; 570 /** The index within the buffer that we are currently looking at. */ 571 this.index = 0; 572 /** The start of the last entity. */ 573 this.entityStart = 0; 574 /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */ 575 this.baseState = 1; 576 /** For special parsing behavior inside of script and style tags. */ 577 this.inRCDATA = false; 578 /** For disabling RCDATA tags handling */ 579 this.inXML = false; 580 /** For disabling interpolation parsing in v-pre */ 581 this.inVPre = false; 582 /** Record newline positions for fast line / column calculation */ 583 this.newlines = []; 584 this.mode = 0; 585 this.delimiterOpen = defaultDelimitersOpen; 586 this.delimiterClose = defaultDelimitersClose; 587 this.delimiterIndex = -1; 588 this.currentSequence = void 0; 589 this.sequenceIndex = 0; 590 } 591 get inSFCRoot() { 592 return this.mode === 2 && this.stack.length === 0; 593 } 594 reset() { 595 this.state = 1; 596 this.mode = 0; 597 this.buffer = ""; 598 this.sectionStart = 0; 599 this.index = 0; 600 this.baseState = 1; 601 this.inRCDATA = false; 602 this.currentSequence = void 0; 603 this.newlines.length = 0; 604 this.delimiterOpen = defaultDelimitersOpen; 605 this.delimiterClose = defaultDelimitersClose; 606 } 607 /** 608 * Generate Position object with line / column information using recorded 609 * newline positions. We know the index is always going to be an already 610 * processed index, so all the newlines up to this index should have been 611 * recorded. 612 */ 613 getPos(index) { 614 let line = 1; 615 let column = index + 1; 616 for (let i = this.newlines.length - 1; i >= 0; i--) { 617 const newlineIndex = this.newlines[i]; 618 if (index > newlineIndex) { 619 line = i + 2; 620 column = index - newlineIndex; 621 break; 622 } 623 } 624 return { 625 column, 626 line, 627 offset: index 628 }; 629 } 630 peek() { 631 return this.buffer.charCodeAt(this.index + 1); 632 } 633 stateText(c) { 634 if (c === 60) { 635 if (this.index > this.sectionStart) { 636 this.cbs.ontext(this.sectionStart, this.index); 637 } 638 this.state = 5; 639 this.sectionStart = this.index; 640 } else if (!this.inVPre && c === this.delimiterOpen[0]) { 641 this.state = 2; 642 this.delimiterIndex = 0; 643 this.stateInterpolationOpen(c); 644 } 645 } 646 stateInterpolationOpen(c) { 647 if (c === this.delimiterOpen[this.delimiterIndex]) { 648 if (this.delimiterIndex === this.delimiterOpen.length - 1) { 649 const start = this.index + 1 - this.delimiterOpen.length; 650 if (start > this.sectionStart) { 651 this.cbs.ontext(this.sectionStart, start); 652 } 653 this.state = 3; 654 this.sectionStart = start; 655 } else { 656 this.delimiterIndex++; 657 } 658 } else if (this.inRCDATA) { 659 this.state = 32; 660 this.stateInRCDATA(c); 661 } else { 662 this.state = 1; 663 this.stateText(c); 664 } 665 } 666 stateInterpolation(c) { 667 if (c === this.delimiterClose[0]) { 668 this.state = 4; 669 this.delimiterIndex = 0; 670 this.stateInterpolationClose(c); 671 } 672 } 673 stateInterpolationClose(c) { 674 if (c === this.delimiterClose[this.delimiterIndex]) { 675 if (this.delimiterIndex === this.delimiterClose.length - 1) { 676 this.cbs.oninterpolation(this.sectionStart, this.index + 1); 677 if (this.inRCDATA) { 678 this.state = 32; 679 } else { 680 this.state = 1; 681 } 682 this.sectionStart = this.index + 1; 683 } else { 684 this.delimiterIndex++; 685 } 686 } else { 687 this.state = 3; 688 this.stateInterpolation(c); 689 } 690 } 691 stateSpecialStartSequence(c) { 692 const isEnd = this.sequenceIndex === this.currentSequence.length; 693 const isMatch = isEnd ? ( 694 // If we are at the end of the sequence, make sure the tag name has ended 695 isEndOfTagSection(c) 696 ) : ( 697 // Otherwise, do a case-insensitive comparison 698 (c | 32) === this.currentSequence[this.sequenceIndex] 699 ); 700 if (!isMatch) { 701 this.inRCDATA = false; 702 } else if (!isEnd) { 703 this.sequenceIndex++; 704 return; 705 } 706 this.sequenceIndex = 0; 707 this.state = 6; 708 this.stateInTagName(c); 709 } 710 /** Look for an end tag. For <title> and <textarea>, also decode entities. */ 711 stateInRCDATA(c) { 712 if (this.sequenceIndex === this.currentSequence.length) { 713 if (c === 62 || isWhitespace(c)) { 714 const endOfText = this.index - this.currentSequence.length; 715 if (this.sectionStart < endOfText) { 716 const actualIndex = this.index; 717 this.index = endOfText; 718 this.cbs.ontext(this.sectionStart, endOfText); 719 this.index = actualIndex; 720 } 721 this.sectionStart = endOfText + 2; 722 this.stateInClosingTagName(c); 723 this.inRCDATA = false; 724 return; 725 } 726 this.sequenceIndex = 0; 727 } 728 if ((c | 32) === this.currentSequence[this.sequenceIndex]) { 729 this.sequenceIndex += 1; 730 } else if (this.sequenceIndex === 0) { 731 if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { 732 if (c === this.delimiterOpen[0]) { 733 this.state = 2; 734 this.delimiterIndex = 0; 735 this.stateInterpolationOpen(c); 736 } 737 } else if (this.fastForwardTo(60)) { 738 this.sequenceIndex = 1; 739 } 740 } else { 741 this.sequenceIndex = Number(c === 60); 742 } 743 } 744 stateCDATASequence(c) { 745 if (c === Sequences.Cdata[this.sequenceIndex]) { 746 if (++this.sequenceIndex === Sequences.Cdata.length) { 747 this.state = 28; 748 this.currentSequence = Sequences.CdataEnd; 749 this.sequenceIndex = 0; 750 this.sectionStart = this.index + 1; 751 } 752 } else { 753 this.sequenceIndex = 0; 754 this.state = 23; 755 this.stateInDeclaration(c); 756 } 757 } 758 /** 759 * When we wait for one specific character, we can speed things up 760 * by skipping through the buffer until we find it. 761 * 762 * @returns Whether the character was found. 763 */ 764 fastForwardTo(c) { 765 while (++this.index < this.buffer.length) { 766 const cc = this.buffer.charCodeAt(this.index); 767 if (cc === 10) { 768 this.newlines.push(this.index); 769 } 770 if (cc === c) { 771 return true; 772 } 773 } 774 this.index = this.buffer.length - 1; 775 return false; 776 } 777 /** 778 * Comments and CDATA end with `-->` and `]]>`. 779 * 780 * Their common qualities are: 781 * - Their end sequences have a distinct character they start with. 782 * - That character is then repeated, so we have to check multiple repeats. 783 * - All characters but the start character of the sequence can be skipped. 784 */ 785 stateInCommentLike(c) { 786 if (c === this.currentSequence[this.sequenceIndex]) { 787 if (++this.sequenceIndex === this.currentSequence.length) { 788 if (this.currentSequence === Sequences.CdataEnd) { 789 this.cbs.oncdata(this.sectionStart, this.index - 2); 790 } else { 791 this.cbs.oncomment(this.sectionStart, this.index - 2); 792 } 793 this.sequenceIndex = 0; 794 this.sectionStart = this.index + 1; 795 this.state = 1; 796 } 797 } else if (this.sequenceIndex === 0) { 798 if (this.fastForwardTo(this.currentSequence[0])) { 799 this.sequenceIndex = 1; 800 } 801 } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { 802 this.sequenceIndex = 0; 803 } 804 } 805 startSpecial(sequence, offset) { 806 this.enterRCDATA(sequence, offset); 807 this.state = 31; 808 } 809 enterRCDATA(sequence, offset) { 810 this.inRCDATA = true; 811 this.currentSequence = sequence; 812 this.sequenceIndex = offset; 813 } 814 stateBeforeTagName(c) { 815 if (c === 33) { 816 this.state = 22; 817 this.sectionStart = this.index + 1; 818 } else if (c === 63) { 819 this.state = 24; 820 this.sectionStart = this.index + 1; 821 } else if (isTagStartChar(c)) { 822 this.sectionStart = this.index; 823 if (this.mode === 0) { 824 this.state = 6; 825 } else if (this.inSFCRoot) { 826 this.state = 34; 827 } else if (!this.inXML) { 828 const lower = c | 32; 829 if (lower === 116) { 830 this.state = 30; 831 } else { 832 this.state = lower === 115 ? 29 : 6; 833 } 834 } else { 835 this.state = 6; 836 } 837 } else if (c === 47) { 838 this.state = 8; 839 } else { 840 this.state = 1; 841 this.stateText(c); 842 } 843 } 844 stateInTagName(c) { 845 if (isEndOfTagSection(c)) { 846 this.handleTagName(c); 847 } 848 } 849 stateInSFCRootTagName(c) { 850 if (isEndOfTagSection(c)) { 851 const tag = this.buffer.slice(this.sectionStart, this.index); 852 if (tag !== "template") { 853 this.enterRCDATA(toCharCodes(`</` + tag), 0); 854 } 855 this.handleTagName(c); 856 } 857 } 858 handleTagName(c) { 859 this.cbs.onopentagname(this.sectionStart, this.index); 860 this.sectionStart = -1; 861 this.state = 11; 862 this.stateBeforeAttrName(c); 863 } 864 stateBeforeClosingTagName(c) { 865 if (isWhitespace(c)) ; else if (c === 62) { 866 if (true) { 867 this.cbs.onerr(14, this.index); 868 } 869 this.state = 1; 870 this.sectionStart = this.index + 1; 871 } else { 872 this.state = isTagStartChar(c) ? 9 : 27; 873 this.sectionStart = this.index; 874 } 875 } 876 stateInClosingTagName(c) { 877 if (c === 62 || isWhitespace(c)) { 878 this.cbs.onclosetag(this.sectionStart, this.index); 879 this.sectionStart = -1; 880 this.state = 10; 881 this.stateAfterClosingTagName(c); 882 } 883 } 884 stateAfterClosingTagName(c) { 885 if (c === 62) { 886 this.state = 1; 887 this.sectionStart = this.index + 1; 888 } 889 } 890 stateBeforeAttrName(c) { 891 if (c === 62) { 892 this.cbs.onopentagend(this.index); 893 if (this.inRCDATA) { 894 this.state = 32; 895 } else { 896 this.state = 1; 897 } 898 this.sectionStart = this.index + 1; 899 } else if (c === 47) { 900 this.state = 7; 901 if (( true) && this.peek() !== 62) { 902 this.cbs.onerr(22, this.index); 903 } 904 } else if (c === 60 && this.peek() === 47) { 905 this.cbs.onopentagend(this.index); 906 this.state = 5; 907 this.sectionStart = this.index; 908 } else if (!isWhitespace(c)) { 909 if (( true) && c === 61) { 910 this.cbs.onerr( 911 19, 912 this.index 913 ); 914 } 915 this.handleAttrStart(c); 916 } 917 } 918 handleAttrStart(c) { 919 if (c === 118 && this.peek() === 45) { 920 this.state = 13; 921 this.sectionStart = this.index; 922 } else if (c === 46 || c === 58 || c === 64 || c === 35) { 923 this.cbs.ondirname(this.index, this.index + 1); 924 this.state = 14; 925 this.sectionStart = this.index + 1; 926 } else { 927 this.state = 12; 928 this.sectionStart = this.index; 929 } 930 } 931 stateInSelfClosingTag(c) { 932 if (c === 62) { 933 this.cbs.onselfclosingtag(this.index); 934 this.state = 1; 935 this.sectionStart = this.index + 1; 936 this.inRCDATA = false; 937 } else if (!isWhitespace(c)) { 938 this.state = 11; 939 this.stateBeforeAttrName(c); 940 } 941 } 942 stateInAttrName(c) { 943 if (c === 61 || isEndOfTagSection(c)) { 944 this.cbs.onattribname(this.sectionStart, this.index); 945 this.handleAttrNameEnd(c); 946 } else if (( true) && (c === 34 || c === 39 || c === 60)) { 947 this.cbs.onerr( 948 17, 949 this.index 950 ); 951 } 952 } 953 stateInDirName(c) { 954 if (c === 61 || isEndOfTagSection(c)) { 955 this.cbs.ondirname(this.sectionStart, this.index); 956 this.handleAttrNameEnd(c); 957 } else if (c === 58) { 958 this.cbs.ondirname(this.sectionStart, this.index); 959 this.state = 14; 960 this.sectionStart = this.index + 1; 961 } else if (c === 46) { 962 this.cbs.ondirname(this.sectionStart, this.index); 963 this.state = 16; 964 this.sectionStart = this.index + 1; 965 } 966 } 967 stateInDirArg(c) { 968 if (c === 61 || isEndOfTagSection(c)) { 969 this.cbs.ondirarg(this.sectionStart, this.index); 970 this.handleAttrNameEnd(c); 971 } else if (c === 91) { 972 this.state = 15; 973 } else if (c === 46) { 974 this.cbs.ondirarg(this.sectionStart, this.index); 975 this.state = 16; 976 this.sectionStart = this.index + 1; 977 } 978 } 979 stateInDynamicDirArg(c) { 980 if (c === 93) { 981 this.state = 14; 982 } else if (c === 61 || isEndOfTagSection(c)) { 983 this.cbs.ondirarg(this.sectionStart, this.index + 1); 984 this.handleAttrNameEnd(c); 985 if (true) { 986 this.cbs.onerr( 987 27, 988 this.index 989 ); 990 } 991 } 992 } 993 stateInDirModifier(c) { 994 if (c === 61 || isEndOfTagSection(c)) { 995 this.cbs.ondirmodifier(this.sectionStart, this.index); 996 this.handleAttrNameEnd(c); 997 } else if (c === 46) { 998 this.cbs.ondirmodifier(this.sectionStart, this.index); 999 this.sectionStart = this.index + 1; 1000 } 1001 } 1002 handleAttrNameEnd(c) { 1003 this.sectionStart = this.index; 1004 this.state = 17; 1005 this.cbs.onattribnameend(this.index); 1006 this.stateAfterAttrName(c); 1007 } 1008 stateAfterAttrName(c) { 1009 if (c === 61) { 1010 this.state = 18; 1011 } else if (c === 47 || c === 62) { 1012 this.cbs.onattribend(0, this.sectionStart); 1013 this.sectionStart = -1; 1014 this.state = 11; 1015 this.stateBeforeAttrName(c); 1016 } else if (!isWhitespace(c)) { 1017 this.cbs.onattribend(0, this.sectionStart); 1018 this.handleAttrStart(c); 1019 } 1020 } 1021 stateBeforeAttrValue(c) { 1022 if (c === 34) { 1023 this.state = 19; 1024 this.sectionStart = this.index + 1; 1025 } else if (c === 39) { 1026 this.state = 20; 1027 this.sectionStart = this.index + 1; 1028 } else if (!isWhitespace(c)) { 1029 this.sectionStart = this.index; 1030 this.state = 21; 1031 this.stateInAttrValueNoQuotes(c); 1032 } 1033 } 1034 handleInAttrValue(c, quote) { 1035 if (c === quote || this.fastForwardTo(quote)) { 1036 this.cbs.onattribdata(this.sectionStart, this.index); 1037 this.sectionStart = -1; 1038 this.cbs.onattribend( 1039 quote === 34 ? 3 : 2, 1040 this.index + 1 1041 ); 1042 this.state = 11; 1043 } 1044 } 1045 stateInAttrValueDoubleQuotes(c) { 1046 this.handleInAttrValue(c, 34); 1047 } 1048 stateInAttrValueSingleQuotes(c) { 1049 this.handleInAttrValue(c, 39); 1050 } 1051 stateInAttrValueNoQuotes(c) { 1052 if (isWhitespace(c) || c === 62) { 1053 this.cbs.onattribdata(this.sectionStart, this.index); 1054 this.sectionStart = -1; 1055 this.cbs.onattribend(1, this.index); 1056 this.state = 11; 1057 this.stateBeforeAttrName(c); 1058 } else if (( true) && c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { 1059 this.cbs.onerr( 1060 18, 1061 this.index 1062 ); 1063 } else ; 1064 } 1065 stateBeforeDeclaration(c) { 1066 if (c === 91) { 1067 this.state = 26; 1068 this.sequenceIndex = 0; 1069 } else { 1070 this.state = c === 45 ? 25 : 23; 1071 } 1072 } 1073 stateInDeclaration(c) { 1074 if (c === 62 || this.fastForwardTo(62)) { 1075 this.state = 1; 1076 this.sectionStart = this.index + 1; 1077 } 1078 } 1079 stateInProcessingInstruction(c) { 1080 if (c === 62 || this.fastForwardTo(62)) { 1081 this.cbs.onprocessinginstruction(this.sectionStart, this.index); 1082 this.state = 1; 1083 this.sectionStart = this.index + 1; 1084 } 1085 } 1086 stateBeforeComment(c) { 1087 if (c === 45) { 1088 this.state = 28; 1089 this.currentSequence = Sequences.CommentEnd; 1090 this.sequenceIndex = 2; 1091 this.sectionStart = this.index + 1; 1092 } else { 1093 this.state = 23; 1094 } 1095 } 1096 stateInSpecialComment(c) { 1097 if (c === 62 || this.fastForwardTo(62)) { 1098 this.cbs.oncomment(this.sectionStart, this.index); 1099 this.state = 1; 1100 this.sectionStart = this.index + 1; 1101 } 1102 } 1103 stateBeforeSpecialS(c) { 1104 const lower = c | 32; 1105 if (lower === Sequences.ScriptEnd[3]) { 1106 this.startSpecial(Sequences.ScriptEnd, 4); 1107 } else if (lower === Sequences.StyleEnd[3]) { 1108 this.startSpecial(Sequences.StyleEnd, 4); 1109 } else { 1110 this.state = 6; 1111 this.stateInTagName(c); 1112 } 1113 } 1114 stateBeforeSpecialT(c) { 1115 const lower = c | 32; 1116 if (lower === Sequences.TitleEnd[3]) { 1117 this.startSpecial(Sequences.TitleEnd, 4); 1118 } else if (lower === Sequences.TextareaEnd[3]) { 1119 this.startSpecial(Sequences.TextareaEnd, 4); 1120 } else { 1121 this.state = 6; 1122 this.stateInTagName(c); 1123 } 1124 } 1125 startEntity() { 1126 } 1127 stateInEntity() { 1128 } 1129 /** 1130 * Iterates through the buffer, calling the function corresponding to the current state. 1131 * 1132 * States that are more likely to be hit are higher up, as a performance improvement. 1133 */ 1134 parse(input) { 1135 this.buffer = input; 1136 while (this.index < this.buffer.length) { 1137 const c = this.buffer.charCodeAt(this.index); 1138 if (c === 10) { 1139 this.newlines.push(this.index); 1140 } 1141 switch (this.state) { 1142 case 1: { 1143 this.stateText(c); 1144 break; 1145 } 1146 case 2: { 1147 this.stateInterpolationOpen(c); 1148 break; 1149 } 1150 case 3: { 1151 this.stateInterpolation(c); 1152 break; 1153 } 1154 case 4: { 1155 this.stateInterpolationClose(c); 1156 break; 1157 } 1158 case 31: { 1159 this.stateSpecialStartSequence(c); 1160 break; 1161 } 1162 case 32: { 1163 this.stateInRCDATA(c); 1164 break; 1165 } 1166 case 26: { 1167 this.stateCDATASequence(c); 1168 break; 1169 } 1170 case 19: { 1171 this.stateInAttrValueDoubleQuotes(c); 1172 break; 1173 } 1174 case 12: { 1175 this.stateInAttrName(c); 1176 break; 1177 } 1178 case 13: { 1179 this.stateInDirName(c); 1180 break; 1181 } 1182 case 14: { 1183 this.stateInDirArg(c); 1184 break; 1185 } 1186 case 15: { 1187 this.stateInDynamicDirArg(c); 1188 break; 1189 } 1190 case 16: { 1191 this.stateInDirModifier(c); 1192 break; 1193 } 1194 case 28: { 1195 this.stateInCommentLike(c); 1196 break; 1197 } 1198 case 27: { 1199 this.stateInSpecialComment(c); 1200 break; 1201 } 1202 case 11: { 1203 this.stateBeforeAttrName(c); 1204 break; 1205 } 1206 case 6: { 1207 this.stateInTagName(c); 1208 break; 1209 } 1210 case 34: { 1211 this.stateInSFCRootTagName(c); 1212 break; 1213 } 1214 case 9: { 1215 this.stateInClosingTagName(c); 1216 break; 1217 } 1218 case 5: { 1219 this.stateBeforeTagName(c); 1220 break; 1221 } 1222 case 17: { 1223 this.stateAfterAttrName(c); 1224 break; 1225 } 1226 case 20: { 1227 this.stateInAttrValueSingleQuotes(c); 1228 break; 1229 } 1230 case 18: { 1231 this.stateBeforeAttrValue(c); 1232 break; 1233 } 1234 case 8: { 1235 this.stateBeforeClosingTagName(c); 1236 break; 1237 } 1238 case 10: { 1239 this.stateAfterClosingTagName(c); 1240 break; 1241 } 1242 case 29: { 1243 this.stateBeforeSpecialS(c); 1244 break; 1245 } 1246 case 30: { 1247 this.stateBeforeSpecialT(c); 1248 break; 1249 } 1250 case 21: { 1251 this.stateInAttrValueNoQuotes(c); 1252 break; 1253 } 1254 case 7: { 1255 this.stateInSelfClosingTag(c); 1256 break; 1257 } 1258 case 23: { 1259 this.stateInDeclaration(c); 1260 break; 1261 } 1262 case 22: { 1263 this.stateBeforeDeclaration(c); 1264 break; 1265 } 1266 case 25: { 1267 this.stateBeforeComment(c); 1268 break; 1269 } 1270 case 24: { 1271 this.stateInProcessingInstruction(c); 1272 break; 1273 } 1274 case 33: { 1275 this.stateInEntity(); 1276 break; 1277 } 1278 } 1279 this.index++; 1280 } 1281 this.cleanup(); 1282 this.finish(); 1283 } 1284 /** 1285 * Remove data that has already been consumed from the buffer. 1286 */ 1287 cleanup() { 1288 if (this.sectionStart !== this.index) { 1289 if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { 1290 this.cbs.ontext(this.sectionStart, this.index); 1291 this.sectionStart = this.index; 1292 } else if (this.state === 19 || this.state === 20 || this.state === 21) { 1293 this.cbs.onattribdata(this.sectionStart, this.index); 1294 this.sectionStart = this.index; 1295 } 1296 } 1297 } 1298 finish() { 1299 this.handleTrailingData(); 1300 this.cbs.onend(); 1301 } 1302 /** Handle any trailing data. */ 1303 handleTrailingData() { 1304 const endIndex = this.buffer.length; 1305 if (this.sectionStart >= endIndex) { 1306 return; 1307 } 1308 if (this.state === 28) { 1309 if (this.currentSequence === Sequences.CdataEnd) { 1310 this.cbs.oncdata(this.sectionStart, endIndex); 1311 } else { 1312 this.cbs.oncomment(this.sectionStart, endIndex); 1313 } 1314 } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { 1315 this.cbs.ontext(this.sectionStart, endIndex); 1316 } 1317 } 1318 emitCodePoint(cp, consumed) { 1319 } 1320} 1321 1322const CompilerDeprecationTypes = { 1323 "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", 1324 "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", 1325 "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", 1326 "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", 1327 "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", 1328 "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", 1329 "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", 1330 "COMPILER_FILTERS": "COMPILER_FILTERS" 1331}; 1332const deprecationData = { 1333 ["COMPILER_IS_ON_ELEMENT"]: { 1334 message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, 1335 link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` 1336 }, 1337 ["COMPILER_V_BIND_SYNC"]: { 1338 message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, 1339 link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` 1340 }, 1341 ["COMPILER_V_BIND_OBJECT_ORDER"]: { 1342 message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, 1343 link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` 1344 }, 1345 ["COMPILER_V_ON_NATIVE"]: { 1346 message: `.native modifier for v-on has been removed as is no longer necessary.`, 1347 link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` 1348 }, 1349 ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { 1350 message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, 1351 link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` 1352 }, 1353 ["COMPILER_NATIVE_TEMPLATE"]: { 1354 message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` 1355 }, 1356 ["COMPILER_INLINE_TEMPLATE"]: { 1357 message: `"inline-template" has been removed in Vue 3.`, 1358 link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` 1359 }, 1360 ["COMPILER_FILTERS"]: { 1361 message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, 1362 link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` 1363 } 1364}; 1365function getCompatValue(key, { compatConfig }) { 1366 const value = compatConfig && compatConfig[key]; 1367 if (key === "MODE") { 1368 return value || 3; 1369 } else { 1370 return value; 1371 } 1372} 1373function isCompatEnabled(key, context) { 1374 const mode = getCompatValue("MODE", context); 1375 const value = getCompatValue(key, context); 1376 return mode === 3 ? value === true : value !== false; 1377} 1378function checkCompatEnabled(key, context, loc, ...args) { 1379 const enabled = isCompatEnabled(key, context); 1380 if ( true && enabled) { 1381 warnDeprecation(key, context, loc, ...args); 1382 } 1383 return enabled; 1384} 1385function warnDeprecation(key, context, loc, ...args) { 1386 const val = getCompatValue(key, context); 1387 if (val === "suppress-warning") { 1388 return; 1389 } 1390 const { message, link } = deprecationData[key]; 1391 const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` 1392 Details: ${link}` : ``}`; 1393 const err = new SyntaxError(msg); 1394 err.code = key; 1395 if (loc) 1396 err.loc = loc; 1397 context.onWarn(err); 1398} 1399 1400function defaultOnError(error) { 1401 throw error; 1402} 1403function defaultOnWarn(msg) { 1404 true && console.warn(`[Vue warn] ${msg.message}`); 1405} 1406function createCompilerError(code, loc, messages, additionalMessage) { 1407 const msg = true ? (messages || errorMessages)[code] + (additionalMessage || ``) : 0; 1408 const error = new SyntaxError(String(msg)); 1409 error.code = code; 1410 error.loc = loc; 1411 return error; 1412} 1413const ErrorCodes = { 1414 "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, 1415 "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", 1416 "CDATA_IN_HTML_CONTENT": 1, 1417 "1": "CDATA_IN_HTML_CONTENT", 1418 "DUPLICATE_ATTRIBUTE": 2, 1419 "2": "DUPLICATE_ATTRIBUTE", 1420 "END_TAG_WITH_ATTRIBUTES": 3, 1421 "3": "END_TAG_WITH_ATTRIBUTES", 1422 "END_TAG_WITH_TRAILING_SOLIDUS": 4, 1423 "4": "END_TAG_WITH_TRAILING_SOLIDUS", 1424 "EOF_BEFORE_TAG_NAME": 5, 1425 "5": "EOF_BEFORE_TAG_NAME", 1426 "EOF_IN_CDATA": 6, 1427 "6": "EOF_IN_CDATA", 1428 "EOF_IN_COMMENT": 7, 1429 "7": "EOF_IN_COMMENT", 1430 "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, 1431 "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", 1432 "EOF_IN_TAG": 9, 1433 "9": "EOF_IN_TAG", 1434 "INCORRECTLY_CLOSED_COMMENT": 10, 1435 "10": "INCORRECTLY_CLOSED_COMMENT", 1436 "INCORRECTLY_OPENED_COMMENT": 11, 1437 "11": "INCORRECTLY_OPENED_COMMENT", 1438 "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, 1439 "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", 1440 "MISSING_ATTRIBUTE_VALUE": 13, 1441 "13": "MISSING_ATTRIBUTE_VALUE", 1442 "MISSING_END_TAG_NAME": 14, 1443 "14": "MISSING_END_TAG_NAME", 1444 "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, 1445 "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", 1446 "NESTED_COMMENT": 16, 1447 "16": "NESTED_COMMENT", 1448 "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, 1449 "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", 1450 "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, 1451 "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", 1452 "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, 1453 "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", 1454 "UNEXPECTED_NULL_CHARACTER": 20, 1455 "20": "UNEXPECTED_NULL_CHARACTER", 1456 "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, 1457 "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", 1458 "UNEXPECTED_SOLIDUS_IN_TAG": 22, 1459 "22": "UNEXPECTED_SOLIDUS_IN_TAG", 1460 "X_INVALID_END_TAG": 23, 1461 "23": "X_INVALID_END_TAG", 1462 "X_MISSING_END_TAG": 24, 1463 "24": "X_MISSING_END_TAG", 1464 "X_MISSING_INTERPOLATION_END": 25, 1465 "25": "X_MISSING_INTERPOLATION_END", 1466 "X_MISSING_DIRECTIVE_NAME": 26, 1467 "26": "X_MISSING_DIRECTIVE_NAME", 1468 "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, 1469 "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", 1470 "X_V_IF_NO_EXPRESSION": 28, 1471 "28": "X_V_IF_NO_EXPRESSION", 1472 "X_V_IF_SAME_KEY": 29, 1473 "29": "X_V_IF_SAME_KEY", 1474 "X_V_ELSE_NO_ADJACENT_IF": 30, 1475 "30": "X_V_ELSE_NO_ADJACENT_IF", 1476 "X_V_FOR_NO_EXPRESSION": 31, 1477 "31": "X_V_FOR_NO_EXPRESSION", 1478 "X_V_FOR_MALFORMED_EXPRESSION": 32, 1479 "32": "X_V_FOR_MALFORMED_EXPRESSION", 1480 "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, 1481 "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", 1482 "X_V_BIND_NO_EXPRESSION": 34, 1483 "34": "X_V_BIND_NO_EXPRESSION", 1484 "X_V_ON_NO_EXPRESSION": 35, 1485 "35": "X_V_ON_NO_EXPRESSION", 1486 "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, 1487 "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", 1488 "X_V_SLOT_MIXED_SLOT_USAGE": 37, 1489 "37": "X_V_SLOT_MIXED_SLOT_USAGE", 1490 "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, 1491 "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", 1492 "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, 1493 "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", 1494 "X_V_SLOT_MISPLACED": 40, 1495 "40": "X_V_SLOT_MISPLACED", 1496 "X_V_MODEL_NO_EXPRESSION": 41, 1497 "41": "X_V_MODEL_NO_EXPRESSION", 1498 "X_V_MODEL_MALFORMED_EXPRESSION": 42, 1499 "42": "X_V_MODEL_MALFORMED_EXPRESSION", 1500 "X_V_MODEL_ON_SCOPE_VARIABLE": 43, 1501 "43": "X_V_MODEL_ON_SCOPE_VARIABLE", 1502 "X_V_MODEL_ON_PROPS": 44, 1503 "44": "X_V_MODEL_ON_PROPS", 1504 "X_INVALID_EXPRESSION": 45, 1505 "45": "X_INVALID_EXPRESSION", 1506 "X_KEEP_ALIVE_INVALID_CHILDREN": 46, 1507 "46": "X_KEEP_ALIVE_INVALID_CHILDREN", 1508 "X_PREFIX_ID_NOT_SUPPORTED": 47, 1509 "47": "X_PREFIX_ID_NOT_SUPPORTED", 1510 "X_MODULE_MODE_NOT_SUPPORTED": 48, 1511 "48": "X_MODULE_MODE_NOT_SUPPORTED", 1512 "X_CACHE_HANDLER_NOT_SUPPORTED": 49, 1513 "49": "X_CACHE_HANDLER_NOT_SUPPORTED", 1514 "X_SCOPE_ID_NOT_SUPPORTED": 50, 1515 "50": "X_SCOPE_ID_NOT_SUPPORTED", 1516 "X_VNODE_HOOKS": 51, 1517 "51": "X_VNODE_HOOKS", 1518 "__EXTEND_POINT__": 52, 1519 "52": "__EXTEND_POINT__" 1520}; 1521const errorMessages = { 1522 // parse errors 1523 [0]: "Illegal comment.", 1524 [1]: "CDATA section is allowed only in XML context.", 1525 [2]: "Duplicate attribute.", 1526 [3]: "End tag cannot have attributes.", 1527 [4]: "Illegal '/' in tags.", 1528 [5]: "Unexpected EOF in tag.", 1529 [6]: "Unexpected EOF in CDATA section.", 1530 [7]: "Unexpected EOF in comment.", 1531 [8]: "Unexpected EOF in script.", 1532 [9]: "Unexpected EOF in tag.", 1533 [10]: "Incorrectly closed comment.", 1534 [11]: "Incorrectly opened comment.", 1535 [12]: "Illegal tag name. Use '<' to print '<'.", 1536 [13]: "Attribute value was expected.", 1537 [14]: "End tag name was expected.", 1538 [15]: "Whitespace was expected.", 1539 [16]: "Unexpected '<!--' in comment.", 1540 [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, 1541 [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", 1542 [19]: "Attribute name cannot start with '='.", 1543 [21]: "'<?' is allowed only in XML context.", 1544 [20]: `Unexpected null character.`, 1545 [22]: "Illegal '/' in tags.", 1546 // Vue-specific parse errors 1547 [23]: "Invalid end tag.", 1548 [24]: "Element is missing end tag.", 1549 [25]: "Interpolation end sign was not found.", 1550 [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", 1551 [26]: "Legal directive name was expected.", 1552 // transform errors 1553 [28]: `v-if/v-else-if is missing expression.`, 1554 [29]: `v-if/else branches must use unique keys.`, 1555 [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, 1556 [31]: `v-for is missing expression.`, 1557 [32]: `v-for has invalid expression.`, 1558 [33]: `<template v-for> key should be placed on the <template> tag.`, 1559 [34]: `v-bind is missing expression.`, 1560 [35]: `v-on is missing expression.`, 1561 [36]: `Unexpected custom directive on <slot> outlet.`, 1562 [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, 1563 [38]: `Duplicate slot names found. `, 1564 [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, 1565 [40]: `v-slot can only be used on components or <template> tags.`, 1566 [41]: `v-model is missing expression.`, 1567 [42]: `v-model value must be a valid JavaScript member expression.`, 1568 [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, 1569 [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. 1570Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, 1571 [45]: `Error parsing JavaScript expression: `, 1572 [46]: `<KeepAlive> expects exactly one child component.`, 1573 [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, 1574 // generic errors 1575 [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, 1576 [48]: `ES module mode is not supported in this build of compiler.`, 1577 [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, 1578 [50]: `"scopeId" option is only supported in module mode.`, 1579 // just to fulfill types 1580 [52]: `` 1581}; 1582 1583function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { 1584 { 1585 return; 1586 } 1587} 1588function isReferencedIdentifier(id, parent, parentStack) { 1589 { 1590 return false; 1591 } 1592} 1593function isInDestructureAssignment(parent, parentStack) { 1594 if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { 1595 let i = parentStack.length; 1596 while (i--) { 1597 const p = parentStack[i]; 1598 if (p.type === "AssignmentExpression") { 1599 return true; 1600 } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { 1601 break; 1602 } 1603 } 1604 } 1605 return false; 1606} 1607function isInNewExpression(parentStack) { 1608 let i = parentStack.length; 1609 while (i--) { 1610 const p = parentStack[i]; 1611 if (p.type === "NewExpression") { 1612 return true; 1613 } else if (p.type !== "MemberExpression") { 1614 break; 1615 } 1616 } 1617 return false; 1618} 1619function walkFunctionParams(node, onIdent) { 1620 for (const p of node.params) { 1621 for (const id of extractIdentifiers(p)) { 1622 onIdent(id); 1623 } 1624 } 1625} 1626function walkBlockDeclarations(block, onIdent) { 1627 for (const stmt of block.body) { 1628 if (stmt.type === "VariableDeclaration") { 1629 if (stmt.declare) 1630 continue; 1631 for (const decl of stmt.declarations) { 1632 for (const id of extractIdentifiers(decl.id)) { 1633 onIdent(id); 1634 } 1635 } 1636 } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { 1637 if (stmt.declare || !stmt.id) 1638 continue; 1639 onIdent(stmt.id); 1640 } else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") { 1641 const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; 1642 if (variable && variable.type === "VariableDeclaration") { 1643 for (const decl of variable.declarations) { 1644 for (const id of extractIdentifiers(decl.id)) { 1645 onIdent(id); 1646 } 1647 } 1648 } 1649 } 1650 } 1651} 1652function extractIdentifiers(param, nodes = []) { 1653 switch (param.type) { 1654 case "Identifier": 1655 nodes.push(param); 1656 break; 1657 case "MemberExpression": 1658 let object = param; 1659 while (object.type === "MemberExpression") { 1660 object = object.object; 1661 } 1662 nodes.push(object); 1663 break; 1664 case "ObjectPattern": 1665 for (const prop of param.properties) { 1666 if (prop.type === "RestElement") { 1667 extractIdentifiers(prop.argument, nodes); 1668 } else { 1669 extractIdentifiers(prop.value, nodes); 1670 } 1671 } 1672 break; 1673 case "ArrayPattern": 1674 param.elements.forEach((element) => { 1675 if (element) 1676 extractIdentifiers(element, nodes); 1677 }); 1678 break; 1679 case "RestElement": 1680 extractIdentifiers(param.argument, nodes); 1681 break; 1682 case "AssignmentPattern": 1683 extractIdentifiers(param.left, nodes); 1684 break; 1685 } 1686 return nodes; 1687} 1688const isFunctionType = (node) => { 1689 return /Function(?:Expression|Declaration)$|Method$/.test(node.type); 1690}; 1691const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; 1692const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; 1693const TS_NODE_TYPES = [ 1694 "TSAsExpression", 1695 // foo as number 1696 "TSTypeAssertion", 1697 // (<number>foo) 1698 "TSNonNullExpression", 1699 // foo! 1700 "TSInstantiationExpression", 1701 // foo<string> 1702 "TSSatisfiesExpression" 1703 // foo satisfies T 1704]; 1705function unwrapTSNode(node) { 1706 if (TS_NODE_TYPES.includes(node.type)) { 1707 return unwrapTSNode(node.expression); 1708 } else { 1709 return node; 1710 } 1711} 1712 1713const isStaticExp = (p) => p.type === 4 && p.isStatic; 1714function isCoreComponent(tag) { 1715 switch (tag) { 1716 case "Teleport": 1717 case "teleport": 1718 return TELEPORT; 1719 case "Suspense": 1720 case "suspense": 1721 return SUSPENSE; 1722 case "KeepAlive": 1723 case "keep-alive": 1724 return KEEP_ALIVE; 1725 case "BaseTransition": 1726 case "base-transition": 1727 return BASE_TRANSITION; 1728 } 1729} 1730const nonIdentifierRE = /^\d|[^\$\w]/; 1731const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); 1732const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; 1733const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; 1734const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; 1735const isMemberExpressionBrowser = (path) => { 1736 path = path.trim().replace(whitespaceRE, (s) => s.trim()); 1737 let state = 0 /* inMemberExp */; 1738 let stateStack = []; 1739 let currentOpenBracketCount = 0; 1740 let currentOpenParensCount = 0; 1741 let currentStringType = null; 1742 for (let i = 0; i < path.length; i++) { 1743 const char = path.charAt(i); 1744 switch (state) { 1745 case 0 /* inMemberExp */: 1746 if (char === "[") { 1747 stateStack.push(state); 1748 state = 1 /* inBrackets */; 1749 currentOpenBracketCount++; 1750 } else if (char === "(") { 1751 stateStack.push(state); 1752 state = 2 /* inParens */; 1753 currentOpenParensCount++; 1754 } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { 1755 return false; 1756 } 1757 break; 1758 case 1 /* inBrackets */: 1759 if (char === `'` || char === `"` || char === "`") { 1760 stateStack.push(state); 1761 state = 3 /* inString */; 1762 currentStringType = char; 1763 } else if (char === `[`) { 1764 currentOpenBracketCount++; 1765 } else if (char === `]`) { 1766 if (!--currentOpenBracketCount) { 1767 state = stateStack.pop(); 1768 } 1769 } 1770 break; 1771 case 2 /* inParens */: 1772 if (char === `'` || char === `"` || char === "`") { 1773 stateStack.push(state); 1774 state = 3 /* inString */; 1775 currentStringType = char; 1776 } else if (char === `(`) { 1777 currentOpenParensCount++; 1778 } else if (char === `)`) { 1779 if (i === path.length - 1) { 1780 return false; 1781 } 1782 if (!--currentOpenParensCount) { 1783 state = stateStack.pop(); 1784 } 1785 } 1786 break; 1787 case 3 /* inString */: 1788 if (char === currentStringType) { 1789 state = stateStack.pop(); 1790 currentStringType = null; 1791 } 1792 break; 1793 } 1794 } 1795 return !currentOpenBracketCount && !currentOpenParensCount; 1796}; 1797const isMemberExpressionNode = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP ; 1798const isMemberExpression = isMemberExpressionBrowser ; 1799function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { 1800 return advancePositionWithMutation( 1801 { 1802 offset: pos.offset, 1803 line: pos.line, 1804 column: pos.column 1805 }, 1806 source, 1807 numberOfCharacters 1808 ); 1809} 1810function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { 1811 let linesCount = 0; 1812 let lastNewLinePos = -1; 1813 for (let i = 0; i < numberOfCharacters; i++) { 1814 if (source.charCodeAt(i) === 10) { 1815 linesCount++; 1816 lastNewLinePos = i; 1817 } 1818 } 1819 pos.offset += numberOfCharacters; 1820 pos.line += linesCount; 1821 pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; 1822 return pos; 1823} 1824function assert(condition, msg) { 1825 if (!condition) { 1826 throw new Error(msg || `unexpected compiler condition`); 1827 } 1828} 1829function findDir(node, name, allowEmpty = false) { 1830 for (let i = 0; i < node.props.length; i++) { 1831 const p = node.props[i]; 1832 if (p.type === 7 && (allowEmpty || p.exp) && ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(name) ? p.name === name : name.test(p.name))) { 1833 return p; 1834 } 1835 } 1836} 1837function findProp(node, name, dynamicOnly = false, allowEmpty = false) { 1838 for (let i = 0; i < node.props.length; i++) { 1839 const p = node.props[i]; 1840 if (p.type === 6) { 1841 if (dynamicOnly) 1842 continue; 1843 if (p.name === name && (p.value || allowEmpty)) { 1844 return p; 1845 } 1846 } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { 1847 return p; 1848 } 1849 } 1850} 1851function isStaticArgOf(arg, name) { 1852 return !!(arg && isStaticExp(arg) && arg.content === name); 1853} 1854function hasDynamicKeyVBind(node) { 1855 return node.props.some( 1856 (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" 1857 p.arg.type !== 4 || // v-bind:[_ctx.foo] 1858 !p.arg.isStatic) 1859 // v-bind:[foo] 1860 ); 1861} 1862function isText$1(node) { 1863 return node.type === 5 || node.type === 2; 1864} 1865function isVSlot(p) { 1866 return p.type === 7 && p.name === "slot"; 1867} 1868function isTemplateNode(node) { 1869 return node.type === 1 && node.tagType === 3; 1870} 1871function isSlotOutlet(node) { 1872 return node.type === 1 && node.tagType === 2; 1873} 1874const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); 1875function getUnnormalizedProps(props, callPath = []) { 1876 if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props) && props.type === 14) { 1877 const callee = props.callee; 1878 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(callee) && propsHelperSet.has(callee)) { 1879 return getUnnormalizedProps( 1880 props.arguments[0], 1881 callPath.concat(props) 1882 ); 1883 } 1884 } 1885 return [props, callPath]; 1886} 1887function injectProp(node, prop, context) { 1888 let propsWithInjection; 1889 let props = node.type === 13 ? node.props : node.arguments[2]; 1890 let callPath = []; 1891 let parentCall; 1892 if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props) && props.type === 14) { 1893 const ret = getUnnormalizedProps(props); 1894 props = ret[0]; 1895 callPath = ret[1]; 1896 parentCall = callPath[callPath.length - 1]; 1897 } 1898 if (props == null || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props)) { 1899 propsWithInjection = createObjectExpression([prop]); 1900 } else if (props.type === 14) { 1901 const first = props.arguments[0]; 1902 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(first) && first.type === 15) { 1903 if (!hasProp(prop, first)) { 1904 first.properties.unshift(prop); 1905 } 1906 } else { 1907 if (props.callee === TO_HANDLERS) { 1908 propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ 1909 createObjectExpression([prop]), 1910 props 1911 ]); 1912 } else { 1913 props.arguments.unshift(createObjectExpression([prop])); 1914 } 1915 } 1916 !propsWithInjection && (propsWithInjection = props); 1917 } else if (props.type === 15) { 1918 if (!hasProp(prop, props)) { 1919 props.properties.unshift(prop); 1920 } 1921 propsWithInjection = props; 1922 } else { 1923 propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ 1924 createObjectExpression([prop]), 1925 props 1926 ]); 1927 if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { 1928 parentCall = callPath[callPath.length - 2]; 1929 } 1930 } 1931 if (node.type === 13) { 1932 if (parentCall) { 1933 parentCall.arguments[0] = propsWithInjection; 1934 } else { 1935 node.props = propsWithInjection; 1936 } 1937 } else { 1938 if (parentCall) { 1939 parentCall.arguments[0] = propsWithInjection; 1940 } else { 1941 node.arguments[2] = propsWithInjection; 1942 } 1943 } 1944} 1945function hasProp(prop, props) { 1946 let result = false; 1947 if (prop.key.type === 4) { 1948 const propKeyName = prop.key.content; 1949 result = props.properties.some( 1950 (p) => p.key.type === 4 && p.key.content === propKeyName 1951 ); 1952 } 1953 return result; 1954} 1955function toValidAssetId(name, type) { 1956 return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { 1957 return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); 1958 })}`; 1959} 1960function hasScopeRef(node, ids) { 1961 if (!node || Object.keys(ids).length === 0) { 1962 return false; 1963 } 1964 switch (node.type) { 1965 case 1: 1966 for (let i = 0; i < node.props.length; i++) { 1967 const p = node.props[i]; 1968 if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { 1969 return true; 1970 } 1971 } 1972 return node.children.some((c) => hasScopeRef(c, ids)); 1973 case 11: 1974 if (hasScopeRef(node.source, ids)) { 1975 return true; 1976 } 1977 return node.children.some((c) => hasScopeRef(c, ids)); 1978 case 9: 1979 return node.branches.some((b) => hasScopeRef(b, ids)); 1980 case 10: 1981 if (hasScopeRef(node.condition, ids)) { 1982 return true; 1983 } 1984 return node.children.some((c) => hasScopeRef(c, ids)); 1985 case 4: 1986 return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; 1987 case 8: 1988 return node.children.some((c) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(c) && hasScopeRef(c, ids)); 1989 case 5: 1990 case 12: 1991 return hasScopeRef(node.content, ids); 1992 case 2: 1993 case 3: 1994 return false; 1995 default: 1996 if (true) ; 1997 return false; 1998 } 1999} 2000function getMemoedVNodeCall(node) { 2001 if (node.type === 14 && node.callee === WITH_MEMO) { 2002 return node.arguments[1].returns; 2003 } else { 2004 return node; 2005 } 2006} 2007const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; 2008 2009const defaultParserOptions = { 2010 parseMode: "base", 2011 ns: 0, 2012 delimiters: [`{{`, `}}`], 2013 getNamespace: () => 0, 2014 isVoidTag: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, 2015 isPreTag: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, 2016 isCustomElement: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, 2017 onError: defaultOnError, 2018 onWarn: defaultOnWarn, 2019 comments: !!("development" !== "production"), 2020 prefixIdentifiers: false 2021}; 2022let currentOptions = defaultParserOptions; 2023let currentRoot = null; 2024let currentInput = ""; 2025let currentOpenTag = null; 2026let currentProp = null; 2027let currentAttrValue = ""; 2028let currentAttrStartIndex = -1; 2029let currentAttrEndIndex = -1; 2030let inPre = 0; 2031let inVPre = false; 2032let currentVPreBoundary = null; 2033const stack = []; 2034const tokenizer = new Tokenizer(stack, { 2035 onerr: emitError, 2036 ontext(start, end) { 2037 onText(getSlice(start, end), start, end); 2038 }, 2039 ontextentity(char, start, end) { 2040 onText(char, start, end); 2041 }, 2042 oninterpolation(start, end) { 2043 if (inVPre) { 2044 return onText(getSlice(start, end), start, end); 2045 } 2046 let innerStart = start + tokenizer.delimiterOpen.length; 2047 let innerEnd = end - tokenizer.delimiterClose.length; 2048 while (isWhitespace(currentInput.charCodeAt(innerStart))) { 2049 innerStart++; 2050 } 2051 while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { 2052 innerEnd--; 2053 } 2054 let exp = getSlice(innerStart, innerEnd); 2055 if (exp.includes("&")) { 2056 { 2057 exp = currentOptions.decodeEntities(exp, false); 2058 } 2059 } 2060 addNode({ 2061 type: 5, 2062 content: createExp(exp, false, getLoc(innerStart, innerEnd)), 2063 loc: getLoc(start, end) 2064 }); 2065 }, 2066 onopentagname(start, end) { 2067 const name = getSlice(start, end); 2068 currentOpenTag = { 2069 type: 1, 2070 tag: name, 2071 ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), 2072 tagType: 0, 2073 // will be refined on tag close 2074 props: [], 2075 children: [], 2076 loc: getLoc(start - 1, end), 2077 codegenNode: void 0 2078 }; 2079 }, 2080 onopentagend(end) { 2081 endOpenTag(end); 2082 }, 2083 onclosetag(start, end) { 2084 const name = getSlice(start, end); 2085 if (!currentOptions.isVoidTag(name)) { 2086 let found = false; 2087 for (let i = 0; i < stack.length; i++) { 2088 const e = stack[i]; 2089 if (e.tag.toLowerCase() === name.toLowerCase()) { 2090 found = true; 2091 if (i > 0) { 2092 emitError(24, stack[0].loc.start.offset); 2093 } 2094 for (let j = 0; j <= i; j++) { 2095 const el = stack.shift(); 2096 onCloseTag(el, end, j < i); 2097 } 2098 break; 2099 } 2100 } 2101 if (!found) { 2102 emitError(23, backTrack(start, 60)); 2103 } 2104 } 2105 }, 2106 onselfclosingtag(end) { 2107 var _a; 2108 const name = currentOpenTag.tag; 2109 currentOpenTag.isSelfClosing = true; 2110 endOpenTag(end); 2111 if (((_a = stack[0]) == null ? void 0 : _a.tag) === name) { 2112 onCloseTag(stack.shift(), end); 2113 } 2114 }, 2115 onattribname(start, end) { 2116 currentProp = { 2117 type: 6, 2118 name: getSlice(start, end), 2119 nameLoc: getLoc(start, end), 2120 value: void 0, 2121 loc: getLoc(start) 2122 }; 2123 }, 2124 ondirname(start, end) { 2125 const raw = getSlice(start, end); 2126 const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); 2127 if (!inVPre && name === "") { 2128 emitError(26, start); 2129 } 2130 if (inVPre || name === "") { 2131 currentProp = { 2132 type: 6, 2133 name: raw, 2134 nameLoc: getLoc(start, end), 2135 value: void 0, 2136 loc: getLoc(start) 2137 }; 2138 } else { 2139 currentProp = { 2140 type: 7, 2141 name, 2142 rawName: raw, 2143 exp: void 0, 2144 arg: void 0, 2145 modifiers: raw === "." ? ["prop"] : [], 2146 loc: getLoc(start) 2147 }; 2148 if (name === "pre") { 2149 inVPre = tokenizer.inVPre = true; 2150 currentVPreBoundary = currentOpenTag; 2151 const props = currentOpenTag.props; 2152 for (let i = 0; i < props.length; i++) { 2153 if (props[i].type === 7) { 2154 props[i] = dirToAttr(props[i]); 2155 } 2156 } 2157 } 2158 } 2159 }, 2160 ondirarg(start, end) { 2161 if (start === end) 2162 return; 2163 const arg = getSlice(start, end); 2164 if (inVPre) { 2165 currentProp.name += arg; 2166 setLocEnd(currentProp.nameLoc, end); 2167 } else { 2168 const isStatic = arg[0] !== `[`; 2169 currentProp.arg = createExp( 2170 isStatic ? arg : arg.slice(1, -1), 2171 isStatic, 2172 getLoc(start, end), 2173 isStatic ? 3 : 0 2174 ); 2175 } 2176 }, 2177 ondirmodifier(start, end) { 2178 const mod = getSlice(start, end); 2179 if (inVPre) { 2180 currentProp.name += "." + mod; 2181 setLocEnd(currentProp.nameLoc, end); 2182 } else if (currentProp.name === "slot") { 2183 const arg = currentProp.arg; 2184 if (arg) { 2185 arg.content += "." + mod; 2186 setLocEnd(arg.loc, end); 2187 } 2188 } else { 2189 currentProp.modifiers.push(mod); 2190 } 2191 }, 2192 onattribdata(start, end) { 2193 currentAttrValue += getSlice(start, end); 2194 if (currentAttrStartIndex < 0) 2195 currentAttrStartIndex = start; 2196 currentAttrEndIndex = end; 2197 }, 2198 onattribentity(char, start, end) { 2199 currentAttrValue += char; 2200 if (currentAttrStartIndex < 0) 2201 currentAttrStartIndex = start; 2202 currentAttrEndIndex = end; 2203 }, 2204 onattribnameend(end) { 2205 const start = currentProp.loc.start.offset; 2206 const name = getSlice(start, end); 2207 if (currentProp.type === 7) { 2208 currentProp.rawName = name; 2209 } 2210 if (currentOpenTag.props.some( 2211 (p) => (p.type === 7 ? p.rawName : p.name) === name 2212 )) { 2213 emitError(2, start); 2214 } 2215 }, 2216 onattribend(quote, end) { 2217 if (currentOpenTag && currentProp) { 2218 setLocEnd(currentProp.loc, end); 2219 if (quote !== 0) { 2220 if (currentAttrValue.includes("&")) { 2221 currentAttrValue = currentOptions.decodeEntities( 2222 currentAttrValue, 2223 true 2224 ); 2225 } 2226 if (currentProp.type === 6) { 2227 if (currentProp.name === "class") { 2228 currentAttrValue = condense(currentAttrValue).trim(); 2229 } 2230 if (quote === 1 && !currentAttrValue) { 2231 emitError(13, end); 2232 } 2233 currentProp.value = { 2234 type: 2, 2235 content: currentAttrValue, 2236 loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) 2237 }; 2238 if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { 2239 tokenizer.enterRCDATA(toCharCodes(`</template`), 0); 2240 } 2241 } else { 2242 let expParseMode = 0 /* Normal */; 2243 currentProp.exp = createExp( 2244 currentAttrValue, 2245 false, 2246 getLoc(currentAttrStartIndex, currentAttrEndIndex), 2247 0, 2248 expParseMode 2249 ); 2250 if (currentProp.name === "for") { 2251 currentProp.forParseResult = parseForExpression(currentProp.exp); 2252 } 2253 let syncIndex = -1; 2254 if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.indexOf("sync")) > -1 && checkCompatEnabled( 2255 "COMPILER_V_BIND_SYNC", 2256 currentOptions, 2257 currentProp.loc, 2258 currentProp.rawName 2259 )) { 2260 currentProp.name = "model"; 2261 currentProp.modifiers.splice(syncIndex, 1); 2262 } 2263 } 2264 } 2265 if (currentProp.type !== 7 || currentProp.name !== "pre") { 2266 currentOpenTag.props.push(currentProp); 2267 } 2268 } 2269 currentAttrValue = ""; 2270 currentAttrStartIndex = currentAttrEndIndex = -1; 2271 }, 2272 oncomment(start, end) { 2273 if (currentOptions.comments) { 2274 addNode({ 2275 type: 3, 2276 content: getSlice(start, end), 2277 loc: getLoc(start - 4, end + 3) 2278 }); 2279 } 2280 }, 2281 onend() { 2282 const end = currentInput.length; 2283 if (( true) && tokenizer.state !== 1) { 2284 switch (tokenizer.state) { 2285 case 5: 2286 case 8: 2287 emitError(5, end); 2288 break; 2289 case 3: 2290 case 4: 2291 emitError( 2292 25, 2293 tokenizer.sectionStart 2294 ); 2295 break; 2296 case 28: 2297 if (tokenizer.currentSequence === Sequences.CdataEnd) { 2298 emitError(6, end); 2299 } else { 2300 emitError(7, end); 2301 } 2302 break; 2303 case 6: 2304 case 7: 2305 case 9: 2306 case 11: 2307 case 12: 2308 case 13: 2309 case 14: 2310 case 15: 2311 case 16: 2312 case 17: 2313 case 18: 2314 case 19: 2315 case 20: 2316 case 21: 2317 emitError(9, end); 2318 break; 2319 } 2320 } 2321 for (let index = 0; index < stack.length; index++) { 2322 onCloseTag(stack[index], end - 1); 2323 emitError(24, stack[index].loc.start.offset); 2324 } 2325 }, 2326 oncdata(start, end) { 2327 if (stack[0].ns !== 0) { 2328 onText(getSlice(start, end), start, end); 2329 } else { 2330 emitError(1, start - 9); 2331 } 2332 }, 2333 onprocessinginstruction(start) { 2334 if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { 2335 emitError( 2336 21, 2337 start - 1 2338 ); 2339 } 2340 } 2341}); 2342const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; 2343const stripParensRE = /^\(|\)$/g; 2344function parseForExpression(input) { 2345 const loc = input.loc; 2346 const exp = input.content; 2347 const inMatch = exp.match(forAliasRE); 2348 if (!inMatch) 2349 return; 2350 const [, LHS, RHS] = inMatch; 2351 const createAliasExpression = (content, offset, asParam = false) => { 2352 const start = loc.start.offset + offset; 2353 const end = start + content.length; 2354 return createExp( 2355 content, 2356 false, 2357 getLoc(start, end), 2358 0, 2359 asParam ? 1 /* Params */ : 0 /* Normal */ 2360 ); 2361 }; 2362 const result = { 2363 source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), 2364 value: void 0, 2365 key: void 0, 2366 index: void 0, 2367 finalized: false 2368 }; 2369 let valueContent = LHS.trim().replace(stripParensRE, "").trim(); 2370 const trimmedOffset = LHS.indexOf(valueContent); 2371 const iteratorMatch = valueContent.match(forIteratorRE); 2372 if (iteratorMatch) { 2373 valueContent = valueContent.replace(forIteratorRE, "").trim(); 2374 const keyContent = iteratorMatch[1].trim(); 2375 let keyOffset; 2376 if (keyContent) { 2377 keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); 2378 result.key = createAliasExpression(keyContent, keyOffset, true); 2379 } 2380 if (iteratorMatch[2]) { 2381 const indexContent = iteratorMatch[2].trim(); 2382 if (indexContent) { 2383 result.index = createAliasExpression( 2384 indexContent, 2385 exp.indexOf( 2386 indexContent, 2387 result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length 2388 ), 2389 true 2390 ); 2391 } 2392 } 2393 } 2394 if (valueContent) { 2395 result.value = createAliasExpression(valueContent, trimmedOffset, true); 2396 } 2397 return result; 2398} 2399function getSlice(start, end) { 2400 return currentInput.slice(start, end); 2401} 2402function endOpenTag(end) { 2403 if (tokenizer.inSFCRoot) { 2404 currentOpenTag.innerLoc = getLoc(end + 1, end + 1); 2405 } 2406 addNode(currentOpenTag); 2407 const { tag, ns } = currentOpenTag; 2408 if (ns === 0 && currentOptions.isPreTag(tag)) { 2409 inPre++; 2410 } 2411 if (currentOptions.isVoidTag(tag)) { 2412 onCloseTag(currentOpenTag, end); 2413 } else { 2414 stack.unshift(currentOpenTag); 2415 if (ns === 1 || ns === 2) { 2416 tokenizer.inXML = true; 2417 } 2418 } 2419 currentOpenTag = null; 2420} 2421function onText(content, start, end) { 2422 var _a; 2423 { 2424 const tag = (_a = stack[0]) == null ? void 0 : _a.tag; 2425 if (tag !== "script" && tag !== "style" && content.includes("&")) { 2426 content = currentOptions.decodeEntities(content, false); 2427 } 2428 } 2429 const parent = stack[0] || currentRoot; 2430 const lastNode = parent.children[parent.children.length - 1]; 2431 if ((lastNode == null ? void 0 : lastNode.type) === 2) { 2432 lastNode.content += content; 2433 setLocEnd(lastNode.loc, end); 2434 } else { 2435 parent.children.push({ 2436 type: 2, 2437 content, 2438 loc: getLoc(start, end) 2439 }); 2440 } 2441} 2442function onCloseTag(el, end, isImplied = false) { 2443 if (isImplied) { 2444 setLocEnd(el.loc, backTrack(end, 60)); 2445 } else { 2446 setLocEnd(el.loc, end + 1); 2447 } 2448 if (tokenizer.inSFCRoot) { 2449 if (el.children.length) { 2450 el.innerLoc.end = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, el.children[el.children.length - 1].loc.end); 2451 } else { 2452 el.innerLoc.end = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, el.innerLoc.start); 2453 } 2454 el.innerLoc.source = getSlice( 2455 el.innerLoc.start.offset, 2456 el.innerLoc.end.offset 2457 ); 2458 } 2459 const { tag, ns } = el; 2460 if (!inVPre) { 2461 if (tag === "slot") { 2462 el.tagType = 2; 2463 } else if (isFragmentTemplate(el)) { 2464 el.tagType = 3; 2465 } else if (isComponent(el)) { 2466 el.tagType = 1; 2467 } 2468 } 2469 if (!tokenizer.inRCDATA) { 2470 el.children = condenseWhitespace(el.children, el.tag); 2471 } 2472 if (ns === 0 && currentOptions.isPreTag(tag)) { 2473 inPre--; 2474 } 2475 if (currentVPreBoundary === el) { 2476 inVPre = tokenizer.inVPre = false; 2477 currentVPreBoundary = null; 2478 } 2479 if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { 2480 tokenizer.inXML = false; 2481 } 2482 { 2483 const props = el.props; 2484 if ( true && isCompatEnabled( 2485 "COMPILER_V_IF_V_FOR_PRECEDENCE", 2486 currentOptions 2487 )) { 2488 let hasIf = false; 2489 let hasFor = false; 2490 for (let i = 0; i < props.length; i++) { 2491 const p = props[i]; 2492 if (p.type === 7) { 2493 if (p.name === "if") { 2494 hasIf = true; 2495 } else if (p.name === "for") { 2496 hasFor = true; 2497 } 2498 } 2499 if (hasIf && hasFor) { 2500 warnDeprecation( 2501 "COMPILER_V_IF_V_FOR_PRECEDENCE", 2502 currentOptions, 2503 el.loc 2504 ); 2505 break; 2506 } 2507 } 2508 } 2509 if (isCompatEnabled( 2510 "COMPILER_NATIVE_TEMPLATE", 2511 currentOptions 2512 ) && el.tag === "template" && !isFragmentTemplate(el)) { 2513 true && warnDeprecation( 2514 "COMPILER_NATIVE_TEMPLATE", 2515 currentOptions, 2516 el.loc 2517 ); 2518 const parent = stack[0] || currentRoot; 2519 const index = parent.children.indexOf(el); 2520 parent.children.splice(index, 1, ...el.children); 2521 } 2522 const inlineTemplateProp = props.find( 2523 (p) => p.type === 6 && p.name === "inline-template" 2524 ); 2525 if (inlineTemplateProp && checkCompatEnabled( 2526 "COMPILER_INLINE_TEMPLATE", 2527 currentOptions, 2528 inlineTemplateProp.loc 2529 ) && el.children.length) { 2530 inlineTemplateProp.value = { 2531 type: 2, 2532 content: getSlice( 2533 el.children[0].loc.start.offset, 2534 el.children[el.children.length - 1].loc.end.offset 2535 ), 2536 loc: inlineTemplateProp.loc 2537 }; 2538 } 2539 } 2540} 2541function backTrack(index, c) { 2542 let i = index; 2543 while (currentInput.charCodeAt(i) !== c && i >= 0) 2544 i--; 2545 return i; 2546} 2547const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); 2548function isFragmentTemplate({ tag, props }) { 2549 if (tag === "template") { 2550 for (let i = 0; i < props.length; i++) { 2551 if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { 2552 return true; 2553 } 2554 } 2555 } 2556 return false; 2557} 2558function isComponent({ tag, props }) { 2559 var _a; 2560 if (currentOptions.isCustomElement(tag)) { 2561 return false; 2562 } 2563 if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || ((_a = currentOptions.isBuiltInComponent) == null ? void 0 : _a.call(currentOptions, tag)) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { 2564 return true; 2565 } 2566 for (let i = 0; i < props.length; i++) { 2567 const p = props[i]; 2568 if (p.type === 6) { 2569 if (p.name === "is" && p.value) { 2570 if (p.value.content.startsWith("vue:")) { 2571 return true; 2572 } else if (checkCompatEnabled( 2573 "COMPILER_IS_ON_ELEMENT", 2574 currentOptions, 2575 p.loc 2576 )) { 2577 return true; 2578 } 2579 } 2580 } else if (// :is on plain element - only treat as component in compat mode 2581 p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled( 2582 "COMPILER_IS_ON_ELEMENT", 2583 currentOptions, 2584 p.loc 2585 )) { 2586 return true; 2587 } 2588 } 2589 return false; 2590} 2591function isUpperCase(c) { 2592 return c > 64 && c < 91; 2593} 2594const windowsNewlineRE = /\r\n/g; 2595function condenseWhitespace(nodes, tag) { 2596 var _a, _b; 2597 const shouldCondense = currentOptions.whitespace !== "preserve"; 2598 let removedWhitespace = false; 2599 for (let i = 0; i < nodes.length; i++) { 2600 const node = nodes[i]; 2601 if (node.type === 2) { 2602 if (!inPre) { 2603 if (isAllWhitespace(node.content)) { 2604 const prev = (_a = nodes[i - 1]) == null ? void 0 : _a.type; 2605 const next = (_b = nodes[i + 1]) == null ? void 0 : _b.type; 2606 if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { 2607 removedWhitespace = true; 2608 nodes[i] = null; 2609 } else { 2610 node.content = " "; 2611 } 2612 } else if (shouldCondense) { 2613 node.content = condense(node.content); 2614 } 2615 } else { 2616 node.content = node.content.replace(windowsNewlineRE, "\n"); 2617 } 2618 } 2619 } 2620 if (inPre && tag && currentOptions.isPreTag(tag)) { 2621 const first = nodes[0]; 2622 if (first && first.type === 2) { 2623 first.content = first.content.replace(/^\r?\n/, ""); 2624 } 2625 } 2626 return removedWhitespace ? nodes.filter(Boolean) : nodes; 2627} 2628function isAllWhitespace(str) { 2629 for (let i = 0; i < str.length; i++) { 2630 if (!isWhitespace(str.charCodeAt(i))) { 2631 return false; 2632 } 2633 } 2634 return true; 2635} 2636function hasNewlineChar(str) { 2637 for (let i = 0; i < str.length; i++) { 2638 const c = str.charCodeAt(i); 2639 if (c === 10 || c === 13) { 2640 return true; 2641 } 2642 } 2643 return false; 2644} 2645function condense(str) { 2646 let ret = ""; 2647 let prevCharIsWhitespace = false; 2648 for (let i = 0; i < str.length; i++) { 2649 if (isWhitespace(str.charCodeAt(i))) { 2650 if (!prevCharIsWhitespace) { 2651 ret += " "; 2652 prevCharIsWhitespace = true; 2653 } 2654 } else { 2655 ret += str[i]; 2656 prevCharIsWhitespace = false; 2657 } 2658 } 2659 return ret; 2660} 2661function addNode(node) { 2662 (stack[0] || currentRoot).children.push(node); 2663} 2664function getLoc(start, end) { 2665 return { 2666 start: tokenizer.getPos(start), 2667 // @ts-expect-error allow late attachment 2668 end: end == null ? end : tokenizer.getPos(end), 2669 // @ts-expect-error allow late attachment 2670 source: end == null ? end : getSlice(start, end) 2671 }; 2672} 2673function setLocEnd(loc, end) { 2674 loc.end = tokenizer.getPos(end); 2675 loc.source = getSlice(loc.start.offset, end); 2676} 2677function dirToAttr(dir) { 2678 const attr = { 2679 type: 6, 2680 name: dir.rawName, 2681 nameLoc: getLoc( 2682 dir.loc.start.offset, 2683 dir.loc.start.offset + dir.rawName.length 2684 ), 2685 value: void 0, 2686 loc: dir.loc 2687 }; 2688 if (dir.exp) { 2689 const loc = dir.exp.loc; 2690 if (loc.end.offset < dir.loc.end.offset) { 2691 loc.start.offset--; 2692 loc.start.column--; 2693 loc.end.offset++; 2694 loc.end.column++; 2695 } 2696 attr.value = { 2697 type: 2, 2698 content: dir.exp.content, 2699 loc 2700 }; 2701 } 2702 return attr; 2703} 2704function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { 2705 const exp = createSimpleExpression(content, isStatic, loc, constType); 2706 return exp; 2707} 2708function emitError(code, index, message) { 2709 currentOptions.onError( 2710 createCompilerError(code, getLoc(index, index), void 0, message) 2711 ); 2712} 2713function reset() { 2714 tokenizer.reset(); 2715 currentOpenTag = null; 2716 currentProp = null; 2717 currentAttrValue = ""; 2718 currentAttrStartIndex = -1; 2719 currentAttrEndIndex = -1; 2720 stack.length = 0; 2721} 2722function baseParse(input, options) { 2723 reset(); 2724 currentInput = input; 2725 currentOptions = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, defaultParserOptions); 2726 if (options) { 2727 let key; 2728 for (key in options) { 2729 if (options[key] != null) { 2730 currentOptions[key] = options[key]; 2731 } 2732 } 2733 } 2734 if (true) { 2735 if (!currentOptions.decodeEntities) { 2736 throw new Error( 2737 `[@vue/compiler-core] decodeEntities option is required in browser builds.` 2738 ); 2739 } 2740 } 2741 tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; 2742 tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; 2743 const delimiters = options == null ? void 0 : options.delimiters; 2744 if (delimiters) { 2745 tokenizer.delimiterOpen = toCharCodes(delimiters[0]); 2746 tokenizer.delimiterClose = toCharCodes(delimiters[1]); 2747 } 2748 const root = currentRoot = createRoot([], input); 2749 tokenizer.parse(currentInput); 2750 root.loc = getLoc(0, input.length); 2751 root.children = condenseWhitespace(root.children); 2752 currentRoot = null; 2753 return root; 2754} 2755 2756function hoistStatic(root, context) { 2757 walk( 2758 root, 2759 context, 2760 // Root node is unfortunately non-hoistable due to potential parent 2761 // fallthrough attributes. 2762 isSingleElementRoot(root, root.children[0]) 2763 ); 2764} 2765function isSingleElementRoot(root, child) { 2766 const { children } = root; 2767 return children.length === 1 && child.type === 1 && !isSlotOutlet(child); 2768} 2769function walk(node, context, doNotHoistNode = false) { 2770 const { children } = node; 2771 const originalCount = children.length; 2772 let hoistedCount = 0; 2773 for (let i = 0; i < children.length; i++) { 2774 const child = children[i]; 2775 if (child.type === 1 && child.tagType === 0) { 2776 const constantType = doNotHoistNode ? 0 : getConstantType(child, context); 2777 if (constantType > 0) { 2778 if (constantType >= 2) { 2779 child.codegenNode.patchFlag = -1 + ( true ? ` /* HOISTED */` : 0); 2780 child.codegenNode = context.hoist(child.codegenNode); 2781 hoistedCount++; 2782 continue; 2783 } 2784 } else { 2785 const codegenNode = child.codegenNode; 2786 if (codegenNode.type === 13) { 2787 const flag = getPatchFlag(codegenNode); 2788 if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { 2789 const props = getNodeProps(child); 2790 if (props) { 2791 codegenNode.props = context.hoist(props); 2792 } 2793 } 2794 if (codegenNode.dynamicProps) { 2795 codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); 2796 } 2797 } 2798 } 2799 } 2800 if (child.type === 1) { 2801 const isComponent = child.tagType === 1; 2802 if (isComponent) { 2803 context.scopes.vSlot++; 2804 } 2805 walk(child, context); 2806 if (isComponent) { 2807 context.scopes.vSlot--; 2808 } 2809 } else if (child.type === 11) { 2810 walk(child, context, child.children.length === 1); 2811 } else if (child.type === 9) { 2812 for (let i2 = 0; i2 < child.branches.length; i2++) { 2813 walk( 2814 child.branches[i2], 2815 context, 2816 child.branches[i2].children.length === 1 2817 ); 2818 } 2819 } 2820 } 2821 if (hoistedCount && context.transformHoist) { 2822 context.transformHoist(children, context, node); 2823 } 2824 if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(node.codegenNode.children)) { 2825 const hoisted = context.hoist( 2826 createArrayExpression(node.codegenNode.children) 2827 ); 2828 if (context.hmr) { 2829 hoisted.content = `[...${hoisted.content}]`; 2830 } 2831 node.codegenNode.children = hoisted; 2832 } 2833} 2834function getConstantType(node, context) { 2835 const { constantCache } = context; 2836 switch (node.type) { 2837 case 1: 2838 if (node.tagType !== 0) { 2839 return 0; 2840 } 2841 const cached = constantCache.get(node); 2842 if (cached !== void 0) { 2843 return cached; 2844 } 2845 const codegenNode = node.codegenNode; 2846 if (codegenNode.type !== 13) { 2847 return 0; 2848 } 2849 if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") { 2850 return 0; 2851 } 2852 const flag = getPatchFlag(codegenNode); 2853 if (!flag) { 2854 let returnType2 = 3; 2855 const generatedPropsType = getGeneratedPropsConstantType(node, context); 2856 if (generatedPropsType === 0) { 2857 constantCache.set(node, 0); 2858 return 0; 2859 } 2860 if (generatedPropsType < returnType2) { 2861 returnType2 = generatedPropsType; 2862 } 2863 for (let i = 0; i < node.children.length; i++) { 2864 const childType = getConstantType(node.children[i], context); 2865 if (childType === 0) { 2866 constantCache.set(node, 0); 2867 return 0; 2868 } 2869 if (childType < returnType2) { 2870 returnType2 = childType; 2871 } 2872 } 2873 if (returnType2 > 1) { 2874 for (let i = 0; i < node.props.length; i++) { 2875 const p = node.props[i]; 2876 if (p.type === 7 && p.name === "bind" && p.exp) { 2877 const expType = getConstantType(p.exp, context); 2878 if (expType === 0) { 2879 constantCache.set(node, 0); 2880 return 0; 2881 } 2882 if (expType < returnType2) { 2883 returnType2 = expType; 2884 } 2885 } 2886 } 2887 } 2888 if (codegenNode.isBlock) { 2889 for (let i = 0; i < node.props.length; i++) { 2890 const p = node.props[i]; 2891 if (p.type === 7) { 2892 constantCache.set(node, 0); 2893 return 0; 2894 } 2895 } 2896 context.removeHelper(OPEN_BLOCK); 2897 context.removeHelper( 2898 getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) 2899 ); 2900 codegenNode.isBlock = false; 2901 context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); 2902 } 2903 constantCache.set(node, returnType2); 2904 return returnType2; 2905 } else { 2906 constantCache.set(node, 0); 2907 return 0; 2908 } 2909 case 2: 2910 case 3: 2911 return 3; 2912 case 9: 2913 case 11: 2914 case 10: 2915 return 0; 2916 case 5: 2917 case 12: 2918 return getConstantType(node.content, context); 2919 case 4: 2920 return node.constType; 2921 case 8: 2922 let returnType = 3; 2923 for (let i = 0; i < node.children.length; i++) { 2924 const child = node.children[i]; 2925 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(child)) { 2926 continue; 2927 } 2928 const childType = getConstantType(child, context); 2929 if (childType === 0) { 2930 return 0; 2931 } else if (childType < returnType) { 2932 returnType = childType; 2933 } 2934 } 2935 return returnType; 2936 default: 2937 if (true) ; 2938 return 0; 2939 } 2940} 2941const allowHoistedHelperSet = /* @__PURE__ */ new Set([ 2942 NORMALIZE_CLASS, 2943 NORMALIZE_STYLE, 2944 NORMALIZE_PROPS, 2945 GUARD_REACTIVE_PROPS 2946]); 2947function getConstantTypeOfHelperCall(value, context) { 2948 if (value.type === 14 && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(value.callee) && allowHoistedHelperSet.has(value.callee)) { 2949 const arg = value.arguments[0]; 2950 if (arg.type === 4) { 2951 return getConstantType(arg, context); 2952 } else if (arg.type === 14) { 2953 return getConstantTypeOfHelperCall(arg, context); 2954 } 2955 } 2956 return 0; 2957} 2958function getGeneratedPropsConstantType(node, context) { 2959 let returnType = 3; 2960 const props = getNodeProps(node); 2961 if (props && props.type === 15) { 2962 const { properties } = props; 2963 for (let i = 0; i < properties.length; i++) { 2964 const { key, value } = properties[i]; 2965 const keyType = getConstantType(key, context); 2966 if (keyType === 0) { 2967 return keyType; 2968 } 2969 if (keyType < returnType) { 2970 returnType = keyType; 2971 } 2972 let valueType; 2973 if (value.type === 4) { 2974 valueType = getConstantType(value, context); 2975 } else if (value.type === 14) { 2976 valueType = getConstantTypeOfHelperCall(value, context); 2977 } else { 2978 valueType = 0; 2979 } 2980 if (valueType === 0) { 2981 return valueType; 2982 } 2983 if (valueType < returnType) { 2984 returnType = valueType; 2985 } 2986 } 2987 } 2988 return returnType; 2989} 2990function getNodeProps(node) { 2991 const codegenNode = node.codegenNode; 2992 if (codegenNode.type === 13) { 2993 return codegenNode.props; 2994 } 2995} 2996function getPatchFlag(node) { 2997 const flag = node.patchFlag; 2998 return flag ? parseInt(flag, 10) : void 0; 2999} 3000 3001function createTransformContext(root, { 3002 filename = "", 3003 prefixIdentifiers = false, 3004 hoistStatic: hoistStatic2 = false, 3005 hmr = false, 3006 cacheHandlers = false, 3007 nodeTransforms = [], 3008 directiveTransforms = {}, 3009 transformHoist = null, 3010 isBuiltInComponent = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP, 3011 isCustomElement = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP, 3012 expressionPlugins = [], 3013 scopeId = null, 3014 slotted = true, 3015 ssr = false, 3016 inSSR = false, 3017 ssrCssVars = ``, 3018 bindingMetadata = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ, 3019 inline = false, 3020 isTS = false, 3021 onError = defaultOnError, 3022 onWarn = defaultOnWarn, 3023 compatConfig 3024}) { 3025 const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); 3026 const context = { 3027 // options 3028 filename, 3029 selfName: nameMatch && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.capitalize)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(nameMatch[1])), 3030 prefixIdentifiers, 3031 hoistStatic: hoistStatic2, 3032 hmr, 3033 cacheHandlers, 3034 nodeTransforms, 3035 directiveTransforms, 3036 transformHoist, 3037 isBuiltInComponent, 3038 isCustomElement, 3039 expressionPlugins, 3040 scopeId, 3041 slotted, 3042 ssr, 3043 inSSR, 3044 ssrCssVars, 3045 bindingMetadata, 3046 inline, 3047 isTS, 3048 onError, 3049 onWarn, 3050 compatConfig, 3051 // state 3052 root, 3053 helpers: /* @__PURE__ */ new Map(), 3054 components: /* @__PURE__ */ new Set(), 3055 directives: /* @__PURE__ */ new Set(), 3056 hoists: [], 3057 imports: [], 3058 constantCache: /* @__PURE__ */ new WeakMap(), 3059 temps: 0, 3060 cached: 0, 3061 identifiers: /* @__PURE__ */ Object.create(null), 3062 scopes: { 3063 vFor: 0, 3064 vSlot: 0, 3065 vPre: 0, 3066 vOnce: 0 3067 }, 3068 parent: null, 3069 currentNode: root, 3070 childIndex: 0, 3071 inVOnce: false, 3072 // methods 3073 helper(name) { 3074 const count = context.helpers.get(name) || 0; 3075 context.helpers.set(name, count + 1); 3076 return name; 3077 }, 3078 removeHelper(name) { 3079 const count = context.helpers.get(name); 3080 if (count) { 3081 const currentCount = count - 1; 3082 if (!currentCount) { 3083 context.helpers.delete(name); 3084 } else { 3085 context.helpers.set(name, currentCount); 3086 } 3087 } 3088 }, 3089 helperString(name) { 3090 return `_${helperNameMap[context.helper(name)]}`; 3091 }, 3092 replaceNode(node) { 3093 if (true) { 3094 if (!context.currentNode) { 3095 throw new Error(`Node being replaced is already removed.`); 3096 } 3097 if (!context.parent) { 3098 throw new Error(`Cannot replace root node.`); 3099 } 3100 } 3101 context.parent.children[context.childIndex] = context.currentNode = node; 3102 }, 3103 removeNode(node) { 3104 if ( true && !context.parent) { 3105 throw new Error(`Cannot remove root node.`); 3106 } 3107 const list = context.parent.children; 3108 const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; 3109 if ( true && removalIndex < 0) { 3110 throw new Error(`node being removed is not a child of current parent`); 3111 } 3112 if (!node || node === context.currentNode) { 3113 context.currentNode = null; 3114 context.onNodeRemoved(); 3115 } else { 3116 if (context.childIndex > removalIndex) { 3117 context.childIndex--; 3118 context.onNodeRemoved(); 3119 } 3120 } 3121 context.parent.children.splice(removalIndex, 1); 3122 }, 3123 onNodeRemoved: () => { 3124 }, 3125 addIdentifiers(exp) { 3126 }, 3127 removeIdentifiers(exp) { 3128 }, 3129 hoist(exp) { 3130 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(exp)) 3131 exp = createSimpleExpression(exp); 3132 context.hoists.push(exp); 3133 const identifier = createSimpleExpression( 3134 `_hoisted_${context.hoists.length}`, 3135 false, 3136 exp.loc, 3137 2 3138 ); 3139 identifier.hoisted = exp; 3140 return identifier; 3141 }, 3142 cache(exp, isVNode = false) { 3143 return createCacheExpression(context.cached++, exp, isVNode); 3144 } 3145 }; 3146 { 3147 context.filters = /* @__PURE__ */ new Set(); 3148 } 3149 return context; 3150} 3151function transform(root, options) { 3152 const context = createTransformContext(root, options); 3153 traverseNode(root, context); 3154 if (options.hoistStatic) { 3155 hoistStatic(root, context); 3156 } 3157 if (!options.ssr) { 3158 createRootCodegen(root, context); 3159 } 3160 root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); 3161 root.components = [...context.components]; 3162 root.directives = [...context.directives]; 3163 root.imports = context.imports; 3164 root.hoists = context.hoists; 3165 root.temps = context.temps; 3166 root.cached = context.cached; 3167 root.transformed = true; 3168 { 3169 root.filters = [...context.filters]; 3170 } 3171} 3172function createRootCodegen(root, context) { 3173 const { helper } = context; 3174 const { children } = root; 3175 if (children.length === 1) { 3176 const child = children[0]; 3177 if (isSingleElementRoot(root, child) && child.codegenNode) { 3178 const codegenNode = child.codegenNode; 3179 if (codegenNode.type === 13) { 3180 convertToBlock(codegenNode, context); 3181 } 3182 root.codegenNode = codegenNode; 3183 } else { 3184 root.codegenNode = child; 3185 } 3186 } else if (children.length > 1) { 3187 let patchFlag = 64; 3188 let patchFlagText = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]; 3189 if ( true && children.filter((c) => c.type !== 3).length === 1) { 3190 patchFlag |= 2048; 3191 patchFlagText += `, ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[2048]}`; 3192 } 3193 root.codegenNode = createVNodeCall( 3194 context, 3195 helper(FRAGMENT), 3196 void 0, 3197 root.children, 3198 patchFlag + ( true ? ` /* ${patchFlagText} */` : 0), 3199 void 0, 3200 void 0, 3201 true, 3202 void 0, 3203 false 3204 ); 3205 } else ; 3206} 3207function traverseChildren(parent, context) { 3208 let i = 0; 3209 const nodeRemoved = () => { 3210 i--; 3211 }; 3212 for (; i < parent.children.length; i++) { 3213 const child = parent.children[i]; 3214 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child)) 3215 continue; 3216 context.parent = parent; 3217 context.childIndex = i; 3218 context.onNodeRemoved = nodeRemoved; 3219 traverseNode(child, context); 3220 } 3221} 3222function traverseNode(node, context) { 3223 context.currentNode = node; 3224 const { nodeTransforms } = context; 3225 const exitFns = []; 3226 for (let i2 = 0; i2 < nodeTransforms.length; i2++) { 3227 const onExit = nodeTransforms[i2](node, context); 3228 if (onExit) { 3229 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(onExit)) { 3230 exitFns.push(...onExit); 3231 } else { 3232 exitFns.push(onExit); 3233 } 3234 } 3235 if (!context.currentNode) { 3236 return; 3237 } else { 3238 node = context.currentNode; 3239 } 3240 } 3241 switch (node.type) { 3242 case 3: 3243 if (!context.ssr) { 3244 context.helper(CREATE_COMMENT); 3245 } 3246 break; 3247 case 5: 3248 if (!context.ssr) { 3249 context.helper(TO_DISPLAY_STRING); 3250 } 3251 break; 3252 case 9: 3253 for (let i2 = 0; i2 < node.branches.length; i2++) { 3254 traverseNode(node.branches[i2], context); 3255 } 3256 break; 3257 case 10: 3258 case 11: 3259 case 1: 3260 case 0: 3261 traverseChildren(node, context); 3262 break; 3263 } 3264 context.currentNode = node; 3265 let i = exitFns.length; 3266 while (i--) { 3267 exitFns[i](); 3268 } 3269} 3270function createStructuralDirectiveTransform(name, fn) { 3271 const matches = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(name) ? (n) => n === name : (n) => name.test(n); 3272 return (node, context) => { 3273 if (node.type === 1) { 3274 const { props } = node; 3275 if (node.tagType === 3 && props.some(isVSlot)) { 3276 return; 3277 } 3278 const exitFns = []; 3279 for (let i = 0; i < props.length; i++) { 3280 const prop = props[i]; 3281 if (prop.type === 7 && matches(prop.name)) { 3282 props.splice(i, 1); 3283 i--; 3284 const onExit = fn(node, prop, context); 3285 if (onExit) 3286 exitFns.push(onExit); 3287 } 3288 } 3289 return exitFns; 3290 } 3291 }; 3292} 3293 3294const PURE_ANNOTATION = `/*#__PURE__*/`; 3295const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; 3296function createCodegenContext(ast, { 3297 mode = "function", 3298 prefixIdentifiers = mode === "module", 3299 sourceMap = false, 3300 filename = `template.vue.html`, 3301 scopeId = null, 3302 optimizeImports = false, 3303 runtimeGlobalName = `Vue`, 3304 runtimeModuleName = `vue`, 3305 ssrRuntimeModuleName = "vue/server-renderer", 3306 ssr = false, 3307 isTS = false, 3308 inSSR = false 3309}) { 3310 const context = { 3311 mode, 3312 prefixIdentifiers, 3313 sourceMap, 3314 filename, 3315 scopeId, 3316 optimizeImports, 3317 runtimeGlobalName, 3318 runtimeModuleName, 3319 ssrRuntimeModuleName, 3320 ssr, 3321 isTS, 3322 inSSR, 3323 source: ast.source, 3324 code: ``, 3325 column: 1, 3326 line: 1, 3327 offset: 0, 3328 indentLevel: 0, 3329 pure: false, 3330 map: void 0, 3331 helper(key) { 3332 return `_${helperNameMap[key]}`; 3333 }, 3334 push(code, newlineIndex = -2 /* None */, node) { 3335 context.code += code; 3336 }, 3337 indent() { 3338 newline(++context.indentLevel); 3339 }, 3340 deindent(withoutNewLine = false) { 3341 if (withoutNewLine) { 3342 --context.indentLevel; 3343 } else { 3344 newline(--context.indentLevel); 3345 } 3346 }, 3347 newline() { 3348 newline(context.indentLevel); 3349 } 3350 }; 3351 function newline(n) { 3352 context.push("\n" + ` `.repeat(n), 0 /* Start */); 3353 } 3354 return context; 3355} 3356function generate(ast, options = {}) { 3357 const context = createCodegenContext(ast, options); 3358 if (options.onContextCreated) 3359 options.onContextCreated(context); 3360 const { 3361 mode, 3362 push, 3363 prefixIdentifiers, 3364 indent, 3365 deindent, 3366 newline, 3367 scopeId, 3368 ssr 3369 } = context; 3370 const helpers = Array.from(ast.helpers); 3371 const hasHelpers = helpers.length > 0; 3372 const useWithBlock = !prefixIdentifiers && mode !== "module"; 3373 const isSetupInlined = false; 3374 const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context; 3375 { 3376 genFunctionPreamble(ast, preambleContext); 3377 } 3378 const functionName = ssr ? `ssrRender` : `render`; 3379 const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; 3380 const signature = args.join(", "); 3381 { 3382 push(`function ${functionName}(${signature}) {`); 3383 } 3384 indent(); 3385 if (useWithBlock) { 3386 push(`with (_ctx) {`); 3387 indent(); 3388 if (hasHelpers) { 3389 push( 3390 `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue 3391`, 3392 -1 /* End */ 3393 ); 3394 newline(); 3395 } 3396 } 3397 if (ast.components.length) { 3398 genAssets(ast.components, "component", context); 3399 if (ast.directives.length || ast.temps > 0) { 3400 newline(); 3401 } 3402 } 3403 if (ast.directives.length) { 3404 genAssets(ast.directives, "directive", context); 3405 if (ast.temps > 0) { 3406 newline(); 3407 } 3408 } 3409 if (ast.filters && ast.filters.length) { 3410 newline(); 3411 genAssets(ast.filters, "filter", context); 3412 newline(); 3413 } 3414 if (ast.temps > 0) { 3415 push(`let `); 3416 for (let i = 0; i < ast.temps; i++) { 3417 push(`${i > 0 ? `, ` : ``}_temp${i}`); 3418 } 3419 } 3420 if (ast.components.length || ast.directives.length || ast.temps) { 3421 push(` 3422`, 0 /* Start */); 3423 newline(); 3424 } 3425 if (!ssr) { 3426 push(`return `); 3427 } 3428 if (ast.codegenNode) { 3429 genNode(ast.codegenNode, context); 3430 } else { 3431 push(`null`); 3432 } 3433 if (useWithBlock) { 3434 deindent(); 3435 push(`}`); 3436 } 3437 deindent(); 3438 push(`}`); 3439 return { 3440 ast, 3441 code: context.code, 3442 preamble: isSetupInlined ? preambleContext.code : ``, 3443 map: context.map ? context.map.toJSON() : void 0 3444 }; 3445} 3446function genFunctionPreamble(ast, context) { 3447 const { 3448 ssr, 3449 prefixIdentifiers, 3450 push, 3451 newline, 3452 runtimeModuleName, 3453 runtimeGlobalName, 3454 ssrRuntimeModuleName 3455 } = context; 3456 const VueBinding = runtimeGlobalName; 3457 const helpers = Array.from(ast.helpers); 3458 if (helpers.length > 0) { 3459 { 3460 push(`const _Vue = ${VueBinding} 3461`, -1 /* End */); 3462 if (ast.hoists.length) { 3463 const staticHelpers = [ 3464 CREATE_VNODE, 3465 CREATE_ELEMENT_VNODE, 3466 CREATE_COMMENT, 3467 CREATE_TEXT, 3468 CREATE_STATIC 3469 ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); 3470 push(`const { ${staticHelpers} } = _Vue 3471`, -1 /* End */); 3472 } 3473 } 3474 } 3475 genHoists(ast.hoists, context); 3476 newline(); 3477 push(`return `); 3478} 3479function genAssets(assets, type, { helper, push, newline, isTS }) { 3480 const resolver = helper( 3481 type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE 3482 ); 3483 for (let i = 0; i < assets.length; i++) { 3484 let id = assets[i]; 3485 const maybeSelfReference = id.endsWith("__self"); 3486 if (maybeSelfReference) { 3487 id = id.slice(0, -6); 3488 } 3489 push( 3490 `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` 3491 ); 3492 if (i < assets.length - 1) { 3493 newline(); 3494 } 3495 } 3496} 3497function genHoists(hoists, context) { 3498 if (!hoists.length) { 3499 return; 3500 } 3501 context.pure = true; 3502 const { push, newline, helper, scopeId, mode } = context; 3503 newline(); 3504 for (let i = 0; i < hoists.length; i++) { 3505 const exp = hoists[i]; 3506 if (exp) { 3507 push( 3508 `const _hoisted_${i + 1} = ${``}` 3509 ); 3510 genNode(exp, context); 3511 newline(); 3512 } 3513 } 3514 context.pure = false; 3515} 3516function isText(n) { 3517 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; 3518} 3519function genNodeListAsArray(nodes, context) { 3520 const multilines = nodes.length > 3 || true && nodes.some((n) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(n) || !isText(n)); 3521 context.push(`[`); 3522 multilines && context.indent(); 3523 genNodeList(nodes, context, multilines); 3524 multilines && context.deindent(); 3525 context.push(`]`); 3526} 3527function genNodeList(nodes, context, multilines = false, comma = true) { 3528 const { push, newline } = context; 3529 for (let i = 0; i < nodes.length; i++) { 3530 const node = nodes[i]; 3531 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node)) { 3532 push(node, -3 /* Unknown */); 3533 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(node)) { 3534 genNodeListAsArray(node, context); 3535 } else { 3536 genNode(node, context); 3537 } 3538 if (i < nodes.length - 1) { 3539 if (multilines) { 3540 comma && push(","); 3541 newline(); 3542 } else { 3543 comma && push(", "); 3544 } 3545 } 3546 } 3547} 3548function genNode(node, context) { 3549 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node)) { 3550 context.push(node, -3 /* Unknown */); 3551 return; 3552 } 3553 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(node)) { 3554 context.push(context.helper(node)); 3555 return; 3556 } 3557 switch (node.type) { 3558 case 1: 3559 case 9: 3560 case 11: 3561 true && assert( 3562 node.codegenNode != null, 3563 `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` 3564 ); 3565 genNode(node.codegenNode, context); 3566 break; 3567 case 2: 3568 genText(node, context); 3569 break; 3570 case 4: 3571 genExpression(node, context); 3572 break; 3573 case 5: 3574 genInterpolation(node, context); 3575 break; 3576 case 12: 3577 genNode(node.codegenNode, context); 3578 break; 3579 case 8: 3580 genCompoundExpression(node, context); 3581 break; 3582 case 3: 3583 genComment(node, context); 3584 break; 3585 case 13: 3586 genVNodeCall(node, context); 3587 break; 3588 case 14: 3589 genCallExpression(node, context); 3590 break; 3591 case 15: 3592 genObjectExpression(node, context); 3593 break; 3594 case 17: 3595 genArrayExpression(node, context); 3596 break; 3597 case 18: 3598 genFunctionExpression(node, context); 3599 break; 3600 case 19: 3601 genConditionalExpression(node, context); 3602 break; 3603 case 20: 3604 genCacheExpression(node, context); 3605 break; 3606 case 21: 3607 genNodeList(node.body, context, true, false); 3608 break; 3609 case 22: 3610 break; 3611 case 23: 3612 break; 3613 case 24: 3614 break; 3615 case 25: 3616 break; 3617 case 26: 3618 break; 3619 case 10: 3620 break; 3621 default: 3622 if (true) { 3623 assert(false, `unhandled codegen node type: ${node.type}`); 3624 const exhaustiveCheck = node; 3625 return exhaustiveCheck; 3626 } 3627 } 3628} 3629function genText(node, context) { 3630 context.push(JSON.stringify(node.content), -3 /* Unknown */, node); 3631} 3632function genExpression(node, context) { 3633 const { content, isStatic } = node; 3634 context.push( 3635 isStatic ? JSON.stringify(content) : content, 3636 -3 /* Unknown */, 3637 node 3638 ); 3639} 3640function genInterpolation(node, context) { 3641 const { push, helper, pure } = context; 3642 if (pure) 3643 push(PURE_ANNOTATION); 3644 push(`${helper(TO_DISPLAY_STRING)}(`); 3645 genNode(node.content, context); 3646 push(`)`); 3647} 3648function genCompoundExpression(node, context) { 3649 for (let i = 0; i < node.children.length; i++) { 3650 const child = node.children[i]; 3651 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child)) { 3652 context.push(child, -3 /* Unknown */); 3653 } else { 3654 genNode(child, context); 3655 } 3656 } 3657} 3658function genExpressionAsPropertyKey(node, context) { 3659 const { push } = context; 3660 if (node.type === 8) { 3661 push(`[`); 3662 genCompoundExpression(node, context); 3663 push(`]`); 3664 } else if (node.isStatic) { 3665 const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); 3666 push(text, -2 /* None */, node); 3667 } else { 3668 push(`[${node.content}]`, -3 /* Unknown */, node); 3669 } 3670} 3671function genComment(node, context) { 3672 const { push, helper, pure } = context; 3673 if (pure) { 3674 push(PURE_ANNOTATION); 3675 } 3676 push( 3677 `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, 3678 -3 /* Unknown */, 3679 node 3680 ); 3681} 3682function genVNodeCall(node, context) { 3683 const { push, helper, pure } = context; 3684 const { 3685 tag, 3686 props, 3687 children, 3688 patchFlag, 3689 dynamicProps, 3690 directives, 3691 isBlock, 3692 disableTracking, 3693 isComponent 3694 } = node; 3695 if (directives) { 3696 push(helper(WITH_DIRECTIVES) + `(`); 3697 } 3698 if (isBlock) { 3699 push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); 3700 } 3701 if (pure) { 3702 push(PURE_ANNOTATION); 3703 } 3704 const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); 3705 push(helper(callHelper) + `(`, -2 /* None */, node); 3706 genNodeList( 3707 genNullableArgs([tag, props, children, patchFlag, dynamicProps]), 3708 context 3709 ); 3710 push(`)`); 3711 if (isBlock) { 3712 push(`)`); 3713 } 3714 if (directives) { 3715 push(`, `); 3716 genNode(directives, context); 3717 push(`)`); 3718 } 3719} 3720function genNullableArgs(args) { 3721 let i = args.length; 3722 while (i--) { 3723 if (args[i] != null) 3724 break; 3725 } 3726 return args.slice(0, i + 1).map((arg) => arg || `null`); 3727} 3728function genCallExpression(node, context) { 3729 const { push, helper, pure } = context; 3730 const callee = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node.callee) ? node.callee : helper(node.callee); 3731 if (pure) { 3732 push(PURE_ANNOTATION); 3733 } 3734 push(callee + `(`, -2 /* None */, node); 3735 genNodeList(node.arguments, context); 3736 push(`)`); 3737} 3738function genObjectExpression(node, context) { 3739 const { push, indent, deindent, newline } = context; 3740 const { properties } = node; 3741 if (!properties.length) { 3742 push(`{}`, -2 /* None */, node); 3743 return; 3744 } 3745 const multilines = properties.length > 1 || true && properties.some((p) => p.value.type !== 4); 3746 push(multilines ? `{` : `{ `); 3747 multilines && indent(); 3748 for (let i = 0; i < properties.length; i++) { 3749 const { key, value } = properties[i]; 3750 genExpressionAsPropertyKey(key, context); 3751 push(`: `); 3752 genNode(value, context); 3753 if (i < properties.length - 1) { 3754 push(`,`); 3755 newline(); 3756 } 3757 } 3758 multilines && deindent(); 3759 push(multilines ? `}` : ` }`); 3760} 3761function genArrayExpression(node, context) { 3762 genNodeListAsArray(node.elements, context); 3763} 3764function genFunctionExpression(node, context) { 3765 const { push, indent, deindent } = context; 3766 const { params, returns, body, newline, isSlot } = node; 3767 if (isSlot) { 3768 push(`_${helperNameMap[WITH_CTX]}(`); 3769 } 3770 push(`(`, -2 /* None */, node); 3771 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(params)) { 3772 genNodeList(params, context); 3773 } else if (params) { 3774 genNode(params, context); 3775 } 3776 push(`) => `); 3777 if (newline || body) { 3778 push(`{`); 3779 indent(); 3780 } 3781 if (returns) { 3782 if (newline) { 3783 push(`return `); 3784 } 3785 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(returns)) { 3786 genNodeListAsArray(returns, context); 3787 } else { 3788 genNode(returns, context); 3789 } 3790 } else if (body) { 3791 genNode(body, context); 3792 } 3793 if (newline || body) { 3794 deindent(); 3795 push(`}`); 3796 } 3797 if (isSlot) { 3798 if (node.isNonScopedSlot) { 3799 push(`, undefined, true`); 3800 } 3801 push(`)`); 3802 } 3803} 3804function genConditionalExpression(node, context) { 3805 const { test, consequent, alternate, newline: needNewline } = node; 3806 const { push, indent, deindent, newline } = context; 3807 if (test.type === 4) { 3808 const needsParens = !isSimpleIdentifier(test.content); 3809 needsParens && push(`(`); 3810 genExpression(test, context); 3811 needsParens && push(`)`); 3812 } else { 3813 push(`(`); 3814 genNode(test, context); 3815 push(`)`); 3816 } 3817 needNewline && indent(); 3818 context.indentLevel++; 3819 needNewline || push(` `); 3820 push(`? `); 3821 genNode(consequent, context); 3822 context.indentLevel--; 3823 needNewline && newline(); 3824 needNewline || push(` `); 3825 push(`: `); 3826 const isNested = alternate.type === 19; 3827 if (!isNested) { 3828 context.indentLevel++; 3829 } 3830 genNode(alternate, context); 3831 if (!isNested) { 3832 context.indentLevel--; 3833 } 3834 needNewline && deindent( 3835 true 3836 /* without newline */ 3837 ); 3838} 3839function genCacheExpression(node, context) { 3840 const { push, helper, indent, deindent, newline } = context; 3841 push(`_cache[${node.index}] || (`); 3842 if (node.isVNode) { 3843 indent(); 3844 push(`${helper(SET_BLOCK_TRACKING)}(-1),`); 3845 newline(); 3846 } 3847 push(`_cache[${node.index}] = `); 3848 genNode(node.value, context); 3849 if (node.isVNode) { 3850 push(`,`); 3851 newline(); 3852 push(`${helper(SET_BLOCK_TRACKING)}(1),`); 3853 newline(); 3854 push(`_cache[${node.index}]`); 3855 deindent(); 3856 } 3857 push(`)`); 3858} 3859 3860const prohibitedKeywordRE = new RegExp( 3861 "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b" 3862); 3863const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; 3864function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) { 3865 const exp = node.content; 3866 if (!exp.trim()) { 3867 return; 3868 } 3869 try { 3870 new Function( 3871 asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}` 3872 ); 3873 } catch (e) { 3874 let message = e.message; 3875 const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE); 3876 if (keywordMatch) { 3877 message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`; 3878 } 3879 context.onError( 3880 createCompilerError( 3881 45, 3882 node.loc, 3883 void 0, 3884 message 3885 ) 3886 ); 3887 } 3888} 3889 3890const transformExpression = (node, context) => { 3891 if (node.type === 5) { 3892 node.content = processExpression( 3893 node.content, 3894 context 3895 ); 3896 } else if (node.type === 1) { 3897 for (let i = 0; i < node.props.length; i++) { 3898 const dir = node.props[i]; 3899 if (dir.type === 7 && dir.name !== "for") { 3900 const exp = dir.exp; 3901 const arg = dir.arg; 3902 if (exp && exp.type === 4 && !(dir.name === "on" && arg)) { 3903 dir.exp = processExpression( 3904 exp, 3905 context, 3906 // slot args must be processed as function params 3907 dir.name === "slot" 3908 ); 3909 } 3910 if (arg && arg.type === 4 && !arg.isStatic) { 3911 dir.arg = processExpression(arg, context); 3912 } 3913 } 3914 } 3915 } 3916}; 3917function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { 3918 { 3919 if (true) { 3920 validateBrowserExpression(node, context, asParams, asRawStatements); 3921 } 3922 return node; 3923 } 3924} 3925function stringifyExpression(exp) { 3926 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(exp)) { 3927 return exp; 3928 } else if (exp.type === 4) { 3929 return exp.content; 3930 } else { 3931 return exp.children.map(stringifyExpression).join(""); 3932 } 3933} 3934 3935const transformIf = createStructuralDirectiveTransform( 3936 /^(if|else|else-if)$/, 3937 (node, dir, context) => { 3938 return processIf(node, dir, context, (ifNode, branch, isRoot) => { 3939 const siblings = context.parent.children; 3940 let i = siblings.indexOf(ifNode); 3941 let key = 0; 3942 while (i-- >= 0) { 3943 const sibling = siblings[i]; 3944 if (sibling && sibling.type === 9) { 3945 key += sibling.branches.length; 3946 } 3947 } 3948 return () => { 3949 if (isRoot) { 3950 ifNode.codegenNode = createCodegenNodeForBranch( 3951 branch, 3952 key, 3953 context 3954 ); 3955 } else { 3956 const parentCondition = getParentCondition(ifNode.codegenNode); 3957 parentCondition.alternate = createCodegenNodeForBranch( 3958 branch, 3959 key + ifNode.branches.length - 1, 3960 context 3961 ); 3962 } 3963 }; 3964 }); 3965 } 3966); 3967function processIf(node, dir, context, processCodegen) { 3968 if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { 3969 const loc = dir.exp ? dir.exp.loc : node.loc; 3970 context.onError( 3971 createCompilerError(28, dir.loc) 3972 ); 3973 dir.exp = createSimpleExpression(`true`, false, loc); 3974 } 3975 if ( true && dir.exp) { 3976 validateBrowserExpression(dir.exp, context); 3977 } 3978 if (dir.name === "if") { 3979 const branch = createIfBranch(node, dir); 3980 const ifNode = { 3981 type: 9, 3982 loc: node.loc, 3983 branches: [branch] 3984 }; 3985 context.replaceNode(ifNode); 3986 if (processCodegen) { 3987 return processCodegen(ifNode, branch, true); 3988 } 3989 } else { 3990 const siblings = context.parent.children; 3991 const comments = []; 3992 let i = siblings.indexOf(node); 3993 while (i-- >= -1) { 3994 const sibling = siblings[i]; 3995 if (sibling && sibling.type === 3) { 3996 context.removeNode(sibling); 3997 true && comments.unshift(sibling); 3998 continue; 3999 } 4000 if (sibling && sibling.type === 2 && !sibling.content.trim().length) { 4001 context.removeNode(sibling); 4002 continue; 4003 } 4004 if (sibling && sibling.type === 9) { 4005 if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { 4006 context.onError( 4007 createCompilerError(30, node.loc) 4008 ); 4009 } 4010 context.removeNode(); 4011 const branch = createIfBranch(node, dir); 4012 if ( true && comments.length && // #3619 ignore comments if the v-if is direct child of <transition> 4013 !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { 4014 branch.children = [...comments, ...branch.children]; 4015 } 4016 if (true) { 4017 const key = branch.userKey; 4018 if (key) { 4019 sibling.branches.forEach(({ userKey }) => { 4020 if (isSameKey(userKey, key)) { 4021 context.onError( 4022 createCompilerError( 4023 29, 4024 branch.userKey.loc 4025 ) 4026 ); 4027 } 4028 }); 4029 } 4030 } 4031 sibling.branches.push(branch); 4032 const onExit = processCodegen && processCodegen(sibling, branch, false); 4033 traverseNode(branch, context); 4034 if (onExit) 4035 onExit(); 4036 context.currentNode = null; 4037 } else { 4038 context.onError( 4039 createCompilerError(30, node.loc) 4040 ); 4041 } 4042 break; 4043 } 4044 } 4045} 4046function createIfBranch(node, dir) { 4047 const isTemplateIf = node.tagType === 3; 4048 return { 4049 type: 10, 4050 loc: node.loc, 4051 condition: dir.name === "else" ? void 0 : dir.exp, 4052 children: isTemplateIf && !findDir(node, "for") ? node.children : [node], 4053 userKey: findProp(node, `key`), 4054 isTemplateIf 4055 }; 4056} 4057function createCodegenNodeForBranch(branch, keyIndex, context) { 4058 if (branch.condition) { 4059 return createConditionalExpression( 4060 branch.condition, 4061 createChildrenCodegenNode(branch, keyIndex, context), 4062 // make sure to pass in asBlock: true so that the comment node call 4063 // closes the current block. 4064 createCallExpression(context.helper(CREATE_COMMENT), [ 4065 true ? '"v-if"' : 0, 4066 "true" 4067 ]) 4068 ); 4069 } else { 4070 return createChildrenCodegenNode(branch, keyIndex, context); 4071 } 4072} 4073function createChildrenCodegenNode(branch, keyIndex, context) { 4074 const { helper } = context; 4075 const keyProperty = createObjectProperty( 4076 `key`, 4077 createSimpleExpression( 4078 `${keyIndex}`, 4079 false, 4080 locStub, 4081 2 4082 ) 4083 ); 4084 const { children } = branch; 4085 const firstChild = children[0]; 4086 const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; 4087 if (needFragmentWrapper) { 4088 if (children.length === 1 && firstChild.type === 11) { 4089 const vnodeCall = firstChild.codegenNode; 4090 injectProp(vnodeCall, keyProperty, context); 4091 return vnodeCall; 4092 } else { 4093 let patchFlag = 64; 4094 let patchFlagText = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]; 4095 if ( true && !branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { 4096 patchFlag |= 2048; 4097 patchFlagText += `, ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[2048]}`; 4098 } 4099 return createVNodeCall( 4100 context, 4101 helper(FRAGMENT), 4102 createObjectExpression([keyProperty]), 4103 children, 4104 patchFlag + ( true ? ` /* ${patchFlagText} */` : 0), 4105 void 0, 4106 void 0, 4107 true, 4108 false, 4109 false, 4110 branch.loc 4111 ); 4112 } 4113 } else { 4114 const ret = firstChild.codegenNode; 4115 const vnodeCall = getMemoedVNodeCall(ret); 4116 if (vnodeCall.type === 13) { 4117 convertToBlock(vnodeCall, context); 4118 } 4119 injectProp(vnodeCall, keyProperty, context); 4120 return ret; 4121 } 4122} 4123function isSameKey(a, b) { 4124 if (!a || a.type !== b.type) { 4125 return false; 4126 } 4127 if (a.type === 6) { 4128 if (a.value.content !== b.value.content) { 4129 return false; 4130 } 4131 } else { 4132 const exp = a.exp; 4133 const branchExp = b.exp; 4134 if (exp.type !== branchExp.type) { 4135 return false; 4136 } 4137 if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { 4138 return false; 4139 } 4140 } 4141 return true; 4142} 4143function getParentCondition(node) { 4144 while (true) { 4145 if (node.type === 19) { 4146 if (node.alternate.type === 19) { 4147 node = node.alternate; 4148 } else { 4149 return node; 4150 } 4151 } else if (node.type === 20) { 4152 node = node.value; 4153 } 4154 } 4155} 4156 4157const transformFor = createStructuralDirectiveTransform( 4158 "for", 4159 (node, dir, context) => { 4160 const { helper, removeHelper } = context; 4161 return processFor(node, dir, context, (forNode) => { 4162 const renderExp = createCallExpression(helper(RENDER_LIST), [ 4163 forNode.source 4164 ]); 4165 const isTemplate = isTemplateNode(node); 4166 const memo = findDir(node, "memo"); 4167 const keyProp = findProp(node, `key`); 4168 const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp); 4169 const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null; 4170 const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; 4171 const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; 4172 forNode.codegenNode = createVNodeCall( 4173 context, 4174 helper(FRAGMENT), 4175 void 0, 4176 renderExp, 4177 fragmentFlag + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[fragmentFlag]} */` : 0), 4178 void 0, 4179 void 0, 4180 true, 4181 !isStableFragment, 4182 false, 4183 node.loc 4184 ); 4185 return () => { 4186 let childBlock; 4187 const { children } = forNode; 4188 if (( true) && isTemplate) { 4189 node.children.some((c) => { 4190 if (c.type === 1) { 4191 const key = findProp(c, "key"); 4192 if (key) { 4193 context.onError( 4194 createCompilerError( 4195 33, 4196 key.loc 4197 ) 4198 ); 4199 return true; 4200 } 4201 } 4202 }); 4203 } 4204 const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; 4205 const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; 4206 if (slotOutlet) { 4207 childBlock = slotOutlet.codegenNode; 4208 if (isTemplate && keyProperty) { 4209 injectProp(childBlock, keyProperty, context); 4210 } 4211 } else if (needFragmentWrapper) { 4212 childBlock = createVNodeCall( 4213 context, 4214 helper(FRAGMENT), 4215 keyProperty ? createObjectExpression([keyProperty]) : void 0, 4216 node.children, 4217 64 + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]} */` : 0), 4218 void 0, 4219 void 0, 4220 true, 4221 void 0, 4222 false 4223 ); 4224 } else { 4225 childBlock = children[0].codegenNode; 4226 if (isTemplate && keyProperty) { 4227 injectProp(childBlock, keyProperty, context); 4228 } 4229 if (childBlock.isBlock !== !isStableFragment) { 4230 if (childBlock.isBlock) { 4231 removeHelper(OPEN_BLOCK); 4232 removeHelper( 4233 getVNodeBlockHelper(context.inSSR, childBlock.isComponent) 4234 ); 4235 } else { 4236 removeHelper( 4237 getVNodeHelper(context.inSSR, childBlock.isComponent) 4238 ); 4239 } 4240 } 4241 childBlock.isBlock = !isStableFragment; 4242 if (childBlock.isBlock) { 4243 helper(OPEN_BLOCK); 4244 helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); 4245 } else { 4246 helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); 4247 } 4248 } 4249 if (memo) { 4250 const loop = createFunctionExpression( 4251 createForLoopParams(forNode.parseResult, [ 4252 createSimpleExpression(`_cached`) 4253 ]) 4254 ); 4255 loop.body = createBlockStatement([ 4256 createCompoundExpression([`const _memo = (`, memo.exp, `)`]), 4257 createCompoundExpression([ 4258 `if (_cached`, 4259 ...keyExp ? [` && _cached.key === `, keyExp] : [], 4260 ` && ${context.helperString( 4261 IS_MEMO_SAME 4262 )}(_cached, _memo)) return _cached` 4263 ]), 4264 createCompoundExpression([`const _item = `, childBlock]), 4265 createSimpleExpression(`_item.memo = _memo`), 4266 createSimpleExpression(`return _item`) 4267 ]); 4268 renderExp.arguments.push( 4269 loop, 4270 createSimpleExpression(`_cache`), 4271 createSimpleExpression(String(context.cached++)) 4272 ); 4273 } else { 4274 renderExp.arguments.push( 4275 createFunctionExpression( 4276 createForLoopParams(forNode.parseResult), 4277 childBlock, 4278 true 4279 ) 4280 ); 4281 } 4282 }; 4283 }); 4284 } 4285); 4286function processFor(node, dir, context, processCodegen) { 4287 if (!dir.exp) { 4288 context.onError( 4289 createCompilerError(31, dir.loc) 4290 ); 4291 return; 4292 } 4293 const parseResult = dir.forParseResult; 4294 if (!parseResult) { 4295 context.onError( 4296 createCompilerError(32, dir.loc) 4297 ); 4298 return; 4299 } 4300 finalizeForParseResult(parseResult, context); 4301 const { addIdentifiers, removeIdentifiers, scopes } = context; 4302 const { source, value, key, index } = parseResult; 4303 const forNode = { 4304 type: 11, 4305 loc: dir.loc, 4306 source, 4307 valueAlias: value, 4308 keyAlias: key, 4309 objectIndexAlias: index, 4310 parseResult, 4311 children: isTemplateNode(node) ? node.children : [node] 4312 }; 4313 context.replaceNode(forNode); 4314 scopes.vFor++; 4315 const onExit = processCodegen && processCodegen(forNode); 4316 return () => { 4317 scopes.vFor--; 4318 if (onExit) 4319 onExit(); 4320 }; 4321} 4322function finalizeForParseResult(result, context) { 4323 if (result.finalized) 4324 return; 4325 if (true) { 4326 validateBrowserExpression(result.source, context); 4327 if (result.key) { 4328 validateBrowserExpression( 4329 result.key, 4330 context, 4331 true 4332 ); 4333 } 4334 if (result.index) { 4335 validateBrowserExpression( 4336 result.index, 4337 context, 4338 true 4339 ); 4340 } 4341 if (result.value) { 4342 validateBrowserExpression( 4343 result.value, 4344 context, 4345 true 4346 ); 4347 } 4348 } 4349 result.finalized = true; 4350} 4351function createForLoopParams({ value, key, index }, memoArgs = []) { 4352 return createParamsList([value, key, index, ...memoArgs]); 4353} 4354function createParamsList(args) { 4355 let i = args.length; 4356 while (i--) { 4357 if (args[i]) 4358 break; 4359 } 4360 return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); 4361} 4362 4363const defaultFallback = createSimpleExpression(`undefined`, false); 4364const trackSlotScopes = (node, context) => { 4365 if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { 4366 const vSlot = findDir(node, "slot"); 4367 if (vSlot) { 4368 vSlot.exp; 4369 context.scopes.vSlot++; 4370 return () => { 4371 context.scopes.vSlot--; 4372 }; 4373 } 4374 } 4375}; 4376const trackVForSlotScopes = (node, context) => { 4377 let vFor; 4378 if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { 4379 const result = vFor.forParseResult; 4380 if (result) { 4381 finalizeForParseResult(result, context); 4382 const { value, key, index } = result; 4383 const { addIdentifiers, removeIdentifiers } = context; 4384 value && addIdentifiers(value); 4385 key && addIdentifiers(key); 4386 index && addIdentifiers(index); 4387 return () => { 4388 value && removeIdentifiers(value); 4389 key && removeIdentifiers(key); 4390 index && removeIdentifiers(index); 4391 }; 4392 } 4393 } 4394}; 4395const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( 4396 props, 4397 children, 4398 false, 4399 true, 4400 children.length ? children[0].loc : loc 4401); 4402function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { 4403 context.helper(WITH_CTX); 4404 const { children, loc } = node; 4405 const slotsProperties = []; 4406 const dynamicSlots = []; 4407 let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; 4408 const onComponentSlot = findDir(node, "slot", true); 4409 if (onComponentSlot) { 4410 const { arg, exp } = onComponentSlot; 4411 if (arg && !isStaticExp(arg)) { 4412 hasDynamicSlots = true; 4413 } 4414 slotsProperties.push( 4415 createObjectProperty( 4416 arg || createSimpleExpression("default", true), 4417 buildSlotFn(exp, void 0, children, loc) 4418 ) 4419 ); 4420 } 4421 let hasTemplateSlots = false; 4422 let hasNamedDefaultSlot = false; 4423 const implicitDefaultChildren = []; 4424 const seenSlotNames = /* @__PURE__ */ new Set(); 4425 let conditionalBranchIndex = 0; 4426 for (let i = 0; i < children.length; i++) { 4427 const slotElement = children[i]; 4428 let slotDir; 4429 if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { 4430 if (slotElement.type !== 3) { 4431 implicitDefaultChildren.push(slotElement); 4432 } 4433 continue; 4434 } 4435 if (onComponentSlot) { 4436 context.onError( 4437 createCompilerError(37, slotDir.loc) 4438 ); 4439 break; 4440 } 4441 hasTemplateSlots = true; 4442 const { children: slotChildren, loc: slotLoc } = slotElement; 4443 const { 4444 arg: slotName = createSimpleExpression(`default`, true), 4445 exp: slotProps, 4446 loc: dirLoc 4447 } = slotDir; 4448 let staticSlotName; 4449 if (isStaticExp(slotName)) { 4450 staticSlotName = slotName ? slotName.content : `default`; 4451 } else { 4452 hasDynamicSlots = true; 4453 } 4454 const vFor = findDir(slotElement, "for"); 4455 const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); 4456 let vIf; 4457 let vElse; 4458 if (vIf = findDir(slotElement, "if")) { 4459 hasDynamicSlots = true; 4460 dynamicSlots.push( 4461 createConditionalExpression( 4462 vIf.exp, 4463 buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), 4464 defaultFallback 4465 ) 4466 ); 4467 } else if (vElse = findDir( 4468 slotElement, 4469 /^else(-if)?$/, 4470 true 4471 /* allowEmpty */ 4472 )) { 4473 let j = i; 4474 let prev; 4475 while (j--) { 4476 prev = children[j]; 4477 if (prev.type !== 3) { 4478 break; 4479 } 4480 } 4481 if (prev && isTemplateNode(prev) && findDir(prev, "if")) { 4482 children.splice(i, 1); 4483 i--; 4484 let conditional = dynamicSlots[dynamicSlots.length - 1]; 4485 while (conditional.alternate.type === 19) { 4486 conditional = conditional.alternate; 4487 } 4488 conditional.alternate = vElse.exp ? createConditionalExpression( 4489 vElse.exp, 4490 buildDynamicSlot( 4491 slotName, 4492 slotFunction, 4493 conditionalBranchIndex++ 4494 ), 4495 defaultFallback 4496 ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); 4497 } else { 4498 context.onError( 4499 createCompilerError(30, vElse.loc) 4500 ); 4501 } 4502 } else if (vFor) { 4503 hasDynamicSlots = true; 4504 const parseResult = vFor.forParseResult; 4505 if (parseResult) { 4506 finalizeForParseResult(parseResult, context); 4507 dynamicSlots.push( 4508 createCallExpression(context.helper(RENDER_LIST), [ 4509 parseResult.source, 4510 createFunctionExpression( 4511 createForLoopParams(parseResult), 4512 buildDynamicSlot(slotName, slotFunction), 4513 true 4514 ) 4515 ]) 4516 ); 4517 } else { 4518 context.onError( 4519 createCompilerError( 4520 32, 4521 vFor.loc 4522 ) 4523 ); 4524 } 4525 } else { 4526 if (staticSlotName) { 4527 if (seenSlotNames.has(staticSlotName)) { 4528 context.onError( 4529 createCompilerError( 4530 38, 4531 dirLoc 4532 ) 4533 ); 4534 continue; 4535 } 4536 seenSlotNames.add(staticSlotName); 4537 if (staticSlotName === "default") { 4538 hasNamedDefaultSlot = true; 4539 } 4540 } 4541 slotsProperties.push(createObjectProperty(slotName, slotFunction)); 4542 } 4543 } 4544 if (!onComponentSlot) { 4545 const buildDefaultSlotProperty = (props, children2) => { 4546 const fn = buildSlotFn(props, void 0, children2, loc); 4547 if (context.compatConfig) { 4548 fn.isNonScopedSlot = true; 4549 } 4550 return createObjectProperty(`default`, fn); 4551 }; 4552 if (!hasTemplateSlots) { 4553 slotsProperties.push(buildDefaultSlotProperty(void 0, children)); 4554 } else if (implicitDefaultChildren.length && // #3766 4555 // with whitespace: 'preserve', whitespaces between slots will end up in 4556 // implicitDefaultChildren. Ignore if all implicit children are whitespaces. 4557 implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { 4558 if (hasNamedDefaultSlot) { 4559 context.onError( 4560 createCompilerError( 4561 39, 4562 implicitDefaultChildren[0].loc 4563 ) 4564 ); 4565 } else { 4566 slotsProperties.push( 4567 buildDefaultSlotProperty(void 0, implicitDefaultChildren) 4568 ); 4569 } 4570 } 4571 } 4572 const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; 4573 let slots = createObjectExpression( 4574 slotsProperties.concat( 4575 createObjectProperty( 4576 `_`, 4577 // 2 = compiled but dynamic = can skip normalization, but must run diff 4578 // 1 = compiled and static = can skip normalization AND diff as optimized 4579 createSimpleExpression( 4580 slotFlag + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.slotFlagsText[slotFlag]} */` : 0), 4581 false 4582 ) 4583 ) 4584 ), 4585 loc 4586 ); 4587 if (dynamicSlots.length) { 4588 slots = createCallExpression(context.helper(CREATE_SLOTS), [ 4589 slots, 4590 createArrayExpression(dynamicSlots) 4591 ]); 4592 } 4593 return { 4594 slots, 4595 hasDynamicSlots 4596 }; 4597} 4598function buildDynamicSlot(name, fn, index) { 4599 const props = [ 4600 createObjectProperty(`name`, name), 4601 createObjectProperty(`fn`, fn) 4602 ]; 4603 if (index != null) { 4604 props.push( 4605 createObjectProperty(`key`, createSimpleExpression(String(index), true)) 4606 ); 4607 } 4608 return createObjectExpression(props); 4609} 4610function hasForwardedSlots(children) { 4611 for (let i = 0; i < children.length; i++) { 4612 const child = children[i]; 4613 switch (child.type) { 4614 case 1: 4615 if (child.tagType === 2 || hasForwardedSlots(child.children)) { 4616 return true; 4617 } 4618 break; 4619 case 9: 4620 if (hasForwardedSlots(child.branches)) 4621 return true; 4622 break; 4623 case 10: 4624 case 11: 4625 if (hasForwardedSlots(child.children)) 4626 return true; 4627 break; 4628 } 4629 } 4630 return false; 4631} 4632function isNonWhitespaceContent(node) { 4633 if (node.type !== 2 && node.type !== 12) 4634 return true; 4635 return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); 4636} 4637 4638const directiveImportMap = /* @__PURE__ */ new WeakMap(); 4639const transformElement = (node, context) => { 4640 return function postTransformElement() { 4641 node = context.currentNode; 4642 if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { 4643 return; 4644 } 4645 const { tag, props } = node; 4646 const isComponent = node.tagType === 1; 4647 let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; 4648 const isDynamicComponent = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; 4649 let vnodeProps; 4650 let vnodeChildren; 4651 let vnodePatchFlag; 4652 let patchFlag = 0; 4653 let vnodeDynamicProps; 4654 let dynamicPropNames; 4655 let vnodeDirectives; 4656 let shouldUseBlock = ( 4657 // dynamic component may resolve to plain elements 4658 isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block 4659 // updates inside get proper isSVG flag at runtime. (#639, #643) 4660 // This is technically web-specific, but splitting the logic out of core 4661 // leads to too much unnecessary complexity. 4662 (tag === "svg" || tag === "foreignObject") 4663 ); 4664 if (props.length > 0) { 4665 const propsBuildResult = buildProps( 4666 node, 4667 context, 4668 void 0, 4669 isComponent, 4670 isDynamicComponent 4671 ); 4672 vnodeProps = propsBuildResult.props; 4673 patchFlag = propsBuildResult.patchFlag; 4674 dynamicPropNames = propsBuildResult.dynamicPropNames; 4675 const directives = propsBuildResult.directives; 4676 vnodeDirectives = directives && directives.length ? createArrayExpression( 4677 directives.map((dir) => buildDirectiveArgs(dir, context)) 4678 ) : void 0; 4679 if (propsBuildResult.shouldUseBlock) { 4680 shouldUseBlock = true; 4681 } 4682 } 4683 if (node.children.length > 0) { 4684 if (vnodeTag === KEEP_ALIVE) { 4685 shouldUseBlock = true; 4686 patchFlag |= 1024; 4687 if ( true && node.children.length > 1) { 4688 context.onError( 4689 createCompilerError(46, { 4690 start: node.children[0].loc.start, 4691 end: node.children[node.children.length - 1].loc.end, 4692 source: "" 4693 }) 4694 ); 4695 } 4696 } 4697 const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling 4698 vnodeTag !== TELEPORT && // explained above. 4699 vnodeTag !== KEEP_ALIVE; 4700 if (shouldBuildAsSlots) { 4701 const { slots, hasDynamicSlots } = buildSlots(node, context); 4702 vnodeChildren = slots; 4703 if (hasDynamicSlots) { 4704 patchFlag |= 1024; 4705 } 4706 } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { 4707 const child = node.children[0]; 4708 const type = child.type; 4709 const hasDynamicTextChild = type === 5 || type === 8; 4710 if (hasDynamicTextChild && getConstantType(child, context) === 0) { 4711 patchFlag |= 1; 4712 } 4713 if (hasDynamicTextChild || type === 2) { 4714 vnodeChildren = child; 4715 } else { 4716 vnodeChildren = node.children; 4717 } 4718 } else { 4719 vnodeChildren = node.children; 4720 } 4721 } 4722 if (patchFlag !== 0) { 4723 if (true) { 4724 if (patchFlag < 0) { 4725 vnodePatchFlag = patchFlag + ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[patchFlag]} */`; 4726 } else { 4727 const flagNames = Object.keys(_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[n]).join(`, `); 4728 vnodePatchFlag = patchFlag + ` /* ${flagNames} */`; 4729 } 4730 } else {} 4731 if (dynamicPropNames && dynamicPropNames.length) { 4732 vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); 4733 } 4734 } 4735 node.codegenNode = createVNodeCall( 4736 context, 4737 vnodeTag, 4738 vnodeProps, 4739 vnodeChildren, 4740 vnodePatchFlag, 4741 vnodeDynamicProps, 4742 vnodeDirectives, 4743 !!shouldUseBlock, 4744 false, 4745 isComponent, 4746 node.loc 4747 ); 4748 }; 4749}; 4750function resolveComponentType(node, context, ssr = false) { 4751 let { tag } = node; 4752 const isExplicitDynamic = isComponentTag(tag); 4753 const isProp = findProp(node, "is"); 4754 if (isProp) { 4755 if (isExplicitDynamic || isCompatEnabled( 4756 "COMPILER_IS_ON_ELEMENT", 4757 context 4758 )) { 4759 const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp; 4760 if (exp) { 4761 return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ 4762 exp 4763 ]); 4764 } 4765 } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { 4766 tag = isProp.value.content.slice(4); 4767 } 4768 } 4769 const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); 4770 if (builtIn) { 4771 if (!ssr) 4772 context.helper(builtIn); 4773 return builtIn; 4774 } 4775 context.helper(RESOLVE_COMPONENT); 4776 context.components.add(tag); 4777 return toValidAssetId(tag, `component`); 4778} 4779function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { 4780 const { tag, loc: elementLoc, children } = node; 4781 let properties = []; 4782 const mergeArgs = []; 4783 const runtimeDirectives = []; 4784 const hasChildren = children.length > 0; 4785 let shouldUseBlock = false; 4786 let patchFlag = 0; 4787 let hasRef = false; 4788 let hasClassBinding = false; 4789 let hasStyleBinding = false; 4790 let hasHydrationEventBinding = false; 4791 let hasDynamicKeys = false; 4792 let hasVnodeHook = false; 4793 const dynamicPropNames = []; 4794 const pushMergeArg = (arg) => { 4795 if (properties.length) { 4796 mergeArgs.push( 4797 createObjectExpression(dedupeProperties(properties), elementLoc) 4798 ); 4799 properties = []; 4800 } 4801 if (arg) 4802 mergeArgs.push(arg); 4803 }; 4804 const analyzePatchFlag = ({ key, value }) => { 4805 if (isStaticExp(key)) { 4806 const name = key.content; 4807 const isEventHandler = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(name); 4808 if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click 4809 // dedicated fast path. 4810 name.toLowerCase() !== "onclick" && // omit v-model handlers 4811 name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks 4812 !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isReservedProp)(name)) { 4813 hasHydrationEventBinding = true; 4814 } 4815 if (isEventHandler && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isReservedProp)(name)) { 4816 hasVnodeHook = true; 4817 } 4818 if (isEventHandler && value.type === 14) { 4819 value = value.arguments[0]; 4820 } 4821 if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { 4822 return; 4823 } 4824 if (name === "ref") { 4825 hasRef = true; 4826 } else if (name === "class") { 4827 hasClassBinding = true; 4828 } else if (name === "style") { 4829 hasStyleBinding = true; 4830 } else if (name !== "key" && !dynamicPropNames.includes(name)) { 4831 dynamicPropNames.push(name); 4832 } 4833 if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { 4834 dynamicPropNames.push(name); 4835 } 4836 } else { 4837 hasDynamicKeys = true; 4838 } 4839 }; 4840 for (let i = 0; i < props.length; i++) { 4841 const prop = props[i]; 4842 if (prop.type === 6) { 4843 const { loc, name, nameLoc, value } = prop; 4844 let isStatic = true; 4845 if (name === "ref") { 4846 hasRef = true; 4847 if (context.scopes.vFor > 0) { 4848 properties.push( 4849 createObjectProperty( 4850 createSimpleExpression("ref_for", true), 4851 createSimpleExpression("true") 4852 ) 4853 ); 4854 } 4855 } 4856 if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( 4857 "COMPILER_IS_ON_ELEMENT", 4858 context 4859 ))) { 4860 continue; 4861 } 4862 properties.push( 4863 createObjectProperty( 4864 createSimpleExpression(name, true, nameLoc), 4865 createSimpleExpression( 4866 value ? value.content : "", 4867 isStatic, 4868 value ? value.loc : loc 4869 ) 4870 ) 4871 ); 4872 } else { 4873 const { name, arg, exp, loc, modifiers } = prop; 4874 const isVBind = name === "bind"; 4875 const isVOn = name === "on"; 4876 if (name === "slot") { 4877 if (!isComponent) { 4878 context.onError( 4879 createCompilerError(40, loc) 4880 ); 4881 } 4882 continue; 4883 } 4884 if (name === "once" || name === "memo") { 4885 continue; 4886 } 4887 if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( 4888 "COMPILER_IS_ON_ELEMENT", 4889 context 4890 ))) { 4891 continue; 4892 } 4893 if (isVOn && ssr) { 4894 continue; 4895 } 4896 if ( 4897 // #938: elements with dynamic keys should be forced into blocks 4898 isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked 4899 // before children 4900 isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") 4901 ) { 4902 shouldUseBlock = true; 4903 } 4904 if (isVBind && isStaticArgOf(arg, "ref") && context.scopes.vFor > 0) { 4905 properties.push( 4906 createObjectProperty( 4907 createSimpleExpression("ref_for", true), 4908 createSimpleExpression("true") 4909 ) 4910 ); 4911 } 4912 if (!arg && (isVBind || isVOn)) { 4913 hasDynamicKeys = true; 4914 if (exp) { 4915 if (isVBind) { 4916 pushMergeArg(); 4917 { 4918 if (true) { 4919 const hasOverridableKeys = mergeArgs.some((arg2) => { 4920 if (arg2.type === 15) { 4921 return arg2.properties.some(({ key }) => { 4922 if (key.type !== 4 || !key.isStatic) { 4923 return true; 4924 } 4925 return key.content !== "class" && key.content !== "style" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(key.content); 4926 }); 4927 } else { 4928 return true; 4929 } 4930 }); 4931 if (hasOverridableKeys) { 4932 checkCompatEnabled( 4933 "COMPILER_V_BIND_OBJECT_ORDER", 4934 context, 4935 loc 4936 ); 4937 } 4938 } 4939 if (isCompatEnabled( 4940 "COMPILER_V_BIND_OBJECT_ORDER", 4941 context 4942 )) { 4943 mergeArgs.unshift(exp); 4944 continue; 4945 } 4946 } 4947 mergeArgs.push(exp); 4948 } else { 4949 pushMergeArg({ 4950 type: 14, 4951 loc, 4952 callee: context.helper(TO_HANDLERS), 4953 arguments: isComponent ? [exp] : [exp, `true`] 4954 }); 4955 } 4956 } else { 4957 context.onError( 4958 createCompilerError( 4959 isVBind ? 34 : 35, 4960 loc 4961 ) 4962 ); 4963 } 4964 continue; 4965 } 4966 if (isVBind && modifiers.includes("prop")) { 4967 patchFlag |= 32; 4968 } 4969 const directiveTransform = context.directiveTransforms[name]; 4970 if (directiveTransform) { 4971 const { props: props2, needRuntime } = directiveTransform(prop, node, context); 4972 !ssr && props2.forEach(analyzePatchFlag); 4973 if (isVOn && arg && !isStaticExp(arg)) { 4974 pushMergeArg(createObjectExpression(props2, elementLoc)); 4975 } else { 4976 properties.push(...props2); 4977 } 4978 if (needRuntime) { 4979 runtimeDirectives.push(prop); 4980 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(needRuntime)) { 4981 directiveImportMap.set(prop, needRuntime); 4982 } 4983 } 4984 } else if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isBuiltInDirective)(name)) { 4985 runtimeDirectives.push(prop); 4986 if (hasChildren) { 4987 shouldUseBlock = true; 4988 } 4989 } 4990 } 4991 } 4992 let propsExpression = void 0; 4993 if (mergeArgs.length) { 4994 pushMergeArg(); 4995 if (mergeArgs.length > 1) { 4996 propsExpression = createCallExpression( 4997 context.helper(MERGE_PROPS), 4998 mergeArgs, 4999 elementLoc 5000 ); 5001 } else { 5002 propsExpression = mergeArgs[0]; 5003 } 5004 } else if (properties.length) { 5005 propsExpression = createObjectExpression( 5006 dedupeProperties(properties), 5007 elementLoc 5008 ); 5009 } 5010 if (hasDynamicKeys) { 5011 patchFlag |= 16; 5012 } else { 5013 if (hasClassBinding && !isComponent) { 5014 patchFlag |= 2; 5015 } 5016 if (hasStyleBinding && !isComponent) { 5017 patchFlag |= 4; 5018 } 5019 if (dynamicPropNames.length) { 5020 patchFlag |= 8; 5021 } 5022 if (hasHydrationEventBinding) { 5023 patchFlag |= 32; 5024 } 5025 } 5026 if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { 5027 patchFlag |= 512; 5028 } 5029 if (!context.inSSR && propsExpression) { 5030 switch (propsExpression.type) { 5031 case 15: 5032 let classKeyIndex = -1; 5033 let styleKeyIndex = -1; 5034 let hasDynamicKey = false; 5035 for (let i = 0; i < propsExpression.properties.length; i++) { 5036 const key = propsExpression.properties[i].key; 5037 if (isStaticExp(key)) { 5038 if (key.content === "class") { 5039 classKeyIndex = i; 5040 } else if (key.content === "style") { 5041 styleKeyIndex = i; 5042 } 5043 } else if (!key.isHandlerKey) { 5044 hasDynamicKey = true; 5045 } 5046 } 5047 const classProp = propsExpression.properties[classKeyIndex]; 5048 const styleProp = propsExpression.properties[styleKeyIndex]; 5049 if (!hasDynamicKey) { 5050 if (classProp && !isStaticExp(classProp.value)) { 5051 classProp.value = createCallExpression( 5052 context.helper(NORMALIZE_CLASS), 5053 [classProp.value] 5054 ); 5055 } 5056 if (styleProp && // the static style is compiled into an object, 5057 // so use `hasStyleBinding` to ensure that it is a dynamic style binding 5058 (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, 5059 // v-bind:style with static literal object 5060 styleProp.value.type === 17)) { 5061 styleProp.value = createCallExpression( 5062 context.helper(NORMALIZE_STYLE), 5063 [styleProp.value] 5064 ); 5065 } 5066 } else { 5067 propsExpression = createCallExpression( 5068 context.helper(NORMALIZE_PROPS), 5069 [propsExpression] 5070 ); 5071 } 5072 break; 5073 case 14: 5074 break; 5075 default: 5076 propsExpression = createCallExpression( 5077 context.helper(NORMALIZE_PROPS), 5078 [ 5079 createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ 5080 propsExpression 5081 ]) 5082 ] 5083 ); 5084 break; 5085 } 5086 } 5087 return { 5088 props: propsExpression, 5089 directives: runtimeDirectives, 5090 patchFlag, 5091 dynamicPropNames, 5092 shouldUseBlock 5093 }; 5094} 5095function dedupeProperties(properties) { 5096 const knownProps = /* @__PURE__ */ new Map(); 5097 const deduped = []; 5098 for (let i = 0; i < properties.length; i++) { 5099 const prop = properties[i]; 5100 if (prop.key.type === 8 || !prop.key.isStatic) { 5101 deduped.push(prop); 5102 continue; 5103 } 5104 const name = prop.key.content; 5105 const existing = knownProps.get(name); 5106 if (existing) { 5107 if (name === "style" || name === "class" || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(name)) { 5108 mergeAsArray(existing, prop); 5109 } 5110 } else { 5111 knownProps.set(name, prop); 5112 deduped.push(prop); 5113 } 5114 } 5115 return deduped; 5116} 5117function mergeAsArray(existing, incoming) { 5118 if (existing.value.type === 17) { 5119 existing.value.elements.push(incoming.value); 5120 } else { 5121 existing.value = createArrayExpression( 5122 [existing.value, incoming.value], 5123 existing.loc 5124 ); 5125 } 5126} 5127function buildDirectiveArgs(dir, context) { 5128 const dirArgs = []; 5129 const runtime = directiveImportMap.get(dir); 5130 if (runtime) { 5131 dirArgs.push(context.helperString(runtime)); 5132 } else { 5133 { 5134 context.helper(RESOLVE_DIRECTIVE); 5135 context.directives.add(dir.name); 5136 dirArgs.push(toValidAssetId(dir.name, `directive`)); 5137 } 5138 } 5139 const { loc } = dir; 5140 if (dir.exp) 5141 dirArgs.push(dir.exp); 5142 if (dir.arg) { 5143 if (!dir.exp) { 5144 dirArgs.push(`void 0`); 5145 } 5146 dirArgs.push(dir.arg); 5147 } 5148 if (Object.keys(dir.modifiers).length) { 5149 if (!dir.arg) { 5150 if (!dir.exp) { 5151 dirArgs.push(`void 0`); 5152 } 5153 dirArgs.push(`void 0`); 5154 } 5155 const trueExpression = createSimpleExpression(`true`, false, loc); 5156 dirArgs.push( 5157 createObjectExpression( 5158 dir.modifiers.map( 5159 (modifier) => createObjectProperty(modifier, trueExpression) 5160 ), 5161 loc 5162 ) 5163 ); 5164 } 5165 return createArrayExpression(dirArgs, dir.loc); 5166} 5167function stringifyDynamicPropNames(props) { 5168 let propsNamesString = `[`; 5169 for (let i = 0, l = props.length; i < l; i++) { 5170 propsNamesString += JSON.stringify(props[i]); 5171 if (i < l - 1) 5172 propsNamesString += ", "; 5173 } 5174 return propsNamesString + `]`; 5175} 5176function isComponentTag(tag) { 5177 return tag === "component" || tag === "Component"; 5178} 5179 5180const transformSlotOutlet = (node, context) => { 5181 if (isSlotOutlet(node)) { 5182 const { children, loc } = node; 5183 const { slotName, slotProps } = processSlotOutlet(node, context); 5184 const slotArgs = [ 5185 context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, 5186 slotName, 5187 "{}", 5188 "undefined", 5189 "true" 5190 ]; 5191 let expectedLen = 2; 5192 if (slotProps) { 5193 slotArgs[2] = slotProps; 5194 expectedLen = 3; 5195 } 5196 if (children.length) { 5197 slotArgs[3] = createFunctionExpression([], children, false, false, loc); 5198 expectedLen = 4; 5199 } 5200 if (context.scopeId && !context.slotted) { 5201 expectedLen = 5; 5202 } 5203 slotArgs.splice(expectedLen); 5204 node.codegenNode = createCallExpression( 5205 context.helper(RENDER_SLOT), 5206 slotArgs, 5207 loc 5208 ); 5209 } 5210}; 5211function processSlotOutlet(node, context) { 5212 let slotName = `"default"`; 5213 let slotProps = void 0; 5214 const nonNameProps = []; 5215 for (let i = 0; i < node.props.length; i++) { 5216 const p = node.props[i]; 5217 if (p.type === 6) { 5218 if (p.value) { 5219 if (p.name === "name") { 5220 slotName = JSON.stringify(p.value.content); 5221 } else { 5222 p.name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(p.name); 5223 nonNameProps.push(p); 5224 } 5225 } 5226 } else { 5227 if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { 5228 if (p.exp) 5229 slotName = p.exp; 5230 } else { 5231 if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { 5232 p.arg.content = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(p.arg.content); 5233 } 5234 nonNameProps.push(p); 5235 } 5236 } 5237 } 5238 if (nonNameProps.length > 0) { 5239 const { props, directives } = buildProps( 5240 node, 5241 context, 5242 nonNameProps, 5243 false, 5244 false 5245 ); 5246 slotProps = props; 5247 if (directives.length) { 5248 context.onError( 5249 createCompilerError( 5250 36, 5251 directives[0].loc 5252 ) 5253 ); 5254 } 5255 } 5256 return { 5257 slotName, 5258 slotProps 5259 }; 5260} 5261 5262const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; 5263const transformOn = (dir, node, context, augmentor) => { 5264 const { loc, modifiers, arg } = dir; 5265 if (!dir.exp && !modifiers.length) { 5266 context.onError(createCompilerError(35, loc)); 5267 } 5268 let eventName; 5269 if (arg.type === 4) { 5270 if (arg.isStatic) { 5271 let rawName = arg.content; 5272 if ( true && rawName.startsWith("vnode")) { 5273 context.onError(createCompilerError(51, arg.loc)); 5274 } 5275 if (rawName.startsWith("vue:")) { 5276 rawName = `vnode-${rawName.slice(4)}`; 5277 } 5278 const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( 5279 // for non-element and vnode lifecycle event listeners, auto convert 5280 // it to camelCase. See issue #2249 5281 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(rawName)) 5282 ) : ( 5283 // preserve case for plain element listeners that have uppercase 5284 // letters, as these may be custom elements' custom events 5285 `on:${rawName}` 5286 ); 5287 eventName = createSimpleExpression(eventString, true, arg.loc); 5288 } else { 5289 eventName = createCompoundExpression([ 5290 `${context.helperString(TO_HANDLER_KEY)}(`, 5291 arg, 5292 `)` 5293 ]); 5294 } 5295 } else { 5296 eventName = arg; 5297 eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); 5298 eventName.children.push(`)`); 5299 } 5300 let exp = dir.exp; 5301 if (exp && !exp.content.trim()) { 5302 exp = void 0; 5303 } 5304 let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; 5305 if (exp) { 5306 const isMemberExp = isMemberExpression(exp.content); 5307 const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content)); 5308 const hasMultipleStatements = exp.content.includes(`;`); 5309 if (true) { 5310 validateBrowserExpression( 5311 exp, 5312 context, 5313 false, 5314 hasMultipleStatements 5315 ); 5316 } 5317 if (isInlineStatement || shouldCache && isMemberExp) { 5318 exp = createCompoundExpression([ 5319 `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, 5320 exp, 5321 hasMultipleStatements ? `}` : `)` 5322 ]); 5323 } 5324 } 5325 let ret = { 5326 props: [ 5327 createObjectProperty( 5328 eventName, 5329 exp || createSimpleExpression(`() => {}`, false, loc) 5330 ) 5331 ] 5332 }; 5333 if (augmentor) { 5334 ret = augmentor(ret); 5335 } 5336 if (shouldCache) { 5337 ret.props[0].value = context.cache(ret.props[0].value); 5338 } 5339 ret.props.forEach((p) => p.key.isHandlerKey = true); 5340 return ret; 5341}; 5342 5343const transformBind = (dir, _node, context) => { 5344 const { modifiers, loc } = dir; 5345 const arg = dir.arg; 5346 let { exp } = dir; 5347 if (!exp && arg.type === 4) { 5348 const propName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(arg.content); 5349 exp = dir.exp = createSimpleExpression(propName, false, arg.loc); 5350 } 5351 if (arg.type !== 4) { 5352 arg.children.unshift(`(`); 5353 arg.children.push(`) || ""`); 5354 } else if (!arg.isStatic) { 5355 arg.content = `${arg.content} || ""`; 5356 } 5357 if (modifiers.includes("camel")) { 5358 if (arg.type === 4) { 5359 if (arg.isStatic) { 5360 arg.content = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(arg.content); 5361 } else { 5362 arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; 5363 } 5364 } else { 5365 arg.children.unshift(`${context.helperString(CAMELIZE)}(`); 5366 arg.children.push(`)`); 5367 } 5368 } 5369 if (!context.inSSR) { 5370 if (modifiers.includes("prop")) { 5371 injectPrefix(arg, "."); 5372 } 5373 if (modifiers.includes("attr")) { 5374 injectPrefix(arg, "^"); 5375 } 5376 } 5377 if (!exp || exp.type === 4 && !exp.content.trim()) { 5378 context.onError(createCompilerError(34, loc)); 5379 return { 5380 props: [createObjectProperty(arg, createSimpleExpression("", true, loc))] 5381 }; 5382 } 5383 return { 5384 props: [createObjectProperty(arg, exp)] 5385 }; 5386}; 5387const injectPrefix = (arg, prefix) => { 5388 if (arg.type === 4) { 5389 if (arg.isStatic) { 5390 arg.content = prefix + arg.content; 5391 } else { 5392 arg.content = `\`${prefix}\${${arg.content}}\``; 5393 } 5394 } else { 5395 arg.children.unshift(`'${prefix}' + (`); 5396 arg.children.push(`)`); 5397 } 5398}; 5399 5400const transformText = (node, context) => { 5401 if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { 5402 return () => { 5403 const children = node.children; 5404 let currentContainer = void 0; 5405 let hasText = false; 5406 for (let i = 0; i < children.length; i++) { 5407 const child = children[i]; 5408 if (isText$1(child)) { 5409 hasText = true; 5410 for (let j = i + 1; j < children.length; j++) { 5411 const next = children[j]; 5412 if (isText$1(next)) { 5413 if (!currentContainer) { 5414 currentContainer = children[i] = createCompoundExpression( 5415 [child], 5416 child.loc 5417 ); 5418 } 5419 currentContainer.children.push(` + `, next); 5420 children.splice(j, 1); 5421 j--; 5422 } else { 5423 currentContainer = void 0; 5424 break; 5425 } 5426 } 5427 } 5428 } 5429 if (!hasText || // if this is a plain element with a single text child, leave it 5430 // as-is since the runtime has dedicated fast path for this by directly 5431 // setting textContent of the element. 5432 // for component root it's always normalized anyway. 5433 children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 5434 // custom directives can potentially add DOM elements arbitrarily, 5435 // we need to avoid setting textContent of the element at runtime 5436 // to avoid accidentally overwriting the DOM elements added 5437 // by the user through custom directives. 5438 !node.props.find( 5439 (p) => p.type === 7 && !context.directiveTransforms[p.name] 5440 ) && // in compat mode, <template> tags with no special directives 5441 // will be rendered as a fragment so its children must be 5442 // converted into vnodes. 5443 !(node.tag === "template"))) { 5444 return; 5445 } 5446 for (let i = 0; i < children.length; i++) { 5447 const child = children[i]; 5448 if (isText$1(child) || child.type === 8) { 5449 const callArgs = []; 5450 if (child.type !== 2 || child.content !== " ") { 5451 callArgs.push(child); 5452 } 5453 if (!context.ssr && getConstantType(child, context) === 0) { 5454 callArgs.push( 5455 1 + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[1]} */` : 0) 5456 ); 5457 } 5458 children[i] = { 5459 type: 12, 5460 content: child, 5461 loc: child.loc, 5462 codegenNode: createCallExpression( 5463 context.helper(CREATE_TEXT), 5464 callArgs 5465 ) 5466 }; 5467 } 5468 } 5469 }; 5470 } 5471}; 5472 5473const seen$1 = /* @__PURE__ */ new WeakSet(); 5474const transformOnce = (node, context) => { 5475 if (node.type === 1 && findDir(node, "once", true)) { 5476 if (seen$1.has(node) || context.inVOnce || context.inSSR) { 5477 return; 5478 } 5479 seen$1.add(node); 5480 context.inVOnce = true; 5481 context.helper(SET_BLOCK_TRACKING); 5482 return () => { 5483 context.inVOnce = false; 5484 const cur = context.currentNode; 5485 if (cur.codegenNode) { 5486 cur.codegenNode = context.cache( 5487 cur.codegenNode, 5488 true 5489 /* isVNode */ 5490 ); 5491 } 5492 }; 5493 } 5494}; 5495 5496const transformModel = (dir, node, context) => { 5497 const { exp, arg } = dir; 5498 if (!exp) { 5499 context.onError( 5500 createCompilerError(41, dir.loc) 5501 ); 5502 return createTransformProps(); 5503 } 5504 const rawExp = exp.loc.source; 5505 const expString = exp.type === 4 ? exp.content : rawExp; 5506 const bindingType = context.bindingMetadata[rawExp]; 5507 if (bindingType === "props" || bindingType === "props-aliased") { 5508 context.onError(createCompilerError(44, exp.loc)); 5509 return createTransformProps(); 5510 } 5511 const maybeRef = false; 5512 if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) { 5513 context.onError( 5514 createCompilerError(42, exp.loc) 5515 ); 5516 return createTransformProps(); 5517 } 5518 const propName = arg ? arg : createSimpleExpression("modelValue", true); 5519 const eventName = arg ? isStaticExp(arg) ? `onUpdate:${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; 5520 let assignmentExp; 5521 const eventArg = context.isTS ? `($event: any)` : `$event`; 5522 { 5523 assignmentExp = createCompoundExpression([ 5524 `${eventArg} => ((`, 5525 exp, 5526 `) = $event)` 5527 ]); 5528 } 5529 const props = [ 5530 // modelValue: foo 5531 createObjectProperty(propName, dir.exp), 5532 // "onUpdate:modelValue": $event => (foo = $event) 5533 createObjectProperty(eventName, assignmentExp) 5534 ]; 5535 if (dir.modifiers.length && node.tagType === 1) { 5536 const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); 5537 const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; 5538 props.push( 5539 createObjectProperty( 5540 modifiersKey, 5541 createSimpleExpression( 5542 `{ ${modifiers} }`, 5543 false, 5544 dir.loc, 5545 2 5546 ) 5547 ) 5548 ); 5549 } 5550 return createTransformProps(props); 5551}; 5552function createTransformProps(props = []) { 5553 return { props }; 5554} 5555 5556const validDivisionCharRE = /[\w).+\-_$\]]/; 5557const transformFilter = (node, context) => { 5558 if (!isCompatEnabled("COMPILER_FILTERS", context)) { 5559 return; 5560 } 5561 if (node.type === 5) { 5562 rewriteFilter(node.content, context); 5563 } 5564 if (node.type === 1) { 5565 node.props.forEach((prop) => { 5566 if (prop.type === 7 && prop.name !== "for" && prop.exp) { 5567 rewriteFilter(prop.exp, context); 5568 } 5569 }); 5570 } 5571}; 5572function rewriteFilter(node, context) { 5573 if (node.type === 4) { 5574 parseFilter(node, context); 5575 } else { 5576 for (let i = 0; i < node.children.length; i++) { 5577 const child = node.children[i]; 5578 if (typeof child !== "object") 5579 continue; 5580 if (child.type === 4) { 5581 parseFilter(child, context); 5582 } else if (child.type === 8) { 5583 rewriteFilter(node, context); 5584 } else if (child.type === 5) { 5585 rewriteFilter(child.content, context); 5586 } 5587 } 5588 } 5589} 5590function parseFilter(node, context) { 5591 const exp = node.content; 5592 let inSingle = false; 5593 let inDouble = false; 5594 let inTemplateString = false; 5595 let inRegex = false; 5596 let curly = 0; 5597 let square = 0; 5598 let paren = 0; 5599 let lastFilterIndex = 0; 5600 let c, prev, i, expression, filters = []; 5601 for (i = 0; i < exp.length; i++) { 5602 prev = c; 5603 c = exp.charCodeAt(i); 5604 if (inSingle) { 5605 if (c === 39 && prev !== 92) 5606 inSingle = false; 5607 } else if (inDouble) { 5608 if (c === 34 && prev !== 92) 5609 inDouble = false; 5610 } else if (inTemplateString) { 5611 if (c === 96 && prev !== 92) 5612 inTemplateString = false; 5613 } else if (inRegex) { 5614 if (c === 47 && prev !== 92) 5615 inRegex = false; 5616 } else if (c === 124 && // pipe 5617 exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { 5618 if (expression === void 0) { 5619 lastFilterIndex = i + 1; 5620 expression = exp.slice(0, i).trim(); 5621 } else { 5622 pushFilter(); 5623 } 5624 } else { 5625 switch (c) { 5626 case 34: 5627 inDouble = true; 5628 break; 5629 case 39: 5630 inSingle = true; 5631 break; 5632 case 96: 5633 inTemplateString = true; 5634 break; 5635 case 40: 5636 paren++; 5637 break; 5638 case 41: 5639 paren--; 5640 break; 5641 case 91: 5642 square++; 5643 break; 5644 case 93: 5645 square--; 5646 break; 5647 case 123: 5648 curly++; 5649 break; 5650 case 125: 5651 curly--; 5652 break; 5653 } 5654 if (c === 47) { 5655 let j = i - 1; 5656 let p; 5657 for (; j >= 0; j--) { 5658 p = exp.charAt(j); 5659 if (p !== " ") 5660 break; 5661 } 5662 if (!p || !validDivisionCharRE.test(p)) { 5663 inRegex = true; 5664 } 5665 } 5666 } 5667 } 5668 if (expression === void 0) { 5669 expression = exp.slice(0, i).trim(); 5670 } else if (lastFilterIndex !== 0) { 5671 pushFilter(); 5672 } 5673 function pushFilter() { 5674 filters.push(exp.slice(lastFilterIndex, i).trim()); 5675 lastFilterIndex = i + 1; 5676 } 5677 if (filters.length) { 5678 true && warnDeprecation( 5679 "COMPILER_FILTERS", 5680 context, 5681 node.loc 5682 ); 5683 for (i = 0; i < filters.length; i++) { 5684 expression = wrapFilter(expression, filters[i], context); 5685 } 5686 node.content = expression; 5687 } 5688} 5689function wrapFilter(exp, filter, context) { 5690 context.helper(RESOLVE_FILTER); 5691 const i = filter.indexOf("("); 5692 if (i < 0) { 5693 context.filters.add(filter); 5694 return `${toValidAssetId(filter, "filter")}(${exp})`; 5695 } else { 5696 const name = filter.slice(0, i); 5697 const args = filter.slice(i + 1); 5698 context.filters.add(name); 5699 return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; 5700 } 5701} 5702 5703const seen = /* @__PURE__ */ new WeakSet(); 5704const transformMemo = (node, context) => { 5705 if (node.type === 1) { 5706 const dir = findDir(node, "memo"); 5707 if (!dir || seen.has(node)) { 5708 return; 5709 } 5710 seen.add(node); 5711 return () => { 5712 const codegenNode = node.codegenNode || context.currentNode.codegenNode; 5713 if (codegenNode && codegenNode.type === 13) { 5714 if (node.tagType !== 1) { 5715 convertToBlock(codegenNode, context); 5716 } 5717 node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ 5718 dir.exp, 5719 createFunctionExpression(void 0, codegenNode), 5720 `_cache`, 5721 String(context.cached++) 5722 ]); 5723 } 5724 }; 5725 } 5726}; 5727 5728function getBaseTransformPreset(prefixIdentifiers) { 5729 return [ 5730 [ 5731 transformOnce, 5732 transformIf, 5733 transformMemo, 5734 transformFor, 5735 ...[transformFilter] , 5736 ... true ? [transformExpression] : 0, 5737 transformSlotOutlet, 5738 transformElement, 5739 trackSlotScopes, 5740 transformText 5741 ], 5742 { 5743 on: transformOn, 5744 bind: transformBind, 5745 model: transformModel 5746 } 5747 ]; 5748} 5749function baseCompile(source, options = {}) { 5750 const onError = options.onError || defaultOnError; 5751 const isModuleMode = options.mode === "module"; 5752 { 5753 if (options.prefixIdentifiers === true) { 5754 onError(createCompilerError(47)); 5755 } else if (isModuleMode) { 5756 onError(createCompilerError(48)); 5757 } 5758 } 5759 const prefixIdentifiers = false; 5760 if (options.cacheHandlers) { 5761 onError(createCompilerError(49)); 5762 } 5763 if (options.scopeId && !isModuleMode) { 5764 onError(createCompilerError(50)); 5765 } 5766 const resolvedOptions = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, options, { 5767 prefixIdentifiers 5768 }); 5769 const ast = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(source) ? baseParse(source, resolvedOptions) : source; 5770 const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(); 5771 transform( 5772 ast, 5773 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, resolvedOptions, { 5774 nodeTransforms: [ 5775 ...nodeTransforms, 5776 ...options.nodeTransforms || [] 5777 // user transforms 5778 ], 5779 directiveTransforms: (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)( 5780 {}, 5781 directiveTransforms, 5782 options.directiveTransforms || {} 5783 // user transforms 5784 ) 5785 }) 5786 ); 5787 return generate(ast, resolvedOptions); 5788} 5789 5790const BindingTypes = { 5791 "DATA": "data", 5792 "PROPS": "props", 5793 "PROPS_ALIASED": "props-aliased", 5794 "SETUP_LET": "setup-let", 5795 "SETUP_CONST": "setup-const", 5796 "SETUP_REACTIVE_CONST": "setup-reactive-const", 5797 "SETUP_MAYBE_REF": "setup-maybe-ref", 5798 "SETUP_REF": "setup-ref", 5799 "OPTIONS": "options", 5800 "LITERAL_CONST": "literal-const" 5801}; 5802 5803const noopDirectiveTransform = () => ({ props: [] }); 5804 5805 5806 5807 5808/***/ }), 5809
vendor: 37,471 bytes, lines 5810-6481
5810/***/ "./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js": 5811/*!*************************************************************************!*\ 5812 !*** ./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js ***! 5813 \*************************************************************************/ 5814/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 5815 5816"use strict"; 5817__webpack_require__.r(__webpack_exports__); 5818/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5819/* harmony export */ BASE_TRANSITION: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.BASE_TRANSITION), 5820/* harmony export */ BindingTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.BindingTypes), 5821/* harmony export */ CAMELIZE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CAMELIZE), 5822/* harmony export */ CAPITALIZE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CAPITALIZE), 5823/* harmony export */ CREATE_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_BLOCK), 5824/* harmony export */ CREATE_COMMENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_COMMENT), 5825/* harmony export */ CREATE_ELEMENT_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_ELEMENT_BLOCK), 5826/* harmony export */ CREATE_ELEMENT_VNODE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_ELEMENT_VNODE), 5827/* harmony export */ CREATE_SLOTS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_SLOTS), 5828/* harmony export */ CREATE_STATIC: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_STATIC), 5829/* harmony export */ CREATE_TEXT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_TEXT), 5830/* harmony export */ CREATE_VNODE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_VNODE), 5831/* harmony export */ CompilerDeprecationTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CompilerDeprecationTypes), 5832/* harmony export */ ConstantTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.ConstantTypes), 5833/* harmony export */ DOMDirectiveTransforms: () => (/* binding */ DOMDirectiveTransforms), 5834/* harmony export */ DOMErrorCodes: () => (/* binding */ DOMErrorCodes), 5835/* harmony export */ DOMErrorMessages: () => (/* binding */ DOMErrorMessages), 5836/* harmony export */ DOMNodeTransforms: () => (/* binding */ DOMNodeTransforms), 5837/* harmony export */ ElementTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.ElementTypes), 5838/* harmony export */ ErrorCodes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.ErrorCodes), 5839/* harmony export */ FRAGMENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.FRAGMENT), 5840/* harmony export */ GUARD_REACTIVE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.GUARD_REACTIVE_PROPS), 5841/* harmony export */ IS_MEMO_SAME: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.IS_MEMO_SAME), 5842/* harmony export */ IS_REF: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.IS_REF), 5843/* harmony export */ KEEP_ALIVE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.KEEP_ALIVE), 5844/* harmony export */ MERGE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.MERGE_PROPS), 5845/* harmony export */ NORMALIZE_CLASS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_CLASS), 5846/* harmony export */ NORMALIZE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_PROPS), 5847/* harmony export */ NORMALIZE_STYLE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_STYLE), 5848/* harmony export */ Namespaces: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.Namespaces), 5849/* harmony export */ NodeTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NodeTypes), 5850/* harmony export */ OPEN_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.OPEN_BLOCK), 5851/* harmony export */ POP_SCOPE_ID: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.POP_SCOPE_ID), 5852/* harmony export */ PUSH_SCOPE_ID: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.PUSH_SCOPE_ID), 5853/* harmony export */ RENDER_LIST: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RENDER_LIST), 5854/* harmony export */ RENDER_SLOT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RENDER_SLOT), 5855/* harmony export */ RESOLVE_COMPONENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_COMPONENT), 5856/* harmony export */ RESOLVE_DIRECTIVE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_DIRECTIVE), 5857/* harmony export */ RESOLVE_DYNAMIC_COMPONENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_DYNAMIC_COMPONENT), 5858/* harmony export */ RESOLVE_FILTER: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_FILTER), 5859/* harmony export */ SET_BLOCK_TRACKING: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.SET_BLOCK_TRACKING), 5860/* harmony export */ SUSPENSE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.SUSPENSE), 5861/* harmony export */ TELEPORT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TELEPORT), 5862/* harmony export */ TO_DISPLAY_STRING: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_DISPLAY_STRING), 5863/* harmony export */ TO_HANDLERS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_HANDLERS), 5864/* harmony export */ TO_HANDLER_KEY: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_HANDLER_KEY), 5865/* harmony export */ TRANSITION: () => (/* binding */ TRANSITION), 5866/* harmony export */ TRANSITION_GROUP: () => (/* binding */ TRANSITION_GROUP), 5867/* harmony export */ TS_NODE_TYPES: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TS_NODE_TYPES), 5868/* harmony export */ UNREF: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.UNREF), 5869/* harmony export */ V_MODEL_CHECKBOX: () => (/* binding */ V_MODEL_CHECKBOX), 5870/* harmony export */ V_MODEL_DYNAMIC: () => (/* binding */ V_MODEL_DYNAMIC), 5871/* harmony export */ V_MODEL_RADIO: () => (/* binding */ V_MODEL_RADIO), 5872/* harmony export */ V_MODEL_SELECT: () => (/* binding */ V_MODEL_SELECT), 5873/* harmony export */ V_MODEL_TEXT: () => (/* binding */ V_MODEL_TEXT), 5874/* harmony export */ V_ON_WITH_KEYS: () => (/* binding */ V_ON_WITH_KEYS), 5875/* harmony export */ V_ON_WITH_MODIFIERS: () => (/* binding */ V_ON_WITH_MODIFIERS), 5876/* harmony export */ V_SHOW: () => (/* binding */ V_SHOW), 5877/* harmony export */ WITH_CTX: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_CTX), 5878/* harmony export */ WITH_DIRECTIVES: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_DIRECTIVES), 5879/* harmony export */ WITH_MEMO: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_MEMO), 5880/* harmony export */ advancePositionWithClone: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.advancePositionWithClone), 5881/* harmony export */ advancePositionWithMutation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.advancePositionWithMutation), 5882/* harmony export */ assert: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.assert), 5883/* harmony export */ baseCompile: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseCompile), 5884/* harmony export */ baseParse: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseParse), 5885/* harmony export */ buildDirectiveArgs: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildDirectiveArgs), 5886/* harmony export */ buildProps: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildProps), 5887/* harmony export */ buildSlots: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildSlots), 5888/* harmony export */ checkCompatEnabled: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.checkCompatEnabled), 5889/* harmony export */ compile: () => (/* binding */ compile), 5890/* harmony export */ convertToBlock: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.convertToBlock), 5891/* harmony export */ createArrayExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createArrayExpression), 5892/* harmony export */ createAssignmentExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createAssignmentExpression), 5893/* harmony export */ createBlockStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createBlockStatement), 5894/* harmony export */ createCacheExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCacheExpression), 5895/* harmony export */ createCallExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression), 5896/* harmony export */ createCompilerError: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompilerError), 5897/* harmony export */ createCompoundExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression), 5898/* harmony export */ createConditionalExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createConditionalExpression), 5899/* harmony export */ createDOMCompilerError: () => (/* binding */ createDOMCompilerError), 5900/* harmony export */ createForLoopParams: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createForLoopParams), 5901/* harmony export */ createFunctionExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createFunctionExpression), 5902/* harmony export */ createIfStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createIfStatement), 5903/* harmony export */ createInterpolation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createInterpolation), 5904/* harmony export */ createObjectExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectExpression), 5905/* harmony export */ createObjectProperty: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty), 5906/* harmony export */ createReturnStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createReturnStatement), 5907/* harmony export */ createRoot: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createRoot), 5908/* harmony export */ createSequenceExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSequenceExpression), 5909/* harmony export */ createSimpleExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression), 5910/* harmony export */ createStructuralDirectiveTransform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createStructuralDirectiveTransform), 5911/* harmony export */ createTemplateLiteral: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createTemplateLiteral), 5912/* harmony export */ createTransformContext: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createTransformContext), 5913/* harmony export */ createVNodeCall: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createVNodeCall), 5914/* harmony export */ errorMessages: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.errorMessages), 5915/* harmony export */ extractIdentifiers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.extractIdentifiers), 5916/* harmony export */ findDir: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findDir), 5917/* harmony export */ findProp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findProp), 5918/* harmony export */ forAliasRE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.forAliasRE), 5919/* harmony export */ generate: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.generate), 5920/* harmony export */ generateCodeFrame: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.generateCodeFrame), 5921/* harmony export */ getBaseTransformPreset: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getBaseTransformPreset), 5922/* harmony export */ getConstantType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getConstantType), 5923/* harmony export */ getMemoedVNodeCall: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getMemoedVNodeCall), 5924/* harmony export */ getVNodeBlockHelper: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getVNodeBlockHelper), 5925/* harmony export */ getVNodeHelper: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getVNodeHelper), 5926/* harmony export */ hasDynamicKeyVBind: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasDynamicKeyVBind), 5927/* harmony export */ hasScopeRef: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasScopeRef), 5928/* harmony export */ helperNameMap: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.helperNameMap), 5929/* harmony export */ injectProp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.injectProp), 5930/* harmony export */ isCoreComponent: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isCoreComponent), 5931/* harmony export */ isFunctionType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isFunctionType), 5932/* harmony export */ isInDestructureAssignment: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isInDestructureAssignment), 5933/* harmony export */ isInNewExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isInNewExpression), 5934/* harmony export */ isMemberExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpression), 5935/* harmony export */ isMemberExpressionBrowser: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpressionBrowser), 5936/* harmony export */ isMemberExpressionNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpressionNode), 5937/* harmony export */ isReferencedIdentifier: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isReferencedIdentifier), 5938/* harmony export */ isSimpleIdentifier: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isSimpleIdentifier), 5939/* harmony export */ isSlotOutlet: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isSlotOutlet), 5940/* harmony export */ isStaticArgOf: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticArgOf), 5941/* harmony export */ isStaticExp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp), 5942/* harmony export */ isStaticProperty: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticProperty), 5943/* harmony export */ isStaticPropertyKey: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticPropertyKey), 5944/* harmony export */ isTemplateNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isTemplateNode), 5945/* harmony export */ isText: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isText), 5946/* harmony export */ isVSlot: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isVSlot), 5947/* harmony export */ locStub: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.locStub), 5948/* harmony export */ noopDirectiveTransform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.noopDirectiveTransform), 5949/* harmony export */ parse: () => (/* binding */ parse), 5950/* harmony export */ parserOptions: () => (/* binding */ parserOptions), 5951/* harmony export */ processExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processExpression), 5952/* harmony export */ processFor: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processFor), 5953/* harmony export */ processIf: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processIf), 5954/* harmony export */ processSlotOutlet: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processSlotOutlet), 5955/* harmony export */ registerRuntimeHelpers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeHelpers), 5956/* harmony export */ resolveComponentType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.resolveComponentType), 5957/* harmony export */ stringifyExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.stringifyExpression), 5958/* harmony export */ toValidAssetId: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.toValidAssetId), 5959/* harmony export */ trackSlotScopes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.trackSlotScopes), 5960/* harmony export */ trackVForSlotScopes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.trackVForSlotScopes), 5961/* harmony export */ transform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transform), 5962/* harmony export */ transformBind: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformBind), 5963/* harmony export */ transformElement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformElement), 5964/* harmony export */ transformExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformExpression), 5965/* harmony export */ transformModel: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformModel), 5966/* harmony export */ transformOn: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformOn), 5967/* harmony export */ transformStyle: () => (/* binding */ transformStyle), 5968/* harmony export */ traverseNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.traverseNode), 5969/* harmony export */ unwrapTSNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.unwrapTSNode), 5970/* harmony export */ walkBlockDeclarations: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkBlockDeclarations), 5971/* harmony export */ walkFunctionParams: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkFunctionParams), 5972/* harmony export */ walkIdentifiers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkIdentifiers), 5973/* harmony export */ warnDeprecation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.warnDeprecation) 5974/* harmony export */ }); 5975/* harmony import */ var _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/compiler-core */ "./node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js"); 5976/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); 5977 5978 5979 5980 5981const V_MODEL_RADIO = Symbol( true ? `vModelRadio` : 0); 5982const V_MODEL_CHECKBOX = Symbol( true ? `vModelCheckbox` : 0); 5983const V_MODEL_TEXT = Symbol( true ? `vModelText` : 0); 5984const V_MODEL_SELECT = Symbol( true ? `vModelSelect` : 0); 5985const V_MODEL_DYNAMIC = Symbol( true ? `vModelDynamic` : 0); 5986const V_ON_WITH_MODIFIERS = Symbol( true ? `vOnModifiersGuard` : 0); 5987const V_ON_WITH_KEYS = Symbol( true ? `vOnKeysGuard` : 0); 5988const V_SHOW = Symbol( true ? `vShow` : 0); 5989const TRANSITION = Symbol( true ? `Transition` : 0); 5990const TRANSITION_GROUP = Symbol( true ? `TransitionGroup` : 0); 5991(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeHelpers)({ 5992 [V_MODEL_RADIO]: `vModelRadio`, 5993 [V_MODEL_CHECKBOX]: `vModelCheckbox`, 5994 [V_MODEL_TEXT]: `vModelText`, 5995 [V_MODEL_SELECT]: `vModelSelect`, 5996 [V_MODEL_DYNAMIC]: `vModelDynamic`, 5997 [V_ON_WITH_MODIFIERS]: `withModifiers`, 5998 [V_ON_WITH_KEYS]: `withKeys`, 5999 [V_SHOW]: `vShow`, 6000 [TRANSITION]: `Transition`, 6001 [TRANSITION_GROUP]: `TransitionGroup` 6002}); 6003 6004let decoder; 6005function decodeHtmlBrowser(raw, asAttr = false) { 6006 if (!decoder) { 6007 decoder = document.createElement("div"); 6008 } 6009 if (asAttr) { 6010 decoder.innerHTML = `<div foo="${raw.replace(/"/g, """)}">`; 6011 return decoder.children[0].getAttribute("foo"); 6012 } else { 6013 decoder.innerHTML = raw; 6014 return decoder.textContent; 6015 } 6016} 6017 6018const parserOptions = { 6019 parseMode: "html", 6020 isVoidTag: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.isVoidTag, 6021 isNativeTag: (tag) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isHTMLTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSVGTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isMathMLTag)(tag), 6022 isPreTag: (tag) => tag === "pre", 6023 decodeEntities: decodeHtmlBrowser , 6024 isBuiltInComponent: (tag) => { 6025 if (tag === "Transition" || tag === "transition") { 6026 return TRANSITION; 6027 } else if (tag === "TransitionGroup" || tag === "transition-group") { 6028 return TRANSITION_GROUP; 6029 } 6030 }, 6031 // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher 6032 getNamespace(tag, parent, rootNamespace) { 6033 let ns = parent ? parent.ns : rootNamespace; 6034 if (parent && ns === 2) { 6035 if (parent.tag === "annotation-xml") { 6036 if (tag === "svg") { 6037 return 1; 6038 } 6039 if (parent.props.some( 6040 (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") 6041 )) { 6042 ns = 0; 6043 } 6044 } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { 6045 ns = 0; 6046 } 6047 } else if (parent && ns === 1) { 6048 if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { 6049 ns = 0; 6050 } 6051 } 6052 if (ns === 0) { 6053 if (tag === "svg") { 6054 return 1; 6055 } 6056 if (tag === "math") { 6057 return 2; 6058 } 6059 } 6060 return ns; 6061 } 6062}; 6063 6064const transformStyle = (node) => { 6065 if (node.type === 1) { 6066 node.props.forEach((p, i) => { 6067 if (p.type === 6 && p.name === "style" && p.value) { 6068 node.props[i] = { 6069 type: 7, 6070 name: `bind`, 6071 arg: (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`style`, true, p.loc), 6072 exp: parseInlineCSS(p.value.content, p.loc), 6073 modifiers: [], 6074 loc: p.loc 6075 }; 6076 } 6077 }); 6078 } 6079}; 6080const parseInlineCSS = (cssText, loc) => { 6081 const normalized = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.parseStringStyle)(cssText); 6082 return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)( 6083 JSON.stringify(normalized), 6084 false, 6085 loc, 6086 3 6087 ); 6088}; 6089 6090function createDOMCompilerError(code, loc) { 6091 return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompilerError)( 6092 code, 6093 loc, 6094 true ? DOMErrorMessages : 0 6095 ); 6096} 6097const DOMErrorCodes = { 6098 "X_V_HTML_NO_EXPRESSION": 53, 6099 "53": "X_V_HTML_NO_EXPRESSION", 6100 "X_V_HTML_WITH_CHILDREN": 54, 6101 "54": "X_V_HTML_WITH_CHILDREN", 6102 "X_V_TEXT_NO_EXPRESSION": 55, 6103 "55": "X_V_TEXT_NO_EXPRESSION", 6104 "X_V_TEXT_WITH_CHILDREN": 56, 6105 "56": "X_V_TEXT_WITH_CHILDREN", 6106 "X_V_MODEL_ON_INVALID_ELEMENT": 57, 6107 "57": "X_V_MODEL_ON_INVALID_ELEMENT", 6108 "X_V_MODEL_ARG_ON_ELEMENT": 58, 6109 "58": "X_V_MODEL_ARG_ON_ELEMENT", 6110 "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, 6111 "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", 6112 "X_V_MODEL_UNNECESSARY_VALUE": 60, 6113 "60": "X_V_MODEL_UNNECESSARY_VALUE", 6114 "X_V_SHOW_NO_EXPRESSION": 61, 6115 "61": "X_V_SHOW_NO_EXPRESSION", 6116 "X_TRANSITION_INVALID_CHILDREN": 62, 6117 "62": "X_TRANSITION_INVALID_CHILDREN", 6118 "X_IGNORED_SIDE_EFFECT_TAG": 63, 6119 "63": "X_IGNORED_SIDE_EFFECT_TAG", 6120 "__EXTEND_POINT__": 64, 6121 "64": "__EXTEND_POINT__" 6122}; 6123const DOMErrorMessages = { 6124 [53]: `v-html is missing expression.`, 6125 [54]: `v-html will override element children.`, 6126 [55]: `v-text is missing expression.`, 6127 [56]: `v-text will override element children.`, 6128 [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, 6129 [58]: `v-model argument is not supported on plain elements.`, 6130 [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, 6131 [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, 6132 [61]: `v-show is missing expression.`, 6133 [62]: `<Transition> expects exactly one child element or component.`, 6134 [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` 6135}; 6136 6137const transformVHtml = (dir, node, context) => { 6138 const { exp, loc } = dir; 6139 if (!exp) { 6140 context.onError( 6141 createDOMCompilerError(53, loc) 6142 ); 6143 } 6144 if (node.children.length) { 6145 context.onError( 6146 createDOMCompilerError(54, loc) 6147 ); 6148 node.children.length = 0; 6149 } 6150 return { 6151 props: [ 6152 (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)( 6153 (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`innerHTML`, true, loc), 6154 exp || (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)("", true) 6155 ) 6156 ] 6157 }; 6158}; 6159 6160const transformVText = (dir, node, context) => { 6161 const { exp, loc } = dir; 6162 if (!exp) { 6163 context.onError( 6164 createDOMCompilerError(55, loc) 6165 ); 6166 } 6167 if (node.children.length) { 6168 context.onError( 6169 createDOMCompilerError(56, loc) 6170 ); 6171 node.children.length = 0; 6172 } 6173 return { 6174 props: [ 6175 (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)( 6176 (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`textContent`, true), 6177 exp ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getConstantType)(exp, context) > 0 ? exp : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)( 6178 context.helperString(_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_DISPLAY_STRING), 6179 [exp], 6180 loc 6181 ) : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)("", true) 6182 ) 6183 ] 6184 }; 6185}; 6186 6187const transformModel = (dir, node, context) => { 6188 const baseResult = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformModel)(dir, node, context); 6189 if (!baseResult.props.length || node.tagType === 1) { 6190 return baseResult; 6191 } 6192 if (dir.arg) { 6193 context.onError( 6194 createDOMCompilerError( 6195 58, 6196 dir.arg.loc 6197 ) 6198 ); 6199 } 6200 function checkDuplicatedValue() { 6201 const value = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findDir)(node, "bind"); 6202 if (value && (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticArgOf)(value.arg, "value")) { 6203 context.onError( 6204 createDOMCompilerError( 6205 60, 6206 value.loc 6207 ) 6208 ); 6209 } 6210 } 6211 const { tag } = node; 6212 const isCustomElement = context.isCustomElement(tag); 6213 if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { 6214 let directiveToUse = V_MODEL_TEXT; 6215 let isInvalidType = false; 6216 if (tag === "input" || isCustomElement) { 6217 const type = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findProp)(node, `type`); 6218 if (type) { 6219 if (type.type === 7) { 6220 directiveToUse = V_MODEL_DYNAMIC; 6221 } else if (type.value) { 6222 switch (type.value.content) { 6223 case "radio": 6224 directiveToUse = V_MODEL_RADIO; 6225 break; 6226 case "checkbox": 6227 directiveToUse = V_MODEL_CHECKBOX; 6228 break; 6229 case "file": 6230 isInvalidType = true; 6231 context.onError( 6232 createDOMCompilerError( 6233 59, 6234 dir.loc 6235 ) 6236 ); 6237 break; 6238 default: 6239 true && checkDuplicatedValue(); 6240 break; 6241 } 6242 } 6243 } else if ((0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasDynamicKeyVBind)(node)) { 6244 directiveToUse = V_MODEL_DYNAMIC; 6245 } else { 6246 true && checkDuplicatedValue(); 6247 } 6248 } else if (tag === "select") { 6249 directiveToUse = V_MODEL_SELECT; 6250 } else { 6251 true && checkDuplicatedValue(); 6252 } 6253 if (!isInvalidType) { 6254 baseResult.needRuntime = context.helper(directiveToUse); 6255 } 6256 } else { 6257 context.onError( 6258 createDOMCompilerError( 6259 57, 6260 dir.loc 6261 ) 6262 ); 6263 } 6264 baseResult.props = baseResult.props.filter( 6265 (p) => !(p.key.type === 4 && p.key.content === "modelValue") 6266 ); 6267 return baseResult; 6268}; 6269 6270const isEventOptionModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)(`passive,once,capture`); 6271const isNonKeyModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( 6272 // event propagation management 6273 `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` 6274); 6275const maybeKeyModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)("left,right"); 6276const isKeyboardEvent = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( 6277 `onkeyup,onkeydown,onkeypress`, 6278 true 6279); 6280const resolveModifiers = (key, modifiers, context, loc) => { 6281 const keyModifiers = []; 6282 const nonKeyModifiers = []; 6283 const eventOptionModifiers = []; 6284 for (let i = 0; i < modifiers.length; i++) { 6285 const modifier = modifiers[i]; 6286 if (modifier === "native" && (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.checkCompatEnabled)( 6287 "COMPILER_V_ON_NATIVE", 6288 context, 6289 loc 6290 )) { 6291 eventOptionModifiers.push(modifier); 6292 } else if (isEventOptionModifier(modifier)) { 6293 eventOptionModifiers.push(modifier); 6294 } else { 6295 if (maybeKeyModifier(modifier)) { 6296 if ((0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key)) { 6297 if (isKeyboardEvent(key.content)) { 6298 keyModifiers.push(modifier); 6299 } else { 6300 nonKeyModifiers.push(modifier); 6301 } 6302 } else { 6303 keyModifiers.push(modifier); 6304 nonKeyModifiers.push(modifier); 6305 } 6306 } else { 6307 if (isNonKeyModifier(modifier)) { 6308 nonKeyModifiers.push(modifier); 6309 } else { 6310 keyModifiers.push(modifier); 6311 } 6312 } 6313 } 6314 } 6315 return { 6316 keyModifiers, 6317 nonKeyModifiers, 6318 eventOptionModifiers 6319 }; 6320}; 6321const transformClick = (key, event) => { 6322 const isStaticClick = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) && key.content.toLowerCase() === "onclick"; 6323 return isStaticClick ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(event, true) : key.type !== 4 ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression)([ 6324 `(`, 6325 key, 6326 `) === "onClick" ? "${event}" : (`, 6327 key, 6328 `)` 6329 ]) : key; 6330}; 6331const transformOn = (dir, node, context) => { 6332 return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformOn)(dir, node, context, (baseResult) => { 6333 const { modifiers } = dir; 6334 if (!modifiers.length) 6335 return baseResult; 6336 let { key, value: handlerExp } = baseResult.props[0]; 6337 const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); 6338 if (nonKeyModifiers.includes("right")) { 6339 key = transformClick(key, `onContextmenu`); 6340 } 6341 if (nonKeyModifiers.includes("middle")) { 6342 key = transformClick(key, `onMouseup`); 6343 } 6344 if (nonKeyModifiers.length) { 6345 handlerExp = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)(context.helper(V_ON_WITH_MODIFIERS), [ 6346 handlerExp, 6347 JSON.stringify(nonKeyModifiers) 6348 ]); 6349 } 6350 if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard 6351 (!(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) || isKeyboardEvent(key.content))) { 6352 handlerExp = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)(context.helper(V_ON_WITH_KEYS), [ 6353 handlerExp, 6354 JSON.stringify(keyModifiers) 6355 ]); 6356 } 6357 if (eventOptionModifiers.length) { 6358 const modifierPostfix = eventOptionModifiers.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize).join(""); 6359 key = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`${key.content}${modifierPostfix}`, true) : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression)([`(`, key, `) + "${modifierPostfix}"`]); 6360 } 6361 return { 6362 props: [(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)(key, handlerExp)] 6363 }; 6364 }); 6365}; 6366 6367const transformShow = (dir, node, context) => { 6368 const { exp, loc } = dir; 6369 if (!exp) { 6370 context.onError( 6371 createDOMCompilerError(61, loc) 6372 ); 6373 } 6374 return { 6375 props: [], 6376 needRuntime: context.helper(V_SHOW) 6377 }; 6378}; 6379 6380const transformTransition = (node, context) => { 6381 if (node.type === 1 && node.tagType === 1) { 6382 const component = context.isBuiltInComponent(node.tag); 6383 if (component === TRANSITION) { 6384 return () => { 6385 if (!node.children.length) { 6386 return; 6387 } 6388 if (hasMultipleChildren(node)) { 6389 context.onError( 6390 createDOMCompilerError( 6391 62, 6392 { 6393 start: node.children[0].loc.start, 6394 end: node.children[node.children.length - 1].loc.end, 6395 source: "" 6396 } 6397 ) 6398 ); 6399 } 6400 const child = node.children[0]; 6401 if (child.type === 1) { 6402 for (const p of child.props) { 6403 if (p.type === 7 && p.name === "show") { 6404 node.props.push({ 6405 type: 6, 6406 name: "persisted", 6407 nameLoc: node.loc, 6408 value: void 0, 6409 loc: node.loc 6410 }); 6411 } 6412 } 6413 } 6414 }; 6415 } 6416 } 6417}; 6418function hasMultipleChildren(node) { 6419 const children = node.children = node.children.filter( 6420 (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) 6421 ); 6422 const child = children[0]; 6423 return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); 6424} 6425 6426const ignoreSideEffectTags = (node, context) => { 6427 if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { 6428 true && context.onError( 6429 createDOMCompilerError( 6430 63, 6431 node.loc 6432 ) 6433 ); 6434 context.removeNode(); 6435 } 6436}; 6437 6438const DOMNodeTransforms = [ 6439 transformStyle, 6440 ... true ? [transformTransition] : 0 6441]; 6442const DOMDirectiveTransforms = { 6443 cloak: _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.noopDirectiveTransform, 6444 html: transformVHtml, 6445 text: transformVText, 6446 model: transformModel, 6447 // override compiler-core 6448 on: transformOn, 6449 // override compiler-core 6450 show: transformShow 6451}; 6452function compile(src, options = {}) { 6453 return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseCompile)( 6454 src, 6455 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, parserOptions, options, { 6456 nodeTransforms: [ 6457 // ignore <script> and <tag> 6458 // this is not put inside DOMNodeTransforms because that list is used 6459 // by compiler-ssr to generate vnode fallback branches 6460 ignoreSideEffectTags, 6461 ...DOMNodeTransforms, 6462 ...options.nodeTransforms || [] 6463 ], 6464 directiveTransforms: (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( 6465 {}, 6466 DOMDirectiveTransforms, 6467 options.directiveTransforms || {} 6468 ), 6469 transformHoist: null 6470 }) 6471 ); 6472} 6473function parse(template, options = {}) { 6474 return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseParse)(template, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, parserOptions, options)); 6475} 6476 6477 6478 6479 6480/***/ }), 6481
vendor: 37,993 bytes, lines 6482-7758
6482/***/ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js": 6483/*!*********************************************************************!*\ 6484 !*** ./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js ***! 6485 \*********************************************************************/ 6486/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 6487 6488"use strict"; 6489__webpack_require__.r(__webpack_exports__); 6490/* harmony export */ __webpack_require__.d(__webpack_exports__, { 6491/* harmony export */ EffectScope: () => (/* binding */ EffectScope), 6492/* harmony export */ ITERATE_KEY: () => (/* binding */ ITERATE_KEY), 6493/* harmony export */ ReactiveEffect: () => (/* binding */ ReactiveEffect), 6494/* harmony export */ ReactiveFlags: () => (/* binding */ ReactiveFlags), 6495/* harmony export */ TrackOpTypes: () => (/* binding */ TrackOpTypes), 6496/* harmony export */ TriggerOpTypes: () => (/* binding */ TriggerOpTypes), 6497/* harmony export */ computed: () => (/* binding */ computed), 6498/* harmony export */ customRef: () => (/* binding */ customRef), 6499/* harmony export */ deferredComputed: () => (/* binding */ deferredComputed), 6500/* harmony export */ effect: () => (/* binding */ effect), 6501/* harmony export */ effectScope: () => (/* binding */ effectScope), 6502/* harmony export */ enableTracking: () => (/* binding */ enableTracking), 6503/* harmony export */ getCurrentScope: () => (/* binding */ getCurrentScope), 6504/* harmony export */ isProxy: () => (/* binding */ isProxy), 6505/* harmony export */ isReactive: () => (/* binding */ isReactive), 6506/* harmony export */ isReadonly: () => (/* binding */ isReadonly), 6507/* harmony export */ isRef: () => (/* binding */ isRef), 6508/* harmony export */ isShallow: () => (/* binding */ isShallow), 6509/* harmony export */ markRaw: () => (/* binding */ markRaw), 6510/* harmony export */ onScopeDispose: () => (/* binding */ onScopeDispose), 6511/* harmony export */ pauseScheduling: () => (/* binding */ pauseScheduling), 6512/* harmony export */ pauseTracking: () => (/* binding */ pauseTracking), 6513/* harmony export */ proxyRefs: () => (/* binding */ proxyRefs), 6514/* harmony export */ reactive: () => (/* binding */ reactive), 6515/* harmony export */ readonly: () => (/* binding */ readonly), 6516/* harmony export */ ref: () => (/* binding */ ref), 6517/* harmony export */ resetScheduling: () => (/* binding */ resetScheduling), 6518/* harmony export */ resetTracking: () => (/* binding */ resetTracking), 6519/* harmony export */ shallowReactive: () => (/* binding */ shallowReactive), 6520/* harmony export */ shallowReadonly: () => (/* binding */ shallowReadonly), 6521/* harmony export */ shallowRef: () => (/* binding */ shallowRef), 6522/* harmony export */ stop: () => (/* binding */ stop), 6523/* harmony export */ toRaw: () => (/* binding */ toRaw), 6524/* harmony export */ toRef: () => (/* binding */ toRef), 6525/* harmony export */ toRefs: () => (/* binding */ toRefs), 6526/* harmony export */ toValue: () => (/* binding */ toValue), 6527/* harmony export */ track: () => (/* binding */ track), 6528/* harmony export */ trigger: () => (/* binding */ trigger), 6529/* harmony export */ triggerRef: () => (/* binding */ triggerRef), 6530/* harmony export */ unref: () => (/* binding */ unref) 6531/* harmony export */ }); 6532/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); 6533 6534 6535function warn(msg, ...args) { 6536 console.warn(`[Vue warn] ${msg}`, ...args); 6537} 6538 6539let activeEffectScope; 6540class EffectScope { 6541 constructor(detached = false) { 6542 this.detached = detached; 6543 /** 6544 * @internal 6545 */ 6546 this._active = true; 6547 /** 6548 * @internal 6549 */ 6550 this.effects = []; 6551 /** 6552 * @internal 6553 */ 6554 this.cleanups = []; 6555 this.parent = activeEffectScope; 6556 if (!detached && activeEffectScope) { 6557 this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( 6558 this 6559 ) - 1; 6560 } 6561 } 6562 get active() { 6563 return this._active; 6564 } 6565 run(fn) { 6566 if (this._active) { 6567 const currentEffectScope = activeEffectScope; 6568 try { 6569 activeEffectScope = this; 6570 return fn(); 6571 } finally { 6572 activeEffectScope = currentEffectScope; 6573 } 6574 } else if (true) { 6575 warn(`cannot run an inactive effect scope.`); 6576 } 6577 } 6578 /** 6579 * This should only be called on non-detached scopes 6580 * @internal 6581 */ 6582 on() { 6583 activeEffectScope = this; 6584 } 6585 /** 6586 * This should only be called on non-detached scopes 6587 * @internal 6588 */ 6589 off() { 6590 activeEffectScope = this.parent; 6591 } 6592 stop(fromParent) { 6593 if (this._active) { 6594 let i, l; 6595 for (i = 0, l = this.effects.length; i < l; i++) { 6596 this.effects[i].stop(); 6597 } 6598 for (i = 0, l = this.cleanups.length; i < l; i++) { 6599 this.cleanups[i](); 6600 } 6601 if (this.scopes) { 6602 for (i = 0, l = this.scopes.length; i < l; i++) { 6603 this.scopes[i].stop(true); 6604 } 6605 } 6606 if (!this.detached && this.parent && !fromParent) { 6607 const last = this.parent.scopes.pop(); 6608 if (last && last !== this) { 6609 this.parent.scopes[this.index] = last; 6610 last.index = this.index; 6611 } 6612 } 6613 this.parent = void 0; 6614 this._active = false; 6615 } 6616 } 6617} 6618function effectScope(detached) { 6619 return new EffectScope(detached); 6620} 6621function recordEffectScope(effect, scope = activeEffectScope) { 6622 if (scope && scope.active) { 6623 scope.effects.push(effect); 6624 } 6625} 6626function getCurrentScope() { 6627 return activeEffectScope; 6628} 6629function onScopeDispose(fn) { 6630 if (activeEffectScope) { 6631 activeEffectScope.cleanups.push(fn); 6632 } else if (true) { 6633 warn( 6634 `onScopeDispose() is called when there is no active effect scope to be associated with.` 6635 ); 6636 } 6637} 6638 6639let activeEffect; 6640class ReactiveEffect { 6641 constructor(fn, trigger, scheduler, scope) { 6642 this.fn = fn; 6643 this.trigger = trigger; 6644 this.scheduler = scheduler; 6645 this.active = true; 6646 this.deps = []; 6647 /** 6648 * @internal 6649 */ 6650 this._dirtyLevel = 3; 6651 /** 6652 * @internal 6653 */ 6654 this._trackId = 0; 6655 /** 6656 * @internal 6657 */ 6658 this._runnings = 0; 6659 /** 6660 * @internal 6661 */ 6662 this._queryings = 0; 6663 /** 6664 * @internal 6665 */ 6666 this._depsLength = 0; 6667 recordEffectScope(this, scope); 6668 } 6669 get dirty() { 6670 if (this._dirtyLevel === 1) { 6671 this._dirtyLevel = 0; 6672 this._queryings++; 6673 pauseTracking(); 6674 for (const dep of this.deps) { 6675 if (dep.computed) { 6676 triggerComputed(dep.computed); 6677 if (this._dirtyLevel >= 2) { 6678 break; 6679 } 6680 } 6681 } 6682 resetTracking(); 6683 this._queryings--; 6684 } 6685 return this._dirtyLevel >= 2; 6686 } 6687 set dirty(v) { 6688 this._dirtyLevel = v ? 3 : 0; 6689 } 6690 run() { 6691 this._dirtyLevel = 0; 6692 if (!this.active) { 6693 return this.fn(); 6694 } 6695 let lastShouldTrack = shouldTrack; 6696 let lastEffect = activeEffect; 6697 try { 6698 shouldTrack = true; 6699 activeEffect = this; 6700 this._runnings++; 6701 preCleanupEffect(this); 6702 return this.fn(); 6703 } finally { 6704 postCleanupEffect(this); 6705 this._runnings--; 6706 activeEffect = lastEffect; 6707 shouldTrack = lastShouldTrack; 6708 } 6709 } 6710 stop() { 6711 var _a; 6712 if (this.active) { 6713 preCleanupEffect(this); 6714 postCleanupEffect(this); 6715 (_a = this.onStop) == null ? void 0 : _a.call(this); 6716 this.active = false; 6717 } 6718 } 6719} 6720function triggerComputed(computed) { 6721 return computed.value; 6722} 6723function preCleanupEffect(effect2) { 6724 effect2._trackId++; 6725 effect2._depsLength = 0; 6726} 6727function postCleanupEffect(effect2) { 6728 if (effect2.deps && effect2.deps.length > effect2._depsLength) { 6729 for (let i = effect2._depsLength; i < effect2.deps.length; i++) { 6730 cleanupDepEffect(effect2.deps[i], effect2); 6731 } 6732 effect2.deps.length = effect2._depsLength; 6733 } 6734} 6735function cleanupDepEffect(dep, effect2) { 6736 const trackId = dep.get(effect2); 6737 if (trackId !== void 0 && effect2._trackId !== trackId) { 6738 dep.delete(effect2); 6739 if (dep.size === 0) { 6740 dep.cleanup(); 6741 } 6742 } 6743} 6744function effect(fn, options) { 6745 if (fn.effect instanceof ReactiveEffect) { 6746 fn = fn.effect.fn; 6747 } 6748 const _effect = new ReactiveEffect(fn, _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP, () => { 6749 if (_effect.dirty) { 6750 _effect.run(); 6751 } 6752 }); 6753 if (options) { 6754 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)(_effect, options); 6755 if (options.scope) 6756 recordEffectScope(_effect, options.scope); 6757 } 6758 if (!options || !options.lazy) { 6759 _effect.run(); 6760 } 6761 const runner = _effect.run.bind(_effect); 6762 runner.effect = _effect; 6763 return runner; 6764} 6765function stop(runner) { 6766 runner.effect.stop(); 6767} 6768let shouldTrack = true; 6769let pauseScheduleStack = 0; 6770const trackStack = []; 6771function pauseTracking() { 6772 trackStack.push(shouldTrack); 6773 shouldTrack = false; 6774} 6775function enableTracking() { 6776 trackStack.push(shouldTrack); 6777 shouldTrack = true; 6778} 6779function resetTracking() { 6780 const last = trackStack.pop(); 6781 shouldTrack = last === void 0 ? true : last; 6782} 6783function pauseScheduling() { 6784 pauseScheduleStack++; 6785} 6786function resetScheduling() { 6787 pauseScheduleStack--; 6788 while (!pauseScheduleStack && queueEffectSchedulers.length) { 6789 queueEffectSchedulers.shift()(); 6790 } 6791} 6792function trackEffect(effect2, dep, debuggerEventExtraInfo) { 6793 var _a; 6794 if (dep.get(effect2) !== effect2._trackId) { 6795 dep.set(effect2, effect2._trackId); 6796 const oldDep = effect2.deps[effect2._depsLength]; 6797 if (oldDep !== dep) { 6798 if (oldDep) { 6799 cleanupDepEffect(oldDep, effect2); 6800 } 6801 effect2.deps[effect2._depsLength++] = dep; 6802 } else { 6803 effect2._depsLength++; 6804 } 6805 if (true) { 6806 (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({ effect: effect2 }, debuggerEventExtraInfo)); 6807 } 6808 } 6809} 6810const queueEffectSchedulers = []; 6811function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) { 6812 var _a; 6813 pauseScheduling(); 6814 for (const effect2 of dep.keys()) { 6815 if (!effect2.allowRecurse && effect2._runnings) { 6816 continue; 6817 } 6818 if (effect2._dirtyLevel < dirtyLevel && (!effect2._runnings || dirtyLevel !== 2)) { 6819 const lastDirtyLevel = effect2._dirtyLevel; 6820 effect2._dirtyLevel = dirtyLevel; 6821 if (lastDirtyLevel === 0 && (!effect2._queryings || dirtyLevel !== 2)) { 6822 if (true) { 6823 (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({ effect: effect2 }, debuggerEventExtraInfo)); 6824 } 6825 effect2.trigger(); 6826 if (effect2.scheduler) { 6827 queueEffectSchedulers.push(effect2.scheduler); 6828 } 6829 } 6830 } 6831 } 6832 resetScheduling(); 6833} 6834 6835const createDep = (cleanup, computed) => { 6836 const dep = /* @__PURE__ */ new Map(); 6837 dep.cleanup = cleanup; 6838 dep.computed = computed; 6839 return dep; 6840}; 6841 6842const targetMap = /* @__PURE__ */ new WeakMap(); 6843const ITERATE_KEY = Symbol( true ? "iterate" : 0); 6844const MAP_KEY_ITERATE_KEY = Symbol( true ? "Map key iterate" : 0); 6845function track(target, type, key) { 6846 if (shouldTrack && activeEffect) { 6847 let depsMap = targetMap.get(target); 6848 if (!depsMap) { 6849 targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); 6850 } 6851 let dep = depsMap.get(key); 6852 if (!dep) { 6853 depsMap.set(key, dep = createDep(() => depsMap.delete(key))); 6854 } 6855 trackEffect( 6856 activeEffect, 6857 dep, 6858 true ? { 6859 target, 6860 type, 6861 key 6862 } : 0 6863 ); 6864 } 6865} 6866function trigger(target, type, key, newValue, oldValue, oldTarget) { 6867 const depsMap = targetMap.get(target); 6868 if (!depsMap) { 6869 return; 6870 } 6871 let deps = []; 6872 if (type === "clear") { 6873 deps = [...depsMap.values()]; 6874 } else if (key === "length" && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { 6875 const newLength = Number(newValue); 6876 depsMap.forEach((dep, key2) => { 6877 if (key2 === "length" || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key2) && key2 >= newLength) { 6878 deps.push(dep); 6879 } 6880 }); 6881 } else { 6882 if (key !== void 0) { 6883 deps.push(depsMap.get(key)); 6884 } 6885 switch (type) { 6886 case "add": 6887 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { 6888 deps.push(depsMap.get(ITERATE_KEY)); 6889 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { 6890 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); 6891 } 6892 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key)) { 6893 deps.push(depsMap.get("length")); 6894 } 6895 break; 6896 case "delete": 6897 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { 6898 deps.push(depsMap.get(ITERATE_KEY)); 6899 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { 6900 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); 6901 } 6902 } 6903 break; 6904 case "set": 6905 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { 6906 deps.push(depsMap.get(ITERATE_KEY)); 6907 } 6908 break; 6909 } 6910 } 6911 pauseScheduling(); 6912 for (const dep of deps) { 6913 if (dep) { 6914 triggerEffects( 6915 dep, 6916 3, 6917 true ? { 6918 target, 6919 type, 6920 key, 6921 newValue, 6922 oldValue, 6923 oldTarget 6924 } : 0 6925 ); 6926 } 6927 } 6928 resetScheduling(); 6929} 6930function getDepFromReactive(object, key) { 6931 var _a; 6932 return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key); 6933} 6934 6935const isNonTrackableKeys = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.makeMap)(`__proto__,__v_isRef,__isVue`); 6936const builtInSymbols = new Set( 6937 /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol) 6938); 6939const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); 6940function createArrayInstrumentations() { 6941 const instrumentations = {}; 6942 ["includes", "indexOf", "lastIndexOf"].forEach((key) => { 6943 instrumentations[key] = function(...args) { 6944 const arr = toRaw(this); 6945 for (let i = 0, l = this.length; i < l; i++) { 6946 track(arr, "get", i + ""); 6947 } 6948 const res = arr[key](...args); 6949 if (res === -1 || res === false) { 6950 return arr[key](...args.map(toRaw)); 6951 } else { 6952 return res; 6953 } 6954 }; 6955 }); 6956 ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { 6957 instrumentations[key] = function(...args) { 6958 pauseTracking(); 6959 pauseScheduling(); 6960 const res = toRaw(this)[key].apply(this, args); 6961 resetScheduling(); 6962 resetTracking(); 6963 return res; 6964 }; 6965 }); 6966 return instrumentations; 6967} 6968function hasOwnProperty(key) { 6969 const obj = toRaw(this); 6970 track(obj, "has", key); 6971 return obj.hasOwnProperty(key); 6972} 6973class BaseReactiveHandler { 6974 constructor(_isReadonly = false, _shallow = false) { 6975 this._isReadonly = _isReadonly; 6976 this._shallow = _shallow; 6977 } 6978 get(target, key, receiver) { 6979 const isReadonly2 = this._isReadonly, shallow = this._shallow; 6980 if (key === "__v_isReactive") { 6981 return !isReadonly2; 6982 } else if (key === "__v_isReadonly") { 6983 return isReadonly2; 6984 } else if (key === "__v_isShallow") { 6985 return shallow; 6986 } else if (key === "__v_raw") { 6987 if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype 6988 // this means the reciever is a user proxy of the reactive proxy 6989 Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { 6990 return target; 6991 } 6992 return; 6993 } 6994 const targetIsArray = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target); 6995 if (!isReadonly2) { 6996 if (targetIsArray && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(arrayInstrumentations, key)) { 6997 return Reflect.get(arrayInstrumentations, key, receiver); 6998 } 6999 if (key === "hasOwnProperty") { 7000 return hasOwnProperty; 7001 } 7002 } 7003 const res = Reflect.get(target, key, receiver); 7004 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { 7005 return res; 7006 } 7007 if (!isReadonly2) { 7008 track(target, "get", key); 7009 } 7010 if (shallow) { 7011 return res; 7012 } 7013 if (isRef(res)) { 7014 return targetIsArray && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key) ? res : res.value; 7015 } 7016 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(res)) { 7017 return isReadonly2 ? readonly(res) : reactive(res); 7018 } 7019 return res; 7020 } 7021} 7022class MutableReactiveHandler extends BaseReactiveHandler { 7023 constructor(shallow = false) { 7024 super(false, shallow); 7025 } 7026 set(target, key, value, receiver) { 7027 let oldValue = target[key]; 7028 if (!this._shallow) { 7029 const isOldValueReadonly = isReadonly(oldValue); 7030 if (!isShallow(value) && !isReadonly(value)) { 7031 oldValue = toRaw(oldValue); 7032 value = toRaw(value); 7033 } 7034 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) && isRef(oldValue) && !isRef(value)) { 7035 if (isOldValueReadonly) { 7036 return false; 7037 } else { 7038 oldValue.value = value; 7039 return true; 7040 } 7041 } 7042 } 7043 const hadKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key) ? Number(key) < target.length : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(target, key); 7044 const result = Reflect.set(target, key, value, receiver); 7045 if (target === toRaw(receiver)) { 7046 if (!hadKey) { 7047 trigger(target, "add", key, value); 7048 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(value, oldValue)) { 7049 trigger(target, "set", key, value, oldValue); 7050 } 7051 } 7052 return result; 7053 } 7054 deleteProperty(target, key) { 7055 const hadKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(target, key); 7056 const oldValue = target[key]; 7057 const result = Reflect.deleteProperty(target, key); 7058 if (result && hadKey) { 7059 trigger(target, "delete", key, void 0, oldValue); 7060 } 7061 return result; 7062 } 7063 has(target, key) { 7064 const result = Reflect.has(target, key); 7065 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) || !builtInSymbols.has(key)) { 7066 track(target, "has", key); 7067 } 7068 return result; 7069 } 7070 ownKeys(target) { 7071 track( 7072 target, 7073 "iterate", 7074 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) ? "length" : ITERATE_KEY 7075 ); 7076 return Reflect.ownKeys(target); 7077 } 7078} 7079class ReadonlyReactiveHandler extends BaseReactiveHandler { 7080 constructor(shallow = false) { 7081 super(true, shallow); 7082 } 7083 set(target, key) { 7084 if (true) { 7085 warn( 7086 `Set operation on key "${String(key)}" failed: target is readonly.`, 7087 target 7088 ); 7089 } 7090 return true; 7091 } 7092 deleteProperty(target, key) { 7093 if (true) { 7094 warn( 7095 `Delete operation on key "${String(key)}" failed: target is readonly.`, 7096 target 7097 ); 7098 } 7099 return true; 7100 } 7101} 7102const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); 7103const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); 7104const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler( 7105 true 7106); 7107const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); 7108 7109const toShallow = (value) => value; 7110const getProto = (v) => Reflect.getPrototypeOf(v); 7111function get(target, key, isReadonly = false, isShallow = false) { 7112 target = target["__v_raw"]; 7113 const rawTarget = toRaw(target); 7114 const rawKey = toRaw(key); 7115 if (!isReadonly) { 7116 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(key, rawKey)) { 7117 track(rawTarget, "get", key); 7118 } 7119 track(rawTarget, "get", rawKey); 7120 } 7121 const { has: has2 } = getProto(rawTarget); 7122 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; 7123 if (has2.call(rawTarget, key)) { 7124 return wrap(target.get(key)); 7125 } else if (has2.call(rawTarget, rawKey)) { 7126 return wrap(target.get(rawKey)); 7127 } else if (target !== rawTarget) { 7128 target.get(key); 7129 } 7130} 7131function has(key, isReadonly = false) { 7132 const target = this["__v_raw"]; 7133 const rawTarget = toRaw(target); 7134 const rawKey = toRaw(key); 7135 if (!isReadonly) { 7136 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(key, rawKey)) { 7137 track(rawTarget, "has", key); 7138 } 7139 track(rawTarget, "has", rawKey); 7140 } 7141 return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); 7142} 7143function size(target, isReadonly = false) { 7144 target = target["__v_raw"]; 7145 !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY); 7146 return Reflect.get(target, "size", target); 7147} 7148function add(value) { 7149 value = toRaw(value); 7150 const target = toRaw(this); 7151 const proto = getProto(target); 7152 const hadKey = proto.has.call(target, value); 7153 if (!hadKey) { 7154 target.add(value); 7155 trigger(target, "add", value, value); 7156 } 7157 return this; 7158} 7159function set(key, value) { 7160 value = toRaw(value); 7161 const target = toRaw(this); 7162 const { has: has2, get: get2 } = getProto(target); 7163 let hadKey = has2.call(target, key); 7164 if (!hadKey) { 7165 key = toRaw(key); 7166 hadKey = has2.call(target, key); 7167 } else if (true) { 7168 checkIdentityKeys(target, has2, key); 7169 } 7170 const oldValue = get2.call(target, key); 7171 target.set(key, value); 7172 if (!hadKey) { 7173 trigger(target, "add", key, value); 7174 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(value, oldValue)) { 7175 trigger(target, "set", key, value, oldValue); 7176 } 7177 return this; 7178} 7179function deleteEntry(key) { 7180 const target = toRaw(this); 7181 const { has: has2, get: get2 } = getProto(target); 7182 let hadKey = has2.call(target, key); 7183 if (!hadKey) { 7184 key = toRaw(key); 7185 hadKey = has2.call(target, key); 7186 } else if (true) { 7187 checkIdentityKeys(target, has2, key); 7188 } 7189 const oldValue = get2 ? get2.call(target, key) : void 0; 7190 const result = target.delete(key); 7191 if (hadKey) { 7192 trigger(target, "delete", key, void 0, oldValue); 7193 } 7194 return result; 7195} 7196function clear() { 7197 const target = toRaw(this); 7198 const hadItems = target.size !== 0; 7199 const oldTarget = true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target) ? new Map(target) : new Set(target) : 0; 7200 const result = target.clear(); 7201 if (hadItems) { 7202 trigger(target, "clear", void 0, void 0, oldTarget); 7203 } 7204 return result; 7205} 7206function createForEach(isReadonly, isShallow) { 7207 return function forEach(callback, thisArg) { 7208 const observed = this; 7209 const target = observed["__v_raw"]; 7210 const rawTarget = toRaw(target); 7211 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; 7212 !isReadonly && track(rawTarget, "iterate", ITERATE_KEY); 7213 return target.forEach((value, key) => { 7214 return callback.call(thisArg, wrap(value), wrap(key), observed); 7215 }); 7216 }; 7217} 7218function createIterableMethod(method, isReadonly, isShallow) { 7219 return function(...args) { 7220 const target = this["__v_raw"]; 7221 const rawTarget = toRaw(target); 7222 const targetIsMap = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(rawTarget); 7223 const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; 7224 const isKeyOnly = method === "keys" && targetIsMap; 7225 const innerIterator = target[method](...args); 7226 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; 7227 !isReadonly && track( 7228 rawTarget, 7229 "iterate", 7230 isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY 7231 ); 7232 return { 7233 // iterator protocol 7234 next() { 7235 const { value, done } = innerIterator.next(); 7236 return done ? { value, done } : { 7237 value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), 7238 done 7239 }; 7240 }, 7241 // iterable protocol 7242 [Symbol.iterator]() { 7243 return this; 7244 } 7245 }; 7246 }; 7247} 7248function createReadonlyMethod(type) { 7249 return function(...args) { 7250 if (true) { 7251 const key = args[0] ? `on key "${args[0]}" ` : ``; 7252 console.warn( 7253 `${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.capitalize)(type)} operation ${key}failed: target is readonly.`, 7254 toRaw(this) 7255 ); 7256 } 7257 return type === "delete" ? false : type === "clear" ? void 0 : this; 7258 }; 7259} 7260function createInstrumentations() { 7261 const mutableInstrumentations2 = { 7262 get(key) { 7263 return get(this, key); 7264 }, 7265 get size() { 7266 return size(this); 7267 }, 7268 has, 7269 add, 7270 set, 7271 delete: deleteEntry, 7272 clear, 7273 forEach: createForEach(false, false) 7274 }; 7275 const shallowInstrumentations2 = { 7276 get(key) { 7277 return get(this, key, false, true); 7278 }, 7279 get size() { 7280 return size(this); 7281 }, 7282 has, 7283 add, 7284 set, 7285 delete: deleteEntry, 7286 clear, 7287 forEach: createForEach(false, true) 7288 }; 7289 const readonlyInstrumentations2 = { 7290 get(key) { 7291 return get(this, key, true); 7292 }, 7293 get size() { 7294 return size(this, true); 7295 }, 7296 has(key) { 7297 return has.call(this, key, true); 7298 }, 7299 add: createReadonlyMethod("add"), 7300 set: createReadonlyMethod("set"), 7301 delete: createReadonlyMethod("delete"), 7302 clear: createReadonlyMethod("clear"), 7303 forEach: createForEach(true, false) 7304 }; 7305 const shallowReadonlyInstrumentations2 = { 7306 get(key) { 7307 return get(this, key, true, true); 7308 }, 7309 get size() { 7310 return size(this, true); 7311 }, 7312 has(key) { 7313 return has.call(this, key, true); 7314 }, 7315 add: createReadonlyMethod("add"), 7316 set: createReadonlyMethod("set"), 7317 delete: createReadonlyMethod("delete"), 7318 clear: createReadonlyMethod("clear"), 7319 forEach: createForEach(true, true) 7320 }; 7321 const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; 7322 iteratorMethods.forEach((method) => { 7323 mutableInstrumentations2[method] = createIterableMethod( 7324 method, 7325 false, 7326 false 7327 ); 7328 readonlyInstrumentations2[method] = createIterableMethod( 7329 method, 7330 true, 7331 false 7332 ); 7333 shallowInstrumentations2[method] = createIterableMethod( 7334 method, 7335 false, 7336 true 7337 ); 7338 shallowReadonlyInstrumentations2[method] = createIterableMethod( 7339 method, 7340 true, 7341 true 7342 ); 7343 }); 7344 return [ 7345 mutableInstrumentations2, 7346 readonlyInstrumentations2, 7347 shallowInstrumentations2, 7348 shallowReadonlyInstrumentations2 7349 ]; 7350} 7351const [ 7352 mutableInstrumentations, 7353 readonlyInstrumentations, 7354 shallowInstrumentations, 7355 shallowReadonlyInstrumentations 7356] = /* @__PURE__ */ createInstrumentations(); 7357function createInstrumentationGetter(isReadonly, shallow) { 7358 const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations; 7359 return (target, key, receiver) => { 7360 if (key === "__v_isReactive") { 7361 return !isReadonly; 7362 } else if (key === "__v_isReadonly") { 7363 return isReadonly; 7364 } else if (key === "__v_raw") { 7365 return target; 7366 } 7367 return Reflect.get( 7368 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(instrumentations, key) && key in target ? instrumentations : target, 7369 key, 7370 receiver 7371 ); 7372 }; 7373} 7374const mutableCollectionHandlers = { 7375 get: /* @__PURE__ */ createInstrumentationGetter(false, false) 7376}; 7377const shallowCollectionHandlers = { 7378 get: /* @__PURE__ */ createInstrumentationGetter(false, true) 7379}; 7380const readonlyCollectionHandlers = { 7381 get: /* @__PURE__ */ createInstrumentationGetter(true, false) 7382}; 7383const shallowReadonlyCollectionHandlers = { 7384 get: /* @__PURE__ */ createInstrumentationGetter(true, true) 7385}; 7386function checkIdentityKeys(target, has2, key) { 7387 const rawKey = toRaw(key); 7388 if (rawKey !== key && has2.call(target, rawKey)) { 7389 const type = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toRawType)(target); 7390 console.warn( 7391 `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` 7392 ); 7393 } 7394} 7395 7396const reactiveMap = /* @__PURE__ */ new WeakMap(); 7397const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); 7398const readonlyMap = /* @__PURE__ */ new WeakMap(); 7399const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); 7400function targetTypeMap(rawType) { 7401 switch (rawType) { 7402 case "Object": 7403 case "Array": 7404 return 1 /* COMMON */; 7405 case "Map": 7406 case "Set": 7407 case "WeakMap": 7408 case "WeakSet": 7409 return 2 /* COLLECTION */; 7410 default: 7411 return 0 /* INVALID */; 7412 } 7413} 7414function getTargetType(value) { 7415 return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toRawType)(value)); 7416} 7417function reactive(target) { 7418 if (isReadonly(target)) { 7419 return target; 7420 } 7421 return createReactiveObject( 7422 target, 7423 false, 7424 mutableHandlers, 7425 mutableCollectionHandlers, 7426 reactiveMap 7427 ); 7428} 7429function shallowReactive(target) { 7430 return createReactiveObject( 7431 target, 7432 false, 7433 shallowReactiveHandlers, 7434 shallowCollectionHandlers, 7435 shallowReactiveMap 7436 ); 7437} 7438function readonly(target) { 7439 return createReactiveObject( 7440 target, 7441 true, 7442 readonlyHandlers, 7443 readonlyCollectionHandlers, 7444 readonlyMap 7445 ); 7446} 7447function shallowReadonly(target) { 7448 return createReactiveObject( 7449 target, 7450 true, 7451 shallowReadonlyHandlers, 7452 shallowReadonlyCollectionHandlers, 7453 shallowReadonlyMap 7454 ); 7455} 7456function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { 7457 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(target)) { 7458 if (true) { 7459 console.warn(`value cannot be made reactive: ${String(target)}`); 7460 } 7461 return target; 7462 } 7463 if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { 7464 return target; 7465 } 7466 const existingProxy = proxyMap.get(target); 7467 if (existingProxy) { 7468 return existingProxy; 7469 } 7470 const targetType = getTargetType(target); 7471 if (targetType === 0 /* INVALID */) { 7472 return target; 7473 } 7474 const proxy = new Proxy( 7475 target, 7476 targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers 7477 ); 7478 proxyMap.set(target, proxy); 7479 return proxy; 7480} 7481function isReactive(value) { 7482 if (isReadonly(value)) { 7483 return isReactive(value["__v_raw"]); 7484 } 7485 return !!(value && value["__v_isReactive"]); 7486} 7487function isReadonly(value) { 7488 return !!(value && value["__v_isReadonly"]); 7489} 7490function isShallow(value) { 7491 return !!(value && value["__v_isShallow"]); 7492} 7493function isProxy(value) { 7494 return isReactive(value) || isReadonly(value); 7495} 7496function toRaw(observed) { 7497 const raw = observed && observed["__v_raw"]; 7498 return raw ? toRaw(raw) : observed; 7499} 7500function markRaw(value) { 7501 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.def)(value, "__v_skip", true); 7502 return value; 7503} 7504const toReactive = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) ? reactive(value) : value; 7505const toReadonly = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) ? readonly(value) : value; 7506 7507class ComputedRefImpl { 7508 constructor(getter, _setter, isReadonly, isSSR) { 7509 this._setter = _setter; 7510 this.dep = void 0; 7511 this.__v_isRef = true; 7512 this["__v_isReadonly"] = false; 7513 this.effect = new ReactiveEffect( 7514 () => getter(this._value), 7515 () => triggerRefValue(this, 1) 7516 ); 7517 this.effect.computed = this; 7518 this.effect.active = this._cacheable = !isSSR; 7519 this["__v_isReadonly"] = isReadonly; 7520 } 7521 get value() { 7522 const self = toRaw(this); 7523 trackRefValue(self); 7524 if (!self._cacheable || self.effect.dirty) { 7525 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(self._value, self._value = self.effect.run())) { 7526 triggerRefValue(self, 2); 7527 } 7528 } 7529 return self._value; 7530 } 7531 set value(newValue) { 7532 this._setter(newValue); 7533 } 7534 // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x 7535 get _dirty() { 7536 return this.effect.dirty; 7537 } 7538 set _dirty(v) { 7539 this.effect.dirty = v; 7540 } 7541 // #endregion 7542} 7543function computed(getterOrOptions, debugOptions, isSSR = false) { 7544 let getter; 7545 let setter; 7546 const onlyGetter = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(getterOrOptions); 7547 if (onlyGetter) { 7548 getter = getterOrOptions; 7549 setter = true ? () => { 7550 console.warn("Write operation failed: computed value is readonly"); 7551 } : 0; 7552 } else { 7553 getter = getterOrOptions.get; 7554 setter = getterOrOptions.set; 7555 } 7556 const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); 7557 if ( true && debugOptions && !isSSR) { 7558 cRef.effect.onTrack = debugOptions.onTrack; 7559 cRef.effect.onTrigger = debugOptions.onTrigger; 7560 } 7561 return cRef; 7562} 7563 7564function trackRefValue(ref2) { 7565 if (shouldTrack && activeEffect) { 7566 ref2 = toRaw(ref2); 7567 trackEffect( 7568 activeEffect, 7569 ref2.dep || (ref2.dep = createDep( 7570 () => ref2.dep = void 0, 7571 ref2 instanceof ComputedRefImpl ? ref2 : void 0 7572 )), 7573 true ? { 7574 target: ref2, 7575 type: "get", 7576 key: "value" 7577 } : 0 7578 ); 7579 } 7580} 7581function triggerRefValue(ref2, dirtyLevel = 3, newVal) { 7582 ref2 = toRaw(ref2); 7583 const dep = ref2.dep; 7584 if (dep) { 7585 triggerEffects( 7586 dep, 7587 dirtyLevel, 7588 true ? { 7589 target: ref2, 7590 type: "set", 7591 key: "value", 7592 newValue: newVal 7593 } : 0 7594 ); 7595 } 7596} 7597function isRef(r) { 7598 return !!(r && r.__v_isRef === true); 7599} 7600function ref(value) { 7601 return createRef(value, false); 7602} 7603function shallowRef(value) { 7604 return createRef(value, true); 7605} 7606function createRef(rawValue, shallow) { 7607 if (isRef(rawValue)) { 7608 return rawValue; 7609 } 7610 return new RefImpl(rawValue, shallow); 7611} 7612class RefImpl { 7613 constructor(value, __v_isShallow) { 7614 this.__v_isShallow = __v_isShallow; 7615 this.dep = void 0; 7616 this.__v_isRef = true; 7617 this._rawValue = __v_isShallow ? value : toRaw(value); 7618 this._value = __v_isShallow ? value : toReactive(value); 7619 } 7620 get value() { 7621 trackRefValue(this); 7622 return this._value; 7623 } 7624 set value(newVal) { 7625 const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); 7626 newVal = useDirectValue ? newVal : toRaw(newVal); 7627 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(newVal, this._rawValue)) { 7628 this._rawValue = newVal; 7629 this._value = useDirectValue ? newVal : toReactive(newVal); 7630 triggerRefValue(this, 3, newVal); 7631 } 7632 } 7633} 7634function triggerRef(ref2) { 7635 triggerRefValue(ref2, 3, true ? ref2.value : 0); 7636} 7637function unref(ref2) { 7638 return isRef(ref2) ? ref2.value : ref2; 7639} 7640function toValue(source) { 7641 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(source) ? source() : unref(source); 7642} 7643const shallowUnwrapHandlers = { 7644 get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), 7645 set: (target, key, value, receiver) => { 7646 const oldValue = target[key]; 7647 if (isRef(oldValue) && !isRef(value)) { 7648 oldValue.value = value; 7649 return true; 7650 } else { 7651 return Reflect.set(target, key, value, receiver); 7652 } 7653 } 7654}; 7655function proxyRefs(objectWithRefs) { 7656 return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); 7657} 7658class CustomRefImpl { 7659 constructor(factory) { 7660 this.dep = void 0; 7661 this.__v_isRef = true; 7662 const { get, set } = factory( 7663 () => trackRefValue(this), 7664 () => triggerRefValue(this) 7665 ); 7666 this._get = get; 7667 this._set = set; 7668 } 7669 get value() { 7670 return this._get(); 7671 } 7672 set value(newVal) { 7673 this._set(newVal); 7674 } 7675} 7676function customRef(factory) { 7677 return new CustomRefImpl(factory); 7678} 7679function toRefs(object) { 7680 if ( true && !isProxy(object)) { 7681 console.warn(`toRefs() expects a reactive object but received a plain one.`); 7682 } 7683 const ret = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(object) ? new Array(object.length) : {}; 7684 for (const key in object) { 7685 ret[key] = propertyToRef(object, key); 7686 } 7687 return ret; 7688} 7689class ObjectRefImpl { 7690 constructor(_object, _key, _defaultValue) { 7691 this._object = _object; 7692 this._key = _key; 7693 this._defaultValue = _defaultValue; 7694 this.__v_isRef = true; 7695 } 7696 get value() { 7697 const val = this._object[this._key]; 7698 return val === void 0 ? this._defaultValue : val; 7699 } 7700 set value(newVal) { 7701 this._object[this._key] = newVal; 7702 } 7703 get dep() { 7704 return getDepFromReactive(toRaw(this._object), this._key); 7705 } 7706} 7707class GetterRefImpl { 7708 constructor(_getter) { 7709 this._getter = _getter; 7710 this.__v_isRef = true; 7711 this.__v_isReadonly = true; 7712 } 7713 get value() { 7714 return this._getter(); 7715 } 7716} 7717function toRef(source, key, defaultValue) { 7718 if (isRef(source)) { 7719 return source; 7720 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(source)) { 7721 return new GetterRefImpl(source); 7722 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(source) && arguments.length > 1) { 7723 return propertyToRef(source, key, defaultValue); 7724 } else { 7725 return ref(source); 7726 } 7727} 7728function propertyToRef(source, key, defaultValue) { 7729 const val = source[key]; 7730 return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); 7731} 7732 7733const deferredComputed = computed; 7734 7735const TrackOpTypes = { 7736 "GET": "get", 7737 "HAS": "has", 7738 "ITERATE": "iterate" 7739}; 7740const TriggerOpTypes = { 7741 "SET": "set", 7742 "ADD": "add", 7743 "DELETE": "delete", 7744 "CLEAR": "clear" 7745}; 7746const ReactiveFlags = { 7747 "SKIP": "__v_skip", 7748 "IS_REACTIVE": "__v_isReactive", 7749 "IS_READONLY": "__v_isReadonly", 7750 "IS_SHALLOW": "__v_isShallow", 7751 "RAW": "__v_raw" 7752}; 7753 7754 7755 7756 7757/***/ }), 7758
vendor: 265,548 bytes, lines 7759-15946
7759/***/ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js": 7760/*!*************************************************************************!*\ 7761 !*** ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js ***! 7762 \*************************************************************************/ 7763/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7764 7765"use strict"; 7766__webpack_require__.r(__webpack_exports__); 7767/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7768/* harmony export */ BaseTransition: () => (/* binding */ BaseTransition), 7769/* harmony export */ BaseTransitionPropsValidators: () => (/* binding */ BaseTransitionPropsValidators), 7770/* harmony export */ Comment: () => (/* binding */ Comment), 7771/* harmony export */ DeprecationTypes: () => (/* binding */ DeprecationTypes), 7772/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.EffectScope), 7773/* harmony export */ ErrorCodes: () => (/* binding */ ErrorCodes), 7774/* harmony export */ ErrorTypeStrings: () => (/* binding */ ErrorTypeStrings), 7775/* harmony export */ Fragment: () => (/* binding */ Fragment), 7776/* harmony export */ KeepAlive: () => (/* binding */ KeepAlive), 7777/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), 7778/* harmony export */ Static: () => (/* binding */ Static), 7779/* harmony export */ Suspense: () => (/* binding */ Suspense), 7780/* harmony export */ Teleport: () => (/* binding */ Teleport), 7781/* harmony export */ Text: () => (/* binding */ Text), 7782/* harmony export */ TrackOpTypes: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.TrackOpTypes), 7783/* harmony export */ TriggerOpTypes: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.TriggerOpTypes), 7784/* harmony export */ assertNumber: () => (/* binding */ assertNumber), 7785/* harmony export */ callWithAsyncErrorHandling: () => (/* binding */ callWithAsyncErrorHandling), 7786/* harmony export */ callWithErrorHandling: () => (/* binding */ callWithErrorHandling), 7787/* harmony export */ camelize: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize), 7788/* harmony export */ capitalize: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize), 7789/* harmony export */ cloneVNode: () => (/* binding */ cloneVNode), 7790/* harmony export */ compatUtils: () => (/* binding */ compatUtils), 7791/* harmony export */ computed: () => (/* binding */ computed), 7792/* harmony export */ createBlock: () => (/* binding */ createBlock), 7793/* harmony export */ createCommentVNode: () => (/* binding */ createCommentVNode), 7794/* harmony export */ createElementBlock: () => (/* binding */ createElementBlock), 7795/* harmony export */ createElementVNode: () => (/* binding */ createBaseVNode), 7796/* harmony export */ createHydrationRenderer: () => (/* binding */ createHydrationRenderer), 7797/* harmony export */ createPropsRestProxy: () => (/* binding */ createPropsRestProxy), 7798/* harmony export */ createRenderer: () => (/* binding */ createRenderer), 7799/* harmony export */ createSlots: () => (/* binding */ createSlots), 7800/* harmony export */ createStaticVNode: () => (/* binding */ createStaticVNode), 7801/* harmony export */ createTextVNode: () => (/* binding */ createTextVNode), 7802/* harmony export */ createVNode: () => (/* binding */ createVNode), 7803/* harmony export */ customRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.customRef), 7804/* harmony export */ defineAsyncComponent: () => (/* binding */ defineAsyncComponent), 7805/* harmony export */ defineComponent: () => (/* binding */ defineComponent), 7806/* harmony export */ defineEmits: () => (/* binding */ defineEmits), 7807/* harmony export */ defineExpose: () => (/* binding */ defineExpose), 7808/* harmony export */ defineModel: () => (/* binding */ defineModel), 7809/* harmony export */ defineOptions: () => (/* binding */ defineOptions), 7810/* harmony export */ defineProps: () => (/* binding */ defineProps), 7811/* harmony export */ defineSlots: () => (/* binding */ defineSlots), 7812/* harmony export */ devtools: () => (/* binding */ devtools), 7813/* harmony export */ effect: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.effect), 7814/* harmony export */ effectScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.effectScope), 7815/* harmony export */ getCurrentInstance: () => (/* binding */ getCurrentInstance), 7816/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), 7817/* harmony export */ getTransitionRawChildren: () => (/* binding */ getTransitionRawChildren), 7818/* harmony export */ guardReactiveProps: () => (/* binding */ guardReactiveProps), 7819/* harmony export */ h: () => (/* binding */ h), 7820/* harmony export */ handleError: () => (/* binding */ handleError), 7821/* harmony export */ hasInjectionContext: () => (/* binding */ hasInjectionContext), 7822/* harmony export */ initCustomFormatter: () => (/* binding */ initCustomFormatter), 7823/* harmony export */ inject: () => (/* binding */ inject), 7824/* harmony export */ isMemoSame: () => (/* binding */ isMemoSame), 7825/* harmony export */ isProxy: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy), 7826/* harmony export */ isReactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive), 7827/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly), 7828/* harmony export */ isRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef), 7829/* harmony export */ isRuntimeOnly: () => (/* binding */ isRuntimeOnly), 7830/* harmony export */ isShallow: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow), 7831/* harmony export */ isVNode: () => (/* binding */ isVNode), 7832/* harmony export */ markRaw: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw), 7833/* harmony export */ mergeDefaults: () => (/* binding */ mergeDefaults), 7834/* harmony export */ mergeModels: () => (/* binding */ mergeModels), 7835/* harmony export */ mergeProps: () => (/* binding */ mergeProps), 7836/* harmony export */ nextTick: () => (/* binding */ nextTick), 7837/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass), 7838/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeProps), 7839/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle), 7840/* harmony export */ onActivated: () => (/* binding */ onActivated), 7841/* harmony export */ onBeforeMount: () => (/* binding */ onBeforeMount), 7842/* harmony export */ onBeforeUnmount: () => (/* binding */ onBeforeUnmount), 7843/* harmony export */ onBeforeUpdate: () => (/* binding */ onBeforeUpdate), 7844/* harmony export */ onDeactivated: () => (/* binding */ onDeactivated), 7845/* harmony export */ onErrorCaptured: () => (/* binding */ onErrorCaptured), 7846/* harmony export */ onMounted: () => (/* binding */ onMounted), 7847/* harmony export */ onRenderTracked: () => (/* binding */ onRenderTracked), 7848/* harmony export */ onRenderTriggered: () => (/* binding */ onRenderTriggered), 7849/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), 7850/* harmony export */ onServerPrefetch: () => (/* binding */ onServerPrefetch), 7851/* harmony export */ onUnmounted: () => (/* binding */ onUnmounted), 7852/* harmony export */ onUpdated: () => (/* binding */ onUpdated), 7853/* harmony export */ openBlock: () => (/* binding */ openBlock), 7854/* harmony export */ popScopeId: () => (/* binding */ popScopeId), 7855/* harmony export */ provide: () => (/* binding */ provide), 7856/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), 7857/* harmony export */ pushScopeId: () => (/* binding */ pushScopeId), 7858/* harmony export */ queuePostFlushCb: () => (/* binding */ queuePostFlushCb), 7859/* harmony export */ reactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.reactive), 7860/* harmony export */ readonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.readonly), 7861/* harmony export */ ref: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref), 7862/* harmony export */ registerRuntimeCompiler: () => (/* binding */ registerRuntimeCompiler), 7863/* harmony export */ renderList: () => (/* binding */ renderList), 7864/* harmony export */ renderSlot: () => (/* binding */ renderSlot), 7865/* harmony export */ resolveComponent: () => (/* binding */ resolveComponent), 7866/* harmony export */ resolveDirective: () => (/* binding */ resolveDirective), 7867/* harmony export */ resolveDynamicComponent: () => (/* binding */ resolveDynamicComponent), 7868/* harmony export */ resolveFilter: () => (/* binding */ resolveFilter), 7869/* harmony export */ resolveTransitionHooks: () => (/* binding */ resolveTransitionHooks), 7870/* harmony export */ setBlockTracking: () => (/* binding */ setBlockTracking), 7871/* harmony export */ setDevtoolsHook: () => (/* binding */ setDevtoolsHook), 7872/* harmony export */ setTransitionHooks: () => (/* binding */ setTransitionHooks), 7873/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), 7874/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), 7875/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowRef), 7876/* harmony export */ ssrContextKey: () => (/* binding */ ssrContextKey), 7877/* harmony export */ ssrUtils: () => (/* binding */ ssrUtils), 7878/* harmony export */ stop: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.stop), 7879/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.toDisplayString), 7880/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey), 7881/* harmony export */ toHandlers: () => (/* binding */ toHandlers), 7882/* harmony export */ toRaw: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw), 7883/* harmony export */ toRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRef), 7884/* harmony export */ toRefs: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRefs), 7885/* harmony export */ toValue: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toValue), 7886/* harmony export */ transformVNodeArgs: () => (/* binding */ transformVNodeArgs), 7887/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.triggerRef), 7888/* harmony export */ unref: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.unref), 7889/* harmony export */ useAttrs: () => (/* binding */ useAttrs), 7890/* harmony export */ useModel: () => (/* binding */ useModel), 7891/* harmony export */ useSSRContext: () => (/* binding */ useSSRContext), 7892/* harmony export */ useSlots: () => (/* binding */ useSlots), 7893/* harmony export */ useTransitionState: () => (/* binding */ useTransitionState), 7894/* harmony export */ version: () => (/* binding */ version), 7895/* harmony export */ warn: () => (/* binding */ warn), 7896/* harmony export */ watch: () => (/* binding */ watch), 7897/* harmony export */ watchEffect: () => (/* binding */ watchEffect), 7898/* harmony export */ watchPostEffect: () => (/* binding */ watchPostEffect), 7899/* harmony export */ watchSyncEffect: () => (/* binding */ watchSyncEffect), 7900/* harmony export */ withAsyncContext: () => (/* binding */ withAsyncContext), 7901/* harmony export */ withCtx: () => (/* binding */ withCtx), 7902/* harmony export */ withDefaults: () => (/* binding */ withDefaults), 7903/* harmony export */ withDirectives: () => (/* binding */ withDirectives), 7904/* harmony export */ withMemo: () => (/* binding */ withMemo), 7905/* harmony export */ withScopeId: () => (/* binding */ withScopeId) 7906/* harmony export */ }); 7907/* harmony import */ var _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/reactivity */ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js"); 7908/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); 7909 7910 7911 7912 7913 7914const stack = []; 7915function pushWarningContext(vnode) { 7916 stack.push(vnode); 7917} 7918function popWarningContext() { 7919 stack.pop(); 7920} 7921function warn$1(msg, ...args) { 7922 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); 7923 const instance = stack.length ? stack[stack.length - 1].component : null; 7924 const appWarnHandler = instance && instance.appContext.config.warnHandler; 7925 const trace = getComponentTrace(); 7926 if (appWarnHandler) { 7927 callWithErrorHandling( 7928 appWarnHandler, 7929 instance, 7930 11, 7931 [ 7932 msg + args.join(""), 7933 instance && instance.proxy, 7934 trace.map( 7935 ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` 7936 ).join("\n"), 7937 trace 7938 ] 7939 ); 7940 } else { 7941 const warnArgs = [`[Vue warn]: ${msg}`, ...args]; 7942 if (trace.length && // avoid spamming console during tests 7943 true) { 7944 warnArgs.push(` 7945`, ...formatTrace(trace)); 7946 } 7947 console.warn(...warnArgs); 7948 } 7949 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); 7950} 7951function getComponentTrace() { 7952 let currentVNode = stack[stack.length - 1]; 7953 if (!currentVNode) { 7954 return []; 7955 } 7956 const normalizedStack = []; 7957 while (currentVNode) { 7958 const last = normalizedStack[0]; 7959 if (last && last.vnode === currentVNode) { 7960 last.recurseCount++; 7961 } else { 7962 normalizedStack.push({ 7963 vnode: currentVNode, 7964 recurseCount: 0 7965 }); 7966 } 7967 const parentInstance = currentVNode.component && currentVNode.component.parent; 7968 currentVNode = parentInstance && parentInstance.vnode; 7969 } 7970 return normalizedStack; 7971} 7972function formatTrace(trace) { 7973 const logs = []; 7974 trace.forEach((entry, i) => { 7975 logs.push(...i === 0 ? [] : [` 7976`], ...formatTraceEntry(entry)); 7977 }); 7978 return logs; 7979} 7980function formatTraceEntry({ vnode, recurseCount }) { 7981 const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; 7982 const isRoot = vnode.component ? vnode.component.parent == null : false; 7983 const open = ` at <${formatComponentName( 7984 vnode.component, 7985 vnode.type, 7986 isRoot 7987 )}`; 7988 const close = `>` + postfix; 7989 return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; 7990} 7991function formatProps(props) { 7992 const res = []; 7993 const keys = Object.keys(props); 7994 keys.slice(0, 3).forEach((key) => { 7995 res.push(...formatProp(key, props[key])); 7996 }); 7997 if (keys.length > 3) { 7998 res.push(` ...`); 7999 } 8000 return res; 8001} 8002function formatProp(key, value, raw) { 8003 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(value)) { 8004 value = JSON.stringify(value); 8005 return raw ? value : [`${key}=${value}`]; 8006 } else if (typeof value === "number" || typeof value === "boolean" || value == null) { 8007 return raw ? value : [`${key}=${value}`]; 8008 } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(value)) { 8009 value = formatProp(key, (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(value.value), true); 8010 return raw ? value : [`${key}=Ref<`, value, `>`]; 8011 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { 8012 return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; 8013 } else { 8014 value = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(value); 8015 return raw ? value : [`${key}=`, value]; 8016 } 8017} 8018function assertNumber(val, type) { 8019 if (false) 8020 {} 8021 if (val === void 0) { 8022 return; 8023 } else if (typeof val !== "number") { 8024 warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); 8025 } else if (isNaN(val)) { 8026 warn$1(`${type} is NaN - the duration expression might be incorrect.`); 8027 } 8028} 8029 8030const ErrorCodes = { 8031 "SETUP_FUNCTION": 0, 8032 "0": "SETUP_FUNCTION", 8033 "RENDER_FUNCTION": 1, 8034 "1": "RENDER_FUNCTION", 8035 "WATCH_GETTER": 2, 8036 "2": "WATCH_GETTER", 8037 "WATCH_CALLBACK": 3, 8038 "3": "WATCH_CALLBACK", 8039 "WATCH_CLEANUP": 4, 8040 "4": "WATCH_CLEANUP", 8041 "NATIVE_EVENT_HANDLER": 5, 8042 "5": "NATIVE_EVENT_HANDLER", 8043 "COMPONENT_EVENT_HANDLER": 6, 8044 "6": "COMPONENT_EVENT_HANDLER", 8045 "VNODE_HOOK": 7, 8046 "7": "VNODE_HOOK", 8047 "DIRECTIVE_HOOK": 8, 8048 "8": "DIRECTIVE_HOOK", 8049 "TRANSITION_HOOK": 9, 8050 "9": "TRANSITION_HOOK", 8051 "APP_ERROR_HANDLER": 10, 8052 "10": "APP_ERROR_HANDLER", 8053 "APP_WARN_HANDLER": 11, 8054 "11": "APP_WARN_HANDLER", 8055 "FUNCTION_REF": 12, 8056 "12": "FUNCTION_REF", 8057 "ASYNC_COMPONENT_LOADER": 13, 8058 "13": "ASYNC_COMPONENT_LOADER", 8059 "SCHEDULER": 14, 8060 "14": "SCHEDULER" 8061}; 8062const ErrorTypeStrings$1 = { 8063 ["sp"]: "serverPrefetch hook", 8064 ["bc"]: "beforeCreate hook", 8065 ["c"]: "created hook", 8066 ["bm"]: "beforeMount hook", 8067 ["m"]: "mounted hook", 8068 ["bu"]: "beforeUpdate hook", 8069 ["u"]: "updated", 8070 ["bum"]: "beforeUnmount hook", 8071 ["um"]: "unmounted hook", 8072 ["a"]: "activated hook", 8073 ["da"]: "deactivated hook", 8074 ["ec"]: "errorCaptured hook", 8075 ["rtc"]: "renderTracked hook", 8076 ["rtg"]: "renderTriggered hook", 8077 [0]: "setup function", 8078 [1]: "render function", 8079 [2]: "watcher getter", 8080 [3]: "watcher callback", 8081 [4]: "watcher cleanup function", 8082 [5]: "native event handler", 8083 [6]: "component event handler", 8084 [7]: "vnode hook", 8085 [8]: "directive hook", 8086 [9]: "transition hook", 8087 [10]: "app errorHandler", 8088 [11]: "app warnHandler", 8089 [12]: "ref function", 8090 [13]: "async component loader", 8091 [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ." 8092}; 8093function callWithErrorHandling(fn, instance, type, args) { 8094 let res; 8095 try { 8096 res = args ? fn(...args) : fn(); 8097 } catch (err) { 8098 handleError(err, instance, type); 8099 } 8100 return res; 8101} 8102function callWithAsyncErrorHandling(fn, instance, type, args) { 8103 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(fn)) { 8104 const res = callWithErrorHandling(fn, instance, type, args); 8105 if (res && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(res)) { 8106 res.catch((err) => { 8107 handleError(err, instance, type); 8108 }); 8109 } 8110 return res; 8111 } 8112 const values = []; 8113 for (let i = 0; i < fn.length; i++) { 8114 values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); 8115 } 8116 return values; 8117} 8118function handleError(err, instance, type, throwInDev = true) { 8119 const contextVNode = instance ? instance.vnode : null; 8120 if (instance) { 8121 let cur = instance.parent; 8122 const exposedInstance = instance.proxy; 8123 const errorInfo = true ? ErrorTypeStrings$1[type] : 0; 8124 while (cur) { 8125 const errorCapturedHooks = cur.ec; 8126 if (errorCapturedHooks) { 8127 for (let i = 0; i < errorCapturedHooks.length; i++) { 8128 if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { 8129 return; 8130 } 8131 } 8132 } 8133 cur = cur.parent; 8134 } 8135 const appErrorHandler = instance.appContext.config.errorHandler; 8136 if (appErrorHandler) { 8137 callWithErrorHandling( 8138 appErrorHandler, 8139 null, 8140 10, 8141 [err, exposedInstance, errorInfo] 8142 ); 8143 return; 8144 } 8145 } 8146 logError(err, type, contextVNode, throwInDev); 8147} 8148function logError(err, type, contextVNode, throwInDev = true) { 8149 if (true) { 8150 const info = ErrorTypeStrings$1[type]; 8151 if (contextVNode) { 8152 pushWarningContext(contextVNode); 8153 } 8154 warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); 8155 if (contextVNode) { 8156 popWarningContext(); 8157 } 8158 if (throwInDev) { 8159 throw err; 8160 } else { 8161 console.error(err); 8162 } 8163 } else {} 8164} 8165 8166let isFlushing = false; 8167let isFlushPending = false; 8168const queue = []; 8169let flushIndex = 0; 8170const pendingPostFlushCbs = []; 8171let activePostFlushCbs = null; 8172let postFlushIndex = 0; 8173const resolvedPromise = /* @__PURE__ */ Promise.resolve(); 8174let currentFlushPromise = null; 8175const RECURSION_LIMIT = 100; 8176function nextTick(fn) { 8177 const p = currentFlushPromise || resolvedPromise; 8178 return fn ? p.then(this ? fn.bind(this) : fn) : p; 8179} 8180function findInsertionIndex(id) { 8181 let start = flushIndex + 1; 8182 let end = queue.length; 8183 while (start < end) { 8184 const middle = start + end >>> 1; 8185 const middleJob = queue[middle]; 8186 const middleJobId = getId(middleJob); 8187 if (middleJobId < id || middleJobId === id && middleJob.pre) { 8188 start = middle + 1; 8189 } else { 8190 end = middle; 8191 } 8192 } 8193 return start; 8194} 8195function queueJob(job) { 8196 if (!queue.length || !queue.includes( 8197 job, 8198 isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex 8199 )) { 8200 if (job.id == null) { 8201 queue.push(job); 8202 } else { 8203 queue.splice(findInsertionIndex(job.id), 0, job); 8204 } 8205 queueFlush(); 8206 } 8207} 8208function queueFlush() { 8209 if (!isFlushing && !isFlushPending) { 8210 isFlushPending = true; 8211 currentFlushPromise = resolvedPromise.then(flushJobs); 8212 } 8213} 8214function invalidateJob(job) { 8215 const i = queue.indexOf(job); 8216 if (i > flushIndex) { 8217 queue.splice(i, 1); 8218 } 8219} 8220function queuePostFlushCb(cb) { 8221 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(cb)) { 8222 if (!activePostFlushCbs || !activePostFlushCbs.includes( 8223 cb, 8224 cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex 8225 )) { 8226 pendingPostFlushCbs.push(cb); 8227 } 8228 } else { 8229 pendingPostFlushCbs.push(...cb); 8230 } 8231 queueFlush(); 8232} 8233function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) { 8234 if (true) { 8235 seen = seen || /* @__PURE__ */ new Map(); 8236 } 8237 for (; i < queue.length; i++) { 8238 const cb = queue[i]; 8239 if (cb && cb.pre) { 8240 if (instance && cb.id !== instance.uid) { 8241 continue; 8242 } 8243 if ( true && checkRecursiveUpdates(seen, cb)) { 8244 continue; 8245 } 8246 queue.splice(i, 1); 8247 i--; 8248 cb(); 8249 } 8250 } 8251} 8252function flushPostFlushCbs(seen) { 8253 if (pendingPostFlushCbs.length) { 8254 const deduped = [...new Set(pendingPostFlushCbs)]; 8255 pendingPostFlushCbs.length = 0; 8256 if (activePostFlushCbs) { 8257 activePostFlushCbs.push(...deduped); 8258 return; 8259 } 8260 activePostFlushCbs = deduped; 8261 if (true) { 8262 seen = seen || /* @__PURE__ */ new Map(); 8263 } 8264 activePostFlushCbs.sort((a, b) => getId(a) - getId(b)); 8265 for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { 8266 if ( true && checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) { 8267 continue; 8268 } 8269 activePostFlushCbs[postFlushIndex](); 8270 } 8271 activePostFlushCbs = null; 8272 postFlushIndex = 0; 8273 } 8274} 8275const getId = (job) => job.id == null ? Infinity : job.id; 8276const comparator = (a, b) => { 8277 const diff = getId(a) - getId(b); 8278 if (diff === 0) { 8279 if (a.pre && !b.pre) 8280 return -1; 8281 if (b.pre && !a.pre) 8282 return 1; 8283 } 8284 return diff; 8285}; 8286function flushJobs(seen) { 8287 isFlushPending = false; 8288 isFlushing = true; 8289 if (true) { 8290 seen = seen || /* @__PURE__ */ new Map(); 8291 } 8292 queue.sort(comparator); 8293 const check = true ? (job) => checkRecursiveUpdates(seen, job) : 0; 8294 try { 8295 for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { 8296 const job = queue[flushIndex]; 8297 if (job && job.active !== false) { 8298 if ( true && check(job)) { 8299 continue; 8300 } 8301 callWithErrorHandling(job, null, 14); 8302 } 8303 } 8304 } finally { 8305 flushIndex = 0; 8306 queue.length = 0; 8307 flushPostFlushCbs(seen); 8308 isFlushing = false; 8309 currentFlushPromise = null; 8310 if (queue.length || pendingPostFlushCbs.length) { 8311 flushJobs(seen); 8312 } 8313 } 8314} 8315function checkRecursiveUpdates(seen, fn) { 8316 if (!seen.has(fn)) { 8317 seen.set(fn, 1); 8318 } else { 8319 const count = seen.get(fn); 8320 if (count > RECURSION_LIMIT) { 8321 const instance = fn.ownerInstance; 8322 const componentName = instance && getComponentName(instance.type); 8323 handleError( 8324 `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, 8325 null, 8326 10 8327 ); 8328 return true; 8329 } else { 8330 seen.set(fn, count + 1); 8331 } 8332 } 8333} 8334 8335let isHmrUpdating = false; 8336const hmrDirtyComponents = /* @__PURE__ */ new Set(); 8337if (true) { 8338 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)().__VUE_HMR_RUNTIME__ = { 8339 createRecord: tryWrap(createRecord), 8340 rerender: tryWrap(rerender), 8341 reload: tryWrap(reload) 8342 }; 8343} 8344const map = /* @__PURE__ */ new Map(); 8345function registerHMR(instance) { 8346 const id = instance.type.__hmrId; 8347 let record = map.get(id); 8348 if (!record) { 8349 createRecord(id, instance.type); 8350 record = map.get(id); 8351 } 8352 record.instances.add(instance); 8353} 8354function unregisterHMR(instance) { 8355 map.get(instance.type.__hmrId).instances.delete(instance); 8356} 8357function createRecord(id, initialDef) { 8358 if (map.has(id)) { 8359 return false; 8360 } 8361 map.set(id, { 8362 initialDef: normalizeClassComponent(initialDef), 8363 instances: /* @__PURE__ */ new Set() 8364 }); 8365 return true; 8366} 8367function normalizeClassComponent(component) { 8368 return isClassComponent(component) ? component.__vccOpts : component; 8369} 8370function rerender(id, newRender) { 8371 const record = map.get(id); 8372 if (!record) { 8373 return; 8374 } 8375 record.initialDef.render = newRender; 8376 [...record.instances].forEach((instance) => { 8377 if (newRender) { 8378 instance.render = newRender; 8379 normalizeClassComponent(instance.type).render = newRender; 8380 } 8381 instance.renderCache = []; 8382 isHmrUpdating = true; 8383 instance.effect.dirty = true; 8384 instance.update(); 8385 isHmrUpdating = false; 8386 }); 8387} 8388function reload(id, newComp) { 8389 const record = map.get(id); 8390 if (!record) 8391 return; 8392 newComp = normalizeClassComponent(newComp); 8393 updateComponentDef(record.initialDef, newComp); 8394 const instances = [...record.instances]; 8395 for (const instance of instances) { 8396 const oldComp = normalizeClassComponent(instance.type); 8397 if (!hmrDirtyComponents.has(oldComp)) { 8398 if (oldComp !== record.initialDef) { 8399 updateComponentDef(oldComp, newComp); 8400 } 8401 hmrDirtyComponents.add(oldComp); 8402 } 8403 instance.appContext.propsCache.delete(instance.type); 8404 instance.appContext.emitsCache.delete(instance.type); 8405 instance.appContext.optionsCache.delete(instance.type); 8406 if (instance.ceReload) { 8407 hmrDirtyComponents.add(oldComp); 8408 instance.ceReload(newComp.styles); 8409 hmrDirtyComponents.delete(oldComp); 8410 } else if (instance.parent) { 8411 instance.parent.effect.dirty = true; 8412 queueJob(instance.parent.update); 8413 } else if (instance.appContext.reload) { 8414 instance.appContext.reload(); 8415 } else if (typeof window !== "undefined") { 8416 window.location.reload(); 8417 } else { 8418 console.warn( 8419 "[HMR] Root or manually mounted instance modified. Full reload required." 8420 ); 8421 } 8422 } 8423 queuePostFlushCb(() => { 8424 for (const instance of instances) { 8425 hmrDirtyComponents.delete( 8426 normalizeClassComponent(instance.type) 8427 ); 8428 } 8429 }); 8430} 8431function updateComponentDef(oldComp, newComp) { 8432 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(oldComp, newComp); 8433 for (const key in oldComp) { 8434 if (key !== "__file" && !(key in newComp)) { 8435 delete oldComp[key]; 8436 } 8437 } 8438} 8439function tryWrap(fn) { 8440 return (id, arg) => { 8441 try { 8442 return fn(id, arg); 8443 } catch (e) { 8444 console.error(e); 8445 console.warn( 8446 `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` 8447 ); 8448 } 8449 }; 8450} 8451 8452let devtools$1; 8453let buffer = []; 8454let devtoolsNotInstalled = false; 8455function emit$1(event, ...args) { 8456 if (devtools$1) { 8457 devtools$1.emit(event, ...args); 8458 } else if (!devtoolsNotInstalled) { 8459 buffer.push({ event, args }); 8460 } 8461} 8462function setDevtoolsHook$1(hook, target) { 8463 var _a, _b; 8464 devtools$1 = hook; 8465 if (devtools$1) { 8466 devtools$1.enabled = true; 8467 buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); 8468 buffer = []; 8469 } else if ( 8470 // handle late devtools injection - only do this if we are in an actual 8471 // browser environment to avoid the timer handle stalling test runner exit 8472 // (#4815) 8473 typeof window !== "undefined" && // some envs mock window but not fully 8474 window.HTMLElement && // also exclude jsdom 8475 !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) 8476 ) { 8477 const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; 8478 replay.push((newHook) => { 8479 setDevtoolsHook$1(newHook, target); 8480 }); 8481 setTimeout(() => { 8482 if (!devtools$1) { 8483 target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; 8484 devtoolsNotInstalled = true; 8485 buffer = []; 8486 } 8487 }, 3e3); 8488 } else { 8489 devtoolsNotInstalled = true; 8490 buffer = []; 8491 } 8492} 8493function devtoolsInitApp(app, version) { 8494 emit$1("app:init" /* APP_INIT */, app, version, { 8495 Fragment, 8496 Text, 8497 Comment, 8498 Static 8499 }); 8500} 8501function devtoolsUnmountApp(app) { 8502 emit$1("app:unmount" /* APP_UNMOUNT */, app); 8503} 8504const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook( 8505 "component:added" /* COMPONENT_ADDED */ 8506); 8507const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); 8508const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( 8509 "component:removed" /* COMPONENT_REMOVED */ 8510); 8511const devtoolsComponentRemoved = (component) => { 8512 if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered 8513 !devtools$1.cleanupBuffer(component)) { 8514 _devtoolsComponentRemoved(component); 8515 } 8516}; 8517function createDevtoolsComponentHook(hook) { 8518 return (component) => { 8519 emit$1( 8520 hook, 8521 component.appContext.app, 8522 component.uid, 8523 component.parent ? component.parent.uid : void 0, 8524 component 8525 ); 8526 }; 8527} 8528const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook( 8529 "perf:start" /* PERFORMANCE_START */ 8530); 8531const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook( 8532 "perf:end" /* PERFORMANCE_END */ 8533); 8534function createDevtoolsPerformanceHook(hook) { 8535 return (component, type, time) => { 8536 emit$1(hook, component.appContext.app, component.uid, component, type, time); 8537 }; 8538} 8539function devtoolsComponentEmit(component, event, params) { 8540 emit$1( 8541 "component:emit" /* COMPONENT_EMIT */, 8542 component.appContext.app, 8543 component, 8544 event, 8545 params 8546 ); 8547} 8548 8549function emit(instance, event, ...rawArgs) { 8550 if (instance.isUnmounted) 8551 return; 8552 const props = instance.vnode.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 8553 if (true) { 8554 const { 8555 emitsOptions, 8556 propsOptions: [propsOptions] 8557 } = instance; 8558 if (emitsOptions) { 8559 if (!(event in emitsOptions) && true) { 8560 if (!propsOptions || !((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event) in propsOptions)) { 8561 warn$1( 8562 `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event)}" prop.` 8563 ); 8564 } 8565 } else { 8566 const validator = emitsOptions[event]; 8567 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(validator)) { 8568 const isValid = validator(...rawArgs); 8569 if (!isValid) { 8570 warn$1( 8571 `Invalid event arguments: event validation failed for event "${event}".` 8572 ); 8573 } 8574 } 8575 } 8576 } 8577 } 8578 let args = rawArgs; 8579 const isModelListener = event.startsWith("update:"); 8580 const modelArg = isModelListener && event.slice(7); 8581 if (modelArg && modelArg in props) { 8582 const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`; 8583 const { number, trim } = props[modifiersKey] || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 8584 if (trim) { 8585 args = rawArgs.map((a) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(a) ? a.trim() : a); 8586 } 8587 if (number) { 8588 args = rawArgs.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber); 8589 } 8590 } 8591 if (true) { 8592 devtoolsComponentEmit(instance, event, args); 8593 } 8594 if (true) { 8595 const lowerCaseEvent = event.toLowerCase(); 8596 if (lowerCaseEvent !== event && props[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(lowerCaseEvent)]) { 8597 warn$1( 8598 `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( 8599 instance, 8600 instance.type 8601 )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)( 8602 event 8603 )}" instead of "${event}".` 8604 ); 8605 } 8606 } 8607 let handlerName; 8608 let handler = props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event)] || // also try camelCase event handler (#2249) 8609 props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(event))]; 8610 if (!handler && isModelListener) { 8611 handler = props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event))]; 8612 } 8613 if (handler) { 8614 callWithAsyncErrorHandling( 8615 handler, 8616 instance, 8617 6, 8618 args 8619 ); 8620 } 8621 const onceHandler = props[handlerName + `Once`]; 8622 if (onceHandler) { 8623 if (!instance.emitted) { 8624 instance.emitted = {}; 8625 } else if (instance.emitted[handlerName]) { 8626 return; 8627 } 8628 instance.emitted[handlerName] = true; 8629 callWithAsyncErrorHandling( 8630 onceHandler, 8631 instance, 8632 6, 8633 args 8634 ); 8635 } 8636} 8637function normalizeEmitsOptions(comp, appContext, asMixin = false) { 8638 const cache = appContext.emitsCache; 8639 const cached = cache.get(comp); 8640 if (cached !== void 0) { 8641 return cached; 8642 } 8643 const raw = comp.emits; 8644 let normalized = {}; 8645 let hasExtends = false; 8646 if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { 8647 const extendEmits = (raw2) => { 8648 const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); 8649 if (normalizedFromExtend) { 8650 hasExtends = true; 8651 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, normalizedFromExtend); 8652 } 8653 }; 8654 if (!asMixin && appContext.mixins.length) { 8655 appContext.mixins.forEach(extendEmits); 8656 } 8657 if (comp.extends) { 8658 extendEmits(comp.extends); 8659 } 8660 if (comp.mixins) { 8661 comp.mixins.forEach(extendEmits); 8662 } 8663 } 8664 if (!raw && !hasExtends) { 8665 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { 8666 cache.set(comp, null); 8667 } 8668 return null; 8669 } 8670 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { 8671 raw.forEach((key) => normalized[key] = null); 8672 } else { 8673 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, raw); 8674 } 8675 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { 8676 cache.set(comp, normalized); 8677 } 8678 return normalized; 8679} 8680function isEmitListener(options, key) { 8681 if (!options || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { 8682 return false; 8683 } 8684 key = key.slice(2).replace(/Once$/, ""); 8685 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, key[0].toLowerCase() + key.slice(1)) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, key); 8686} 8687 8688let currentRenderingInstance = null; 8689let currentScopeId = null; 8690function setCurrentRenderingInstance(instance) { 8691 const prev = currentRenderingInstance; 8692 currentRenderingInstance = instance; 8693 currentScopeId = instance && instance.type.__scopeId || null; 8694 return prev; 8695} 8696function pushScopeId(id) { 8697 currentScopeId = id; 8698} 8699function popScopeId() { 8700 currentScopeId = null; 8701} 8702const withScopeId = (_id) => withCtx; 8703function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { 8704 if (!ctx) 8705 return fn; 8706 if (fn._n) { 8707 return fn; 8708 } 8709 const renderFnWithContext = (...args) => { 8710 if (renderFnWithContext._d) { 8711 setBlockTracking(-1); 8712 } 8713 const prevInstance = setCurrentRenderingInstance(ctx); 8714 let res; 8715 try { 8716 res = fn(...args); 8717 } finally { 8718 setCurrentRenderingInstance(prevInstance); 8719 if (renderFnWithContext._d) { 8720 setBlockTracking(1); 8721 } 8722 } 8723 if (true) { 8724 devtoolsComponentUpdated(ctx); 8725 } 8726 return res; 8727 }; 8728 renderFnWithContext._n = true; 8729 renderFnWithContext._c = true; 8730 renderFnWithContext._d = true; 8731 return renderFnWithContext; 8732} 8733 8734let accessedAttrs = false; 8735function markAttrsAccessed() { 8736 accessedAttrs = true; 8737} 8738function renderComponentRoot(instance) { 8739 const { 8740 type: Component, 8741 vnode, 8742 proxy, 8743 withProxy, 8744 props, 8745 propsOptions: [propsOptions], 8746 slots, 8747 attrs, 8748 emit, 8749 render, 8750 renderCache, 8751 data, 8752 setupState, 8753 ctx, 8754 inheritAttrs 8755 } = instance; 8756 let result; 8757 let fallthroughAttrs; 8758 const prev = setCurrentRenderingInstance(instance); 8759 if (true) { 8760 accessedAttrs = false; 8761 } 8762 try { 8763 if (vnode.shapeFlag & 4) { 8764 const proxyToUse = withProxy || proxy; 8765 const thisProxy = true && setupState.__isScriptSetup ? new Proxy(proxyToUse, { 8766 get(target, key, receiver) { 8767 warn$1( 8768 `Property '${String( 8769 key 8770 )}' was accessed via 'this'. Avoid using 'this' in templates.` 8771 ); 8772 return Reflect.get(target, key, receiver); 8773 } 8774 }) : proxyToUse; 8775 result = normalizeVNode( 8776 render.call( 8777 thisProxy, 8778 proxyToUse, 8779 renderCache, 8780 props, 8781 setupState, 8782 data, 8783 ctx 8784 ) 8785 ); 8786 fallthroughAttrs = attrs; 8787 } else { 8788 const render2 = Component; 8789 if ( true && attrs === props) { 8790 markAttrsAccessed(); 8791 } 8792 result = normalizeVNode( 8793 render2.length > 1 ? render2( 8794 props, 8795 true ? { 8796 get attrs() { 8797 markAttrsAccessed(); 8798 return attrs; 8799 }, 8800 slots, 8801 emit 8802 } : 0 8803 ) : render2( 8804 props, 8805 null 8806 /* we know it doesn't need it */ 8807 ) 8808 ); 8809 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); 8810 } 8811 } catch (err) { 8812 blockStack.length = 0; 8813 handleError(err, instance, 1); 8814 result = createVNode(Comment); 8815 } 8816 let root = result; 8817 let setRoot = void 0; 8818 if ( true && result.patchFlag > 0 && result.patchFlag & 2048) { 8819 [root, setRoot] = getChildRoot(result); 8820 } 8821 if (fallthroughAttrs && inheritAttrs !== false) { 8822 const keys = Object.keys(fallthroughAttrs); 8823 const { shapeFlag } = root; 8824 if (keys.length) { 8825 if (shapeFlag & (1 | 6)) { 8826 if (propsOptions && keys.some(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)) { 8827 fallthroughAttrs = filterModelListeners( 8828 fallthroughAttrs, 8829 propsOptions 8830 ); 8831 } 8832 root = cloneVNode(root, fallthroughAttrs); 8833 } else if ( true && !accessedAttrs && root.type !== Comment) { 8834 const allAttrs = Object.keys(attrs); 8835 const eventAttrs = []; 8836 const extraAttrs = []; 8837 for (let i = 0, l = allAttrs.length; i < l; i++) { 8838 const key = allAttrs[i]; 8839 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { 8840 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key)) { 8841 eventAttrs.push(key[2].toLowerCase() + key.slice(3)); 8842 } 8843 } else { 8844 extraAttrs.push(key); 8845 } 8846 } 8847 if (extraAttrs.length) { 8848 warn$1( 8849 `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.` 8850 ); 8851 } 8852 if (eventAttrs.length) { 8853 warn$1( 8854 `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` 8855 ); 8856 } 8857 } 8858 } 8859 } 8860 if (vnode.dirs) { 8861 if ( true && !isElementRoot(root)) { 8862 warn$1( 8863 `Runtime directive used on component with non-element root node. The directives will not function as intended.` 8864 ); 8865 } 8866 root = cloneVNode(root); 8867 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; 8868 } 8869 if (vnode.transition) { 8870 if ( true && !isElementRoot(root)) { 8871 warn$1( 8872 `Component inside <Transition> renders non-element root node that cannot be animated.` 8873 ); 8874 } 8875 root.transition = vnode.transition; 8876 } 8877 if ( true && setRoot) { 8878 setRoot(root); 8879 } else { 8880 result = root; 8881 } 8882 setCurrentRenderingInstance(prev); 8883 return result; 8884} 8885const getChildRoot = (vnode) => { 8886 const rawChildren = vnode.children; 8887 const dynamicChildren = vnode.dynamicChildren; 8888 const childRoot = filterSingleRoot(rawChildren); 8889 if (!childRoot) { 8890 return [vnode, void 0]; 8891 } 8892 const index = rawChildren.indexOf(childRoot); 8893 const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; 8894 const setRoot = (updatedRoot) => { 8895 rawChildren[index] = updatedRoot; 8896 if (dynamicChildren) { 8897 if (dynamicIndex > -1) { 8898 dynamicChildren[dynamicIndex] = updatedRoot; 8899 } else if (updatedRoot.patchFlag > 0) { 8900 vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; 8901 } 8902 } 8903 }; 8904 return [normalizeVNode(childRoot), setRoot]; 8905}; 8906function filterSingleRoot(children) { 8907 let singleRoot; 8908 for (let i = 0; i < children.length; i++) { 8909 const child = children[i]; 8910 if (isVNode(child)) { 8911 if (child.type !== Comment || child.children === "v-if") { 8912 if (singleRoot) { 8913 return; 8914 } else { 8915 singleRoot = child; 8916 } 8917 } 8918 } else { 8919 return; 8920 } 8921 } 8922 return singleRoot; 8923} 8924const getFunctionalFallthrough = (attrs) => { 8925 let res; 8926 for (const key in attrs) { 8927 if (key === "class" || key === "style" || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { 8928 (res || (res = {}))[key] = attrs[key]; 8929 } 8930 } 8931 return res; 8932}; 8933const filterModelListeners = (attrs, props) => { 8934 const res = {}; 8935 for (const key in attrs) { 8936 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key) || !(key.slice(9) in props)) { 8937 res[key] = attrs[key]; 8938 } 8939 } 8940 return res; 8941}; 8942const isElementRoot = (vnode) => { 8943 return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; 8944}; 8945function shouldUpdateComponent(prevVNode, nextVNode, optimized) { 8946 const { props: prevProps, children: prevChildren, component } = prevVNode; 8947 const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; 8948 const emits = component.emitsOptions; 8949 if ( true && (prevChildren || nextChildren) && isHmrUpdating) { 8950 return true; 8951 } 8952 if (nextVNode.dirs || nextVNode.transition) { 8953 return true; 8954 } 8955 if (optimized && patchFlag >= 0) { 8956 if (patchFlag & 1024) { 8957 return true; 8958 } 8959 if (patchFlag & 16) { 8960 if (!prevProps) { 8961 return !!nextProps; 8962 } 8963 return hasPropsChanged(prevProps, nextProps, emits); 8964 } else if (patchFlag & 8) { 8965 const dynamicProps = nextVNode.dynamicProps; 8966 for (let i = 0; i < dynamicProps.length; i++) { 8967 const key = dynamicProps[i]; 8968 if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { 8969 return true; 8970 } 8971 } 8972 } 8973 } else { 8974 if (prevChildren || nextChildren) { 8975 if (!nextChildren || !nextChildren.$stable) { 8976 return true; 8977 } 8978 } 8979 if (prevProps === nextProps) { 8980 return false; 8981 } 8982 if (!prevProps) { 8983 return !!nextProps; 8984 } 8985 if (!nextProps) { 8986 return true; 8987 } 8988 return hasPropsChanged(prevProps, nextProps, emits); 8989 } 8990 return false; 8991} 8992function hasPropsChanged(prevProps, nextProps, emitsOptions) { 8993 const nextKeys = Object.keys(nextProps); 8994 if (nextKeys.length !== Object.keys(prevProps).length) { 8995 return true; 8996 } 8997 for (let i = 0; i < nextKeys.length; i++) { 8998 const key = nextKeys[i]; 8999 if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { 9000 return true; 9001 } 9002 } 9003 return false; 9004} 9005function updateHOCHostEl({ vnode, parent }, el) { 9006 if (!el) 9007 return; 9008 while (parent) { 9009 const root = parent.subTree; 9010 if (root.suspense && root.suspense.activeBranch === vnode) { 9011 root.el = vnode.el; 9012 } 9013 if (root === vnode) { 9014 (vnode = parent.vnode).el = el; 9015 parent = parent.parent; 9016 } else { 9017 break; 9018 } 9019 } 9020} 9021 9022const COMPONENTS = "components"; 9023const DIRECTIVES = "directives"; 9024function resolveComponent(name, maybeSelfReference) { 9025 return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; 9026} 9027const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); 9028function resolveDynamicComponent(component) { 9029 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(component)) { 9030 return resolveAsset(COMPONENTS, component, false) || component; 9031 } else { 9032 return component || NULL_DYNAMIC_COMPONENT; 9033 } 9034} 9035function resolveDirective(name) { 9036 return resolveAsset(DIRECTIVES, name); 9037} 9038function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { 9039 const instance = currentRenderingInstance || currentInstance; 9040 if (instance) { 9041 const Component = instance.type; 9042 if (type === COMPONENTS) { 9043 const selfName = getComponentName( 9044 Component, 9045 false 9046 ); 9047 if (selfName && (selfName === name || selfName === (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name) || selfName === (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name)))) { 9048 return Component; 9049 } 9050 } 9051 const res = ( 9052 // local registration 9053 // check instance[type] first which is resolved for options API 9054 resolve(instance[type] || Component[type], name) || // global registration 9055 resolve(instance.appContext[type], name) 9056 ); 9057 if (!res && maybeSelfReference) { 9058 return Component; 9059 } 9060 if ( true && warnMissing && !res) { 9061 const extra = type === COMPONENTS ? ` 9062If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; 9063 warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); 9064 } 9065 return res; 9066 } else if (true) { 9067 warn$1( 9068 `resolve${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)(type.slice(0, -1))} can only be used in render() or setup().` 9069 ); 9070 } 9071} 9072function resolve(registry, name) { 9073 return registry && (registry[name] || registry[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name)] || registry[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name))]); 9074} 9075 9076const isSuspense = (type) => type.__isSuspense; 9077let suspenseId = 0; 9078const SuspenseImpl = { 9079 name: "Suspense", 9080 // In order to make Suspense tree-shakable, we need to avoid importing it 9081 // directly in the renderer. The renderer checks for the __isSuspense flag 9082 // on a vnode's type and calls the `process` method, passing in renderer 9083 // internals. 9084 __isSuspense: true, 9085 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { 9086 if (n1 == null) { 9087 mountSuspense( 9088 n2, 9089 container, 9090 anchor, 9091 parentComponent, 9092 parentSuspense, 9093 namespace, 9094 slotScopeIds, 9095 optimized, 9096 rendererInternals 9097 ); 9098 } else { 9099 patchSuspense( 9100 n1, 9101 n2, 9102 container, 9103 anchor, 9104 parentComponent, 9105 namespace, 9106 slotScopeIds, 9107 optimized, 9108 rendererInternals 9109 ); 9110 } 9111 }, 9112 hydrate: hydrateSuspense, 9113 create: createSuspenseBoundary, 9114 normalize: normalizeSuspenseChildren 9115}; 9116const Suspense = SuspenseImpl ; 9117function triggerEvent(vnode, name) { 9118 const eventListener = vnode.props && vnode.props[name]; 9119 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(eventListener)) { 9120 eventListener(); 9121 } 9122} 9123function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { 9124 const { 9125 p: patch, 9126 o: { createElement } 9127 } = rendererInternals; 9128 const hiddenContainer = createElement("div"); 9129 const suspense = vnode.suspense = createSuspenseBoundary( 9130 vnode, 9131 parentSuspense, 9132 parentComponent, 9133 container, 9134 hiddenContainer, 9135 anchor, 9136 namespace, 9137 slotScopeIds, 9138 optimized, 9139 rendererInternals 9140 ); 9141 patch( 9142 null, 9143 suspense.pendingBranch = vnode.ssContent, 9144 hiddenContainer, 9145 null, 9146 parentComponent, 9147 suspense, 9148 namespace, 9149 slotScopeIds 9150 ); 9151 if (suspense.deps > 0) { 9152 triggerEvent(vnode, "onPending"); 9153 triggerEvent(vnode, "onFallback"); 9154 patch( 9155 null, 9156 vnode.ssFallback, 9157 container, 9158 anchor, 9159 parentComponent, 9160 null, 9161 // fallback tree will not have suspense context 9162 namespace, 9163 slotScopeIds 9164 ); 9165 setActiveBranch(suspense, vnode.ssFallback); 9166 } else { 9167 suspense.resolve(false, true); 9168 } 9169} 9170function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { 9171 const suspense = n2.suspense = n1.suspense; 9172 suspense.vnode = n2; 9173 n2.el = n1.el; 9174 const newBranch = n2.ssContent; 9175 const newFallback = n2.ssFallback; 9176 const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; 9177 if (pendingBranch) { 9178 suspense.pendingBranch = newBranch; 9179 if (isSameVNodeType(newBranch, pendingBranch)) { 9180 patch( 9181 pendingBranch, 9182 newBranch, 9183 suspense.hiddenContainer, 9184 null, 9185 parentComponent, 9186 suspense, 9187 namespace, 9188 slotScopeIds, 9189 optimized 9190 ); 9191 if (suspense.deps <= 0) { 9192 suspense.resolve(); 9193 } else if (isInFallback) { 9194 if (!isHydrating) { 9195 patch( 9196 activeBranch, 9197 newFallback, 9198 container, 9199 anchor, 9200 parentComponent, 9201 null, 9202 // fallback tree will not have suspense context 9203 namespace, 9204 slotScopeIds, 9205 optimized 9206 ); 9207 setActiveBranch(suspense, newFallback); 9208 } 9209 } 9210 } else { 9211 suspense.pendingId = suspenseId++; 9212 if (isHydrating) { 9213 suspense.isHydrating = false; 9214 suspense.activeBranch = pendingBranch; 9215 } else { 9216 unmount(pendingBranch, parentComponent, suspense); 9217 } 9218 suspense.deps = 0; 9219 suspense.effects.length = 0; 9220 suspense.hiddenContainer = createElement("div"); 9221 if (isInFallback) { 9222 patch( 9223 null, 9224 newBranch, 9225 suspense.hiddenContainer, 9226 null, 9227 parentComponent, 9228 suspense, 9229 namespace, 9230 slotScopeIds, 9231 optimized 9232 ); 9233 if (suspense.deps <= 0) { 9234 suspense.resolve(); 9235 } else { 9236 patch( 9237 activeBranch, 9238 newFallback, 9239 container, 9240 anchor, 9241 parentComponent, 9242 null, 9243 // fallback tree will not have suspense context 9244 namespace, 9245 slotScopeIds, 9246 optimized 9247 ); 9248 setActiveBranch(suspense, newFallback); 9249 } 9250 } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { 9251 patch( 9252 activeBranch, 9253 newBranch, 9254 container, 9255 anchor, 9256 parentComponent, 9257 suspense, 9258 namespace, 9259 slotScopeIds, 9260 optimized 9261 ); 9262 suspense.resolve(true); 9263 } else { 9264 patch( 9265 null, 9266 newBranch, 9267 suspense.hiddenContainer, 9268 null, 9269 parentComponent, 9270 suspense, 9271 namespace, 9272 slotScopeIds, 9273 optimized 9274 ); 9275 if (suspense.deps <= 0) { 9276 suspense.resolve(); 9277 } 9278 } 9279 } 9280 } else { 9281 if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { 9282 patch( 9283 activeBranch, 9284 newBranch, 9285 container, 9286 anchor, 9287 parentComponent, 9288 suspense, 9289 namespace, 9290 slotScopeIds, 9291 optimized 9292 ); 9293 setActiveBranch(suspense, newBranch); 9294 } else { 9295 triggerEvent(n2, "onPending"); 9296 suspense.pendingBranch = newBranch; 9297 if (newBranch.shapeFlag & 512) { 9298 suspense.pendingId = newBranch.component.suspenseId; 9299 } else { 9300 suspense.pendingId = suspenseId++; 9301 } 9302 patch( 9303 null, 9304 newBranch, 9305 suspense.hiddenContainer, 9306 null, 9307 parentComponent, 9308 suspense, 9309 namespace, 9310 slotScopeIds, 9311 optimized 9312 ); 9313 if (suspense.deps <= 0) { 9314 suspense.resolve(); 9315 } else { 9316 const { timeout, pendingId } = suspense; 9317 if (timeout > 0) { 9318 setTimeout(() => { 9319 if (suspense.pendingId === pendingId) { 9320 suspense.fallback(newFallback); 9321 } 9322 }, timeout); 9323 } else if (timeout === 0) { 9324 suspense.fallback(newFallback); 9325 } 9326 } 9327 } 9328 } 9329} 9330let hasWarned = false; 9331function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { 9332 if ( true && !hasWarned) { 9333 hasWarned = true; 9334 console[console.info ? "info" : "log"]( 9335 `<Suspense> is an experimental feature and its API will likely change.` 9336 ); 9337 } 9338 const { 9339 p: patch, 9340 m: move, 9341 um: unmount, 9342 n: next, 9343 o: { parentNode, remove } 9344 } = rendererInternals; 9345 let parentSuspenseId; 9346 const isSuspensible = isVNodeSuspensible(vnode); 9347 if (isSuspensible) { 9348 if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) { 9349 parentSuspenseId = parentSuspense.pendingId; 9350 parentSuspense.deps++; 9351 } 9352 } 9353 const timeout = vnode.props ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(vnode.props.timeout) : void 0; 9354 if (true) { 9355 assertNumber(timeout, `Suspense timeout`); 9356 } 9357 const suspense = { 9358 vnode, 9359 parent: parentSuspense, 9360 parentComponent, 9361 namespace, 9362 container, 9363 hiddenContainer, 9364 anchor, 9365 deps: 0, 9366 pendingId: suspenseId++, 9367 timeout: typeof timeout === "number" ? timeout : -1, 9368 activeBranch: null, 9369 pendingBranch: null, 9370 isInFallback: !isHydrating, 9371 isHydrating, 9372 isUnmounted: false, 9373 effects: [], 9374 resolve(resume = false, sync = false) { 9375 if (true) { 9376 if (!resume && !suspense.pendingBranch) { 9377 throw new Error( 9378 `suspense.resolve() is called without a pending branch.` 9379 ); 9380 } 9381 if (suspense.isUnmounted) { 9382 throw new Error( 9383 `suspense.resolve() is called on an already unmounted suspense boundary.` 9384 ); 9385 } 9386 } 9387 const { 9388 vnode: vnode2, 9389 activeBranch, 9390 pendingBranch, 9391 pendingId, 9392 effects, 9393 parentComponent: parentComponent2, 9394 container: container2 9395 } = suspense; 9396 let delayEnter = false; 9397 if (suspense.isHydrating) { 9398 suspense.isHydrating = false; 9399 } else if (!resume) { 9400 delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; 9401 if (delayEnter) { 9402 activeBranch.transition.afterLeave = () => { 9403 if (pendingId === suspense.pendingId) { 9404 move( 9405 pendingBranch, 9406 container2, 9407 next(activeBranch), 9408 0 9409 ); 9410 queuePostFlushCb(effects); 9411 } 9412 }; 9413 } 9414 let { anchor: anchor2 } = suspense; 9415 if (activeBranch) { 9416 anchor2 = next(activeBranch); 9417 unmount(activeBranch, parentComponent2, suspense, true); 9418 } 9419 if (!delayEnter) { 9420 move(pendingBranch, container2, anchor2, 0); 9421 } 9422 } 9423 setActiveBranch(suspense, pendingBranch); 9424 suspense.pendingBranch = null; 9425 suspense.isInFallback = false; 9426 let parent = suspense.parent; 9427 let hasUnresolvedAncestor = false; 9428 while (parent) { 9429 if (parent.pendingBranch) { 9430 parent.effects.push(...effects); 9431 hasUnresolvedAncestor = true; 9432 break; 9433 } 9434 parent = parent.parent; 9435 } 9436 if (!hasUnresolvedAncestor && !delayEnter) { 9437 queuePostFlushCb(effects); 9438 } 9439 suspense.effects = []; 9440 if (isSuspensible) { 9441 if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { 9442 parentSuspense.deps--; 9443 if (parentSuspense.deps === 0 && !sync) { 9444 parentSuspense.resolve(); 9445 } 9446 } 9447 } 9448 triggerEvent(vnode2, "onResolve"); 9449 }, 9450 fallback(fallbackVNode) { 9451 if (!suspense.pendingBranch) { 9452 return; 9453 } 9454 const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; 9455 triggerEvent(vnode2, "onFallback"); 9456 const anchor2 = next(activeBranch); 9457 const mountFallback = () => { 9458 if (!suspense.isInFallback) { 9459 return; 9460 } 9461 patch( 9462 null, 9463 fallbackVNode, 9464 container2, 9465 anchor2, 9466 parentComponent2, 9467 null, 9468 // fallback tree will not have suspense context 9469 namespace2, 9470 slotScopeIds, 9471 optimized 9472 ); 9473 setActiveBranch(suspense, fallbackVNode); 9474 }; 9475 const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; 9476 if (delayEnter) { 9477 activeBranch.transition.afterLeave = mountFallback; 9478 } 9479 suspense.isInFallback = true; 9480 unmount( 9481 activeBranch, 9482 parentComponent2, 9483 null, 9484 // no suspense so unmount hooks fire now 9485 true 9486 // shouldRemove 9487 ); 9488 if (!delayEnter) { 9489 mountFallback(); 9490 } 9491 }, 9492 move(container2, anchor2, type) { 9493 suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); 9494 suspense.container = container2; 9495 }, 9496 next() { 9497 return suspense.activeBranch && next(suspense.activeBranch); 9498 }, 9499 registerDep(instance, setupRenderEffect) { 9500 const isInPendingSuspense = !!suspense.pendingBranch; 9501 if (isInPendingSuspense) { 9502 suspense.deps++; 9503 } 9504 const hydratedEl = instance.vnode.el; 9505 instance.asyncDep.catch((err) => { 9506 handleError(err, instance, 0); 9507 }).then((asyncSetupResult) => { 9508 if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { 9509 return; 9510 } 9511 instance.asyncResolved = true; 9512 const { vnode: vnode2 } = instance; 9513 if (true) { 9514 pushWarningContext(vnode2); 9515 } 9516 handleSetupResult(instance, asyncSetupResult, false); 9517 if (hydratedEl) { 9518 vnode2.el = hydratedEl; 9519 } 9520 const placeholder = !hydratedEl && instance.subTree.el; 9521 setupRenderEffect( 9522 instance, 9523 vnode2, 9524 // component may have been moved before resolve. 9525 // if this is not a hydration, instance.subTree will be the comment 9526 // placeholder. 9527 parentNode(hydratedEl || instance.subTree.el), 9528 // anchor will not be used if this is hydration, so only need to 9529 // consider the comment placeholder case. 9530 hydratedEl ? null : next(instance.subTree), 9531 suspense, 9532 namespace, 9533 optimized 9534 ); 9535 if (placeholder) { 9536 remove(placeholder); 9537 } 9538 updateHOCHostEl(instance, vnode2.el); 9539 if (true) { 9540 popWarningContext(); 9541 } 9542 if (isInPendingSuspense && --suspense.deps === 0) { 9543 suspense.resolve(); 9544 } 9545 }); 9546 }, 9547 unmount(parentSuspense2, doRemove) { 9548 suspense.isUnmounted = true; 9549 if (suspense.activeBranch) { 9550 unmount( 9551 suspense.activeBranch, 9552 parentComponent, 9553 parentSuspense2, 9554 doRemove 9555 ); 9556 } 9557 if (suspense.pendingBranch) { 9558 unmount( 9559 suspense.pendingBranch, 9560 parentComponent, 9561 parentSuspense2, 9562 doRemove 9563 ); 9564 } 9565 } 9566 }; 9567 return suspense; 9568} 9569function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { 9570 const suspense = vnode.suspense = createSuspenseBoundary( 9571 vnode, 9572 parentSuspense, 9573 parentComponent, 9574 node.parentNode, 9575 // eslint-disable-next-line no-restricted-globals 9576 document.createElement("div"), 9577 null, 9578 namespace, 9579 slotScopeIds, 9580 optimized, 9581 rendererInternals, 9582 true 9583 ); 9584 const result = hydrateNode( 9585 node, 9586 suspense.pendingBranch = vnode.ssContent, 9587 parentComponent, 9588 suspense, 9589 slotScopeIds, 9590 optimized 9591 ); 9592 if (suspense.deps === 0) { 9593 suspense.resolve(false, true); 9594 } 9595 return result; 9596} 9597function normalizeSuspenseChildren(vnode) { 9598 const { shapeFlag, children } = vnode; 9599 const isSlotChildren = shapeFlag & 32; 9600 vnode.ssContent = normalizeSuspenseSlot( 9601 isSlotChildren ? children.default : children 9602 ); 9603 vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); 9604} 9605function normalizeSuspenseSlot(s) { 9606 let block; 9607 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(s)) { 9608 const trackBlock = isBlockTreeEnabled && s._c; 9609 if (trackBlock) { 9610 s._d = false; 9611 openBlock(); 9612 } 9613 s = s(); 9614 if (trackBlock) { 9615 s._d = true; 9616 block = currentBlock; 9617 closeBlock(); 9618 } 9619 } 9620 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(s)) { 9621 const singleChild = filterSingleRoot(s); 9622 if ( true && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { 9623 warn$1(`<Suspense> slots expect a single root node.`); 9624 } 9625 s = singleChild; 9626 } 9627 s = normalizeVNode(s); 9628 if (block && !s.dynamicChildren) { 9629 s.dynamicChildren = block.filter((c) => c !== s); 9630 } 9631 return s; 9632} 9633function queueEffectWithSuspense(fn, suspense) { 9634 if (suspense && suspense.pendingBranch) { 9635 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(fn)) { 9636 suspense.effects.push(...fn); 9637 } else { 9638 suspense.effects.push(fn); 9639 } 9640 } else { 9641 queuePostFlushCb(fn); 9642 } 9643} 9644function setActiveBranch(suspense, branch) { 9645 suspense.activeBranch = branch; 9646 const { vnode, parentComponent } = suspense; 9647 const el = vnode.el = branch.el; 9648 if (parentComponent && parentComponent.subTree === vnode) { 9649 parentComponent.vnode.el = el; 9650 updateHOCHostEl(parentComponent, el); 9651 } 9652} 9653function isVNodeSuspensible(vnode) { 9654 var _a; 9655 return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false; 9656} 9657 9658const ssrContextKey = Symbol.for("v-scx"); 9659const useSSRContext = () => { 9660 { 9661 const ctx = inject(ssrContextKey); 9662 if (!ctx) { 9663 true && warn$1( 9664 `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` 9665 ); 9666 } 9667 return ctx; 9668 } 9669}; 9670 9671function watchEffect(effect, options) { 9672 return doWatch(effect, null, options); 9673} 9674function watchPostEffect(effect, options) { 9675 return doWatch( 9676 effect, 9677 null, 9678 true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, options, { flush: "post" }) : 0 9679 ); 9680} 9681function watchSyncEffect(effect, options) { 9682 return doWatch( 9683 effect, 9684 null, 9685 true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, options, { flush: "sync" }) : 0 9686 ); 9687} 9688const INITIAL_WATCHER_VALUE = {}; 9689function watch(source, cb, options) { 9690 if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(cb)) { 9691 warn$1( 9692 `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` 9693 ); 9694 } 9695 return doWatch(source, cb, options); 9696} 9697function doWatch(source, cb, { 9698 immediate, 9699 deep, 9700 flush, 9701 once, 9702 onTrack, 9703 onTrigger 9704} = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { 9705 if (cb && once) { 9706 const _cb = cb; 9707 cb = (...args) => { 9708 _cb(...args); 9709 unwatch(); 9710 }; 9711 } 9712 if ( true && deep !== void 0 && typeof deep === "number") { 9713 warn$1( 9714 `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.` 9715 ); 9716 } 9717 if ( true && !cb) { 9718 if (immediate !== void 0) { 9719 warn$1( 9720 `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` 9721 ); 9722 } 9723 if (deep !== void 0) { 9724 warn$1( 9725 `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` 9726 ); 9727 } 9728 if (once !== void 0) { 9729 warn$1( 9730 `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` 9731 ); 9732 } 9733 } 9734 const warnInvalidSource = (s) => { 9735 warn$1( 9736 `Invalid watch source: `, 9737 s, 9738 `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` 9739 ); 9740 }; 9741 const instance = currentInstance; 9742 const reactiveGetter = (source2) => deep === true ? source2 : ( 9743 // for deep: false, only traverse root-level properties 9744 traverse(source2, deep === false ? 1 : void 0) 9745 ); 9746 let getter; 9747 let forceTrigger = false; 9748 let isMultiSource = false; 9749 if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(source)) { 9750 getter = () => source.value; 9751 forceTrigger = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow)(source); 9752 } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(source)) { 9753 getter = () => reactiveGetter(source); 9754 forceTrigger = true; 9755 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(source)) { 9756 isMultiSource = true; 9757 forceTrigger = source.some((s) => (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(s) || (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow)(s)); 9758 getter = () => source.map((s) => { 9759 if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(s)) { 9760 return s.value; 9761 } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(s)) { 9762 return reactiveGetter(s); 9763 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(s)) { 9764 return callWithErrorHandling(s, instance, 2); 9765 } else { 9766 true && warnInvalidSource(s); 9767 } 9768 }); 9769 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(source)) { 9770 if (cb) { 9771 getter = () => callWithErrorHandling(source, instance, 2); 9772 } else { 9773 getter = () => { 9774 if (cleanup) { 9775 cleanup(); 9776 } 9777 return callWithAsyncErrorHandling( 9778 source, 9779 instance, 9780 3, 9781 [onCleanup] 9782 ); 9783 }; 9784 } 9785 } else { 9786 getter = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; 9787 true && warnInvalidSource(source); 9788 } 9789 if (cb && deep) { 9790 const baseGetter = getter; 9791 getter = () => traverse(baseGetter()); 9792 } 9793 let cleanup; 9794 let onCleanup = (fn) => { 9795 cleanup = effect.onStop = () => { 9796 callWithErrorHandling(fn, instance, 4); 9797 cleanup = effect.onStop = void 0; 9798 }; 9799 }; 9800 let ssrCleanup; 9801 if (isInSSRComponentSetup) { 9802 onCleanup = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; 9803 if (!cb) { 9804 getter(); 9805 } else if (immediate) { 9806 callWithAsyncErrorHandling(cb, instance, 3, [ 9807 getter(), 9808 isMultiSource ? [] : void 0, 9809 onCleanup 9810 ]); 9811 } 9812 if (flush === "sync") { 9813 const ctx = useSSRContext(); 9814 ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); 9815 } else { 9816 return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; 9817 } 9818 } 9819 let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; 9820 const job = () => { 9821 if (!effect.active || !effect.dirty) { 9822 return; 9823 } 9824 if (cb) { 9825 const newValue = effect.run(); 9826 if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(v, oldValue[i])) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(newValue, oldValue)) || false) { 9827 if (cleanup) { 9828 cleanup(); 9829 } 9830 callWithAsyncErrorHandling(cb, instance, 3, [ 9831 newValue, 9832 // pass undefined as the old value when it's changed for the first time 9833 oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, 9834 onCleanup 9835 ]); 9836 oldValue = newValue; 9837 } 9838 } else { 9839 effect.run(); 9840 } 9841 }; 9842 job.allowRecurse = !!cb; 9843 let scheduler; 9844 if (flush === "sync") { 9845 scheduler = job; 9846 } else if (flush === "post") { 9847 scheduler = () => queuePostRenderEffect(job, instance && instance.suspense); 9848 } else { 9849 job.pre = true; 9850 if (instance) 9851 job.id = instance.uid; 9852 scheduler = () => queueJob(job); 9853 } 9854 const effect = new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect(getter, _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP, scheduler); 9855 const scope = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); 9856 const unwatch = () => { 9857 effect.stop(); 9858 if (scope) { 9859 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(scope.effects, effect); 9860 } 9861 }; 9862 if (true) { 9863 effect.onTrack = onTrack; 9864 effect.onTrigger = onTrigger; 9865 } 9866 if (cb) { 9867 if (immediate) { 9868 job(); 9869 } else { 9870 oldValue = effect.run(); 9871 } 9872 } else if (flush === "post") { 9873 queuePostRenderEffect( 9874 effect.run.bind(effect), 9875 instance && instance.suspense 9876 ); 9877 } else { 9878 effect.run(); 9879 } 9880 if (ssrCleanup) 9881 ssrCleanup.push(unwatch); 9882 return unwatch; 9883} 9884function instanceWatch(source, value, options) { 9885 const publicThis = this.proxy; 9886 const getter = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); 9887 let cb; 9888 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { 9889 cb = value; 9890 } else { 9891 cb = value.handler; 9892 options = value; 9893 } 9894 const cur = currentInstance; 9895 setCurrentInstance(this); 9896 const res = doWatch(getter, cb.bind(publicThis), options); 9897 if (cur) { 9898 setCurrentInstance(cur); 9899 } else { 9900 unsetCurrentInstance(); 9901 } 9902 return res; 9903} 9904function createPathGetter(ctx, path) { 9905 const segments = path.split("."); 9906 return () => { 9907 let cur = ctx; 9908 for (let i = 0; i < segments.length && cur; i++) { 9909 cur = cur[segments[i]]; 9910 } 9911 return cur; 9912 }; 9913} 9914function traverse(value, depth, currentDepth = 0, seen) { 9915 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(value) || value["__v_skip"]) { 9916 return value; 9917 } 9918 if (depth && depth > 0) { 9919 if (currentDepth >= depth) { 9920 return value; 9921 } 9922 currentDepth++; 9923 } 9924 seen = seen || /* @__PURE__ */ new Set(); 9925 if (seen.has(value)) { 9926 return value; 9927 } 9928 seen.add(value); 9929 if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(value)) { 9930 traverse(value.value, depth, currentDepth, seen); 9931 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { 9932 for (let i = 0; i < value.length; i++) { 9933 traverse(value[i], depth, currentDepth, seen); 9934 } 9935 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isMap)(value)) { 9936 value.forEach((v) => { 9937 traverse(v, depth, currentDepth, seen); 9938 }); 9939 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value)) { 9940 for (const key in value) { 9941 traverse(value[key], depth, currentDepth, seen); 9942 } 9943 } 9944 return value; 9945} 9946 9947function validateDirectiveName(name) { 9948 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isBuiltInDirective)(name)) { 9949 warn$1("Do not use built-in directive ids as custom directive id: " + name); 9950 } 9951} 9952function withDirectives(vnode, directives) { 9953 const internalInstance = currentRenderingInstance; 9954 if (internalInstance === null) { 9955 true && warn$1(`withDirectives can only be used inside render functions.`); 9956 return vnode; 9957 } 9958 const instance = getExposeProxy(internalInstance) || internalInstance.proxy; 9959 const bindings = vnode.dirs || (vnode.dirs = []); 9960 for (let i = 0; i < directives.length; i++) { 9961 let [dir, value, arg, modifiers = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ] = directives[i]; 9962 if (dir) { 9963 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(dir)) { 9964 dir = { 9965 mounted: dir, 9966 updated: dir 9967 }; 9968 } 9969 if (dir.deep) { 9970 traverse(value); 9971 } 9972 bindings.push({ 9973 dir, 9974 instance, 9975 value, 9976 oldValue: void 0, 9977 arg, 9978 modifiers 9979 }); 9980 } 9981 } 9982 return vnode; 9983} 9984function invokeDirectiveHook(vnode, prevVNode, instance, name) { 9985 const bindings = vnode.dirs; 9986 const oldBindings = prevVNode && prevVNode.dirs; 9987 for (let i = 0; i < bindings.length; i++) { 9988 const binding = bindings[i]; 9989 if (oldBindings) { 9990 binding.oldValue = oldBindings[i].value; 9991 } 9992 let hook = binding.dir[name]; 9993 if (hook) { 9994 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); 9995 callWithAsyncErrorHandling(hook, instance, 8, [ 9996 vnode.el, 9997 binding, 9998 vnode, 9999 prevVNode 10000 ]); 10001 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); 10002 } 10003 } 10004} 10005 10006const leaveCbKey = Symbol("_leaveCb"); 10007const enterCbKey = Symbol("_enterCb"); 10008function useTransitionState() { 10009 const state = { 10010 isMounted: false, 10011 isLeaving: false, 10012 isUnmounting: false, 10013 leavingVNodes: /* @__PURE__ */ new Map() 10014 }; 10015 onMounted(() => { 10016 state.isMounted = true; 10017 }); 10018 onBeforeUnmount(() => { 10019 state.isUnmounting = true; 10020 }); 10021 return state; 10022} 10023const TransitionHookValidator = [Function, Array]; 10024const BaseTransitionPropsValidators = { 10025 mode: String, 10026 appear: Boolean, 10027 persisted: Boolean, 10028 // enter 10029 onBeforeEnter: TransitionHookValidator, 10030 onEnter: TransitionHookValidator, 10031 onAfterEnter: TransitionHookValidator, 10032 onEnterCancelled: TransitionHookValidator, 10033 // leave 10034 onBeforeLeave: TransitionHookValidator, 10035 onLeave: TransitionHookValidator, 10036 onAfterLeave: TransitionHookValidator, 10037 onLeaveCancelled: TransitionHookValidator, 10038 // appear 10039 onBeforeAppear: TransitionHookValidator, 10040 onAppear: TransitionHookValidator, 10041 onAfterAppear: TransitionHookValidator, 10042 onAppearCancelled: TransitionHookValidator 10043}; 10044const BaseTransitionImpl = { 10045 name: `BaseTransition`, 10046 props: BaseTransitionPropsValidators, 10047 setup(props, { slots }) { 10048 const instance = getCurrentInstance(); 10049 const state = useTransitionState(); 10050 let prevTransitionKey; 10051 return () => { 10052 const children = slots.default && getTransitionRawChildren(slots.default(), true); 10053 if (!children || !children.length) { 10054 return; 10055 } 10056 let child = children[0]; 10057 if (children.length > 1) { 10058 let hasFound = false; 10059 for (const c of children) { 10060 if (c.type !== Comment) { 10061 if ( true && hasFound) { 10062 warn$1( 10063 "<transition> can only be used on a single element or component. Use <transition-group> for lists." 10064 ); 10065 break; 10066 } 10067 child = c; 10068 hasFound = true; 10069 if (false) 10070 {} 10071 } 10072 } 10073 } 10074 const rawProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); 10075 const { mode } = rawProps; 10076 if ( true && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { 10077 warn$1(`invalid <transition> mode: ${mode}`); 10078 } 10079 if (state.isLeaving) { 10080 return emptyPlaceholder(child); 10081 } 10082 const innerChild = getKeepAliveChild(child); 10083 if (!innerChild) { 10084 return emptyPlaceholder(child); 10085 } 10086 const enterHooks = resolveTransitionHooks( 10087 innerChild, 10088 rawProps, 10089 state, 10090 instance 10091 ); 10092 setTransitionHooks(innerChild, enterHooks); 10093 const oldChild = instance.subTree; 10094 const oldInnerChild = oldChild && getKeepAliveChild(oldChild); 10095 let transitionKeyChanged = false; 10096 const { getTransitionKey } = innerChild.type; 10097 if (getTransitionKey) { 10098 const key = getTransitionKey(); 10099 if (prevTransitionKey === void 0) { 10100 prevTransitionKey = key; 10101 } else if (key !== prevTransitionKey) { 10102 prevTransitionKey = key; 10103 transitionKeyChanged = true; 10104 } 10105 } 10106 if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) { 10107 const leavingHooks = resolveTransitionHooks( 10108 oldInnerChild, 10109 rawProps, 10110 state, 10111 instance 10112 ); 10113 setTransitionHooks(oldInnerChild, leavingHooks); 10114 if (mode === "out-in") { 10115 state.isLeaving = true; 10116 leavingHooks.afterLeave = () => { 10117 state.isLeaving = false; 10118 if (instance.update.active !== false) { 10119 instance.effect.dirty = true; 10120 instance.update(); 10121 } 10122 }; 10123 return emptyPlaceholder(child); 10124 } else if (mode === "in-out" && innerChild.type !== Comment) { 10125 leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { 10126 const leavingVNodesCache = getLeavingNodesForType( 10127 state, 10128 oldInnerChild 10129 ); 10130 leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; 10131 el[leaveCbKey] = () => { 10132 earlyRemove(); 10133 el[leaveCbKey] = void 0; 10134 delete enterHooks.delayedLeave; 10135 }; 10136 enterHooks.delayedLeave = delayedLeave; 10137 }; 10138 } 10139 } 10140 return child; 10141 }; 10142 } 10143}; 10144const BaseTransition = BaseTransitionImpl; 10145function getLeavingNodesForType(state, vnode) { 10146 const { leavingVNodes } = state; 10147 let leavingVNodesCache = leavingVNodes.get(vnode.type); 10148 if (!leavingVNodesCache) { 10149 leavingVNodesCache = /* @__PURE__ */ Object.create(null); 10150 leavingVNodes.set(vnode.type, leavingVNodesCache); 10151 } 10152 return leavingVNodesCache; 10153} 10154function resolveTransitionHooks(vnode, props, state, instance) { 10155 const { 10156 appear, 10157 mode, 10158 persisted = false, 10159 onBeforeEnter, 10160 onEnter, 10161 onAfterEnter, 10162 onEnterCancelled, 10163 onBeforeLeave, 10164 onLeave, 10165 onAfterLeave, 10166 onLeaveCancelled, 10167 onBeforeAppear, 10168 onAppear, 10169 onAfterAppear, 10170 onAppearCancelled 10171 } = props; 10172 const key = String(vnode.key); 10173 const leavingVNodesCache = getLeavingNodesForType(state, vnode); 10174 const callHook = (hook, args) => { 10175 hook && callWithAsyncErrorHandling( 10176 hook, 10177 instance, 10178 9, 10179 args 10180 ); 10181 }; 10182 const callAsyncHook = (hook, args) => { 10183 const done = args[1]; 10184 callHook(hook, args); 10185 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { 10186 if (hook.every((hook2) => hook2.length <= 1)) 10187 done(); 10188 } else if (hook.length <= 1) { 10189 done(); 10190 } 10191 }; 10192 const hooks = { 10193 mode, 10194 persisted, 10195 beforeEnter(el) { 10196 let hook = onBeforeEnter; 10197 if (!state.isMounted) { 10198 if (appear) { 10199 hook = onBeforeAppear || onBeforeEnter; 10200 } else { 10201 return; 10202 } 10203 } 10204 if (el[leaveCbKey]) { 10205 el[leaveCbKey]( 10206 true 10207 /* cancelled */ 10208 ); 10209 } 10210 const leavingVNode = leavingVNodesCache[key]; 10211 if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { 10212 leavingVNode.el[leaveCbKey](); 10213 } 10214 callHook(hook, [el]); 10215 }, 10216 enter(el) { 10217 let hook = onEnter; 10218 let afterHook = onAfterEnter; 10219 let cancelHook = onEnterCancelled; 10220 if (!state.isMounted) { 10221 if (appear) { 10222 hook = onAppear || onEnter; 10223 afterHook = onAfterAppear || onAfterEnter; 10224 cancelHook = onAppearCancelled || onEnterCancelled; 10225 } else { 10226 return; 10227 } 10228 } 10229 let called = false; 10230 const done = el[enterCbKey] = (cancelled) => { 10231 if (called) 10232 return; 10233 called = true; 10234 if (cancelled) { 10235 callHook(cancelHook, [el]); 10236 } else { 10237 callHook(afterHook, [el]); 10238 } 10239 if (hooks.delayedLeave) { 10240 hooks.delayedLeave(); 10241 } 10242 el[enterCbKey] = void 0; 10243 }; 10244 if (hook) { 10245 callAsyncHook(hook, [el, done]); 10246 } else { 10247 done(); 10248 } 10249 }, 10250 leave(el, remove) { 10251 const key2 = String(vnode.key); 10252 if (el[enterCbKey]) { 10253 el[enterCbKey]( 10254 true 10255 /* cancelled */ 10256 ); 10257 } 10258 if (state.isUnmounting) { 10259 return remove(); 10260 } 10261 callHook(onBeforeLeave, [el]); 10262 let called = false; 10263 const done = el[leaveCbKey] = (cancelled) => { 10264 if (called) 10265 return; 10266 called = true; 10267 remove(); 10268 if (cancelled) { 10269 callHook(onLeaveCancelled, [el]); 10270 } else { 10271 callHook(onAfterLeave, [el]); 10272 } 10273 el[leaveCbKey] = void 0; 10274 if (leavingVNodesCache[key2] === vnode) { 10275 delete leavingVNodesCache[key2]; 10276 } 10277 }; 10278 leavingVNodesCache[key2] = vnode; 10279 if (onLeave) { 10280 callAsyncHook(onLeave, [el, done]); 10281 } else { 10282 done(); 10283 } 10284 }, 10285 clone(vnode2) { 10286 return resolveTransitionHooks(vnode2, props, state, instance); 10287 } 10288 }; 10289 return hooks; 10290} 10291function emptyPlaceholder(vnode) { 10292 if (isKeepAlive(vnode)) { 10293 vnode = cloneVNode(vnode); 10294 vnode.children = null; 10295 return vnode; 10296 } 10297} 10298function getKeepAliveChild(vnode) { 10299 return isKeepAlive(vnode) ? ( 10300 // #7121 ensure get the child component subtree in case 10301 // it's been replaced during HMR 10302 true && vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0 10303 ) : vnode; 10304} 10305function setTransitionHooks(vnode, hooks) { 10306 if (vnode.shapeFlag & 6 && vnode.component) { 10307 setTransitionHooks(vnode.component.subTree, hooks); 10308 } else if (vnode.shapeFlag & 128) { 10309 vnode.ssContent.transition = hooks.clone(vnode.ssContent); 10310 vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); 10311 } else { 10312 vnode.transition = hooks; 10313 } 10314} 10315function getTransitionRawChildren(children, keepComment = false, parentKey) { 10316 let ret = []; 10317 let keyedFragmentCount = 0; 10318 for (let i = 0; i < children.length; i++) { 10319 let child = children[i]; 10320 const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); 10321 if (child.type === Fragment) { 10322 if (child.patchFlag & 128) 10323 keyedFragmentCount++; 10324 ret = ret.concat( 10325 getTransitionRawChildren(child.children, keepComment, key) 10326 ); 10327 } else if (keepComment || child.type !== Comment) { 10328 ret.push(key != null ? cloneVNode(child, { key }) : child); 10329 } 10330 } 10331 if (keyedFragmentCount > 1) { 10332 for (let i = 0; i < ret.length; i++) { 10333 ret[i].patchFlag = -2; 10334 } 10335 } 10336 return ret; 10337} 10338 10339/*! #__NO_SIDE_EFFECTS__ */ 10340// @__NO_SIDE_EFFECTS__ 10341function defineComponent(options, extraOptions) { 10342 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? ( 10343 // #8326: extend call and options.name access are considered side-effects 10344 // by Rollup, so we have to wrap it in a pure-annotated IIFE. 10345 /* @__PURE__ */ (() => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({ name: options.name }, extraOptions, { setup: options }))() 10346 ) : options; 10347} 10348 10349const isAsyncWrapper = (i) => !!i.type.__asyncLoader; 10350/*! #__NO_SIDE_EFFECTS__ */ 10351// @__NO_SIDE_EFFECTS__ 10352function defineAsyncComponent(source) { 10353 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(source)) { 10354 source = { loader: source }; 10355 } 10356 const { 10357 loader, 10358 loadingComponent, 10359 errorComponent, 10360 delay = 200, 10361 timeout, 10362 // undefined = never times out 10363 suspensible = true, 10364 onError: userOnError 10365 } = source; 10366 let pendingRequest = null; 10367 let resolvedComp; 10368 let retries = 0; 10369 const retry = () => { 10370 retries++; 10371 pendingRequest = null; 10372 return load(); 10373 }; 10374 const load = () => { 10375 let thisRequest; 10376 return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { 10377 err = err instanceof Error ? err : new Error(String(err)); 10378 if (userOnError) { 10379 return new Promise((resolve, reject) => { 10380 const userRetry = () => resolve(retry()); 10381 const userFail = () => reject(err); 10382 userOnError(err, userRetry, userFail, retries + 1); 10383 }); 10384 } else { 10385 throw err; 10386 } 10387 }).then((comp) => { 10388 if (thisRequest !== pendingRequest && pendingRequest) { 10389 return pendingRequest; 10390 } 10391 if ( true && !comp) { 10392 warn$1( 10393 `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` 10394 ); 10395 } 10396 if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { 10397 comp = comp.default; 10398 } 10399 if ( true && comp && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { 10400 throw new Error(`Invalid async component load result: ${comp}`); 10401 } 10402 resolvedComp = comp; 10403 return comp; 10404 })); 10405 }; 10406 return defineComponent({ 10407 name: "AsyncComponentWrapper", 10408 __asyncLoader: load, 10409 get __asyncResolved() { 10410 return resolvedComp; 10411 }, 10412 setup() { 10413 const instance = currentInstance; 10414 if (resolvedComp) { 10415 return () => createInnerComp(resolvedComp, instance); 10416 } 10417 const onError = (err) => { 10418 pendingRequest = null; 10419 handleError( 10420 err, 10421 instance, 10422 13, 10423 !errorComponent 10424 ); 10425 }; 10426 if (suspensible && instance.suspense || isInSSRComponentSetup) { 10427 return load().then((comp) => { 10428 return () => createInnerComp(comp, instance); 10429 }).catch((err) => { 10430 onError(err); 10431 return () => errorComponent ? createVNode(errorComponent, { 10432 error: err 10433 }) : null; 10434 }); 10435 } 10436 const loaded = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(false); 10437 const error = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); 10438 const delayed = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(!!delay); 10439 if (delay) { 10440 setTimeout(() => { 10441 delayed.value = false; 10442 }, delay); 10443 } 10444 if (timeout != null) { 10445 setTimeout(() => { 10446 if (!loaded.value && !error.value) { 10447 const err = new Error( 10448 `Async component timed out after ${timeout}ms.` 10449 ); 10450 onError(err); 10451 error.value = err; 10452 } 10453 }, timeout); 10454 } 10455 load().then(() => { 10456 loaded.value = true; 10457 if (instance.parent && isKeepAlive(instance.parent.vnode)) { 10458 instance.parent.effect.dirty = true; 10459 queueJob(instance.parent.update); 10460 } 10461 }).catch((err) => { 10462 onError(err); 10463 error.value = err; 10464 }); 10465 return () => { 10466 if (loaded.value && resolvedComp) { 10467 return createInnerComp(resolvedComp, instance); 10468 } else if (error.value && errorComponent) { 10469 return createVNode(errorComponent, { 10470 error: error.value 10471 }); 10472 } else if (loadingComponent && !delayed.value) { 10473 return createVNode(loadingComponent); 10474 } 10475 }; 10476 } 10477 }); 10478} 10479function createInnerComp(comp, parent) { 10480 const { ref: ref2, props, children, ce } = parent.vnode; 10481 const vnode = createVNode(comp, props, children); 10482 vnode.ref = ref2; 10483 vnode.ce = ce; 10484 delete parent.vnode.ce; 10485 return vnode; 10486} 10487 10488const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; 10489const KeepAliveImpl = { 10490 name: `KeepAlive`, 10491 // Marker for special handling inside the renderer. We are not using a === 10492 // check directly on KeepAlive in the renderer, because importing it directly 10493 // would prevent it from being tree-shaken. 10494 __isKeepAlive: true, 10495 props: { 10496 include: [String, RegExp, Array], 10497 exclude: [String, RegExp, Array], 10498 max: [String, Number] 10499 }, 10500 setup(props, { slots }) { 10501 const instance = getCurrentInstance(); 10502 const sharedContext = instance.ctx; 10503 if (!sharedContext.renderer) { 10504 return () => { 10505 const children = slots.default && slots.default(); 10506 return children && children.length === 1 ? children[0] : children; 10507 }; 10508 } 10509 const cache = /* @__PURE__ */ new Map(); 10510 const keys = /* @__PURE__ */ new Set(); 10511 let current = null; 10512 if (true) { 10513 instance.__v_cache = cache; 10514 } 10515 const parentSuspense = instance.suspense; 10516 const { 10517 renderer: { 10518 p: patch, 10519 m: move, 10520 um: _unmount, 10521 o: { createElement } 10522 } 10523 } = sharedContext; 10524 const storageContainer = createElement("div"); 10525 sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { 10526 const instance2 = vnode.component; 10527 move(vnode, container, anchor, 0, parentSuspense); 10528 patch( 10529 instance2.vnode, 10530 vnode, 10531 container, 10532 anchor, 10533 instance2, 10534 parentSuspense, 10535 namespace, 10536 vnode.slotScopeIds, 10537 optimized 10538 ); 10539 queuePostRenderEffect(() => { 10540 instance2.isDeactivated = false; 10541 if (instance2.a) { 10542 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance2.a); 10543 } 10544 const vnodeHook = vnode.props && vnode.props.onVnodeMounted; 10545 if (vnodeHook) { 10546 invokeVNodeHook(vnodeHook, instance2.parent, vnode); 10547 } 10548 }, parentSuspense); 10549 if (true) { 10550 devtoolsComponentAdded(instance2); 10551 } 10552 }; 10553 sharedContext.deactivate = (vnode) => { 10554 const instance2 = vnode.component; 10555 move(vnode, storageContainer, null, 1, parentSuspense); 10556 queuePostRenderEffect(() => { 10557 if (instance2.da) { 10558 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance2.da); 10559 } 10560 const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; 10561 if (vnodeHook) { 10562 invokeVNodeHook(vnodeHook, instance2.parent, vnode); 10563 } 10564 instance2.isDeactivated = true; 10565 }, parentSuspense); 10566 if (true) { 10567 devtoolsComponentAdded(instance2); 10568 } 10569 }; 10570 function unmount(vnode) { 10571 resetShapeFlag(vnode); 10572 _unmount(vnode, instance, parentSuspense, true); 10573 } 10574 function pruneCache(filter) { 10575 cache.forEach((vnode, key) => { 10576 const name = getComponentName(vnode.type); 10577 if (name && (!filter || !filter(name))) { 10578 pruneCacheEntry(key); 10579 } 10580 }); 10581 } 10582 function pruneCacheEntry(key) { 10583 const cached = cache.get(key); 10584 if (!current || !isSameVNodeType(cached, current)) { 10585 unmount(cached); 10586 } else if (current) { 10587 resetShapeFlag(current); 10588 } 10589 cache.delete(key); 10590 keys.delete(key); 10591 } 10592 watch( 10593 () => [props.include, props.exclude], 10594 ([include, exclude]) => { 10595 include && pruneCache((name) => matches(include, name)); 10596 exclude && pruneCache((name) => !matches(exclude, name)); 10597 }, 10598 // prune post-render after `current` has been updated 10599 { flush: "post", deep: true } 10600 ); 10601 let pendingCacheKey = null; 10602 const cacheSubtree = () => { 10603 if (pendingCacheKey != null) { 10604 cache.set(pendingCacheKey, getInnerChild(instance.subTree)); 10605 } 10606 }; 10607 onMounted(cacheSubtree); 10608 onUpdated(cacheSubtree); 10609 onBeforeUnmount(() => { 10610 cache.forEach((cached) => { 10611 const { subTree, suspense } = instance; 10612 const vnode = getInnerChild(subTree); 10613 if (cached.type === vnode.type && cached.key === vnode.key) { 10614 resetShapeFlag(vnode); 10615 const da = vnode.component.da; 10616 da && queuePostRenderEffect(da, suspense); 10617 return; 10618 } 10619 unmount(cached); 10620 }); 10621 }); 10622 return () => { 10623 pendingCacheKey = null; 10624 if (!slots.default) { 10625 return null; 10626 } 10627 const children = slots.default(); 10628 const rawVNode = children[0]; 10629 if (children.length > 1) { 10630 if (true) { 10631 warn$1(`KeepAlive should contain exactly one component child.`); 10632 } 10633 current = null; 10634 return children; 10635 } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { 10636 current = null; 10637 return rawVNode; 10638 } 10639 let vnode = getInnerChild(rawVNode); 10640 const comp = vnode.type; 10641 const name = getComponentName( 10642 isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp 10643 ); 10644 const { include, exclude, max } = props; 10645 if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { 10646 current = vnode; 10647 return rawVNode; 10648 } 10649 const key = vnode.key == null ? comp : vnode.key; 10650 const cachedVNode = cache.get(key); 10651 if (vnode.el) { 10652 vnode = cloneVNode(vnode); 10653 if (rawVNode.shapeFlag & 128) { 10654 rawVNode.ssContent = vnode; 10655 } 10656 } 10657 pendingCacheKey = key; 10658 if (cachedVNode) { 10659 vnode.el = cachedVNode.el; 10660 vnode.component = cachedVNode.component; 10661 if (vnode.transition) { 10662 setTransitionHooks(vnode, vnode.transition); 10663 } 10664 vnode.shapeFlag |= 512; 10665 keys.delete(key); 10666 keys.add(key); 10667 } else { 10668 keys.add(key); 10669 if (max && keys.size > parseInt(max, 10)) { 10670 pruneCacheEntry(keys.values().next().value); 10671 } 10672 } 10673 vnode.shapeFlag |= 256; 10674 current = vnode; 10675 return isSuspense(rawVNode.type) ? rawVNode : vnode; 10676 }; 10677 } 10678}; 10679const KeepAlive = KeepAliveImpl; 10680function matches(pattern, name) { 10681 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(pattern)) { 10682 return pattern.some((p) => matches(p, name)); 10683 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(pattern)) { 10684 return pattern.split(",").includes(name); 10685 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isRegExp)(pattern)) { 10686 return pattern.test(name); 10687 } 10688 return false; 10689} 10690function onActivated(hook, target) { 10691 registerKeepAliveHook(hook, "a", target); 10692} 10693function onDeactivated(hook, target) { 10694 registerKeepAliveHook(hook, "da", target); 10695} 10696function registerKeepAliveHook(hook, type, target = currentInstance) { 10697 const wrappedHook = hook.__wdc || (hook.__wdc = () => { 10698 let current = target; 10699 while (current) { 10700 if (current.isDeactivated) { 10701 return; 10702 } 10703 current = current.parent; 10704 } 10705 return hook(); 10706 }); 10707 injectHook(type, wrappedHook, target); 10708 if (target) { 10709 let current = target.parent; 10710 while (current && current.parent) { 10711 if (isKeepAlive(current.parent.vnode)) { 10712 injectToKeepAliveRoot(wrappedHook, type, target, current); 10713 } 10714 current = current.parent; 10715 } 10716 } 10717} 10718function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { 10719 const injected = injectHook( 10720 type, 10721 hook, 10722 keepAliveRoot, 10723 true 10724 /* prepend */ 10725 ); 10726 onUnmounted(() => { 10727 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(keepAliveRoot[type], injected); 10728 }, target); 10729} 10730function resetShapeFlag(vnode) { 10731 vnode.shapeFlag &= ~256; 10732 vnode.shapeFlag &= ~512; 10733} 10734function getInnerChild(vnode) { 10735 return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; 10736} 10737 10738function injectHook(type, hook, target = currentInstance, prepend = false) { 10739 if (target) { 10740 const hooks = target[type] || (target[type] = []); 10741 const wrappedHook = hook.__weh || (hook.__weh = (...args) => { 10742 if (target.isUnmounted) { 10743 return; 10744 } 10745 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); 10746 setCurrentInstance(target); 10747 const res = callWithAsyncErrorHandling(hook, target, type, args); 10748 unsetCurrentInstance(); 10749 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); 10750 return res; 10751 }); 10752 if (prepend) { 10753 hooks.unshift(wrappedHook); 10754 } else { 10755 hooks.push(wrappedHook); 10756 } 10757 return wrappedHook; 10758 } else if (true) { 10759 const apiName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(ErrorTypeStrings$1[type].replace(/ hook$/, "")); 10760 warn$1( 10761 `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) 10762 ); 10763 } 10764} 10765const createHook = (lifecycle) => (hook, target = currentInstance) => ( 10766 // post-create lifecycle registrations are noops during SSR (except for serverPrefetch) 10767 (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target) 10768); 10769const onBeforeMount = createHook("bm"); 10770const onMounted = createHook("m"); 10771const onBeforeUpdate = createHook("bu"); 10772const onUpdated = createHook("u"); 10773const onBeforeUnmount = createHook("bum"); 10774const onUnmounted = createHook("um"); 10775const onServerPrefetch = createHook("sp"); 10776const onRenderTriggered = createHook( 10777 "rtg" 10778); 10779const onRenderTracked = createHook( 10780 "rtc" 10781); 10782function onErrorCaptured(hook, target = currentInstance) { 10783 injectHook("ec", hook, target); 10784} 10785 10786function renderList(source, renderItem, cache, index) { 10787 let ret; 10788 const cached = cache && cache[index]; 10789 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(source) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(source)) { 10790 ret = new Array(source.length); 10791 for (let i = 0, l = source.length; i < l; i++) { 10792 ret[i] = renderItem(source[i], i, void 0, cached && cached[i]); 10793 } 10794 } else if (typeof source === "number") { 10795 if ( true && !Number.isInteger(source)) { 10796 warn$1(`The v-for range expect an integer value but got ${source}.`); 10797 } 10798 ret = new Array(source); 10799 for (let i = 0; i < source; i++) { 10800 ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); 10801 } 10802 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(source)) { 10803 if (source[Symbol.iterator]) { 10804 ret = Array.from( 10805 source, 10806 (item, i) => renderItem(item, i, void 0, cached && cached[i]) 10807 ); 10808 } else { 10809 const keys = Object.keys(source); 10810 ret = new Array(keys.length); 10811 for (let i = 0, l = keys.length; i < l; i++) { 10812 const key = keys[i]; 10813 ret[i] = renderItem(source[key], key, i, cached && cached[i]); 10814 } 10815 } 10816 } else { 10817 ret = []; 10818 } 10819 if (cache) { 10820 cache[index] = ret; 10821 } 10822 return ret; 10823} 10824 10825function createSlots(slots, dynamicSlots) { 10826 for (let i = 0; i < dynamicSlots.length; i++) { 10827 const slot = dynamicSlots[i]; 10828 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(slot)) { 10829 for (let j = 0; j < slot.length; j++) { 10830 slots[slot[j].name] = slot[j].fn; 10831 } 10832 } else if (slot) { 10833 slots[slot.name] = slot.key ? (...args) => { 10834 const res = slot.fn(...args); 10835 if (res) 10836 res.key = slot.key; 10837 return res; 10838 } : slot.fn; 10839 } 10840 } 10841 return slots; 10842} 10843 10844function renderSlot(slots, name, props = {}, fallback, noSlotted) { 10845 if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { 10846 if (name !== "default") 10847 props.name = name; 10848 return createVNode("slot", props, fallback && fallback()); 10849 } 10850 let slot = slots[name]; 10851 if ( true && slot && slot.length > 1) { 10852 warn$1( 10853 `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` 10854 ); 10855 slot = () => []; 10856 } 10857 if (slot && slot._c) { 10858 slot._d = false; 10859 } 10860 openBlock(); 10861 const validSlotContent = slot && ensureValidVNode(slot(props)); 10862 const rendered = createBlock( 10863 Fragment, 10864 { 10865 key: props.key || // slot content array of a dynamic conditional slot may have a branch 10866 // key attached in the `createSlots` helper, respect that 10867 validSlotContent && validSlotContent.key || `_${name}` 10868 }, 10869 validSlotContent || (fallback ? fallback() : []), 10870 validSlotContent && slots._ === 1 ? 64 : -2 10871 ); 10872 if (!noSlotted && rendered.scopeId) { 10873 rendered.slotScopeIds = [rendered.scopeId + "-s"]; 10874 } 10875 if (slot && slot._c) { 10876 slot._d = true; 10877 } 10878 return rendered; 10879} 10880function ensureValidVNode(vnodes) { 10881 return vnodes.some((child) => { 10882 if (!isVNode(child)) 10883 return true; 10884 if (child.type === Comment) 10885 return false; 10886 if (child.type === Fragment && !ensureValidVNode(child.children)) 10887 return false; 10888 return true; 10889 }) ? vnodes : null; 10890} 10891 10892function toHandlers(obj, preserveCaseIfNecessary) { 10893 const ret = {}; 10894 if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(obj)) { 10895 warn$1(`v-on with no argument expects an object value.`); 10896 return ret; 10897 } 10898 for (const key in obj) { 10899 ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(key)] = obj[key]; 10900 } 10901 return ret; 10902} 10903 10904const getPublicInstance = (i) => { 10905 if (!i) 10906 return null; 10907 if (isStatefulComponent(i)) 10908 return getExposeProxy(i) || i.proxy; 10909 return getPublicInstance(i.parent); 10910}; 10911const publicPropertiesMap = ( 10912 // Move PURE marker to new line to workaround compiler discarding it 10913 // due to type annotation 10914 /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), { 10915 $: (i) => i, 10916 $el: (i) => i.vnode.el, 10917 $data: (i) => i.data, 10918 $props: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.props) : 0, 10919 $attrs: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.attrs) : 0, 10920 $slots: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.slots) : 0, 10921 $refs: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.refs) : 0, 10922 $parent: (i) => getPublicInstance(i.parent), 10923 $root: (i) => getPublicInstance(i.root), 10924 $emit: (i) => i.emit, 10925 $options: (i) => true ? resolveMergedOptions(i) : 0, 10926 $forceUpdate: (i) => i.f || (i.f = () => { 10927 i.effect.dirty = true; 10928 queueJob(i.update); 10929 }), 10930 $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), 10931 $watch: (i) => true ? instanceWatch.bind(i) : 0 10932 }) 10933); 10934const isReservedPrefix = (key) => key === "_" || key === "$"; 10935const hasSetupBinding = (state, key) => state !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && !state.__isScriptSetup && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(state, key); 10936const PublicInstanceProxyHandlers = { 10937 get({ _: instance }, key) { 10938 const { ctx, setupState, data, props, accessCache, type, appContext } = instance; 10939 if ( true && key === "__isVue") { 10940 return true; 10941 } 10942 let normalizedProps; 10943 if (key[0] !== "$") { 10944 const n = accessCache[key]; 10945 if (n !== void 0) { 10946 switch (n) { 10947 case 1 /* SETUP */: 10948 return setupState[key]; 10949 case 2 /* DATA */: 10950 return data[key]; 10951 case 4 /* CONTEXT */: 10952 return ctx[key]; 10953 case 3 /* PROPS */: 10954 return props[key]; 10955 } 10956 } else if (hasSetupBinding(setupState, key)) { 10957 accessCache[key] = 1 /* SETUP */; 10958 return setupState[key]; 10959 } else if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { 10960 accessCache[key] = 2 /* DATA */; 10961 return data[key]; 10962 } else if ( 10963 // only cache other properties when instance has declared (thus stable) 10964 // props 10965 (normalizedProps = instance.propsOptions[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(normalizedProps, key) 10966 ) { 10967 accessCache[key] = 3 /* PROPS */; 10968 return props[key]; 10969 } else if (ctx !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key)) { 10970 accessCache[key] = 4 /* CONTEXT */; 10971 return ctx[key]; 10972 } else if ( false || shouldCacheAccess) { 10973 accessCache[key] = 0 /* OTHER */; 10974 } 10975 } 10976 const publicGetter = publicPropertiesMap[key]; 10977 let cssModule, globalProperties; 10978 if (publicGetter) { 10979 if (key === "$attrs") { 10980 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", key); 10981 true && markAttrsAccessed(); 10982 } else if ( true && key === "$slots") { 10983 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", key); 10984 } 10985 return publicGetter(instance); 10986 } else if ( 10987 // css module (injected by vue-loader) 10988 (cssModule = type.__cssModules) && (cssModule = cssModule[key]) 10989 ) { 10990 return cssModule; 10991 } else if (ctx !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key)) { 10992 accessCache[key] = 4 /* CONTEXT */; 10993 return ctx[key]; 10994 } else if ( 10995 // global properties 10996 globalProperties = appContext.config.globalProperties, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(globalProperties, key) 10997 ) { 10998 { 10999 return globalProperties[key]; 11000 } 11001 } else if ( true && currentRenderingInstance && (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading 11002 // to infinite warning loop 11003 key.indexOf("__v") !== 0)) { 11004 if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && isReservedPrefix(key[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { 11005 warn$1( 11006 `Property ${JSON.stringify( 11007 key 11008 )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` 11009 ); 11010 } else if (instance === currentRenderingInstance) { 11011 warn$1( 11012 `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` 11013 ); 11014 } 11015 } 11016 }, 11017 set({ _: instance }, key, value) { 11018 const { data, setupState, ctx } = instance; 11019 if (hasSetupBinding(setupState, key)) { 11020 setupState[key] = value; 11021 return true; 11022 } else if ( true && setupState.__isScriptSetup && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, key)) { 11023 warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); 11024 return false; 11025 } else if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { 11026 data[key] = value; 11027 return true; 11028 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(instance.props, key)) { 11029 true && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); 11030 return false; 11031 } 11032 if (key[0] === "$" && key.slice(1) in instance) { 11033 true && warn$1( 11034 `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` 11035 ); 11036 return false; 11037 } else { 11038 if ( true && key in instance.appContext.config.globalProperties) { 11039 Object.defineProperty(ctx, key, { 11040 enumerable: true, 11041 configurable: true, 11042 value 11043 }); 11044 } else { 11045 ctx[key] = value; 11046 } 11047 } 11048 return true; 11049 }, 11050 has({ 11051 _: { data, setupState, accessCache, ctx, appContext, propsOptions } 11052 }, key) { 11053 let normalizedProps; 11054 return !!accessCache[key] || data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(normalizedProps, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(publicPropertiesMap, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(appContext.config.globalProperties, key); 11055 }, 11056 defineProperty(target, key, descriptor) { 11057 if (descriptor.get != null) { 11058 target._.accessCache[key] = 0; 11059 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(descriptor, "value")) { 11060 this.set(target, key, descriptor.value, null); 11061 } 11062 return Reflect.defineProperty(target, key, descriptor); 11063 } 11064}; 11065if (true) { 11066 PublicInstanceProxyHandlers.ownKeys = (target) => { 11067 warn$1( 11068 `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` 11069 ); 11070 return Reflect.ownKeys(target); 11071 }; 11072} 11073const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( 11074 {}, 11075 PublicInstanceProxyHandlers, 11076 { 11077 get(target, key) { 11078 if (key === Symbol.unscopables) { 11079 return; 11080 } 11081 return PublicInstanceProxyHandlers.get(target, key, target); 11082 }, 11083 has(_, key) { 11084 const has = key[0] !== "_" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isGloballyAllowed)(key); 11085 if ( true && !has && PublicInstanceProxyHandlers.has(_, key)) { 11086 warn$1( 11087 `Property ${JSON.stringify( 11088 key 11089 )} should not start with _ which is a reserved prefix for Vue internals.` 11090 ); 11091 } 11092 return has; 11093 } 11094 } 11095); 11096function createDevRenderContext(instance) { 11097 const target = {}; 11098 Object.defineProperty(target, `_`, { 11099 configurable: true, 11100 enumerable: false, 11101 get: () => instance 11102 }); 11103 Object.keys(publicPropertiesMap).forEach((key) => { 11104 Object.defineProperty(target, key, { 11105 configurable: true, 11106 enumerable: false, 11107 get: () => publicPropertiesMap[key](instance), 11108 // intercepted by the proxy so no need for implementation, 11109 // but needed to prevent set errors 11110 set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP 11111 }); 11112 }); 11113 return target; 11114} 11115function exposePropsOnRenderContext(instance) { 11116 const { 11117 ctx, 11118 propsOptions: [propsOptions] 11119 } = instance; 11120 if (propsOptions) { 11121 Object.keys(propsOptions).forEach((key) => { 11122 Object.defineProperty(ctx, key, { 11123 enumerable: true, 11124 configurable: true, 11125 get: () => instance.props[key], 11126 set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP 11127 }); 11128 }); 11129 } 11130} 11131function exposeSetupStateOnRenderContext(instance) { 11132 const { ctx, setupState } = instance; 11133 Object.keys((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(setupState)).forEach((key) => { 11134 if (!setupState.__isScriptSetup) { 11135 if (isReservedPrefix(key[0])) { 11136 warn$1( 11137 `setup() return property ${JSON.stringify( 11138 key 11139 )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` 11140 ); 11141 return; 11142 } 11143 Object.defineProperty(ctx, key, { 11144 enumerable: true, 11145 configurable: true, 11146 get: () => setupState[key], 11147 set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP 11148 }); 11149 } 11150 }); 11151} 11152 11153const warnRuntimeUsage = (method) => warn$1( 11154 `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` 11155); 11156function defineProps() { 11157 if (true) { 11158 warnRuntimeUsage(`defineProps`); 11159 } 11160 return null; 11161} 11162function defineEmits() { 11163 if (true) { 11164 warnRuntimeUsage(`defineEmits`); 11165 } 11166 return null; 11167} 11168function defineExpose(exposed) { 11169 if (true) { 11170 warnRuntimeUsage(`defineExpose`); 11171 } 11172} 11173function defineOptions(options) { 11174 if (true) { 11175 warnRuntimeUsage(`defineOptions`); 11176 } 11177} 11178function defineSlots() { 11179 if (true) { 11180 warnRuntimeUsage(`defineSlots`); 11181 } 11182 return null; 11183} 11184function defineModel() { 11185 if (true) { 11186 warnRuntimeUsage("defineModel"); 11187 } 11188} 11189function withDefaults(props, defaults) { 11190 if (true) { 11191 warnRuntimeUsage(`withDefaults`); 11192 } 11193 return null; 11194} 11195function useSlots() { 11196 return getContext().slots; 11197} 11198function useAttrs() { 11199 return getContext().attrs; 11200} 11201function useModel(props, name, options = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { 11202 const i = getCurrentInstance(); 11203 if ( true && !i) { 11204 warn$1(`useModel() called without active instance.`); 11205 return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); 11206 } 11207 if ( true && !i.propsOptions[0][name]) { 11208 warn$1(`useModel() called with prop "${name}" which is not declared.`); 11209 return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); 11210 } 11211 const camelizedName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name); 11212 const hyphenatedName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(name); 11213 const res = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.customRef)((track, trigger) => { 11214 let localValue; 11215 watchSyncEffect(() => { 11216 const propValue = props[name]; 11217 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(localValue, propValue)) { 11218 localValue = propValue; 11219 trigger(); 11220 } 11221 }); 11222 return { 11223 get() { 11224 track(); 11225 return options.get ? options.get(localValue) : localValue; 11226 }, 11227 set(value) { 11228 const rawProps = i.vnode.props; 11229 if (!(rawProps && // check if parent has passed v-model 11230 (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(value, localValue)) { 11231 localValue = value; 11232 trigger(); 11233 } 11234 i.emit(`update:${name}`, options.set ? options.set(value) : value); 11235 } 11236 }; 11237 }); 11238 const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`; 11239 res[Symbol.iterator] = () => { 11240 let i2 = 0; 11241 return { 11242 next() { 11243 if (i2 < 2) { 11244 return { value: i2++ ? props[modifierKey] || {} : res, done: false }; 11245 } else { 11246 return { done: true }; 11247 } 11248 } 11249 }; 11250 }; 11251 return res; 11252} 11253function getContext() { 11254 const i = getCurrentInstance(); 11255 if ( true && !i) { 11256 warn$1(`useContext() called without active instance.`); 11257 } 11258 return i.setupContext || (i.setupContext = createSetupContext(i)); 11259} 11260function normalizePropsOrEmits(props) { 11261 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props) ? props.reduce( 11262 (normalized, p) => (normalized[p] = null, normalized), 11263 {} 11264 ) : props; 11265} 11266function mergeDefaults(raw, defaults) { 11267 const props = normalizePropsOrEmits(raw); 11268 for (const key in defaults) { 11269 if (key.startsWith("__skip")) 11270 continue; 11271 let opt = props[key]; 11272 if (opt) { 11273 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opt) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt)) { 11274 opt = props[key] = { type: opt, default: defaults[key] }; 11275 } else { 11276 opt.default = defaults[key]; 11277 } 11278 } else if (opt === null) { 11279 opt = props[key] = { default: defaults[key] }; 11280 } else if (true) { 11281 warn$1(`props default key "${key}" has no corresponding declaration.`); 11282 } 11283 if (opt && defaults[`__skip_${key}`]) { 11284 opt.skipFactory = true; 11285 } 11286 } 11287 return props; 11288} 11289function mergeModels(a, b) { 11290 if (!a || !b) 11291 return a || b; 11292 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(a) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(b)) 11293 return a.concat(b); 11294 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); 11295} 11296function createPropsRestProxy(props, excludedKeys) { 11297 const ret = {}; 11298 for (const key in props) { 11299 if (!excludedKeys.includes(key)) { 11300 Object.defineProperty(ret, key, { 11301 enumerable: true, 11302 get: () => props[key] 11303 }); 11304 } 11305 } 11306 return ret; 11307} 11308function withAsyncContext(getAwaitable) { 11309 const ctx = getCurrentInstance(); 11310 if ( true && !ctx) { 11311 warn$1( 11312 `withAsyncContext called without active current instance. This is likely a bug.` 11313 ); 11314 } 11315 let awaitable = getAwaitable(); 11316 unsetCurrentInstance(); 11317 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(awaitable)) { 11318 awaitable = awaitable.catch((e) => { 11319 setCurrentInstance(ctx); 11320 throw e; 11321 }); 11322 } 11323 return [awaitable, () => setCurrentInstance(ctx)]; 11324} 11325 11326function createDuplicateChecker() { 11327 const cache = /* @__PURE__ */ Object.create(null); 11328 return (type, key) => { 11329 if (cache[key]) { 11330 warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); 11331 } else { 11332 cache[key] = type; 11333 } 11334 }; 11335} 11336let shouldCacheAccess = true; 11337function applyOptions(instance) { 11338 const options = resolveMergedOptions(instance); 11339 const publicThis = instance.proxy; 11340 const ctx = instance.ctx; 11341 shouldCacheAccess = false; 11342 if (options.beforeCreate) { 11343 callHook(options.beforeCreate, instance, "bc"); 11344 } 11345 const { 11346 // state 11347 data: dataOptions, 11348 computed: computedOptions, 11349 methods, 11350 watch: watchOptions, 11351 provide: provideOptions, 11352 inject: injectOptions, 11353 // lifecycle 11354 created, 11355 beforeMount, 11356 mounted, 11357 beforeUpdate, 11358 updated, 11359 activated, 11360 deactivated, 11361 beforeDestroy, 11362 beforeUnmount, 11363 destroyed, 11364 unmounted, 11365 render, 11366 renderTracked, 11367 renderTriggered, 11368 errorCaptured, 11369 serverPrefetch, 11370 // public API 11371 expose, 11372 inheritAttrs, 11373 // assets 11374 components, 11375 directives, 11376 filters 11377 } = options; 11378 const checkDuplicateProperties = true ? createDuplicateChecker() : 0; 11379 if (true) { 11380 const [propsOptions] = instance.propsOptions; 11381 if (propsOptions) { 11382 for (const key in propsOptions) { 11383 checkDuplicateProperties("Props" /* PROPS */, key); 11384 } 11385 } 11386 } 11387 if (injectOptions) { 11388 resolveInjections(injectOptions, ctx, checkDuplicateProperties); 11389 } 11390 if (methods) { 11391 for (const key in methods) { 11392 const methodHandler = methods[key]; 11393 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(methodHandler)) { 11394 if (true) { 11395 Object.defineProperty(ctx, key, { 11396 value: methodHandler.bind(publicThis), 11397 configurable: true, 11398 enumerable: true, 11399 writable: true 11400 }); 11401 } else {} 11402 if (true) { 11403 checkDuplicateProperties("Methods" /* METHODS */, key); 11404 } 11405 } else if (true) { 11406 warn$1( 11407 `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` 11408 ); 11409 } 11410 } 11411 } 11412 if (dataOptions) { 11413 if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(dataOptions)) { 11414 warn$1( 11415 `The data option must be a function. Plain object usage is no longer supported.` 11416 ); 11417 } 11418 const data = dataOptions.call(publicThis, publicThis); 11419 if ( true && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(data)) { 11420 warn$1( 11421 `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` 11422 ); 11423 } 11424 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(data)) { 11425 true && warn$1(`data() should return an object.`); 11426 } else { 11427 instance.data = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.reactive)(data); 11428 if (true) { 11429 for (const key in data) { 11430 checkDuplicateProperties("Data" /* DATA */, key); 11431 if (!isReservedPrefix(key[0])) { 11432 Object.defineProperty(ctx, key, { 11433 configurable: true, 11434 enumerable: true, 11435 get: () => data[key], 11436 set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP 11437 }); 11438 } 11439 } 11440 } 11441 } 11442 } 11443 shouldCacheAccess = true; 11444 if (computedOptions) { 11445 for (const key in computedOptions) { 11446 const opt = computedOptions[key]; 11447 const get = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) ? opt.bind(publicThis, publicThis) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt.get) ? opt.get.bind(publicThis, publicThis) : _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; 11448 if ( true && get === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { 11449 warn$1(`Computed property "${key}" has no getter.`); 11450 } 11451 const set = !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt.set) ? opt.set.bind(publicThis) : true ? () => { 11452 warn$1( 11453 `Write operation failed: computed property "${key}" is readonly.` 11454 ); 11455 } : 0; 11456 const c = computed({ 11457 get, 11458 set 11459 }); 11460 Object.defineProperty(ctx, key, { 11461 enumerable: true, 11462 configurable: true, 11463 get: () => c.value, 11464 set: (v) => c.value = v 11465 }); 11466 if (true) { 11467 checkDuplicateProperties("Computed" /* COMPUTED */, key); 11468 } 11469 } 11470 } 11471 if (watchOptions) { 11472 for (const key in watchOptions) { 11473 createWatcher(watchOptions[key], ctx, publicThis, key); 11474 } 11475 } 11476 if (provideOptions) { 11477 const provides = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(provideOptions) ? provideOptions.call(publicThis) : provideOptions; 11478 Reflect.ownKeys(provides).forEach((key) => { 11479 provide(key, provides[key]); 11480 }); 11481 } 11482 if (created) { 11483 callHook(created, instance, "c"); 11484 } 11485 function registerLifecycleHook(register, hook) { 11486 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { 11487 hook.forEach((_hook) => register(_hook.bind(publicThis))); 11488 } else if (hook) { 11489 register(hook.bind(publicThis)); 11490 } 11491 } 11492 registerLifecycleHook(onBeforeMount, beforeMount); 11493 registerLifecycleHook(onMounted, mounted); 11494 registerLifecycleHook(onBeforeUpdate, beforeUpdate); 11495 registerLifecycleHook(onUpdated, updated); 11496 registerLifecycleHook(onActivated, activated); 11497 registerLifecycleHook(onDeactivated, deactivated); 11498 registerLifecycleHook(onErrorCaptured, errorCaptured); 11499 registerLifecycleHook(onRenderTracked, renderTracked); 11500 registerLifecycleHook(onRenderTriggered, renderTriggered); 11501 registerLifecycleHook(onBeforeUnmount, beforeUnmount); 11502 registerLifecycleHook(onUnmounted, unmounted); 11503 registerLifecycleHook(onServerPrefetch, serverPrefetch); 11504 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(expose)) { 11505 if (expose.length) { 11506 const exposed = instance.exposed || (instance.exposed = {}); 11507 expose.forEach((key) => { 11508 Object.defineProperty(exposed, key, { 11509 get: () => publicThis[key], 11510 set: (val) => publicThis[key] = val 11511 }); 11512 }); 11513 } else if (!instance.exposed) { 11514 instance.exposed = {}; 11515 } 11516 } 11517 if (render && instance.render === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { 11518 instance.render = render; 11519 } 11520 if (inheritAttrs != null) { 11521 instance.inheritAttrs = inheritAttrs; 11522 } 11523 if (components) 11524 instance.components = components; 11525 if (directives) 11526 instance.directives = directives; 11527} 11528function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { 11529 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(injectOptions)) { 11530 injectOptions = normalizeInject(injectOptions); 11531 } 11532 for (const key in injectOptions) { 11533 const opt = injectOptions[key]; 11534 let injected; 11535 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(opt)) { 11536 if ("default" in opt) { 11537 injected = inject( 11538 opt.from || key, 11539 opt.default, 11540 true 11541 ); 11542 } else { 11543 injected = inject(opt.from || key); 11544 } 11545 } else { 11546 injected = inject(opt); 11547 } 11548 if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(injected)) { 11549 Object.defineProperty(ctx, key, { 11550 enumerable: true, 11551 configurable: true, 11552 get: () => injected.value, 11553 set: (v) => injected.value = v 11554 }); 11555 } else { 11556 ctx[key] = injected; 11557 } 11558 if (true) { 11559 checkDuplicateProperties("Inject" /* INJECT */, key); 11560 } 11561 } 11562} 11563function callHook(hook, instance, type) { 11564 callWithAsyncErrorHandling( 11565 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), 11566 instance, 11567 type 11568 ); 11569} 11570function createWatcher(raw, ctx, publicThis, key) { 11571 const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; 11572 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(raw)) { 11573 const handler = ctx[raw]; 11574 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) { 11575 watch(getter, handler); 11576 } else if (true) { 11577 warn$1(`Invalid watch handler specified by key "${raw}"`, handler); 11578 } 11579 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(raw)) { 11580 watch(getter, raw.bind(publicThis)); 11581 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(raw)) { 11582 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { 11583 raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); 11584 } else { 11585 const handler = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; 11586 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) { 11587 watch(getter, handler, raw); 11588 } else if (true) { 11589 warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); 11590 } 11591 } 11592 } else if (true) { 11593 warn$1(`Invalid watch option: "${key}"`, raw); 11594 } 11595} 11596function resolveMergedOptions(instance) { 11597 const base = instance.type; 11598 const { mixins, extends: extendsOptions } = base; 11599 const { 11600 mixins: globalMixins, 11601 optionsCache: cache, 11602 config: { optionMergeStrategies } 11603 } = instance.appContext; 11604 const cached = cache.get(base); 11605 let resolved; 11606 if (cached) { 11607 resolved = cached; 11608 } else if (!globalMixins.length && !mixins && !extendsOptions) { 11609 { 11610 resolved = base; 11611 } 11612 } else { 11613 resolved = {}; 11614 if (globalMixins.length) { 11615 globalMixins.forEach( 11616 (m) => mergeOptions(resolved, m, optionMergeStrategies, true) 11617 ); 11618 } 11619 mergeOptions(resolved, base, optionMergeStrategies); 11620 } 11621 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(base)) { 11622 cache.set(base, resolved); 11623 } 11624 return resolved; 11625} 11626function mergeOptions(to, from, strats, asMixin = false) { 11627 const { mixins, extends: extendsOptions } = from; 11628 if (extendsOptions) { 11629 mergeOptions(to, extendsOptions, strats, true); 11630 } 11631 if (mixins) { 11632 mixins.forEach( 11633 (m) => mergeOptions(to, m, strats, true) 11634 ); 11635 } 11636 for (const key in from) { 11637 if (asMixin && key === "expose") { 11638 true && warn$1( 11639 `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` 11640 ); 11641 } else { 11642 const strat = internalOptionMergeStrats[key] || strats && strats[key]; 11643 to[key] = strat ? strat(to[key], from[key]) : from[key]; 11644 } 11645 } 11646 return to; 11647} 11648const internalOptionMergeStrats = { 11649 data: mergeDataFn, 11650 props: mergeEmitsOrPropsOptions, 11651 emits: mergeEmitsOrPropsOptions, 11652 // objects 11653 methods: mergeObjectOptions, 11654 computed: mergeObjectOptions, 11655 // lifecycle 11656 beforeCreate: mergeAsArray, 11657 created: mergeAsArray, 11658 beforeMount: mergeAsArray, 11659 mounted: mergeAsArray, 11660 beforeUpdate: mergeAsArray, 11661 updated: mergeAsArray, 11662 beforeDestroy: mergeAsArray, 11663 beforeUnmount: mergeAsArray, 11664 destroyed: mergeAsArray, 11665 unmounted: mergeAsArray, 11666 activated: mergeAsArray, 11667 deactivated: mergeAsArray, 11668 errorCaptured: mergeAsArray, 11669 serverPrefetch: mergeAsArray, 11670 // assets 11671 components: mergeObjectOptions, 11672 directives: mergeObjectOptions, 11673 // watch 11674 watch: mergeWatchOptions, 11675 // provide / inject 11676 provide: mergeDataFn, 11677 inject: mergeInject 11678}; 11679function mergeDataFn(to, from) { 11680 if (!from) { 11681 return to; 11682 } 11683 if (!to) { 11684 return from; 11685 } 11686 return function mergedDataFn() { 11687 return ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend))( 11688 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(to) ? to.call(this, this) : to, 11689 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(from) ? from.call(this, this) : from 11690 ); 11691 }; 11692} 11693function mergeInject(to, from) { 11694 return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); 11695} 11696function normalizeInject(raw) { 11697 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { 11698 const res = {}; 11699 for (let i = 0; i < raw.length; i++) { 11700 res[raw[i]] = raw[i]; 11701 } 11702 return res; 11703 } 11704 return raw; 11705} 11706function mergeAsArray(to, from) { 11707 return to ? [...new Set([].concat(to, from))] : from; 11708} 11709function mergeObjectOptions(to, from) { 11710 return to ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), to, from) : from; 11711} 11712function mergeEmitsOrPropsOptions(to, from) { 11713 if (to) { 11714 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(to) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(from)) { 11715 return [.../* @__PURE__ */ new Set([...to, ...from])]; 11716 } 11717 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( 11718 /* @__PURE__ */ Object.create(null), 11719 normalizePropsOrEmits(to), 11720 normalizePropsOrEmits(from != null ? from : {}) 11721 ); 11722 } else { 11723 return from; 11724 } 11725} 11726function mergeWatchOptions(to, from) { 11727 if (!to) 11728 return from; 11729 if (!from) 11730 return to; 11731 const merged = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), to); 11732 for (const key in from) { 11733 merged[key] = mergeAsArray(to[key], from[key]); 11734 } 11735 return merged; 11736} 11737 11738function createAppContext() { 11739 return { 11740 app: null, 11741 config: { 11742 isNativeTag: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NO, 11743 performance: false, 11744 globalProperties: {}, 11745 optionMergeStrategies: {}, 11746 errorHandler: void 0, 11747 warnHandler: void 0, 11748 compilerOptions: {} 11749 }, 11750 mixins: [], 11751 components: {}, 11752 directives: {}, 11753 provides: /* @__PURE__ */ Object.create(null), 11754 optionsCache: /* @__PURE__ */ new WeakMap(), 11755 propsCache: /* @__PURE__ */ new WeakMap(), 11756 emitsCache: /* @__PURE__ */ new WeakMap() 11757 }; 11758} 11759let uid$1 = 0; 11760function createAppAPI(render, hydrate) { 11761 return function createApp(rootComponent, rootProps = null) { 11762 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(rootComponent)) { 11763 rootComponent = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, rootComponent); 11764 } 11765 if (rootProps != null && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(rootProps)) { 11766 true && warn$1(`root props passed to app.mount() must be an object.`); 11767 rootProps = null; 11768 } 11769 const context = createAppContext(); 11770 const installedPlugins = /* @__PURE__ */ new WeakSet(); 11771 let isMounted = false; 11772 const app = context.app = { 11773 _uid: uid$1++, 11774 _component: rootComponent, 11775 _props: rootProps, 11776 _container: null, 11777 _context: context, 11778 _instance: null, 11779 version, 11780 get config() { 11781 return context.config; 11782 }, 11783 set config(v) { 11784 if (true) { 11785 warn$1( 11786 `app.config cannot be replaced. Modify individual options instead.` 11787 ); 11788 } 11789 }, 11790 use(plugin, ...options) { 11791 if (installedPlugins.has(plugin)) { 11792 true && warn$1(`Plugin has already been applied to target app.`); 11793 } else if (plugin && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(plugin.install)) { 11794 installedPlugins.add(plugin); 11795 plugin.install(app, ...options); 11796 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(plugin)) { 11797 installedPlugins.add(plugin); 11798 plugin(app, ...options); 11799 } else if (true) { 11800 warn$1( 11801 `A plugin must either be a function or an object with an "install" function.` 11802 ); 11803 } 11804 return app; 11805 }, 11806 mixin(mixin) { 11807 if (true) { 11808 if (!context.mixins.includes(mixin)) { 11809 context.mixins.push(mixin); 11810 } else if (true) { 11811 warn$1( 11812 "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") 11813 ); 11814 } 11815 } else {} 11816 return app; 11817 }, 11818 component(name, component) { 11819 if (true) { 11820 validateComponentName(name, context.config); 11821 } 11822 if (!component) { 11823 return context.components[name]; 11824 } 11825 if ( true && context.components[name]) { 11826 warn$1(`Component "${name}" has already been registered in target app.`); 11827 } 11828 context.components[name] = component; 11829 return app; 11830 }, 11831 directive(name, directive) { 11832 if (true) { 11833 validateDirectiveName(name); 11834 } 11835 if (!directive) { 11836 return context.directives[name]; 11837 } 11838 if ( true && context.directives[name]) { 11839 warn$1(`Directive "${name}" has already been registered in target app.`); 11840 } 11841 context.directives[name] = directive; 11842 return app; 11843 }, 11844 mount(rootContainer, isHydrate, namespace) { 11845 if (!isMounted) { 11846 if ( true && rootContainer.__vue_app__) { 11847 warn$1( 11848 `There is already an app instance mounted on the host container. 11849 If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` 11850 ); 11851 } 11852 const vnode = createVNode(rootComponent, rootProps); 11853 vnode.appContext = context; 11854 if (namespace === true) { 11855 namespace = "svg"; 11856 } else if (namespace === false) { 11857 namespace = void 0; 11858 } 11859 if (true) { 11860 context.reload = () => { 11861 render( 11862 cloneVNode(vnode), 11863 rootContainer, 11864 namespace 11865 ); 11866 }; 11867 } 11868 if (isHydrate && hydrate) { 11869 hydrate(vnode, rootContainer); 11870 } else { 11871 render(vnode, rootContainer, namespace); 11872 } 11873 isMounted = true; 11874 app._container = rootContainer; 11875 rootContainer.__vue_app__ = app; 11876 if (true) { 11877 app._instance = vnode.component; 11878 devtoolsInitApp(app, version); 11879 } 11880 return getExposeProxy(vnode.component) || vnode.component.proxy; 11881 } else if (true) { 11882 warn$1( 11883 `App has already been mounted. 11884If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` 11885 ); 11886 } 11887 }, 11888 unmount() { 11889 if (isMounted) { 11890 render(null, app._container); 11891 if (true) { 11892 app._instance = null; 11893 devtoolsUnmountApp(app); 11894 } 11895 delete app._container.__vue_app__; 11896 } else if (true) { 11897 warn$1(`Cannot unmount an app that is not mounted.`); 11898 } 11899 }, 11900 provide(key, value) { 11901 if ( true && key in context.provides) { 11902 warn$1( 11903 `App already provides property with key "${String(key)}". It will be overwritten with the new value.` 11904 ); 11905 } 11906 context.provides[key] = value; 11907 return app; 11908 }, 11909 runWithContext(fn) { 11910 currentApp = app; 11911 try { 11912 return fn(); 11913 } finally { 11914 currentApp = null; 11915 } 11916 } 11917 }; 11918 return app; 11919 }; 11920} 11921let currentApp = null; 11922 11923function provide(key, value) { 11924 if (!currentInstance) { 11925 if (true) { 11926 warn$1(`provide() can only be used inside setup().`); 11927 } 11928 } else { 11929 let provides = currentInstance.provides; 11930 const parentProvides = currentInstance.parent && currentInstance.parent.provides; 11931 if (parentProvides === provides) { 11932 provides = currentInstance.provides = Object.create(parentProvides); 11933 } 11934 provides[key] = value; 11935 } 11936} 11937function inject(key, defaultValue, treatDefaultAsFactory = false) { 11938 const instance = currentInstance || currentRenderingInstance; 11939 if (instance || currentApp) { 11940 const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides; 11941 if (provides && key in provides) { 11942 return provides[key]; 11943 } else if (arguments.length > 1) { 11944 return treatDefaultAsFactory && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; 11945 } else if (true) { 11946 warn$1(`injection "${String(key)}" not found.`); 11947 } 11948 } else if (true) { 11949 warn$1(`inject() can only be used inside setup() or functional components.`); 11950 } 11951} 11952function hasInjectionContext() { 11953 return !!(currentInstance || currentRenderingInstance || currentApp); 11954} 11955 11956function initProps(instance, rawProps, isStateful, isSSR = false) { 11957 const props = {}; 11958 const attrs = {}; 11959 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(attrs, InternalObjectKey, 1); 11960 instance.propsDefaults = /* @__PURE__ */ Object.create(null); 11961 setFullProps(instance, rawProps, props, attrs); 11962 for (const key in instance.propsOptions[0]) { 11963 if (!(key in props)) { 11964 props[key] = void 0; 11965 } 11966 } 11967 if (true) { 11968 validateProps(rawProps || {}, props, instance); 11969 } 11970 if (isStateful) { 11971 instance.props = isSSR ? props : (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReactive)(props); 11972 } else { 11973 if (!instance.type.props) { 11974 instance.props = attrs; 11975 } else { 11976 instance.props = props; 11977 } 11978 } 11979 instance.attrs = attrs; 11980} 11981function isInHmrContext(instance) { 11982 while (instance) { 11983 if (instance.type.__hmrId) 11984 return true; 11985 instance = instance.parent; 11986 } 11987} 11988function updateProps(instance, rawProps, rawPrevProps, optimized) { 11989 const { 11990 props, 11991 attrs, 11992 vnode: { patchFlag } 11993 } = instance; 11994 const rawCurrentProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); 11995 const [options] = instance.propsOptions; 11996 let hasAttrsChanged = false; 11997 if ( 11998 // always force full diff in dev 11999 // - #1942 if hmr is enabled with sfc component 12000 // - vite#872 non-sfc component used by sfc component 12001 !( true && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16) 12002 ) { 12003 if (patchFlag & 8) { 12004 const propsToUpdate = instance.vnode.dynamicProps; 12005 for (let i = 0; i < propsToUpdate.length; i++) { 12006 let key = propsToUpdate[i]; 12007 if (isEmitListener(instance.emitsOptions, key)) { 12008 continue; 12009 } 12010 const value = rawProps[key]; 12011 if (options) { 12012 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(attrs, key)) { 12013 if (value !== attrs[key]) { 12014 attrs[key] = value; 12015 hasAttrsChanged = true; 12016 } 12017 } else { 12018 const camelizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); 12019 props[camelizedKey] = resolvePropValue( 12020 options, 12021 rawCurrentProps, 12022 camelizedKey, 12023 value, 12024 instance, 12025 false 12026 ); 12027 } 12028 } else { 12029 if (value !== attrs[key]) { 12030 attrs[key] = value; 12031 hasAttrsChanged = true; 12032 } 12033 } 12034 } 12035 } 12036 } else { 12037 if (setFullProps(instance, rawProps, props, attrs)) { 12038 hasAttrsChanged = true; 12039 } 12040 let kebabKey; 12041 for (const key in rawCurrentProps) { 12042 if (!rawProps || // for camelCase 12043 !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && // it's possible the original props was passed in as kebab-case 12044 // and converted to camelCase (#955) 12045 ((kebabKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) === key || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, kebabKey))) { 12046 if (options) { 12047 if (rawPrevProps && // for camelCase 12048 (rawPrevProps[key] !== void 0 || // for kebab-case 12049 rawPrevProps[kebabKey] !== void 0)) { 12050 props[key] = resolvePropValue( 12051 options, 12052 rawCurrentProps, 12053 key, 12054 void 0, 12055 instance, 12056 true 12057 ); 12058 } 12059 } else { 12060 delete props[key]; 12061 } 12062 } 12063 } 12064 if (attrs !== rawCurrentProps) { 12065 for (const key in attrs) { 12066 if (!rawProps || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && true) { 12067 delete attrs[key]; 12068 hasAttrsChanged = true; 12069 } 12070 } 12071 } 12072 } 12073 if (hasAttrsChanged) { 12074 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.trigger)(instance, "set", "$attrs"); 12075 } 12076 if (true) { 12077 validateProps(rawProps || {}, props, instance); 12078 } 12079} 12080function setFullProps(instance, rawProps, props, attrs) { 12081 const [options, needCastKeys] = instance.propsOptions; 12082 let hasAttrsChanged = false; 12083 let rawCastValues; 12084 if (rawProps) { 12085 for (let key in rawProps) { 12086 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) { 12087 continue; 12088 } 12089 const value = rawProps[key]; 12090 let camelKey; 12091 if (options && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, camelKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key))) { 12092 if (!needCastKeys || !needCastKeys.includes(camelKey)) { 12093 props[camelKey] = value; 12094 } else { 12095 (rawCastValues || (rawCastValues = {}))[camelKey] = value; 12096 } 12097 } else if (!isEmitListener(instance.emitsOptions, key)) { 12098 if (!(key in attrs) || value !== attrs[key]) { 12099 attrs[key] = value; 12100 hasAttrsChanged = true; 12101 } 12102 } 12103 } 12104 } 12105 if (needCastKeys) { 12106 const rawCurrentProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); 12107 const castValues = rawCastValues || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 12108 for (let i = 0; i < needCastKeys.length; i++) { 12109 const key = needCastKeys[i]; 12110 props[key] = resolvePropValue( 12111 options, 12112 rawCurrentProps, 12113 key, 12114 castValues[key], 12115 instance, 12116 !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(castValues, key) 12117 ); 12118 } 12119 } 12120 return hasAttrsChanged; 12121} 12122function resolvePropValue(options, props, key, value, instance, isAbsent) { 12123 const opt = options[key]; 12124 if (opt != null) { 12125 const hasDefault = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(opt, "default"); 12126 if (hasDefault && value === void 0) { 12127 const defaultValue = opt.default; 12128 if (opt.type !== Function && !opt.skipFactory && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(defaultValue)) { 12129 const { propsDefaults } = instance; 12130 if (key in propsDefaults) { 12131 value = propsDefaults[key]; 12132 } else { 12133 setCurrentInstance(instance); 12134 value = propsDefaults[key] = defaultValue.call( 12135 null, 12136 props 12137 ); 12138 unsetCurrentInstance(); 12139 } 12140 } else { 12141 value = defaultValue; 12142 } 12143 } 12144 if (opt[0 /* shouldCast */]) { 12145 if (isAbsent && !hasDefault) { 12146 value = false; 12147 } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key))) { 12148 value = true; 12149 } 12150 } 12151 } 12152 return value; 12153} 12154function normalizePropsOptions(comp, appContext, asMixin = false) { 12155 const cache = appContext.propsCache; 12156 const cached = cache.get(comp); 12157 if (cached) { 12158 return cached; 12159 } 12160 const raw = comp.props; 12161 const normalized = {}; 12162 const needCastKeys = []; 12163 let hasExtends = false; 12164 if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { 12165 const extendProps = (raw2) => { 12166 hasExtends = true; 12167 const [props, keys] = normalizePropsOptions(raw2, appContext, true); 12168 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, props); 12169 if (keys) 12170 needCastKeys.push(...keys); 12171 }; 12172 if (!asMixin && appContext.mixins.length) { 12173 appContext.mixins.forEach(extendProps); 12174 } 12175 if (comp.extends) { 12176 extendProps(comp.extends); 12177 } 12178 if (comp.mixins) { 12179 comp.mixins.forEach(extendProps); 12180 } 12181 } 12182 if (!raw && !hasExtends) { 12183 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { 12184 cache.set(comp, _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR); 12185 } 12186 return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; 12187 } 12188 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { 12189 for (let i = 0; i < raw.length; i++) { 12190 if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(raw[i])) { 12191 warn$1(`props must be strings when using array syntax.`, raw[i]); 12192 } 12193 const normalizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(raw[i]); 12194 if (validatePropName(normalizedKey)) { 12195 normalized[normalizedKey] = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 12196 } 12197 } 12198 } else if (raw) { 12199 if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(raw)) { 12200 warn$1(`invalid props options`, raw); 12201 } 12202 for (const key in raw) { 12203 const normalizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); 12204 if (validatePropName(normalizedKey)) { 12205 const opt = raw[key]; 12206 const prop = normalized[normalizedKey] = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opt) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) ? { type: opt } : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, opt); 12207 if (prop) { 12208 const booleanIndex = getTypeIndex(Boolean, prop.type); 12209 const stringIndex = getTypeIndex(String, prop.type); 12210 prop[0 /* shouldCast */] = booleanIndex > -1; 12211 prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex; 12212 if (booleanIndex > -1 || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(prop, "default")) { 12213 needCastKeys.push(normalizedKey); 12214 } 12215 } 12216 } 12217 } 12218 } 12219 const res = [normalized, needCastKeys]; 12220 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { 12221 cache.set(comp, res); 12222 } 12223 return res; 12224} 12225function validatePropName(key) { 12226 if (key[0] !== "$") { 12227 return true; 12228 } else if (true) { 12229 warn$1(`Invalid prop name: "${key}" is a reserved property.`); 12230 } 12231 return false; 12232} 12233function getType(ctor) { 12234 const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/); 12235 return match ? match[2] : ctor === null ? "null" : ""; 12236} 12237function isSameType(a, b) { 12238 return getType(a) === getType(b); 12239} 12240function getTypeIndex(type, expectedTypes) { 12241 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(expectedTypes)) { 12242 return expectedTypes.findIndex((t) => isSameType(t, type)); 12243 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(expectedTypes)) { 12244 return isSameType(expectedTypes, type) ? 0 : -1; 12245 } 12246 return -1; 12247} 12248function validateProps(rawProps, props, instance) { 12249 const resolvedValues = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); 12250 const options = instance.propsOptions[0]; 12251 for (const key in options) { 12252 let opt = options[key]; 12253 if (opt == null) 12254 continue; 12255 validateProp( 12256 key, 12257 resolvedValues[key], 12258 opt, 12259 true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(resolvedValues) : 0, 12260 !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) 12261 ); 12262 } 12263} 12264function validateProp(name, value, prop, props, isAbsent) { 12265 const { type, required, validator, skipCheck } = prop; 12266 if (required && isAbsent) { 12267 warn$1('Missing required prop: "' + name + '"'); 12268 return; 12269 } 12270 if (value == null && !required) { 12271 return; 12272 } 12273 if (type != null && type !== true && !skipCheck) { 12274 let isValid = false; 12275 const types = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(type) ? type : [type]; 12276 const expectedTypes = []; 12277 for (let i = 0; i < types.length && !isValid; i++) { 12278 const { valid, expectedType } = assertType(value, types[i]); 12279 expectedTypes.push(expectedType || ""); 12280 isValid = valid; 12281 } 12282 if (!isValid) { 12283 warn$1(getInvalidTypeMessage(name, value, expectedTypes)); 12284 return; 12285 } 12286 } 12287 if (validator && !validator(value, props)) { 12288 warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); 12289 } 12290} 12291const isSimpleType = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( 12292 "String,Number,Boolean,Function,Symbol,BigInt" 12293); 12294function assertType(value, type) { 12295 let valid; 12296 const expectedType = getType(type); 12297 if (isSimpleType(expectedType)) { 12298 const t = typeof value; 12299 valid = t === expectedType.toLowerCase(); 12300 if (!valid && t === "object") { 12301 valid = value instanceof type; 12302 } 12303 } else if (expectedType === "Object") { 12304 valid = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(value); 12305 } else if (expectedType === "Array") { 12306 valid = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value); 12307 } else if (expectedType === "null") { 12308 valid = value === null; 12309 } else { 12310 valid = value instanceof type; 12311 } 12312 return { 12313 valid, 12314 expectedType 12315 }; 12316} 12317function getInvalidTypeMessage(name, value, expectedTypes) { 12318 if (expectedTypes.length === 0) { 12319 return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; 12320 } 12321 let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize).join(" | ")}`; 12322 const expectedType = expectedTypes[0]; 12323 const receivedType = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toRawType)(value); 12324 const expectedValue = styleValue(value, expectedType); 12325 const receivedValue = styleValue(value, receivedType); 12326 if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { 12327 message += ` with value ${expectedValue}`; 12328 } 12329 message += `, got ${receivedType} `; 12330 if (isExplicable(receivedType)) { 12331 message += `with value ${receivedValue}.`; 12332 } 12333 return message; 12334} 12335function styleValue(value, type) { 12336 if (type === "String") { 12337 return `"${value}"`; 12338 } else if (type === "Number") { 12339 return `${Number(value)}`; 12340 } else { 12341 return `${value}`; 12342 } 12343} 12344function isExplicable(type) { 12345 const explicitTypes = ["string", "number", "boolean"]; 12346 return explicitTypes.some((elem) => type.toLowerCase() === elem); 12347} 12348function isBoolean(...args) { 12349 return args.some((elem) => elem.toLowerCase() === "boolean"); 12350} 12351 12352const isInternalKey = (key) => key[0] === "_" || key === "$stable"; 12353const normalizeSlotValue = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; 12354const normalizeSlot = (key, rawSlot, ctx) => { 12355 if (rawSlot._n) { 12356 return rawSlot; 12357 } 12358 const normalized = withCtx((...args) => { 12359 if ( true && currentInstance) { 12360 warn$1( 12361 `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` 12362 ); 12363 } 12364 return normalizeSlotValue(rawSlot(...args)); 12365 }, ctx); 12366 normalized._c = false; 12367 return normalized; 12368}; 12369const normalizeObjectSlots = (rawSlots, slots, instance) => { 12370 const ctx = rawSlots._ctx; 12371 for (const key in rawSlots) { 12372 if (isInternalKey(key)) 12373 continue; 12374 const value = rawSlots[key]; 12375 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { 12376 slots[key] = normalizeSlot(key, value, ctx); 12377 } else if (value != null) { 12378 if (true) { 12379 warn$1( 12380 `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` 12381 ); 12382 } 12383 const normalized = normalizeSlotValue(value); 12384 slots[key] = () => normalized; 12385 } 12386 } 12387}; 12388const normalizeVNodeSlots = (instance, children) => { 12389 if ( true && !isKeepAlive(instance.vnode) && true) { 12390 warn$1( 12391 `Non-function value encountered for default slot. Prefer function slots for better performance.` 12392 ); 12393 } 12394 const normalized = normalizeSlotValue(children); 12395 instance.slots.default = () => normalized; 12396}; 12397const initSlots = (instance, children) => { 12398 if (instance.vnode.shapeFlag & 32) { 12399 const type = children._; 12400 if (type) { 12401 instance.slots = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(children); 12402 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(children, "_", type); 12403 } else { 12404 normalizeObjectSlots( 12405 children, 12406 instance.slots = {}); 12407 } 12408 } else { 12409 instance.slots = {}; 12410 if (children) { 12411 normalizeVNodeSlots(instance, children); 12412 } 12413 } 12414 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(instance.slots, InternalObjectKey, 1); 12415}; 12416const updateSlots = (instance, children, optimized) => { 12417 const { vnode, slots } = instance; 12418 let needDeletionCheck = true; 12419 let deletionComparisonTarget = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 12420 if (vnode.shapeFlag & 32) { 12421 const type = children._; 12422 if (type) { 12423 if ( true && isHmrUpdating) { 12424 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(slots, children); 12425 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.trigger)(instance, "set", "$slots"); 12426 } else if (optimized && type === 1) { 12427 needDeletionCheck = false; 12428 } else { 12429 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(slots, children); 12430 if (!optimized && type === 1) { 12431 delete slots._; 12432 } 12433 } 12434 } else { 12435 needDeletionCheck = !children.$stable; 12436 normalizeObjectSlots(children, slots); 12437 } 12438 deletionComparisonTarget = children; 12439 } else if (children) { 12440 normalizeVNodeSlots(instance, children); 12441 deletionComparisonTarget = { default: 1 }; 12442 } 12443 if (needDeletionCheck) { 12444 for (const key in slots) { 12445 if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { 12446 delete slots[key]; 12447 } 12448 } 12449 } 12450}; 12451 12452function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { 12453 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(rawRef)) { 12454 rawRef.forEach( 12455 (r, i) => setRef( 12456 r, 12457 oldRawRef && ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(oldRawRef) ? oldRawRef[i] : oldRawRef), 12458 parentSuspense, 12459 vnode, 12460 isUnmount 12461 ) 12462 ); 12463 return; 12464 } 12465 if (isAsyncWrapper(vnode) && !isUnmount) { 12466 return; 12467 } 12468 const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el; 12469 const value = isUnmount ? null : refValue; 12470 const { i: owner, r: ref } = rawRef; 12471 if ( true && !owner) { 12472 warn$1( 12473 `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` 12474 ); 12475 return; 12476 } 12477 const oldRef = oldRawRef && oldRawRef.r; 12478 const refs = owner.refs === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ ? owner.refs = {} : owner.refs; 12479 const setupState = owner.setupState; 12480 if (oldRef != null && oldRef !== ref) { 12481 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(oldRef)) { 12482 refs[oldRef] = null; 12483 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, oldRef)) { 12484 setupState[oldRef] = null; 12485 } 12486 } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(oldRef)) { 12487 oldRef.value = null; 12488 } 12489 } 12490 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(ref)) { 12491 callWithErrorHandling(ref, owner, 12, [value, refs]); 12492 } else { 12493 const _isString = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(ref); 12494 const _isRef = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(ref); 12495 if (_isString || _isRef) { 12496 const doSet = () => { 12497 if (rawRef.f) { 12498 const existing = _isString ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref) ? setupState[ref] : refs[ref] : ref.value; 12499 if (isUnmount) { 12500 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(existing, refValue); 12501 } else { 12502 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing)) { 12503 if (_isString) { 12504 refs[ref] = [refValue]; 12505 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref)) { 12506 setupState[ref] = refs[ref]; 12507 } 12508 } else { 12509 ref.value = [refValue]; 12510 if (rawRef.k) 12511 refs[rawRef.k] = ref.value; 12512 } 12513 } else if (!existing.includes(refValue)) { 12514 existing.push(refValue); 12515 } 12516 } 12517 } else if (_isString) { 12518 refs[ref] = value; 12519 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref)) { 12520 setupState[ref] = value; 12521 } 12522 } else if (_isRef) { 12523 ref.value = value; 12524 if (rawRef.k) 12525 refs[rawRef.k] = value; 12526 } else if (true) { 12527 warn$1("Invalid template ref type:", ref, `(${typeof ref})`); 12528 } 12529 }; 12530 if (value) { 12531 doSet.id = -1; 12532 queuePostRenderEffect(doSet, parentSuspense); 12533 } else { 12534 doSet(); 12535 } 12536 } else if (true) { 12537 warn$1("Invalid template ref type:", ref, `(${typeof ref})`); 12538 } 12539 } 12540} 12541 12542let hasMismatch = false; 12543const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; 12544const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); 12545const getContainerType = (container) => { 12546 if (isSVGContainer(container)) 12547 return "svg"; 12548 if (isMathMLContainer(container)) 12549 return "mathml"; 12550 return void 0; 12551}; 12552const isComment = (node) => node.nodeType === 8 /* COMMENT */; 12553function createHydrationFunctions(rendererInternals) { 12554 const { 12555 mt: mountComponent, 12556 p: patch, 12557 o: { 12558 patchProp, 12559 createText, 12560 nextSibling, 12561 parentNode, 12562 remove, 12563 insert, 12564 createComment 12565 } 12566 } = rendererInternals; 12567 const hydrate = (vnode, container) => { 12568 if (!container.hasChildNodes()) { 12569 ( true) && warn$1( 12570 `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` 12571 ); 12572 patch(null, vnode, container); 12573 flushPostFlushCbs(); 12574 container._vnode = vnode; 12575 return; 12576 } 12577 hasMismatch = false; 12578 hydrateNode(container.firstChild, vnode, null, null, null); 12579 flushPostFlushCbs(); 12580 container._vnode = vnode; 12581 if (hasMismatch && true) { 12582 console.error(`Hydration completed but contains mismatches.`); 12583 } 12584 }; 12585 const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { 12586 const isFragmentStart = isComment(node) && node.data === "["; 12587 const onMismatch = () => handleMismatch( 12588 node, 12589 vnode, 12590 parentComponent, 12591 parentSuspense, 12592 slotScopeIds, 12593 isFragmentStart 12594 ); 12595 const { type, ref, shapeFlag, patchFlag } = vnode; 12596 let domType = node.nodeType; 12597 vnode.el = node; 12598 if (true) { 12599 if (!("__vnode" in node)) { 12600 Object.defineProperty(node, "__vnode", { 12601 value: vnode, 12602 enumerable: false 12603 }); 12604 } 12605 if (!("__vueParentComponent" in node)) { 12606 Object.defineProperty(node, "__vueParentComponent", { 12607 value: parentComponent, 12608 enumerable: false 12609 }); 12610 } 12611 } 12612 if (patchFlag === -2) { 12613 optimized = false; 12614 vnode.dynamicChildren = null; 12615 } 12616 let nextNode = null; 12617 switch (type) { 12618 case Text: 12619 if (domType !== 3 /* TEXT */) { 12620 if (vnode.children === "") { 12621 insert(vnode.el = createText(""), parentNode(node), node); 12622 nextNode = node; 12623 } else { 12624 nextNode = onMismatch(); 12625 } 12626 } else { 12627 if (node.data !== vnode.children) { 12628 hasMismatch = true; 12629 ( true) && warn$1( 12630 `Hydration text mismatch in`, 12631 node.parentNode, 12632 ` 12633 - rendered on server: ${JSON.stringify( 12634 node.data 12635 )} 12636 - expected on client: ${JSON.stringify(vnode.children)}` 12637 ); 12638 node.data = vnode.children; 12639 } 12640 nextNode = nextSibling(node); 12641 } 12642 break; 12643 case Comment: 12644 if (isTemplateNode(node)) { 12645 nextNode = nextSibling(node); 12646 replaceNode( 12647 vnode.el = node.content.firstChild, 12648 node, 12649 parentComponent 12650 ); 12651 } else if (domType !== 8 /* COMMENT */ || isFragmentStart) { 12652 nextNode = onMismatch(); 12653 } else { 12654 nextNode = nextSibling(node); 12655 } 12656 break; 12657 case Static: 12658 if (isFragmentStart) { 12659 node = nextSibling(node); 12660 domType = node.nodeType; 12661 } 12662 if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) { 12663 nextNode = node; 12664 const needToAdoptContent = !vnode.children.length; 12665 for (let i = 0; i < vnode.staticCount; i++) { 12666 if (needToAdoptContent) 12667 vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data; 12668 if (i === vnode.staticCount - 1) { 12669 vnode.anchor = nextNode; 12670 } 12671 nextNode = nextSibling(nextNode); 12672 } 12673 return isFragmentStart ? nextSibling(nextNode) : nextNode; 12674 } else { 12675 onMismatch(); 12676 } 12677 break; 12678 case Fragment: 12679 if (!isFragmentStart) { 12680 nextNode = onMismatch(); 12681 } else { 12682 nextNode = hydrateFragment( 12683 node, 12684 vnode, 12685 parentComponent, 12686 parentSuspense, 12687 slotScopeIds, 12688 optimized 12689 ); 12690 } 12691 break; 12692 default: 12693 if (shapeFlag & 1) { 12694 if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { 12695 nextNode = onMismatch(); 12696 } else { 12697 nextNode = hydrateElement( 12698 node, 12699 vnode, 12700 parentComponent, 12701 parentSuspense, 12702 slotScopeIds, 12703 optimized 12704 ); 12705 } 12706 } else if (shapeFlag & 6) { 12707 vnode.slotScopeIds = slotScopeIds; 12708 const container = parentNode(node); 12709 if (isFragmentStart) { 12710 nextNode = locateClosingAnchor(node); 12711 } else if (isComment(node) && node.data === "teleport start") { 12712 nextNode = locateClosingAnchor(node, node.data, "teleport end"); 12713 } else { 12714 nextNode = nextSibling(node); 12715 } 12716 mountComponent( 12717 vnode, 12718 container, 12719 null, 12720 parentComponent, 12721 parentSuspense, 12722 getContainerType(container), 12723 optimized 12724 ); 12725 if (isAsyncWrapper(vnode)) { 12726 let subTree; 12727 if (isFragmentStart) { 12728 subTree = createVNode(Fragment); 12729 subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; 12730 } else { 12731 subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); 12732 } 12733 subTree.el = node; 12734 vnode.component.subTree = subTree; 12735 } 12736 } else if (shapeFlag & 64) { 12737 if (domType !== 8 /* COMMENT */) { 12738 nextNode = onMismatch(); 12739 } else { 12740 nextNode = vnode.type.hydrate( 12741 node, 12742 vnode, 12743 parentComponent, 12744 parentSuspense, 12745 slotScopeIds, 12746 optimized, 12747 rendererInternals, 12748 hydrateChildren 12749 ); 12750 } 12751 } else if (shapeFlag & 128) { 12752 nextNode = vnode.type.hydrate( 12753 node, 12754 vnode, 12755 parentComponent, 12756 parentSuspense, 12757 getContainerType(parentNode(node)), 12758 slotScopeIds, 12759 optimized, 12760 rendererInternals, 12761 hydrateNode 12762 ); 12763 } else if (true) { 12764 warn$1("Invalid HostVNode type:", type, `(${typeof type})`); 12765 } 12766 } 12767 if (ref != null) { 12768 setRef(ref, null, parentSuspense, vnode); 12769 } 12770 return nextNode; 12771 }; 12772 const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { 12773 optimized = optimized || !!vnode.dynamicChildren; 12774 const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; 12775 const forcePatch = type === "input" || type === "option"; 12776 if (true) { 12777 if (dirs) { 12778 invokeDirectiveHook(vnode, null, parentComponent, "created"); 12779 } 12780 let needCallTransitionHooks = false; 12781 if (isTemplateNode(el)) { 12782 needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; 12783 const content = el.content.firstChild; 12784 if (needCallTransitionHooks) { 12785 transition.beforeEnter(content); 12786 } 12787 replaceNode(content, el, parentComponent); 12788 vnode.el = el = content; 12789 } 12790 if (shapeFlag & 16 && // skip if element has innerHTML / textContent 12791 !(props && (props.innerHTML || props.textContent))) { 12792 let next = hydrateChildren( 12793 el.firstChild, 12794 vnode, 12795 el, 12796 parentComponent, 12797 parentSuspense, 12798 slotScopeIds, 12799 optimized 12800 ); 12801 let hasWarned = false; 12802 while (next) { 12803 hasMismatch = true; 12804 if (( true) && !hasWarned) { 12805 warn$1( 12806 `Hydration children mismatch on`, 12807 el, 12808 ` 12809Server rendered element contains more child nodes than client vdom.` 12810 ); 12811 hasWarned = true; 12812 } 12813 const cur = next; 12814 next = next.nextSibling; 12815 remove(cur); 12816 } 12817 } else if (shapeFlag & 8) { 12818 if (el.textContent !== vnode.children) { 12819 hasMismatch = true; 12820 ( true) && warn$1( 12821 `Hydration text content mismatch on`, 12822 el, 12823 ` 12824 - rendered on server: ${el.textContent} 12825 - expected on client: ${vnode.children}` 12826 ); 12827 el.textContent = vnode.children; 12828 } 12829 } 12830 if (props) { 12831 if (true) { 12832 for (const key in props) { 12833 if ( true && propHasMismatch(el, key, props[key])) { 12834 hasMismatch = true; 12835 } 12836 if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key) || // force hydrate v-bind with .prop modifiers 12837 key[0] === ".") { 12838 patchProp( 12839 el, 12840 key, 12841 null, 12842 props[key], 12843 void 0, 12844 void 0, 12845 parentComponent 12846 ); 12847 } 12848 } 12849 } else {} 12850 } 12851 let vnodeHooks; 12852 if (vnodeHooks = props && props.onVnodeBeforeMount) { 12853 invokeVNodeHook(vnodeHooks, parentComponent, vnode); 12854 } 12855 if (dirs) { 12856 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 12857 } 12858 if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { 12859 queueEffectWithSuspense(() => { 12860 vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); 12861 needCallTransitionHooks && transition.enter(el); 12862 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 12863 }, parentSuspense); 12864 } 12865 } 12866 return el.nextSibling; 12867 }; 12868 const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { 12869 optimized = optimized || !!parentVNode.dynamicChildren; 12870 const children = parentVNode.children; 12871 const l = children.length; 12872 let hasWarned = false; 12873 for (let i = 0; i < l; i++) { 12874 const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); 12875 if (node) { 12876 node = hydrateNode( 12877 node, 12878 vnode, 12879 parentComponent, 12880 parentSuspense, 12881 slotScopeIds, 12882 optimized 12883 ); 12884 } else if (vnode.type === Text && !vnode.children) { 12885 continue; 12886 } else { 12887 hasMismatch = true; 12888 if (( true) && !hasWarned) { 12889 warn$1( 12890 `Hydration children mismatch on`, 12891 container, 12892 ` 12893Server rendered element contains fewer child nodes than client vdom.` 12894 ); 12895 hasWarned = true; 12896 } 12897 patch( 12898 null, 12899 vnode, 12900 container, 12901 null, 12902 parentComponent, 12903 parentSuspense, 12904 getContainerType(container), 12905 slotScopeIds 12906 ); 12907 } 12908 } 12909 return node; 12910 }; 12911 const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { 12912 const { slotScopeIds: fragmentSlotScopeIds } = vnode; 12913 if (fragmentSlotScopeIds) { 12914 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 12915 } 12916 const container = parentNode(node); 12917 const next = hydrateChildren( 12918 nextSibling(node), 12919 vnode, 12920 container, 12921 parentComponent, 12922 parentSuspense, 12923 slotScopeIds, 12924 optimized 12925 ); 12926 if (next && isComment(next) && next.data === "]") { 12927 return nextSibling(vnode.anchor = next); 12928 } else { 12929 hasMismatch = true; 12930 insert(vnode.anchor = createComment(`]`), container, next); 12931 return next; 12932 } 12933 }; 12934 const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { 12935 hasMismatch = true; 12936 ( true) && warn$1( 12937 `Hydration node mismatch: 12938- rendered on server:`, 12939 node, 12940 node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, 12941 ` 12942- expected on client:`, 12943 vnode.type 12944 ); 12945 vnode.el = null; 12946 if (isFragment) { 12947 const end = locateClosingAnchor(node); 12948 while (true) { 12949 const next2 = nextSibling(node); 12950 if (next2 && next2 !== end) { 12951 remove(next2); 12952 } else { 12953 break; 12954 } 12955 } 12956 } 12957 const next = nextSibling(node); 12958 const container = parentNode(node); 12959 remove(node); 12960 patch( 12961 null, 12962 vnode, 12963 container, 12964 next, 12965 parentComponent, 12966 parentSuspense, 12967 getContainerType(container), 12968 slotScopeIds 12969 ); 12970 return next; 12971 }; 12972 const locateClosingAnchor = (node, open = "[", close = "]") => { 12973 let match = 0; 12974 while (node) { 12975 node = nextSibling(node); 12976 if (node && isComment(node)) { 12977 if (node.data === open) 12978 match++; 12979 if (node.data === close) { 12980 if (match === 0) { 12981 return nextSibling(node); 12982 } else { 12983 match--; 12984 } 12985 } 12986 } 12987 } 12988 return node; 12989 }; 12990 const replaceNode = (newNode, oldNode, parentComponent) => { 12991 const parentNode2 = oldNode.parentNode; 12992 if (parentNode2) { 12993 parentNode2.replaceChild(newNode, oldNode); 12994 } 12995 let parent = parentComponent; 12996 while (parent) { 12997 if (parent.vnode.el === oldNode) { 12998 parent.vnode.el = parent.subTree.el = newNode; 12999 } 13000 parent = parent.parent; 13001 } 13002 }; 13003 const isTemplateNode = (node) => { 13004 return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template"; 13005 }; 13006 return [hydrate, hydrateNode]; 13007} 13008function propHasMismatch(el, key, clientValue) { 13009 let mismatchType; 13010 let mismatchKey; 13011 let actual; 13012 let expected; 13013 if (key === "class") { 13014 actual = toClassSet(el.getAttribute("class") || ""); 13015 expected = toClassSet((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass)(clientValue)); 13016 if (!isSetEqual(actual, expected)) { 13017 mismatchType = mismatchKey = `class`; 13018 } 13019 } else if (key === "style") { 13020 actual = el.getAttribute("style"); 13021 expected = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(clientValue) ? clientValue : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.stringifyStyle)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle)(clientValue)); 13022 if (actual !== expected) { 13023 mismatchType = mismatchKey = "style"; 13024 } 13025 } else if (el instanceof SVGElement && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isKnownSvgAttr)(key) || el instanceof HTMLElement && ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isBooleanAttr)(key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isKnownHtmlAttr)(key))) { 13026 actual = el.hasAttribute(key) && el.getAttribute(key); 13027 expected = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isBooleanAttr)(key) ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.includeBooleanAttr)(clientValue) ? "" : false : clientValue == null ? false : String(clientValue); 13028 if (actual !== expected) { 13029 mismatchType = `attribute`; 13030 mismatchKey = key; 13031 } 13032 } 13033 if (mismatchType) { 13034 const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; 13035 warn$1( 13036 `Hydration ${mismatchType} mismatch on`, 13037 el, 13038 ` 13039 - rendered on server: ${format(actual)} 13040 - expected on client: ${format(expected)} 13041 Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. 13042 You should fix the source of the mismatch.` 13043 ); 13044 return true; 13045 } 13046 return false; 13047} 13048function toClassSet(str) { 13049 return new Set(str.trim().split(/\s+/)); 13050} 13051function isSetEqual(a, b) { 13052 if (a.size !== b.size) { 13053 return false; 13054 } 13055 for (const s of a) { 13056 if (!b.has(s)) { 13057 return false; 13058 } 13059 } 13060 return true; 13061} 13062 13063let supported; 13064let perf; 13065function startMeasure(instance, type) { 13066 if (instance.appContext.config.performance && isSupported()) { 13067 perf.mark(`vue-${type}-${instance.uid}`); 13068 } 13069 if (true) { 13070 devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); 13071 } 13072} 13073function endMeasure(instance, type) { 13074 if (instance.appContext.config.performance && isSupported()) { 13075 const startTag = `vue-${type}-${instance.uid}`; 13076 const endTag = startTag + `:end`; 13077 perf.mark(endTag); 13078 perf.measure( 13079 `<${formatComponentName(instance, instance.type)}> ${type}`, 13080 startTag, 13081 endTag 13082 ); 13083 perf.clearMarks(startTag); 13084 perf.clearMarks(endTag); 13085 } 13086 if (true) { 13087 devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); 13088 } 13089} 13090function isSupported() { 13091 if (supported !== void 0) { 13092 return supported; 13093 } 13094 if (typeof window !== "undefined" && window.performance) { 13095 supported = true; 13096 perf = window.performance; 13097 } else { 13098 supported = false; 13099 } 13100 return supported; 13101} 13102 13103function initFeatureFlags() { 13104 const needWarn = []; 13105 if (false) {} 13106 if (false) {} 13107 if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") { 13108 true && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`); 13109 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false; 13110 } 13111 if ( true && needWarn.length) { 13112 const multi = needWarn.length > 1; 13113 console.warn( 13114 `Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle. 13115 13116For more details, see https://link.vuejs.org/feature-flags.` 13117 ); 13118 } 13119} 13120 13121const queuePostRenderEffect = queueEffectWithSuspense ; 13122function createRenderer(options) { 13123 return baseCreateRenderer(options); 13124} 13125function createHydrationRenderer(options) { 13126 return baseCreateRenderer(options, createHydrationFunctions); 13127} 13128function baseCreateRenderer(options, createHydrationFns) { 13129 { 13130 initFeatureFlags(); 13131 } 13132 const target = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)(); 13133 target.__VUE__ = true; 13134 if (true) { 13135 setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); 13136 } 13137 const { 13138 insert: hostInsert, 13139 remove: hostRemove, 13140 patchProp: hostPatchProp, 13141 createElement: hostCreateElement, 13142 createText: hostCreateText, 13143 createComment: hostCreateComment, 13144 setText: hostSetText, 13145 setElementText: hostSetElementText, 13146 parentNode: hostParentNode, 13147 nextSibling: hostNextSibling, 13148 setScopeId: hostSetScopeId = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP, 13149 insertStaticContent: hostInsertStaticContent 13150 } = options; 13151 const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = true && isHmrUpdating ? false : !!n2.dynamicChildren) => { 13152 if (n1 === n2) { 13153 return; 13154 } 13155 if (n1 && !isSameVNodeType(n1, n2)) { 13156 anchor = getNextHostNode(n1); 13157 unmount(n1, parentComponent, parentSuspense, true); 13158 n1 = null; 13159 } 13160 if (n2.patchFlag === -2) { 13161 optimized = false; 13162 n2.dynamicChildren = null; 13163 } 13164 const { type, ref, shapeFlag } = n2; 13165 switch (type) { 13166 case Text: 13167 processText(n1, n2, container, anchor); 13168 break; 13169 case Comment: 13170 processCommentNode(n1, n2, container, anchor); 13171 break; 13172 case Static: 13173 if (n1 == null) { 13174 mountStaticNode(n2, container, anchor, namespace); 13175 } else if (true) { 13176 patchStaticNode(n1, n2, container, namespace); 13177 } 13178 break; 13179 case Fragment: 13180 processFragment( 13181 n1, 13182 n2, 13183 container, 13184 anchor, 13185 parentComponent, 13186 parentSuspense, 13187 namespace, 13188 slotScopeIds, 13189 optimized 13190 ); 13191 break; 13192 default: 13193 if (shapeFlag & 1) { 13194 processElement( 13195 n1, 13196 n2, 13197 container, 13198 anchor, 13199 parentComponent, 13200 parentSuspense, 13201 namespace, 13202 slotScopeIds, 13203 optimized 13204 ); 13205 } else if (shapeFlag & 6) { 13206 processComponent( 13207 n1, 13208 n2, 13209 container, 13210 anchor, 13211 parentComponent, 13212 parentSuspense, 13213 namespace, 13214 slotScopeIds, 13215 optimized 13216 ); 13217 } else if (shapeFlag & 64) { 13218 type.process( 13219 n1, 13220 n2, 13221 container, 13222 anchor, 13223 parentComponent, 13224 parentSuspense, 13225 namespace, 13226 slotScopeIds, 13227 optimized, 13228 internals 13229 ); 13230 } else if (shapeFlag & 128) { 13231 type.process( 13232 n1, 13233 n2, 13234 container, 13235 anchor, 13236 parentComponent, 13237 parentSuspense, 13238 namespace, 13239 slotScopeIds, 13240 optimized, 13241 internals 13242 ); 13243 } else if (true) { 13244 warn$1("Invalid VNode type:", type, `(${typeof type})`); 13245 } 13246 } 13247 if (ref != null && parentComponent) { 13248 setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); 13249 } 13250 }; 13251 const processText = (n1, n2, container, anchor) => { 13252 if (n1 == null) { 13253 hostInsert( 13254 n2.el = hostCreateText(n2.children), 13255 container, 13256 anchor 13257 ); 13258 } else { 13259 const el = n2.el = n1.el; 13260 if (n2.children !== n1.children) { 13261 hostSetText(el, n2.children); 13262 } 13263 } 13264 }; 13265 const processCommentNode = (n1, n2, container, anchor) => { 13266 if (n1 == null) { 13267 hostInsert( 13268 n2.el = hostCreateComment(n2.children || ""), 13269 container, 13270 anchor 13271 ); 13272 } else { 13273 n2.el = n1.el; 13274 } 13275 }; 13276 const mountStaticNode = (n2, container, anchor, namespace) => { 13277 [n2.el, n2.anchor] = hostInsertStaticContent( 13278 n2.children, 13279 container, 13280 anchor, 13281 namespace, 13282 n2.el, 13283 n2.anchor 13284 ); 13285 }; 13286 const patchStaticNode = (n1, n2, container, namespace) => { 13287 if (n2.children !== n1.children) { 13288 const anchor = hostNextSibling(n1.anchor); 13289 removeStaticNode(n1); 13290 [n2.el, n2.anchor] = hostInsertStaticContent( 13291 n2.children, 13292 container, 13293 anchor, 13294 namespace 13295 ); 13296 } else { 13297 n2.el = n1.el; 13298 n2.anchor = n1.anchor; 13299 } 13300 }; 13301 const moveStaticNode = ({ el, anchor }, container, nextSibling) => { 13302 let next; 13303 while (el && el !== anchor) { 13304 next = hostNextSibling(el); 13305 hostInsert(el, container, nextSibling); 13306 el = next; 13307 } 13308 hostInsert(anchor, container, nextSibling); 13309 }; 13310 const removeStaticNode = ({ el, anchor }) => { 13311 let next; 13312 while (el && el !== anchor) { 13313 next = hostNextSibling(el); 13314 hostRemove(el); 13315 el = next; 13316 } 13317 hostRemove(anchor); 13318 }; 13319 const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 13320 if (n2.type === "svg") { 13321 namespace = "svg"; 13322 } else if (n2.type === "math") { 13323 namespace = "mathml"; 13324 } 13325 if (n1 == null) { 13326 mountElement( 13327 n2, 13328 container, 13329 anchor, 13330 parentComponent, 13331 parentSuspense, 13332 namespace, 13333 slotScopeIds, 13334 optimized 13335 ); 13336 } else { 13337 patchElement( 13338 n1, 13339 n2, 13340 parentComponent, 13341 parentSuspense, 13342 namespace, 13343 slotScopeIds, 13344 optimized 13345 ); 13346 } 13347 }; 13348 const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 13349 let el; 13350 let vnodeHook; 13351 const { props, shapeFlag, transition, dirs } = vnode; 13352 el = vnode.el = hostCreateElement( 13353 vnode.type, 13354 namespace, 13355 props && props.is, 13356 props 13357 ); 13358 if (shapeFlag & 8) { 13359 hostSetElementText(el, vnode.children); 13360 } else if (shapeFlag & 16) { 13361 mountChildren( 13362 vnode.children, 13363 el, 13364 null, 13365 parentComponent, 13366 parentSuspense, 13367 resolveChildrenNamespace(vnode, namespace), 13368 slotScopeIds, 13369 optimized 13370 ); 13371 } 13372 if (dirs) { 13373 invokeDirectiveHook(vnode, null, parentComponent, "created"); 13374 } 13375 setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); 13376 if (props) { 13377 for (const key in props) { 13378 if (key !== "value" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) { 13379 hostPatchProp( 13380 el, 13381 key, 13382 null, 13383 props[key], 13384 namespace, 13385 vnode.children, 13386 parentComponent, 13387 parentSuspense, 13388 unmountChildren 13389 ); 13390 } 13391 } 13392 if ("value" in props) { 13393 hostPatchProp(el, "value", null, props.value, namespace); 13394 } 13395 if (vnodeHook = props.onVnodeBeforeMount) { 13396 invokeVNodeHook(vnodeHook, parentComponent, vnode); 13397 } 13398 } 13399 if (true) { 13400 Object.defineProperty(el, "__vnode", { 13401 value: vnode, 13402 enumerable: false 13403 }); 13404 Object.defineProperty(el, "__vueParentComponent", { 13405 value: parentComponent, 13406 enumerable: false 13407 }); 13408 } 13409 if (dirs) { 13410 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 13411 } 13412 const needCallTransitionHooks = needTransition(parentSuspense, transition); 13413 if (needCallTransitionHooks) { 13414 transition.beforeEnter(el); 13415 } 13416 hostInsert(el, container, anchor); 13417 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { 13418 queuePostRenderEffect(() => { 13419 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 13420 needCallTransitionHooks && transition.enter(el); 13421 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 13422 }, parentSuspense); 13423 } 13424 }; 13425 const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { 13426 if (scopeId) { 13427 hostSetScopeId(el, scopeId); 13428 } 13429 if (slotScopeIds) { 13430 for (let i = 0; i < slotScopeIds.length; i++) { 13431 hostSetScopeId(el, slotScopeIds[i]); 13432 } 13433 } 13434 if (parentComponent) { 13435 let subTree = parentComponent.subTree; 13436 if ( true && subTree.patchFlag > 0 && subTree.patchFlag & 2048) { 13437 subTree = filterSingleRoot(subTree.children) || subTree; 13438 } 13439 if (vnode === subTree) { 13440 const parentVNode = parentComponent.vnode; 13441 setScopeId( 13442 el, 13443 parentVNode, 13444 parentVNode.scopeId, 13445 parentVNode.slotScopeIds, 13446 parentComponent.parent 13447 ); 13448 } 13449 } 13450 }; 13451 const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { 13452 for (let i = start; i < children.length; i++) { 13453 const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); 13454 patch( 13455 null, 13456 child, 13457 container, 13458 anchor, 13459 parentComponent, 13460 parentSuspense, 13461 namespace, 13462 slotScopeIds, 13463 optimized 13464 ); 13465 } 13466 }; 13467 const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 13468 const el = n2.el = n1.el; 13469 let { patchFlag, dynamicChildren, dirs } = n2; 13470 patchFlag |= n1.patchFlag & 16; 13471 const oldProps = n1.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 13472 const newProps = n2.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 13473 let vnodeHook; 13474 parentComponent && toggleRecurse(parentComponent, false); 13475 if (vnodeHook = newProps.onVnodeBeforeUpdate) { 13476 invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 13477 } 13478 if (dirs) { 13479 invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); 13480 } 13481 parentComponent && toggleRecurse(parentComponent, true); 13482 if ( true && isHmrUpdating) { 13483 patchFlag = 0; 13484 optimized = false; 13485 dynamicChildren = null; 13486 } 13487 if (dynamicChildren) { 13488 patchBlockChildren( 13489 n1.dynamicChildren, 13490 dynamicChildren, 13491 el, 13492 parentComponent, 13493 parentSuspense, 13494 resolveChildrenNamespace(n2, namespace), 13495 slotScopeIds 13496 ); 13497 if (true) { 13498 traverseStaticChildren(n1, n2); 13499 } 13500 } else if (!optimized) { 13501 patchChildren( 13502 n1, 13503 n2, 13504 el, 13505 null, 13506 parentComponent, 13507 parentSuspense, 13508 resolveChildrenNamespace(n2, namespace), 13509 slotScopeIds, 13510 false 13511 ); 13512 } 13513 if (patchFlag > 0) { 13514 if (patchFlag & 16) { 13515 patchProps( 13516 el, 13517 n2, 13518 oldProps, 13519 newProps, 13520 parentComponent, 13521 parentSuspense, 13522 namespace 13523 ); 13524 } else { 13525 if (patchFlag & 2) { 13526 if (oldProps.class !== newProps.class) { 13527 hostPatchProp(el, "class", null, newProps.class, namespace); 13528 } 13529 } 13530 if (patchFlag & 4) { 13531 hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); 13532 } 13533 if (patchFlag & 8) { 13534 const propsToUpdate = n2.dynamicProps; 13535 for (let i = 0; i < propsToUpdate.length; i++) { 13536 const key = propsToUpdate[i]; 13537 const prev = oldProps[key]; 13538 const next = newProps[key]; 13539 if (next !== prev || key === "value") { 13540 hostPatchProp( 13541 el, 13542 key, 13543 prev, 13544 next, 13545 namespace, 13546 n1.children, 13547 parentComponent, 13548 parentSuspense, 13549 unmountChildren 13550 ); 13551 } 13552 } 13553 } 13554 } 13555 if (patchFlag & 1) { 13556 if (n1.children !== n2.children) { 13557 hostSetElementText(el, n2.children); 13558 } 13559 } 13560 } else if (!optimized && dynamicChildren == null) { 13561 patchProps( 13562 el, 13563 n2, 13564 oldProps, 13565 newProps, 13566 parentComponent, 13567 parentSuspense, 13568 namespace 13569 ); 13570 } 13571 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { 13572 queuePostRenderEffect(() => { 13573 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 13574 dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); 13575 }, parentSuspense); 13576 } 13577 }; 13578 const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { 13579 for (let i = 0; i < newChildren.length; i++) { 13580 const oldVNode = oldChildren[i]; 13581 const newVNode = newChildren[i]; 13582 const container = ( 13583 // oldVNode may be an errored async setup() component inside Suspense 13584 // which will not have a mounted element 13585 oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent 13586 // of the Fragment itself so it can move its children. 13587 (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement 13588 // which also requires the correct parent container 13589 !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. 13590 oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( 13591 // In other cases, the parent container is not actually used so we 13592 // just pass the block element here to avoid a DOM parentNode call. 13593 fallbackContainer 13594 ) 13595 ); 13596 patch( 13597 oldVNode, 13598 newVNode, 13599 container, 13600 null, 13601 parentComponent, 13602 parentSuspense, 13603 namespace, 13604 slotScopeIds, 13605 true 13606 ); 13607 } 13608 }; 13609 const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => { 13610 if (oldProps !== newProps) { 13611 if (oldProps !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { 13612 for (const key in oldProps) { 13613 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key) && !(key in newProps)) { 13614 hostPatchProp( 13615 el, 13616 key, 13617 oldProps[key], 13618 null, 13619 namespace, 13620 vnode.children, 13621 parentComponent, 13622 parentSuspense, 13623 unmountChildren 13624 ); 13625 } 13626 } 13627 } 13628 for (const key in newProps) { 13629 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) 13630 continue; 13631 const next = newProps[key]; 13632 const prev = oldProps[key]; 13633 if (next !== prev && key !== "value") { 13634 hostPatchProp( 13635 el, 13636 key, 13637 prev, 13638 next, 13639 namespace, 13640 vnode.children, 13641 parentComponent, 13642 parentSuspense, 13643 unmountChildren 13644 ); 13645 } 13646 } 13647 if ("value" in newProps) { 13648 hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); 13649 } 13650 } 13651 }; 13652 const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 13653 const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); 13654 const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); 13655 let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; 13656 if ( true && // #5523 dev root fragment may inherit directives 13657 (isHmrUpdating || patchFlag & 2048)) { 13658 patchFlag = 0; 13659 optimized = false; 13660 dynamicChildren = null; 13661 } 13662 if (fragmentSlotScopeIds) { 13663 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 13664 } 13665 if (n1 == null) { 13666 hostInsert(fragmentStartAnchor, container, anchor); 13667 hostInsert(fragmentEndAnchor, container, anchor); 13668 mountChildren( 13669 n2.children, 13670 container, 13671 fragmentEndAnchor, 13672 parentComponent, 13673 parentSuspense, 13674 namespace, 13675 slotScopeIds, 13676 optimized 13677 ); 13678 } else { 13679 if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result 13680 // of renderSlot() with no valid children 13681 n1.dynamicChildren) { 13682 patchBlockChildren( 13683 n1.dynamicChildren, 13684 dynamicChildren, 13685 container, 13686 parentComponent, 13687 parentSuspense, 13688 namespace, 13689 slotScopeIds 13690 ); 13691 if (true) { 13692 traverseStaticChildren(n1, n2); 13693 } else {} 13694 } else { 13695 patchChildren( 13696 n1, 13697 n2, 13698 container, 13699 fragmentEndAnchor, 13700 parentComponent, 13701 parentSuspense, 13702 namespace, 13703 slotScopeIds, 13704 optimized 13705 ); 13706 } 13707 } 13708 }; 13709 const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 13710 n2.slotScopeIds = slotScopeIds; 13711 if (n1 == null) { 13712 if (n2.shapeFlag & 512) { 13713 parentComponent.ctx.activate( 13714 n2, 13715 container, 13716 anchor, 13717 namespace, 13718 optimized 13719 ); 13720 } else { 13721 mountComponent( 13722 n2, 13723 container, 13724 anchor, 13725 parentComponent, 13726 parentSuspense, 13727 namespace, 13728 optimized 13729 ); 13730 } 13731 } else { 13732 updateComponent(n1, n2, optimized); 13733 } 13734 }; 13735 const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { 13736 const instance = (initialVNode.component = createComponentInstance( 13737 initialVNode, 13738 parentComponent, 13739 parentSuspense 13740 )); 13741 if ( true && instance.type.__hmrId) { 13742 registerHMR(instance); 13743 } 13744 if (true) { 13745 pushWarningContext(initialVNode); 13746 startMeasure(instance, `mount`); 13747 } 13748 if (isKeepAlive(initialVNode)) { 13749 instance.ctx.renderer = internals; 13750 } 13751 { 13752 if (true) { 13753 startMeasure(instance, `init`); 13754 } 13755 setupComponent(instance); 13756 if (true) { 13757 endMeasure(instance, `init`); 13758 } 13759 } 13760 if (instance.asyncDep) { 13761 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect); 13762 if (!initialVNode.el) { 13763 const placeholder = instance.subTree = createVNode(Comment); 13764 processCommentNode(null, placeholder, container, anchor); 13765 } 13766 } else { 13767 setupRenderEffect( 13768 instance, 13769 initialVNode, 13770 container, 13771 anchor, 13772 parentSuspense, 13773 namespace, 13774 optimized 13775 ); 13776 } 13777 if (true) { 13778 popWarningContext(); 13779 endMeasure(instance, `mount`); 13780 } 13781 }; 13782 const updateComponent = (n1, n2, optimized) => { 13783 const instance = n2.component = n1.component; 13784 if (shouldUpdateComponent(n1, n2, optimized)) { 13785 if (instance.asyncDep && !instance.asyncResolved) { 13786 if (true) { 13787 pushWarningContext(n2); 13788 } 13789 updateComponentPreRender(instance, n2, optimized); 13790 if (true) { 13791 popWarningContext(); 13792 } 13793 return; 13794 } else { 13795 instance.next = n2; 13796 invalidateJob(instance.update); 13797 instance.effect.dirty = true; 13798 instance.update(); 13799 } 13800 } else { 13801 n2.el = n1.el; 13802 instance.vnode = n2; 13803 } 13804 }; 13805 const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { 13806 const componentUpdateFn = () => { 13807 if (!instance.isMounted) { 13808 let vnodeHook; 13809 const { el, props } = initialVNode; 13810 const { bm, m, parent } = instance; 13811 const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); 13812 toggleRecurse(instance, false); 13813 if (bm) { 13814 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bm); 13815 } 13816 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { 13817 invokeVNodeHook(vnodeHook, parent, initialVNode); 13818 } 13819 toggleRecurse(instance, true); 13820 if (el && hydrateNode) { 13821 const hydrateSubTree = () => { 13822 if (true) { 13823 startMeasure(instance, `render`); 13824 } 13825 instance.subTree = renderComponentRoot(instance); 13826 if (true) { 13827 endMeasure(instance, `render`); 13828 } 13829 if (true) { 13830 startMeasure(instance, `hydrate`); 13831 } 13832 hydrateNode( 13833 el, 13834 instance.subTree, 13835 instance, 13836 parentSuspense, 13837 null 13838 ); 13839 if (true) { 13840 endMeasure(instance, `hydrate`); 13841 } 13842 }; 13843 if (isAsyncWrapperVNode) { 13844 initialVNode.type.__asyncLoader().then( 13845 // note: we are moving the render call into an async callback, 13846 // which means it won't track dependencies - but it's ok because 13847 // a server-rendered async wrapper is already in resolved state 13848 // and it will never need to change. 13849 () => !instance.isUnmounted && hydrateSubTree() 13850 ); 13851 } else { 13852 hydrateSubTree(); 13853 } 13854 } else { 13855 if (true) { 13856 startMeasure(instance, `render`); 13857 } 13858 const subTree = instance.subTree = renderComponentRoot(instance); 13859 if (true) { 13860 endMeasure(instance, `render`); 13861 } 13862 if (true) { 13863 startMeasure(instance, `patch`); 13864 } 13865 patch( 13866 null, 13867 subTree, 13868 container, 13869 anchor, 13870 instance, 13871 parentSuspense, 13872 namespace 13873 ); 13874 if (true) { 13875 endMeasure(instance, `patch`); 13876 } 13877 initialVNode.el = subTree.el; 13878 } 13879 if (m) { 13880 queuePostRenderEffect(m, parentSuspense); 13881 } 13882 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { 13883 const scopedInitialVNode = initialVNode; 13884 queuePostRenderEffect( 13885 () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), 13886 parentSuspense 13887 ); 13888 } 13889 if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { 13890 instance.a && queuePostRenderEffect(instance.a, parentSuspense); 13891 } 13892 instance.isMounted = true; 13893 if (true) { 13894 devtoolsComponentAdded(instance); 13895 } 13896 initialVNode = container = anchor = null; 13897 } else { 13898 let { next, bu, u, parent, vnode } = instance; 13899 { 13900 const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); 13901 if (nonHydratedAsyncRoot) { 13902 if (next) { 13903 next.el = vnode.el; 13904 updateComponentPreRender(instance, next, optimized); 13905 } 13906 nonHydratedAsyncRoot.asyncDep.then(() => { 13907 if (!instance.isUnmounted) { 13908 componentUpdateFn(); 13909 } 13910 }); 13911 return; 13912 } 13913 } 13914 let originNext = next; 13915 let vnodeHook; 13916 if (true) { 13917 pushWarningContext(next || instance.vnode); 13918 } 13919 toggleRecurse(instance, false); 13920 if (next) { 13921 next.el = vnode.el; 13922 updateComponentPreRender(instance, next, optimized); 13923 } else { 13924 next = vnode; 13925 } 13926 if (bu) { 13927 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bu); 13928 } 13929 if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { 13930 invokeVNodeHook(vnodeHook, parent, next, vnode); 13931 } 13932 toggleRecurse(instance, true); 13933 if (true) { 13934 startMeasure(instance, `render`); 13935 } 13936 const nextTree = renderComponentRoot(instance); 13937 if (true) { 13938 endMeasure(instance, `render`); 13939 } 13940 const prevTree = instance.subTree; 13941 instance.subTree = nextTree; 13942 if (true) { 13943 startMeasure(instance, `patch`); 13944 } 13945 patch( 13946 prevTree, 13947 nextTree, 13948 // parent may have changed if it's in a teleport 13949 hostParentNode(prevTree.el), 13950 // anchor may have changed if it's in a fragment 13951 getNextHostNode(prevTree), 13952 instance, 13953 parentSuspense, 13954 namespace 13955 ); 13956 if (true) { 13957 endMeasure(instance, `patch`); 13958 } 13959 next.el = nextTree.el; 13960 if (originNext === null) { 13961 updateHOCHostEl(instance, nextTree.el); 13962 } 13963 if (u) { 13964 queuePostRenderEffect(u, parentSuspense); 13965 } 13966 if (vnodeHook = next.props && next.props.onVnodeUpdated) { 13967 queuePostRenderEffect( 13968 () => invokeVNodeHook(vnodeHook, parent, next, vnode), 13969 parentSuspense 13970 ); 13971 } 13972 if (true) { 13973 devtoolsComponentUpdated(instance); 13974 } 13975 if (true) { 13976 popWarningContext(); 13977 } 13978 } 13979 }; 13980 const effect = instance.effect = new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect( 13981 componentUpdateFn, 13982 _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP, 13983 () => queueJob(update), 13984 instance.scope 13985 // track it in component's effect scope 13986 ); 13987 const update = instance.update = () => { 13988 if (effect.dirty) { 13989 effect.run(); 13990 } 13991 }; 13992 update.id = instance.uid; 13993 toggleRecurse(instance, true); 13994 if (true) { 13995 effect.onTrack = instance.rtc ? (e) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance.rtc, e) : void 0; 13996 effect.onTrigger = instance.rtg ? (e) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance.rtg, e) : void 0; 13997 update.ownerInstance = instance; 13998 } 13999 update(); 14000 }; 14001 const updateComponentPreRender = (instance, nextVNode, optimized) => { 14002 nextVNode.component = instance; 14003 const prevProps = instance.vnode.props; 14004 instance.vnode = nextVNode; 14005 instance.next = null; 14006 updateProps(instance, nextVNode.props, prevProps, optimized); 14007 updateSlots(instance, nextVNode.children, optimized); 14008 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); 14009 flushPreFlushCbs(instance); 14010 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); 14011 }; 14012 const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { 14013 const c1 = n1 && n1.children; 14014 const prevShapeFlag = n1 ? n1.shapeFlag : 0; 14015 const c2 = n2.children; 14016 const { patchFlag, shapeFlag } = n2; 14017 if (patchFlag > 0) { 14018 if (patchFlag & 128) { 14019 patchKeyedChildren( 14020 c1, 14021 c2, 14022 container, 14023 anchor, 14024 parentComponent, 14025 parentSuspense, 14026 namespace, 14027 slotScopeIds, 14028 optimized 14029 ); 14030 return; 14031 } else if (patchFlag & 256) { 14032 patchUnkeyedChildren( 14033 c1, 14034 c2, 14035 container, 14036 anchor, 14037 parentComponent, 14038 parentSuspense, 14039 namespace, 14040 slotScopeIds, 14041 optimized 14042 ); 14043 return; 14044 } 14045 } 14046 if (shapeFlag & 8) { 14047 if (prevShapeFlag & 16) { 14048 unmountChildren(c1, parentComponent, parentSuspense); 14049 } 14050 if (c2 !== c1) { 14051 hostSetElementText(container, c2); 14052 } 14053 } else { 14054 if (prevShapeFlag & 16) { 14055 if (shapeFlag & 16) { 14056 patchKeyedChildren( 14057 c1, 14058 c2, 14059 container, 14060 anchor, 14061 parentComponent, 14062 parentSuspense, 14063 namespace, 14064 slotScopeIds, 14065 optimized 14066 ); 14067 } else { 14068 unmountChildren(c1, parentComponent, parentSuspense, true); 14069 } 14070 } else { 14071 if (prevShapeFlag & 8) { 14072 hostSetElementText(container, ""); 14073 } 14074 if (shapeFlag & 16) { 14075 mountChildren( 14076 c2, 14077 container, 14078 anchor, 14079 parentComponent, 14080 parentSuspense, 14081 namespace, 14082 slotScopeIds, 14083 optimized 14084 ); 14085 } 14086 } 14087 } 14088 }; 14089 const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 14090 c1 = c1 || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; 14091 c2 = c2 || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; 14092 const oldLength = c1.length; 14093 const newLength = c2.length; 14094 const commonLength = Math.min(oldLength, newLength); 14095 let i; 14096 for (i = 0; i < commonLength; i++) { 14097 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 14098 patch( 14099 c1[i], 14100 nextChild, 14101 container, 14102 null, 14103 parentComponent, 14104 parentSuspense, 14105 namespace, 14106 slotScopeIds, 14107 optimized 14108 ); 14109 } 14110 if (oldLength > newLength) { 14111 unmountChildren( 14112 c1, 14113 parentComponent, 14114 parentSuspense, 14115 true, 14116 false, 14117 commonLength 14118 ); 14119 } else { 14120 mountChildren( 14121 c2, 14122 container, 14123 anchor, 14124 parentComponent, 14125 parentSuspense, 14126 namespace, 14127 slotScopeIds, 14128 optimized, 14129 commonLength 14130 ); 14131 } 14132 }; 14133 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 14134 let i = 0; 14135 const l2 = c2.length; 14136 let e1 = c1.length - 1; 14137 let e2 = l2 - 1; 14138 while (i <= e1 && i <= e2) { 14139 const n1 = c1[i]; 14140 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 14141 if (isSameVNodeType(n1, n2)) { 14142 patch( 14143 n1, 14144 n2, 14145 container, 14146 null, 14147 parentComponent, 14148 parentSuspense, 14149 namespace, 14150 slotScopeIds, 14151 optimized 14152 ); 14153 } else { 14154 break; 14155 } 14156 i++; 14157 } 14158 while (i <= e1 && i <= e2) { 14159 const n1 = c1[e1]; 14160 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); 14161 if (isSameVNodeType(n1, n2)) { 14162 patch( 14163 n1, 14164 n2, 14165 container, 14166 null, 14167 parentComponent, 14168 parentSuspense, 14169 namespace, 14170 slotScopeIds, 14171 optimized 14172 ); 14173 } else { 14174 break; 14175 } 14176 e1--; 14177 e2--; 14178 } 14179 if (i > e1) { 14180 if (i <= e2) { 14181 const nextPos = e2 + 1; 14182 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; 14183 while (i <= e2) { 14184 patch( 14185 null, 14186 c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), 14187 container, 14188 anchor, 14189 parentComponent, 14190 parentSuspense, 14191 namespace, 14192 slotScopeIds, 14193 optimized 14194 ); 14195 i++; 14196 } 14197 } 14198 } else if (i > e2) { 14199 while (i <= e1) { 14200 unmount(c1[i], parentComponent, parentSuspense, true); 14201 i++; 14202 } 14203 } else { 14204 const s1 = i; 14205 const s2 = i; 14206 const keyToNewIndexMap = /* @__PURE__ */ new Map(); 14207 for (i = s2; i <= e2; i++) { 14208 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 14209 if (nextChild.key != null) { 14210 if ( true && keyToNewIndexMap.has(nextChild.key)) { 14211 warn$1( 14212 `Duplicate keys found during update:`, 14213 JSON.stringify(nextChild.key), 14214 `Make sure keys are unique.` 14215 ); 14216 } 14217 keyToNewIndexMap.set(nextChild.key, i); 14218 } 14219 } 14220 let j; 14221 let patched = 0; 14222 const toBePatched = e2 - s2 + 1; 14223 let moved = false; 14224 let maxNewIndexSoFar = 0; 14225 const newIndexToOldIndexMap = new Array(toBePatched); 14226 for (i = 0; i < toBePatched; i++) 14227 newIndexToOldIndexMap[i] = 0; 14228 for (i = s1; i <= e1; i++) { 14229 const prevChild = c1[i]; 14230 if (patched >= toBePatched) { 14231 unmount(prevChild, parentComponent, parentSuspense, true); 14232 continue; 14233 } 14234 let newIndex; 14235 if (prevChild.key != null) { 14236 newIndex = keyToNewIndexMap.get(prevChild.key); 14237 } else { 14238 for (j = s2; j <= e2; j++) { 14239 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { 14240 newIndex = j; 14241 break; 14242 } 14243 } 14244 } 14245 if (newIndex === void 0) { 14246 unmount(prevChild, parentComponent, parentSuspense, true); 14247 } else { 14248 newIndexToOldIndexMap[newIndex - s2] = i + 1; 14249 if (newIndex >= maxNewIndexSoFar) { 14250 maxNewIndexSoFar = newIndex; 14251 } else { 14252 moved = true; 14253 } 14254 patch( 14255 prevChild, 14256 c2[newIndex], 14257 container, 14258 null, 14259 parentComponent, 14260 parentSuspense, 14261 namespace, 14262 slotScopeIds, 14263 optimized 14264 ); 14265 patched++; 14266 } 14267 } 14268 const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; 14269 j = increasingNewIndexSequence.length - 1; 14270 for (i = toBePatched - 1; i >= 0; i--) { 14271 const nextIndex = s2 + i; 14272 const nextChild = c2[nextIndex]; 14273 const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; 14274 if (newIndexToOldIndexMap[i] === 0) { 14275 patch( 14276 null, 14277 nextChild, 14278 container, 14279 anchor, 14280 parentComponent, 14281 parentSuspense, 14282 namespace, 14283 slotScopeIds, 14284 optimized 14285 ); 14286 } else if (moved) { 14287 if (j < 0 || i !== increasingNewIndexSequence[j]) { 14288 move(nextChild, container, anchor, 2); 14289 } else { 14290 j--; 14291 } 14292 } 14293 } 14294 } 14295 }; 14296 const move = (vnode, container, anchor, moveType, parentSuspense = null) => { 14297 const { el, type, transition, children, shapeFlag } = vnode; 14298 if (shapeFlag & 6) { 14299 move(vnode.component.subTree, container, anchor, moveType); 14300 return; 14301 } 14302 if (shapeFlag & 128) { 14303 vnode.suspense.move(container, anchor, moveType); 14304 return; 14305 } 14306 if (shapeFlag & 64) { 14307 type.move(vnode, container, anchor, internals); 14308 return; 14309 } 14310 if (type === Fragment) { 14311 hostInsert(el, container, anchor); 14312 for (let i = 0; i < children.length; i++) { 14313 move(children[i], container, anchor, moveType); 14314 } 14315 hostInsert(vnode.anchor, container, anchor); 14316 return; 14317 } 14318 if (type === Static) { 14319 moveStaticNode(vnode, container, anchor); 14320 return; 14321 } 14322 const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; 14323 if (needTransition2) { 14324 if (moveType === 0) { 14325 transition.beforeEnter(el); 14326 hostInsert(el, container, anchor); 14327 queuePostRenderEffect(() => transition.enter(el), parentSuspense); 14328 } else { 14329 const { leave, delayLeave, afterLeave } = transition; 14330 const remove2 = () => hostInsert(el, container, anchor); 14331 const performLeave = () => { 14332 leave(el, () => { 14333 remove2(); 14334 afterLeave && afterLeave(); 14335 }); 14336 }; 14337 if (delayLeave) { 14338 delayLeave(el, remove2, performLeave); 14339 } else { 14340 performLeave(); 14341 } 14342 } 14343 } else { 14344 hostInsert(el, container, anchor); 14345 } 14346 }; 14347 const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { 14348 const { 14349 type, 14350 props, 14351 ref, 14352 children, 14353 dynamicChildren, 14354 shapeFlag, 14355 patchFlag, 14356 dirs 14357 } = vnode; 14358 if (ref != null) { 14359 setRef(ref, null, parentSuspense, vnode, true); 14360 } 14361 if (shapeFlag & 256) { 14362 parentComponent.ctx.deactivate(vnode); 14363 return; 14364 } 14365 const shouldInvokeDirs = shapeFlag & 1 && dirs; 14366 const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); 14367 let vnodeHook; 14368 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { 14369 invokeVNodeHook(vnodeHook, parentComponent, vnode); 14370 } 14371 if (shapeFlag & 6) { 14372 unmountComponent(vnode.component, parentSuspense, doRemove); 14373 } else { 14374 if (shapeFlag & 128) { 14375 vnode.suspense.unmount(parentSuspense, doRemove); 14376 return; 14377 } 14378 if (shouldInvokeDirs) { 14379 invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); 14380 } 14381 if (shapeFlag & 64) { 14382 vnode.type.remove( 14383 vnode, 14384 parentComponent, 14385 parentSuspense, 14386 optimized, 14387 internals, 14388 doRemove 14389 ); 14390 } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments 14391 (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { 14392 unmountChildren( 14393 dynamicChildren, 14394 parentComponent, 14395 parentSuspense, 14396 false, 14397 true 14398 ); 14399 } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { 14400 unmountChildren(children, parentComponent, parentSuspense); 14401 } 14402 if (doRemove) { 14403 remove(vnode); 14404 } 14405 } 14406 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { 14407 queuePostRenderEffect(() => { 14408 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 14409 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); 14410 }, parentSuspense); 14411 } 14412 }; 14413 const remove = (vnode) => { 14414 const { type, el, anchor, transition } = vnode; 14415 if (type === Fragment) { 14416 if ( true && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { 14417 vnode.children.forEach((child) => { 14418 if (child.type === Comment) { 14419 hostRemove(child.el); 14420 } else { 14421 remove(child); 14422 } 14423 }); 14424 } else { 14425 removeFragment(el, anchor); 14426 } 14427 return; 14428 } 14429 if (type === Static) { 14430 removeStaticNode(vnode); 14431 return; 14432 } 14433 const performRemove = () => { 14434 hostRemove(el); 14435 if (transition && !transition.persisted && transition.afterLeave) { 14436 transition.afterLeave(); 14437 } 14438 }; 14439 if (vnode.shapeFlag & 1 && transition && !transition.persisted) { 14440 const { leave, delayLeave } = transition; 14441 const performLeave = () => leave(el, performRemove); 14442 if (delayLeave) { 14443 delayLeave(vnode.el, performRemove, performLeave); 14444 } else { 14445 performLeave(); 14446 } 14447 } else { 14448 performRemove(); 14449 } 14450 }; 14451 const removeFragment = (cur, end) => { 14452 let next; 14453 while (cur !== end) { 14454 next = hostNextSibling(cur); 14455 hostRemove(cur); 14456 cur = next; 14457 } 14458 hostRemove(end); 14459 }; 14460 const unmountComponent = (instance, parentSuspense, doRemove) => { 14461 if ( true && instance.type.__hmrId) { 14462 unregisterHMR(instance); 14463 } 14464 const { bum, scope, update, subTree, um } = instance; 14465 if (bum) { 14466 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bum); 14467 } 14468 scope.stop(); 14469 if (update) { 14470 update.active = false; 14471 unmount(subTree, instance, parentSuspense, doRemove); 14472 } 14473 if (um) { 14474 queuePostRenderEffect(um, parentSuspense); 14475 } 14476 queuePostRenderEffect(() => { 14477 instance.isUnmounted = true; 14478 }, parentSuspense); 14479 if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { 14480 parentSuspense.deps--; 14481 if (parentSuspense.deps === 0) { 14482 parentSuspense.resolve(); 14483 } 14484 } 14485 if (true) { 14486 devtoolsComponentRemoved(instance); 14487 } 14488 }; 14489 const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { 14490 for (let i = start; i < children.length; i++) { 14491 unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); 14492 } 14493 }; 14494 const getNextHostNode = (vnode) => { 14495 if (vnode.shapeFlag & 6) { 14496 return getNextHostNode(vnode.component.subTree); 14497 } 14498 if (vnode.shapeFlag & 128) { 14499 return vnode.suspense.next(); 14500 } 14501 return hostNextSibling(vnode.anchor || vnode.el); 14502 }; 14503 const render = (vnode, container, namespace) => { 14504 if (vnode == null) { 14505 if (container._vnode) { 14506 unmount(container._vnode, null, null, true); 14507 } 14508 } else { 14509 patch( 14510 container._vnode || null, 14511 vnode, 14512 container, 14513 null, 14514 null, 14515 null, 14516 namespace 14517 ); 14518 } 14519 flushPreFlushCbs(); 14520 flushPostFlushCbs(); 14521 container._vnode = vnode; 14522 }; 14523 const internals = { 14524 p: patch, 14525 um: unmount, 14526 m: move, 14527 r: remove, 14528 mt: mountComponent, 14529 mc: mountChildren, 14530 pc: patchChildren, 14531 pbc: patchBlockChildren, 14532 n: getNextHostNode, 14533 o: options 14534 }; 14535 let hydrate; 14536 let hydrateNode; 14537 if (createHydrationFns) { 14538 [hydrate, hydrateNode] = createHydrationFns( 14539 internals 14540 ); 14541 } 14542 return { 14543 render, 14544 hydrate, 14545 createApp: createAppAPI(render, hydrate) 14546 }; 14547} 14548function resolveChildrenNamespace({ type, props }, currentNamespace) { 14549 return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; 14550} 14551function toggleRecurse({ effect, update }, allowed) { 14552 effect.allowRecurse = update.allowRecurse = allowed; 14553} 14554function needTransition(parentSuspense, transition) { 14555 return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; 14556} 14557function traverseStaticChildren(n1, n2, shallow = false) { 14558 const ch1 = n1.children; 14559 const ch2 = n2.children; 14560 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch1) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch2)) { 14561 for (let i = 0; i < ch1.length; i++) { 14562 const c1 = ch1[i]; 14563 let c2 = ch2[i]; 14564 if (c2.shapeFlag & 1 && !c2.dynamicChildren) { 14565 if (c2.patchFlag <= 0 || c2.patchFlag === 32) { 14566 c2 = ch2[i] = cloneIfMounted(ch2[i]); 14567 c2.el = c1.el; 14568 } 14569 if (!shallow) 14570 traverseStaticChildren(c1, c2); 14571 } 14572 if (c2.type === Text) { 14573 c2.el = c1.el; 14574 } 14575 if ( true && c2.type === Comment && !c2.el) { 14576 c2.el = c1.el; 14577 } 14578 } 14579 } 14580} 14581function getSequence(arr) { 14582 const p = arr.slice(); 14583 const result = [0]; 14584 let i, j, u, v, c; 14585 const len = arr.length; 14586 for (i = 0; i < len; i++) { 14587 const arrI = arr[i]; 14588 if (arrI !== 0) { 14589 j = result[result.length - 1]; 14590 if (arr[j] < arrI) { 14591 p[i] = j; 14592 result.push(i); 14593 continue; 14594 } 14595 u = 0; 14596 v = result.length - 1; 14597 while (u < v) { 14598 c = u + v >> 1; 14599 if (arr[result[c]] < arrI) { 14600 u = c + 1; 14601 } else { 14602 v = c; 14603 } 14604 } 14605 if (arrI < arr[result[u]]) { 14606 if (u > 0) { 14607 p[i] = result[u - 1]; 14608 } 14609 result[u] = i; 14610 } 14611 } 14612 } 14613 u = result.length; 14614 v = result[u - 1]; 14615 while (u-- > 0) { 14616 result[u] = v; 14617 v = p[v]; 14618 } 14619 return result; 14620} 14621function locateNonHydratedAsyncRoot(instance) { 14622 const subComponent = instance.subTree.component; 14623 if (subComponent) { 14624 if (subComponent.asyncDep && !subComponent.asyncResolved) { 14625 return subComponent; 14626 } else { 14627 return locateNonHydratedAsyncRoot(subComponent); 14628 } 14629 } 14630} 14631 14632const isTeleport = (type) => type.__isTeleport; 14633const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); 14634const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; 14635const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; 14636const resolveTarget = (props, select) => { 14637 const targetSelector = props && props.to; 14638 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(targetSelector)) { 14639 if (!select) { 14640 true && warn$1( 14641 `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` 14642 ); 14643 return null; 14644 } else { 14645 const target = select(targetSelector); 14646 if (!target) { 14647 true && warn$1( 14648 `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` 14649 ); 14650 } 14651 return target; 14652 } 14653 } else { 14654 if ( true && !targetSelector && !isTeleportDisabled(props)) { 14655 warn$1(`Invalid Teleport target: ${targetSelector}`); 14656 } 14657 return targetSelector; 14658 } 14659}; 14660const TeleportImpl = { 14661 name: "Teleport", 14662 __isTeleport: true, 14663 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { 14664 const { 14665 mc: mountChildren, 14666 pc: patchChildren, 14667 pbc: patchBlockChildren, 14668 o: { insert, querySelector, createText, createComment } 14669 } = internals; 14670 const disabled = isTeleportDisabled(n2.props); 14671 let { shapeFlag, children, dynamicChildren } = n2; 14672 if ( true && isHmrUpdating) { 14673 optimized = false; 14674 dynamicChildren = null; 14675 } 14676 if (n1 == null) { 14677 const placeholder = n2.el = true ? createComment("teleport start") : 0; 14678 const mainAnchor = n2.anchor = true ? createComment("teleport end") : 0; 14679 insert(placeholder, container, anchor); 14680 insert(mainAnchor, container, anchor); 14681 const target = n2.target = resolveTarget(n2.props, querySelector); 14682 const targetAnchor = n2.targetAnchor = createText(""); 14683 if (target) { 14684 insert(targetAnchor, target); 14685 if (namespace === "svg" || isTargetSVG(target)) { 14686 namespace = "svg"; 14687 } else if (namespace === "mathml" || isTargetMathML(target)) { 14688 namespace = "mathml"; 14689 } 14690 } else if ( true && !disabled) { 14691 warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`); 14692 } 14693 const mount = (container2, anchor2) => { 14694 if (shapeFlag & 16) { 14695 mountChildren( 14696 children, 14697 container2, 14698 anchor2, 14699 parentComponent, 14700 parentSuspense, 14701 namespace, 14702 slotScopeIds, 14703 optimized 14704 ); 14705 } 14706 }; 14707 if (disabled) { 14708 mount(container, mainAnchor); 14709 } else if (target) { 14710 mount(target, targetAnchor); 14711 } 14712 } else { 14713 n2.el = n1.el; 14714 const mainAnchor = n2.anchor = n1.anchor; 14715 const target = n2.target = n1.target; 14716 const targetAnchor = n2.targetAnchor = n1.targetAnchor; 14717 const wasDisabled = isTeleportDisabled(n1.props); 14718 const currentContainer = wasDisabled ? container : target; 14719 const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; 14720 if (namespace === "svg" || isTargetSVG(target)) { 14721 namespace = "svg"; 14722 } else if (namespace === "mathml" || isTargetMathML(target)) { 14723 namespace = "mathml"; 14724 } 14725 if (dynamicChildren) { 14726 patchBlockChildren( 14727 n1.dynamicChildren, 14728 dynamicChildren, 14729 currentContainer, 14730 parentComponent, 14731 parentSuspense, 14732 namespace, 14733 slotScopeIds 14734 ); 14735 traverseStaticChildren(n1, n2, true); 14736 } else if (!optimized) { 14737 patchChildren( 14738 n1, 14739 n2, 14740 currentContainer, 14741 currentAnchor, 14742 parentComponent, 14743 parentSuspense, 14744 namespace, 14745 slotScopeIds, 14746 false 14747 ); 14748 } 14749 if (disabled) { 14750 if (!wasDisabled) { 14751 moveTeleport( 14752 n2, 14753 container, 14754 mainAnchor, 14755 internals, 14756 1 14757 ); 14758 } else { 14759 if (n2.props && n1.props && n2.props.to !== n1.props.to) { 14760 n2.props.to = n1.props.to; 14761 } 14762 } 14763 } else { 14764 if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { 14765 const nextTarget = n2.target = resolveTarget( 14766 n2.props, 14767 querySelector 14768 ); 14769 if (nextTarget) { 14770 moveTeleport( 14771 n2, 14772 nextTarget, 14773 null, 14774 internals, 14775 0 14776 ); 14777 } else if (true) { 14778 warn$1( 14779 "Invalid Teleport target on update:", 14780 target, 14781 `(${typeof target})` 14782 ); 14783 } 14784 } else if (wasDisabled) { 14785 moveTeleport( 14786 n2, 14787 target, 14788 targetAnchor, 14789 internals, 14790 1 14791 ); 14792 } 14793 } 14794 } 14795 updateCssVars(n2); 14796 }, 14797 remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) { 14798 const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode; 14799 if (target) { 14800 hostRemove(targetAnchor); 14801 } 14802 doRemove && hostRemove(anchor); 14803 if (shapeFlag & 16) { 14804 const shouldRemove = doRemove || !isTeleportDisabled(props); 14805 for (let i = 0; i < children.length; i++) { 14806 const child = children[i]; 14807 unmount( 14808 child, 14809 parentComponent, 14810 parentSuspense, 14811 shouldRemove, 14812 !!child.dynamicChildren 14813 ); 14814 } 14815 } 14816 }, 14817 move: moveTeleport, 14818 hydrate: hydrateTeleport 14819}; 14820function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { 14821 if (moveType === 0) { 14822 insert(vnode.targetAnchor, container, parentAnchor); 14823 } 14824 const { el, anchor, shapeFlag, children, props } = vnode; 14825 const isReorder = moveType === 2; 14826 if (isReorder) { 14827 insert(el, container, parentAnchor); 14828 } 14829 if (!isReorder || isTeleportDisabled(props)) { 14830 if (shapeFlag & 16) { 14831 for (let i = 0; i < children.length; i++) { 14832 move( 14833 children[i], 14834 container, 14835 parentAnchor, 14836 2 14837 ); 14838 } 14839 } 14840 } 14841 if (isReorder) { 14842 insert(anchor, container, parentAnchor); 14843 } 14844} 14845function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { 14846 o: { nextSibling, parentNode, querySelector } 14847}, hydrateChildren) { 14848 const target = vnode.target = resolveTarget( 14849 vnode.props, 14850 querySelector 14851 ); 14852 if (target) { 14853 const targetNode = target._lpa || target.firstChild; 14854 if (vnode.shapeFlag & 16) { 14855 if (isTeleportDisabled(vnode.props)) { 14856 vnode.anchor = hydrateChildren( 14857 nextSibling(node), 14858 vnode, 14859 parentNode(node), 14860 parentComponent, 14861 parentSuspense, 14862 slotScopeIds, 14863 optimized 14864 ); 14865 vnode.targetAnchor = targetNode; 14866 } else { 14867 vnode.anchor = nextSibling(node); 14868 let targetAnchor = targetNode; 14869 while (targetAnchor) { 14870 targetAnchor = nextSibling(targetAnchor); 14871 if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") { 14872 vnode.targetAnchor = targetAnchor; 14873 target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); 14874 break; 14875 } 14876 } 14877 hydrateChildren( 14878 targetNode, 14879 vnode, 14880 target, 14881 parentComponent, 14882 parentSuspense, 14883 slotScopeIds, 14884 optimized 14885 ); 14886 } 14887 } 14888 updateCssVars(vnode); 14889 } 14890 return vnode.anchor && nextSibling(vnode.anchor); 14891} 14892const Teleport = TeleportImpl; 14893function updateCssVars(vnode) { 14894 const ctx = vnode.ctx; 14895 if (ctx && ctx.ut) { 14896 let node = vnode.children[0].el; 14897 while (node && node !== vnode.targetAnchor) { 14898 if (node.nodeType === 1) 14899 node.setAttribute("data-v-owner", ctx.uid); 14900 node = node.nextSibling; 14901 } 14902 ctx.ut(); 14903 } 14904} 14905 14906const Fragment = Symbol.for("v-fgt"); 14907const Text = Symbol.for("v-txt"); 14908const Comment = Symbol.for("v-cmt"); 14909const Static = Symbol.for("v-stc"); 14910const blockStack = []; 14911let currentBlock = null; 14912function openBlock(disableTracking = false) { 14913 blockStack.push(currentBlock = disableTracking ? null : []); 14914} 14915function closeBlock() { 14916 blockStack.pop(); 14917 currentBlock = blockStack[blockStack.length - 1] || null; 14918} 14919let isBlockTreeEnabled = 1; 14920function setBlockTracking(value) { 14921 isBlockTreeEnabled += value; 14922} 14923function setupBlock(vnode) { 14924 vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR : null; 14925 closeBlock(); 14926 if (isBlockTreeEnabled > 0 && currentBlock) { 14927 currentBlock.push(vnode); 14928 } 14929 return vnode; 14930} 14931function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { 14932 return setupBlock( 14933 createBaseVNode( 14934 type, 14935 props, 14936 children, 14937 patchFlag, 14938 dynamicProps, 14939 shapeFlag, 14940 true 14941 ) 14942 ); 14943} 14944function createBlock(type, props, children, patchFlag, dynamicProps) { 14945 return setupBlock( 14946 createVNode( 14947 type, 14948 props, 14949 children, 14950 patchFlag, 14951 dynamicProps, 14952 true 14953 ) 14954 ); 14955} 14956function isVNode(value) { 14957 return value ? value.__v_isVNode === true : false; 14958} 14959function isSameVNodeType(n1, n2) { 14960 if ( true && n2.shapeFlag & 6 && hmrDirtyComponents.has(n2.type)) { 14961 n1.shapeFlag &= ~256; 14962 n2.shapeFlag &= ~512; 14963 return false; 14964 } 14965 return n1.type === n2.type && n1.key === n2.key; 14966} 14967let vnodeArgsTransformer; 14968function transformVNodeArgs(transformer) { 14969 vnodeArgsTransformer = transformer; 14970} 14971const createVNodeWithArgsTransform = (...args) => { 14972 return _createVNode( 14973 ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args 14974 ); 14975}; 14976const InternalObjectKey = `__vInternal`; 14977const normalizeKey = ({ key }) => key != null ? key : null; 14978const normalizeRef = ({ 14979 ref, 14980 ref_key, 14981 ref_for 14982}) => { 14983 if (typeof ref === "number") { 14984 ref = "" + ref; 14985 } 14986 return ref != null ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(ref) || (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(ref) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; 14987}; 14988function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { 14989 const vnode = { 14990 __v_isVNode: true, 14991 __v_skip: true, 14992 type, 14993 props, 14994 key: props && normalizeKey(props), 14995 ref: props && normalizeRef(props), 14996 scopeId: currentScopeId, 14997 slotScopeIds: null, 14998 children, 14999 component: null, 15000 suspense: null, 15001 ssContent: null, 15002 ssFallback: null, 15003 dirs: null, 15004 transition: null, 15005 el: null, 15006 anchor: null, 15007 target: null, 15008 targetAnchor: null, 15009 staticCount: 0, 15010 shapeFlag, 15011 patchFlag, 15012 dynamicProps, 15013 dynamicChildren: null, 15014 appContext: null, 15015 ctx: currentRenderingInstance 15016 }; 15017 if (needFullChildrenNormalization) { 15018 normalizeChildren(vnode, children); 15019 if (shapeFlag & 128) { 15020 type.normalize(vnode); 15021 } 15022 } else if (children) { 15023 vnode.shapeFlag |= (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(children) ? 8 : 16; 15024 } 15025 if ( true && vnode.key !== vnode.key) { 15026 warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); 15027 } 15028 if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself 15029 !isBlockNode && // has current parent block 15030 currentBlock && // presence of a patch flag indicates this node needs patching on updates. 15031 // component nodes also should always be patched, because even if the 15032 // component doesn't need to update, it needs to persist the instance on to 15033 // the next vnode so that it can be properly unmounted later. 15034 (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the 15035 // vnode should not be considered dynamic due to handler caching. 15036 vnode.patchFlag !== 32) { 15037 currentBlock.push(vnode); 15038 } 15039 return vnode; 15040} 15041const createVNode = true ? createVNodeWithArgsTransform : 0; 15042function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { 15043 if (!type || type === NULL_DYNAMIC_COMPONENT) { 15044 if ( true && !type) { 15045 warn$1(`Invalid vnode type when creating vnode: ${type}.`); 15046 } 15047 type = Comment; 15048 } 15049 if (isVNode(type)) { 15050 const cloned = cloneVNode( 15051 type, 15052 props, 15053 true 15054 /* mergeRef: true */ 15055 ); 15056 if (children) { 15057 normalizeChildren(cloned, children); 15058 } 15059 if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { 15060 if (cloned.shapeFlag & 6) { 15061 currentBlock[currentBlock.indexOf(type)] = cloned; 15062 } else { 15063 currentBlock.push(cloned); 15064 } 15065 } 15066 cloned.patchFlag |= -2; 15067 return cloned; 15068 } 15069 if (isClassComponent(type)) { 15070 type = type.__vccOpts; 15071 } 15072 if (props) { 15073 props = guardReactiveProps(props); 15074 let { class: klass, style } = props; 15075 if (klass && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(klass)) { 15076 props.class = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass)(klass); 15077 } 15078 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(style)) { 15079 if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(style) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(style)) { 15080 style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, style); 15081 } 15082 props.style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle)(style); 15083 } 15084 } 15085 const shapeFlag = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(type) ? 4 : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(type) ? 2 : 0; 15086 if ( true && shapeFlag & 4 && (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(type)) { 15087 type = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(type); 15088 warn$1( 15089 `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, 15090 ` 15091Component that was made reactive: `, 15092 type 15093 ); 15094 } 15095 return createBaseVNode( 15096 type, 15097 props, 15098 children, 15099 patchFlag, 15100 dynamicProps, 15101 shapeFlag, 15102 isBlockNode, 15103 true 15104 ); 15105} 15106function guardReactiveProps(props) { 15107 if (!props) 15108 return null; 15109 return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(props) || InternalObjectKey in props ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, props) : props; 15110} 15111function cloneVNode(vnode, extraProps, mergeRef = false) { 15112 const { props, ref, patchFlag, children } = vnode; 15113 const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; 15114 const cloned = { 15115 __v_isVNode: true, 15116 __v_skip: true, 15117 type: vnode.type, 15118 props: mergedProps, 15119 key: mergedProps && normalizeKey(mergedProps), 15120 ref: extraProps && extraProps.ref ? ( 15121 // #2078 in the case of <component :is="vnode" ref="extra"/> 15122 // if the vnode itself already has a ref, cloneVNode will need to merge 15123 // the refs so the single vnode can be set on multiple refs 15124 mergeRef && ref ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) 15125 ) : ref, 15126 scopeId: vnode.scopeId, 15127 slotScopeIds: vnode.slotScopeIds, 15128 children: true && patchFlag === -1 && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(children) ? children.map(deepCloneVNode) : children, 15129 target: vnode.target, 15130 targetAnchor: vnode.targetAnchor, 15131 staticCount: vnode.staticCount, 15132 shapeFlag: vnode.shapeFlag, 15133 // if the vnode is cloned with extra props, we can no longer assume its 15134 // existing patch flag to be reliable and need to add the FULL_PROPS flag. 15135 // note: preserve flag for fragments since they use the flag for children 15136 // fast paths only. 15137 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, 15138 dynamicProps: vnode.dynamicProps, 15139 dynamicChildren: vnode.dynamicChildren, 15140 appContext: vnode.appContext, 15141 dirs: vnode.dirs, 15142 transition: vnode.transition, 15143 // These should technically only be non-null on mounted VNodes. However, 15144 // they *should* be copied for kept-alive vnodes. So we just always copy 15145 // them since them being non-null during a mount doesn't affect the logic as 15146 // they will simply be overwritten. 15147 component: vnode.component, 15148 suspense: vnode.suspense, 15149 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), 15150 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), 15151 el: vnode.el, 15152 anchor: vnode.anchor, 15153 ctx: vnode.ctx, 15154 ce: vnode.ce 15155 }; 15156 return cloned; 15157} 15158function deepCloneVNode(vnode) { 15159 const cloned = cloneVNode(vnode); 15160 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) { 15161 cloned.children = vnode.children.map(deepCloneVNode); 15162 } 15163 return cloned; 15164} 15165function createTextVNode(text = " ", flag = 0) { 15166 return createVNode(Text, null, text, flag); 15167} 15168function createStaticVNode(content, numberOfNodes) { 15169 const vnode = createVNode(Static, null, content); 15170 vnode.staticCount = numberOfNodes; 15171 return vnode; 15172} 15173function createCommentVNode(text = "", asBlock = false) { 15174 return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); 15175} 15176function normalizeVNode(child) { 15177 if (child == null || typeof child === "boolean") { 15178 return createVNode(Comment); 15179 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(child)) { 15180 return createVNode( 15181 Fragment, 15182 null, 15183 // #3666, avoid reference pollution when reusing vnode 15184 child.slice() 15185 ); 15186 } else if (typeof child === "object") { 15187 return cloneIfMounted(child); 15188 } else { 15189 return createVNode(Text, null, String(child)); 15190 } 15191} 15192function cloneIfMounted(child) { 15193 return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); 15194} 15195function normalizeChildren(vnode, children) { 15196 let type = 0; 15197 const { shapeFlag } = vnode; 15198 if (children == null) { 15199 children = null; 15200 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(children)) { 15201 type = 16; 15202 } else if (typeof children === "object") { 15203 if (shapeFlag & (1 | 64)) { 15204 const slot = children.default; 15205 if (slot) { 15206 slot._c && (slot._d = false); 15207 normalizeChildren(vnode, slot()); 15208 slot._c && (slot._d = true); 15209 } 15210 return; 15211 } else { 15212 type = 32; 15213 const slotFlag = children._; 15214 if (!slotFlag && !(InternalObjectKey in children)) { 15215 children._ctx = currentRenderingInstance; 15216 } else if (slotFlag === 3 && currentRenderingInstance) { 15217 if (currentRenderingInstance.slots._ === 1) { 15218 children._ = 1; 15219 } else { 15220 children._ = 2; 15221 vnode.patchFlag |= 1024; 15222 } 15223 } 15224 } 15225 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(children)) { 15226 children = { default: children, _ctx: currentRenderingInstance }; 15227 type = 32; 15228 } else { 15229 children = String(children); 15230 if (shapeFlag & 64) { 15231 type = 16; 15232 children = [createTextVNode(children)]; 15233 } else { 15234 type = 8; 15235 } 15236 } 15237 vnode.children = children; 15238 vnode.shapeFlag |= type; 15239} 15240function mergeProps(...args) { 15241 const ret = {}; 15242 for (let i = 0; i < args.length; i++) { 15243 const toMerge = args[i]; 15244 for (const key in toMerge) { 15245 if (key === "class") { 15246 if (ret.class !== toMerge.class) { 15247 ret.class = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass)([ret.class, toMerge.class]); 15248 } 15249 } else if (key === "style") { 15250 ret.style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle)([ret.style, toMerge.style]); 15251 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { 15252 const existing = ret[key]; 15253 const incoming = toMerge[key]; 15254 if (incoming && existing !== incoming && !((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing) && existing.includes(incoming))) { 15255 ret[key] = existing ? [].concat(existing, incoming) : incoming; 15256 } 15257 } else if (key !== "") { 15258 ret[key] = toMerge[key]; 15259 } 15260 } 15261 } 15262 return ret; 15263} 15264function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { 15265 callWithAsyncErrorHandling(hook, instance, 7, [ 15266 vnode, 15267 prevVNode 15268 ]); 15269} 15270 15271const emptyAppContext = createAppContext(); 15272let uid = 0; 15273function createComponentInstance(vnode, parent, suspense) { 15274 const type = vnode.type; 15275 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; 15276 const instance = { 15277 uid: uid++, 15278 vnode, 15279 type, 15280 parent, 15281 appContext, 15282 root: null, 15283 // to be immediately set 15284 next: null, 15285 subTree: null, 15286 // will be set synchronously right after creation 15287 effect: null, 15288 update: null, 15289 // will be set synchronously right after creation 15290 scope: new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.EffectScope( 15291 true 15292 /* detached */ 15293 ), 15294 render: null, 15295 proxy: null, 15296 exposed: null, 15297 exposeProxy: null, 15298 withProxy: null, 15299 provides: parent ? parent.provides : Object.create(appContext.provides), 15300 accessCache: null, 15301 renderCache: [], 15302 // local resolved assets 15303 components: null, 15304 directives: null, 15305 // resolved props and emits options 15306 propsOptions: normalizePropsOptions(type, appContext), 15307 emitsOptions: normalizeEmitsOptions(type, appContext), 15308 // emit 15309 emit: null, 15310 // to be set immediately 15311 emitted: null, 15312 // props default value 15313 propsDefaults: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, 15314 // inheritAttrs 15315 inheritAttrs: type.inheritAttrs, 15316 // state 15317 ctx: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, 15318 data: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, 15319 props: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, 15320 attrs: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, 15321 slots: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, 15322 refs: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, 15323 setupState: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, 15324 setupContext: null, 15325 attrsProxy: null, 15326 slotsProxy: null, 15327 // suspense related 15328 suspense, 15329 suspenseId: suspense ? suspense.pendingId : 0, 15330 asyncDep: null, 15331 asyncResolved: false, 15332 // lifecycle hooks 15333 // not using enums here because it results in computed properties 15334 isMounted: false, 15335 isUnmounted: false, 15336 isDeactivated: false, 15337 bc: null, 15338 c: null, 15339 bm: null, 15340 m: null, 15341 bu: null, 15342 u: null, 15343 um: null, 15344 bum: null, 15345 da: null, 15346 a: null, 15347 rtg: null, 15348 rtc: null, 15349 ec: null, 15350 sp: null 15351 }; 15352 if (true) { 15353 instance.ctx = createDevRenderContext(instance); 15354 } else {} 15355 instance.root = parent ? parent.root : instance; 15356 instance.emit = emit.bind(null, instance); 15357 if (vnode.ce) { 15358 vnode.ce(instance); 15359 } 15360 return instance; 15361} 15362let currentInstance = null; 15363const getCurrentInstance = () => currentInstance || currentRenderingInstance; 15364let internalSetCurrentInstance; 15365let setInSSRSetupState; 15366{ 15367 const g = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)(); 15368 const registerGlobalSetter = (key, setter) => { 15369 let setters; 15370 if (!(setters = g[key])) 15371 setters = g[key] = []; 15372 setters.push(setter); 15373 return (v) => { 15374 if (setters.length > 1) 15375 setters.forEach((set) => set(v)); 15376 else 15377 setters[0](v); 15378 }; 15379 }; 15380 internalSetCurrentInstance = registerGlobalSetter( 15381 `__VUE_INSTANCE_SETTERS__`, 15382 (v) => currentInstance = v 15383 ); 15384 setInSSRSetupState = registerGlobalSetter( 15385 `__VUE_SSR_SETTERS__`, 15386 (v) => isInSSRComponentSetup = v 15387 ); 15388} 15389const setCurrentInstance = (instance) => { 15390 internalSetCurrentInstance(instance); 15391 instance.scope.on(); 15392}; 15393const unsetCurrentInstance = () => { 15394 currentInstance && currentInstance.scope.off(); 15395 internalSetCurrentInstance(null); 15396}; 15397const isBuiltInTag = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)("slot,component"); 15398function validateComponentName(name, config) { 15399 const appIsNativeTag = config.isNativeTag || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NO; 15400 if (isBuiltInTag(name) || appIsNativeTag(name)) { 15401 warn$1( 15402 "Do not use built-in or reserved HTML elements as component id: " + name 15403 ); 15404 } 15405} 15406function isStatefulComponent(instance) { 15407 return instance.vnode.shapeFlag & 4; 15408} 15409let isInSSRComponentSetup = false; 15410function setupComponent(instance, isSSR = false) { 15411 isSSR && setInSSRSetupState(isSSR); 15412 const { props, children } = instance.vnode; 15413 const isStateful = isStatefulComponent(instance); 15414 initProps(instance, props, isStateful, isSSR); 15415 initSlots(instance, children); 15416 const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; 15417 isSSR && setInSSRSetupState(false); 15418 return setupResult; 15419} 15420function setupStatefulComponent(instance, isSSR) { 15421 var _a; 15422 const Component = instance.type; 15423 if (true) { 15424 if (Component.name) { 15425 validateComponentName(Component.name, instance.appContext.config); 15426 } 15427 if (Component.components) { 15428 const names = Object.keys(Component.components); 15429 for (let i = 0; i < names.length; i++) { 15430 validateComponentName(names[i], instance.appContext.config); 15431 } 15432 } 15433 if (Component.directives) { 15434 const names = Object.keys(Component.directives); 15435 for (let i = 0; i < names.length; i++) { 15436 validateDirectiveName(names[i]); 15437 } 15438 } 15439 if (Component.compilerOptions && isRuntimeOnly()) { 15440 warn$1( 15441 `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` 15442 ); 15443 } 15444 } 15445 instance.accessCache = /* @__PURE__ */ Object.create(null); 15446 instance.proxy = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw)(new Proxy(instance.ctx, PublicInstanceProxyHandlers)); 15447 if (true) { 15448 exposePropsOnRenderContext(instance); 15449 } 15450 const { setup } = Component; 15451 if (setup) { 15452 const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; 15453 setCurrentInstance(instance); 15454 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); 15455 const setupResult = callWithErrorHandling( 15456 setup, 15457 instance, 15458 0, 15459 [ 15460 true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(instance.props) : 0, 15461 setupContext 15462 ] 15463 ); 15464 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); 15465 unsetCurrentInstance(); 15466 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(setupResult)) { 15467 setupResult.then(unsetCurrentInstance, unsetCurrentInstance); 15468 if (isSSR) { 15469 return setupResult.then((resolvedResult) => { 15470 handleSetupResult(instance, resolvedResult, isSSR); 15471 }).catch((e) => { 15472 handleError(e, instance, 0); 15473 }); 15474 } else { 15475 instance.asyncDep = setupResult; 15476 if ( true && !instance.suspense) { 15477 const name = (_a = Component.name) != null ? _a : "Anonymous"; 15478 warn$1( 15479 `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` 15480 ); 15481 } 15482 } 15483 } else { 15484 handleSetupResult(instance, setupResult, isSSR); 15485 } 15486 } else { 15487 finishComponentSetup(instance, isSSR); 15488 } 15489} 15490function handleSetupResult(instance, setupResult, isSSR) { 15491 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(setupResult)) { 15492 if (instance.type.__ssrInlineRender) { 15493 instance.ssrRender = setupResult; 15494 } else { 15495 instance.render = setupResult; 15496 } 15497 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(setupResult)) { 15498 if ( true && isVNode(setupResult)) { 15499 warn$1( 15500 `setup() should not return VNodes directly - return a render function instead.` 15501 ); 15502 } 15503 if (true) { 15504 instance.devtoolsRawSetupState = setupResult; 15505 } 15506 instance.setupState = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs)(setupResult); 15507 if (true) { 15508 exposeSetupStateOnRenderContext(instance); 15509 } 15510 } else if ( true && setupResult !== void 0) { 15511 warn$1( 15512 `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` 15513 ); 15514 } 15515 finishComponentSetup(instance, isSSR); 15516} 15517let compile; 15518let installWithProxy; 15519function registerRuntimeCompiler(_compile) { 15520 compile = _compile; 15521 installWithProxy = (i) => { 15522 if (i.render._rc) { 15523 i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); 15524 } 15525 }; 15526} 15527const isRuntimeOnly = () => !compile; 15528function finishComponentSetup(instance, isSSR, skipOptions) { 15529 const Component = instance.type; 15530 if (!instance.render) { 15531 if (!isSSR && compile && !Component.render) { 15532 const template = Component.template || resolveMergedOptions(instance).template; 15533 if (template) { 15534 if (true) { 15535 startMeasure(instance, `compile`); 15536 } 15537 const { isCustomElement, compilerOptions } = instance.appContext.config; 15538 const { delimiters, compilerOptions: componentCompilerOptions } = Component; 15539 const finalCompilerOptions = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( 15540 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( 15541 { 15542 isCustomElement, 15543 delimiters 15544 }, 15545 compilerOptions 15546 ), 15547 componentCompilerOptions 15548 ); 15549 Component.render = compile(template, finalCompilerOptions); 15550 if (true) { 15551 endMeasure(instance, `compile`); 15552 } 15553 } 15554 } 15555 instance.render = Component.render || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; 15556 if (installWithProxy) { 15557 installWithProxy(instance); 15558 } 15559 } 15560 if (true) { 15561 setCurrentInstance(instance); 15562 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); 15563 try { 15564 applyOptions(instance); 15565 } finally { 15566 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); 15567 unsetCurrentInstance(); 15568 } 15569 } 15570 if ( true && !Component.render && instance.render === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP && !isSSR) { 15571 if (!compile && Component.template) { 15572 warn$1( 15573 `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` ) 15574 ); 15575 } else { 15576 warn$1(`Component is missing template or render function.`); 15577 } 15578 } 15579} 15580function getAttrsProxy(instance) { 15581 return instance.attrsProxy || (instance.attrsProxy = new Proxy( 15582 instance.attrs, 15583 true ? { 15584 get(target, key) { 15585 markAttrsAccessed(); 15586 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", "$attrs"); 15587 return target[key]; 15588 }, 15589 set() { 15590 warn$1(`setupContext.attrs is readonly.`); 15591 return false; 15592 }, 15593 deleteProperty() { 15594 warn$1(`setupContext.attrs is readonly.`); 15595 return false; 15596 } 15597 } : 0 15598 )); 15599} 15600function getSlotsProxy(instance) { 15601 return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, { 15602 get(target, key) { 15603 (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", "$slots"); 15604 return target[key]; 15605 } 15606 })); 15607} 15608function createSetupContext(instance) { 15609 const expose = (exposed) => { 15610 if (true) { 15611 if (instance.exposed) { 15612 warn$1(`expose() should be called only once per setup().`); 15613 } 15614 if (exposed != null) { 15615 let exposedType = typeof exposed; 15616 if (exposedType === "object") { 15617 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(exposed)) { 15618 exposedType = "array"; 15619 } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(exposed)) { 15620 exposedType = "ref"; 15621 } 15622 } 15623 if (exposedType !== "object") { 15624 warn$1( 15625 `expose() should be passed a plain object, received ${exposedType}.` 15626 ); 15627 } 15628 } 15629 } 15630 instance.exposed = exposed || {}; 15631 }; 15632 if (true) { 15633 return Object.freeze({ 15634 get attrs() { 15635 return getAttrsProxy(instance); 15636 }, 15637 get slots() { 15638 return getSlotsProxy(instance); 15639 }, 15640 get emit() { 15641 return (event, ...args) => instance.emit(event, ...args); 15642 }, 15643 expose 15644 }); 15645 } else {} 15646} 15647function getExposeProxy(instance) { 15648 if (instance.exposed) { 15649 return instance.exposeProxy || (instance.exposeProxy = new Proxy((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs)((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw)(instance.exposed)), { 15650 get(target, key) { 15651 if (key in target) { 15652 return target[key]; 15653 } else if (key in publicPropertiesMap) { 15654 return publicPropertiesMap[key](instance); 15655 } 15656 }, 15657 has(target, key) { 15658 return key in target || key in publicPropertiesMap; 15659 } 15660 })); 15661 } 15662} 15663const classifyRE = /(?:^|[-_])(\w)/g; 15664const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); 15665function getComponentName(Component, includeInferred = true) { 15666 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; 15667} 15668function formatComponentName(instance, Component, isRoot = false) { 15669 let name = getComponentName(Component); 15670 if (!name && Component.__file) { 15671 const match = Component.__file.match(/([^/\\]+)\.\w+$/); 15672 if (match) { 15673 name = match[1]; 15674 } 15675 } 15676 if (!name && instance && instance.parent) { 15677 const inferFromRegistry = (registry) => { 15678 for (const key in registry) { 15679 if (registry[key] === Component) { 15680 return key; 15681 } 15682 } 15683 }; 15684 name = inferFromRegistry( 15685 instance.components || instance.parent.type.components 15686 ) || inferFromRegistry(instance.appContext.components); 15687 } 15688 return name ? classify(name) : isRoot ? `App` : `Anonymous`; 15689} 15690function isClassComponent(value) { 15691 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value) && "__vccOpts" in value; 15692} 15693 15694const computed = (getterOrOptions, debugOptions) => { 15695 return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.computed)(getterOrOptions, debugOptions, isInSSRComponentSetup); 15696}; 15697 15698function h(type, propsOrChildren, children) { 15699 const l = arguments.length; 15700 if (l === 2) { 15701 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(propsOrChildren) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(propsOrChildren)) { 15702 if (isVNode(propsOrChildren)) { 15703 return createVNode(type, null, [propsOrChildren]); 15704 } 15705 return createVNode(type, propsOrChildren); 15706 } else { 15707 return createVNode(type, null, propsOrChildren); 15708 } 15709 } else { 15710 if (l > 3) { 15711 children = Array.prototype.slice.call(arguments, 2); 15712 } else if (l === 3 && isVNode(children)) { 15713 children = [children]; 15714 } 15715 return createVNode(type, propsOrChildren, children); 15716 } 15717} 15718 15719function isShallow(value) { 15720 return !!(value && value["__v_isShallow"]); 15721} 15722 15723function initCustomFormatter() { 15724 if ( false || typeof window === "undefined") { 15725 return; 15726 } 15727 const vueStyle = { style: "color:#3ba776" }; 15728 const numberStyle = { style: "color:#1677ff" }; 15729 const stringStyle = { style: "color:#f5222d" }; 15730 const keywordStyle = { style: "color:#eb2f96" }; 15731 const formatter = { 15732 header(obj) { 15733 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(obj)) { 15734 return null; 15735 } 15736 if (obj.__isVue) { 15737 return ["div", vueStyle, `VueInstance`]; 15738 } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(obj)) { 15739 return [ 15740 "div", 15741 {}, 15742 ["span", vueStyle, genRefFlag(obj)], 15743 "<", 15744 formatValue(obj.value), 15745 `>` 15746 ]; 15747 } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(obj)) { 15748 return [ 15749 "div", 15750 {}, 15751 ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], 15752 "<", 15753 formatValue(obj), 15754 `>${(0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly)(obj) ? ` (readonly)` : ``}` 15755 ]; 15756 } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly)(obj)) { 15757 return [ 15758 "div", 15759 {}, 15760 ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], 15761 "<", 15762 formatValue(obj), 15763 ">" 15764 ]; 15765 } 15766 return null; 15767 }, 15768 hasBody(obj) { 15769 return obj && obj.__isVue; 15770 }, 15771 body(obj) { 15772 if (obj && obj.__isVue) { 15773 return [ 15774 "div", 15775 {}, 15776 ...formatInstance(obj.$) 15777 ]; 15778 } 15779 } 15780 }; 15781 function formatInstance(instance) { 15782 const blocks = []; 15783 if (instance.type.props && instance.props) { 15784 blocks.push(createInstanceBlock("props", (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(instance.props))); 15785 } 15786 if (instance.setupState !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { 15787 blocks.push(createInstanceBlock("setup", instance.setupState)); 15788 } 15789 if (instance.data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { 15790 blocks.push(createInstanceBlock("data", (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(instance.data))); 15791 } 15792 const computed = extractKeys(instance, "computed"); 15793 if (computed) { 15794 blocks.push(createInstanceBlock("computed", computed)); 15795 } 15796 const injected = extractKeys(instance, "inject"); 15797 if (injected) { 15798 blocks.push(createInstanceBlock("injected", injected)); 15799 } 15800 blocks.push([ 15801 "div", 15802 {}, 15803 [ 15804 "span", 15805 { 15806 style: keywordStyle.style + ";opacity:0.66" 15807 }, 15808 "$ (internal): " 15809 ], 15810 ["object", { object: instance }] 15811 ]); 15812 return blocks; 15813 } 15814 function createInstanceBlock(type, target) { 15815 target = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, target); 15816 if (!Object.keys(target).length) { 15817 return ["span", {}]; 15818 } 15819 return [ 15820 "div", 15821 { style: "line-height:1.25em;margin-bottom:0.6em" }, 15822 [ 15823 "div", 15824 { 15825 style: "color:#476582" 15826 }, 15827 type 15828 ], 15829 [ 15830 "div", 15831 { 15832 style: "padding-left:1.25em" 15833 }, 15834 ...Object.keys(target).map((key) => { 15835 return [ 15836 "div", 15837 {}, 15838 ["span", keywordStyle, key + ": "], 15839 formatValue(target[key], false) 15840 ]; 15841 }) 15842 ] 15843 ]; 15844 } 15845 function formatValue(v, asRaw = true) { 15846 if (typeof v === "number") { 15847 return ["span", numberStyle, v]; 15848 } else if (typeof v === "string") { 15849 return ["span", stringStyle, JSON.stringify(v)]; 15850 } else if (typeof v === "boolean") { 15851 return ["span", keywordStyle, v]; 15852 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(v)) { 15853 return ["object", { object: asRaw ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(v) : v }]; 15854 } else { 15855 return ["span", stringStyle, String(v)]; 15856 } 15857 } 15858 function extractKeys(instance, type) { 15859 const Comp = instance.type; 15860 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(Comp)) { 15861 return; 15862 } 15863 const extracted = {}; 15864 for (const key in instance.ctx) { 15865 if (isKeyOfType(Comp, key, type)) { 15866 extracted[key] = instance.ctx[key]; 15867 } 15868 } 15869 return extracted; 15870 } 15871 function isKeyOfType(Comp, key, type) { 15872 const opts = Comp[type]; 15873 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opts) && opts.includes(key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(opts) && key in opts) { 15874 return true; 15875 } 15876 if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { 15877 return true; 15878 } 15879 if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { 15880 return true; 15881 } 15882 } 15883 function genRefFlag(v) { 15884 if (isShallow(v)) { 15885 return `ShallowRef`; 15886 } 15887 if (v.effect) { 15888 return `ComputedRef`; 15889 } 15890 return `Ref`; 15891 } 15892 if (window.devtoolsFormatters) { 15893 window.devtoolsFormatters.push(formatter); 15894 } else { 15895 window.devtoolsFormatters = [formatter]; 15896 } 15897} 15898 15899function withMemo(memo, render, cache, index) { 15900 const cached = cache[index]; 15901 if (cached && isMemoSame(cached, memo)) { 15902 return cached; 15903 } 15904 const ret = render(); 15905 ret.memo = memo.slice(); 15906 return cache[index] = ret; 15907} 15908function isMemoSame(cached, memo) { 15909 const prev = cached.memo; 15910 if (prev.length != memo.length) { 15911 return false; 15912 } 15913 for (let i = 0; i < prev.length; i++) { 15914 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(prev[i], memo[i])) { 15915 return false; 15916 } 15917 } 15918 if (isBlockTreeEnabled > 0 && currentBlock) { 15919 currentBlock.push(cached); 15920 } 15921 return true; 15922} 15923 15924const version = "3.4.5"; 15925const warn = true ? warn$1 : 0; 15926const ErrorTypeStrings = ErrorTypeStrings$1 ; 15927const devtools = true ? devtools$1 : 0; 15928const setDevtoolsHook = true ? setDevtoolsHook$1 : 0; 15929const _ssrUtils = { 15930 createComponentInstance, 15931 setupComponent, 15932 renderComponentRoot, 15933 setCurrentRenderingInstance, 15934 isVNode: isVNode, 15935 normalizeVNode 15936}; 15937const ssrUtils = _ssrUtils ; 15938const resolveFilter = null; 15939const compatUtils = null; 15940const DeprecationTypes = null; 15941 15942 15943 15944 15945/***/ }), 15946
vendor: 71,501 bytes, lines 15947-17683
15947/***/ "./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js": 15948/*!***********************************************************************!*\ 15949 !*** ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js ***! 15950 \***********************************************************************/ 15951/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 15952 15953"use strict"; 15954__webpack_require__.r(__webpack_exports__); 15955/* harmony export */ __webpack_require__.d(__webpack_exports__, { 15956/* harmony export */ BaseTransition: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransition), 15957/* harmony export */ BaseTransitionPropsValidators: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators), 15958/* harmony export */ Comment: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Comment), 15959/* harmony export */ DeprecationTypes: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.DeprecationTypes), 15960/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.EffectScope), 15961/* harmony export */ ErrorCodes: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ErrorCodes), 15962/* harmony export */ ErrorTypeStrings: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ErrorTypeStrings), 15963/* harmony export */ Fragment: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment), 15964/* harmony export */ KeepAlive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.KeepAlive), 15965/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), 15966/* harmony export */ Static: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Static), 15967/* harmony export */ Suspense: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Suspense), 15968/* harmony export */ Teleport: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Teleport), 15969/* harmony export */ Text: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Text), 15970/* harmony export */ TrackOpTypes: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.TrackOpTypes), 15971/* harmony export */ Transition: () => (/* binding */ Transition), 15972/* harmony export */ TransitionGroup: () => (/* binding */ TransitionGroup), 15973/* harmony export */ TriggerOpTypes: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.TriggerOpTypes), 15974/* harmony export */ VueElement: () => (/* binding */ VueElement), 15975/* harmony export */ assertNumber: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.assertNumber), 15976/* harmony export */ callWithAsyncErrorHandling: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling), 15977/* harmony export */ callWithErrorHandling: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithErrorHandling), 15978/* harmony export */ camelize: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.camelize), 15979/* harmony export */ capitalize: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.capitalize), 15980/* harmony export */ cloneVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.cloneVNode), 15981/* harmony export */ compatUtils: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.compatUtils), 15982/* harmony export */ computed: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.computed), 15983/* harmony export */ createApp: () => (/* binding */ createApp), 15984/* harmony export */ createBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createBlock), 15985/* harmony export */ createCommentVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode), 15986/* harmony export */ createElementBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createElementBlock), 15987/* harmony export */ createElementVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createElementVNode), 15988/* harmony export */ createHydrationRenderer: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer), 15989/* harmony export */ createPropsRestProxy: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createPropsRestProxy), 15990/* harmony export */ createRenderer: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createRenderer), 15991/* harmony export */ createSSRApp: () => (/* binding */ createSSRApp), 15992/* harmony export */ createSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createSlots), 15993/* harmony export */ createStaticVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createStaticVNode), 15994/* harmony export */ createTextVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createTextVNode), 15995/* harmony export */ createVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode), 15996/* harmony export */ customRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.customRef), 15997/* harmony export */ defineAsyncComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineAsyncComponent), 15998/* harmony export */ defineComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineComponent), 15999/* harmony export */ defineCustomElement: () => (/* binding */ defineCustomElement), 16000/* harmony export */ defineEmits: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineEmits), 16001/* harmony export */ defineExpose: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineExpose), 16002/* harmony export */ defineModel: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineModel), 16003/* harmony export */ defineOptions: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineOptions), 16004/* harmony export */ defineProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineProps), 16005/* harmony export */ defineSSRCustomElement: () => (/* binding */ defineSSRCustomElement), 16006/* harmony export */ defineSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineSlots), 16007/* harmony export */ devtools: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.devtools), 16008/* harmony export */ effect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.effect), 16009/* harmony export */ effectScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.effectScope), 16010/* harmony export */ getCurrentInstance: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance), 16011/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), 16012/* harmony export */ getTransitionRawChildren: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren), 16013/* harmony export */ guardReactiveProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps), 16014/* harmony export */ h: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.h), 16015/* harmony export */ handleError: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.handleError), 16016/* harmony export */ hasInjectionContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.hasInjectionContext), 16017/* harmony export */ hydrate: () => (/* binding */ hydrate), 16018/* harmony export */ initCustomFormatter: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.initCustomFormatter), 16019/* harmony export */ initDirectivesForSSR: () => (/* binding */ initDirectivesForSSR), 16020/* harmony export */ inject: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.inject), 16021/* harmony export */ isMemoSame: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isMemoSame), 16022/* harmony export */ isProxy: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isProxy), 16023/* harmony export */ isReactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isReactive), 16024/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isReadonly), 16025/* harmony export */ isRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRef), 16026/* harmony export */ isRuntimeOnly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly), 16027/* harmony export */ isShallow: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isShallow), 16028/* harmony export */ isVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isVNode), 16029/* harmony export */ markRaw: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.markRaw), 16030/* harmony export */ mergeDefaults: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeDefaults), 16031/* harmony export */ mergeModels: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeModels), 16032/* harmony export */ mergeProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeProps), 16033/* harmony export */ nextTick: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.nextTick), 16034/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeClass), 16035/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeProps), 16036/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle), 16037/* harmony export */ onActivated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onActivated), 16038/* harmony export */ onBeforeMount: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount), 16039/* harmony export */ onBeforeUnmount: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount), 16040/* harmony export */ onBeforeUpdate: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate), 16041/* harmony export */ onDeactivated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onDeactivated), 16042/* harmony export */ onErrorCaptured: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onErrorCaptured), 16043/* harmony export */ onMounted: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onMounted), 16044/* harmony export */ onRenderTracked: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onRenderTracked), 16045/* harmony export */ onRenderTriggered: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onRenderTriggered), 16046/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), 16047/* harmony export */ onServerPrefetch: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onServerPrefetch), 16048/* harmony export */ onUnmounted: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUnmounted), 16049/* harmony export */ onUpdated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUpdated), 16050/* harmony export */ openBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.openBlock), 16051/* harmony export */ popScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.popScopeId), 16052/* harmony export */ provide: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.provide), 16053/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), 16054/* harmony export */ pushScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.pushScopeId), 16055/* harmony export */ queuePostFlushCb: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.queuePostFlushCb), 16056/* harmony export */ reactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.reactive), 16057/* harmony export */ readonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.readonly), 16058/* harmony export */ ref: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ref), 16059/* harmony export */ registerRuntimeCompiler: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeCompiler), 16060/* harmony export */ render: () => (/* binding */ render), 16061/* harmony export */ renderList: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.renderList), 16062/* harmony export */ renderSlot: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.renderSlot), 16063/* harmony export */ resolveComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveComponent), 16064/* harmony export */ resolveDirective: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveDirective), 16065/* harmony export */ resolveDynamicComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent), 16066/* harmony export */ resolveFilter: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveFilter), 16067/* harmony export */ resolveTransitionHooks: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks), 16068/* harmony export */ setBlockTracking: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setBlockTracking), 16069/* harmony export */ setDevtoolsHook: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setDevtoolsHook), 16070/* harmony export */ setTransitionHooks: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks), 16071/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), 16072/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), 16073/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowRef), 16074/* harmony export */ ssrContextKey: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ssrContextKey), 16075/* harmony export */ ssrUtils: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ssrUtils), 16076/* harmony export */ stop: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.stop), 16077/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toDisplayString), 16078/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey), 16079/* harmony export */ toHandlers: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toHandlers), 16080/* harmony export */ toRaw: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRaw), 16081/* harmony export */ toRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRef), 16082/* harmony export */ toRefs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRefs), 16083/* harmony export */ toValue: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toValue), 16084/* harmony export */ transformVNodeArgs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.transformVNodeArgs), 16085/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.triggerRef), 16086/* harmony export */ unref: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.unref), 16087/* harmony export */ useAttrs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useAttrs), 16088/* harmony export */ useCssModule: () => (/* binding */ useCssModule), 16089/* harmony export */ useCssVars: () => (/* binding */ useCssVars), 16090/* harmony export */ useModel: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useModel), 16091/* harmony export */ useSSRContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useSSRContext), 16092/* harmony export */ useSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useSlots), 16093/* harmony export */ useTransitionState: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useTransitionState), 16094/* harmony export */ vModelCheckbox: () => (/* binding */ vModelCheckbox), 16095/* harmony export */ vModelDynamic: () => (/* binding */ vModelDynamic), 16096/* harmony export */ vModelRadio: () => (/* binding */ vModelRadio), 16097/* harmony export */ vModelSelect: () => (/* binding */ vModelSelect), 16098/* harmony export */ vModelText: () => (/* binding */ vModelText), 16099/* harmony export */ vShow: () => (/* binding */ vShow), 16100/* harmony export */ version: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.version), 16101/* harmony export */ warn: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn), 16102/* harmony export */ watch: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watch), 16103/* harmony export */ watchEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchEffect), 16104/* harmony export */ watchPostEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect), 16105/* harmony export */ watchSyncEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchSyncEffect), 16106/* harmony export */ withAsyncContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withAsyncContext), 16107/* harmony export */ withCtx: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withCtx), 16108/* harmony export */ withDefaults: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withDefaults), 16109/* harmony export */ withDirectives: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withDirectives), 16110/* harmony export */ withKeys: () => (/* binding */ withKeys), 16111/* harmony export */ withMemo: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withMemo), 16112/* harmony export */ withModifiers: () => (/* binding */ withModifiers), 16113/* harmony export */ withScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withScopeId) 16114/* harmony export */ }); 16115/* harmony import */ var _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/runtime-core */ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"); 16116/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); 16117/* harmony import */ var _vue_runtime_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vue/runtime-core */ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js"); 16118 16119 16120 16121 16122const svgNS = "http://www.w3.org/2000/svg"; 16123const mathmlNS = "http://www.w3.org/1998/Math/MathML"; 16124const doc = typeof document !== "undefined" ? document : null; 16125const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); 16126const nodeOps = { 16127 insert: (child, parent, anchor) => { 16128 parent.insertBefore(child, anchor || null); 16129 }, 16130 remove: (child) => { 16131 const parent = child.parentNode; 16132 if (parent) { 16133 parent.removeChild(child); 16134 } 16135 }, 16136 createElement: (tag, namespace, is, props) => { 16137 const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0); 16138 if (tag === "select" && props && props.multiple != null) { 16139 el.setAttribute("multiple", props.multiple); 16140 } 16141 return el; 16142 }, 16143 createText: (text) => doc.createTextNode(text), 16144 createComment: (text) => doc.createComment(text), 16145 setText: (node, text) => { 16146 node.nodeValue = text; 16147 }, 16148 setElementText: (el, text) => { 16149 el.textContent = text; 16150 }, 16151 parentNode: (node) => node.parentNode, 16152 nextSibling: (node) => node.nextSibling, 16153 querySelector: (selector) => doc.querySelector(selector), 16154 setScopeId(el, id) { 16155 el.setAttribute(id, ""); 16156 }, 16157 // __UNSAFE__ 16158 // Reason: innerHTML. 16159 // Static content here can only come from compiled templates. 16160 // As long as the user only uses trusted templates, this is safe. 16161 insertStaticContent(content, parent, anchor, namespace, start, end) { 16162 const before = anchor ? anchor.previousSibling : parent.lastChild; 16163 if (start && (start === end || start.nextSibling)) { 16164 while (true) { 16165 parent.insertBefore(start.cloneNode(true), anchor); 16166 if (start === end || !(start = start.nextSibling)) 16167 break; 16168 } 16169 } else { 16170 templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content; 16171 const template = templateContainer.content; 16172 if (namespace === "svg" || namespace === "mathml") { 16173 const wrapper = template.firstChild; 16174 while (wrapper.firstChild) { 16175 template.appendChild(wrapper.firstChild); 16176 } 16177 template.removeChild(wrapper); 16178 } 16179 parent.insertBefore(template, anchor); 16180 } 16181 return [ 16182 // first 16183 before ? before.nextSibling : parent.firstChild, 16184 // last 16185 anchor ? anchor.previousSibling : parent.lastChild 16186 ]; 16187 } 16188}; 16189 16190const TRANSITION = "transition"; 16191const ANIMATION = "animation"; 16192const vtcKey = Symbol("_vtc"); 16193const Transition = (props, { slots }) => (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.h)(_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransition, resolveTransitionProps(props), slots); 16194Transition.displayName = "Transition"; 16195const DOMTransitionPropsValidators = { 16196 name: String, 16197 type: String, 16198 css: { 16199 type: Boolean, 16200 default: true 16201 }, 16202 duration: [String, Number, Object], 16203 enterFromClass: String, 16204 enterActiveClass: String, 16205 enterToClass: String, 16206 appearFromClass: String, 16207 appearActiveClass: String, 16208 appearToClass: String, 16209 leaveFromClass: String, 16210 leaveActiveClass: String, 16211 leaveToClass: String 16212}; 16213const TransitionPropsValidators = Transition.props = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( 16214 {}, 16215 _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators, 16216 DOMTransitionPropsValidators 16217); 16218const callHook = (hook, args = []) => { 16219 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { 16220 hook.forEach((h2) => h2(...args)); 16221 } else if (hook) { 16222 hook(...args); 16223 } 16224}; 16225const hasExplicitCallback = (hook) => { 16226 return hook ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; 16227}; 16228function resolveTransitionProps(rawProps) { 16229 const baseProps = {}; 16230 for (const key in rawProps) { 16231 if (!(key in DOMTransitionPropsValidators)) { 16232 baseProps[key] = rawProps[key]; 16233 } 16234 } 16235 if (rawProps.css === false) { 16236 return baseProps; 16237 } 16238 const { 16239 name = "v", 16240 type, 16241 duration, 16242 enterFromClass = `${name}-enter-from`, 16243 enterActiveClass = `${name}-enter-active`, 16244 enterToClass = `${name}-enter-to`, 16245 appearFromClass = enterFromClass, 16246 appearActiveClass = enterActiveClass, 16247 appearToClass = enterToClass, 16248 leaveFromClass = `${name}-leave-from`, 16249 leaveActiveClass = `${name}-leave-active`, 16250 leaveToClass = `${name}-leave-to` 16251 } = rawProps; 16252 const durations = normalizeDuration(duration); 16253 const enterDuration = durations && durations[0]; 16254 const leaveDuration = durations && durations[1]; 16255 const { 16256 onBeforeEnter, 16257 onEnter, 16258 onEnterCancelled, 16259 onLeave, 16260 onLeaveCancelled, 16261 onBeforeAppear = onBeforeEnter, 16262 onAppear = onEnter, 16263 onAppearCancelled = onEnterCancelled 16264 } = baseProps; 16265 const finishEnter = (el, isAppear, done) => { 16266 removeTransitionClass(el, isAppear ? appearToClass : enterToClass); 16267 removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); 16268 done && done(); 16269 }; 16270 const finishLeave = (el, done) => { 16271 el._isLeaving = false; 16272 removeTransitionClass(el, leaveFromClass); 16273 removeTransitionClass(el, leaveToClass); 16274 removeTransitionClass(el, leaveActiveClass); 16275 done && done(); 16276 }; 16277 const makeEnterHook = (isAppear) => { 16278 return (el, done) => { 16279 const hook = isAppear ? onAppear : onEnter; 16280 const resolve = () => finishEnter(el, isAppear, done); 16281 callHook(hook, [el, resolve]); 16282 nextFrame(() => { 16283 removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); 16284 addTransitionClass(el, isAppear ? appearToClass : enterToClass); 16285 if (!hasExplicitCallback(hook)) { 16286 whenTransitionEnds(el, type, enterDuration, resolve); 16287 } 16288 }); 16289 }; 16290 }; 16291 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(baseProps, { 16292 onBeforeEnter(el) { 16293 callHook(onBeforeEnter, [el]); 16294 addTransitionClass(el, enterFromClass); 16295 addTransitionClass(el, enterActiveClass); 16296 }, 16297 onBeforeAppear(el) { 16298 callHook(onBeforeAppear, [el]); 16299 addTransitionClass(el, appearFromClass); 16300 addTransitionClass(el, appearActiveClass); 16301 }, 16302 onEnter: makeEnterHook(false), 16303 onAppear: makeEnterHook(true), 16304 onLeave(el, done) { 16305 el._isLeaving = true; 16306 const resolve = () => finishLeave(el, done); 16307 addTransitionClass(el, leaveFromClass); 16308 forceReflow(); 16309 addTransitionClass(el, leaveActiveClass); 16310 nextFrame(() => { 16311 if (!el._isLeaving) { 16312 return; 16313 } 16314 removeTransitionClass(el, leaveFromClass); 16315 addTransitionClass(el, leaveToClass); 16316 if (!hasExplicitCallback(onLeave)) { 16317 whenTransitionEnds(el, type, leaveDuration, resolve); 16318 } 16319 }); 16320 callHook(onLeave, [el, resolve]); 16321 }, 16322 onEnterCancelled(el) { 16323 finishEnter(el, false); 16324 callHook(onEnterCancelled, [el]); 16325 }, 16326 onAppearCancelled(el) { 16327 finishEnter(el, true); 16328 callHook(onAppearCancelled, [el]); 16329 }, 16330 onLeaveCancelled(el) { 16331 finishLeave(el); 16332 callHook(onLeaveCancelled, [el]); 16333 } 16334 }); 16335} 16336function normalizeDuration(duration) { 16337 if (duration == null) { 16338 return null; 16339 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(duration)) { 16340 return [NumberOf(duration.enter), NumberOf(duration.leave)]; 16341 } else { 16342 const n = NumberOf(duration); 16343 return [n, n]; 16344 } 16345} 16346function NumberOf(val) { 16347 const res = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(val); 16348 if (true) { 16349 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.assertNumber)(res, "<transition> explicit duration"); 16350 } 16351 return res; 16352} 16353function addTransitionClass(el, cls) { 16354 cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); 16355 (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); 16356} 16357function removeTransitionClass(el, cls) { 16358 cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); 16359 const _vtc = el[vtcKey]; 16360 if (_vtc) { 16361 _vtc.delete(cls); 16362 if (!_vtc.size) { 16363 el[vtcKey] = void 0; 16364 } 16365 } 16366} 16367function nextFrame(cb) { 16368 requestAnimationFrame(() => { 16369 requestAnimationFrame(cb); 16370 }); 16371} 16372let endId = 0; 16373function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { 16374 const id = el._endId = ++endId; 16375 const resolveIfNotStale = () => { 16376 if (id === el._endId) { 16377 resolve(); 16378 } 16379 }; 16380 if (explicitTimeout) { 16381 return setTimeout(resolveIfNotStale, explicitTimeout); 16382 } 16383 const { type, timeout, propCount } = getTransitionInfo(el, expectedType); 16384 if (!type) { 16385 return resolve(); 16386 } 16387 const endEvent = type + "end"; 16388 let ended = 0; 16389 const end = () => { 16390 el.removeEventListener(endEvent, onEnd); 16391 resolveIfNotStale(); 16392 }; 16393 const onEnd = (e) => { 16394 if (e.target === el && ++ended >= propCount) { 16395 end(); 16396 } 16397 }; 16398 setTimeout(() => { 16399 if (ended < propCount) { 16400 end(); 16401 } 16402 }, timeout + 1); 16403 el.addEventListener(endEvent, onEnd); 16404} 16405function getTransitionInfo(el, expectedType) { 16406 const styles = window.getComputedStyle(el); 16407 const getStyleProperties = (key) => (styles[key] || "").split(", "); 16408 const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); 16409 const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); 16410 const transitionTimeout = getTimeout(transitionDelays, transitionDurations); 16411 const animationDelays = getStyleProperties(`${ANIMATION}Delay`); 16412 const animationDurations = getStyleProperties(`${ANIMATION}Duration`); 16413 const animationTimeout = getTimeout(animationDelays, animationDurations); 16414 let type = null; 16415 let timeout = 0; 16416 let propCount = 0; 16417 if (expectedType === TRANSITION) { 16418 if (transitionTimeout > 0) { 16419 type = TRANSITION; 16420 timeout = transitionTimeout; 16421 propCount = transitionDurations.length; 16422 } 16423 } else if (expectedType === ANIMATION) { 16424 if (animationTimeout > 0) { 16425 type = ANIMATION; 16426 timeout = animationTimeout; 16427 propCount = animationDurations.length; 16428 } 16429 } else { 16430 timeout = Math.max(transitionTimeout, animationTimeout); 16431 type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; 16432 propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; 16433 } 16434 const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( 16435 getStyleProperties(`${TRANSITION}Property`).toString() 16436 ); 16437 return { 16438 type, 16439 timeout, 16440 propCount, 16441 hasTransform 16442 }; 16443} 16444function getTimeout(delays, durations) { 16445 while (delays.length < durations.length) { 16446 delays = delays.concat(delays); 16447 } 16448 return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); 16449} 16450function toMs(s) { 16451 if (s === "auto") 16452 return 0; 16453 return Number(s.slice(0, -1).replace(",", ".")) * 1e3; 16454} 16455function forceReflow() { 16456 return document.body.offsetHeight; 16457} 16458 16459function patchClass(el, value, isSVG) { 16460 const transitionClasses = el[vtcKey]; 16461 if (transitionClasses) { 16462 value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); 16463 } 16464 if (value == null) { 16465 el.removeAttribute("class"); 16466 } else if (isSVG) { 16467 el.setAttribute("class", value); 16468 } else { 16469 el.className = value; 16470 } 16471} 16472 16473const vShowOldKey = Symbol("_vod"); 16474const vShow = { 16475 beforeMount(el, { value }, { transition }) { 16476 el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display; 16477 if (transition && value) { 16478 transition.beforeEnter(el); 16479 } else { 16480 setDisplay(el, value); 16481 } 16482 }, 16483 mounted(el, { value }, { transition }) { 16484 if (transition && value) { 16485 transition.enter(el); 16486 } 16487 }, 16488 updated(el, { value, oldValue }, { transition }) { 16489 if (!value === !oldValue) 16490 return; 16491 if (transition) { 16492 if (value) { 16493 transition.beforeEnter(el); 16494 setDisplay(el, true); 16495 transition.enter(el); 16496 } else { 16497 transition.leave(el, () => { 16498 setDisplay(el, false); 16499 }); 16500 } 16501 } else { 16502 setDisplay(el, value); 16503 } 16504 }, 16505 beforeUnmount(el, { value }) { 16506 setDisplay(el, value); 16507 } 16508}; 16509function setDisplay(el, value) { 16510 el.style.display = value ? el[vShowOldKey] : "none"; 16511} 16512function initVShowForSSR() { 16513 vShow.getSSRProps = ({ value }) => { 16514 if (!value) { 16515 return { style: { display: "none" } }; 16516 } 16517 }; 16518} 16519 16520const CSS_VAR_TEXT = Symbol( true ? "CSS_VAR_TEXT" : 0); 16521function useCssVars(getter) { 16522 const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); 16523 if (!instance) { 16524 true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`useCssVars is called without current active component instance.`); 16525 return; 16526 } 16527 const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => { 16528 Array.from( 16529 document.querySelectorAll(`[data-v-owner="${instance.uid}"]`) 16530 ).forEach((node) => setVarsOnNode(node, vars)); 16531 }; 16532 const setVars = () => { 16533 const vars = getter(instance.proxy); 16534 setVarsOnVNode(instance.subTree, vars); 16535 updateTeleports(vars); 16536 }; 16537 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect)(setVars); 16538 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onMounted)(() => { 16539 const ob = new MutationObserver(setVars); 16540 ob.observe(instance.subTree.el.parentNode, { childList: true }); 16541 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUnmounted)(() => ob.disconnect()); 16542 }); 16543} 16544function setVarsOnVNode(vnode, vars) { 16545 if (vnode.shapeFlag & 128) { 16546 const suspense = vnode.suspense; 16547 vnode = suspense.activeBranch; 16548 if (suspense.pendingBranch && !suspense.isHydrating) { 16549 suspense.effects.push(() => { 16550 setVarsOnVNode(suspense.activeBranch, vars); 16551 }); 16552 } 16553 } 16554 while (vnode.component) { 16555 vnode = vnode.component.subTree; 16556 } 16557 if (vnode.shapeFlag & 1 && vnode.el) { 16558 setVarsOnNode(vnode.el, vars); 16559 } else if (vnode.type === _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment) { 16560 vnode.children.forEach((c) => setVarsOnVNode(c, vars)); 16561 } else if (vnode.type === _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Static) { 16562 let { el, anchor } = vnode; 16563 while (el) { 16564 setVarsOnNode(el, vars); 16565 if (el === anchor) 16566 break; 16567 el = el.nextSibling; 16568 } 16569 } 16570} 16571function setVarsOnNode(el, vars) { 16572 if (el.nodeType === 1) { 16573 const style = el.style; 16574 let cssText = ""; 16575 for (const key in vars) { 16576 style.setProperty(`--${key}`, vars[key]); 16577 cssText += `--${key}: ${vars[key]};`; 16578 } 16579 style[CSS_VAR_TEXT] = cssText; 16580 } 16581} 16582 16583function patchStyle(el, prev, next) { 16584 const style = el.style; 16585 const isCssString = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(next); 16586 if (next && !isCssString) { 16587 if (prev && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(prev)) { 16588 for (const key in prev) { 16589 if (next[key] == null) { 16590 setStyle(style, key, ""); 16591 } 16592 } 16593 } 16594 for (const key in next) { 16595 setStyle(style, key, next[key]); 16596 } 16597 } else { 16598 const currentDisplay = style.display; 16599 if (isCssString) { 16600 if (prev !== next) { 16601 const cssVarText = style[CSS_VAR_TEXT]; 16602 if (cssVarText) { 16603 next += ";" + cssVarText; 16604 } 16605 style.cssText = next; 16606 } 16607 } else if (prev) { 16608 el.removeAttribute("style"); 16609 } 16610 if (vShowOldKey in el) { 16611 style.display = currentDisplay; 16612 } 16613 } 16614} 16615const semicolonRE = /[^\\];\s*$/; 16616const importantRE = /\s*!important$/; 16617function setStyle(style, name, val) { 16618 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(val)) { 16619 val.forEach((v) => setStyle(style, name, v)); 16620 } else { 16621 if (val == null) 16622 val = ""; 16623 if (true) { 16624 if (semicolonRE.test(val)) { 16625 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( 16626 `Unexpected semicolon at the end of '${name}' style value: '${val}'` 16627 ); 16628 } 16629 } 16630 if (name.startsWith("--")) { 16631 style.setProperty(name, val); 16632 } else { 16633 const prefixed = autoPrefix(style, name); 16634 if (importantRE.test(val)) { 16635 style.setProperty( 16636 (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(prefixed), 16637 val.replace(importantRE, ""), 16638 "important" 16639 ); 16640 } else { 16641 style[prefixed] = val; 16642 } 16643 } 16644 } 16645} 16646const prefixes = ["Webkit", "Moz", "ms"]; 16647const prefixCache = {}; 16648function autoPrefix(style, rawName) { 16649 const cached = prefixCache[rawName]; 16650 if (cached) { 16651 return cached; 16652 } 16653 let name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(rawName); 16654 if (name !== "filter" && name in style) { 16655 return prefixCache[rawName] = name; 16656 } 16657 name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)(name); 16658 for (let i = 0; i < prefixes.length; i++) { 16659 const prefixed = prefixes[i] + name; 16660 if (prefixed in style) { 16661 return prefixCache[rawName] = prefixed; 16662 } 16663 } 16664 return rawName; 16665} 16666 16667const xlinkNS = "http://www.w3.org/1999/xlink"; 16668function patchAttr(el, key, value, isSVG, instance) { 16669 if (isSVG && key.startsWith("xlink:")) { 16670 if (value == null) { 16671 el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); 16672 } else { 16673 el.setAttributeNS(xlinkNS, key, value); 16674 } 16675 } else { 16676 const isBoolean = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSpecialBooleanAttr)(key); 16677 if (value == null || isBoolean && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.includeBooleanAttr)(value)) { 16678 el.removeAttribute(key); 16679 } else { 16680 el.setAttribute(key, isBoolean ? "" : value); 16681 } 16682 } 16683} 16684 16685function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) { 16686 if (key === "innerHTML" || key === "textContent") { 16687 if (prevChildren) { 16688 unmountChildren(prevChildren, parentComponent, parentSuspense); 16689 } 16690 el[key] = value == null ? "" : value; 16691 return; 16692 } 16693 const tag = el.tagName; 16694 if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally 16695 !tag.includes("-")) { 16696 el._value = value; 16697 const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value; 16698 const newValue = value == null ? "" : value; 16699 if (oldValue !== newValue) { 16700 el.value = newValue; 16701 } 16702 if (value == null) { 16703 el.removeAttribute(key); 16704 } 16705 return; 16706 } 16707 let needRemove = false; 16708 if (value === "" || value == null) { 16709 const type = typeof el[key]; 16710 if (type === "boolean") { 16711 value = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.includeBooleanAttr)(value); 16712 } else if (value == null && type === "string") { 16713 value = ""; 16714 needRemove = true; 16715 } else if (type === "number") { 16716 value = 0; 16717 needRemove = true; 16718 } 16719 } 16720 try { 16721 el[key] = value; 16722 } catch (e) { 16723 if ( true && !needRemove) { 16724 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( 16725 `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, 16726 e 16727 ); 16728 } 16729 } 16730 needRemove && el.removeAttribute(key); 16731} 16732 16733function addEventListener(el, event, handler, options) { 16734 el.addEventListener(event, handler, options); 16735} 16736function removeEventListener(el, event, handler, options) { 16737 el.removeEventListener(event, handler, options); 16738} 16739const veiKey = Symbol("_vei"); 16740function patchEvent(el, rawName, prevValue, nextValue, instance = null) { 16741 const invokers = el[veiKey] || (el[veiKey] = {}); 16742 const existingInvoker = invokers[rawName]; 16743 if (nextValue && existingInvoker) { 16744 existingInvoker.value = nextValue; 16745 } else { 16746 const [name, options] = parseName(rawName); 16747 if (nextValue) { 16748 const invoker = invokers[rawName] = createInvoker(nextValue, instance); 16749 addEventListener(el, name, invoker, options); 16750 } else if (existingInvoker) { 16751 removeEventListener(el, name, existingInvoker, options); 16752 invokers[rawName] = void 0; 16753 } 16754 } 16755} 16756const optionsModifierRE = /(?:Once|Passive|Capture)$/; 16757function parseName(name) { 16758 let options; 16759 if (optionsModifierRE.test(name)) { 16760 options = {}; 16761 let m; 16762 while (m = name.match(optionsModifierRE)) { 16763 name = name.slice(0, name.length - m[0].length); 16764 options[m[0].toLowerCase()] = true; 16765 } 16766 } 16767 const event = name[2] === ":" ? name.slice(3) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(name.slice(2)); 16768 return [event, options]; 16769} 16770let cachedNow = 0; 16771const p = /* @__PURE__ */ Promise.resolve(); 16772const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); 16773function createInvoker(initialValue, instance) { 16774 const invoker = (e) => { 16775 if (!e._vts) { 16776 e._vts = Date.now(); 16777 } else if (e._vts <= invoker.attached) { 16778 return; 16779 } 16780 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling)( 16781 patchStopImmediatePropagation(e, invoker.value), 16782 instance, 16783 5, 16784 [e] 16785 ); 16786 }; 16787 invoker.value = initialValue; 16788 invoker.attached = getNow(); 16789 return invoker; 16790} 16791function patchStopImmediatePropagation(e, value) { 16792 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { 16793 const originalStop = e.stopImmediatePropagation; 16794 e.stopImmediatePropagation = () => { 16795 originalStop.call(e); 16796 e._stopped = true; 16797 }; 16798 return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2)); 16799 } else { 16800 return value; 16801 } 16802} 16803 16804const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter 16805key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; 16806const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => { 16807 const isSVG = namespace === "svg"; 16808 if (key === "class") { 16809 patchClass(el, nextValue, isSVG); 16810 } else if (key === "style") { 16811 patchStyle(el, prevValue, nextValue); 16812 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { 16813 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key)) { 16814 patchEvent(el, key, prevValue, nextValue, parentComponent); 16815 } 16816 } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { 16817 patchDOMProp( 16818 el, 16819 key, 16820 nextValue, 16821 prevChildren, 16822 parentComponent, 16823 parentSuspense, 16824 unmountChildren 16825 ); 16826 } else { 16827 if (key === "true-value") { 16828 el._trueValue = nextValue; 16829 } else if (key === "false-value") { 16830 el._falseValue = nextValue; 16831 } 16832 patchAttr(el, key, nextValue, isSVG); 16833 } 16834}; 16835function shouldSetAsProp(el, key, value, isSVG) { 16836 if (isSVG) { 16837 if (key === "innerHTML" || key === "textContent") { 16838 return true; 16839 } 16840 if (key in el && isNativeOn(key) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { 16841 return true; 16842 } 16843 return false; 16844 } 16845 if (key === "spellcheck" || key === "draggable" || key === "translate") { 16846 return false; 16847 } 16848 if (key === "form") { 16849 return false; 16850 } 16851 if (key === "list" && el.tagName === "INPUT") { 16852 return false; 16853 } 16854 if (key === "type" && el.tagName === "TEXTAREA") { 16855 return false; 16856 } 16857 if (key === "width" || key === "height") { 16858 const tag = el.tagName; 16859 if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { 16860 return false; 16861 } 16862 } 16863 if (isNativeOn(key) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(value)) { 16864 return false; 16865 } 16866 return key in el; 16867} 16868 16869/*! #__NO_SIDE_EFFECTS__ */ 16870// @__NO_SIDE_EFFECTS__ 16871function defineCustomElement(options, hydrate2) { 16872 const Comp = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineComponent)(options); 16873 class VueCustomElement extends VueElement { 16874 constructor(initialProps) { 16875 super(Comp, initialProps, hydrate2); 16876 } 16877 } 16878 VueCustomElement.def = Comp; 16879 return VueCustomElement; 16880} 16881/*! #__NO_SIDE_EFFECTS__ */ 16882const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => { 16883 return /* @__PURE__ */ defineCustomElement(options, hydrate); 16884}; 16885const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { 16886}; 16887class VueElement extends BaseClass { 16888 constructor(_def, _props = {}, hydrate2) { 16889 super(); 16890 this._def = _def; 16891 this._props = _props; 16892 /** 16893 * @internal 16894 */ 16895 this._instance = null; 16896 this._connected = false; 16897 this._resolved = false; 16898 this._numberProps = null; 16899 this._ob = null; 16900 if (this.shadowRoot && hydrate2) { 16901 hydrate2(this._createVNode(), this.shadowRoot); 16902 } else { 16903 if ( true && this.shadowRoot) { 16904 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( 16905 `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` 16906 ); 16907 } 16908 this.attachShadow({ mode: "open" }); 16909 if (!this._def.__asyncLoader) { 16910 this._resolveProps(this._def); 16911 } 16912 } 16913 } 16914 connectedCallback() { 16915 this._connected = true; 16916 if (!this._instance) { 16917 if (this._resolved) { 16918 this._update(); 16919 } else { 16920 this._resolveDef(); 16921 } 16922 } 16923 } 16924 disconnectedCallback() { 16925 this._connected = false; 16926 if (this._ob) { 16927 this._ob.disconnect(); 16928 this._ob = null; 16929 } 16930 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.nextTick)(() => { 16931 if (!this._connected) { 16932 render(null, this.shadowRoot); 16933 this._instance = null; 16934 } 16935 }); 16936 } 16937 /** 16938 * resolve inner component definition (handle possible async component) 16939 */ 16940 _resolveDef() { 16941 this._resolved = true; 16942 for (let i = 0; i < this.attributes.length; i++) { 16943 this._setAttr(this.attributes[i].name); 16944 } 16945 this._ob = new MutationObserver((mutations) => { 16946 for (const m of mutations) { 16947 this._setAttr(m.attributeName); 16948 } 16949 }); 16950 this._ob.observe(this, { attributes: true }); 16951 const resolve = (def, isAsync = false) => { 16952 const { props, styles } = def; 16953 let numberProps; 16954 if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props)) { 16955 for (const key in props) { 16956 const opt = props[key]; 16957 if (opt === Number || opt && opt.type === Number) { 16958 if (key in this._props) { 16959 this._props[key] = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(this._props[key]); 16960 } 16961 (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key)] = true; 16962 } 16963 } 16964 } 16965 this._numberProps = numberProps; 16966 if (isAsync) { 16967 this._resolveProps(def); 16968 } 16969 this._applyStyles(styles); 16970 this._update(); 16971 }; 16972 const asyncDef = this._def.__asyncLoader; 16973 if (asyncDef) { 16974 asyncDef().then((def) => resolve(def, true)); 16975 } else { 16976 resolve(this._def); 16977 } 16978 } 16979 _resolveProps(def) { 16980 const { props } = def; 16981 const declaredPropKeys = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props) ? props : Object.keys(props || {}); 16982 for (const key of Object.keys(this)) { 16983 if (key[0] !== "_" && declaredPropKeys.includes(key)) { 16984 this._setProp(key, this[key], true, false); 16985 } 16986 } 16987 for (const key of declaredPropKeys.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)) { 16988 Object.defineProperty(this, key, { 16989 get() { 16990 return this._getProp(key); 16991 }, 16992 set(val) { 16993 this._setProp(key, val); 16994 } 16995 }); 16996 } 16997 } 16998 _setAttr(key) { 16999 let value = this.getAttribute(key); 17000 const camelKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); 17001 if (this._numberProps && this._numberProps[camelKey]) { 17002 value = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(value); 17003 } 17004 this._setProp(camelKey, value, false); 17005 } 17006 /** 17007 * @internal 17008 */ 17009 _getProp(key) { 17010 return this._props[key]; 17011 } 17012 /** 17013 * @internal 17014 */ 17015 _setProp(key, val, shouldReflect = true, shouldUpdate = true) { 17016 if (val !== this._props[key]) { 17017 this._props[key] = val; 17018 if (shouldUpdate && this._instance) { 17019 this._update(); 17020 } 17021 if (shouldReflect) { 17022 if (val === true) { 17023 this.setAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key), ""); 17024 } else if (typeof val === "string" || typeof val === "number") { 17025 this.setAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key), val + ""); 17026 } else if (!val) { 17027 this.removeAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)); 17028 } 17029 } 17030 } 17031 } 17032 _update() { 17033 render(this._createVNode(), this.shadowRoot); 17034 } 17035 _createVNode() { 17036 const vnode = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode)(this._def, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, this._props)); 17037 if (!this._instance) { 17038 vnode.ce = (instance) => { 17039 this._instance = instance; 17040 instance.isCE = true; 17041 if (true) { 17042 instance.ceReload = (newStyles) => { 17043 if (this._styles) { 17044 this._styles.forEach((s) => this.shadowRoot.removeChild(s)); 17045 this._styles.length = 0; 17046 } 17047 this._applyStyles(newStyles); 17048 this._instance = null; 17049 this._update(); 17050 }; 17051 } 17052 const dispatch = (event, args) => { 17053 this.dispatchEvent( 17054 new CustomEvent(event, { 17055 detail: args 17056 }) 17057 ); 17058 }; 17059 instance.emit = (event, ...args) => { 17060 dispatch(event, args); 17061 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event) !== event) { 17062 dispatch((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event), args); 17063 } 17064 }; 17065 let parent = this; 17066 while (parent = parent && (parent.parentNode || parent.host)) { 17067 if (parent instanceof VueElement) { 17068 instance.parent = parent._instance; 17069 instance.provides = parent._instance.provides; 17070 break; 17071 } 17072 } 17073 }; 17074 } 17075 return vnode; 17076 } 17077 _applyStyles(styles) { 17078 if (styles) { 17079 styles.forEach((css) => { 17080 const s = document.createElement("style"); 17081 s.textContent = css; 17082 this.shadowRoot.appendChild(s); 17083 if (true) { 17084 (this._styles || (this._styles = [])).push(s); 17085 } 17086 }); 17087 } 17088 } 17089} 17090 17091function useCssModule(name = "$style") { 17092 { 17093 const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); 17094 if (!instance) { 17095 true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`useCssModule must be called inside setup()`); 17096 return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 17097 } 17098 const modules = instance.type.__cssModules; 17099 if (!modules) { 17100 true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`Current instance does not have CSS modules injected.`); 17101 return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 17102 } 17103 const mod = modules[name]; 17104 if (!mod) { 17105 true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`Current instance does not have CSS module named "${name}".`); 17106 return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; 17107 } 17108 return mod; 17109 } 17110} 17111 17112const positionMap = /* @__PURE__ */ new WeakMap(); 17113const newPositionMap = /* @__PURE__ */ new WeakMap(); 17114const moveCbKey = Symbol("_moveCb"); 17115const enterCbKey = Symbol("_enterCb"); 17116const TransitionGroupImpl = { 17117 name: "TransitionGroup", 17118 props: /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, TransitionPropsValidators, { 17119 tag: String, 17120 moveClass: String 17121 }), 17122 setup(props, { slots }) { 17123 const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); 17124 const state = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useTransitionState)(); 17125 let prevChildren; 17126 let children; 17127 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUpdated)(() => { 17128 if (!prevChildren.length) { 17129 return; 17130 } 17131 const moveClass = props.moveClass || `${props.name || "v"}-move`; 17132 if (!hasCSSTransform( 17133 prevChildren[0].el, 17134 instance.vnode.el, 17135 moveClass 17136 )) { 17137 return; 17138 } 17139 prevChildren.forEach(callPendingCbs); 17140 prevChildren.forEach(recordPosition); 17141 const movedChildren = prevChildren.filter(applyTranslation); 17142 forceReflow(); 17143 movedChildren.forEach((c) => { 17144 const el = c.el; 17145 const style = el.style; 17146 addTransitionClass(el, moveClass); 17147 style.transform = style.webkitTransform = style.transitionDuration = ""; 17148 const cb = el[moveCbKey] = (e) => { 17149 if (e && e.target !== el) { 17150 return; 17151 } 17152 if (!e || /transform$/.test(e.propertyName)) { 17153 el.removeEventListener("transitionend", cb); 17154 el[moveCbKey] = null; 17155 removeTransitionClass(el, moveClass); 17156 } 17157 }; 17158 el.addEventListener("transitionend", cb); 17159 }); 17160 }); 17161 return () => { 17162 const rawProps = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_2__.toRaw)(props); 17163 const cssTransitionProps = resolveTransitionProps(rawProps); 17164 let tag = rawProps.tag || _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment; 17165 prevChildren = children; 17166 children = slots.default ? (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren)(slots.default()) : []; 17167 for (let i = 0; i < children.length; i++) { 17168 const child = children[i]; 17169 if (child.key != null) { 17170 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks)( 17171 child, 17172 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks)(child, cssTransitionProps, state, instance) 17173 ); 17174 } else if (true) { 17175 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`<TransitionGroup> children must be keyed.`); 17176 } 17177 } 17178 if (prevChildren) { 17179 for (let i = 0; i < prevChildren.length; i++) { 17180 const child = prevChildren[i]; 17181 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks)( 17182 child, 17183 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks)(child, cssTransitionProps, state, instance) 17184 ); 17185 positionMap.set(child, child.el.getBoundingClientRect()); 17186 } 17187 } 17188 return (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode)(tag, null, children); 17189 }; 17190 } 17191}; 17192const removeMode = (props) => delete props.mode; 17193/* @__PURE__ */ removeMode(TransitionGroupImpl.props); 17194const TransitionGroup = TransitionGroupImpl; 17195function callPendingCbs(c) { 17196 const el = c.el; 17197 if (el[moveCbKey]) { 17198 el[moveCbKey](); 17199 } 17200 if (el[enterCbKey]) { 17201 el[enterCbKey](); 17202 } 17203} 17204function recordPosition(c) { 17205 newPositionMap.set(c, c.el.getBoundingClientRect()); 17206} 17207function applyTranslation(c) { 17208 const oldPos = positionMap.get(c); 17209 const newPos = newPositionMap.get(c); 17210 const dx = oldPos.left - newPos.left; 17211 const dy = oldPos.top - newPos.top; 17212 if (dx || dy) { 17213 const s = c.el.style; 17214 s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; 17215 s.transitionDuration = "0s"; 17216 return c; 17217 } 17218} 17219function hasCSSTransform(el, root, moveClass) { 17220 const clone = el.cloneNode(); 17221 const _vtc = el[vtcKey]; 17222 if (_vtc) { 17223 _vtc.forEach((cls) => { 17224 cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); 17225 }); 17226 } 17227 moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); 17228 clone.style.display = "none"; 17229 const container = root.nodeType === 1 ? root : root.parentNode; 17230 container.appendChild(clone); 17231 const { hasTransform } = getTransitionInfo(clone); 17232 container.removeChild(clone); 17233 return hasTransform; 17234} 17235 17236const getModelAssigner = (vnode) => { 17237 const fn = vnode.props["onUpdate:modelValue"] || false; 17238 return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(fn) ? (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(fn, value) : fn; 17239}; 17240function onCompositionStart(e) { 17241 e.target.composing = true; 17242} 17243function onCompositionEnd(e) { 17244 const target = e.target; 17245 if (target.composing) { 17246 target.composing = false; 17247 target.dispatchEvent(new Event("input")); 17248 } 17249} 17250const assignKey = Symbol("_assign"); 17251const vModelText = { 17252 created(el, { modifiers: { lazy, trim, number } }, vnode) { 17253 el[assignKey] = getModelAssigner(vnode); 17254 const castToNumber = number || vnode.props && vnode.props.type === "number"; 17255 addEventListener(el, lazy ? "change" : "input", (e) => { 17256 if (e.target.composing) 17257 return; 17258 let domValue = el.value; 17259 if (trim) { 17260 domValue = domValue.trim(); 17261 } 17262 if (castToNumber) { 17263 domValue = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(domValue); 17264 } 17265 el[assignKey](domValue); 17266 }); 17267 if (trim) { 17268 addEventListener(el, "change", () => { 17269 el.value = el.value.trim(); 17270 }); 17271 } 17272 if (!lazy) { 17273 addEventListener(el, "compositionstart", onCompositionStart); 17274 addEventListener(el, "compositionend", onCompositionEnd); 17275 addEventListener(el, "change", onCompositionEnd); 17276 } 17277 }, 17278 // set value on mounted so it's after min/max for type="range" 17279 mounted(el, { value }) { 17280 el.value = value == null ? "" : value; 17281 }, 17282 beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) { 17283 el[assignKey] = getModelAssigner(vnode); 17284 if (el.composing) 17285 return; 17286 const elValue = number || el.type === "number" ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(el.value) : el.value; 17287 const newValue = value == null ? "" : value; 17288 if (elValue === newValue) { 17289 return; 17290 } 17291 if (document.activeElement === el && el.type !== "range") { 17292 if (lazy) { 17293 return; 17294 } 17295 if (trim && el.value.trim() === newValue) { 17296 return; 17297 } 17298 } 17299 el.value = newValue; 17300 } 17301}; 17302const vModelCheckbox = { 17303 // #4096 array checkboxes need to be deep traversed 17304 deep: true, 17305 created(el, _, vnode) { 17306 el[assignKey] = getModelAssigner(vnode); 17307 addEventListener(el, "change", () => { 17308 const modelValue = el._modelValue; 17309 const elementValue = getValue(el); 17310 const checked = el.checked; 17311 const assign = el[assignKey]; 17312 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(modelValue)) { 17313 const index = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(modelValue, elementValue); 17314 const found = index !== -1; 17315 if (checked && !found) { 17316 assign(modelValue.concat(elementValue)); 17317 } else if (!checked && found) { 17318 const filtered = [...modelValue]; 17319 filtered.splice(index, 1); 17320 assign(filtered); 17321 } 17322 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(modelValue)) { 17323 const cloned = new Set(modelValue); 17324 if (checked) { 17325 cloned.add(elementValue); 17326 } else { 17327 cloned.delete(elementValue); 17328 } 17329 assign(cloned); 17330 } else { 17331 assign(getCheckboxValue(el, checked)); 17332 } 17333 }); 17334 }, 17335 // set initial checked on mount to wait for true-value/false-value 17336 mounted: setChecked, 17337 beforeUpdate(el, binding, vnode) { 17338 el[assignKey] = getModelAssigner(vnode); 17339 setChecked(el, binding, vnode); 17340 } 17341}; 17342function setChecked(el, { value, oldValue }, vnode) { 17343 el._modelValue = value; 17344 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { 17345 el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, vnode.props.value) > -1; 17346 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { 17347 el.checked = value.has(vnode.props.value); 17348 } else if (value !== oldValue) { 17349 el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, getCheckboxValue(el, true)); 17350 } 17351} 17352const vModelRadio = { 17353 created(el, { value }, vnode) { 17354 el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, vnode.props.value); 17355 el[assignKey] = getModelAssigner(vnode); 17356 addEventListener(el, "change", () => { 17357 el[assignKey](getValue(el)); 17358 }); 17359 }, 17360 beforeUpdate(el, { value, oldValue }, vnode) { 17361 el[assignKey] = getModelAssigner(vnode); 17362 if (value !== oldValue) { 17363 el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, vnode.props.value); 17364 } 17365 } 17366}; 17367const vModelSelect = { 17368 // <select multiple> value need to be deep traversed 17369 deep: true, 17370 created(el, { value, modifiers: { number } }, vnode) { 17371 const isSetModel = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value); 17372 addEventListener(el, "change", () => { 17373 const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( 17374 (o) => number ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(getValue(o)) : getValue(o) 17375 ); 17376 el[assignKey]( 17377 el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] 17378 ); 17379 }); 17380 el[assignKey] = getModelAssigner(vnode); 17381 }, 17382 // set value in mounted & updated because <select> relies on its children 17383 // <option>s. 17384 mounted(el, { value }) { 17385 setSelected(el, value); 17386 }, 17387 beforeUpdate(el, _binding, vnode) { 17388 el[assignKey] = getModelAssigner(vnode); 17389 }, 17390 updated(el, { value }) { 17391 setSelected(el, value); 17392 } 17393}; 17394function setSelected(el, value) { 17395 const isMultiple = el.multiple; 17396 if (isMultiple && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { 17397 true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( 17398 `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` 17399 ); 17400 return; 17401 } 17402 for (let i = 0, l = el.options.length; i < l; i++) { 17403 const option = el.options[i]; 17404 const optionValue = getValue(option); 17405 if (isMultiple) { 17406 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { 17407 option.selected = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, optionValue) > -1; 17408 } else { 17409 option.selected = value.has(optionValue); 17410 } 17411 } else { 17412 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(getValue(option), value)) { 17413 if (el.selectedIndex !== i) 17414 el.selectedIndex = i; 17415 return; 17416 } 17417 } 17418 } 17419 if (!isMultiple && el.selectedIndex !== -1) { 17420 el.selectedIndex = -1; 17421 } 17422} 17423function getValue(el) { 17424 return "_value" in el ? el._value : el.value; 17425} 17426function getCheckboxValue(el, checked) { 17427 const key = checked ? "_trueValue" : "_falseValue"; 17428 return key in el ? el[key] : checked; 17429} 17430const vModelDynamic = { 17431 created(el, binding, vnode) { 17432 callModelHook(el, binding, vnode, null, "created"); 17433 }, 17434 mounted(el, binding, vnode) { 17435 callModelHook(el, binding, vnode, null, "mounted"); 17436 }, 17437 beforeUpdate(el, binding, vnode, prevVNode) { 17438 callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); 17439 }, 17440 updated(el, binding, vnode, prevVNode) { 17441 callModelHook(el, binding, vnode, prevVNode, "updated"); 17442 } 17443}; 17444function resolveDynamicModel(tagName, type) { 17445 switch (tagName) { 17446 case "SELECT": 17447 return vModelSelect; 17448 case "TEXTAREA": 17449 return vModelText; 17450 default: 17451 switch (type) { 17452 case "checkbox": 17453 return vModelCheckbox; 17454 case "radio": 17455 return vModelRadio; 17456 default: 17457 return vModelText; 17458 } 17459 } 17460} 17461function callModelHook(el, binding, vnode, prevVNode, hook) { 17462 const modelToUse = resolveDynamicModel( 17463 el.tagName, 17464 vnode.props && vnode.props.type 17465 ); 17466 const fn = modelToUse[hook]; 17467 fn && fn(el, binding, vnode, prevVNode); 17468} 17469function initVModelForSSR() { 17470 vModelText.getSSRProps = ({ value }) => ({ value }); 17471 vModelRadio.getSSRProps = ({ value }, vnode) => { 17472 if (vnode.props && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(vnode.props.value, value)) { 17473 return { checked: true }; 17474 } 17475 }; 17476 vModelCheckbox.getSSRProps = ({ value }, vnode) => { 17477 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { 17478 if (vnode.props && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, vnode.props.value) > -1) { 17479 return { checked: true }; 17480 } 17481 } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { 17482 if (vnode.props && value.has(vnode.props.value)) { 17483 return { checked: true }; 17484 } 17485 } else if (value) { 17486 return { checked: true }; 17487 } 17488 }; 17489 vModelDynamic.getSSRProps = (binding, vnode) => { 17490 if (typeof vnode.type !== "string") { 17491 return; 17492 } 17493 const modelToUse = resolveDynamicModel( 17494 // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase 17495 vnode.type.toUpperCase(), 17496 vnode.props && vnode.props.type 17497 ); 17498 if (modelToUse.getSSRProps) { 17499 return modelToUse.getSSRProps(binding, vnode); 17500 } 17501 }; 17502} 17503 17504const systemModifiers = ["ctrl", "shift", "alt", "meta"]; 17505const modifierGuards = { 17506 stop: (e) => e.stopPropagation(), 17507 prevent: (e) => e.preventDefault(), 17508 self: (e) => e.target !== e.currentTarget, 17509 ctrl: (e) => !e.ctrlKey, 17510 shift: (e) => !e.shiftKey, 17511 alt: (e) => !e.altKey, 17512 meta: (e) => !e.metaKey, 17513 left: (e) => "button" in e && e.button !== 0, 17514 middle: (e) => "button" in e && e.button !== 1, 17515 right: (e) => "button" in e && e.button !== 2, 17516 exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) 17517}; 17518const withModifiers = (fn, modifiers) => { 17519 const cache = fn._withMods || (fn._withMods = {}); 17520 const cacheKey = modifiers.join("."); 17521 return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { 17522 for (let i = 0; i < modifiers.length; i++) { 17523 const guard = modifierGuards[modifiers[i]]; 17524 if (guard && guard(event, modifiers)) 17525 return; 17526 } 17527 return fn(event, ...args); 17528 }); 17529}; 17530const keyNames = { 17531 esc: "escape", 17532 space: " ", 17533 up: "arrow-up", 17534 left: "arrow-left", 17535 right: "arrow-right", 17536 down: "arrow-down", 17537 delete: "backspace" 17538}; 17539const withKeys = (fn, modifiers) => { 17540 const cache = fn._withKeys || (fn._withKeys = {}); 17541 const cacheKey = modifiers.join("."); 17542 return cache[cacheKey] || (cache[cacheKey] = (event) => { 17543 if (!("key" in event)) { 17544 return; 17545 } 17546 const eventKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event.key); 17547 if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) { 17548 return fn(event); 17549 } 17550 }); 17551}; 17552 17553const rendererOptions = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({ patchProp }, nodeOps); 17554let renderer; 17555let enabledHydration = false; 17556function ensureRenderer() { 17557 return renderer || (renderer = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createRenderer)(rendererOptions)); 17558} 17559function ensureHydrationRenderer() { 17560 renderer = enabledHydration ? renderer : (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer)(rendererOptions); 17561 enabledHydration = true; 17562 return renderer; 17563} 17564const render = (...args) => { 17565 ensureRenderer().render(...args); 17566}; 17567const hydrate = (...args) => { 17568 ensureHydrationRenderer().hydrate(...args); 17569}; 17570const createApp = (...args) => { 17571 const app = ensureRenderer().createApp(...args); 17572 if (true) { 17573 injectNativeTagCheck(app); 17574 injectCompilerOptionsCheck(app); 17575 } 17576 const { mount } = app; 17577 app.mount = (containerOrSelector) => { 17578 const container = normalizeContainer(containerOrSelector); 17579 if (!container) 17580 return; 17581 const component = app._component; 17582 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(component) && !component.render && !component.template) { 17583 component.template = container.innerHTML; 17584 } 17585 container.innerHTML = ""; 17586 const proxy = mount(container, false, resolveRootNamespace(container)); 17587 if (container instanceof Element) { 17588 container.removeAttribute("v-cloak"); 17589 container.setAttribute("data-v-app", ""); 17590 } 17591 return proxy; 17592 }; 17593 return app; 17594}; 17595const createSSRApp = (...args) => { 17596 const app = ensureHydrationRenderer().createApp(...args); 17597 if (true) { 17598 injectNativeTagCheck(app); 17599 injectCompilerOptionsCheck(app); 17600 } 17601 const { mount } = app; 17602 app.mount = (containerOrSelector) => { 17603 const container = normalizeContainer(containerOrSelector); 17604 if (container) { 17605 return mount(container, true, resolveRootNamespace(container)); 17606 } 17607 }; 17608 return app; 17609}; 17610function resolveRootNamespace(container) { 17611 if (container instanceof SVGElement) { 17612 return "svg"; 17613 } 17614 if (typeof MathMLElement === "function" && container instanceof MathMLElement) { 17615 return "mathml"; 17616 } 17617} 17618function injectNativeTagCheck(app) { 17619 Object.defineProperty(app.config, "isNativeTag", { 17620 value: (tag) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isHTMLTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSVGTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isMathMLTag)(tag), 17621 writable: false 17622 }); 17623} 17624function injectCompilerOptionsCheck(app) { 17625 if ((0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly)()) { 17626 const isCustomElement = app.config.isCustomElement; 17627 Object.defineProperty(app.config, "isCustomElement", { 17628 get() { 17629 return isCustomElement; 17630 }, 17631 set() { 17632 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( 17633 `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` 17634 ); 17635 } 17636 }); 17637 const compilerOptions = app.config.compilerOptions; 17638 const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. 17639- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. 17640- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader 17641- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; 17642 Object.defineProperty(app.config, "compilerOptions", { 17643 get() { 17644 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(msg); 17645 return compilerOptions; 17646 }, 17647 set() { 17648 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(msg); 17649 } 17650 }); 17651 } 17652} 17653function normalizeContainer(container) { 17654 if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(container)) { 17655 const res = document.querySelector(container); 17656 if ( true && !res) { 17657 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( 17658 `Failed to mount app: mount target selector "${container}" returned null.` 17659 ); 17660 } 17661 return res; 17662 } 17663 if ( true && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { 17664 (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( 17665 `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` 17666 ); 17667 } 17668 return container; 17669} 17670let ssrDirectiveInitialized = false; 17671const initDirectivesForSSR = () => { 17672 if (!ssrDirectiveInitialized) { 17673 ssrDirectiveInitialized = true; 17674 initVModelForSSR(); 17675 initVShowForSSR(); 17676 } 17677} ; 17678 17679 17680 17681 17682/***/ }), 17683
vendor: 24,797 bytes, lines 17684-18242
17684/***/ "./node_modules/@vue/shared/dist/shared.esm-bundler.js": 17685/*!*************************************************************!*\ 17686 !*** ./node_modules/@vue/shared/dist/shared.esm-bundler.js ***! 17687 \*************************************************************/ 17688/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 17689 17690"use strict"; 17691__webpack_require__.r(__webpack_exports__); 17692/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17693/* harmony export */ EMPTY_ARR: () => (/* binding */ EMPTY_ARR), 17694/* harmony export */ EMPTY_OBJ: () => (/* binding */ EMPTY_OBJ), 17695/* harmony export */ NO: () => (/* binding */ NO), 17696/* harmony export */ NOOP: () => (/* binding */ NOOP), 17697/* harmony export */ PatchFlagNames: () => (/* binding */ PatchFlagNames), 17698/* harmony export */ PatchFlags: () => (/* binding */ PatchFlags), 17699/* harmony export */ ShapeFlags: () => (/* binding */ ShapeFlags), 17700/* harmony export */ SlotFlags: () => (/* binding */ SlotFlags), 17701/* harmony export */ camelize: () => (/* binding */ camelize), 17702/* harmony export */ capitalize: () => (/* binding */ capitalize), 17703/* harmony export */ def: () => (/* binding */ def), 17704/* harmony export */ escapeHtml: () => (/* binding */ escapeHtml), 17705/* harmony export */ escapeHtmlComment: () => (/* binding */ escapeHtmlComment), 17706/* harmony export */ extend: () => (/* binding */ extend), 17707/* harmony export */ genPropsAccessExp: () => (/* binding */ genPropsAccessExp), 17708/* harmony export */ generateCodeFrame: () => (/* binding */ generateCodeFrame), 17709/* harmony export */ getGlobalThis: () => (/* binding */ getGlobalThis), 17710/* harmony export */ hasChanged: () => (/* binding */ hasChanged), 17711/* harmony export */ hasOwn: () => (/* binding */ hasOwn), 17712/* harmony export */ hyphenate: () => (/* binding */ hyphenate), 17713/* harmony export */ includeBooleanAttr: () => (/* binding */ includeBooleanAttr), 17714/* harmony export */ invokeArrayFns: () => (/* binding */ invokeArrayFns), 17715/* harmony export */ isArray: () => (/* binding */ isArray), 17716/* harmony export */ isBooleanAttr: () => (/* binding */ isBooleanAttr), 17717/* harmony export */ isBuiltInDirective: () => (/* binding */ isBuiltInDirective), 17718/* harmony export */ isDate: () => (/* binding */ isDate), 17719/* harmony export */ isFunction: () => (/* binding */ isFunction), 17720/* harmony export */ isGloballyAllowed: () => (/* binding */ isGloballyAllowed), 17721/* harmony export */ isGloballyWhitelisted: () => (/* binding */ isGloballyWhitelisted), 17722/* harmony export */ isHTMLTag: () => (/* binding */ isHTMLTag), 17723/* harmony export */ isIntegerKey: () => (/* binding */ isIntegerKey), 17724/* harmony export */ isKnownHtmlAttr: () => (/* binding */ isKnownHtmlAttr), 17725/* harmony export */ isKnownSvgAttr: () => (/* binding */ isKnownSvgAttr), 17726/* harmony export */ isMap: () => (/* binding */ isMap), 17727/* harmony export */ isMathMLTag: () => (/* binding */ isMathMLTag), 17728/* harmony export */ isModelListener: () => (/* binding */ isModelListener), 17729/* harmony export */ isObject: () => (/* binding */ isObject), 17730/* harmony export */ isOn: () => (/* binding */ isOn), 17731/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject), 17732/* harmony export */ isPromise: () => (/* binding */ isPromise), 17733/* harmony export */ isRegExp: () => (/* binding */ isRegExp), 17734/* harmony export */ isReservedProp: () => (/* binding */ isReservedProp), 17735/* harmony export */ isSSRSafeAttrName: () => (/* binding */ isSSRSafeAttrName), 17736/* harmony export */ isSVGTag: () => (/* binding */ isSVGTag), 17737/* harmony export */ isSet: () => (/* binding */ isSet), 17738/* harmony export */ isSpecialBooleanAttr: () => (/* binding */ isSpecialBooleanAttr), 17739/* harmony export */ isString: () => (/* binding */ isString), 17740/* harmony export */ isSymbol: () => (/* binding */ isSymbol), 17741/* harmony export */ isVoidTag: () => (/* binding */ isVoidTag), 17742/* harmony export */ looseEqual: () => (/* binding */ looseEqual), 17743/* harmony export */ looseIndexOf: () => (/* binding */ looseIndexOf), 17744/* harmony export */ looseToNumber: () => (/* binding */ looseToNumber), 17745/* harmony export */ makeMap: () => (/* binding */ makeMap), 17746/* harmony export */ normalizeClass: () => (/* binding */ normalizeClass), 17747/* harmony export */ normalizeProps: () => (/* binding */ normalizeProps), 17748/* harmony export */ normalizeStyle: () => (/* binding */ normalizeStyle), 17749/* harmony export */ objectToString: () => (/* binding */ objectToString), 17750/* harmony export */ parseStringStyle: () => (/* binding */ parseStringStyle), 17751/* harmony export */ propsToAttrMap: () => (/* binding */ propsToAttrMap), 17752/* harmony export */ remove: () => (/* binding */ remove), 17753/* harmony export */ slotFlagsText: () => (/* binding */ slotFlagsText), 17754/* harmony export */ stringifyStyle: () => (/* binding */ stringifyStyle), 17755/* harmony export */ toDisplayString: () => (/* binding */ toDisplayString), 17756/* harmony export */ toHandlerKey: () => (/* binding */ toHandlerKey), 17757/* harmony export */ toNumber: () => (/* binding */ toNumber), 17758/* harmony export */ toRawType: () => (/* binding */ toRawType), 17759/* harmony export */ toTypeString: () => (/* binding */ toTypeString) 17760/* harmony export */ }); 17761function makeMap(str, expectsLowerCase) { 17762 const set = new Set(str.split(",")); 17763 return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val); 17764} 17765 17766const EMPTY_OBJ = true ? Object.freeze({}) : 0; 17767const EMPTY_ARR = true ? Object.freeze([]) : 0; 17768const NOOP = () => { 17769}; 17770const NO = () => false; 17771const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter 17772(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); 17773const isModelListener = (key) => key.startsWith("onUpdate:"); 17774const extend = Object.assign; 17775const remove = (arr, el) => { 17776 const i = arr.indexOf(el); 17777 if (i > -1) { 17778 arr.splice(i, 1); 17779 } 17780}; 17781const hasOwnProperty = Object.prototype.hasOwnProperty; 17782const hasOwn = (val, key) => hasOwnProperty.call(val, key); 17783const isArray = Array.isArray; 17784const isMap = (val) => toTypeString(val) === "[object Map]"; 17785const isSet = (val) => toTypeString(val) === "[object Set]"; 17786const isDate = (val) => toTypeString(val) === "[object Date]"; 17787const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; 17788const isFunction = (val) => typeof val === "function"; 17789const isString = (val) => typeof val === "string"; 17790const isSymbol = (val) => typeof val === "symbol"; 17791const isObject = (val) => val !== null && typeof val === "object"; 17792const isPromise = (val) => { 17793 return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); 17794}; 17795const objectToString = Object.prototype.toString; 17796const toTypeString = (value) => objectToString.call(value); 17797const toRawType = (value) => { 17798 return toTypeString(value).slice(8, -1); 17799}; 17800const isPlainObject = (val) => toTypeString(val) === "[object Object]"; 17801const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; 17802const isReservedProp = /* @__PURE__ */ makeMap( 17803 // the leading comma is intentional so empty string "" is also included 17804 ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" 17805); 17806const isBuiltInDirective = /* @__PURE__ */ makeMap( 17807 "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" 17808); 17809const cacheStringFunction = (fn) => { 17810 const cache = /* @__PURE__ */ Object.create(null); 17811 return (str) => { 17812 const hit = cache[str]; 17813 return hit || (cache[str] = fn(str)); 17814 }; 17815}; 17816const camelizeRE = /-(\w)/g; 17817const camelize = cacheStringFunction((str) => { 17818 return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); 17819}); 17820const hyphenateRE = /\B([A-Z])/g; 17821const hyphenate = cacheStringFunction( 17822 (str) => str.replace(hyphenateRE, "-$1").toLowerCase() 17823); 17824const capitalize = cacheStringFunction((str) => { 17825 return str.charAt(0).toUpperCase() + str.slice(1); 17826}); 17827const toHandlerKey = cacheStringFunction((str) => { 17828 const s = str ? `on${capitalize(str)}` : ``; 17829 return s; 17830}); 17831const hasChanged = (value, oldValue) => !Object.is(value, oldValue); 17832const invokeArrayFns = (fns, arg) => { 17833 for (let i = 0; i < fns.length; i++) { 17834 fns[i](arg); 17835 } 17836}; 17837const def = (obj, key, value) => { 17838 Object.defineProperty(obj, key, { 17839 configurable: true, 17840 enumerable: false, 17841 value 17842 }); 17843}; 17844const looseToNumber = (val) => { 17845 const n = parseFloat(val); 17846 return isNaN(n) ? val : n; 17847}; 17848const toNumber = (val) => { 17849 const n = isString(val) ? Number(val) : NaN; 17850 return isNaN(n) ? val : n; 17851}; 17852let _globalThis; 17853const getGlobalThis = () => { 17854 return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : {}); 17855}; 17856const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; 17857function genPropsAccessExp(name) { 17858 return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`; 17859} 17860 17861const PatchFlags = { 17862 "TEXT": 1, 17863 "1": "TEXT", 17864 "CLASS": 2, 17865 "2": "CLASS", 17866 "STYLE": 4, 17867 "4": "STYLE", 17868 "PROPS": 8, 17869 "8": "PROPS", 17870 "FULL_PROPS": 16, 17871 "16": "FULL_PROPS", 17872 "NEED_HYDRATION": 32, 17873 "32": "NEED_HYDRATION", 17874 "STABLE_FRAGMENT": 64, 17875 "64": "STABLE_FRAGMENT", 17876 "KEYED_FRAGMENT": 128, 17877 "128": "KEYED_FRAGMENT", 17878 "UNKEYED_FRAGMENT": 256, 17879 "256": "UNKEYED_FRAGMENT", 17880 "NEED_PATCH": 512, 17881 "512": "NEED_PATCH", 17882 "DYNAMIC_SLOTS": 1024, 17883 "1024": "DYNAMIC_SLOTS", 17884 "DEV_ROOT_FRAGMENT": 2048, 17885 "2048": "DEV_ROOT_FRAGMENT", 17886 "HOISTED": -1, 17887 "-1": "HOISTED", 17888 "BAIL": -2, 17889 "-2": "BAIL" 17890}; 17891const PatchFlagNames = { 17892 [1]: `TEXT`, 17893 [2]: `CLASS`, 17894 [4]: `STYLE`, 17895 [8]: `PROPS`, 17896 [16]: `FULL_PROPS`, 17897 [32]: `NEED_HYDRATION`, 17898 [64]: `STABLE_FRAGMENT`, 17899 [128]: `KEYED_FRAGMENT`, 17900 [256]: `UNKEYED_FRAGMENT`, 17901 [512]: `NEED_PATCH`, 17902 [1024]: `DYNAMIC_SLOTS`, 17903 [2048]: `DEV_ROOT_FRAGMENT`, 17904 [-1]: `HOISTED`, 17905 [-2]: `BAIL` 17906}; 17907 17908const ShapeFlags = { 17909 "ELEMENT": 1, 17910 "1": "ELEMENT", 17911 "FUNCTIONAL_COMPONENT": 2, 17912 "2": "FUNCTIONAL_COMPONENT", 17913 "STATEFUL_COMPONENT": 4, 17914 "4": "STATEFUL_COMPONENT", 17915 "TEXT_CHILDREN": 8, 17916 "8": "TEXT_CHILDREN", 17917 "ARRAY_CHILDREN": 16, 17918 "16": "ARRAY_CHILDREN", 17919 "SLOTS_CHILDREN": 32, 17920 "32": "SLOTS_CHILDREN", 17921 "TELEPORT": 64, 17922 "64": "TELEPORT", 17923 "SUSPENSE": 128, 17924 "128": "SUSPENSE", 17925 "COMPONENT_SHOULD_KEEP_ALIVE": 256, 17926 "256": "COMPONENT_SHOULD_KEEP_ALIVE", 17927 "COMPONENT_KEPT_ALIVE": 512, 17928 "512": "COMPONENT_KEPT_ALIVE", 17929 "COMPONENT": 6, 17930 "6": "COMPONENT" 17931}; 17932 17933const SlotFlags = { 17934 "STABLE": 1, 17935 "1": "STABLE", 17936 "DYNAMIC": 2, 17937 "2": "DYNAMIC", 17938 "FORWARDED": 3, 17939 "3": "FORWARDED" 17940}; 17941const slotFlagsText = { 17942 [1]: "STABLE", 17943 [2]: "DYNAMIC", 17944 [3]: "FORWARDED" 17945}; 17946 17947const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error"; 17948const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); 17949const isGloballyWhitelisted = isGloballyAllowed; 17950 17951const range = 2; 17952function generateCodeFrame(source, start = 0, end = source.length) { 17953 let lines = source.split(/(\r?\n)/); 17954 const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); 17955 lines = lines.filter((_, idx) => idx % 2 === 0); 17956 let count = 0; 17957 const res = []; 17958 for (let i = 0; i < lines.length; i++) { 17959 count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); 17960 if (count >= start) { 17961 for (let j = i - range; j <= i + range || end > count; j++) { 17962 if (j < 0 || j >= lines.length) 17963 continue; 17964 const line = j + 1; 17965 res.push( 17966 `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` 17967 ); 17968 const lineLength = lines[j].length; 17969 const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; 17970 if (j === i) { 17971 const pad = start - (count - (lineLength + newLineSeqLength)); 17972 const length = Math.max( 17973 1, 17974 end > count ? lineLength - pad : end - start 17975 ); 17976 res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); 17977 } else if (j > i) { 17978 if (end > count) { 17979 const length = Math.max(Math.min(end - count, lineLength), 1); 17980 res.push(` | ` + "^".repeat(length)); 17981 } 17982 count += lineLength + newLineSeqLength; 17983 } 17984 } 17985 break; 17986 } 17987 } 17988 return res.join("\n"); 17989} 17990 17991function normalizeStyle(value) { 17992 if (isArray(value)) { 17993 const res = {}; 17994 for (let i = 0; i < value.length; i++) { 17995 const item = value[i]; 17996 const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); 17997 if (normalized) { 17998 for (const key in normalized) { 17999 res[key] = normalized[key]; 18000 } 18001 } 18002 } 18003 return res; 18004 } else if (isString(value) || isObject(value)) { 18005 return value; 18006 } 18007} 18008const listDelimiterRE = /;(?![^(]*\))/g; 18009const propertyDelimiterRE = /:([^]+)/; 18010const styleCommentRE = /\/\*[^]*?\*\//g; 18011function parseStringStyle(cssText) { 18012 const ret = {}; 18013 cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { 18014 if (item) { 18015 const tmp = item.split(propertyDelimiterRE); 18016 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); 18017 } 18018 }); 18019 return ret; 18020} 18021function stringifyStyle(styles) { 18022 let ret = ""; 18023 if (!styles || isString(styles)) { 18024 return ret; 18025 } 18026 for (const key in styles) { 18027 const value = styles[key]; 18028 const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); 18029 if (isString(value) || typeof value === "number") { 18030 ret += `${normalizedKey}:${value};`; 18031 } 18032 } 18033 return ret; 18034} 18035function normalizeClass(value) { 18036 let res = ""; 18037 if (isString(value)) { 18038 res = value; 18039 } else if (isArray(value)) { 18040 for (let i = 0; i < value.length; i++) { 18041 const normalized = normalizeClass(value[i]); 18042 if (normalized) { 18043 res += normalized + " "; 18044 } 18045 } 18046 } else if (isObject(value)) { 18047 for (const name in value) { 18048 if (value[name]) { 18049 res += name + " "; 18050 } 18051 } 18052 } 18053 return res.trim(); 18054} 18055function normalizeProps(props) { 18056 if (!props) 18057 return null; 18058 let { class: klass, style } = props; 18059 if (klass && !isString(klass)) { 18060 props.class = normalizeClass(klass); 18061 } 18062 if (style) { 18063 props.style = normalizeStyle(style); 18064 } 18065 return props; 18066} 18067 18068const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; 18069const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,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,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; 18070const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; 18071const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; 18072const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); 18073const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); 18074const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); 18075const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); 18076 18077const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; 18078const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); 18079const isBooleanAttr = /* @__PURE__ */ makeMap( 18080 specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` 18081); 18082function includeBooleanAttr(value) { 18083 return !!value || value === ""; 18084} 18085const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; 18086const attrValidationCache = {}; 18087function isSSRSafeAttrName(name) { 18088 if (attrValidationCache.hasOwnProperty(name)) { 18089 return attrValidationCache[name]; 18090 } 18091 const isUnsafe = unsafeAttrCharRE.test(name); 18092 if (isUnsafe) { 18093 console.error(`unsafe attribute name: ${name}`); 18094 } 18095 return attrValidationCache[name] = !isUnsafe; 18096} 18097const propsToAttrMap = { 18098 acceptCharset: "accept-charset", 18099 className: "class", 18100 htmlFor: "for", 18101 httpEquiv: "http-equiv" 18102}; 18103const isKnownHtmlAttr = /* @__PURE__ */ makeMap( 18104 `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` 18105); 18106const isKnownSvgAttr = /* @__PURE__ */ makeMap( 18107 `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` 18108); 18109 18110const escapeRE = /["'&<>]/; 18111function escapeHtml(string) { 18112 const str = "" + string; 18113 const match = escapeRE.exec(str); 18114 if (!match) { 18115 return str; 18116 } 18117 let html = ""; 18118 let escaped; 18119 let index; 18120 let lastIndex = 0; 18121 for (index = match.index; index < str.length; index++) { 18122 switch (str.charCodeAt(index)) { 18123 case 34: 18124 escaped = """; 18125 break; 18126 case 38: 18127 escaped = "&"; 18128 break; 18129 case 39: 18130 escaped = "'"; 18131 break; 18132 case 60: 18133 escaped = "<"; 18134 break; 18135 case 62: 18136 escaped = ">"; 18137 break; 18138 default: 18139 continue; 18140 } 18141 if (lastIndex !== index) { 18142 html += str.slice(lastIndex, index); 18143 } 18144 lastIndex = index + 1; 18145 html += escaped; 18146 } 18147 return lastIndex !== index ? html + str.slice(lastIndex, index) : html; 18148} 18149const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; 18150function escapeHtmlComment(src) { 18151 return src.replace(commentStripRE, ""); 18152} 18153 18154function looseCompareArrays(a, b) { 18155 if (a.length !== b.length) 18156 return false; 18157 let equal = true; 18158 for (let i = 0; equal && i < a.length; i++) { 18159 equal = looseEqual(a[i], b[i]); 18160 } 18161 return equal; 18162} 18163function looseEqual(a, b) { 18164 if (a === b) 18165 return true; 18166 let aValidType = isDate(a); 18167 let bValidType = isDate(b); 18168 if (aValidType || bValidType) { 18169 return aValidType && bValidType ? a.getTime() === b.getTime() : false; 18170 } 18171 aValidType = isSymbol(a); 18172 bValidType = isSymbol(b); 18173 if (aValidType || bValidType) { 18174 return a === b; 18175 } 18176 aValidType = isArray(a); 18177 bValidType = isArray(b); 18178 if (aValidType || bValidType) { 18179 return aValidType && bValidType ? looseCompareArrays(a, b) : false; 18180 } 18181 aValidType = isObject(a); 18182 bValidType = isObject(b); 18183 if (aValidType || bValidType) { 18184 if (!aValidType || !bValidType) { 18185 return false; 18186 } 18187 const aKeysCount = Object.keys(a).length; 18188 const bKeysCount = Object.keys(b).length; 18189 if (aKeysCount !== bKeysCount) { 18190 return false; 18191 } 18192 for (const key in a) { 18193 const aHasKey = a.hasOwnProperty(key); 18194 const bHasKey = b.hasOwnProperty(key); 18195 if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { 18196 return false; 18197 } 18198 } 18199 } 18200 return String(a) === String(b); 18201} 18202function looseIndexOf(arr, val) { 18203 return arr.findIndex((item) => looseEqual(item, val)); 18204} 18205 18206const toDisplayString = (val) => { 18207 return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); 18208}; 18209const replacer = (_key, val) => { 18210 if (val && val.__v_isRef) { 18211 return replacer(_key, val.value); 18212 } else if (isMap(val)) { 18213 return { 18214 [`Map(${val.size})`]: [...val.entries()].reduce( 18215 (entries, [key, val2], i) => { 18216 entries[stringifySymbol(key, i) + " =>"] = val2; 18217 return entries; 18218 }, 18219 {} 18220 ) 18221 }; 18222 } else if (isSet(val)) { 18223 return { 18224 [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) 18225 }; 18226 } else if (isSymbol(val)) { 18227 return stringifySymbol(val); 18228 } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { 18229 return String(val); 18230 } 18231 return val; 18232}; 18233const stringifySymbol = (v, i = "") => { 18234 var _a; 18235 return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v; 18236}; 18237 18238 18239 18240 18241/***/ }), 18242
vendor: 342 bytes, lines 18243-18252
18243/***/ "./node_modules/axios/index.js": 18244/*!*************************************!*\ 18245 !*** ./node_modules/axios/index.js ***! 18246 \*************************************/ 18247/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18248 18249module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); 18250 18251/***/ }), 18252
vendor: 7,910 bytes, lines 18253-18475
18253/***/ "./node_modules/axios/lib/adapters/xhr.js": 18254/*!************************************************!*\ 18255 !*** ./node_modules/axios/lib/adapters/xhr.js ***! 18256 \************************************************/ 18257/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18258 18259"use strict"; 18260 18261 18262var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 18263var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); 18264var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); 18265var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); 18266var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); 18267var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); 18268var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); 18269var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); 18270var transitionalDefaults = __webpack_require__(/*! ../defaults/transitional */ "./node_modules/axios/lib/defaults/transitional.js"); 18271var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 18272 18273module.exports = function xhrAdapter(config) { 18274 return new Promise(function dispatchXhrRequest(resolve, reject) { 18275 var requestData = config.data; 18276 var requestHeaders = config.headers; 18277 var responseType = config.responseType; 18278 var onCanceled; 18279 function done() { 18280 if (config.cancelToken) { 18281 config.cancelToken.unsubscribe(onCanceled); 18282 } 18283 18284 if (config.signal) { 18285 config.signal.removeEventListener('abort', onCanceled); 18286 } 18287 } 18288 18289 if (utils.isFormData(requestData)) { 18290 delete requestHeaders['Content-Type']; // Let the browser set it 18291 } 18292 18293 var request = new XMLHttpRequest(); 18294 18295 // HTTP basic authentication 18296 if (config.auth) { 18297 var username = config.auth.username || ''; 18298 var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; 18299 requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); 18300 } 18301 18302 var fullPath = buildFullPath(config.baseURL, config.url); 18303 request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); 18304 18305 // Set the request timeout in MS 18306 request.timeout = config.timeout; 18307 18308 function onloadend() { 18309 if (!request) { 18310 return; 18311 } 18312 // Prepare the response 18313 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; 18314 var responseData = !responseType || responseType === 'text' || responseType === 'json' ? 18315 request.responseText : request.response; 18316 var response = { 18317 data: responseData, 18318 status: request.status, 18319 statusText: request.statusText, 18320 headers: responseHeaders, 18321 config: config, 18322 request: request 18323 }; 18324 18325 settle(function _resolve(value) { 18326 resolve(value); 18327 done(); 18328 }, function _reject(err) { 18329 reject(err); 18330 done(); 18331 }, response); 18332 18333 // Clean up request 18334 request = null; 18335 } 18336 18337 if ('onloadend' in request) { 18338 // Use onloadend if available 18339 request.onloadend = onloadend; 18340 } else { 18341 // Listen for ready state to emulate onloadend 18342 request.onreadystatechange = function handleLoad() { 18343 if (!request || request.readyState !== 4) { 18344 return; 18345 } 18346 18347 // The request errored out and we didn't get a response, this will be 18348 // handled by onerror instead 18349 // With one exception: request that using file: protocol, most browsers 18350 // will return status as 0 even though it's a successful request 18351 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { 18352 return; 18353 } 18354 // readystate handler is calling before onerror or ontimeout handlers, 18355 // so we should call onloadend on the next 'tick' 18356 setTimeout(onloadend); 18357 }; 18358 } 18359 18360 // Handle browser request cancellation (as opposed to a manual cancellation) 18361 request.onabort = function handleAbort() { 18362 if (!request) { 18363 return; 18364 } 18365 18366 reject(createError('Request aborted', config, 'ECONNABORTED', request)); 18367 18368 // Clean up request 18369 request = null; 18370 }; 18371 18372 // Handle low level network errors 18373 request.onerror = function handleError() { 18374 // Real errors are hidden from us by the browser 18375 // onerror should only fire if it's a network error 18376 reject(createError('Network Error', config, null, request)); 18377 18378 // Clean up request 18379 request = null; 18380 }; 18381 18382 // Handle timeout 18383 request.ontimeout = function handleTimeout() { 18384 var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; 18385 var transitional = config.transitional || transitionalDefaults; 18386 if (config.timeoutErrorMessage) { 18387 timeoutErrorMessage = config.timeoutErrorMessage; 18388 } 18389 reject(createError( 18390 timeoutErrorMessage, 18391 config, 18392 transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', 18393 request)); 18394 18395 // Clean up request 18396 request = null; 18397 }; 18398 18399 // Add xsrf header 18400 // This is only done if running in a standard browser environment. 18401 // Specifically not if we're in a web worker, or react-native. 18402 if (utils.isStandardBrowserEnv()) { 18403 // Add xsrf header 18404 var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? 18405 cookies.read(config.xsrfCookieName) : 18406 undefined; 18407 18408 if (xsrfValue) { 18409 requestHeaders[config.xsrfHeaderName] = xsrfValue; 18410 } 18411 } 18412 18413 // Add headers to the request 18414 if ('setRequestHeader' in request) { 18415 utils.forEach(requestHeaders, function setRequestHeader(val, key) { 18416 if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { 18417 // Remove Content-Type if data is undefined 18418 delete requestHeaders[key]; 18419 } else { 18420 // Otherwise add header to the request 18421 request.setRequestHeader(key, val); 18422 } 18423 }); 18424 } 18425 18426 // Add withCredentials to request if needed 18427 if (!utils.isUndefined(config.withCredentials)) { 18428 request.withCredentials = !!config.withCredentials; 18429 } 18430 18431 // Add responseType to request if needed 18432 if (responseType && responseType !== 'json') { 18433 request.responseType = config.responseType; 18434 } 18435 18436 // Handle progress if needed 18437 if (typeof config.onDownloadProgress === 'function') { 18438 request.addEventListener('progress', config.onDownloadProgress); 18439 } 18440 18441 // Not all browsers support upload events 18442 if (typeof config.onUploadProgress === 'function' && request.upload) { 18443 request.upload.addEventListener('progress', config.onUploadProgress); 18444 } 18445 18446 if (config.cancelToken || config.signal) { 18447 // Handle cancellation 18448 // eslint-disable-next-line func-names 18449 onCanceled = function(cancel) { 18450 if (!request) { 18451 return; 18452 } 18453 reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel); 18454 request.abort(); 18455 request = null; 18456 }; 18457 18458 config.cancelToken && config.cancelToken.subscribe(onCanceled); 18459 if (config.signal) { 18460 config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); 18461 } 18462 } 18463 18464 if (!requestData) { 18465 requestData = null; 18466 } 18467 18468 // Send the request 18469 request.send(requestData); 18470 }); 18471}; 18472 18473 18474/***/ }), 18475
vendor: 2,504 bytes, lines 18476-18543
18476/***/ "./node_modules/axios/lib/axios.js": 18477/*!*****************************************!*\ 18478 !*** ./node_modules/axios/lib/axios.js ***! 18479 \*****************************************/ 18480/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18481 18482"use strict"; 18483 18484 18485var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); 18486var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); 18487var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); 18488var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); 18489var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults/index.js"); 18490 18491/** 18492 * Create an instance of Axios 18493 * 18494 * @param {Object} defaultConfig The default config for the instance 18495 * @return {Axios} A new instance of Axios 18496 */ 18497function createInstance(defaultConfig) { 18498 var context = new Axios(defaultConfig); 18499 var instance = bind(Axios.prototype.request, context); 18500 18501 // Copy axios.prototype to instance 18502 utils.extend(instance, Axios.prototype, context); 18503 18504 // Copy context to instance 18505 utils.extend(instance, context); 18506 18507 // Factory for creating new instances 18508 instance.create = function create(instanceConfig) { 18509 return createInstance(mergeConfig(defaultConfig, instanceConfig)); 18510 }; 18511 18512 return instance; 18513} 18514 18515// Create the default instance to be exported 18516var axios = createInstance(defaults); 18517 18518// Expose Axios class to allow class inheritance 18519axios.Axios = Axios; 18520 18521// Expose Cancel & CancelToken 18522axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 18523axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); 18524axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); 18525axios.VERSION = (__webpack_require__(/*! ./env/data */ "./node_modules/axios/lib/env/data.js").version); 18526 18527// Expose all/spread 18528axios.all = function all(promises) { 18529 return Promise.all(promises); 18530}; 18531axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); 18532 18533// Expose isAxiosError 18534axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js"); 18535 18536module.exports = axios; 18537 18538// Allow use of default import syntax in TypeScript 18539module.exports["default"] = axios; 18540 18541 18542/***/ }), 18543
vendor: 636 bytes, lines 18544-18573
18544/***/ "./node_modules/axios/lib/cancel/Cancel.js": 18545/*!*************************************************!*\ 18546 !*** ./node_modules/axios/lib/cancel/Cancel.js ***! 18547 \*************************************************/ 18548/***/ ((module) => { 18549 18550"use strict"; 18551 18552 18553/** 18554 * A `Cancel` is an object that is thrown when an operation is canceled. 18555 * 18556 * @class 18557 * @param {string=} message The message. 18558 */ 18559function Cancel(message) { 18560 this.message = message; 18561} 18562 18563Cancel.prototype.toString = function toString() { 18564 return 'Cancel' + (this.message ? ': ' + this.message : ''); 18565}; 18566 18567Cancel.prototype.__CANCEL__ = true; 18568 18569module.exports = Cancel; 18570 18571 18572/***/ }), 18573
vendor: 2,848 bytes, lines 18574-18703
18574/***/ "./node_modules/axios/lib/cancel/CancelToken.js": 18575/*!******************************************************!*\ 18576 !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! 18577 \******************************************************/ 18578/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18579 18580"use strict"; 18581 18582 18583var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 18584 18585/** 18586 * A `CancelToken` is an object that can be used to request cancellation of an operation. 18587 * 18588 * @class 18589 * @param {Function} executor The executor function. 18590 */ 18591function CancelToken(executor) { 18592 if (typeof executor !== 'function') { 18593 throw new TypeError('executor must be a function.'); 18594 } 18595 18596 var resolvePromise; 18597 18598 this.promise = new Promise(function promiseExecutor(resolve) { 18599 resolvePromise = resolve; 18600 }); 18601 18602 var token = this; 18603 18604 // eslint-disable-next-line func-names 18605 this.promise.then(function(cancel) { 18606 if (!token._listeners) return; 18607 18608 var i; 18609 var l = token._listeners.length; 18610 18611 for (i = 0; i < l; i++) { 18612 token._listeners[i](cancel); 18613 } 18614 token._listeners = null; 18615 }); 18616 18617 // eslint-disable-next-line func-names 18618 this.promise.then = function(onfulfilled) { 18619 var _resolve; 18620 // eslint-disable-next-line func-names 18621 var promise = new Promise(function(resolve) { 18622 token.subscribe(resolve); 18623 _resolve = resolve; 18624 }).then(onfulfilled); 18625 18626 promise.cancel = function reject() { 18627 token.unsubscribe(_resolve); 18628 }; 18629 18630 return promise; 18631 }; 18632 18633 executor(function cancel(message) { 18634 if (token.reason) { 18635 // Cancellation has already been requested 18636 return; 18637 } 18638 18639 token.reason = new Cancel(message); 18640 resolvePromise(token.reason); 18641 }); 18642} 18643 18644/** 18645 * Throws a `Cancel` if cancellation has been requested. 18646 */ 18647CancelToken.prototype.throwIfRequested = function throwIfRequested() { 18648 if (this.reason) { 18649 throw this.reason; 18650 } 18651}; 18652 18653/** 18654 * Subscribe to the cancel signal 18655 */ 18656 18657CancelToken.prototype.subscribe = function subscribe(listener) { 18658 if (this.reason) { 18659 listener(this.reason); 18660 return; 18661 } 18662 18663 if (this._listeners) { 18664 this._listeners.push(listener); 18665 } else { 18666 this._listeners = [listener]; 18667 } 18668}; 18669 18670/** 18671 * Unsubscribe from the cancel signal 18672 */ 18673 18674CancelToken.prototype.unsubscribe = function unsubscribe(listener) { 18675 if (!this._listeners) { 18676 return; 18677 } 18678 var index = this._listeners.indexOf(listener); 18679 if (index !== -1) { 18680 this._listeners.splice(index, 1); 18681 } 18682}; 18683 18684/** 18685 * Returns an object that contains a new `CancelToken` and a function that, when called, 18686 * cancels the `CancelToken`. 18687 */ 18688CancelToken.source = function source() { 18689 var cancel; 18690 var token = new CancelToken(function executor(c) { 18691 cancel = c; 18692 }); 18693 return { 18694 token: token, 18695 cancel: cancel 18696 }; 18697}; 18698 18699module.exports = CancelToken; 18700 18701 18702/***/ }), 18703
vendor: 361 bytes, lines 18704-18719
18704/***/ "./node_modules/axios/lib/cancel/isCancel.js": 18705/*!***************************************************!*\ 18706 !*** ./node_modules/axios/lib/cancel/isCancel.js ***! 18707 \***************************************************/ 18708/***/ ((module) => { 18709 18710"use strict"; 18711 18712 18713module.exports = function isCancel(value) { 18714 return !!(value && value.__CANCEL__); 18715}; 18716 18717 18718/***/ }), 18719
vendor: 4,908 bytes, lines 18720-18878
18720/***/ "./node_modules/axios/lib/core/Axios.js": 18721/*!**********************************************!*\ 18722 !*** ./node_modules/axios/lib/core/Axios.js ***! 18723 \**********************************************/ 18724/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18725 18726"use strict"; 18727 18728 18729var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 18730var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); 18731var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); 18732var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); 18733var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); 18734var validator = __webpack_require__(/*! ../helpers/validator */ "./node_modules/axios/lib/helpers/validator.js"); 18735 18736var validators = validator.validators; 18737/** 18738 * Create a new instance of Axios 18739 * 18740 * @param {Object} instanceConfig The default config for the instance 18741 */ 18742function Axios(instanceConfig) { 18743 this.defaults = instanceConfig; 18744 this.interceptors = { 18745 request: new InterceptorManager(), 18746 response: new InterceptorManager() 18747 }; 18748} 18749 18750/** 18751 * Dispatch a request 18752 * 18753 * @param {Object} config The config specific for this request (merged with this.defaults) 18754 */ 18755Axios.prototype.request = function request(configOrUrl, config) { 18756 /*eslint no-param-reassign:0*/ 18757 // Allow for axios('example/url'[, config]) a la fetch API 18758 if (typeof configOrUrl === 'string') { 18759 config = config || {}; 18760 config.url = configOrUrl; 18761 } else { 18762 config = configOrUrl || {}; 18763 } 18764 18765 config = mergeConfig(this.defaults, config); 18766 18767 // Set config.method 18768 if (config.method) { 18769 config.method = config.method.toLowerCase(); 18770 } else if (this.defaults.method) { 18771 config.method = this.defaults.method.toLowerCase(); 18772 } else { 18773 config.method = 'get'; 18774 } 18775 18776 var transitional = config.transitional; 18777 18778 if (transitional !== undefined) { 18779 validator.assertOptions(transitional, { 18780 silentJSONParsing: validators.transitional(validators.boolean), 18781 forcedJSONParsing: validators.transitional(validators.boolean), 18782 clarifyTimeoutError: validators.transitional(validators.boolean) 18783 }, false); 18784 } 18785 18786 // filter out skipped interceptors 18787 var requestInterceptorChain = []; 18788 var synchronousRequestInterceptors = true; 18789 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 18790 if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { 18791 return; 18792 } 18793 18794 synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; 18795 18796 requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); 18797 }); 18798 18799 var responseInterceptorChain = []; 18800 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 18801 responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); 18802 }); 18803 18804 var promise; 18805 18806 if (!synchronousRequestInterceptors) { 18807 var chain = [dispatchRequest, undefined]; 18808 18809 Array.prototype.unshift.apply(chain, requestInterceptorChain); 18810 chain = chain.concat(responseInterceptorChain); 18811 18812 promise = Promise.resolve(config); 18813 while (chain.length) { 18814 promise = promise.then(chain.shift(), chain.shift()); 18815 } 18816 18817 return promise; 18818 } 18819 18820 18821 var newConfig = config; 18822 while (requestInterceptorChain.length) { 18823 var onFulfilled = requestInterceptorChain.shift(); 18824 var onRejected = requestInterceptorChain.shift(); 18825 try { 18826 newConfig = onFulfilled(newConfig); 18827 } catch (error) { 18828 onRejected(error); 18829 break; 18830 } 18831 } 18832 18833 try { 18834 promise = dispatchRequest(newConfig); 18835 } catch (error) { 18836 return Promise.reject(error); 18837 } 18838 18839 while (responseInterceptorChain.length) { 18840 promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); 18841 } 18842 18843 return promise; 18844}; 18845 18846Axios.prototype.getUri = function getUri(config) { 18847 config = mergeConfig(this.defaults, config); 18848 return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); 18849}; 18850 18851// Provide aliases for supported request methods 18852utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { 18853 /*eslint func-names:0*/ 18854 Axios.prototype[method] = function(url, config) { 18855 return this.request(mergeConfig(config || {}, { 18856 method: method, 18857 url: url, 18858 data: (config || {}).data 18859 })); 18860 }; 18861}); 18862 18863utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 18864 /*eslint func-names:0*/ 18865 Axios.prototype[method] = function(url, data, config) { 18866 return this.request(mergeConfig(config || {}, { 18867 method: method, 18868 url: url, 18869 data: data 18870 })); 18871 }; 18872}); 18873 18874module.exports = Axios; 18875 18876 18877/***/ }), 18878
vendor: 1,754 bytes, lines 18879-18943
18879/***/ "./node_modules/axios/lib/core/InterceptorManager.js": 18880/*!***********************************************************!*\ 18881 !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! 18882 \***********************************************************/ 18883/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18884 18885"use strict"; 18886 18887 18888var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 18889 18890function InterceptorManager() { 18891 this.handlers = []; 18892} 18893 18894/** 18895 * Add a new interceptor to the stack 18896 * 18897 * @param {Function} fulfilled The function to handle `then` for a `Promise` 18898 * @param {Function} rejected The function to handle `reject` for a `Promise` 18899 * 18900 * @return {Number} An ID used to remove interceptor later 18901 */ 18902InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { 18903 this.handlers.push({ 18904 fulfilled: fulfilled, 18905 rejected: rejected, 18906 synchronous: options ? options.synchronous : false, 18907 runWhen: options ? options.runWhen : null 18908 }); 18909 return this.handlers.length - 1; 18910}; 18911 18912/** 18913 * Remove an interceptor from the stack 18914 * 18915 * @param {Number} id The ID that was returned by `use` 18916 */ 18917InterceptorManager.prototype.eject = function eject(id) { 18918 if (this.handlers[id]) { 18919 this.handlers[id] = null; 18920 } 18921}; 18922 18923/** 18924 * Iterate over all the registered interceptors 18925 * 18926 * This method is particularly useful for skipping over any 18927 * interceptors that may have become `null` calling `eject`. 18928 * 18929 * @param {Function} fn The function to call for each interceptor 18930 */ 18931InterceptorManager.prototype.forEach = function forEach(fn) { 18932 utils.forEach(this.handlers, function forEachHandler(h) { 18933 if (h !== null) { 18934 fn(h); 18935 } 18936 }); 18937}; 18938 18939module.exports = InterceptorManager; 18940 18941 18942/***/ }), 18943
vendor: 1,149 bytes, lines 18944-18974
18944/***/ "./node_modules/axios/lib/core/buildFullPath.js": 18945/*!******************************************************!*\ 18946 !*** ./node_modules/axios/lib/core/buildFullPath.js ***! 18947 \******************************************************/ 18948/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18949 18950"use strict"; 18951 18952 18953var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); 18954var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); 18955 18956/** 18957 * Creates a new URL by combining the baseURL with the requestedURL, 18958 * only when the requestedURL is not already an absolute URL. 18959 * If the requestURL is absolute, this function returns the requestedURL untouched. 18960 * 18961 * @param {string} baseURL The base URL 18962 * @param {string} requestedURL Absolute or relative URL to combine 18963 * @returns {string} The combined full path 18964 */ 18965module.exports = function buildFullPath(baseURL, requestedURL) { 18966 if (baseURL && !isAbsoluteURL(requestedURL)) { 18967 return combineURLs(baseURL, requestedURL); 18968 } 18969 return requestedURL; 18970}; 18971 18972 18973/***/ }), 18974
vendor: 1,000 bytes, lines 18975-19003
18975/***/ "./node_modules/axios/lib/core/createError.js": 18976/*!****************************************************!*\ 18977 !*** ./node_modules/axios/lib/core/createError.js ***! 18978 \****************************************************/ 18979/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18980 18981"use strict"; 18982 18983 18984var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); 18985 18986/** 18987 * Create an Error with the specified message, config, error code, request and response. 18988 * 18989 * @param {string} message The error message. 18990 * @param {Object} config The config. 18991 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 18992 * @param {Object} [request] The request. 18993 * @param {Object} [response] The response. 18994 * @returns {Error} The created error. 18995 */ 18996module.exports = function createError(message, config, code, request, response) { 18997 var error = new Error(message); 18998 return enhanceError(error, config, code, request, response); 18999}; 19000 19001 19002/***/ }), 19003
vendor: 2,753 bytes, lines 19004-19101
19004/***/ "./node_modules/axios/lib/core/dispatchRequest.js": 19005/*!********************************************************!*\ 19006 !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! 19007 \********************************************************/ 19008/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19009 19010"use strict"; 19011 19012 19013var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 19014var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); 19015var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); 19016var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js"); 19017var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 19018 19019/** 19020 * Throws a `Cancel` if cancellation has been requested. 19021 */ 19022function throwIfCancellationRequested(config) { 19023 if (config.cancelToken) { 19024 config.cancelToken.throwIfRequested(); 19025 } 19026 19027 if (config.signal && config.signal.aborted) { 19028 throw new Cancel('canceled'); 19029 } 19030} 19031 19032/** 19033 * Dispatch a request to the server using the configured adapter. 19034 * 19035 * @param {object} config The config that is to be used for the request 19036 * @returns {Promise} The Promise to be fulfilled 19037 */ 19038module.exports = function dispatchRequest(config) { 19039 throwIfCancellationRequested(config); 19040 19041 // Ensure headers exist 19042 config.headers = config.headers || {}; 19043 19044 // Transform request data 19045 config.data = transformData.call( 19046 config, 19047 config.data, 19048 config.headers, 19049 config.transformRequest 19050 ); 19051 19052 // Flatten headers 19053 config.headers = utils.merge( 19054 config.headers.common || {}, 19055 config.headers[config.method] || {}, 19056 config.headers 19057 ); 19058 19059 utils.forEach( 19060 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], 19061 function cleanHeaderConfig(method) { 19062 delete config.headers[method]; 19063 } 19064 ); 19065 19066 var adapter = config.adapter || defaults.adapter; 19067 19068 return adapter(config).then(function onAdapterResolution(response) { 19069 throwIfCancellationRequested(config); 19070 19071 // Transform response data 19072 response.data = transformData.call( 19073 config, 19074 response.data, 19075 response.headers, 19076 config.transformResponse 19077 ); 19078 19079 return response; 19080 }, function onAdapterRejection(reason) { 19081 if (!isCancel(reason)) { 19082 throwIfCancellationRequested(config); 19083 19084 // Transform response data 19085 if (reason && reason.response) { 19086 reason.response.data = transformData.call( 19087 config, 19088 reason.response.data, 19089 reason.response.headers, 19090 config.transformResponse 19091 ); 19092 } 19093 } 19094 19095 return Promise.reject(reason); 19096 }); 19097}; 19098 19099 19100/***/ }), 19101
vendor: 1,399 bytes, lines 19102-19155
19102/***/ "./node_modules/axios/lib/core/enhanceError.js": 19103/*!*****************************************************!*\ 19104 !*** ./node_modules/axios/lib/core/enhanceError.js ***! 19105 \*****************************************************/ 19106/***/ ((module) => { 19107 19108"use strict"; 19109 19110 19111/** 19112 * Update an Error with the specified config, error code, and response. 19113 * 19114 * @param {Error} error The error to update. 19115 * @param {Object} config The config. 19116 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 19117 * @param {Object} [request] The request. 19118 * @param {Object} [response] The response. 19119 * @returns {Error} The error. 19120 */ 19121module.exports = function enhanceError(error, config, code, request, response) { 19122 error.config = config; 19123 if (code) { 19124 error.code = code; 19125 } 19126 19127 error.request = request; 19128 error.response = response; 19129 error.isAxiosError = true; 19130 19131 error.toJSON = function toJSON() { 19132 return { 19133 // Standard 19134 message: this.message, 19135 name: this.name, 19136 // Microsoft 19137 description: this.description, 19138 number: this.number, 19139 // Mozilla 19140 fileName: this.fileName, 19141 lineNumber: this.lineNumber, 19142 columnNumber: this.columnNumber, 19143 stack: this.stack, 19144 // Axios 19145 config: this.config, 19146 code: this.code, 19147 status: this.response && this.response.status ? this.response.status : null 19148 }; 19149 }; 19150 return error; 19151}; 19152 19153 19154/***/ }), 19155
vendor: 3,558 bytes, lines 19156-19265
19156/***/ "./node_modules/axios/lib/core/mergeConfig.js": 19157/*!****************************************************!*\ 19158 !*** ./node_modules/axios/lib/core/mergeConfig.js ***! 19159 \****************************************************/ 19160/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19161 19162"use strict"; 19163 19164 19165var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); 19166 19167/** 19168 * Config-specific merge-function which creates a new config-object 19169 * by merging two configuration objects together. 19170 * 19171 * @param {Object} config1 19172 * @param {Object} config2 19173 * @returns {Object} New object resulting from merging config2 to config1 19174 */ 19175module.exports = function mergeConfig(config1, config2) { 19176 // eslint-disable-next-line no-param-reassign 19177 config2 = config2 || {}; 19178 var config = {}; 19179 19180 function getMergedValue(target, source) { 19181 if (utils.isPlainObject(target) && utils.isPlainObject(source)) { 19182 return utils.merge(target, source); 19183 } else if (utils.isPlainObject(source)) { 19184 return utils.merge({}, source); 19185 } else if (utils.isArray(source)) { 19186 return source.slice(); 19187 } 19188 return source; 19189 } 19190 19191 // eslint-disable-next-line consistent-return 19192 function mergeDeepProperties(prop) { 19193 if (!utils.isUndefined(config2[prop])) { 19194 return getMergedValue(config1[prop], config2[prop]); 19195 } else if (!utils.isUndefined(config1[prop])) { 19196 return getMergedValue(undefined, config1[prop]); 19197 } 19198 } 19199 19200 // eslint-disable-next-line consistent-return 19201 function valueFromConfig2(prop) { 19202 if (!utils.isUndefined(config2[prop])) { 19203 return getMergedValue(undefined, config2[prop]); 19204 } 19205 } 19206 19207 // eslint-disable-next-line consistent-return 19208 function defaultToConfig2(prop) { 19209 if (!utils.isUndefined(config2[prop])) { 19210 return getMergedValue(undefined, config2[prop]); 19211 } else if (!utils.isUndefined(config1[prop])) { 19212 return getMergedValue(undefined, config1[prop]); 19213 } 19214 } 19215 19216 // eslint-disable-next-line consistent-return 19217 function mergeDirectKeys(prop) { 19218 if (prop in config2) { 19219 return getMergedValue(config1[prop], config2[prop]); 19220 } else if (prop in config1) { 19221 return getMergedValue(undefined, config1[prop]); 19222 } 19223 } 19224 19225 var mergeMap = { 19226 'url': valueFromConfig2, 19227 'method': valueFromConfig2, 19228 'data': valueFromConfig2, 19229 'baseURL': defaultToConfig2, 19230 'transformRequest': defaultToConfig2, 19231 'transformResponse': defaultToConfig2, 19232 'paramsSerializer': defaultToConfig2, 19233 'timeout': defaultToConfig2, 19234 'timeoutMessage': defaultToConfig2, 19235 'withCredentials': defaultToConfig2, 19236 'adapter': defaultToConfig2, 19237 'responseType': defaultToConfig2, 19238 'xsrfCookieName': defaultToConfig2, 19239 'xsrfHeaderName': defaultToConfig2, 19240 'onUploadProgress': defaultToConfig2, 19241 'onDownloadProgress': defaultToConfig2, 19242 'decompress': defaultToConfig2, 19243 'maxContentLength': defaultToConfig2, 19244 'maxBodyLength': defaultToConfig2, 19245 'transport': defaultToConfig2, 19246 'httpAgent': defaultToConfig2, 19247 'httpsAgent': defaultToConfig2, 19248 'cancelToken': defaultToConfig2, 19249 'socketPath': defaultToConfig2, 19250 'responseEncoding': defaultToConfig2, 19251 'validateStatus': mergeDirectKeys 19252 }; 19253 19254 utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { 19255 var merge = mergeMap[prop] || mergeDeepProperties; 19256 var configValue = merge(prop); 19257 (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); 19258 }); 19259 19260 return config; 19261}; 19262 19263 19264/***/ }), 19265
vendor: 1,060 bytes, lines 19266-19301
19266/***/ "./node_modules/axios/lib/core/settle.js": 19267/*!***********************************************!*\ 19268 !*** ./node_modules/axios/lib/core/settle.js ***! 19269 \***********************************************/ 19270/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19271 19272"use strict"; 19273 19274 19275var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); 19276 19277/** 19278 * Resolve or reject a Promise based on response status. 19279 * 19280 * @param {Function} resolve A function that resolves the promise. 19281 * @param {Function} reject A function that rejects the promise. 19282 * @param {object} response The response. 19283 */ 19284module.exports = function settle(resolve, reject, response) { 19285 var validateStatus = response.config.validateStatus; 19286 if (!response.status || !validateStatus || validateStatus(response.status)) { 19287 resolve(response); 19288 } else { 19289 reject(createError( 19290 'Request failed with status code ' + response.status, 19291 response.config, 19292 null, 19293 response.request, 19294 response 19295 )); 19296 } 19297}; 19298 19299 19300/***/ }), 19301
vendor: 1,070 bytes, lines 19302-19334
19302/***/ "./node_modules/axios/lib/core/transformData.js": 19303/*!******************************************************!*\ 19304 !*** ./node_modules/axios/lib/core/transformData.js ***! 19305 \******************************************************/ 19306/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19307 19308"use strict"; 19309 19310 19311var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 19312var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js"); 19313 19314/** 19315 * Transform the data for a request or a response 19316 * 19317 * @param {Object|String} data The data to be transformed 19318 * @param {Array} headers The headers for the request or response 19319 * @param {Array|Function} fns A single function or Array of functions 19320 * @returns {*} The resulting transformed data 19321 */ 19322module.exports = function transformData(data, headers, fns) { 19323 var context = this || defaults; 19324 /*eslint no-param-reassign:0*/ 19325 utils.forEach(fns, function transform(fn) { 19326 data = fn.call(context, data, headers); 19327 }); 19328 19329 return data; 19330}; 19331 19332 19333/***/ }), 19334
vendor: 4,375 bytes, lines 19335-19477
19335/***/ "./node_modules/axios/lib/defaults/index.js": 19336/*!**************************************************!*\ 19337 !*** ./node_modules/axios/lib/defaults/index.js ***! 19338 \**************************************************/ 19339/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19340 19341"use strict"; 19342/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); 19343 19344 19345var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); 19346var normalizeHeaderName = __webpack_require__(/*! ../helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); 19347var enhanceError = __webpack_require__(/*! ../core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); 19348var transitionalDefaults = __webpack_require__(/*! ./transitional */ "./node_modules/axios/lib/defaults/transitional.js"); 19349 19350var DEFAULT_CONTENT_TYPE = { 19351 'Content-Type': 'application/x-www-form-urlencoded' 19352}; 19353 19354function setContentTypeIfUnset(headers, value) { 19355 if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { 19356 headers['Content-Type'] = value; 19357 } 19358} 19359 19360function getDefaultAdapter() { 19361 var adapter; 19362 if (typeof XMLHttpRequest !== 'undefined') { 19363 // For browsers use XHR adapter 19364 adapter = __webpack_require__(/*! ../adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); 19365 } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { 19366 // For node use HTTP adapter 19367 adapter = __webpack_require__(/*! ../adapters/http */ "./node_modules/axios/lib/adapters/xhr.js"); 19368 } 19369 return adapter; 19370} 19371 19372function stringifySafely(rawValue, parser, encoder) { 19373 if (utils.isString(rawValue)) { 19374 try { 19375 (parser || JSON.parse)(rawValue); 19376 return utils.trim(rawValue); 19377 } catch (e) { 19378 if (e.name !== 'SyntaxError') { 19379 throw e; 19380 } 19381 } 19382 } 19383 19384 return (encoder || JSON.stringify)(rawValue); 19385} 19386 19387var defaults = { 19388 19389 transitional: transitionalDefaults, 19390 19391 adapter: getDefaultAdapter(), 19392 19393 transformRequest: [function transformRequest(data, headers) { 19394 normalizeHeaderName(headers, 'Accept'); 19395 normalizeHeaderName(headers, 'Content-Type'); 19396 19397 if (utils.isFormData(data) || 19398 utils.isArrayBuffer(data) || 19399 utils.isBuffer(data) || 19400 utils.isStream(data) || 19401 utils.isFile(data) || 19402 utils.isBlob(data) 19403 ) { 19404 return data; 19405 } 19406 if (utils.isArrayBufferView(data)) { 19407 return data.buffer; 19408 } 19409 if (utils.isURLSearchParams(data)) { 19410 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); 19411 return data.toString(); 19412 } 19413 if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { 19414 setContentTypeIfUnset(headers, 'application/json'); 19415 return stringifySafely(data); 19416 } 19417 return data; 19418 }], 19419 19420 transformResponse: [function transformResponse(data) { 19421 var transitional = this.transitional || defaults.transitional; 19422 var silentJSONParsing = transitional && transitional.silentJSONParsing; 19423 var forcedJSONParsing = transitional && transitional.forcedJSONParsing; 19424 var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; 19425 19426 if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { 19427 try { 19428 return JSON.parse(data); 19429 } catch (e) { 19430 if (strictJSONParsing) { 19431 if (e.name === 'SyntaxError') { 19432 throw enhanceError(e, this, 'E_JSON_PARSE'); 19433 } 19434 throw e; 19435 } 19436 } 19437 } 19438 19439 return data; 19440 }], 19441 19442 /** 19443 * A timeout in milliseconds to abort a request. If set to 0 (default) a 19444 * timeout is not created. 19445 */ 19446 timeout: 0, 19447 19448 xsrfCookieName: 'XSRF-TOKEN', 19449 xsrfHeaderName: 'X-XSRF-TOKEN', 19450 19451 maxContentLength: -1, 19452 maxBodyLength: -1, 19453 19454 validateStatus: function validateStatus(status) { 19455 return status >= 200 && status < 300; 19456 }, 19457 19458 headers: { 19459 common: { 19460 'Accept': 'application/json, text/plain, */*' 19461 } 19462 } 19463}; 19464 19465utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { 19466 defaults.headers[method] = {}; 19467}); 19468 19469utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 19470 defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); 19471}); 19472 19473module.exports = defaults; 19474 19475 19476/***/ }), 19477
vendor: 403 bytes, lines 19478-19495
19478/***/ "./node_modules/axios/lib/defaults/transitional.js": 19479/*!*********************************************************!*\ 19480 !*** ./node_modules/axios/lib/defaults/transitional.js ***! 19481 \*********************************************************/ 19482/***/ ((module) => { 19483 19484"use strict"; 19485 19486 19487module.exports = { 19488 silentJSONParsing: true, 19489 forcedJSONParsing: true, 19490 clarifyTimeoutError: false 19491}; 19492 19493 19494/***/ }), 19495
vendor: 273 bytes, lines 19496-19507
19496/***/ "./node_modules/axios/lib/env/data.js": 19497/*!********************************************!*\ 19498 !*** ./node_modules/axios/lib/env/data.js ***! 19499 \********************************************/ 19500/***/ ((module) => { 19501 19502module.exports = { 19503 "version": "0.26.1" 19504}; 19505 19506/***/ }), 19507
vendor: 503 bytes, lines 19508-19529
19508/***/ "./node_modules/axios/lib/helpers/bind.js": 19509/*!************************************************!*\ 19510 !*** ./node_modules/axios/lib/helpers/bind.js ***! 19511 \************************************************/ 19512/***/ ((module) => { 19513 19514"use strict"; 19515 19516 19517module.exports = function bind(fn, thisArg) { 19518 return function wrap() { 19519 var args = new Array(arguments.length); 19520 for (var i = 0; i < args.length; i++) { 19521 args[i] = arguments[i]; 19522 } 19523 return fn.apply(thisArg, args); 19524 }; 19525}; 19526 19527 19528/***/ }), 19529
vendor: 2,007 bytes, lines 19530-19610
19530/***/ "./node_modules/axios/lib/helpers/buildURL.js": 19531/*!****************************************************!*\ 19532 !*** ./node_modules/axios/lib/helpers/buildURL.js ***! 19533 \****************************************************/ 19534/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19535 19536"use strict"; 19537 19538 19539var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 19540 19541function encode(val) { 19542 return encodeURIComponent(val). 19543 replace(/%3A/gi, ':'). 19544 replace(/%24/g, '$'). 19545 replace(/%2C/gi, ','). 19546 replace(/%20/g, '+'). 19547 replace(/%5B/gi, '['). 19548 replace(/%5D/gi, ']'); 19549} 19550 19551/** 19552 * Build a URL by appending params to the end 19553 * 19554 * @param {string} url The base of the url (e.g., http://www.google.com) 19555 * @param {object} [params] The params to be appended 19556 * @returns {string} The formatted url 19557 */ 19558module.exports = function buildURL(url, params, paramsSerializer) { 19559 /*eslint no-param-reassign:0*/ 19560 if (!params) { 19561 return url; 19562 } 19563 19564 var serializedParams; 19565 if (paramsSerializer) { 19566 serializedParams = paramsSerializer(params); 19567 } else if (utils.isURLSearchParams(params)) { 19568 serializedParams = params.toString(); 19569 } else { 19570 var parts = []; 19571 19572 utils.forEach(params, function serialize(val, key) { 19573 if (val === null || typeof val === 'undefined') { 19574 return; 19575 } 19576 19577 if (utils.isArray(val)) { 19578 key = key + '[]'; 19579 } else { 19580 val = [val]; 19581 } 19582 19583 utils.forEach(val, function parseValue(v) { 19584 if (utils.isDate(v)) { 19585 v = v.toISOString(); 19586 } else if (utils.isObject(v)) { 19587 v = JSON.stringify(v); 19588 } 19589 parts.push(encode(key) + '=' + encode(v)); 19590 }); 19591 }); 19592 19593 serializedParams = parts.join('&'); 19594 } 19595 19596 if (serializedParams) { 19597 var hashmarkIndex = url.indexOf('#'); 19598 if (hashmarkIndex !== -1) { 19599 url = url.slice(0, hashmarkIndex); 19600 } 19601 19602 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; 19603 } 19604 19605 return url; 19606}; 19607 19608 19609/***/ }), 19610
vendor: 655 bytes, lines 19611-19635
19611/***/ "./node_modules/axios/lib/helpers/combineURLs.js": 19612/*!*******************************************************!*\ 19613 !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! 19614 \*******************************************************/ 19615/***/ ((module) => { 19616 19617"use strict"; 19618 19619 19620/** 19621 * Creates a new URL by combining the specified URLs 19622 * 19623 * @param {string} baseURL The base URL 19624 * @param {string} relativeURL The relative URL 19625 * @returns {string} The combined URL 19626 */ 19627module.exports = function combineURLs(baseURL, relativeURL) { 19628 return relativeURL 19629 ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') 19630 : baseURL; 19631}; 19632 19633 19634/***/ }), 19635
vendor: 1,794 bytes, lines 19636-19699
19636/***/ "./node_modules/axios/lib/helpers/cookies.js": 19637/*!***************************************************!*\ 19638 !*** ./node_modules/axios/lib/helpers/cookies.js ***! 19639 \***************************************************/ 19640/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19641 19642"use strict"; 19643 19644 19645var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 19646 19647module.exports = ( 19648 utils.isStandardBrowserEnv() ? 19649 19650 // Standard browser envs support document.cookie 19651 (function standardBrowserEnv() { 19652 return { 19653 write: function write(name, value, expires, path, domain, secure) { 19654 var cookie = []; 19655 cookie.push(name + '=' + encodeURIComponent(value)); 19656 19657 if (utils.isNumber(expires)) { 19658 cookie.push('expires=' + new Date(expires).toGMTString()); 19659 } 19660 19661 if (utils.isString(path)) { 19662 cookie.push('path=' + path); 19663 } 19664 19665 if (utils.isString(domain)) { 19666 cookie.push('domain=' + domain); 19667 } 19668 19669 if (secure === true) { 19670 cookie.push('secure'); 19671 } 19672 19673 document.cookie = cookie.join('; '); 19674 }, 19675 19676 read: function read(name) { 19677 var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); 19678 return (match ? decodeURIComponent(match[3]) : null); 19679 }, 19680 19681 remove: function remove(name) { 19682 this.write(name, '', Date.now() - 86400000); 19683 } 19684 }; 19685 })() : 19686 19687 // Non standard browser env (web workers, react-native) lack needed support. 19688 (function nonStandardBrowserEnv() { 19689 return { 19690 write: function write() {}, 19691 read: function read() { return null; }, 19692 remove: function remove() {} 19693 }; 19694 })() 19695); 19696 19697 19698/***/ }), 19699
vendor: 844 bytes, lines 19700-19724
19700/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": 19701/*!*********************************************************!*\ 19702 !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! 19703 \*********************************************************/ 19704/***/ ((module) => { 19705 19706"use strict"; 19707 19708 19709/** 19710 * Determines whether the specified URL is absolute 19711 * 19712 * @param {string} url The URL to test 19713 * @returns {boolean} True if the specified URL is absolute, otherwise false 19714 */ 19715module.exports = function isAbsoluteURL(url) { 19716 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). 19717 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed 19718 // by any combination of letters, digits, plus, period, or hyphen. 19719 return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); 19720}; 19721 19722 19723/***/ }), 19724
vendor: 752 bytes, lines 19725-19748
19725/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": 19726/*!********************************************************!*\ 19727 !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! 19728 \********************************************************/ 19729/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19730 19731"use strict"; 19732 19733 19734var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 19735 19736/** 19737 * Determines whether the payload is an error thrown by Axios 19738 * 19739 * @param {*} payload The value to test 19740 * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false 19741 */ 19742module.exports = function isAxiosError(payload) { 19743 return utils.isObject(payload) && (payload.isAxiosError === true); 19744}; 19745 19746 19747/***/ }), 19748
vendor: 2,696 bytes, lines 19749-19827
19749/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": 19750/*!***********************************************************!*\ 19751 !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! 19752 \***********************************************************/ 19753/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19754 19755"use strict"; 19756 19757 19758var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 19759 19760module.exports = ( 19761 utils.isStandardBrowserEnv() ? 19762 19763 // Standard browser envs have full support of the APIs needed to test 19764 // whether the request URL is of the same origin as current location. 19765 (function standardBrowserEnv() { 19766 var msie = /(msie|trident)/i.test(navigator.userAgent); 19767 var urlParsingNode = document.createElement('a'); 19768 var originURL; 19769 19770 /** 19771 * Parse a URL to discover it's components 19772 * 19773 * @param {String} url The URL to be parsed 19774 * @returns {Object} 19775 */ 19776 function resolveURL(url) { 19777 var href = url; 19778 19779 if (msie) { 19780 // IE needs attribute set twice to normalize properties 19781 urlParsingNode.setAttribute('href', href); 19782 href = urlParsingNode.href; 19783 } 19784 19785 urlParsingNode.setAttribute('href', href); 19786 19787 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 19788 return { 19789 href: urlParsingNode.href, 19790 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 19791 host: urlParsingNode.host, 19792 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 19793 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 19794 hostname: urlParsingNode.hostname, 19795 port: urlParsingNode.port, 19796 pathname: (urlParsingNode.pathname.charAt(0) === '/') ? 19797 urlParsingNode.pathname : 19798 '/' + urlParsingNode.pathname 19799 }; 19800 } 19801 19802 originURL = resolveURL(window.location.href); 19803 19804 /** 19805 * Determine if a URL shares the same origin as the current location 19806 * 19807 * @param {String} requestURL The URL to test 19808 * @returns {boolean} True if URL shares the same origin, otherwise false 19809 */ 19810 return function isURLSameOrigin(requestURL) { 19811 var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; 19812 return (parsed.protocol === originURL.protocol && 19813 parsed.host === originURL.host); 19814 }; 19815 })() : 19816 19817 // Non standard browser envs (web workers, react-native) lack needed support. 19818 (function nonStandardBrowserEnv() { 19819 return function isURLSameOrigin() { 19820 return true; 19821 }; 19822 })() 19823); 19824 19825 19826/***/ }), 19827
vendor: 764 bytes, lines 19828-19850
19828/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": 19829/*!***************************************************************!*\ 19830 !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! 19831 \***************************************************************/ 19832/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19833 19834"use strict"; 19835 19836 19837var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); 19838 19839module.exports = function normalizeHeaderName(headers, normalizedName) { 19840 utils.forEach(headers, function processHeader(value, name) { 19841 if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { 19842 headers[normalizedName] = value; 19843 delete headers[name]; 19844 } 19845 }); 19846}; 19847 19848 19849/***/ }), 19850
vendor: 1,772 bytes, lines 19851-19914
19851/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": 19852/*!********************************************************!*\ 19853 !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! 19854 \********************************************************/ 19855/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19856 19857"use strict"; 19858 19859 19860var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 19861 19862// Headers whose duplicates are ignored by node 19863// c.f. https://nodejs.org/api/http.html#http_message_headers 19864var ignoreDuplicateOf = [ 19865 'age', 'authorization', 'content-length', 'content-type', 'etag', 19866 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 19867 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 19868 'referer', 'retry-after', 'user-agent' 19869]; 19870 19871/** 19872 * Parse headers into an object 19873 * 19874 * ``` 19875 * Date: Wed, 27 Aug 2014 08:58:49 GMT 19876 * Content-Type: application/json 19877 * Connection: keep-alive 19878 * Transfer-Encoding: chunked 19879 * ``` 19880 * 19881 * @param {String} headers Headers needing to be parsed 19882 * @returns {Object} Headers parsed into an object 19883 */ 19884module.exports = function parseHeaders(headers) { 19885 var parsed = {}; 19886 var key; 19887 var val; 19888 var i; 19889 19890 if (!headers) { return parsed; } 19891 19892 utils.forEach(headers.split('\n'), function parser(line) { 19893 i = line.indexOf(':'); 19894 key = utils.trim(line.substr(0, i)).toLowerCase(); 19895 val = utils.trim(line.substr(i + 1)); 19896 19897 if (key) { 19898 if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { 19899 return; 19900 } 19901 if (key === 'set-cookie') { 19902 parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); 19903 } else { 19904 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; 19905 } 19906 } 19907 }); 19908 19909 return parsed; 19910}; 19911 19912 19913/***/ }), 19914
vendor: 819 bytes, lines 19915-19952
19915/***/ "./node_modules/axios/lib/helpers/spread.js": 19916/*!**************************************************!*\ 19917 !*** ./node_modules/axios/lib/helpers/spread.js ***! 19918 \**************************************************/ 19919/***/ ((module) => { 19920 19921"use strict"; 19922 19923 19924/** 19925 * Syntactic sugar for invoking a function and expanding an array for arguments. 19926 * 19927 * Common use case would be to use `Function.prototype.apply`. 19928 * 19929 * ```js 19930 * function f(x, y, z) {} 19931 * var args = [1, 2, 3]; 19932 * f.apply(null, args); 19933 * ``` 19934 * 19935 * With `spread` this example can be re-written. 19936 * 19937 * ```js 19938 * spread(function(x, y, z) {})([1, 2, 3]); 19939 * ``` 19940 * 19941 * @param {Function} callback 19942 * @returns {Function} 19943 */ 19944module.exports = function spread(callback) { 19945 return function wrap(arr) { 19946 return callback.apply(null, arr); 19947 }; 19948}; 19949 19950 19951/***/ }), 19952
vendor: 2,719 bytes, lines 19953-20045
19953/***/ "./node_modules/axios/lib/helpers/validator.js": 19954/*!*****************************************************!*\ 19955 !*** ./node_modules/axios/lib/helpers/validator.js ***! 19956 \*****************************************************/ 19957/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19958 19959"use strict"; 19960 19961 19962var VERSION = (__webpack_require__(/*! ../env/data */ "./node_modules/axios/lib/env/data.js").version); 19963 19964var validators = {}; 19965 19966// eslint-disable-next-line func-names 19967['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { 19968 validators[type] = function validator(thing) { 19969 return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; 19970 }; 19971}); 19972 19973var deprecatedWarnings = {}; 19974 19975/** 19976 * Transitional option validator 19977 * @param {function|boolean?} validator - set to false if the transitional option has been removed 19978 * @param {string?} version - deprecated version / removed since version 19979 * @param {string?} message - some message with additional info 19980 * @returns {function} 19981 */ 19982validators.transitional = function transitional(validator, version, message) { 19983 function formatMessage(opt, desc) { 19984 return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); 19985 } 19986 19987 // eslint-disable-next-line func-names 19988 return function(value, opt, opts) { 19989 if (validator === false) { 19990 throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : ''))); 19991 } 19992 19993 if (version && !deprecatedWarnings[opt]) { 19994 deprecatedWarnings[opt] = true; 19995 // eslint-disable-next-line no-console 19996 console.warn( 19997 formatMessage( 19998 opt, 19999 ' has been deprecated since v' + version + ' and will be removed in the near future' 20000 ) 20001 ); 20002 } 20003 20004 return validator ? validator(value, opt, opts) : true; 20005 }; 20006}; 20007 20008/** 20009 * Assert object's properties type 20010 * @param {object} options 20011 * @param {object} schema 20012 * @param {boolean?} allowUnknown 20013 */ 20014 20015function assertOptions(options, schema, allowUnknown) { 20016 if (typeof options !== 'object') { 20017 throw new TypeError('options must be an object'); 20018 } 20019 var keys = Object.keys(options); 20020 var i = keys.length; 20021 while (i-- > 0) { 20022 var opt = keys[i]; 20023 var validator = schema[opt]; 20024 if (validator) { 20025 var value = options[opt]; 20026 var result = value === undefined || validator(value, opt, options); 20027 if (result !== true) { 20028 throw new TypeError('option ' + opt + ' must be ' + result); 20029 } 20030 continue; 20031 } 20032 if (allowUnknown !== true) { 20033 throw Error('Unknown option ' + opt); 20034 } 20035 } 20036} 20037 20038module.exports = { 20039 assertOptions: assertOptions, 20040 validators: validators 20041}; 20042 20043 20044/***/ }), 20045
vendor: 18,865 bytes, lines 20046-20556
20046/***/ "./node_modules/axios/lib/utils.js": 20047/*!*****************************************!*\ 20048 !*** ./node_modules/axios/lib/utils.js ***! 20049 \*****************************************/ 20050/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 20051 20052"use strict"; 20053 20054 20055var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); 20056 20057// utils is a library of generic helper functions non-specific to axios 20058 20059var toString = Object.prototype.toString; 20060 20061/** 20062 * Determine if a value is an Array 20063 * 20064 * @param {Object} val The value to test 20065 * @returns {boolean} True if value is an Array, otherwise false 20066 */ 20067function isArray(val) { 20068 return Array.isArray(val); 20069} 20070 20071/** 20072 * Determine if a value is undefined 20073 * 20074 * @param {Object} val The value to test 20075 * @returns {boolean} True if the value is undefined, otherwise false 20076 */ 20077function isUndefined(val) { 20078 return typeof val === 'undefined'; 20079} 20080 20081/** 20082 * Determine if a value is a Buffer 20083 * 20084 * @param {Object} val The value to test 20085 * @returns {boolean} True if value is a Buffer, otherwise false 20086 */ 20087function isBuffer(val) { 20088 return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) 20089 && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); 20090} 20091 20092/** 20093 * Determine if a value is an ArrayBuffer 20094 * 20095 * @param {Object} val The value to test 20096 * @returns {boolean} True if value is an ArrayBuffer, otherwise false 20097 */ 20098function isArrayBuffer(val) { 20099 return toString.call(val) === '[object ArrayBuffer]'; 20100} 20101 20102/** 20103 * Determine if a value is a FormData 20104 * 20105 * @param {Object} val The value to test 20106 * @returns {boolean} True if value is an FormData, otherwise false 20107 */ 20108function isFormData(val) { 20109 return toString.call(val) === '[object FormData]'; 20110} 20111 20112/** 20113 * Determine if a value is a view on an ArrayBuffer 20114 * 20115 * @param {Object} val The value to test 20116 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false 20117 */ 20118function isArrayBufferView(val) { 20119 var result; 20120 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { 20121 result = ArrayBuffer.isView(val); 20122 } else { 20123 result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); 20124 } 20125 return result; 20126} 20127 20128/** 20129 * Determine if a value is a String 20130 * 20131 * @param {Object} val The value to test 20132 * @returns {boolean} True if value is a String, otherwise false 20133 */ 20134function isString(val) { 20135 return typeof val === 'string'; 20136} 20137 20138/** 20139 * Determine if a value is a Number 20140 * 20141 * @param {Object} val The value to test 20142 * @returns {boolean} True if value is a Number, otherwise false 20143 */ 20144function isNumber(val) { 20145 return typeof val === 'number'; 20146} 20147 20148/** 20149 * Determine if a value is an Object 20150 * 20151 * @param {Object} val The value to test 20152 * @returns {boolean} True if value is an Object, otherwise false 20153 */ 20154function isObject(val) { 20155 return val !== null && typeof val === 'object'; 20156} 20157 20158/** 20159 * Determine if a value is a plain Object 20160 * 20161 * @param {Object} val The value to test 20162 * @return {boolean} True if value is a plain Object, otherwise false 20163 */ 20164function isPlainObject(val) { 20165 if (toString.call(val) !== '[object Object]') { 20166 return false; 20167 } 20168 20169 var prototype = Object.getPrototypeOf(val); 20170 return prototype === null || prototype === Object.prototype; 20171} 20172 20173/** 20174 * Determine if a value is a Date 20175 * 20176 * @param {Object} val The value to test 20177 * @returns {boolean} True if value is a Date, otherwise false 20178 */ 20179function isDate(val) { 20180 return toString.call(val) === '[object Date]'; 20181} 20182 20183/** 20184 * Determine if a value is a File 20185 * 20186 * @param {Object} val The value to test 20187 * @returns {boolean} True if value is a File, otherwise false 20188 */ 20189function isFile(val) { 20190 return toString.call(val) === '[object File]'; 20191} 20192 20193/** 20194 * Determine if a value is a Blob 20195 * 20196 * @param {Object} val The value to test 20197 * @returns {boolean} True if value is a Blob, otherwise false 20198 */ 20199function isBlob(val) { 20200 return toString.call(val) === '[object Blob]'; 20201} 20202 20203/** 20204 * Determine if a value is a Function 20205 * 20206 * @param {Object} val The value to test 20207 * @returns {boolean} True if value is a Function, otherwise false 20208 */ 20209function isFunction(val) { 20210 return toString.call(val) === '[object Function]'; 20211} 20212 20213/** 20214 * Determine if a value is a Stream 20215 * 20216 * @param {Object} val The value to test 20217 * @returns {boolean} True if value is a Stream, otherwise false 20218 */ 20219function isStream(val) { 20220 return isObject(val) && isFunction(val.pipe); 20221} 20222 20223/** 20224 * Determine if a value is a URLSearchParams object 20225 * 20226 * @param {Object} val The value to test 20227 * @returns {boolean} True if value is a URLSearchParams object, otherwise false 20228 */ 20229function isURLSearchParams(val) { 20230 return toString.call(val) === '[object URLSearchParams]'; 20231} 20232 20233/** 20234 * Trim excess whitespace off the beginning and end of a string 20235 * 20236 * @param {String} str The String to trim 20237 * @returns {String} The String freed of excess whitespace 20238 */ 20239function trim(str) { 20240 return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); 20241} 20242 20243/** 20244 * Determine if we're running in a standard browser environment 20245 * 20246 * This allows axios to run in a web worker, and react-native. 20247 * Both environments support XMLHttpRequest, but not fully standard globals. 20248 * 20249 * web workers: 20250 * typeof window -> undefined 20251 * typeof document -> undefined 20252 * 20253 * react-native: 20254 * navigator.product -> 'ReactNative' 20255 * nativescript 20256 * navigator.product -> 'NativeScript' or 'NS' 20257 */ 20258function isStandardBrowserEnv() { 20259 if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || 20260 navigator.product === 'NativeScript' || 20261 navigator.product === 'NS')) { 20262 return false; 20263 } 20264 return ( 20265 typeof window !== 'undefined' && 20266 typeof document !== 'undefined' 20267 ); 20268} 20269 20270/** 20271 * Iterate over an Array or an Object invoking a function for each item. 20272 * 20273 * If `obj` is an Array callback will be called passing 20274 * the value, index, and complete array for each item. 20275 * 20276 * If 'obj' is an Object callback will be called passing 20277 * the value, key, and complete object for each property. 20278 * 20279 * @param {Object|Array} obj The object to iterate 20280 * @param {Function} fn The callback to invoke for each item 20281 */ 20282function forEach(obj, fn) { 20283 // Don't bother if no value provided 20284 if (obj === null || typeof obj === 'undefined') { 20285 return; 20286 } 20287 20288 // Force an array if not already something iterable 20289 if (typeof obj !== 'object') { 20290 /*eslint no-param-reassign:0*/ 20291 obj = [obj]; 20292 } 20293 20294 if (isArray(obj)) { 20295 // Iterate over array values 20296 for (var i = 0, l = obj.length; i < l; i++) { 20297 fn.call(null, obj[i], i, obj); 20298 } 20299 } else { 20300 // Iterate over object keys 20301 for (var key in obj) { 20302 if (Object.prototype.hasOwnProperty.call(obj, key)) { 20303 fn.call(null, obj[key], key, obj); 20304 } 20305 } 20306 } 20307} 20308 20309/** 20310 * Accepts varargs expecting each argument to be an object, then 20311 * immutably merges the properties of each object and returns result. 20312 * 20313 * When multiple objects contain the same key the later object in 20314 * the arguments list will take precedence. 20315 * 20316 * Example: 20317 * 20318 * ```js 20319 * var result = merge({foo: 123}, {foo: 456}); 20320 * console.log(result.foo); // outputs 456 20321 * ``` 20322 * 20323 * @param {Object} obj1 Object to merge 20324 * @returns {Object} Result of all merge properties 20325 */ 20326function merge(/* obj1, obj2, obj3, ... */) { 20327 var result = {}; 20328 function assignValue(val, key) { 20329 if (isPlainObject(result[key]) && isPlainObject(val)) { 20330 result[key] = merge(result[key], val); 20331 } else if (isPlainObject(val)) { 20332 result[key] = merge({}, val); 20333 } else if (isArray(val)) { 20334 result[key] = val.slice(); 20335 } else { 20336 result[key] = val; 20337 } 20338 } 20339 20340 for (var i = 0, l = arguments.length; i < l; i++) { 20341 forEach(arguments[i], assignValue); 20342 } 20343 return result; 20344} 20345 20346/** 20347 * Extends object a by mutably adding to it the properties of object b. 20348 * 20349 * @param {Object} a The object to be extended 20350 * @param {Object} b The object to copy properties from 20351 * @param {Object} thisArg The object to bind function to 20352 * @return {Object} The resulting value of object a 20353 */ 20354function extend(a, b, thisArg) { 20355 forEach(b, function assignValue(val, key) { 20356 if (thisArg && typeof val === 'function') { 20357 a[key] = bind(val, thisArg); 20358 } else { 20359 a[key] = val; 20360 } 20361 }); 20362 return a; 20363} 20364 20365/** 20366 * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) 20367 * 20368 * @param {string} content with BOM 20369 * @return {string} content value without BOM 20370 */ 20371function stripBOM(content) { 20372 if (content.charCodeAt(0) === 0xFEFF) { 20373 content = content.slice(1); 20374 } 20375 return content; 20376} 20377 20378module.exports = { 20379 isArray: isArray, 20380 isArrayBuffer: isArrayBuffer, 20381 isBuffer: isBuffer, 20382 isFormData: isFormData, 20383 isArrayBufferView: isArrayBufferView, 20384 isString: isString, 20385 isNumber: isNumber, 20386 isObject: isObject, 20387 isPlainObject: isPlainObject, 20388 isUndefined: isUndefined, 20389 isDate: isDate, 20390 isFile: isFile, 20391 isBlob: isBlob, 20392 isFunction: isFunction, 20393 isStream: isStream, 20394 isURLSearchParams: isURLSearchParams, 20395 isStandardBrowserEnv: isStandardBrowserEnv, 20396 forEach: forEach, 20397 merge: merge, 20398 extend: extend, 20399 trim: trim, 20400 stripBOM: stripBOM 20401}; 20402 20403 20404/***/ }), 20405 20406/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/VariablePriceComponent.vue?vue&type=script&lang=js": 20407/*!****************************************************************************************************************************************************************************************************************!*\ 20408 !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/VariablePriceComponent.vue?vue&type=script&lang=js ***! 20409 \****************************************************************************************************************************************************************************************************************/ 20410/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 20411 20412"use strict"; 20413__webpack_require__.r(__webpack_exports__); 20414/* harmony export */ __webpack_require__.d(__webpack_exports__, { 20415/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 20416/* harmony export */ }); 20417/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 20418 props: ['variable_data'], 20419 data: function data() { 20420 return {}; 20421 }, 20422 methods: { 20423 isVariablePrice: function isVariablePrice() { 20424 var variable_data = this.variable_data; 20425 return Boolean(variable_data.variable_price); 20426 }, 20427 isExtraChildren: function isExtraChildren() { 20428 var variable_data = this.variable_data; 20429 return Boolean(variable_data.variable_price && variable_data.variable_price.extra_children && variable_data.variable_price.extra_children.length > 0); 20430 }, 20431 isExtraAdults: function isExtraAdults() { 20432 var variable_data = this.variable_data; 20433 return Boolean(variable_data.variable_price && variable_data.variable_price.extra_adults && variable_data.variable_price.extra_adults.length > 0); 20434 } 20435 }, 20436 mounted: function mounted() { 20437 console.log('Component mounted.'); 20438 } 20439}); 20440 20441/***/ }), 20442 20443/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/VariablePriceComponent.vue?vue&type=template&id=70a0f90a": 20444/*!********************************************************************************************************************************************************************************************************************************************************************************************!*\ 20445 !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/VariablePriceComponent.vue?vue&type=template&id=70a0f90a ***! 20446 \********************************************************************************************************************************************************************************************************************************************************************************************/ 20447/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 20448 20449"use strict"; 20450__webpack_require__.r(__webpack_exports__); 20451/* harmony export */ __webpack_require__.d(__webpack_exports__, { 20452/* harmony export */ render: () => (/* binding */ render) 20453/* harmony export */ }); 20454/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js"); 20455 20456var _hoisted_1 = { 20457 key: 0 20458}; 20459var _hoisted_2 = { 20460 key: 0, 20461 "class": "row header" 20462}; 20463var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", { 20464 "class": "col-md-8" 20465}, " Extra Adults ", -1 /* HOISTED */); 20466var _hoisted_4 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", { 20467 "class": "col-md-4" 20468}, " Price ", -1 /* HOISTED */); 20469var _hoisted_5 = [_hoisted_3, _hoisted_4]; 20470var _hoisted_6 = { 20471 "class": "row" 20472}; 20473var _hoisted_7 = { 20474 "class": "col-md-8" 20475}; 20476var _hoisted_8 = ["name", "value"]; 20477var _hoisted_9 = ["name", "value"]; 20478var _hoisted_10 = { 20479 "class": "col-md-4" 20480}; 20481var _hoisted_11 = ["name", "value"]; 20482var _hoisted_12 = { 20483 key: 2 20484}; 20485var _hoisted_13 = { 20486 key: 3, 20487 "class": "row header" 20488}; 20489var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", { 20490 "class": "col-md-8" 20491}, " Extra Children ", -1 /* HOISTED */); 20492var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", { 20493 "class": "col-md-4" 20494}, " Price ", -1 /* HOISTED */); 20495var _hoisted_16 = [_hoisted_14, _hoisted_15]; 20496var _hoisted_17 = { 20497 "class": "row" 20498}; 20499var _hoisted_18 = { 20500 "class": "col-md-8" 20501}; 20502var _hoisted_19 = ["name", "value"]; 20503var _hoisted_20 = ["name", "value"]; 20504var _hoisted_21 = { 20505 "class": "col-md-4" 20506}; 20507var _hoisted_22 = ["name", "value"]; 20508var _hoisted_23 = { 20509 key: 5 20510}; 20511function render(_ctx, _cache, $props, $setup, $data, $options) { 20512 return $options.isVariablePrice() ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [$options.isExtraAdults() ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, [].concat(_hoisted_5))) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $options.isVariablePrice() ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, { 20513 key: 1 20514 }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.variable_data.variable_price.extra_adults, function (variable) { 20515 return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { 20516 type: "hidden", 20517 "class": "js-variable_price-id", 20518 name: 'variable_price[extra_adults][' + (variable.id - 1) + '][id]', 20519 value: variable.id 20520 }, null, 8 /* PROPS */, _hoisted_8), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { 20521 type: "number", 20522 name: 'variable_price[extra_adults][' + (variable.id - 1) + '][number]', 20523 "class": "form-control js-variable_price-number", 20524 value: variable.number, 20525 readonly: "" 20526 }, null, 8 /* PROPS */, _hoisted_9)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { 20527 type: "number", 20528 name: 'variable_price[extra_adults][' + (variable.id - 1) + '][price]', 20529 "class": "form-control js-variable_price-amount", 20530 value: variable.price 20531 }, null, 8 /* PROPS */, _hoisted_11)])])]); 20532 }), 256 /* UNKEYED_FRAGMENT */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $options.isExtraAdults() ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("hr", _hoisted_12)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $options.isExtraChildren() ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_13, [].concat(_hoisted_16))) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $options.isVariablePrice() ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, { 20533 key: 4 20534 }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.variable_data.variable_price.extra_children, function (variable) { 20535 return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_17, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_18, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { 20536 type: "hidden", 20537 "class": "js-variable_price-id", 20538 name: 'variable_price[extra_children][' + (variable.id - 1) + '][id]', 20539 value: variable.id 20540 }, null, 8 /* PROPS */, _hoisted_19), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { 20541 type: "number", 20542 name: 'variable_price[extra_children][' + (variable.id - 1) + '][number]', 20543 "class": "form-control js-variable_price-number", 20544 value: variable.number, 20545 readonly: "" 20546 }, null, 8 /* PROPS */, _hoisted_20)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_21, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { 20547 type: "number", 20548 name: 'variable_price[extra_children][' + (variable.id - 1) + '][price]', 20549 "class": "form-control js-variable_price-amount", 20550 value: variable.price 20551 }, null, 8 /* PROPS */, _hoisted_22)])])]); 20552 }), 256 /* UNKEYED_FRAGMENT */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $options.isExtraChildren() ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("hr", _hoisted_23)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true); 20553} 20554 20555/***/ }), 20556
20557/***/ "./resources/js/app.js": 20558/*!*****************************!*\ 20559 !*** ./resources/js/app.js ***! 20560 \*****************************/ 20561/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 20562 20563"use strict"; 20564__webpack_require__.r(__webpack_exports__); 20565/* harmony import */ var vue3_lazyload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue3-lazyload */ "./node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js"); 20566/* provided dependency */ var Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js"); 20567 20568 20569/** 20570 * First we will load all of this project's JavaScript dependencies which 20571 * includes Vue and other libraries. It is a great starting point when 20572 * building robust, powerful web applications using Vue and Laravel. 20573 */ 20574function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 20575function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 20576function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 20577function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 20578function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 20579function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } 20580function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 20581function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 20582function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 20583function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 20584function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } 20585function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 20586__webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js"); 20587 20588var element = '#app'; 20589var updated = function updated() {}; 20590var created = function created() {}; 20591var components = {}; 20592var otherData = {}; 20593var computed = {}; 20594var watch = {}; 20595var methods = {}; 20596var commonData = { 20597 isLoading: false, 20598 isContentLoading: true, 20599 error_messages: {}, 20600 error: false, 20601 applied: false, 20602 checkout: false, 20603 test: '', 20604 screenSize: 1440 20605}; 20606var commonMethods = { 20607 formatMoney: function formatMoney(price) { 20608 return window.bravo_format_float_money(price); 20609 }, 20610 makePostRequest: function makePostRequest(url, data_params, callback) { 20611 var _this = this; 20612 try { 20613 this.isLoading = true; 20614 axios.post(url, data_params).then(function (response) { 20615 if (response.data.status == 'redirect') { 20616 window.location.href = response.data.redirect_url; 20617 } else if (response.data.status == 'reload') { 20618 window.location.reload(); 20619 } else { 20620 callback(response.data); 20621 } 20622 })["catch"](function (error) { 20623 console.log(error); 20624 })["finally"](function () { 20625 _this.isLoading = false;
20626 }); 20627 } catch (error) { 20628 this.isLoading = false; 20629 } 20630 } 20631}; 20632var common_module = (__webpack_require__(/*! ./modules/home.js */ "./resources/js/modules/home.js")["default"]); 20633otherData = _objectSpread(_objectSpread({}, otherData), common_module.otherData); 20634methods = _objectSpread(_objectSpread({}, methods), common_module.methods); 20635if (fresco.route_name == 'hotel.search') { 20636 var module_data = (__webpack_require__(/*! ./modules/search.js */ "./resources/js/modules/search.js")["default"]); 20637 otherData = _objectSpread(_objectSpread({}, otherData), module_data.otherData); 20638 methods = _objectSpread(_objectSpread({}, methods), module_data.methods); 20639 computed = _objectSpread(_objectSpread({}, computed), module_data.computed); 20640} 20641if (['hotel.detail', 'hotel.google.detail'].includes(fresco.route_name)) { 20642 var _module_data = (__webpack_require__(/*! ./modules/hotel_detail.js */ "./resources/js/modules/hotel_detail.js")["default"]); 20643 otherData = _objectSpread(_objectSpread({}, otherData), _module_data.otherData); 20644 methods = _objectSpread(_objectSpread({}, methods), _module_data.methods); 20645 computed = _objectSpread(_objectSpread({}, computed), _module_data.computed); 20646 watch = _objectSpread(_objectSpread({}, watch), _module_data.watch); 20647 updated = _module_data.updated; 20648} 20649if (['hotel.vendor.promotion.index', 'hotel.vendor.promotion.edit', 'hotel.vendor.promotion.create'].includes(fresco.route_name)) { 20650 var _module_data2 = (__webpack_require__(/*! ./modules/promotion.js */ "./resources/js/modules/promotion.js")["default"]); 20651 otherData = _objectSpread(_objectSpread({}, otherData), _module_data2.otherData); 20652 methods = _objectSpread(_objectSpread({}, methods), _module_data2.methods); 20653 computed = _objectSpread(_objectSpread({}, computed), _module_data2.computed); 20654} 20655if (fresco.route_name == 'booking.checkout') { 20656 var _module_data3 = (__webpack_require__(/*! ./modules/booking_checkout.js */ "./resources/js/modules/booking_checkout.js")["default"]); 20657 otherData = _objectSpread(_objectSpread({}, otherData), _module_data3.otherData); 20658 methods = _objectSpread(_objectSpread({}, methods), _module_data3.methods); 20659} 20660if (['booking.details', 'booking.viewBooking'].includes(fresco.route_name)) { 20661 var _module_data4 = (__webpack_require__(/*! ./modules/booking_details.js */ "./resources/js/modules/booking_details.js")["default"]); 20662 otherData = _objectSpread(_objectSpread({}, otherData), _module_data4.otherData); 20663 methods = _objectSpread(_objectSpread({}, methods), _module_data4.methods); 20664} 20665if (fresco.route_name == 'booking.change') { 20666 var _module_data5 = (__webpack_require__(/*! ./modules/common/booking_change.js */ "./resources/js/modules/common/booking_change.js")["default"]); 20667 otherData = _objectSpread(_objectSpread({}, otherData), _module_data5.otherData); 20668 methods = _objectSpread(_objectSpread({}, methods), _module_data5.methods); 20669 computed = _objectSpread(_objectSpread({}, computed), _module_data5.computed); 20670} 20671if (fresco.route_name == 'user.booking.history') { 20672 var _module_data6 = (__webpack_require__(/*! ./modules/booking_history.js */ "./resources/js/modules/booking_history.js")["default"]); 20673 otherData = _objectSpread(_objectSpread({}, otherData), _module_data6.otherData); 20674 methods = _objectSpread(_objectSpread({}, methods), _module_data6.methods); 20675 computed = _objectSpread(_objectSpread({}, computed), _module_data6.computed); 20676} 20677if (fresco.route_name == 'hotel.vendor.booking_report') { 20678 var _module_data7 = (__webpack_require__(/*! ./modules/common/virtual_card_modal.js */ "./resources/js/modules/common/virtual_card_modal.js")["default"]); 20679 otherData = _objectSpread(_objectSpread({}, otherData), _module_data7.otherData); 20680 methods = _objectSpread(_objectSpread({}, methods), _module_data7.methods); 20681} 20682if (fresco.route_name == 'hotel.vendor.bulkEdit.availabilityView') { 20683 var _module_data8 = (__webpack_require__(/*! ./modules/common/bulk_update_availability_view.js */ "./resources/js/modules/common/bulk_update_availability_view.js")["default"]); 20684 otherData = _objectSpread(_objectSpread({}, otherData), _module_data8.otherData); 20685 methods = _objectSpread(_objectSpread({}, methods), _module_data8.methods); 20686 computed = _objectSpread(_objectSpread({}, computed), _module_data8.computed); 20687 created = _module_data8.created; 20688} 20689if (fresco.route_name == 'hotel.vendor.bulkEdit.price.bulkEdit') { 20690 var _module_data9 = (__webpack_require__(/*! ./modules/common/bulk_edit_price_view.js */ "./resources/js/modules/common/bulk_edit_price_view.js")["default"]); 20691 otherData = _objectSpread(_objectSpread({}, otherData), _module_data9.otherData); 20692 methods = _objectSpread(_objectSpread({}, methods), _module_data9.methods); 20693 components = _objectSpread(_objectSpread({}, components), _module_data9.components); 20694} 20695if (fresco.route_name == 'hotel.vendor.bulkEdit.priveView') { 20696 var _module_data10 = (__webpack_require__(/*! ./modules/common/bulk_update_price_view.js */ "./resources/js/modules/common/bulk_update_price_view.js")["default"]); 20697 otherData = _objectSpread(_objectSpread({}, otherData), _module_data10.otherData); 20698 methods = _objectSpread(_objectSpread({}, methods), _module_data10.methods); 20699 components = _objectSpread(_objectSpread({}, components), _module_data10.components); 20700 created = _module_data10.created; 20701} 20702if (['hotel.vendor.room.create', 'hotel.vendor.room.edit'].includes(fresco.route_name)) { 20703 var _module_data11 = (__webpack_require__(/*! ./modules/common/room_detail.js */ "./resources/js/modules/common/room_detail.js")["default"]); 20704 otherData = _objectSpread(_objectSpread({}, otherData), _module_data11.otherData); 20705 methods = _objectSpread(_objectSpread({}, methods), _module_data11.methods); 20706} 20707if (fresco.page == 'user') { 20708 var _module_data12 = (__webpack_require__(/*! ./modules/user.js */ "./resources/js/modules/user.js")["default"]); 20709 otherData = _objectSpread(_objectSpread({}, otherData), _module_data12.otherData); 20710 methods = _objectSpread(_objectSpread({}, methods), _module_data12.methods); 20711} 20712var myApp = Vue.createApp({ 20713 data: function data() { 20714 return _objectSpread(_objectSpread({}, commonData), otherData); 20715 }, 20716 mounted: function mounted() { 20717 var _this2 = this; 20718 window.addEventListener('load', function () { 20719 // Init Default Data 20720 if (objectLength(default_init_data) > 0) { 20721 for (var _i = 0, _Object$entries = Object.entries(default_init_data); _i < _Object$entries.length; _i++) { 20722 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), 20723 key = _Object$entries$_i[0], 20724 value = _Object$entries$_i[1]; 20725 _this2[key] = value; 20726 } 20727 } 20728 if (typeof window.vueInitData !== 'undefined') { 20729 for (var _i2 = 0, _Object$entries2 = Object.entries(window.vueInitData); _i2 < _Object$entries2.length; _i2++) { 20730 var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2), 20731 _key = _Object$entries2$_i[0], 20732 _value = _Object$entries2$_i[1]; 20733 _this2[_key] = _value; 20734 } 20735 } 20736 if (typeof _this2.loadFunctions === "function") { 20737 _this2.loadFunctions(); 20738 } 20739 if (typeof _this2.registerEvents === "function") { 20740 _this2.registerEvents(); 20741 } 20742 if (typeof _this2.commonEvents === "function") { 20743 _this2.commonEvents(); 20744 } 20745 _this2.screenSize = $(window).width(); 20746 var self = _this2; 20747 $(document).ready(function () { 20748 setTimeout(function () { 20749 $('[data-toggle="tooltip"]').tooltip(); 20750 }, 1000); 20751 $(document).on('click', '.scroll-top', function () { 20752 $("html,body").animate({ 20753 scrollTop: 0 20754 }, 500); 20755 $('.scroll-top-wrap').hide(); 20756 }); 20757 $('.scroll-top-wrap').hide(); 20758 if ($(this).scrollTop() > 800) { 20759 $('.scroll-top-wrap').show(); 20760 } 20761 $(document).scroll(function () { 20762 if ($(this).scrollTop() > 800) { 20763 $('.scroll-top-wrap').fadeIn(); 20764 } else { 20765 $('.scroll-top-wrap').fadeOut(); 20766 } 20767 }); 20768 self.isContentLoading = false;
20769 }); 20770 }); 20771 }, 20772 created: created, 20773 updated: updated, 20774 components: components, 20775 methods: _objectSpread(_objectSpread({}, commonMethods), methods), 20776 computed: computed 20777}); 20778myApp.use(vue3_lazyload__WEBPACK_IMPORTED_MODULE_0__["default"], { 20779 log: false, 20780 observerOptions: { 20781 threshold: 0.3 20782 } 20783}); 20784myApp.mount('#app'); 20785 20786/***/ }), 20787
20788/***/ "./resources/js/bootstrap.js": 20789/*!***********************************!*\ 20790 !*** ./resources/js/bootstrap.js ***! 20791 \***********************************/ 20792/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 20793 20794"use strict"; 20795__webpack_require__.r(__webpack_exports__); 20796/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js"); 20797window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); 20798 20799/** 20800 * We'll load jQuery and the Bootstrap jQuery plugin which provides support 20801 * for JavaScript based Bootstrap features such as modals and tabs. This 20802 * code may be modified to fit the specific needs of your application. 20803 */ 20804 20805try { 20806 window.Popper = (__webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")["default"]); 20807 // window.$ = window.jQuery = require('jquery'); 20808} catch (e) {} 20809 20810/** 20811 * We'll load the axios HTTP library which allows us to easily issue requests 20812 * to our Laravel back-end. This library automatically handles sending the 20813 * CSRF token as a header based on the value of the "XSRF" token cookie. 20814 */ 20815 20816window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); 20817window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 20818var token = document.head.querySelector('meta[name="csrf-token"]'); 20819if (token) { 20820 window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 20821} else { 20822 console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 20823} 20824 20825// window.bootstrap = require('bootstrap'); 20826 20827// window.Vue = require('vue'); 20828 20829 20830// Vue.config.productionTip = false 20831 20832/***/ }), 20833
vendor: 1,659 bytes, lines 20834-20845
20834/***/ "./resources/js/modules/booking_checkout.js": 20835/*!**************************************************!*\ 20836 !*** ./resources/js/modules/booking_checkout.js ***! 20837 \**************************************************/ 20838/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 20839 20840"use strict"; 20841__webpack_require__.r(__webpack_exports__); 20842/* harmony export */ __webpack_require__.d(__webpack_exports__, { 20843/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 20844/* harmony export */ }); 20845function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap;
vendor: 5,446 bytes, line 20845
20845 var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEac
vendor: 6,106 bytes, lines 20845-20883
20845h(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } 20846function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 20847function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 20848function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 20849function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 20850function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 20851function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 20852function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 20853function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 20854function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 20855function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 20856function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } 20857function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 20858function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 20859/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 20860 otherData: { 20861 onSubmit: false, 20862 message: { 20863 content: '', 20864 type: false 20865 }, 20866 applied: false, 20867 name: "", 20868 price: 0, 20869 s_price: "", 20870 cardValidationClasses: { 20871 'form-control': true, 20872 'is-invalid': false 20873 }, 20874 error: false, 20875 error_message: "", 20876 checkout: true, 20877 isOverlayVisible: false, 20878 gateways: [], 20879 current_step: 1, 20880 payement_type: '', 20881 rooms: [] 20882 }, 20883 methods: {
20884 doCheckout: function doCheckout() { 20885 if (this.onSubmit) return false; 20886 if (!this.validate()) { 20887 this.message.content = 'Kindly fill required details before submitting'; 20888 this.message.type = false; 20889 return false; 20890 } 20891 this.onSubmit = true; 20892 this.isOverlayVisible = true; 20893 var dataToSubmit = $('.booking-form').find('input,textarea,select').serializeArray(); 20894 var dataUrl = fresco.url + '/booking/doCheckout'; 20895 var payement_type = $('input[name=payment_gateway]:checked').val(); 20896 if (payement_type == 'stripe_pay_late1r') { 20897 var isPayLaterSaved = $('#is-pay-later-saved-already').val(); 20898 if (isPayLaterSaved) { 20899 dataToSubmit.push({ 20900 name: 'isPayLaterSaved', 20901 value: 'yes' 20902 }); 20903 this.sendCheckout(this, dataUrl, dataToSubmit); 20904 } else { 20905 dataToSubmit.push({ 20906 name: 'isPayLaterSaved', 20907 value: 'no' 20908 }); 20909 // New case, Saving card works on Customer's browser, later send some info for confirmation in server side 20910 document.payLaterObjects.checkStripePayLater(this, dataUrl, dataToSubmit); 20911 } 20912 } else { 20913 // This was the default case, which booking all functions takes place in server 20914 this.sendCheckout(this, dataUrl, dataToSubmit); 20915 } 20916 }, 20917 validate: function validate() { 20918 var scroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; 20919 var flag = true; 20920 $('#form-checkout .validation-required').removeClass('.validation-required'); 20921 var input_value = $('#form-checkout').find('input[name=phone]').val(); 20922 if (input_value == "" || input_value == undefined) { 20923 var element = $('#form-checkout').find('input[name=phone]'); 20924 $(element).addClass('is-invalid'); 20925 flag = false; 20926 } 20927 input_value = $('#form-checkout').find('input[name=first_name]').val(); 20928 if (input_value == "" || input_value == undefined) { 20929 var element = $('#form-checkout').find('input[name=first_name]'); 20930 $(element).addClass('is-invalid'); 20931 flag = false; 20932 } else { 20933 $('#form-checkout').find('input[name=first_name]').removeClass('is-invalid'); 20934 } 20935 input_value = $('#form-checkout').find('input[name=last_name]').val(); 20936 if (input_value == "" || input_value == undefined) { 20937 var element = $('#form-checkout').find('input[name=last_name]'); 20938 $(element).addClass('is-invalid'); 20939 flag = false; 20940 } else { 20941 $('#form-checkout').find('input[name=last_name]').removeClass('is-invalid'); 20942 } 20943 input_value = $('#form-checkout').find('input[name=email]').val(); 20944 var EmailRegex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 20945 var emailValid = EmailRegex.test(input_value); 20946 if (input_value == "" || input_value == undefined || !emailValid) { 20947 var element = $('#form-checkout').find('input[name=email]'); 20948 $(element).addClass('is-invalid'); 20949 flag = false; 20950 } else { 20951 $('#form-checkout').find('input[name=email]').removeClass('is-invalid'); 20952 } 20953 input_value = $('#form-checkout').find('select[name=country]').val(); 20954 if (input_value == "" || input_value == undefined) { 20955 $('#form-checkout').find('select[name=country]').addClass('is-invalid'); 20956 flag = false; 20957 } else { 20958 $('#form-checkout').find('select[name=country]').removeClass('is-invalid'); 20959 } 20960 input_value = $('#form-checkout').find('input[name=address_line_1]').val(); 20961 $('#form-checkout').find('input[name=address_line_1]').removeClass('is-invalid'); 20962 if (input_value == "" || input_value == undefined) { 20963 var element = $('#form-checkout').find('input[name=address_line_1]'); 20964 $(element).addClass('is-invalid'); 20965 flag = false; 20966 } 20967 input_value = $('#form-checkout').find('input[name=city]').val(); 20968 $('#form-checkout').find('input[name=city]').removeClass('is-invalid'); 20969 if (input_value == "" || input_value == undefined) { 20970 var element = $('#form-checkout').find('input[name=city]'); 20971 $(element).addClass('is-invalid'); 20972 flag = false;
20973 } 20974 input_value = $('#form-checkout').find('input[name=state]').val(); 20975 $('#form-checkout').find('input[name=state]').removeClass('is-invalid'); 20976 if (input_value == "" || input_value == undefined) { 20977 var element = $('#form-checkout').find('input[name=state]'); 20978 $(element).addClass('is-invalid'); 20979 flag = false; 20980 } 20981 $('.room_guests_wrap').each(function (i, room) { 20982 var index = $(room).data('index'); 20983 var copy_value = $('.room_copy_guest_' + index).prop('checked'); 20984 $('.room_first_name_' + index).removeClass('is-invalid'); 20985 $('.room_last_name_' + index).removeClass('is-invalid'); 20986 $('.room_email_' + index).removeClass('is-invalid'); 20987 $('.room_phone_' + index).removeClass('is-invalid'); 20988 if (index > 0 && !copy_value) { 20989 input_value = $('.room_first_name_' + index).val(); 20990 if (input_value == "" || input_value == undefined) { 20991 $('.room_first_name_' + index).addClass('is-invalid'); 20992 flag = false; 20993 } 20994 input_value = $('.room_last_name_' + index).val(); 20995 if (input_value == "" || input_value == undefined) { 20996 $('.room_last_name_' + index).addClass('is-invalid'); 20997 flag = false; 20998 } 20999 input_value = $('.room_email_' + index).val(); 21000 var EmailRegex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 21001 var emailValid = EmailRegex.test(input_value); 21002 if (input_value == "" || input_value == undefined || !emailValid) { 21003 $('.room_email_' + index).addClass('is-invalid'); 21004 flag = false; 21005 } 21006 input_value = $('.room_phone_' + index).val(); 21007 if (input_value == "" || input_value == undefined) { 21008 $('.room_phone_' + index).addClass('is-invalid'); 21009 flag = false; 21010 } 21011 } 21012 }); 21013 input_value = $('#form-checkout').find('input[name=payment_gateway]:checked').val(); 21014 if (input_value != undefined) {} 21015 var firstWrongElement = $('.is-invalid'); 21016 if (scroll && firstWrongElement.length > 0) { 21017 this.scrollToElement(firstWrongElement[0]); 21018 } 21019 $('#form-checkout .is-invalid').each(function (index, elem) { 21020 $(elem).closest('.position-relative').addClass('validation-required'); 21021 }); 21022 return flag; 21023 }, 21024 applyCoupon: function applyCoupon() { 21025 var abc = this; 21026 $.ajax({ 21027 url: fresco.url + '/booking/applyCoupon', 21028 type: "POST", 21029 data: { 21030 name: this.name, 21031 code: $('input[name=code]').val() 21032 }, 21033 success: function success(response) { 21034 if (response.error) { 21035 abc.error = true; 21036 abc.error_message = response.message; 21037 setTimeout(function () { 21038 abc.error = false; 21039 }, 3000); 21040 } else { 21041 window.location.reload(); 21042 } 21043 }, 21044 error: function error(_error) { 21045 console.log(_error); 21046 abc.error = true; 21047 abc.error_message = "Network error, try again"; 21048 } 21049 }); 21050 }, 21051 removeCoupon: function removeCoupon() { 21052 var abc = this; 21053 $.ajax({ 21054 url: fresco.url + '/booking/removeCoupon', 21055 type: "POST", 21056 data: { 21057 name: this.name, 21058 code: $('input[name=code]').val() 21059 }, 21060 success: function success(response) { 21061 window.location.reload(); 21062 }, 21063 error: function error(_error2) { 21064 abc.error = true; 21065 abc.error_message = "Network error"; 21066 } 21067 }); 21068 }, 21069 is_name_and_email_filled: function is_name_and_email_filled() { 21070 var email = $('#form-checkout').find('input[name=email]').val(); 21071 var last_name = $('#form-checkout').find('input[name=last_name]').val(); 21072 var first_name = $('#form-checkout').find('input[name=first_name]').val(); 21073 if (email && last_name && first_name) { 21074 return true; 21075 } 21076 return false; 21077 }, 21078 name_or_email_fields_changed: function name_or_email_fields_changed() { 21079 if (this.is_name_and_email_filled()) { 21080 // This plugin is abandoned 21081 // document.payLaterObjects.loadStripeClientSecret(); 21082 } 21083 }, 21084 scrollToElement: function scrollToElement(element) { 21085 $('html, body').animate({ 21086 scrollTop: $(element).offset().top 21087 }, 100, function () { 21088 $(element).focus(); 21089 }); 21090 }, 21091 sendCheckout: function sendCheckout(me, dataUrl, dataToSubmit) { 21092 $.ajax({ 21093 url: dataUrl, 21094 data: dataToSubmit, 21095 method: "post", 21096 success: function success(res) { 21097 if (!res.status && !res.url) { 21098 me.onSubmit = false;
21099 me.isOverlayVisible = false; 21100 } 21101 if (res.elements) { 21102 for (var k in res.elements) { 21103 $(k).html(res.elements[k]); 21104 } 21105 } 21106 if (res.message) { 21107 if (res.message.message) { 21108 me.message.content = res.message.message; 21109 } else { 21110 me.message.content = res.message; 21111 } 21112 me.message.type = res.status; 21113 } 21114 if (res.url) { 21115 window.location.href = res.url; 21116 } 21117 if (res.errors && _typeof(res.errors) == 'object') { 21118 var html = ''; 21119 for (var i in res.errors) { 21120 html += res.errors[i] + '<br>'; 21121 } 21122 me.message.content = html; 21123 } 21124 }, 21125 error: function error(e) { 21126 me.onSubmit = false; 21127 me.isOverlayVisible = false; 21128 if (e.responseJSON) { 21129 me.message.content = e.responseJSON.message ? e.responseJSON.message : 'Can not booking'; 21130 me.message.type = false;
21131 } else { 21132 if (e.responseText) { 21133 me.message.content = e.responseText; 21134 me.message.type = false; 21135 } 21136 } 21137 } 21138 }); 21139 }, 21140 initiateCardWidget: function initiateCardWidget(selector) { 21141 new Card({ 21142 // a selector or DOM element for the form where users will 21143 // be entering their information 21144 form: '.' + selector + '_gateway_parent', 21145 // a selector or DOM element for the container 21146 // where you want the card to appear 21147 container: '.' + selector + '_card-wrapper', 21148 formSelectors: { 21149 numberInput: 'input[name=' + selector + '_card_number]', 21150 // optional — default input[name="number"] 21151 expiryInput: 'input[name=' + selector + '_card_expiration]', 21152 // optional — default input[name="expiry"] 21153 cvcInput: 'input[name=' + selector + '_card_cvc]', 21154 // optional — default input[name="cvc"] 21155 nameInput: 'input[name=' + selector + '_card_first_name],input[name=' + selector + '_card_last_name]' // optional - defaults input[name="name"] 21156 } 21157 }); 21158 }, 21159 registerEvents: function registerEvents() { 21160 var _this = this; 21161 var self = this; 21162 setTimeout(function () { 21163 _this.name_or_email_fields_changed(); 21164 }, 1000); 21165 for (var _i = 0, _Object$entries = Object.entries(this.gateways); _i < _Object$entries.length; _i++) { 21166 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), 21167 key = _Object$entries$_i[0], 21168 data = _Object$entries$_i[1]; 21169 if (['stripe', 'stripe_pay_later', 'save_credit_card'].includes(data)) { 21170 this.initiateCardWidget(data); 21171 } 21172 } 21173 var initiateCardWidget = false; 21174 if (initiateCardWidget) { 21175 // initiateCardWidget(); 21176 } 21177 $(document).on('keyup', '.is-invalid', function () { 21178 $(this).removeClass('is-invalid'); 21179 }); 21180 $(document).on('change', '.room_copy_guests', function () { 21181 var isChecked = $(this).prop('checked'); 21182 var index = $(this).data('index'); 21183 var first_name = $('#form-checkout').find('input[name=first_name]').val(); 21184 var last_name = $('#form-checkout').find('input[name=last_name]').val(); 21185 var email = $('#form-checkout').find('input[name=email]').val(); 21186 var phone = $('#form-checkout').find('input[name=phone]').val(); 21187 var country_code = $('#form-checkout').find('input[name=country_code]').val(); 21188 var phone_code = $('#form-checkout').find('input[name=phone_code]').val(); 21189 $('.room_first_name_' + index).val(first_name); 21190 $('.room_last_name_' + index).val(last_name); 21191 $('.room_email_' + index).val(email); 21192 $('.room_phone_' + index).val(phone); 21193 $('.room_copy_guest_' + index).prop('checked', isChecked); 21194 self.validate(false); 21195 }); 21196 $("#bravo_save_credit_card_expiration").keypress(function (e) { 21197 var exp = $(this).val(); 21198 if (exp.length >= 9) { 21199 $(this).val($(this).val().substring(0, 9)); 21200 e.preventDefault(); 21201 } 21202 }); 21203 var selectContainer = document.getElementById("js_pn-select"); 21204 var countrySearchInput = document.getElementById("js_search-input"); 21205 var noResultListItem = document.getElementById("js_no-results-found"); 21206 var dropdownTrigger = document.getElementById("js_trigger-dropdown"); 21207 var phoneNumberInput = document.getElementById("js_input-phonenumber"); 21208 var dropdownContainer = document.getElementById("js_dropdown"); 21209 var selectedPrefix = document.getElementById("js_number-prefix"); 21210 var selectedFlag = document.getElementById("js_selected-flag"); 21211 var listContainer = document.getElementById("js_list"); 21212 var countryList; 21213 var init = /*#__PURE__*/function () { 21214 var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(countries) { 21215 var selectCountry, setNewSelected, addSelectedModifier, closeDropdown, openDropdown, countdown, closeOnMouseLeave, clearTimeOut, attatchDropdownEvents, removeDropdownEvents, createList, attatchListItemEventListeners, initiateList; 21216 return _regeneratorRuntime().wrap(function _callee$(_context) { 21217 while (1) switch (_context.prev = _context.next) { 21218 case 0: 21219 selectCountry = function selectCountry(e) { 21220 var _e$target$closest$dat = e.target.closest("li").dataset, 21221 flag = _e$target$closest$dat.flag, 21222 prefix = _e$target$closest$dat.prefix; 21223 setNewSelected(prefix, flag); 21224 closeDropdown(); 21225 addSelectedModifier(flag); 21226 }; // -------------- Update the 'Selected country flag' to reflect changes 21227 setNewSelected = function setNewSelected(prefix, flag) { 21228 $('#country_code').val(flag); 21229 $('#phone_code').val(prefix); 21230 selectedFlag.src = "https://flagpedia.net/data/flags/icon/36x27/".concat(flag.toLowerCase(), ".png"); 21231 selectedPrefix.textContent = "+".concat(prefix); 21232 selectContainer.style.setProperty("--prefix-length", prefix.length); 21233 }; // -------------- Removes and adds modifier to selected country 21234 addSelectedModifier = function addSelectedModifier(flag) { 21235 var previousSelected = document.getElementsByClassName("pn-list-item--selected")[0]; 21236 var newSelected = document.querySelectorAll(".pn-list-item[data-flag=".concat(flag, "]"))[0]; 21237 if (previousSelected != undefined) { 21238 previousSelected.classList.remove("pn-list-item--selected"); 21239 newSelected.classList.add("pn-list-item--selected"); 21240 } 21241 }; // -------------- Close dropdown 21242 closeDropdown = function closeDropdown() { 21243 selectContainer.classList.remove("pn-select--open"); 21244 listContainer.scrollTop = 0; 21245 countrySearchInput.value = ""; 21246 countryList.search(); 21247 phoneNumberInput.focus(); 21248 removeDropdownEvents(); 21249 }; 21250 $('#js_input-phonenumber').focus(function () { 21251 $('#js_pn-select').addClass('focused'); 21252 }); 21253 $('#js_input-phonenumber').blur(function () { 21254 $('#js_pn-select').removeClass('focused'); 21255 }); 21256 21257 // -------------- Open dropdown 21258 openDropdown = function openDropdown() { 21259 selectContainer.classList.add("pn-select--open"); 21260 attatchDropdownEvents(); 21261 }; // -------------- Dropdown event listeners 21262 closeOnMouseLeave = function closeOnMouseLeave() { 21263 // console.log("countdown activated"); 21264 countdown = setTimeout(function () { 21265 return closeDropdown(); 21266 }, 2000); 21267 }; 21268 clearTimeOut = function clearTimeOut() { 21269 return clearTimeout(countdown); 21270 }; 21271 attatchDropdownEvents = function attatchDropdownEvents() { 21272 // console.log("Adding event listeners"); 21273 dropdownContainer.addEventListener("mouseleave", closeOnMouseLeave); 21274 dropdownContainer.addEventListener("mouseenter", clearTimeOut); 21275 }; 21276 removeDropdownEvents = function removeDropdownEvents() { 21277 // console.log("Removing event listeners and countdown"); 21278 clearTimeout(countdown); 21279 dropdownContainer.removeEventListener("mouseleave", closeOnMouseLeave); 21280 dropdownContainer.removeEventListener("mouseenter", clearTimeOut); 21281 }; // -------------- Close when clicked outside the dropdown 21282 document.addEventListener("click", function (e) { 21283 if (e.target !== selectContainer && !selectContainer.contains(e.target) && selectContainer.classList.contains("pn-select--open")) { 21284 closeDropdown(); 21285 } 21286 }); 21287 21288 // -------------- Append generated listItems to list element
21289 createList = function createList() { 21290 return new Promise(function (resolve, _) { 21291 countries.forEach(function (country, index, countries) { 21292 var name = country.name, 21293 prefix = country.prefix, 21294 flag = country.flag; 21295 var element = "<li class=\"pn-list-item ".concat(flag === "us" ? "pn-list-item--selected" : "", " js_pn-list-item\" data-flag=\"").concat(flag, "\" data-prefix=\"").concat(prefix, "\" tabindex=\"0\" role=\"button\" aria-pressed=\"false\">\n <img class=\"pn-list-item__flag\" src=\"https://flagpedia.net/data/flags/icon/36x27/").concat(flag.toLowerCase(), ".png\" />\n <span class=\"pn-list-item__country js_country-name\">").concat(name, "</span>\n <span class=\"pn-list-item__prefix js_country-prefix\">(+").concat(prefix, ")</span>\n </li>"); 21296 listContainer.innerHTML += element; 21297 if (index === countries.length - 1) { 21298 resolve(); 21299 } 21300 }); 21301 }); 21302 }; // -------------- After all the listItems are created we loop over the items to attach the eventListeners 21303 attatchListItemEventListeners = function attatchListItemEventListeners() { 21304 return new Promise(function (resolve, _) { 21305 var listItems = _toConsumableArray(document.getElementsByClassName("js_pn-list-item")); 21306 listItems.forEach(function (item, index, listItems) { 21307 item.addEventListener("click", function (event) { 21308 selectCountry(event); 21309 }); 21310 // Keydown event listener - https://dev.to/tylerjdev/when-role-button-is-not-enough-dac 21311 item.addEventListener("keydown", function (e) { 21312 var keyD = e.key !== undefined ? e.key : e.keyCode; 21313 if (keyD === "Enter" || keyD === 13 || ["Spacebar", " "].indexOf(keyD) >= 0 || keyD === 32) { 21314 e.preventDefault(); 21315 this.click(); 21316 } 21317 }); 21318 if (index === listItems.length - 1) { 21319 resolve(); 21320 } 21321 }); 21322 }); 21323 }; // -------------- After all the listItems are created we initate list and it's listeners 21324 initiateList = function initiateList() { 21325 countryList = new List("js_pn-select", { 21326 valueNames: ["js_country-name", "js_country-prefix"] 21327 }); 21328 21329 // Add 'updated' listener for search results 21330 countryList.on("updated", function (list) { 21331 if (list.matchingItems.length < 5) listContainer.classList.toggle("pn-list--no-scroll"); 21332 noResultListItem.style.display = list.matchingItems.length > 0 ? "none" : "block"; 21333 }); 21334 }; 21335 _context.next = 17; 21336 return createList(); 21337 case 17: 21338 _context.next = 19; 21339 return attatchListItemEventListeners(); 21340 case 19: 21341 initiateList(); 21342 dropdownTrigger.addEventListener("click", function () { 21343 var isOpen = selectContainer.classList.contains("pn-select--open"); 21344 isOpen ? closeDropdown() : openDropdown(); 21345 }); 21346 case 21: 21347 case "end": 21348 return _context.stop(); 21349 } 21350 }, _callee); 21351 })); 21352 return function init(_x) { 21353 return _ref.apply(this, arguments); 21354 }; 21355 }(); 21356 var countries = __webpack_require__(/*! ./../countries.json */ "./resources/js/countries.json"); 21357 init(countries); 21358 } 21359 } 21360}); 21361 21362/***/ }), 21363
21364/***/ "./resources/js/modules/booking_details.js": 21365/*!*************************************************!*\ 21366 !*** ./resources/js/modules/booking_details.js ***! 21367 \*************************************************/ 21368/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 21369 21370"use strict"; 21371__webpack_require__.r(__webpack_exports__); 21372/* harmony export */ __webpack_require__.d(__webpack_exports__, { 21373/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 21374/* harmony export */ }); 21375/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 21376 otherData: { 21377 applied: false, 21378 name: "", 21379 price: 0, 21380 s_price: "", 21381 error: false, 21382 error_message: "", 21383 checkout: false, 21384 booking_id: '', 21385 is_modified: false 21386 }, 21387 methods: { 21388 updatePMS: function updatePMS() { 21389 var url = fresco.url + '/booking/update-pms'; 21390 $.ajax({ 21391 url: fresco.url + '/booking/update-pms', 21392 data: { 21393 booking_id: this.booking_id, 21394 is_modified: this.is_modified 21395 }, 21396 method: 'post', 21397 success: function success(json) {}, 21398 error: function error(e) { 21399 console.log(e); 21400 } 21401 }); 21402 }, 21403 registerEvents: function registerEvents() { 21404 this.updatePMS(); 21405 $(document).ready(function () { 21406 $('.js-cancel-confirm-button').click(function () { 21407 $('.js-cancel-confirm-button .d-none').removeClass('d-none'); 21408 }); 21409 }); 21410 } 21411 } 21412}); 21413 21414/***/ }), 21415
21416/***/ "./resources/js/modules/booking_history.js": 21417/*!*************************************************!*\ 21418 !*** ./resources/js/modules/booking_history.js ***! 21419 \*************************************************/ 21420/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 21421 21422"use strict"; 21423__webpack_require__.r(__webpack_exports__); 21424/* harmony export */ __webpack_require__.d(__webpack_exports__, { 21425/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 21426/* harmony export */ }); 21427/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 21428 otherData: { 21429 booking_id: '', 21430 results: { 21431 data: [], 21432 total: 0, 21433 per_page: 20, 21434 from: 1, 21435 to: 0, 21436 current_page: 1 21437 }, 21438 category: '', 21439 date: '', 21440 time: '', 21441 type: '', 21442 description: '', 21443 offset: 4 21444 }, 21445 computed: { 21446 pagesNumber: function pagesNumber() { 21447 if (!this.results.to) { 21448 return []; 21449 } 21450 var from = this.results.current_page - this.offset; 21451 if (from < 1) { 21452 from = 1; 21453 } 21454 var to = from + this.offset * 2; 21455 if (to >= this.results.last_page) { 21456 to = this.results.last_page; 21457 } 21458 var pagesArray = []; 21459 for (var page = from; page <= to; page++) { 21460 pagesArray.push(page); 21461 } 21462 return pagesArray; 21463 } 21464 }, 21465 methods: { 21466 changePage: function changePage(page) { 21467 this.results.current_page = page; 21468 this.fetchResult(); 21469 }, 21470 fetchResult: function fetchResult() { 21471 var me = this; 21472 $.ajax({ 21473 url: fresco.url + '/user/booking/get_history_data?page=' + this.results.current_page, 21474 data: { 21475 booking_id: this.booking_id, 21476 category: this.category, 21477 date: this.date, 21478 time: this.time, 21479 type: this.type, 21480 description: this.description 21481 }, 21482 method: 'post', 21483 success: function success(json) { 21484 setTimeout(function () { 21485 me.results.data = json.data; 21486 me.results.current_page = json.current_page; 21487 me.results.from = json.from; 21488 me.results.to = json.to; 21489 me.results.total = json.total; 21490 me.results.per_page = json.per_page; 21491 me.results.last_page = json.last_page; 21492 }); 21493 }, 21494 error: function error(e) {} 21495 }); 21496 }, 21497 registerEvents: function registerEvents() { 21498 this.fetchResult(); 21499 } 21500 } 21501}); 21502 21503/***/ }), 21504
21505/***/ "./resources/js/modules/common/booking_change.js": 21506/*!*******************************************************!*\ 21507 !*** ./resources/js/modules/common/booking_change.js ***! 21508 \*******************************************************/ 21509/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 21510 21511"use strict"; 21512__webpack_require__.r(__webpack_exports__); 21513/* harmony export */ __webpack_require__.d(__webpack_exports__, { 21514/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 21515/* harmony export */ }); 21516function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 21517function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 21518function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 21519function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 21520function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 21521function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 21522function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 21523function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 21524function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } 21525function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 21526/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 21527 otherData: { 21528 applied: false, 21529 code: '', 21530 name: "", 21531 price: 0, 21532 s_price: "", 21533 error: false, 21534 taxes: [], 21535 tax_values: {}, 21536 r_taxes: [], 21537 r_tax_values: {}, 21538 booking: {}, 21539 adults: 1, 21540 children: 0, 21541 room: 1, 21542 currency: fresco.currency_symbol, 21543 change_data: { 21544 modified: false, 21545 additional_price: 0, 21546 is_negative: false 21547 }, 21548 default_change_data: { 21549 modified: false, 21550 additional_price: 0 21551 }, 21552 temp: { 21553 rooms: {} 21554 }, 21555 is_modified: false, 21556 original_booking: {}, 21557 original_temp: {}, 21558 service: {}, 21559 rooms: [], 21560 available_rooms: [], 21561 coupon: '', 21562 couponCode: '', 21563 couponError: '', 21564 couponMaxAmount: '', 21565 couponMinAmount: '', 21566 couponValue: '', 21567 coupon_offer: '', 21568 couponId: '', 21569 couponType: '', 21570 currency_symbol: '', 21571 step_num: 0, 21572 i18n: [], 21573 max_adults: 0, 21574 max_children: 0, 21575 max_occupancy: 0, 21576 recommended_rooms: [], 21577 recommended_rooms_price: 0, 21578 recommended_rooms_taxes: [], 21579 total_price_before_fee: 0, 21580 additional_price: 0, 21581 update: false, 21582 onSubmit1: false, 21583 buyer_fees: 0, 21584 offerSaveNormal: 0, 21585 modified_rooms: [], 21586 modified_data: { 21587 start_date: '', 21588 end_date: '', 21589 total: '', 21590 old_room: '', 21591 new_room: '' 21592 }, 21593 guest: { 21594 rooms: [], 21595 index: '' 21596 }, 21597 extra_price: [], 21598 extra_price_recommended: [] 21599 }, 21600 methods: { 21601 formatMoney: function formatMoney(m) { 21602 return window.bravo_format_money(m); 21603 }, 21604 goToStep: function goToStep(step_num) { 21605 this.step_num = step_num; 21606 }, 21607 showTopView: function showTopView() { 21608 document.getElementById('booking_change').scrollIntoView(); 21609 }, 21610 format_money_float: function format_money_float(price) { 21611 return window.bravo_format_float_money(price); 21612 }, 21613 cloneObject: function cloneObject(obj) { 21614 var merge = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 21615 return $.extend(true, {}, obj); 21616 }, 21617 addPersonType: function addPersonType(type) { 21618 switch (type) { 21619 case "room": 21620 this.room++; 21621 break; 21622 case "adults": 21623 this.adults++; 21624 break; 21625 case "children": 21626 this.children++; 21627 break; 21628 } 21629 }, 21630 minusPersonType: function minusPersonType(type) { 21631 switch (type) { 21632 case "room": 21633 if (this.room >= 2) { 21634 this.room--; 21635 } 21636 break; 21637 case "adults": 21638 if (this.adults >= 2) { 21639 this.adults--; 21640 } 21641 break; 21642 case "children": 21643 if (this.children >= 1) { 21644 this.children--; 21645 } 21646 break; 21647 } 21648 }, 21649 getStepType: function getStepType() { 21650 var type = 'cancel'; 21651 if (this.step_num == 1) { 21652 type = 'guest'; 21653 } else if (this.step_num == 2) { 21654 type = 'date'; 21655 } else if (this.step_num == 3) { 21656 type = 'room'; 21657 } else if (this.step_num == 4) { 21658 type = 'new_room'; 21659 } 21660 return type; 21661 },
21662 addTaxData: function addTaxData(id, title, price) { 21663 var tax = 0; 21664 for (var key in this.booking.tax) { 21665 if (this.booking.tax.hasOwnProperty(key)) { 21666 if (key !== "__number__") { 21667 var d = this.booking.tax[key].room.split(","); 21668 for (var j = 0; j < d.length; j++) { 21669 if (d[j] == "all" || d[j] == id) { 21670 tax += this.addTax(this.booking.tax[key], title, price); 21671 } 21672 } 21673 } 21674 } 21675 } 21676 return tax; 21677 }, 21678 addTax: function addTax(data, title, price) { 21679 var flag = true; 21680 for (var i = 0; i < this.taxes.length; i++) { 21681 if (this.taxes[i].id == data.id) { 21682 flag = false; 21683 break; 21684 } 21685 } 21686 if (flag) { 21687 this.taxes.push(data); 21688 } 21689 switch (data.type) { 21690 case "percentage": 21691 var tax = parseFloat(price) * (parseFloat(data.value) / 100); 21692 if (this.tax_values[data.id] != undefined || this.tax_values[data.id] != null) { 21693 this.tax_values[data.id] += tax; 21694 } else { 21695 this.tax_values[data.id] = tax; 21696 } 21697 return tax; 21698 case "fixed": 21699 var tax = parseFloat(data.value); 21700 if (this.tax_values[data.id] != undefined || this.tax_values[data.id] != null) { 21701 this.tax_values[data.id] += tax; 21702 } else { 21703 this.tax_values[data.id] = tax; 21704 } 21705 return tax; 21706 default: 21707 return 0; 21708 } 21709 }, 21710 addTaxesToRecommendedRoom: function addTaxesToRecommendedRoom(recommended_rooms, taxes) { 21711 var _this = this; 21712 var guests = this.children + this.adults; 21713 var total_price = 0; 21714 var total_price_room = 0; 21715 this.r_tax_values = {}; 21716 this.r_taxes = []; 21717 var me = this; 21718 me.offerSaveRecommended = 0; 21719 var allRooms = []; 21720 for (var _i = 0, _Object$entries = Object.entries(recommended_rooms); _i < _Object$entries.length; _i++) { 21721 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), 21722 key = _Object$entries$_i[0], 21723 recommended = _Object$entries$_i[1]; 21724 for (var _i2 = 0, _Object$entries2 = Object.entries(recommended.allRooms); _i2 < _Object$entries2.length; _i2++) { 21725 var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2), 21726 _key = _Object$entries2$_i[0], 21727 room = _Object$entries2$_i[1]; 21728 allRooms.push(room); 21729 } 21730 } 21731 var r_rooms = allRooms.map(function (room) { 21732 var current_room_price = room.discount_price * room.number_selected; 21733 total_price += current_room_price; 21734 total_price_room += current_room_price; 21735 me.offerSaveRecommended += (room.price - room.discount_price) * room.number_selected; 21736 var tax = []; 21737 for (var taxKey in taxes) { 21738 if (taxes[taxKey].room == "all") { 21739 var tempTaxHolder = _toConsumableArray(me.recommended_rooms_taxes); 21740 var flag = tempTaxHolder.some(function (value) { 21741 return value.id === taxes[taxKey].id; 21742 }); 21743 if (!flag) { 21744 tempTaxHolder.push(taxes[taxKey]); 21745 me.recommended_rooms_taxes = tempTaxHolder; 21746 } 21747 if (!_this.r_taxes.includes(taxes[taxKey])) _this.r_taxes.push(taxes[taxKey]); 21748 tax.push(taxes[taxKey]); 21749 var extra_price = 0; 21750 if (taxes[taxKey].type == "percentage") { 21751 var value = parseFloat(taxes[taxKey].value); 21752 if (_this.r_tax_values[taxes[taxKey].id] === undefined) { 21753 _this.r_tax_values[taxes[taxKey].id] = current_room_price * value / 100; 21754 } else { 21755 _this.r_tax_values[taxes[taxKey].id] += current_room_price * value / 100; 21756 } 21757 extra_price = current_room_price * value / 100; 21758 } else { 21759 var value = parseFloat(taxes[taxKey].value); 21760 if (_this.r_tax_values[taxes[taxKey].id] === undefined) { 21761 _this.r_tax_values[taxes[taxKey].id] = value; 21762 } else { 21763 _this.r_tax_values[taxes[taxKey].id] += value; 21764 } 21765 extra_price = value; 21766 } 21767 total_price += extra_price; 21768 } else { 21769 var rooms = taxes[taxKey].room.split(','); 21770 for (var j = 0; j < rooms.length; j++) { 21771 if (room.id == rooms[j]) { 21772 if (!_this.r_taxes.includes(taxes[taxKey])) _this.r_taxes.push(taxes[taxKey]); 21773 tax.push(taxes[taxKey]); 21774 var extra_price = 0; 21775 if (taxes[taxKey].type == "percentage") { 21776 var value = parseFloat(taxes[taxKey].value); 21777 if (_this.r_tax_values[taxes[taxKey].id] === undefined) { 21778 _this.r_tax_values[taxes[taxKey].id] = current_room_price * value / 100; 21779 } else { 21780 _this.r_tax_values[taxes[taxKey].id] += current_room_price * value / 100; 21781 } 21782 extra_price = current_room_price * value / 100; 21783 } else { 21784 var value = parseFloat(taxes[taxKey].value); 21785 if (_this.r_tax_values[taxes[taxKey].id] === undefined) { 21786 _this.r_tax_values[taxes[taxKey].id] = value; 21787 } else { 21788 _this.r_tax_values[taxes[taxKey].id] += value; 21789 } 21790 extra_price = value; 21791 } 21792 total_price += extra_price; 21793 break; 21794 } 21795 } 21796 } 21797 } 21798 room.taxes = tax; 21799 return room; 21800 }); 21801 21802 // Calculating vendor commissions 21803 for (var ix in this.buyer_fees) { 21804 var item = this.buyer_fees[ix]; 21805 21806 //for Fixed 21807 var fee_price = parseFloat(item.price); 21808 21809 //for Percent 21810 if (typeof item.unit !== "undefined" && item.unit === "percent") { 21811 fee_price = total_price_room / 100 * fee_price; 21812 } 21813 if (typeof item.per_person !== "undefined") { 21814 fee_price = fee_price * guests; 21815 } 21816 total_price += fee_price; 21817 } 21818 this.recommended_rooms_price = total_price; 21819 return recommended_rooms; 21820 }, 21821 setDefaultBeforeChanges: function setDefaultBeforeChanges(step) { 21822 var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 21823 this.modified_data.total = this.original_booking.total; 21824 if (step == 1) { 21825 this.guest.index = index; 21826 this.guest.rooms[index] = this.cloneObject(this.temp.rooms[index]); 21827 } else if (step == 2) { 21828 this.modified_data.start_date = this.original_booking.start_date; 21829 this.modified_data.end_date = this.original_booking.end_date; 21830 } else if (step == 3) { 21831 this.temp.rooms[index].number_selected = 0; 21832 this.modified_data.old_room = this.temp.rooms[index].title + ' x 1'; 21833 } 21834 this.goToStep(step); 21835 }, 21836 resetChanges: function resetChanges() { 21837 this.is_modified = false;
21838 this.change_data.additional_price = 0; 21839 this.change_data.is_negative = false; 21840 this.guest.rooms = []; 21841 this.couponError = ''; 21842 this.offerSaveNormal = this.coupon_offer; 21843 this.adults = 1; 21844 this.children = 0; 21845 this.recommended_rooms = {}; 21846 this.modified_rooms = []; 21847 this.additional_price = 0; 21848 this.modified_data = {}; 21849 this.total_price_before_fee = this.original_booking.total_before_fees; 21850 this.booking = this.cloneObject(this.original_booking); 21851 this.temp = this.cloneObject(this.original_temp); 21852 this.goToStep(0); 21853 this.showTopView(); 21854 }, 21855 checkEnableButton: function checkEnableButton(type) { 21856 if (type == 'date') { 21857 if (this.original_booking.start_date == this.booking.start_date && this.original_booking.end_date == this.booking.end_date) { 21858 return false; 21859 } 21860 } 21861 return true; 21862 }, 21863 calculateOccupancy: function calculateOccupancy() { 21864 var check = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; 21865 this.max_adults = this.max_occupancy - parseInt(this.guest.rooms[this.guest.index].t_children); 21866 this.max_children = this.max_occupancy - parseInt(this.guest.rooms[this.guest.index].t_adults); 21867 if (check) { 21868 this.changeBooking(); 21869 } 21870 }, 21871 checkEnabled: function checkEnabled(index, type) { 21872 if (index > 0) { 21873 return false; 21874 } 21875 return true; 21876 }, 21877 resetRooms: function resetRooms() { 21878 var me = this; 21879 me.rooms.forEach(function (room, index) { 21880 room.allRooms.forEach(function (value, key) { 21881 me.rooms[index].allRooms[key].checked = false; 21882 me.rooms[index].allRooms[key].number_selected = 0; 21883 }); 21884 }); 21885 return me.rooms; 21886 }, 21887 updateRoom: function updateRoom(id, value, index) { 21888 this.rooms = this.resetRooms(); 21889 var _this$rooms$filter = this.rooms.filter(function (room) { 21890 return room.id === id; 21891 }), 21892 _this$rooms$filter2 = _slicedToArray(_this$rooms$filter, 1), 21893 selected_room = _this$rooms$filter2[0]; 21894 this.rooms = this.rooms.map(function (room) { 21895 if (room.id === id) room.allRooms[index].checked = true; 21896 return room; 21897 }); 21898 var rooms = []; 21899 var tmpRoom = this.cloneObject(selected_room.allRooms[index]); 21900 tmpRoom.number_selected = value; 21901 rooms.push(tmpRoom); 21902 this.temp.rooms.forEach(function (room) { 21903 rooms.push(room); 21904 }); 21905 this.modified_data.new_room = tmpRoom.title + ' x 1'; 21906 this.is_modified = true; 21907 this.modified_rooms = rooms; 21908 }, 21909 addNewRoom: function addNewRoom(id, value, index) { 21910 var me = this.rooms; 21911 var _this$rooms$filter3 = this.rooms.filter(function (value) { 21912 return value.id === id; 21913 }), 21914 _this$rooms$filter4 = _slicedToArray(_this$rooms$filter3, 1), 21915 selected_room = _this$rooms$filter4[0]; 21916 var count = 0; 21917 selected_room.allRooms[index].number_selected = parseInt(value); 21918 selected_room.allRooms.forEach(function (value) { 21919 count += parseInt(value.number_selected) > 0 ? parseInt(value.number_selected) : 0; 21920 }); 21921 selected_room.allRooms[index].selected = parseInt(value); 21922 selected_room.allRooms.forEach(function (value) { 21923 value.selected_count = count; 21924 }); 21925 var tempRooms = this.rooms.map(function (value) { 21926 if (value.id === id) return selected_room; 21927 return value; 21928 }); 21929 this.rooms = tempRooms; 21930 }, 21931 addRecommendedRoom: function addRecommendedRoom() { 21932 this.rooms = this.recommended_rooms; 21933 this.update = true; 21934 this.changeBooking(); 21935 }, 21936 cancelRoom: function cancelRoom(index) { 21937 setTimeout(function () { 21938 $('#cancelRoomModal_' + index).modal('hide'); 21939 }); 21940 this.temp.rooms[index].number_selected = 0; 21941 this.modified_data.total = this.original_booking.total; 21942 this.modified_data.cancel_room = this.temp.rooms[index].title + ' x 1'; 21943 this.update = true; 21944 this.changeBooking(); 21945 }, 21946 updateOldBooking: function updateOldBooking(rooms) { 21947 var temp = []; 21948 this.modified_data.add_room = []; 21949 for (var _i3 = 0, _Object$entries3 = Object.entries(rooms); _i3 < _Object$entries3.length; _i3++) { 21950 var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2), 21951 key = _Object$entries3$_i[0], 21952 room = _Object$entries3$_i[1]; 21953 if (room.number_selected > 0) { 21954 temp.push(room); 21955 this.modified_data.add_room.push(room.title + ' x ' + room.number_selected); 21956 } 21957 } 21958 for (var _i4 = 0, _Object$entries4 = Object.entries(this.temp.rooms); _i4 < _Object$entries4.length; _i4++) { 21959 var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2), 21960 index = _Object$entries4$_i[0], 21961 booking = _Object$entries4$_i[1]; 21962 if (booking.number_selected > 0) { 21963 temp.push(booking); 21964 } 21965 } 21966 temp = _.map(temp, function (item) { 21967 return _.pick(item, ['id', 'title', 'number', 'number_selected', 'adults', 'children', 't_adults', 't_children', 's_adults', 'extra_adults', 'extra_children', 'price', 'discount_price']); 21968 }); 21969 return temp; 21970 }, 21971 checkAvailability: function checkAvailability() { 21972 var me = this; 21973 this.showTopView();
21974 var type = this.getStepType(); 21975 var adults = this.booking.adults; 21976 var children = this.booking.children; 21977 var room = this.booking.room; 21978 if (type == 'new_room') { 21979 adults = this.adults; 21980 children = this.children; 21981 room = this.room; 21982 } else if (type == 'date') { 21983 if (this.booking.start_date == this.original_booking.start_date && this.booking.end_date == this.original_booking.end_date) { 21984 return false; 21985 } 21986 } 21987 this.rooms = []; 21988 this.couponError = ''; 21989 this.recommended_rooms = []; 21990 this.isLoading = true; 21991 this.change_data.modified = false; 21992 this.is_modified = false; 21993 $.ajax({ 21994 url: $('#check_availability').val(), 21995 data: { 21996 code: this.code, 21997 hotel_id: this.id, 21998 start_date: this.booking.start_date, 21999 end_date: this.booking.end_date, 22000 couponId: this.couponId, 22001 type: type, 22002 adults: adults, 22003 children: children, 22004 room: room, 22005 rooms: this.booking.rooms, 22006 bookings: this.original_booking, 22007 temp_rooms: this.temp.rooms, 22008 guest_rooms: this.guest.rooms 22009 }, 22010 method: 'post', 22011 success: function success(json) { 22012 me.isLoading = false; 22013 if (!json.status) { 22014 frescoApp.showAjaxMessage(json); 22015 } else { 22016 me.rooms = json.rooms; 22017 me.couponError = json.coupon_error; 22018 me.couponMaxAmount = json.coupon_max_amount; 22019 me.couponMinAmount = json.coupon_min_amount; 22020 me.couponValue = json.coupon_value; 22021 me.couponId = json.coupon_id; 22022 me.couponType = json.coupon_type; 22023 if (type == 'date') { 22024 me.changeBooking(); 22025 } else if (type == 'guest') { 22026 me.max_occupancy = json.max_occupancy; 22027 me.guest.rooms = json.guest_rooms; 22028 me.calculateOccupancy(false); 22029 } else if (type == 'new_room') { 22030 me.recommended_rooms = me.addTaxesToRecommendedRoom(json.recommended_rooms, me.booking.tax); 22031 } 22032 $("body").tooltip({ 22033 selector: '[data-toggle=tooltip]' 22034 }); 22035 } 22036 }, 22037 error: function error(e) { 22038 me.isLoading = false; 22039 me.firstLoad = false; 22040 frescoApp.showAjaxError(e); 22041 } 22042 }); 22043 }, 22044 changeBooking: function changeBooking() { 22045 var _this2 = this; 22046 var me = this; 22047 var type = this.getStepType(); 22048 this.showTopView(); 22049 var rooms = []; 22050 this.rooms.forEach(function (room) { 22051 room.allRooms.forEach(function (value) { 22052 if (value.number_selected > 0) { 22053 rooms.push(value); 22054 } 22055 ; 22056 }); 22057 }); 22058 if (rooms.length == 0) { 22059 this.temp.rooms.forEach(function (value) { 22060 if (value.number_selected > 0) { 22061 rooms.push(value); 22062 } 22063 ; 22064 }); 22065 } 22066 if (type == 'room') { 22067 rooms = this.modified_rooms; 22068 } 22069 var room_data = _.map(rooms, function (item) { 22070 return _.pick(item, ['id', 'title', 'number', 'number_selected', 'adults', 'children', 't_adults', 't_children', 's_adults', 'extra_adults', 'extra_children', 'price', 'discount_price']); 22071 }); 22072 if (type == 'new_room') { 22073 room_data = this.updateOldBooking(room_data); 22074 } 22075 this.isLoading = true; 22076 this.change_data.additional_price = 0; 22077 this.change_data.is_negative = false; 22078 this.booking.total_before_fees = this.original_booking.total_before_fees; 22079 this.booking.rooms = this.cloneObject(this.original_booking.rooms); 22080 $.ajax({ 22081 url: $('#change_booking').val(), 22082 data: { 22083 code: this.code, 22084 start_date: this.booking.start_date, 22085 end_date: this.booking.end_date, 22086 type: type, 22087 couponId: this.couponId, 22088 adults: this.booking.adults, 22089 children: this.booking.children, 22090 room: this.booking.room, 22091 rooms: room_data, 22092 guest_rooms: this.guest.rooms, 22093 booking: this.original_booking, 22094 tax: this.booking.tax 22095 }, 22096 method: 'post', 22097 success: function success(json) { 22098 _this2.isLoading = false;
22099 if (!json.status) { 22100 if (json.messages) { 22101 alert(json.messages); 22102 } 22103 return false; 22104 } else { 22105 _this2.booking = _this2.cloneObject(json.data.booked_data); 22106 var additional_price = _this2.original_booking.total_before_fees - _this2.booking.total_before_fees; 22107 if (additional_price > 0) { 22108 _this2.change_data.additional_price = additional_price; 22109 _this2.change_data.is_negative = true; 22110 } else { 22111 _this2.change_data.additional_price = _this2.booking.total_before_fees - _this2.original_booking.total_before_fees; 22112 _this2.change_data.is_negative = false; 22113 } 22114 if (json.data.offer > 0) { 22115 _this2.offerSaveNormal = json.data.offer; 22116 } 22117 if (me.checkEnableButton(type)) { 22118 me.is_modified = true; 22119 } 22120 if (_this2.update) { 22121 _this2.updateBooking(); 22122 } 22123 } 22124 }, 22125 error: function error(e) { 22126 this.isLoading = false; 22127 } 22128 }); 22129 }, 22130 updateBooking: function updateBooking() { 22131 var me = this; 22132 var type = this.getStepType(); 22133 this.showTopView(); 22134 var rooms = []; 22135 this.booking.rooms.forEach(function (value) { 22136 if (value.number_selected > 0) { 22137 rooms.push(value); 22138 } 22139 ; 22140 }); 22141 var room_data = _.map(rooms, function (item) { 22142 return _.pick(item, ['id', 'title', 'number', 'number_selected', 'adults', 'children', 't_adults', 't_children', 's_adults', 'extra_adults', 'extra_children', 'price', 'discount_price']); 22143 }); 22144 this.isLoading = true; 22145 $.ajax({ 22146 url: $('#update_booking').val(), 22147 data: { 22148 code: this.code, 22149 start_date: this.booking.start_date, 22150 end_date: this.booking.end_date, 22151 type: type, 22152 couponId: this.couponId, 22153 rooms: room_data, 22154 booking: this.booking, 22155 tax: this.booking.tax, 22156 tax_value: this.booking.tax_value, 22157 modified_data: this.modified_data 22158 }, 22159 method: 'post', 22160 success: function success(json) { 22161 window.location.href = json.redirect; 22162 }, 22163 error: function error(e) {} 22164 }); 22165 }, 22166 initDatePicker: function initDatePicker() { 22167 var me = this; 22168 var options = { 22169 maxSpan: { 22170 "days": 30 22171 }, 22172 showCalendar: false, 22173 autoApply: true, 22174 disabledPast: true, 22175 dateFormat: fresco.date_format, 22176 enableLoading: true, 22177 showEventTooltip: true, 22178 classNotAvailable: ['disabled', 'off'], 22179 disableHightLight: true, 22180 minDate: moment().format(fresco.date_format), 22181 startDate: me.booking.start_date, 22182 endDate: me.booking.end_date, 22183 opens: fresco.rtl ? 'left' : 'right', 22184 locale: { 22185 direction: fresco.rtl ? 'rtl' : 'ltr', 22186 firstDay: daterangepickerLocale.first_day_of_week, 22187 format: fresco.date_format 22188 } 22189 }; 22190 $(document).ready(function () { 22191 $('.date-picker-range').daterangepicker(options).on('apply.daterangepicker', function (ev, picker) { 22192 if (picker.endDate.diff(picker.startDate, 'day') <= 0) { 22193 picker.endDate.add(1, 'day'); 22194 } 22195 me.booking.start_date = picker.startDate.format(fresco.date_format); 22196 me.booking.end_date = picker.endDate.format(fresco.date_format); 22197 me.is_modified = false; 22198 }); 22199 }); 22200 }, 22201 setStickyPopUpPrice: function setStickyPopUpPrice() { 22202 var main_container_width = $('.start_room_sticky').width(); 22203 var window_height = $(window).height(); 22204 var windowTop = $(window).scrollTop(); 22205 var stickyTop = $('.start_room_sticky').offset().top + 100 - window_height; 22206 var stickyBottom = $('.end_room_sticky').offset().top + 300 - window_height; 22207 if (stickyTop < windowTop && windowTop < stickyBottom) { 22208 $(document).find(".hotel_room_book_status").addClass("sticky").css("width", main_container_width); 22209 $(document).find(".end_room_sticky").css("min-height", $(document).find(".hotel_room_book_status").height() + 32 + 20); 22210 setTimeout(function () { 22211 $(document).find(".hotel_room_book_status").addClass("active"); 22212 }, 100); 22213 } else { 22214 $(document).find(".hotel_room_book_status").removeClass("sticky").css("width", "auto"); 22215 $(document).find(".end_room_sticky").css("min-height", "auto"); 22216 $(document).find(".hotel_room_book_status").removeClass("active"); 22217 } 22218 }, 22219 loadFunctions: function loadFunctions() { 22220 this.initDatePicker(); 22221 }, 22222 registerEvents: function registerEvents() { 22223 var me = this; 22224 $(document).ready(function () { 22225 me.isContentLoading = false;
22226 // SCROLL 22227 $(window).scroll(function () { 22228 me.setStickyPopUpPrice(); 22229 }); 22230 me.showTopView(); 22231 }); 22232 } 22233 }, 22234 computed: { 22235 total_price: function total_price() { 22236 var me = this; 22237 if (me.total_rooms > 0) { 22238 var guests = me.children + me.adults; 22239 var total_price = 0; 22240 var startDate = new Date(me.booking.start_date).getTime(); 22241 var endDate = new Date(me.booking.end_date).getTime(); 22242 this.taxes = []; 22243 var number = this.taxes.length; 22244 for (var i = 0; i < number; i++) { 22245 this.taxes.pop(); 22246 } 22247 this.tax_values = {}; 22248 var tax_fee = 0; 22249 var rooms = []; 22250 this.rooms.forEach(function (room) { 22251 room.allRooms.forEach(function (value) { 22252 rooms.push(value); 22253 }); 22254 }); 22255 rooms.forEach(function (item) { 22256 if (parseInt(item.number_selected) > 0) { 22257 total_price += item.price * parseInt(item.number_selected); 22258 tax_fee += me.addTaxData(item.id, item.title, item.discount_price * parseInt(item.number_selected)); 22259 } 22260 }); 22261 var t_price = total_price; 22262 var duration_in_day = moment(endDate).diff(moment(startDate), 'days'); 22263 for (var ix in me.extra_price) { 22264 var item = me.extra_price[ix]; 22265 var type_total = 0; 22266 if (item.enable === true) { 22267 switch (item.type) { 22268 case "one_time": 22269 type_total += parseFloat(item.price); 22270 break; 22271 case "per_day": 22272 type_total += parseFloat(item.price) * Math.max(1, duration_in_day); 22273 break; 22274 } 22275 if (typeof item.per_person !== "undefined") { 22276 type_total = type_total * guests; 22277 } 22278 total_price += type_total; 22279 } 22280 } 22281 this.total_price_before_fee = total_price; 22282 var total_fee = 0; 22283 // debugger 22284 for (var ix in me.buyer_fees) { 22285 var item = me.buyer_fees[ix]; 22286 22287 //for Fixed 22288 var fee_price = parseFloat(item.price); 22289 22290 //for Percent 22291 if (typeof item.unit !== "undefined" && item.unit === "percent") { 22292 fee_price = total_price / 100 * fee_price; 22293 } 22294 if (typeof item.per_person !== "undefined") { 22295 fee_price = fee_price * guests; 22296 } 22297 total_fee += fee_price; 22298 } 22299 if (me.couponValue !== 0) { 22300 if (total_price >= me.couponMinAmount) { 22301 if (me.couponType == 'percentage') { 22302 var offer = total_price * me.couponValue / 100; 22303 } else { 22304 var offer = me.couponValue; 22305 } 22306 if (me.couponMaxAmount != -1 && offer > me.couponMaxAmount) { 22307 offer = me.couponMaxAmount; 22308 } 22309 me.offerSaveNormal = offer; 22310 } 22311 } 22312 total_price += total_fee; 22313 total_price += tax_fee; 22314 this.total_price_fee = total_fee; 22315 return total_price; 22316 } 22317 return 0; 22318 }, 22319 total_rooms: function total_rooms() { 22320 var me = this; 22321 if (me.rooms.length > 0) { 22322 var t = 0; 22323 var rooms = []; 22324 this.rooms.forEach(function (room) { 22325 room.allRooms.forEach(function (value) { 22326 rooms.push(value); 22327 }); 22328 }); 22329 rooms.forEach(function (item) { 22330 if (item.number_selected) { 22331 t += parseInt(item.number_selected); 22332 } 22333 }); 22334 return t; 22335 } 22336 return 0; 22337 }, 22338 total_price_html: function total_price_html() { 22339 if (!this.total_price) return ''; 22340 setTimeout(function () { 22341 $('[data-toggle="tooltip"]').tooltip(); 22342 $(document).trigger("scroll"); 22343 }, 200); 22344 return window.bravo_format_float_money(this.total_price); 22345 }, 22346 total_price_for_recommend_rooms: function total_price_for_recommend_rooms() { 22347 var me = this; 22348 var total_price = 0; 22349 for (var ix in me.extra_price_recommended) { 22350 var item = me.extra_price_recommended[ix]; 22351 var type_total = 0; 22352 if (item.enable === true) { 22353 switch (item.type) { 22354 case "one_time": 22355 type_total += parseFloat(item.price); 22356 break; 22357 case "per_day": 22358 type_total += parseFloat(item.price) * Math.max(1, duration_in_day); 22359 break; 22360 } 22361 if (typeof item.per_person !== "undefined") { 22362 type_total = type_total * guests; 22363 } 22364 total_price += type_total; 22365 } 22366 } 22367 var total_price_for_recommend_rooms = this.recommended_rooms_price + total_price; 22368 return window.bravo_format_float_money(total_price_for_recommend_rooms); 22369 }, 22370 total_price_for_modified_rooms: function total_price_for_modified_rooms() { 22371 var me = this; 22372 if (me.modified_rooms.length > 0) { 22373 var guests = me.children + me.adults; 22374 var total_price = 0; 22375 var startDate = new Date(me.booking.start_date).getTime(); 22376 var endDate = new Date(me.booking.end_date).getTime(); 22377 this.taxes = []; 22378 var number = this.taxes.length; 22379 for (var i = 0; i < number; i++) { 22380 this.taxes.pop(); 22381 } 22382 this.tax_values = {}; 22383 var tax_fee = 0; 22384 var i = 1;
22385 this.modified_rooms.forEach(function (item) { 22386 if (item.number_selected > 0) { 22387 total_price += item.price * parseInt(item.number_selected); 22388 tax_fee += me.addTaxData(item.id, item.title, item.discount_price * parseInt(item.number_selected)); 22389 i++; 22390 } 22391 }); 22392 var t_price = total_price; 22393 var duration_in_day = moment(endDate).diff(moment(startDate), 'days'); 22394 for (var ix in me.extra_price) { 22395 var item = me.extra_price[ix]; 22396 var type_total = 0; 22397 if (item.enable === true) { 22398 switch (item.type) { 22399 case "one_time": 22400 type_total += parseFloat(item.price); 22401 break; 22402 case "per_day": 22403 type_total += parseFloat(item.price) * Math.max(1, duration_in_day); 22404 break; 22405 } 22406 if (typeof item.per_person !== "undefined") { 22407 type_total = type_total * guests; 22408 } 22409 total_price += type_total; 22410 } 22411 } 22412 var total_fee = 0; 22413 // debugger 22414 for (var ix in me.buyer_fees) { 22415 var item = me.buyer_fees[ix]; 22416 22417 //for Fixed 22418 var fee_price = parseFloat(item.price); 22419 22420 //for Percent 22421 if (typeof item.unit !== "undefined" && item.unit === "percent") { 22422 fee_price = total_price / 100 * fee_price; 22423 } 22424 if (typeof item.per_person !== "undefined") { 22425 fee_price = fee_price * guests; 22426 } 22427 total_fee += fee_price; 22428 } 22429 for (var _i5 = 0, _Object$entries5 = Object.entries(this.taxes); _i5 < _Object$entries5.length; _i5++) { 22430 var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2), 22431 key = _Object$entries5$_i[0], 22432 tax = _Object$entries5$_i[1]; 22433 for (var _i6 = 0, _Object$entries6 = Object.entries(this.tax_values); _i6 < _Object$entries6.length; _i6++) { 22434 var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2), 22435 key1 = _Object$entries6$_i[0], 22436 value = _Object$entries6$_i[1]; 22437 if (tax.id == key) { 22438 me.taxes[key1].values = value; 22439 } 22440 } 22441 } 22442 this.total_price_before_fee = total_price; 22443 this.additional_price = total_price - parseFloat(this.original_booking.total_before_fees).toFixed(2); 22444 if (this.additional_price < 0) { 22445 this.additional_price = Math.abs(this.additional_price); 22446 this.change_data.is_negative = true; 22447 } else { 22448 this.change_data.is_negative = false; 22449 } 22450 if (this.couponValue !== 0) { 22451 if (this.couponType == 'percentage') { 22452 this.offerSaveNormal = total_price * this.couponValue / 100; 22453 } else { 22454 this.offerSaveNormal = this.couponValue; 22455 } 22456 total_price -= this.offerSaveNormal; 22457 } 22458 total_price += total_fee; 22459 total_price += tax_fee; 22460 this.total_price_fee = total_fee; 22461 this.booking.tax = this.taxes; 22462 return total_price; 22463 } 22464 return this.booking.total; 22465 } 22466 } 22467}); 22468 22469/***/ }), 22470
22471/***/ "./resources/js/modules/common/bulk_edit_price_view.js": 22472/*!*************************************************************!*\ 22473 !*** ./resources/js/modules/common/bulk_edit_price_view.js ***! 22474 \*************************************************************/ 22475/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 22476 22477"use strict"; 22478__webpack_require__.r(__webpack_exports__); 22479/* harmony export */ __webpack_require__.d(__webpack_exports__, { 22480/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 22481/* harmony export */ }); 22482/* harmony import */ var _components_VariablePriceComponent_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../components/VariablePriceComponent.vue */ "./resources/js/components/VariablePriceComponent.vue"); 22483 22484/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 22485 otherData: { 22486 is_variable_pricing_update: false, 22487 is_variable_price_available: false, 22488 variable_data: { 22489 variable_price: { 22490 extra_adults: [ 22491 // {id: 1, number: 1, price: 10}, 22492 // {id: 2, number: 2, price: 20}, 22493 ], 22494 extra_children: [ 22495 // {id: 1, number: 1, price: 10}, 22496 // {id: 2, number: 2, price: 20}, 22497 ] 22498 } 22499 } 22500 }, 22501 components: { 22502 VariablePrice: _components_VariablePriceComponent_vue__WEBPACK_IMPORTED_MODULE_0__["default"] 22503 }, 22504 methods: { 22505 setVariableDataAndRelated: function setVariableDataAndRelated() { 22506 var me = this; 22507 var getVariablePriceAndRelatedUrl = $('#getVariablePriceAndRelatedUrl').val(); 22508 var room_class_ids = $('#js-rooms-select2').val(); 22509 if (room_class_ids.length > 1) { 22510 me.is_variable_pricing_update = false; 22511 me.is_variable_price_available = false; 22512 me.variable_data.variable_price = null; 22513 } else { 22514 $.get({ 22515 url: getVariablePriceAndRelatedUrl, 22516 data: { 22517 room_class_id: room_class_ids 22518 }, 22519 success: function success(data) { 22520 console.log('The data is', data); 22521 if (data.variablePrice) { 22522 me.is_variable_pricing_update = true; 22523 me.is_variable_price_available = true; 22524 me.variable_data.variable_price = data.variablePrice; 22525 } 22526 } 22527 }); 22528 } 22529 }, 22530 registerEvents: function registerEvents() { 22531 var me = this; 22532 $('#js-rooms-select2').change(function () { 22533 me.setVariableDataAndRelated(); 22534 }); 22535 me.setVariableDataAndRelated(); 22536 } 22537 } 22538}); 22539 22540/***/ }), 22541
vendor: 2,058 bytes, lines 22542-22554
22542/***/ "./resources/js/modules/common/bulk_update_availability_view.js": 22543/*!**********************************************************************!*\ 22544 !*** ./resources/js/modules/common/bulk_update_availability_view.js ***! 22545 \**********************************************************************/ 22546/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 22547 22548"use strict"; 22549__webpack_require__.r(__webpack_exports__); 22550/* harmony export */ __webpack_require__.d(__webpack_exports__, { 22551/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 22552/* harmony export */ }); 22553function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 22554function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap;
vendor: 5,446 bytes, line 22554
22554 var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEac
22554h(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } 22555function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 22556function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 22557/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 22558 otherData: { 22559 message: "Hello Vue!", 22560 bulkData: {}, 22561 isInitial: true, 22562 modalData: {}, 22563 isModalLoading: false, 22564 modalMessage: '', 22565 modalErrors: {} 22566 }, 22567 computed: { 22568 isHotelsAvailable: function isHotelsAvailable() { 22569 return _.isEmpty(this.bulkData) ? false : this.bulkData.rows.length; 22570 } 22571 }, 22572 methods: { 22573 getBulkDataForThisDate: function getBulkDataForThisDate(hotelId, roomId, dateOfBulkData) { 22574 // console.log(hotelId, roomId, dateOfBulkData); 22575 if (hotelId && roomId && dateOfBulkData && !_.isEmpty(this.bulkData)) { 22576 var hotelThing = _.find(this.bulkData.rows, function (o) { 22577 return o.id == hotelId.id; 22578 }); 22579 var roomThing = _.find(hotelThing.rooms, function (o) { 22580 return o.id == roomId.id; 22581 }); 22582 var dateWiseThing = _.filter(roomThing.dateWiseData, function (o) { 22583 return o.id == dateOfBulkData; 22584 }); 22585 return dateWiseThing[0].data; 22586 } else { 22587 return {}; 22588 } 22589 }, 22590 getBulkUpdateItemStyle: function getBulkUpdateItemStyle(bulkData) { 22591 var baseStyle = ['single-line-content', 'is-bulk-item']; 22592 if (bulkData.status == 'new') baseStyle.push('is-room-bulk-updated'); 22593 if (bulkData.available == 'Available') baseStyle.push('is-available'); 22594 if (bulkData.number == 0) baseStyle.push('is-number-zero'); 22595 return _.join(baseStyle, ' '); 22596 }, 22597 showUpdatePopup: function showUpdatePopup(hotelId, roomId, dateOfBulkData) { 22598 var hotelThing = _.find(this.bulkData.rows, function (o) { 22599 return o.id == hotelId.id; 22600 }); 22601 var roomThing = _.find(hotelThing.rooms, function (o) { 22602 return o.id == roomId.id; 22603 }); 22604 var dateWiseThing = _.filter(roomThing.dateWiseData, function (o) { 22605 return o.id == dateOfBulkData; 22606 }); 22607 var data = dateWiseThing[0].data; 22608 var dateRaw = dateWiseThing[0].dateFormatted; 22609 this.modalData = { 22610 hotel: hotelThing, 22611 hotelTitle: hotelThing.title, 22612 room: roomThing, 22613 roomTitle: roomThing.title, 22614 datedData: dateWiseThing, 22615 data: data, 22616 dateFormatted: moment(dateRaw), 22617 dateRaw: dateRaw,
22618 status: data.available, 22619 number: data.number 22620 }; 22621 this.modalMessage = ''; 22622 $("#js-modal-activator").click(); 22623 }, 22624 saveSingleAvailability: function saveSingleAvailability() { 22625 var url = $('#availabilitySingleUpdateUrl').val(); 22626 var me = this; 22627 this.isModalLoading = true; 22628 $.post(url, { 22629 'date': this.modalData.dateRaw, 22630 'room_class_id': this.modalData.room.id, 22631 'status': this.modalData.status, 22632 'no_of_rooms': this.modalData.number 22633 }, /*#__PURE__*/function () { 22634 var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) { 22635 return _regeneratorRuntime().wrap(function _callee$(_context) { 22636 while (1) switch (_context.prev = _context.next) { 22637 case 0: 22638 _context.next = 2; 22639 return me.fetchLatestData().then(function () { 22640 setTimeout(function () { 22641 me.isModalLoading = false; 22642 me.modalMessage = 'Saved'; 22643 $("#js-modal-activator").click(); 22644 }, 3); 22645 }); 22646 case 2: 22647 case "end": 22648 return _context.stop(); 22649 } 22650 }, _callee); 22651 })); 22652 return function (_x) { 22653 return _ref.apply(this, arguments); 22654 }; 22655 }()).fail(function (data, textStatus, jqXHR) { 22656 alert('Error'); 22657 me.modalMessage = 'Error'; 22658 me.isModalLoading = false; 22659 }); 22660 }, 22661 fetchLatestData: function () { 22662 var _fetchLatestData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { 22663 var bulkDataUrl, me; 22664 return _regeneratorRuntime().wrap(function _callee2$(_context2) { 22665 while (1) switch (_context2.prev = _context2.next) { 22666 case 0: 22667 // GET request using fetch with async/await 22668 bulkDataUrl = document.getElementById('bulkDataUrl').value; 22669 me = this; 22670 $.get(bulkDataUrl, function (data) { 22671 me.bulkData = data; 22672 me.isInitial = false; 22673 }).fail(function () { 22674 alert('Error in loading data'); 22675 }); 22676 case 3: 22677 case "end": 22678 return _context2.stop(); 22679 } 22680 }, _callee2, this); 22681 })); 22682 function fetchLatestData() { 22683 return _fetchLatestData.apply(this, arguments); 22684 } 22685 return fetchLatestData; 22686 }(), 22687 unescape: function unescape(text) { 22688 return _.unescape(text); 22689 }, 22690 registerEvents: function registerEvents() { 22691 this.fetchLatestData(); 22692 $('.has-datepicker').datepicker({ 22693 dateFormat: 'yy-mm-dd' 22694 }); 22695 $(function () { 22696 $('[data-toggle="tooltip"]').tooltip(); 22697 function SetDefaultValuesOnSelect2(selectSelector) { 22698 // https://select2.org/programmatic-control/add-select-clear-items#creating-new-options-in-the-dropdown 22699 var data = { 22700 text: $(selectSelector).attr('data-preselected-name'), 22701 id: $(selectSelector).attr('data-preselected-id') 22702 }; 22703 var newOption = new Option(data.text, data.id, false, false); 22704 $(selectSelector).append(newOption).trigger('change'); 22705 } 22706 SetDefaultValuesOnSelect2('#js-hotel-select2'); 22707 }); 22708 } 22709 }, 22710 created: function created() {} 22711}); 22712 22713/***/ }), 22714
vendor: 2,255 bytes, lines 22715-22728
22715/***/ "./resources/js/modules/common/bulk_update_price_view.js": 22716/*!***************************************************************!*\ 22717 !*** ./resources/js/modules/common/bulk_update_price_view.js ***! 22718 \***************************************************************/ 22719/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 22720 22721"use strict"; 22722__webpack_require__.r(__webpack_exports__); 22723/* harmony export */ __webpack_require__.d(__webpack_exports__, { 22724/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 22725/* harmony export */ }); 22726/* harmony import */ var _components_VariablePriceComponent_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../components/VariablePriceComponent.vue */ "./resources/js/components/VariablePriceComponent.vue"); 22727function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 22728function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap;
vendor: 5,446 bytes, line 22728
22728 var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEac
22728h(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } 22729function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 22730function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 22731 22732/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 22733 otherData: { 22734 message: "Hello Vue!", 22735 tableHtml: '', 22736 tableData: {}, 22737 modalData: {}, 22738 isInitial: true, 22739 isModalLoading: false, 22740 modalMessage: '', 22741 modalErrors: {}, 22742 enable: true, 22743 // Variable Pricing Related, public/module/hotel/js/variable-price-app.js 22744 is_variable_pricing_update: true, 22745 is_variable_price_available: true, 22746 is_single_update: false, 22747 variable_data: { 22748 variable_price: { 22749 extra_adults: [ 22750 // {id: 1, number: 1, price: 10}, 22751 // {id: 2, number: 2, price: 20}, 22752 ], 22753 extra_children: [ 22754 // {id: 1, number: 1, price: 10}, 22755 // {id: 2, number: 2, price: 20}, 22756 ] 22757 } 22758 } 22759 }, 22760 components: { 22761 VariablePrice: _components_VariablePriceComponent_vue__WEBPACK_IMPORTED_MODULE_0__["default"] 22762 }, 22763 methods: { 22764 fetchLatestData: function () { 22765 var _fetchLatestData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { 22766 var me, partialLoadUrl; 22767 return _regeneratorRuntime().wrap(function _callee$(_context) { 22768 while (1) switch (_context.prev = _context.next) { 22769 case 0: 22770 me = this; 22771 partialLoadUrl = document.getElementById('partialLoadUrl').value; 22772 $.get(partialLoadUrl, function (data) { 22773 var rows = data.rows; 22774 if (rows.length > 0) { 22775 rows = rows.filter(function (value) { 22776 return value.rooms.length > 0; 22777 }); 22778 } else { 22779 rows = []; 22780 var row = {}; 22781 row.id = 0; 22782 row.title = "No hotels found"; 22783 row.status = ""; 22784 row.rooms = []; 22785 row.meta = ""; 22786 rows[0] = row; 22787 } 22788 this.isModalLoading = false;
22789 data.rows = rows; 22790 me.tableData = data; 22791 }).fail(function () { 22792 alert('Error in loading data'); 22793 }); 22794 case 3: 22795 case "end": 22796 return _context.stop(); 22797 } 22798 }, _callee, this); 22799 })); 22800 function fetchLatestData() { 22801 return _fetchLatestData.apply(this, arguments); 22802 } 22803 return fetchLatestData; 22804 }(), 22805 singleUpdatePrice: function singleUpdatePrice(jsonEncodedModalData, variableData) { 22806 this.modalData = jsonEncodedModalData; 22807 if (variableData) { 22808 this.is_variable_price_available = true; 22809 this.is_variable_pricing_update = true; 22810 } else { 22811 this.is_variable_price_available = false; 22812 this.is_variable_pricing_update = false; 22813 } 22814 this.modalData.new_price = this.modalData.currentPrice; 22815 this.variable_data.variable_price = variableData; 22816 this.modalData.update_price = 'is_new_price'; 22817 this.modalData.dateFormatted = moment(this.modalData.date); 22818 $('#js-modal-activator').click(); 22819 }, 22820 saveSinglePrice: function saveSinglePrice() { 22821 var singleUpdateUrl = $('#singleUpdateUrl').val(); 22822 var me = this; 22823 me.isModalLoading = true; 22824 var oldData = { 22825 room_class_id: this.modalData.roomId, 22826 date: this.modalData.date, 22827 update_price: this.modalData.update_price, 22828 new_price: this.modalData.new_price, 22829 increment_unit: this.modalData.increment_unit, 22830 increment_quantity: this.modalData.increment_quantity, 22831 increment_type: this.modalData.increment_type, 22832 variable_pricing: this.is_variable_pricing_update, 22833 variable_price: this.variable_data.variable_price 22834 }; 22835 // This is a workaround, ideally oldData should work.
22836 // But, the data is not sync with this.modalData in case of variable_pricing, 22837 // this is the reason for workaround 22838 var newData = $('#single-update-popup').serializeArray(); 22839 newData.push({ 22840 name: 'date', 22841 value: this.modalData.date 22842 }); 22843 newData.push({ 22844 name: 'room_class_id', 22845 value: this.modalData.roomId 22846 }); 22847 $.post(singleUpdateUrl, newData, /*#__PURE__*/function () { 22848 var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) { 22849 return _regeneratorRuntime().wrap(function _callee2$(_context2) { 22850 while (1) switch (_context2.prev = _context2.next) { 22851 case 0: 22852 console.log(data); 22853 // debugger; 22854 setTimeout(function () { 22855 me.fetchLatestData(); 22856 $('#js-modal-activator').click(); 22857 }, 3); 22858 case 2: 22859 case "end": 22860 return _context2.stop(); 22861 } 22862 }, _callee2); 22863 })); 22864 return function (_x) { 22865 return _ref.apply(this, arguments); 22866 }; 22867 }()).fail(function (data, textStatus, jqXHR) { 22868 alert('Error'); 22869 me.modalMessage = 'Error'; 22870 }); 22871 me.isModalLoading = false; 22872 }, 22873 getBulkUpdateItemStyle: function getBulkUpdateItemStyle(bulkData) { 22874 var baseStyle = ['single-line-content', 'is-bulk-item']; 22875 if (bulkData.data.status == 'bulkPrice') baseStyle.push('is-room-bulk-updated'); 22876 if (bulkData.data.status == 'ratePlanPrice') baseStyle.push('is-room-rate-plan-price'); 22877 if (bulkData.available == 'Available') baseStyle.push('is-available'); 22878 if (bulkData.number == 0) baseStyle.push('is-number-zero'); 22879 return _.join(baseStyle, ' '); 22880 }, 22881 unescape: function unescape(text) { 22882 return _.unescape(text); 22883 }, 22884 registerEvents: function registerEvents() { 22885 this.fetchLatestData(); 22886 $(function () { 22887 $('.has-datepicker').datepicker({ 22888 dateFormat: 'yy-mm-dd' 22889 }); 22890 $('[data-toggle="tooltip"]').tooltip(); 22891 }); 22892 } 22893 }, 22894 created: function created() {} 22895}); 22896 22897/***/ }), 22898
22899/***/ "./resources/js/modules/common/room_detail.js": 22900/*!****************************************************!*\ 22901 !*** ./resources/js/modules/common/room_detail.js ***! 22902 \****************************************************/ 22903/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 22904 22905"use strict"; 22906__webpack_require__.r(__webpack_exports__); 22907/* harmony export */ __webpack_require__.d(__webpack_exports__, { 22908/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 22909/* harmony export */ }); 22910/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 22911 otherData: { 22912 enable: true, 22913 adult: 0 22914 }, 22915 methods: { 22916 inputChanged: function inputChanged() { 22917 var max_adult = parseInt($('input[name="max_adults"]').val()); 22918 if (!isNaN(max_adult)) { 22919 var std_occupancy = parseInt($('input[name="adults"]').val()); 22920 if (max_adult > std_occupancy) { 22921 var html_string = ""; 22922 for (var i = 1; i <= max_adult - std_occupancy; i++) { 22923 html_string += " <div class=\"row\">\n <div class=\"col-md-3\">\n <input type=\"hidden\" class=\"js-variable_price-id\" name=\"variable_price[extra_adults][".concat(i - 1, "][id]\" value=\"").concat(i, "\" />\n <input type=\"number\" name=\"variable_price[extra_adults][").concat(i - 1, "][number]\" class=\"form-control js-variable_price-number\" value=\"").concat(i, "\" readonly />\n </div>\n <div class=\"col-md-3\">\n <input type=\"number\" name=\"variable_price[extra_adults][").concat(i - 1, "][price]\" class=\"form-control js-variable_price-amount\" value=\"0\" />\n </div>\n <div class=\"col-md-3\">\n <input type=\"hidden\" class=\"js-variable_price-id\" name=\"variable_price[extra_children][").concat(i - 1, "][id]\" value=\"").concat(i, "\" />\n <input type=\"number\" name=\"variable_price[extra_children][").concat(i - 1, "][number]\" class=\"form-control js-variable_price-number\" value=\"").concat(i, "\" readonly />\n </div>\n <div class=\"col-md-3\">\n <input type=\"number\" name=\"variable_price[extra_children][").concat(i - 1, "][price]\" class=\"form-control js-variable_price-amount\" value=\"0\" />\n </div>\n </div>"); 22924 } 22925 setTimeout(function () { 22926 $('#variable-html').html(html_string); 22927 }, .1); 22928 } else { 22929 $('#variable-html').html(""); 22930 } 22931 } else { 22932 $('#variable-html').html(""); 22933 } 22934 } 22935 } 22936}); 22937 22938/***/ }), 22939
22940/***/ "./resources/js/modules/common/virtual_card_modal.js": 22941/*!***********************************************************!*\ 22942 !*** ./resources/js/modules/common/virtual_card_modal.js ***! 22943 \***********************************************************/ 22944/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 22945 22946"use strict"; 22947__webpack_require__.r(__webpack_exports__); 22948/* harmony export */ __webpack_require__.d(__webpack_exports__, { 22949/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 22950/* harmony export */ }); 22951/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 22952 otherData: { 22953 cardMaskData: {}, 22954 creditCardMaskData: {}, 22955 cardData: { 22956 balances: [], 22957 transactions: [] 22958 }, 22959 selectedBookingForModal: { 22960 // bookingId: 0, 22961 isThisCardDisplayed: false 22962 }, 22963 isLoading: false, 22964 cardLoadingStatus: '', 22965 debug: null, 22966 creditCardData: { 22967 password: '', 22968 isCardDisplay: false, 22969 cardData: {}, 22970 isOverlayShown: false, 22971 isPasswordIncorrect: false 22972 }, 22973 payment: { 22974 booking_id: '', 22975 total: 0, 22976 paid: 0, 22977 remain: 0, 22978 refund: 0, 22979 is_charge: false, 22980 is_refund: false, 22981 is_authorize: false, 22982 total_paid: 0, 22983 total_refund: 0, 22984 transactions: [], 22985 all_payments: [], 22986 authorizations: [], 22987 authorized_transaction: [], 22988 refund_data: { 22989 amount: '', 22990 reference: '' 22991 }, 22992 charge_data: { 22993 amount: '' 22994 }, 22995 authorize_data: { 22996 amount: '', 22997 reference: 0, 22998 type: 'capture' 22999 } 23000 }, 23001 status_message: '', 23002 booking_id: '', 23003 type: '', 23004 isPaymentLoad: false 23005 }, 23006 computed: { 23007 checkEnableAuthorize: function checkEnableAuthorize() { 23008 var _this = this; 23009 if (this.payment.authorize_data.amount == '' || this.payment.authorize_data.amount <= 0) { 23010 return true; 23011 } 23012 if (this.payment.authorize_data.reference != 0) { 23013 var index = this.payment.authorizations.findIndex(function (data) { 23014 return data.id == _this.payment.authorize_data.reference; 23015 }); 23016 if (this.payment.authorizations[index].amount - this.payment.authorize_data.amount < 0) { 23017 return true; 23018 } 23019 } 23020 return false; 23021 }, 23022 checkEnableRefund: function checkEnableRefund() { 23023 var _this2 = this; 23024 if (this.payment.refund_data.amount == '' || this.payment.refund_data.amount <= 0 || this.payment.refund_data.reference == '') { 23025 return true; 23026 } 23027 var index = this.payment.all_payments.findIndex(function (data) { 23028 return data.id == _this2.payment.refund_data.reference; 23029 }); 23030 if (this.payment.all_payments[index].amount - this.payment.refund_data.amount < 0) { 23031 return true; 23032 } 23033 return false; 23034 }, 23035 checkEnableCharge: function checkEnableCharge() { 23036 if (this.payment.charge_data.amount == '' || this.payment.charge_data.amount <= 0) { 23037 return true; 23038 } 23039 if (this.payment.remain - this.payment.charge_data.amount < 0) { 23040 return true; 23041 } 23042 return false; 23043 } 23044 }, 23045 methods: { 23046 showModal: function showModal(booking_id) { 23047 this.selectedBookingForModal.bookingId = booking_id; 23048 this.resetCardWithMask(); 23049 this.showCardDetails(); 23050 $('#my-modal').modal('show'); 23051 // this.$refs["my-modal"].modal('show'); 23052 }, 23053 hideModal: function hideModal() { 23054 $('#my-modal').modal('hide'); 23055 // this.$refs['my-modal'].hide() 23056 }, 23057 resetCardWithMask: function resetCardWithMask() { 23058 // reset card details with mask 23059 this.cardData = this.cardMaskData; 23060 this.cardData.transactions = []; 23061 this.cardData.balances = []; 23062 this.isThisCardDisplayed = false; 23063 this.cardLoadingStatus = ''; 23064 }, 23065 showCardDetails: function showCardDetails() { 23066 var showCardDetailsUrl = $('#showCardDetailsUrl').val(); 23067 var me = this; 23068 var bookingId = this.selectedBookingForModal.bookingId; 23069 me.isLoading = true;
23070 me.cardLoadingStatus = 'Loading...'; 23071 if (!me.isThisCardDisplayed) { 23072 $.get({ 23073 url: showCardDetailsUrl, 23074 data: { 23075 booking_id: bookingId 23076 }, 23077 success: function success(response) { 23078 me.debug = response; 23079 if (response.status == "success") { 23080 me.cardData = response.cardData; 23081 me.isThisCardDisplayed = true; 23082 me.cardLoadingStatus = response.cardData.status; 23083 console.log("showCardDetails success"); 23084 } else { 23085 console.log("Error in showCardDetails", response); 23086 } 23087 // console.log('Retrieved card details', response); 23088 me.isLoading = false; 23089 }, 23090 error: function error(_error) { 23091 console.log("showCardDetail error", _error); 23092 me.isLoading = false; 23093 } 23094 }); 23095 } 23096 }, 23097 getHeaderClass: function getHeaderClass() { 23098 var headerClassList = ['card-header-inner-container']; 23099 if (this.cardLoadingStatus == 'active') headerClassList.push('is-active-card'); 23100 if (this.cardLoadingStatus == 'canceled') headerClassList.push('is-canceled-card'); 23101 if (this.cardLoadingStatus == 'inactive') headerClassList.push('is-inactive-card'); 23102 return headerClassList.join(' '); 23103 }, 23104 getCardLoadingStatusText: function getCardLoadingStatusText() { 23105 if (this.cardLoadingStatus == '') { 23106 return 'Not Loaded'; 23107 } else { 23108 return _.upperFirst(this.cardLoadingStatus); 23109 } 23110 }, 23111 showSavedCreditCardStep1: function showSavedCreditCardStep1(booking_id) { 23112 $('#save-credit-card-modal').modal('show'); 23113 // this.$refs["save-credit-card-modal"].show(); 23114 this.selectedBookingForModal.bookingId = booking_id; 23115 this.creditCardData.cardData = this.creditCardMaskData; 23116 this.creditCardData.isCardDisplay = false; 23117 }, 23118 showSavedCreditCardStep2: function showSavedCreditCardStep2() { 23119 var url = $('#showSavedCreditCardDetailsUrl').val(); 23120 var me = this; 23121 var booking_id = this.selectedBookingForModal.bookingId; 23122 if (url) { 23123 me.creditCardData.isOverlayShown = true; 23124 $.post({ 23125 url: url, 23126 data: { 23127 booking_id: booking_id, 23128 password: this.creditCardData.password 23129 }, 23130 success: function success(data) { 23131 if (data.status == 'success') { 23132 me.creditCardData.cardData.cardNumber = data.card_details.card_number; 23133 me.creditCardData.cardData.expiry = data.card_details.card_expiration; 23134 me.creditCardData.cardData.CVV = data.card_details.card_cvc; 23135 me.creditCardData.isCardDisplay = true; 23136 me.creditCardData.isOverlayShown = false; 23137 me.creditCardData.isPasswordIncorrect = false; 23138 } else { 23139 me.creditCardData.isOverlayShown = false; 23140 me.creditCardData.isPasswordIncorrect = true; 23141 } 23142 }, 23143 error: function error(errorData, message) { 23144 me.creditCardData.isCardDisplay = false; 23145 me.creditCardData.isOverlayShown = false; 23146 me.creditCardData.isPasswordIncorrect = false; 23147 } 23148 }); 23149 } 23150 }, 23151 changeAuthorization: function changeAuthorization() { 23152 var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'capture'; 23153 var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; 23154 this.payment.authorize_data.type = type; 23155 if (type == 'void') { 23156 this.showPaymentModal(this.payment.booking_id, 'authorize'); 23157 return true; 23158 } 23159 var amount = ''; 23160 if (id != 0) { 23161 var index = this.payment.authorizations.findIndex(function (data) { 23162 return data.id == id; 23163 }); 23164 amount = this.payment.authorizations[index].amount; 23165 } 23166 this.payment.authorize_data.amount = amount; 23167 }, 23168 showPaymentModal: function showPaymentModal(booking_id) { 23169 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all'; 23170 var me = this; 23171 if (type == 'refund' && this.checkEnableRefund) { 23172 return false;
23173 } else if (type == 'charge' && this.checkEnableCharge) { 23174 return false; 23175 } else if (type == 'authorize' && this.checkEnableAuthorize) { 23176 return false; 23177 } 23178 var url = $('#showPaymentDetail').val(); 23179 var data_params = { 23180 booking_id: booking_id, 23181 type: type 23182 }; 23183 this.error_messages = {}; 23184 if (type != 'all') { 23185 data_params[type + '_data'] = this.payment[type + '_data']; 23186 } else { 23187 this.type = ''; 23188 this.isPaymentLoad = true; 23189 $('.btn-filter').removeClass('btn-info'); 23190 } 23191 $('#paymentModal').modal('show'); 23192 var callback_function = function callback_function(res) { 23193 me.payment = res.data; 23194 me.isPaymentLoad = false; 23195 if (res.error) { 23196 me.error_messages[type] = res.error_messages; 23197 return false; 23198 } 23199 if (['charge', 'refund'].includes(type)) { 23200 if (!res.data['is_' + type]) { 23201 $('#paymentModal').find('.nav-tabs a:first').tab('show'); 23202 me.type = ''; 23203 } 23204 me.status_message = 'Success!!!'; 23205 setTimeout(function () { 23206 me.status_message = ''; 23207 }, 1000); 23208 } 23209 }; 23210 this.makePostRequest(url, data_params, callback_function); 23211 }, 23212 updatePMS: function updatePMS() { 23213 var url = $('#updatePms').val(); 23214 var data_params = { 23215 booking_id: this.booking_id, 23216 is_modified: true 23217 }; 23218 var callback_function = function callback_function(res) {}; 23219 this.makePostRequest(url, data_params, callback_function); 23220 }, 23221 registerEvents: function registerEvents() { 23222 var me = this; 23223 this.cardMaskData = { 23224 cardNumber: 'xxxx xxxx xxxx 1234', 23225 ExpMonth: 'xx', 23226 ExpYear: 'xx', 23227 CVV: 'xxx', 23228 transactions: [ 23229 // { txnId: 40, Comment: 'Dickerson', amount: '123.00 $' }, 23230 ], 23231 balances: [] 23232 }; 23233 this.cardData = this.cardMaskData; 23234 this.creditCardMaskData = { 23235 cardNumber: 'xxxx xxxx xxxx 1234', 23236 expiry: 'xx / xx', 23237 CVV: 'xxx' 23238 }; 23239 this.creditCardData.cardData = this.creditCardMaskData; 23240 $(document).ready(function () { 23241 $('#paymentModal').on('hidden.bs.modal', function () { 23242 $(this).find('.nav-tabs a:first').tab('show'); 23243 }); 23244 }); 23245 $('.btn-filter').on('click', function () { 23246 var type = $(this).data('type'); 23247 $('.btn-filter').removeClass('btn-info'); 23248 if (type == me.type) { 23249 me.type = ''; 23250 } else { 23251 me.type = type; 23252 $(this).addClass('btn-info'); 23253 } 23254 }); 23255 if (this.booking_id != '') { 23256 this.updatePMS(); 23257 } 23258 } 23259 } 23260}); 23261 23262/***/ }), 23263
23264/***/ "./resources/js/modules/home.js": 23265/*!**************************************!*\ 23266 !*** ./resources/js/modules/home.js ***! 23267 \**************************************/ 23268/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 23269 23270"use strict"; 23271__webpack_require__.r(__webpack_exports__); 23272/* harmony export */ __webpack_require__.d(__webpack_exports__, { 23273/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 23274/* harmony export */ }); 23275function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 23276function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } 23277function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 23278function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 23279/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 23280 otherData: { 23281 mobile_login_data: { 23282 country_code: 'US', 23283 phone: '', 23284 show_verification_code: false, 23285 show_resend_btn: false, 23286 error_message: '', 23287 status_message: '', 23288 verify_code: '', 23289 auth_code: '' 23290 } 23291 }, 23292 methods: { 23293 loginMobile: function loginMobile(type) { 23294 var _this = this; 23295 var url = $('#mobile_url').val(); 23296 var form = $('.bravo-form-mobile-login'); 23297 var data_params = { 23298 type: type, 23299 country_code: this.mobile_login_data.country_code, 23300 phone: this.mobile_login_data.phone, 23301 code: this.mobile_login_data.verify_code, 23302 auth_code: this.mobile_login_data.auth_code, 23303 redirect: form.find('input[name=redirect]').val() 23304 }; 23305 $('.error').hide(); 23306 this.mobile_login_data.error_message = ''; 23307 var callback_function = function callback_function(data) { 23308 if (data.status) { 23309 if (type == 'send_otp') { 23310 _this.mobile_login_data.auth_code = data.auth_code; 23311 setTimeout(function () { 23312 _this.mobile_login_data.show_resend_btn = true; 23313 }, 30000); 23314 _this.mobile_login_data.show_verification_code = true; 23315 } 23316 } else { 23317 if (data.status_message !== undefined) { 23318 for (var item in data.status_message) { 23319 var msg = data.status_message[item]; 23320 form.find('.error-' + item).show().text(msg[0]); 23321 } 23322 } 23323 if (data.invalid_otp) { 23324 return false; 23325 } 23326 _this.mobile_login_data.show_resend_btn = false; 23327 _this.mobile_login_data.show_verification_code = false; 23328 _this.mobile_login_data.verify_code = ''; 23329 } 23330 }; 23331 this.makePostRequest(url, data_params, callback_function); 23332 }, 23333 commonEvents: function commonEvents() { 23334 var me = this; 23335 $(document).ready(function () { 23336 $.fn.bravoAutocomplete = function (options) { 23337 return this.each(function () { 23338 var $this = $(this); 23339 var main = $(this).closest(".smart-search"); 23340 var textLoading = options.textLoading; 23341 main.append('<div class="bravo-autocomplete on-message"><div class="list-item form-location-search-hotel"></div><div class="message">' + textLoading + '</div></div>'); 23342 $(document).on('click', ".form-location-search-hotel .autocomplete-item", function (event) { 23343 setTimeout(function () { 23344 datePickerShown = false; 23345 $('.form-date-search-hotel').trigger('click'); 23346 }, 100); 23347 }); 23348 $(document).on("click.Bst", function (event) { 23349 if (main.has(event.target).length === 0 && !main.is(event.target)) { 23350 main.find('.bravo-autocomplete').removeClass('show'); 23351 } else { 23352 if (options.dataDefault.length > 0) { 23353 main.find('.bravo-autocomplete').addClass('show'); 23354 } 23355 } 23356 }); 23357 if (options.dataDefault.length > 0) { 23358 var items = '<p class="p-3 mb-0">Popular Destinations</p>'; 23359 for (var index in options.dataDefault) { 23360 var item = options.dataDefault[index]; 23361 var item_count = item.count; 23362 if (item.count > 0) { 23363 if (item.count > 1) { 23364 var count_number = item.count + " Hotels"; 23365 } else { 23366 var count_number = item.count + " Hotel"; 23367 } 23368 items += '<div class="d-flex item justify-content-between align-items-center autocomplete-item" data-type="' + item.type + '" data-id="' + item.id + '" data-text="' + item.title + '"><div class="align-items-center d-flex"><img src="' + item.icon_url + '" class="bed-icon"><p class="d-flex flex-column mb-0 pl-3"><span class="text-sm"> ' + item.title + '</span><span class="text-sm loc-desc">' + item.title_desc + '</span></p></div><span class="float-right text-sm">' + count_number + '</span> </div>'; 23369 } 23370 } 23371 main.find('.bravo-autocomplete .list-item').html(items); 23372 main.find('.bravo-autocomplete').removeClass("on-message"); 23373 } 23374 var requestTimeLimit; 23375 if (typeof options.url != 'undefined' && options.url) { 23376 $this.keyup(function () { 23377 main.find('.bravo-autocomplete').addClass("on-message"); 23378 main.find('.bravo-autocomplete .message').html(textLoading); 23379 main.find('.child_id').val(""); 23380 var query = $(this).val(); 23381 clearTimeout(requestTimeLimit); 23382 if (query.length === 0) { 23383 if (options.dataDefault.length > 0) { 23384 var items = ''; 23385 for (var index in options.dataDefault) { 23386 var item = options.dataDefault[index]; 23387 if (item.count > 0) { 23388 if (item.count > 1) { 23389 var count_number = item.count + " Hotels"; 23390 } else { 23391 var count_number = item.count + " Hotel"; 23392 } 23393 items += '<div class="d-flex item justify-content-between align-items-center autocomplete-item" data-type="' + item.type + '" data-id="' + item.id + '" data-text="' + item.title + '"><div class="align-items-center d-flex"><img src="' + item.icon_url + '" class="bed-icon"><p class="d-flex flex-column mb-0 pl-3"><span class="text-sm"> ' + item.title + '</span><span class="text-sm loc-desc">' + item.title_desc + '</span></p></div><span class="float-right text-sm">' + count_number + '</span> </div>'; 23394 } 23395 } 23396 main.find('.bravo-autocomplete .list-item').html(items); 23397 main.find('.bravo-autocomplete').removeClass("on-message"); 23398 } else { 23399 main.find('.bravo-autocomplete').removeClass('show'); 23400 } 23401 return; 23402 } 23403 requestTimeLimit = setTimeout(function () { 23404 $.ajax({ 23405 url: options.url, 23406 data: { 23407 search: query 23408 }, 23409 dataType: 'json', 23410 type: 'get', 23411 beforeSend: function beforeSend() {}, 23412 success: function success(res) { 23413 if (res.status === 1) { 23414 var items = ''; 23415 for (var ix in res.data) { 23416 var item = res.data[ix]; 23417 if (item.count > 1) { 23418 var count_number = item.count + " Hotels"; 23419 } else { 23420 var count_number = item.count + " Hotel"; 23421 } 23422 if (item.type == 'location') { 23423 items += '<div class="d-flex item justify-content-between align-items-center autocomplete-item" data-type="' + item.type + '" data-id="' + item.id + '" data-text="' + item.title + '"><div class="align-items-center d-flex"><img src="' + item.icon_url + '" class="bed-icon"><p class="d-flex flex-column mb-0 pl-3"><span class="text-sm"> ' + get_highlight(item.title, query) + '</span><span class="text-sm loc-desc">' + item.title_desc + '</span></p></div><span class="float-right text-sm">' + count_number + '</span> </div>'; 23424 } else { 23425 items += '<div class="item d-flex" data-type="' + item.type + '" data-id="' + item.id + '" data-text="' + item.title + '"><div class=""> <img src="' + item.icon_url + '" class="hotel-bed-icon"></div><div class="ml-2"><p class="m-0 result_head"> ' + get_highlight(item.title, query) + '</p><p class="m-0 text-muted">' + item.address + '</p></div> </div>'; 23426 } 23427 } 23428 main.find('.bravo-autocomplete .list-item').html(items); 23429 main.find('.bravo-autocomplete').removeClass("on-message"); 23430 } 23431 if (_typeof(res.message) === undefined) { 23432 main.find('.bravo-autocomplete').addClass("on-message"); 23433 } else { 23434 main.find('.bravo-autocomplete .message').html(res.message); 23435 } 23436 } 23437 }); 23438 }, 10); 23439 function get_highlight(text, val) { 23440 return text.replace(new RegExp(val + '(?!([^<]+)?>
23440)', 'gi'), '<span class="h-line">$&</span>'); 23441 } 23442 main.find('.bravo-autocomplete').addClass('show'); 23443 }); 23444 } 23445 main.find('.bravo-autocomplete').on('click', '.item', function () { 23446 var id = $(this).attr('data-id'), 23447 text = $(this).attr('data-text'), 23448 type = $(this).attr('data-type'); 23449 if (id.length > 0 && text.length > 0) { 23450 text = text.replace(/-/g, ""); 23451 //text = text.substring(1); 23452 text = trimFunc(text, ' '); 23453 text = trimFunc(text, '-'); 23454 main.find('.parent_text').val(text).trigger("change"); 23455 if (type == 'location') { 23456 if (me.searchFilter !== undefined) { 23457 me.searchFilter.location = id; 23458 me.searchFilter.hotel_id = ''; 23459 } else { 23460 main.find('.location').val(id).trigger("change"); 23461 main.find('.hotel_id').val('').trigger("change"); 23462 } 23463 } else { 23464 if (me.searchFilter !== undefined) { 23465 me.searchFilter.hotel_id = id; 23466 me.searchFilter.location = ''; 23467 } else { 23468 main.find('.hotel_id').val(id).trigger("change"); 23469 main.find('.location').val('').trigger("change"); 23470 } 23471 } 23472 } 23473 setTimeout(function () { 23474 main.find('.bravo-autocomplete').removeClass('show'); 23475 }, 100); 23476 }); 23477 main.find('#smart-search-location').blur(function () { 23478 if (!$(this).val()) { 23479 if (me.searchFilter !== undefined) { 23480 me.searchFilter.location = ''; 23481 me.searchFilter.hotel_id = ''; 23482 } 23483 main.find('.hotel_id').val('').trigger("change"); 23484 main.find('.location').val('').trigger("change"); 23485 } 23486 }); 23487 var trimFunc = function trimFunc(s, c) { 23488 if (c === "]") c = "\\]"; 23489 if (c === "\\") c = "\\\\"; 23490 return s.replace(new RegExp("^[" + c + "]+|[" + c + "]+$", "g"), ""); 23491 }; 23492 }); 23493 }; 23494 setTimeout(function () { 23495 $(document).on('click', '.form-location-search-hotel .autocomplete-item', function () { 23496 $('.date-wrapper').trigger('click'); 23497 }); 23498 }, 100); 23499 }); 23500 $(document).ready(function () { 23501 function parseErrorMessage(e) { 23502 var html = ''; 23503 if (e.responseJSON) { 23504 if (e.responseJSON.errors) { 23505 return Object.values(e.responseJSON.errors).join('<br>'); 23506 } 23507 } 23508 return html; 23509 } 23510 $(".g-map-place").each(function () { 23511 var map = $(this).find('.map').attr('id'); 23512 var searchInput = $(this).find('input[name=map_place]'); 23513 var latInput = $(this).find('input[name="map_lat"]'); 23514 var lgnInput = $(this).find('input[name="map_lgn"]'); 23515 new BravoMapEngine(map, { 23516 fitBounds: true, 23517 center: [51.505, -0.09], 23518 ready: function ready(engineMap) { 23519 engineMap.searchBox(searchInput, function (dataLatLng) { 23520 latInput.attr("value", dataLatLng[0]); 23521 lgnInput.attr("value", dataLatLng[1]); 23522 }); 23523 } 23524 }); 23525 }); 23526 $(".bravo-list-tour").each(function () { 23527 $(this).find(".owl-carousel").owlCarousel({ 23528 items: 4, 23529 loop: false, 23530 margin: 15, 23531 nav: false, 23532 responsive: { 23533 0: { 23534 items: 1 23535 }, 23536 768: { 23537 items: 2 23538 }, 23539 1000: { 23540 items: 4 23541 } 23542 } 23543 }); 23544 }); 23545 $(".bravo-list-space").each(function () { 23546 $(this).find(".owl-carousel").owlCarousel({ 23547 items: 3, 23548 loop: false, 23549 margin: 15, 23550 nav: false, 23551 responsive: { 23552 0: { 23553 items: 1 23554 }, 23555 768: { 23556 items: 2 23557 }, 23558 1000: { 23559 items: 3 23560 } 23561 } 23562 }); 23563 }); 23564 $(".item-loop-list.skyplace-design").each(function () { 23565 $(this).find(".owl-carousel").owlCarousel({ 23566 items: 1, 23567 loop: false, 23568 margin: 15, 23569 nav: true, 23570 dots: false 23571 }); 23572 var buttons = $(this).find('.owl-nav button'); 23573 $(buttons[0]).html('<i class="fa fa-chevron-left"></i>'); 23574 $(buttons[1]).html('<i class="fa fa-chevron-right"></i>'); 23575 }); 23576 $(window).trigger('resize'); 23577 $(".bravo-list-car").each(function () { 23578 $(this).find(".owl-carousel").owlCarousel({ 23579 items: 4, 23580 loop: false, 23581 margin: 15, 23582 nav: false, 23583 responsive: { 23584 0: { 23585 items: 1 23586 }, 23587 768: { 23588 items: 2 23589 }, 23590 1000: { 23591 items: 4 23592 } 23593 } 23594 }); 23595 }); 23596 $(".bravo-form-search-all").each(function () { 23597 $(this).find(".owl-carousel").owlCarousel({ 23598 items: 1, 23599 loop: false, 23600 dots: true, 23601 nav: true, 23602 lazyLoad: true, 23603 lazyLoadEager: 1, 23604 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 23605 }); 23606 }); 23607 $(".featured-destination").each(function () { 23608 $(this).find(".owl-carousel").owlCarousel({ 23609 loop: false, 23610 dots: false, 23611 nav: true, 23612 margin: 2, 23613 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 23614 responsive: { 23615 0: { 23616 items: 1 23617 }, 23618 768: { 23619 items: 2, 23620 margin: 15 23621 }, 23622 992: { 23623 items: 1 23624 } 23625 } 23626 }); 23627 }); 23628 if (window.innerWidth < 1200) { 23629 $(".responsive-offer").each(function () { 23630 $(this).find(".owl-carousel").owlCarousel({ 23631 loop: true, 23632 dots: false, 23633 nav: false, 23634 margin: 10, 23635 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 23636 responsive: { 23637 0: { 23638 items: 1.2 23639 }, 23640 768: { 23641 items: 2.2 23642 } 23643 } 23644 }); 23645 }); 23646 $(".reponsive-intro").each(function () { 23647 $(this).find(".owl-carousel").owlCarousel({ 23648 loop: false, 23649 dots: false, 23650 nav: true, 23651 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 23652 responsive: { 23653 0: { 23654 items: 1, 23655 margin: 0 23656 }, 23657 768: { 23658 items: 2, 23659 margin: 10 23660 } 23661 } 23662 }); 23663 }); 23664 } 23665 var list_location_buttons = $('.bravo-offer-type-2 .owl-carousel .owl-nav button'); 23666 $(list_location_buttons[0]).html('<img src="' + fresco.url_root + '/images/carousel_left_arrow.png" />'); 23667 $(list_location_buttons[1]).html('<img src="' + fresco.url_root + '/images/carousel_right_arrow.png" />'); 23668 $(".list-location-type-2").each(function () { 23669 $(this).find(".owl-carousel").owlCarousel({ 23670 items: 3, 23671 loop: false, 23672 margin: 15, 23673 dots: true, 23674 nav: true, 23675 responsive: { 23676 0: { 23677 items: 1 23678 }, 23679 768: { 23680 items: 2 23681 }, 23682 1000: { 23683 items: 3 23684 } 23685 } 23686 }); 23687 }); 23688 var list_location_buttons = $('.list-location-type-2 .owl-carousel .owl-nav button'); 23689 $(list_location_buttons[0]).html('<img src="' + fresco.url_root + '/images/carousel_left_arrow.png" />'); 23690 $(list_location_buttons[1]).html('<img src="' + fresco.url_root + '/images/carousel_right_arrow.png" />'); 23691 $(".bravo-testimonial-2").each(function () { 23692 $(this).find(".owl-carousel").owlCarousel(_defineProperty(_defineProperty(_defineProperty({ 23693 items: 3, 23694 loop: false, 23695 margin: 15, 23696 dots: true, 23697 autoplay: true 23698 }, "loop", true), "autoplayTimeout", 3000), "responsive", { 23699 0: { 23700 items: 1 23701 }, 23702 768: { 23703 items: 1 23704 }, 23705 1000: { 23706 items: 1 23707 } 23708 })); 23709 }); 23710 $(".exclusive-deals-1").each(function () { 23711 if ($(this).hasClass('one-banner')) { 23712 $(this).find(".owl-carousel").owlCarousel(_defineProperty(_defineProperty({ 23713 items: 1, 23714 loop: false, 23715 margin: 15, 23716 dots: true, 23717 itemsDesktop: false, 23718 itemsDesktopSmall: false, 23719 itemsTablet: false, 23720 itemsMobile: false 23721 }, "loop", false), "responsive", { 23722 0: { 23723 items: 1 23724 }, 23725 768: { 23726 items: 1 23727 }, 23728 1000: { 23729 items: 1 23730 } 23731 })); 23732 } else if ($(this).hasClass('two-banner')) { 23733 $(this).find(".owl-carousel").owlCarousel(_defineProperty(_defineProperty({ 23734 items: 2, 23735 loop: false, 23736 margin: 15, 23737 dots: true 23738 }, "loop", false), "responsive", { 23739 0: { 23740 items: 1 23741 }, 23742 768: { 23743 items: 2 23744 }, 23745 1000: { 23746 items: 3 23747 } 23748 })); 23749 } else { 23750 $(this).find(".owl-carousel").owlCarousel(_defineProperty(_defineProperty({ 23751 items: 3, 23752 loop: false, 23753 margin: 15, 23754 dots: true 23755 }, "loop", false), "responsive", { 23756 0: { 23757 items: 1 23758 }, 23759 768: { 23760 items: 2 23761 }, 23762 1000: { 23763 items: 3 23764 } 23765 })); 23766 } 23767 $(this).find(".owl-carousel .item").css('height', $(window).height() - 50 + 'px'); 23768 }); 23769 var timer_val = $('#exclusive-timer').val(); 23770 if (timer_val == "") timer_val = 5000; 23771 var exclusive_deals_element = $('.exclusive-deals-1'); 23772 if (sessionStorage.getItem('hotelsbyweek') == null && exclusive_deals_element.length > 0) { 23773 sessionStorage.setItem('hotelsbyweek', 'true'); 23774 setTimeout(function () { 23775 $('.exclusive-deals-1').removeClass('d-none'); 23776 }, timer_val); 23777 $('body').on('click', '.exclusive-deals-1 .close', function () { 23778 $('.exclusive-deals-1').remove(); 23779 }); 23780 } else { 23781 $('.exclusive-deals-1').remove(); 23782 } 23783 $(".bravo_fullHeight").each(function () { 23784 var height = $(document).height(); 23785 if ($(document).find(".bravo-admin-bar").length > 0) { 23786 height = height - $(".bravo-admin-bar").height(); 23787 } 23788 $(this).css('min-height', height); 23789 }); 23790 23791 // Date Picker Range 23792 $('.form-date-search').each(function () { 23793 var nowDate = new Date(); 23794 var today = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate(), 0, 0, 0, 0); 23795 var parent = $(this), 23796 date_wrapper = $('.date-wrapper', parent),
23797 check_in_input = $('.check-in-input', parent), 23798 check_out_input = $('.check-out-input', parent), 23799 check_in_out = $('.check-in-out', parent), 23800 check_in_render = $('.check-in-render', parent), 23801 check_out_render = $('.check-out-render', parent); 23802 var isMobile = $(window).width() < 992; 23803 var options = { 23804 singleDatePicker: false, 23805 autoApply: true, 23806 disabledPast: true, 23807 customClass: '', 23808 widthSingle: 300, 23809 onlyShowCurrentMonth: true, 23810 minDate: today, 23811 opens: isMobile ? 'center' : 'left', 23812 locale: { 23813 format: "YYYY-MM-DD", 23814 direction: fresco.rtl ? 'rtl' : 'ltr', 23815 firstDay: daterangepickerLocale.first_day_of_week 23816 } 23817 }; 23818 if ((typeof daterangepickerLocale === "undefined" ? "undefined" : _typeof(daterangepickerLocale)) == 'object') { 23819 options.locale = _.merge(daterangepickerLocale, options.locale); 23820 } 23821 check_in_out.daterangepicker(options); 23822 $('.check-in-out', parent).on('apply.daterangepicker', function (ev, picker) { 23823 if (picker.endDate.diff(picker.startDate, 'day') <= 0) { 23824 picker.endDate.add(1, 'day'); 23825 } 23826 check_in_input.val(picker.startDate.format(fresco.date_format)); 23827 check_in_render.html(picker.startDate.format(fresco.date_format)); 23828 check_out_input.val(picker.endDate.format(fresco.date_format)); 23829 check_out_render.html(picker.endDate.format(fresco.date_format)); 23830 check_in_out.val(picker.startDate.format("YYYY-MM-DD") + " - " + picker.endDate.format("YYYY-MM-DD")); 23831 }); 23832 $('.check-in-out', parent).on('hide.daterangepicker', function (ev, picker) { 23833 // datePickerShown = false; 23834 }); 23835 $('.check-in-out', parent).on('click', function (event) { 23836 event.preventDefault(); 23837 event.stopPropagation(); 23838 }); 23839 date_wrapper.click(function (e) { 23840 check_in_out.trigger('click'); 23841 }); 23842 }); 23843 $('#smart-search-location').on('click', function (event) { 23844 if ($(window).width() < 768) { 23845 setTimeout(function () { 23846 var element = document.getElementById("menu-fixed-container"); 23847 element.scrollIntoView(); 23848 // $("html, body").animate({ scrollTop: 0 }, "slow"); 23849 // $('#menu-fixed-container').scrollTop(0); 23850 }); 23851 } 23852 }); 23853 23854 // Date Picker 23855 $('.date-picker').each(function () { 23856 var options = { 23857 "singleDatePicker": true, 23858 opens: isMobile ? 'center' : 'left', 23859 locale: { 23860 format: fresco.date_format, 23861 direction: fresco.rtl ? 'rtl' : 'ltr', 23862 firstDay: daterangepickerLocale.first_day_of_week 23863 } 23864 }; 23865 if ((typeof daterangepickerLocale === "undefined" ? "undefined" : _typeof(daterangepickerLocale)) == 'object') { 23866 options.locale = _.merge(daterangepickerLocale, options.locale); 23867 } 23868 $(this).daterangepicker(options); 23869 }); 23870 var datePickerShown = false; 23871 // Date Picker Range for hotel 23872 $(document).on('click', '.form-date-search-hotel', function (event) { 23873 event.preventDefault(); 23874 event.stopPropagation(); 23875 var parent = $(this); 23876 var datepicker = $('.check-in-out', parent).data('daterangepicker'); 23877 if (datePickerShown) { 23878 datepicker.hide(); 23879 } else { 23880 // datepicker.show(); 23881 } 23882 datePickerShown = !datePickerShown; 23883 }); 23884 $('.form-date-search-hotel').each(function () { 23885 var nowDate = new Date(); 23886 var today = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate() - 1, 0, 0, 0, 0); 23887 var parent = $(this), 23888 date_wrapper = $('.date-wrapper', parent),
23889 check_in_input = $('.check-in-input', parent), 23890 check_out_input = $('.check-out-input', parent), 23891 check_in_out = $('.check-in-out', parent), 23892 check_in_render = $('.check-in-render', parent), 23893 check_out_render = $('.check-out-render', parent); 23894 var isMobile = $(window).width() < 992; 23895 var template = '<div class="daterangepicker">' + '<div class="ranges"></div>' + '<div class="drp-calendar left">' + '<div class="calendar-table"></div>' + '<div class="calendar-time"></div>' + '</div>' + '<div class="drp-calendar right">' + '<div class="calendar-table"></div>' + '<div class="calendar-time"></div>' + '</div>' + '<div class="drp-buttons d-block text-center">' + '<span class="drp-selected"></span>' + '<span class="drp-days"></span>' + '</div>' + '</div>'; 23896 var options = { 23897 singleDatePicker: false, 23898 autoApply: true, 23899 disabledPast: true, 23900 customClass: '', 23901 widthSingle: 100, 23902 onlyShowCurrentMonth: true, 23903 autoUpdateInput: false, 23904 minDate: today, 23905 opens: isMobile ? 'center' : 'left', 23906 template: template, 23907 locale: { 23908 format: "dddd, DD MMMM YYYY", 23909 direction: fresco.rtl ? 'rtl' : 'ltr', 23910 firstDay: daterangepickerLocale.first_day_of_week, 23911 separator: '-' 23912 } 23913 }; 23914 console.log(options); 23915 var checkinDate = new Date(check_in_input.data('original_date')); 23916 var checkoutDate = new Date(check_out_input.data('original_date')); 23917 if (checkinDate != 'Invalid Date' && checkoutDate != 'Invalid Date') { 23918 options.startDate = checkinDate; 23919 options.endDate = checkoutDate; 23920 } 23921 if ((typeof daterangepickerLocale === "undefined" ? "undefined" : _typeof(daterangepickerLocale)) == 'object') { 23922 options.locale = _.merge(daterangepickerLocale, options.locale); 23923 } 23924 check_in_out.daterangepicker(options); 23925 $('.check-in-out', parent).on('apply.daterangepicker', function (ev, picker) { 23926 if (picker.endDate.diff(picker.startDate, 'day') <= 0) { 23927 picker.endDate.add(1, 'day'); 23928 } 23929 if (me.searchFilter !== undefined) { 23930 me.searchFilter.start = picker.startDate.format(fresco.date_format); 23931 me.searchFilter.end = picker.endDate.format(fresco.date_format); 23932 me.searchFilter.date = picker.startDate.format("YYYY-MM-DD") + " - " + picker.endDate.format("YYYY-MM-DD"); 23933 } else { 23934 check_in_input.val(picker.startDate.format(fresco.date_format)); 23935 check_in_render.html(picker.startDate.format(fresco.date_format)); 23936 check_out_input.val(picker.endDate.format(fresco.date_format)); 23937 check_out_render.html(picker.endDate.format(fresco.date_format)); 23938 check_in_out.val(picker.startDate.format("YYYY-MM-DD") + " - " + picker.endDate.format("YYYY-MM-DD")); 23939 } 23940 setTimeout(function () { 23941 $('.form-guest-search-hotel').click(); 23942 }, 1); 23943 }); 23944 $('.check-in-out', parent).on('hide.daterangepicker', function (ev, picker) { 23945 // datePickerShown = false; 23946 }); 23947 $('.check-in-out', parent).on('click', function (event) { 23948 event.preventDefault(); 23949 event.stopPropagation(); 23950 }); 23951 date_wrapper.click(function (e) { 23952 check_in_out.trigger('click'); 23953 }); 23954 }); 23955 23956 //Review 23957 $('.review-form .review-items .rates .fa').each(function () { 23958 var list = $(this).parent(), 23959 listItems = list.children(), 23960 itemIndex = $(this).index(), 23961 parentItem = list.parent(); 23962 $(this).hover(function () { 23963 for (var i = 0; i < listItems.length; i++) { 23964 if (i <= itemIndex) { 23965 $(listItems[i]).addClass('hovered'); 23966 } else { 23967 break; 23968 } 23969 } 23970 $(this).click(function () { 23971 for (var i = 0; i < listItems.length; i++) { 23972 if (i <= itemIndex) { 23973 $(listItems[i]).addClass('selected'); 23974 } else { 23975 $(listItems[i]).removeClass('selected'); 23976 } 23977 } 23978 parentItem.children('.review_stats').val(itemIndex + 1); 23979 }); 23980 }, function () { 23981 listItems.removeClass('hovered'); 23982 }); 23983 }); 23984 $('button[data-toggle="tab"]').on('shown.bs.tab', function (event) { 23985 $('.message-error').hide(); 23986 var type = event.target.getAttribute('aria-controls'); 23987 $('#tab_type').val(type); 23988 }); 23989 23990 //Login 23991 $('.bravo-form-login [type=submit]').click(function (e) { 23992 e.preventDefault(); 23993 var form = $(this).closest('.bravo-form-login'); 23994 $.ajaxSetup({ 23995 headers: { 23996 'X-CSRF-TOKEN': form.find('meta[name="csrf-token"]').attr('content') 23997 } 23998 }); 23999 var type = $('#tab_type').val(); 24000 var data_params = {}; 24001 if (type == 'user') { 24002 data_params = { 24003 'email': form.find('input[name=email]').val(), 24004 'password': form.find('input[name=password]').val(), 24005 'remember': form.find('input[name=remember]').is(":checked") ? 1 : '', 24006 'g-recaptcha-response': form.find('[name=g-recaptcha-response]').val(), 24007 'redirect': form.find('input[name=redirect]').val(), 24008 'type': form.find('input[name=type]').val() 24009 }; 24010 } else { 24011 data_params = { 24012 'email': form.find('input[name=vendor_email]').val(), 24013 'password': form.find('input[name=vendor_password]').val(), 24014 'remember': form.find('input[name=vendor_remember]').is(":checked") ? 1 : '', 24015 'g-recaptcha-response': form.find('[name=g-recaptcha-response]').val(), 24016 'redirect': form.find('input[name=redirect]').val(), 24017 'hotel_id': form.find('input[name=hotel_id]').val(), 24018 'type': form.find('input[name=type]').val() 24019 }; 24020 } 24021 $.ajax({ 24022 'url': fresco.routes.login, 24023 'data': data_params, 24024 'type': 'POST', 24025 beforeSend: function beforeSend() { 24026 form.find('.form-floating').removeClass('validation-required'); 24027 form.find('.validation-error').attr('title', ''); 24028 form.find('.icon-loading').css("display", 'inline-block'); 24029 }, 24030 success: function success(data) { 24031 form.find('.icon-loading').hide(); 24032 $('[data-toggle="tooltip"]').tooltip('dispose'); 24033 if (data.error === true) { 24034 if (data.messages !== undefined) { 24035 for (var item in data.messages) { 24036 var msg = data.messages[item]; 24037 var prefix = type == 'user' ? '' : 'vendor_'; 24038 console.log(form.find('.error-' + prefix + item)); 24039 form.find('.error-' + prefix + item).attr('title', msg[0]); 24040 form.find('.error-' + prefix + item).closest('.form-floating').addClass('validation-required'); 24041 } 24042 } 24043 if (data.messages.message_error !== undefined) { 24044 form.find('.message-error').show().html('<div class="alert alert-danger">' + data.messages.message_error[0] + '</div>'); 24045 } 24046 } 24047 setTimeout(function () { 24048 $('[data-toggle="tooltip"]').tooltip(); 24049 }, 500); 24050 if (typeof data.redirect !== 'undefined' && data.redirect) { 24051 window.location.href = data.redirect; 24052 } 24053 } 24054 }); 24055 }); 24056 $('.bravo-form-register [type=submit]').click(function (e) { 24057 e.preventDefault(); 24058 var form = $(this).closest('.bravo-form-register'); 24059 $.ajaxSetup({ 24060 headers: { 24061 'X-CSRF-TOKEN': form.find('meta[name="csrf-token"]').attr('content') 24062 } 24063 }); 24064 $.ajax({ 24065 'url': fresco.routes.register, 24066 'data': { 24067 'email': form.find('input[name=email]').val(), 24068 'password': form.find('input[name=password]').val(), 24069 'first_name': form.find('input[name=first_name]').val(), 24070 'last_name': form.find('input[name=last_name]').val(), 24071 'phone': form.find('input[name=phone]').val(), 24072 'term': form.find('input[name=term]').is(":checked") ? 1 : '', 24073 'g-recaptcha-response': form.find('[name=g-recaptcha-response]').val() 24074 }, 24075 'type': 'POST', 24076 beforeSend: function beforeSend() { 24077 form.find('.error').hide(); 24078 form.find('.icon-loading').css("display", 'inline-block'); 24079 form.find('.message-error').hide(); 24080 }, 24081 success: function success(data) { 24082 form.find('.icon-loading').hide(); 24083 if (data.error === true) { 24084 if (data.messages !== undefined) { 24085 for (var item in data.messages) { 24086 var msg = data.messages[item]; 24087 form.find('.error-' + item).show().text(msg[0]); 24088 } 24089 } 24090 if (data.messages.message_error !== undefined) { 24091 form.find('.message-error').show().html('<div class="alert alert-danger">' + data.messages.message_error[0] + '</div>'); 24092 } 24093 } 24094 if (data.redirect !== undefined) { 24095 window.location.href = data.redirect; 24096 } 24097 }, 24098 error: function error(e) { 24099 form.find('.icon-loading').hide(); 24100 if (typeof e.responseJSON !== "undefined" && typeof e.responseJSON.message != 'undefined') { 24101 form.find('.message-error').show().html('<div class="alert alert-danger">' + e.responseJSON.message + '</div>'); 24102 } 24103 } 24104 }); 24105 }); 24106 $(document).on('click', '.bravo-form-reset [type=submit]', function (e) { 24107 e.preventDefault(); 24108 var form = $(this).closest('.bravo-form-reset'); 24109 $.ajaxSetup({ 24110 headers: { 24111 'X-CSRF-TOKEN': form.find('meta[name="csrf-token"]').attr('content') 24112 } 24113 }); 24114 var type = $('#tab_type').val(); 24115 var data_params = { 24116 'email': form.find('input[name=email]').val(), 24117 'type': form.find('input[name=type]').val() 24118 }; 24119 if (type != 'user') { 24120 data_params['email'] = form.find('input[name=vendor_email]').val();
24121 data_params['login_id'] = form.find('input[name=vendor_login_id]').val(); 24122 } 24123 $.ajax({ 24124 'url': form.attr('action'), 24125 'data': data_params, 24126 'type': 'POST', 24127 beforeSend: function beforeSend() { 24128 form.find('.form-floating').removeClass('validation-required'); 24129 form.find('.validation-error').attr('title', ''); 24130 form.find('.icon-loading').css("display", 'inline-block'); 24131 form.find('.message-error').hide(); 24132 }, 24133 success: function success(data) { 24134 form.find('.icon-loading').hide(); 24135 $('[data-toggle="tooltip"]').tooltip('dispose'); 24136 if (data.error === true) { 24137 if (data.messages !== undefined) { 24138 for (var item in data.messages) { 24139 var msg = data.messages[item]; 24140 var prefix = type == 'user' ? '' : 'vendor_'; 24141 form.find('.error-' + prefix + item).attr('title', msg[0]); 24142 form.find('.error-' + prefix + item).closest('.form-floating').addClass('validation-required'); 24143 } 24144 } 24145 if (data.messages.message_error !== undefined) { 24146 form.find('.message-error').show().html('<div class="alert alert-gray mb-4">' + data.messages.message_error[0] + '</div>'); 24147 } 24148 } 24149 setTimeout(function () { 24150 $('[data-toggle="tooltip"]').tooltip(); 24151 }, 500); 24152 if (typeof data.redirect !== 'undefined' && data.redirect) { 24153 window.location.href = data.redirect; 24154 } 24155 } 24156 }); 24157 }); 24158 $(document).on('click', '.bravo-form-set [type=submit]', function (e) { 24159 e.preventDefault(); 24160 var form = $(this).closest('.bravo-form-set'); 24161 $.ajaxSetup({ 24162 headers: { 24163 'X-CSRF-TOKEN': form.find('meta[name="csrf-token"]').attr('content') 24164 } 24165 }); 24166 var data_params = { 24167 'type': form.find('input[name=type]').val(), 24168 'reset_token': form.find('input[name=reset_token]').val(), 24169 'email': form.find('input[name=email]').val(), 24170 'login_id': form.find('input[name=login_id]').val(), 24171 'password': form.find('input[name=password]').val(), 24172 'password_confirmation': form.find('input[name=password_confirmation]').val() 24173 }; 24174 $.ajax({ 24175 'url': form.attr('action'), 24176 'data': data_params, 24177 'type': 'POST', 24178 beforeSend: function beforeSend() { 24179 form.find('.form-floating').removeClass('validation-required'); 24180 form.find('.validation-error').attr('title', ''); 24181 form.find('.icon-loading').css("display", 'inline-block'); 24182 form.find('.message-error').hide(); 24183 }, 24184 success: function success(data) { 24185 form.find('.icon-loading').hide(); 24186 $('[data-toggle="tooltip"]').tooltip('dispose'); 24187 if (data.status === true) { 24188 var PathLoader = function PathLoader(el) { 24189 this.el = el; 24190 this.strokeLength = el.getTotalLength(); 24191 24192 // set dash offset to 0 24193 this.el.style.strokeDasharray = this.el.style.strokeDashoffset = this.strokeLength; 24194 }; 24195 $('.reset-form').addClass('d-none'); 24196 $('.reset-success').removeClass('d-none'); 24197 PathLoader.prototype._draw = function (val) { 24198 this.el.style.strokeDashoffset = this.strokeLength * (1 - val); 24199 }; 24200 PathLoader.prototype.setProgress = function (val, cb) { 24201 this._draw(val); 24202 if (cb && typeof cb === 'function') cb(); 24203 }; 24204 PathLoader.prototype.setProgressFn = function (fn) { 24205 if (typeof fn === 'function') fn(this); 24206 }; 24207 var body = document.body, 24208 svg = document.querySelector('svg path'); 24209 if (svg !== null) { 24210 svg = new PathLoader(svg); 24211 setTimeout(function () { 24212 document.body.classList.add('active'); 24213 svg.setProgress(1); 24214 }, 500); 24215 } 24216 } else if (data.error === true) { 24217 if (data.messages !== undefined) { 24218 for (var item in data.messages) { 24219 var msg = data.messages[item]; 24220 form.find('.error-' + item).attr('title', msg[0]); 24221 form.find('.error-' + item).closest('.form-floating').addClass('validation-required'); 24222 } 24223 } 24224 if (data.messages.message_error !== undefined) { 24225 form.find('.message-error').show().html('<div class="alert alert-gray">' + data.messages.message_error[0] + '</div>'); 24226 } 24227 } 24228 setTimeout(function () { 24229 $('[data-toggle="tooltip"]').tooltip(); 24230 }, 500); 24231 if (typeof data.redirect !== 'undefined' && data.redirect) { 24232 window.location.href = data.redirect; 24233 } 24234 } 24235 }); 24236 }); 24237 var form_subscribe_type = ""; 24238 $('.subscribe-modal-button').click(function () { 24239 form_subscribe_type = $(this).data('type'); 24240 }); 24241 24242 // subscribing form 24243 $('.bravo-form-subscribe [type=submit]').click(function (e) { 24244 e.preventDefault(); 24245 var form = $(this).closest('.bravo-form-subscribe'); 24246 $.ajaxSetup({ 24247 headers: { 24248 'X-CSRF-TOKEN': form.find('meta[name="csrf-token"]').attr('content') 24249 } 24250 }); 24251 $.ajax({ 24252 'url': fresco.url + '/subscribe', 24253 'data': { 24254 'type': form_subscribe_type, 24255 'email': form.find('input[name=email]').val(), 24256 'first_name': form.find('input[name=first_name]').val(), 24257 'last_name': form.find('input[name=last_name]').val(), 24258 'g-recaptcha-response': form.find('[name=g-recaptcha-response]').val() 24259 }, 24260 'type': 'POST', 24261 beforeSend: function beforeSend() { 24262 form.find('.error').hide(); 24263 form.find('.icon-loading').css("display", 'inline-block'); 24264 }, 24265 success: function success(data) { 24266 form.find('.icon-loading').hide(); 24267 if (data.error === true) { 24268 if (data.messages !== undefined) { 24269 for (var item in data.messages) { 24270 var msg = data.messages[item]; 24271 form.find('.error-' + item).show().text(msg[0]); 24272 } 24273 } 24274 if (data.messages.message_error !== undefined) { 24275 form.find('.message-error').show().html('<div class="alert alert-danger">' + data.messages.message_error[0] + '</div>'); 24276 } 24277 } else { 24278 form.find('.message-error').show().html('<div class="alert alert-success">Thank you for subscribing</div>'); 24279 setTimeout(function () { 24280 $('#subscribe').modal('hide'); 24281 }, 2000); 24282 } 24283 }, 24284 error: function error(e) { 24285 form.find('.icon-loading').hide(); 24286 if (typeof e.responseJSON !== "undefined" && typeof e.responseJSON.message != 'undefined') { 24287 form.find('.message-error').show().html('<div class="alert alert-danger">' + e.responseJSON.message + '</div>'); 24288 } 24289 } 24290 }); 24291 }); 24292 $('#register').on('show.bs.modal', function (event) { 24293 $('#login').modal('hide'); 24294 }); 24295 $('#login').on('show.bs.modal', function (event) { 24296 $('#register').modal('hide'); 24297 }); 24298 var onSubmitSubscribe = false;
24299 //Subscribe box 24300 $('.bravo-subscribe-form').submit(function (e) { 24301 e.preventDefault(); 24302 if (onSubmitSubscribe) return; 24303 $(this).addClass('loading'); 24304 var me = $(this); 24305 me.find('.form-mess').html(''); 24306 $.ajax({ 24307 url: me.attr('action'), 24308 type: 'post', 24309 data: $(this).serialize(), 24310 dataType: 'json', 24311 success: function success(json) { 24312 onSubmitSubscribe = false; 24313 me.removeClass('loading'); 24314 if (json.message) { 24315 me.find('.form-mess').html('<span class="' + (json.status ? 'text-success' : 'text-danger') + '">' + json.message + '</span>'); 24316 } 24317 if (json.status) { 24318 me.find('input').val(''); 24319 } 24320 }, 24321 error: function error(e) { 24322 onSubmitSubscribe = false; 24323 me.removeClass('loading'); 24324 if (parseErrorMessage(e)) { 24325 me.find('.form-mess').html('<span class="text-danger">' + parseErrorMessage(e) + '</span>'); 24326 } else if (e.responseText) { 24327 me.find('.form-mess').html('<span class="text-danger">' + e.responseText + '</span>'); 24328 } 24329 } 24330 }); 24331 return false; 24332 }); 24333 24334 //Menu 24335 $(".bravo-more-menu").click(function () { 24336 $(this).trigger('bravo-trigger-menu-mobile'); 24337 }); 24338 $(".bravo-menu-mobile .b-close").click(function () { 24339 $(".bravo-more-menu").trigger('bravo-trigger-menu-mobile'); 24340 }); 24341 $(document).on("click", ".bravo-effect-bg", function () { 24342 $(".bravo-more-menu").trigger('bravo-trigger-menu-mobile'); 24343 }); 24344 $(document).on("bravo-trigger-menu-mobile", ".bravo-more-menu", function () { 24345 $(this).toggleClass('active'); 24346 if ($(this).hasClass('active')) { 24347 $(".bravo-menu-mobile").addClass("active"); 24348 $('body').css('overflow', 'hidden').append("<div class='bravo-effect-bg'></div>"); 24349 } else { 24350 $(".bravo-menu-mobile").removeClass("active"); 24351 $("body").css('overflow', 'initial').find(".bravo-effect-bg").remove(); 24352 } 24353 }); 24354 $(".bravo-menu-mobile .g-menu ul li .fa").click(function (e) { 24355 e.preventDefault(); 24356 $(this).closest('li').toggleClass('active'); 24357 }); 24358 $(".bravo-menu-mobile").each(function () { 24359 var h_profile = $(this).find(".user-profile").height(); 24360 var h1_main = $(window).height(); 24361 $(this).find(".g-menu").css("max-height", h1_main - h_profile - 15); 24362 }); 24363 $(".bravo-more-menu-user").click(function () { 24364 $(".bravo_user_profile > .container-fluid > .row > .col-md-3").addClass("active"); 24365 $("body").css('overflow', 'hidden').append("<div class='bravo-effect-user-bg'></div>"); 24366 }); 24367 $(document).on("click", ".bravo-effect-user-bg,.bravo-close-menu-user", function () { 24368 $(".bravo_user_profile > .container-fluid > .row > .col-md-3").removeClass("active"); 24369 $('body').css('overflow', 'initial').find(".bravo-effect-user-bg").remove(); 24370 }); 24371 $('[data-toggle="tooltip"]').tooltip(); 24372 $('.dropdown-toggle').dropdown(); 24373 $('.dropdown-toggle').dropdown('hide'); 24374 $('.select-guests-dropdown .btn-minus').click(function (e) { 24375 e.stopPropagation(); 24376 var parent = $(this).closest('.form-select-guests'); 24377 var input = parent.find('.select-guests-dropdown .tmp_' + $(this).data('input')); 24378 var min = parseInt(input.attr('min')); 24379 var old = parseInt(input.val()); 24380 if (old <= min) { 24381 return; 24382 } 24383 input.val(old - 1); 24384 // updateGuestCountText(parent); 24385 }); 24386 $('.select-guests-dropdown .btn-add').click(function (e) { 24387 e.stopPropagation(); 24388 var parent = $(this).closest('.form-select-guests'); 24389 var input = parent.find('.select-guests-dropdown .tmp_' + $(this).data('input')); 24390 var max = parseInt(input.attr('max')); 24391 var old = parseInt(input.val()); 24392 if (old >= max) { 24393 return; 24394 } 24395 input.val(old + 1); 24396 // updateGuestCountText(parent); 24397 }); 24398 $('.select-guests-dropdown .guest-apply-btn').click(function (e) { 24399 var parent = $(this).closest('.form-select-guests'); 24400 var adults = parent.find('.select-guests-dropdown .tmp_adults').val(); 24401 parent.find('.select-guests-dropdown [name="adults"]').val(adults); 24402 var children = parent.find('.select-guests-dropdown .tmp_children').val(); 24403 parent.find('.select-guests-dropdown [name="children"]').val(children); 24404 var room = parent.find('.select-guests-dropdown .tmp_room').val(); 24405 parent.find('.select-guests-dropdown [name="room"]').val(room); 24406 parent.find('.select-guests-dropdown').removeClass('show'); 24407 updateGuestCountText(parent); 24408 }); 24409 $('.select-guests-dropdown .guest-reset-btn').click(function (e) { 24410 var parent = $(this).closest('.form-select-guests'); 24411 24412 // let adults = parent.find('.select-guests-dropdown [name="adults"]').val(); 24413 var adults = 1; 24414 parent.find('.select-guests-dropdown .tmp_adults').val(adults); 24415 parent.find('.select-guests-dropdown [name="adults"]').val(adults); 24416 24417 // let children = parent.find('.select-guests-dropdown [name="children"]').val(); 24418 var children = 0; 24419 parent.find('.select-guests-dropdown .tmp_children').val(children); 24420 parent.find('.select-guests-dropdown [name="children"]').val(children); 24421 24422 // let room = parent.find('.select-guests-dropdown [name="room"]').val(); 24423 var room = 1; 24424 parent.find('.select-guests-dropdown .tmp_room').val(room); 24425 parent.find('.select-guests-dropdown [name="room"]').val(room); 24426 parent.find('.select-guests-dropdown').removeClass('show'); 24427 updateGuestCountText(parent); 24428 }); 24429 $('.select-guests-dropdown input').keyup(function (e) { 24430 var parent = $(this).closest('.form-select-guests'); 24431 updateGuestCountText(parent); 24432 }); 24433 $('.select-guests-dropdown input').change(function (e) { 24434 var parent = $(this).closest('.form-select-guests'); 24435 updateGuestCountText(parent); 24436 }); 24437 function updateGuestCountText(parent) { 24438 var adults = parseInt(parent.find('[name=adults]').val()); 24439 var children = parseInt(parent.find('[name=children]').val()); 24440 var room = parseInt(parent.find('[name=room]').val()); 24441 var adultsHtml = parent.find('.render .adults .multi').data('html'); 24442 parent.find('.render .adults .multi').html(adultsHtml.replace(':count', adults)); 24443 if (adults > 1) { 24444 parent.find('.render .adults .multi').removeClass('d-none'); 24445 parent.find('.render .adults .one').addClass('d-none'); 24446 } else { 24447 parent.find('.render .adults .multi').addClass('d-none'); 24448 parent.find('.render .adults .one').removeClass('d-none'); 24449 } 24450 var childrenHtml = parent.find('.render .children .multi').data('html'); 24451 parent.find('.render .children .multi').html(childrenHtml.replace(':count', children)); 24452 if (children > 1) { 24453 parent.find('.render .children .multi').removeClass('d-none'); 24454 parent.find('.render .children .one').addClass('d-none'); 24455 } else { 24456 parent.find('.render .children .multi').addClass('d-none'); 24457 parent.find('.render .children .one').removeClass('d-none').html(parent.find('.render .children .one').data('html').replace(':count', children)); 24458 } 24459 var roomHtml = parent.find('.render .room .multi').data('html'); 24460 parent.find('.render .room .multi').html(roomHtml.replace(':count', room)); 24461 if (room > 1) { 24462 parent.find('.render .room .multi').removeClass('d-none'); 24463 parent.find('.render .room .one').addClass('d-none'); 24464 } else { 24465 parent.find('.render .room .multi').addClass('d-none'); 24466 parent.find('.render .room .one').removeClass('d-none').html(parent.find('.render .room .one').data('html').replace(':count', room)); 24467 } 24468 } 24469 $('.select-guests-dropdown .dropdown-item-row').click(function (e) { 24470 e.stopPropagation(); 24471 }); 24472 $(".smart-search .smart-search-location").each(function () { 24473 var $this = $(this); 24474 var string_list = $this.attr('data-default'); 24475 var default_list = []; 24476 if (string_list.length > 0) { 24477 default_list = JSON.parse(string_list); 24478 } 24479 var options = { 24480 url: fresco.url + '/location/search/searchForSelect2', 24481 dataDefault: default_list, 24482 textLoading: $this.attr("data-onLoad"), 24483 iconItem: "icofont-location-pin" 24484 }; 24485 $this.bravoAutocomplete(options); 24486 }); 24487 $(".smart-search .smart-select").each(function () { 24488 var $this = $(this); 24489 var string_list = $this.attr('data-default'); 24490 var default_list = []; 24491 if (string_list.length > 0) { 24492 default_list = JSON.parse(string_list); 24493 } 24494 var options = { 24495 dataDefault: default_list, 24496 iconItem: "", 24497 textLoading: $this.attr("data-onLoad") 24498 }; 24499 $this.bravoAutocomplete(options); 24500 }); 24501 $(document).on("click", ".service-wishlist", function () { 24502 var $this = $(this); 24503 $.ajax({ 24504 url: fresco.url + '/user/wishlist', 24505 data: { 24506 object_id: $this.attr("data-id"), 24507 object_model: $this.attr("data-type") 24508 }, 24509 dataType: 'json', 24510 type: 'POST', 24511 beforeSend: function beforeSend() { 24512 $this.addClass("loading"); 24513 }, 24514 success: function success(res) { 24515 $this.attr('class', "service-wishlist " + res["class"]); 24516 }, 24517 error: function error(e) { 24518 if (e.status === 401) { 24519 $('#login').modal('show'); 24520 } 24521 } 24522 }); 24523 }); 24524 $(document).on("click", ".service-wishlist-1", function () { 24525 var $this = $(this); 24526 $.ajax({ 24527 url: fresco.url + '/user/wishlist', 24528 data: { 24529 object_id: $this.attr("data-id"), 24530 object_model: $this.attr("data-type") 24531 }, 24532 dataType: 'json', 24533 type: 'POST', 24534 beforeSend: function beforeSend() { 24535 $this.addClass("loading"); 24536 }, 24537 success: function success(res) { 24538 $this.attr('class', "service-wishlist-1 " + res["class"]); 24539 }, 24540 error: function error(e) { 24541 if (e.status === 401) { 24542 $('#login').modal('show'); 24543 } 24544 } 24545 }); 24546 }); 24547 $('.bravo-video-popup').click(function () { 24548 var video_url = $(this).data("src"); 24549 var target = $(this).data("target"); 24550 $(target).find(".bravo_embed_video").attr('src', video_url + "?autoplay=0&modestbranding=1&showinfo=0"); 24551 $(target).on('hidden.bs.modal', function () { 24552 $(target).find(".bravo_embed_video").attr('src', ""); 24553 }); 24554 }); 24555 var onSubmitContact = false;
24556 // Contact box 24557 $('.bravo-contact-block-form').submit(function (e) { 24558 e.preventDefault(); 24559 if (onSubmitContact) return; 24560 $(this).addClass('loading'); 24561 var me = $(this); 24562 me.find('.form-mess').html(''); 24563 $.ajax({ 24564 url: me.attr('action'), 24565 type: 'post', 24566 data: $(this).serialize(), 24567 dataType: 'json', 24568 success: function success(json) { 24569 onSubmitContact = false; 24570 me.removeClass('loading'); 24571 if (json.message) { 24572 me.find('.form-mess').html('<span class="' + (json.status ? 'text-success' : 'text-danger') + '">' + json.message + '</span>'); 24573 } 24574 if (json.status) { 24575 me.find('input').val(''); 24576 me.find('textarea').val(''); 24577 } 24578 }, 24579 error: function error(e) { 24580 onSubmitContact = false; 24581 me.removeClass('loading'); 24582 if (parseErrorMessage(e)) { 24583 me.find('.form-mess').html('<span class="text-danger">' + parseErrorMessage(e) + '</span>'); 24584 } else if (e.responseText) { 24585 me.find('.form-mess').html('<span class="text-danger">' + e.responseText + '</span>'); 24586 } 24587 } 24588 }); 24589 return false; 24590 }); 24591 $('.btn-submit-enquiry').click(function (e) { 24592 e.preventDefault(); 24593 var form = $(this).closest('.enquiry_form_modal_form'); 24594 $.ajax({ 24595 url: fresco.url + '/booking/addEnquiry', 24596 data: form.find('textarea,input,select').serialize(), 24597 dataType: 'json', 24598 type: 'post', 24599 beforeSend: function beforeSend() { 24600 form.find('.message_box').html('').hide(); 24601 form.find('.icon-loading').css("display", 'inline-block'); 24602 }, 24603 success: function success(res) { 24604 if (res.errors) { 24605 res.message = ''; 24606 for (var k in res.errors) { 24607 res.message += res.errors[k].join('<br>') + '<br>'; 24608 } 24609 } 24610 if (res.message) { 24611 if (!res.status) { 24612 form.find('.message_box').append('<div class="text text-danger">' + res.message + '</div>').show(); 24613 } else { 24614 form.find('.message_box').append('<div class="text text-success">' + res.message + '</div>').show(); 24615 } 24616 } 24617 form.find('.icon-loading').hide(); 24618 if (res.status) { 24619 form.find('textarea,input,select').val(''); 24620 } 24621 if (typeof BravoReCaptcha != "undefined") { 24622 BravoReCaptcha.reset('enquiry_form'); 24623 } 24624 }, 24625 error: function error(e) { 24626 if (typeof BravoReCaptcha != "undefined") { 24627 BravoReCaptcha.reset('enquiry_form'); 24628 } 24629 form.find('.icon-loading').hide(); 24630 } 24631 }); 24632 }); 24633 $('.popular-place-button').click(function () { 24634 var destination_id = $(this).data('place-id'); 24635 $('input[name = location]').val(destination_id); 24636 $('form.bravo_form.menu-2').submit(); 24637 }); 24638 }); 24639 24640 // Drawer for menu type 2 24641 jQuery(function ($) { 24642 $('.in-mobile.burger-li').click(function () { 24643 $('.jasper-menu-2-drawer').toggleClass('d-none'); 24644 }); 24645 $('.jasper-menu-2-drawer .close-button').click(function () { 24646 $('.jasper-menu-2-drawer').toggleClass('d-none'); 24647 }); 24648 if ($('#menu-container').offset() !== undefined && $('.bravo_footer').offset() !== undefined) { 24649 var distance_from_top_to_menu = $('#menu-container').offset().top + 80; 24650 var distance_from_top_to_pagination = $('.bravo_footer').offset().top - 150; 24651 $(window).scroll(function () { 24652 if ($(window).width() > 1024) { 24653 if ($(window).scrollTop() > distance_from_top_to_menu && $(window).scrollTop() < distance_from_top_to_pagination) { 24654 if (!$('#menu-fixed-container').hasClass('fixed-container')) { 24655 $('#menu-fixed-container').addClass('fixed-container'); 24656 } 24657 if (!$('#menu-container').hasClass('container')) { 24658 $('#menu-container').addClass('container'); 24659 } 24660 } else { 24661 if ($('#menu-fixed-container').hasClass('fixed-container')) $('#menu-fixed-container').removeClass('fixed-container'); 24662 if ($('#menu-container').hasClass('container')) $('#menu-container').removeClass('container'); 24663 } 24664 } else { 24665 if ($('#menu-fixed-container').hasClass('fixed-container')) $('#menu-fixed-container').removeClass('fixed-container'); 24666 if ($('#menu-container').hasClass('container')) $('#menu-container').removeClass('container'); 24667 } 24668 }); 24669 } 24670 $('#in-desktop-dark-menu').attr('src', $('img.in-desktop.white-menu').attr('src')); 24671 var isMoreRoomAmenitiesSelected = false;
24672 $('.hover-cursor-attribute').click(function () { 24673 isMoreRoomAmenitiesSelected = true; 24674 }); 24675 $('.bravo-list-item .skypalace-hotel-list-info').click(function () { 24676 if (!isMoreRoomAmenitiesSelected) { 24677 var win = window.open($(this).data('url'), '_blank'); 24678 win.focus(); 24679 } 24680 isMoreRoomAmenitiesSelected = false; 24681 }); 24682 }); 24683 } 24684 } 24685}); 24686 24687/***/ }), 24688
24689/***/ "./resources/js/modules/hotel_detail.js": 24690/*!**********************************************!*\ 24691 !*** ./resources/js/modules/hotel_detail.js ***! 24692 \**********************************************/ 24693/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 24694 24695"use strict"; 24696__webpack_require__.r(__webpack_exports__); 24697/* harmony export */ __webpack_require__.d(__webpack_exports__, { 24698/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 24699/* harmony export */ }); 24700var _methods; 24701function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 24702function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 24703function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 24704function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } 24705function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 24706function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 24707function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 24708function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 24709function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 24710function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 24711function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 24712function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 24713function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 24714function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 24715function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } 24716function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 24717/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 24718 otherData: { 24719 id: '', 24720 extra_price: [], 24721 extra_price_recommended: [], 24722 person_types: [[]], 24723 buyer_fees: [], 24724 message: { 24725 content: '', 24726 type: false 24727 }, 24728 html: '', 24729 onSubmit: false, 24730 onSubmit1: false, 24731 minDate: false, 24732 currency: fresco.currency_symbol, 24733 datePickerShown: false, 24734 start_date: '', 24735 end_date: '', 24736 startDate: '', 24737 endDate: '', 24738 timezone: '', 24739 start_date_html: 'Select Date', 24740 start_date_html1: 'Select Date', 24741 end_date_html: 'Select Date', 24742 booking_description: '', 24743 number_of_guests: 0, 24744 step: 1, 24745 start_date_obj: '', 24746 adults: 1, 24747 children: 0, 24748 room: 1, 24749 tmp_adults: 1, 24750 tmp_children: 0, 24751 tmp_room: 1, 24752 couponCode: '', 24753 allEvents: [], 24754 rooms: [], 24755 recommended_rooms: [], 24756 recommendedHtml: [], 24757 recommended_rooms_price: 0, 24758 recommended_rooms_taxes: [], 24759 onLoadAvailability: false, 24760 firstLoad: true, 24761 couponError: '', 24762 couponMinAmount: 0, 24763 couponMaxAmount: -1, 24764 couponValue: 0, 24765 couponType: '', 24766 couponId: null, 24767 offerSaveRecommended: 0, 24768 offerSaveNormal: 0, 24769 i18n: [], 24770 total_price_before_fee: 0, 24771 total_price_fee: 0, 24772 taxes: [], 24773 tax_values: {}, 24774 r_taxes: [], 24775 r_tax_values: {},
24776 is_form_enquiry_and_book: false, 24777 enquiry_type: 'book', 24778 enquiry_is_submit: false, 24779 enquiry_name: "", 24780 enquiry_email: "", 24781 enquiry_phone: "", 24782 enquiry_note: "", 24783 table_width: 0, 24784 table_height: 0, 24785 linkHeights: {}, 24786 promotions: {}, 24787 map_lat: '', 24788 map_lng: '', 24789 map_zoom: '8', 24790 map_data: [], 24791 reference: 'direct_website', 24792 popup_code: '', 24793 params: [], 24794 total_days: 1 24795 }, 24796 watch: { 24797 extra_price: { 24798 handlerf: function handlerf() { 24799 this.step = 1; 24800 }, 24801 deep: true 24802 }, 24803 extra_price_recommended: { 24804 handlerf: function handlerf() { 24805 this.step = 1; 24806 }, 24807 deep: true 24808 }, 24809 start_date: function start_date() { 24810 this.step = 1; 24811 }, 24812 guests: function guests() { 24813 this.step = 1; 24814 }, 24815 person_types: { 24816 handlerf: function handlerf() { 24817 this.step = 1; 24818 }, 24819 deep: true 24820 } 24821 }, 24822 computed: { 24823 nightsText: function nightsText() { 24824 if (this.total_days > 1) { 24825 return 'For ' + this.total_days + ' Nights'; 24826 } else { 24827 return 'Per Night'; 24828 } 24829 }, 24830 revie_rat: function revie_rat() { 24831 this.getReviewText(); 24832 return 'clickRate'; 24833 }, 24834 total_price: function total_price() { 24835 var self = this; 24836 if (this.start_date !== "" && this.total_rooms > 0) { 24837 var guests = this.children + this.adults; 24838 var total_price = 0; 24839 var startDate = new Date(this.start_date).getTime(); 24840 var endDate = new Date(this.end_date).getTime(); 24841 this.taxes = []; 24842 this.offerSaveNormal = 0; 24843 var number = this.taxes.length; 24844 for (var i = 0; i < number; i++) { 24845 this.taxes.pop(); 24846 } 24847 this.tax_values = {}; 24848 var tax_fee = 0; 24849 var rooms = []; 24850 this.rooms.forEach(function (room) { 24851 room.allRooms.forEach(function (value) { 24852 rooms.push(value); 24853 }); 24854 }); 24855 rooms.forEach(function (item) { 24856 if (item.number_selected) { 24857 total_price += item.discount_price * parseInt(item.number_selected); 24858 if (parseInt(item.number_selected) > 0) { 24859 tax_fee += self.addTaxData(item.id, item.title, item.discount_price * parseInt(item.number_selected)); 24860 } 24861 self.offerSaveNormal += (item.price - item.discount_price) * item.number_selected; 24862 } 24863 }); 24864 var t_price = total_price; 24865 var duration_in_day = moment(endDate).diff(moment(startDate), 'days'); 24866 for (var ix in this.extra_price) { 24867 var item = this.extra_price[ix]; 24868 var type_total = 0; 24869 if (item.enable === true) { 24870 switch (item.type) { 24871 case "one_time": 24872 type_total += parseFloat(item.price); 24873 break; 24874 case "per_day": 24875 type_total += parseFloat(item.price) * Math.max(1, duration_in_day); 24876 break; 24877 } 24878 if (typeof item.per_person !== "undefined") { 24879 type_total = type_total * guests; 24880 } 24881 total_price += type_total; 24882 } 24883 } 24884 this.total_price_before_fee = total_price; 24885 var total_fee = 0; 24886 // debugger 24887 for (var ix in this.buyer_fees) { 24888 var item = this.buyer_fees[ix]; 24889 24890 //for Fixed 24891 var fee_price = parseFloat(item.price); 24892 24893 //for Percent 24894 if (typeof item.unit !== "undefined" && item.unit === "percent") { 24895 fee_price = total_price / 100 * fee_price; 24896 } 24897 if (typeof item.per_person !== "undefined") { 24898 fee_price = fee_price * guests; 24899 } 24900 total_fee += fee_price; 24901 } 24902 total_price += total_fee; 24903 total_price += tax_fee; 24904 this.total_price_fee = total_fee; 24905 return total_price; 24906 } 24907 return 0; 24908 }, 24909 total_price_for_recommend_rooms: function total_price_for_recommend_rooms() { 24910 var total_price = 0; 24911 for (var ix in this.extra_price_recommended) { 24912 var item = this.extra_price_recommended[ix]; 24913 var type_total = 0; 24914 if (item.enable === true) { 24915 switch (item.type) { 24916 case "one_time": 24917 type_total += parseFloat(item.price); 24918 break; 24919 case "per_day": 24920 type_total += parseFloat(item.price) * Math.max(1, duration_in_day); 24921 break; 24922 } 24923 if (typeof item.per_person !== "undefined") { 24924 type_total = type_total * guests; 24925 } 24926 total_price += type_total; 24927 } 24928 } 24929 var total_price_for_recommend_rooms = this.recommended_rooms_price + total_price; 24930 return window.bravo_format_float_money(total_price_for_recommend_rooms); 24931 }, 24932 total_price_for_recommend_rooms_without_tax: function total_price_for_recommend_rooms_without_tax() { 24933 var total_price = 0; 24934 var allRooms = []; 24935 for (var _i = 0, _Object$entries = Object.entries(this.recommended_rooms); _i < _Object$entries.length; _i++) { 24936 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), 24937 key = _Object$entries$_i[0], 24938 recommended = _Object$entries$_i[1]; 24939 for (var _i2 = 0, _Object$entries2 = Object.entries(recommended.allRooms); _i2 < _Object$entries2.length; _i2++) { 24940 var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2), 24941 _key = _Object$entries2$_i[0], 24942 room = _Object$entries2$_i[1]; 24943 allRooms.push(room); 24944 } 24945 } 24946 var r_rooms = allRooms.map(function (room) { 24947 var current_room_price = room.discount_price * room.number_selected; 24948 total_price += current_room_price; 24949 return room; 24950 }); 24951 return window.bravo_format_money(total_price); 24952 }, 24953 selected_rooms: function selected_rooms() { 24954 if (this.start_date !== "") { 24955 var rooms = [];
24956 this.rooms.forEach(function (room) { 24957 room.allRooms.forEach(function (value) { 24958 if (value.number_selected > 0) { 24959 rooms.push(value); 24960 } 24961 }); 24962 }); 24963 return rooms; 24964 } 24965 return []; 24966 }, 24967 total_rooms: function total_rooms() { 24968 if (this.start_date !== "") { 24969 var t = 0; 24970 var rooms = []; 24971 this.rooms.forEach(function (room) { 24972 room.allRooms.forEach(function (value) { 24973 rooms.push(value); 24974 }); 24975 }); 24976 rooms.forEach(function (item) { 24977 if (item.number_selected) { 24978 t += parseInt(item.number_selected); 24979 } 24980 }); 24981 return t; 24982 } 24983 return 0; 24984 }, 24985 total_price_html: function total_price_html() { 24986 if (!this.total_price) return ''; 24987 setTimeout(function () { 24988 $('[data-toggle="tooltip"]').tooltip(); 24989 $(document).trigger("scroll"); 24990 }, 200); 24991 return window.bravo_format_float_money(this.total_price); 24992 }, 24993 pay_now_price: function pay_now_price() { 24994 if (this.is_deposit_ready) { 24995 var total_price_depossit = 0; 24996 var tmp_total_price = this.total_price; 24997 var deposit_fomular = this.deposit_fomular; 24998 if (deposit_fomular === "deposit_and_fee") { 24999 tmp_total_price = this.total_price_before_fee; 25000 } 25001 switch (this.deposit_type) { 25002 case "percent": 25003 total_price_depossit = tmp_total_price * this.deposit_amount / 100; 25004 break; 25005 default: 25006 total_price_depossit = this.deposit_amount; 25007 } 25008 if (deposit_fomular === "deposit_and_fee") { 25009 total_price_depossit = total_price_depossit + this.total_price_fee; 25010 } 25011 return total_price_depossit; 25012 } 25013 return this.total_price; 25014 }, 25015 pay_now_price_html: function pay_now_price_html() { 25016 return window.bravo_format_float_money(this.pay_now_price); 25017 }, 25018 is_deposit_ready: function is_deposit_ready() { 25019 if (this.deposit && this.deposit_amount) return true; 25020 return false; 25021 }, 25022 daysOfWeekDisabled: function daysOfWeekDisabled() { 25023 var res = []; 25024 for (var k in this.open_hours) { 25025 if (typeof this.open_hours[k].enable == 'undefined' || this.open_hours[k].enable != 1) { 25026 if (k == 7) { 25027 res.push(0); 25028 } else { 25029 res.push(k); 25030 } 25031 } 25032 } 25033 return res; 25034 }, 25035 guests: function guests() { 25036 return this.children + this.adults; 25037 } 25038 }, 25039 updated: function updated() { 25040 this.$nextTick(function () { 25041 // Code that will run only after the 25042 // entire view has been re-rendered 25043 this.initializeCarousel(); 25044 this.table_height = $('#desktop-room-items').height(); 25045 this.table_width = $('#desktop-room-items').width(); 25046 this.changeSelectBoxSize(); 25047 this.getLinkHeights(); 25048 }); 25049 }, 25050 methods: (_methods = { 25051 formatQueryString: function formatQueryString(jsonUrl) { 25052 return new URLSearchParams(jsonUrl).toString(); 25053 }, 25054 initTooltips: function initTooltips() { 25055 setTimeout(function () { 25056 $('[data-toggle="tooltip"]').tooltip(); 25057 }, 500); 25058 }, 25059 updatePageUrl: function updatePageUrl() { 25060 var formatted_url = this.formatQueryString(this.params); 25061 var newRelativePathQuery = window.location.pathname + '?' + formatted_url; 25062 history.replaceState(null, '', newRelativePathQuery); 25063 }, 25064 formatMoney: function formatMoney(m) { 25065 return window.bravo_format_money(m); 25066 }, 25067 showTime: function showTime() { 25068 var options = { 25069 hour: '2-digit', 25070 minute: '2-digit', 25071 second: '2-digit', 25072 year: 'numeric', 25073 month: '2-digit', 25074 day: '2-digit' 25075 }; 25076 var date = new Date().toLocaleString('en-US', { 25077 timeZone: this.timezone 25078 }); 25079 document.getElementById('local_time').innerHTML = date; 25080 }, 25081 addRoom: function addRoom(id, value, index) { 25082 var me = this.rooms; 25083 var _this$rooms$filter = this.rooms.filter(function (value) { 25084 return value.id === id; 25085 }), 25086 _this$rooms$filter2 = _slicedToArray(_this$rooms$filter, 1), 25087 selected_room = _this$rooms$filter2[0]; 25088 var count = 0; 25089 selected_room.allRooms[index].number_selected = parseInt(value);
25090 selected_room.allRooms.forEach(function (value) { 25091 count += parseInt(value.number_selected) > 0 ? parseInt(value.number_selected) : 0; 25092 }); 25093 selected_room.allRooms[index].selected = parseInt(value); 25094 selected_room.allRooms.forEach(function (value) { 25095 value.selected_count = count; 25096 }); 25097 var tempRooms = this.rooms.map(function (value) { 25098 if (value.id === id) return selected_room; 25099 return value; 25100 }); 25101 this.rooms = tempRooms; 25102 }, 25103 addTaxesToRecommendedRoom: function addTaxesToRecommendedRoom(recommended_rooms, taxes) { 25104 var _this = this; 25105 var guests = this.children + this.adults; 25106 var total_price = 0; 25107 var total_price_room = 0; 25108 this.r_tax_values = {}; 25109 this.r_taxes = []; 25110 var me = this; 25111 me.offerSaveRecommended = 0; 25112 var allRooms = []; 25113 for (var _i3 = 0, _Object$entries3 = Object.entries(recommended_rooms); _i3 < _Object$entries3.length; _i3++) { 25114 var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2), 25115 key = _Object$entries3$_i[0], 25116 recommended = _Object$entries3$_i[1]; 25117 for (var _i4 = 0, _Object$entries4 = Object.entries(recommended.allRooms); _i4 < _Object$entries4.length; _i4++) { 25118 var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2), 25119 _key2 = _Object$entries4$_i[0], 25120 room = _Object$entries4$_i[1]; 25121 allRooms.push(room); 25122 } 25123 } 25124 var r_rooms = allRooms.map(function (room) { 25125 var current_room_price = room.discount_price * room.number_selected; 25126 total_price += current_room_price; 25127 total_price_room += current_room_price; 25128 me.offerSaveRecommended += (room.price - room.discount_price) * room.number_selected; 25129 var tax = []; 25130 for (var taxKey in taxes) { 25131 if (taxes[taxKey].room == "all") { 25132 var tempTaxHolder = _toConsumableArray(me.recommended_rooms_taxes); 25133 var flag = tempTaxHolder.some(function (value) { 25134 return value.id === taxes[taxKey].id; 25135 }); 25136 if (!flag) { 25137 tempTaxHolder.push(taxes[taxKey]); 25138 me.recommended_rooms_taxes = tempTaxHolder; 25139 } 25140 if (!_this.r_taxes.includes(taxes[taxKey])) _this.r_taxes.push(taxes[taxKey]); 25141 tax.push(taxes[taxKey]); 25142 var extra_price = 0; 25143 if (taxes[taxKey].type == "percentage") { 25144 var value = parseFloat(taxes[taxKey].value); 25145 if (_this.r_tax_values[taxes[taxKey].id] === undefined) { 25146 _this.r_tax_values[taxes[taxKey].id] = current_room_price * value / 100; 25147 } else { 25148 _this.r_tax_values[taxes[taxKey].id] += current_room_price * value / 100; 25149 } 25150 extra_price = current_room_price * value / 100; 25151 } else { 25152 var value = parseFloat(taxes[taxKey].value); 25153 if (_this.r_tax_values[taxes[taxKey].id] === undefined) { 25154 _this.r_tax_values[taxes[taxKey].id] = value; 25155 } else { 25156 _this.r_tax_values[taxes[taxKey].id] += value; 25157 } 25158 extra_price = value; 25159 } 25160 total_price += extra_price; 25161 } else { 25162 var rooms = taxes[taxKey].room.split(','); 25163 for (var j = 0; j < rooms.length; j++) { 25164 if (room.id == rooms[j]) { 25165 if (!_this.r_taxes.includes(taxes[taxKey])) _this.r_taxes.push(taxes[taxKey]); 25166 tax.push(taxes[taxKey]); 25167 var extra_price = 0; 25168 if (taxes[taxKey].type == "percentage") { 25169 var value = parseFloat(taxes[taxKey].value); 25170 if (_this.r_tax_values[taxes[taxKey].id] === undefined) { 25171 _this.r_tax_values[taxes[taxKey].id] = current_room_price * value / 100; 25172 } else { 25173 _this.r_tax_values[taxes[taxKey].id] += current_room_price * value / 100; 25174 } 25175 extra_price = current_room_price * value / 100; 25176 } else { 25177 var value = parseFloat(taxes[taxKey].value); 25178 if (_this.r_tax_values[taxes[taxKey].id] === undefined) { 25179 _this.r_tax_values[taxes[taxKey].id] = value; 25180 } else { 25181 _this.r_tax_values[taxes[taxKey].id] += value; 25182 } 25183 extra_price = value; 25184 } 25185 total_price += extra_price; 25186 break; 25187 } 25188 } 25189 } 25190 } 25191 room.taxes = tax; 25192 return room; 25193 }); 25194 25195 // Calculating vendor commissions 25196 for (var ix in this.buyer_fees) { 25197 var item = this.buyer_fees[ix]; 25198 //for Fixed 25199 var fee_price = parseFloat(item.price); 25200 25201 //for Percent 25202 if (typeof item.unit !== "undefined" && item.unit === "percent") { 25203 fee_price = total_price_room / 100 * fee_price; 25204 } 25205 if (typeof item.per_person !== "undefined") { 25206 fee_price = fee_price * guests; 25207 } 25208 total_price += fee_price; 25209 } 25210 this.recommended_rooms_price = total_price; 25211 return recommended_rooms; 25212 },
25213 addTaxData: function addTaxData(id, title, price) { 25214 var tax = 0; 25215 for (var key in this.tax) { 25216 if (this.tax.hasOwnProperty(key)) { 25217 if (key !== "__number__") { 25218 var d = this.tax[key].room.split(","); 25219 for (var j = 0; j < d.length; j++) { 25220 if (d[j] == "all" || d[j] == id) { 25221 tax += this.addTax(this.tax[key], title, price); 25222 } 25223 } 25224 } 25225 } 25226 } 25227 return tax; 25228 }, 25229 sortRooms: function sortRooms(rooms) { 25230 var adults = parseInt(this.adults); 25231 // debugger 25232 var sortedRooms = rooms.sort(function (a, b) { 25233 var roomAdultsA = a.t_adults; 25234 var roomAdultsB = b.t_adults; 25235 return roomAdultsA - roomAdultsB; 25236 }); 25237 if (sortedRooms[sortedRooms.length - 1].t_adults <= adults) { 25238 return sortedRooms.reverse(); 25239 } 25240 var index = 0; 25241 sortedRooms.forEach(function (room, i) { 25242 if (room.t_adults === adults) { 25243 index = i; 25244 } 25245 }); 25246 var firstPart = sortedRooms.splice(0, index + 1).reverse(); 25247 return firstPart.concat(sortedRooms); 25248 }, 25249 addTax: function addTax(data, title, price) { 25250 var flag = true; 25251 for (var i = 0; i < this.taxes.length; i++) { 25252 if (this.taxes[i].id == data.id) { 25253 flag = false; 25254 break; 25255 } 25256 } 25257 if (flag) { 25258 this.taxes.push(data); 25259 } 25260 switch (data.type) { 25261 case "percentage": 25262 var tax = parseFloat(price) * (parseFloat(data.value) / 100); 25263 if (this.tax_values[data.id] != undefined || this.tax_values[data.id] != null) { 25264 this.tax_values[data.id] += tax; 25265 } else { 25266 this.tax_values[data.id] = tax; 25267 } 25268 return tax; 25269 case "fixed": 25270 var tax = parseFloat(data.value); 25271 if (this.tax_values[data.id] != undefined || this.tax_values[data.id] != null) { 25272 this.tax_values[data.id] += tax; 25273 } else { 25274 this.tax_values[data.id] = tax; 25275 } 25276 return tax; 25277 default: 25278 return 0; 25279 } 25280 } 25281 }, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_methods, "formatMoney", function formatMoney(m) { 25282 return window.bravo_format_money(m); 25283 }), "validate", function validate() { 25284 var isRecommended = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 25285 if (!this.start_date || !this.end_date) { 25286 this.message.status = false; 25287 this.message.content = bravo_booking_i18n.no_date_select; 25288 return false; 25289 } 25290 if (!this.guests) { 25291 this.message.status = false; 25292 this.message.content = bravo_booking_i18n.no_guest_select; 25293 return false; 25294 } 25295 if (!isRecommended) { 25296 var no_of_adults = 0; 25297 var no_of_children = 0; 25298 var no_of_room = 0; 25299 var rooms = []; 25300 this.rooms.forEach(function (room) { 25301 room.allRooms.forEach(function (value) { 25302 rooms.push(value); 25303 }); 25304 }); 25305 rooms.map(function (item) { 25306 if (item.number_selected > 0) { 25307 var a_count = (item.adults + item.extra_adults) * item.number_selected; 25308 var c_count = item.children * item.number_selected; 25309 no_of_adults += a_count; 25310 no_of_children += c_count; 25311 no_of_room++; 25312 } 25313 }); 25314 if (this.adults > no_of_adults || this.$children > no_of_children) { 25315 frescoApp.showAjaxMessage({ 25316 status: false, 25317 message: "".concat(no_of_room > 1 ? 'Rooms' : 'Room', " can't accommodate all guests. Select more rooms") 25318 }); 25319 return false; 25320 } 25321 } 25322 return true; 25323 }), "addPersonType", function addPersonType(type) { 25324 switch (type) { 25325 case "adults": 25326 this.tmp_adults++; 25327 break; 25328 case "children": 25329 this.tmp_children++; 25330 break; 25331 case "room": 25332 this.tmp_room++; 25333 break; 25334 } 25335 }), "minusPersonType", function minusPersonType(type) { 25336 switch (type) { 25337 case "adults": 25338 if (this.tmp_adults >= 2) { 25339 this.tmp_adults--; 25340 } 25341 break; 25342 case "children": 25343 if (this.tmp_children >= 1) { 25344 this.tmp_children--; 25345 } 25346 break; 25347 case "room": 25348 if (this.tmp_room >= 2) { 25349 this.tmp_room--; 25350 } 25351 break; 25352 } 25353 }
25353), "updatePersonFilter", function updatePersonFilter(type) { 25354 if (type == 'apply') { 25355 this.adults = this.tmp_adults; 25356 this.children = this.tmp_children; 25357 this.room = this.tmp_room; 25358 var element = document.getElementById("select-guests-dropdown"); 25359 element.classList.remove("show"); 25360 } else { 25361 this.tmp_adults = 1; 25362 this.tmp_children = 0; 25363 this.tmp_room = 1; 25364 } 25365 }), "checkAvailability", function checkAvailability() { 25366 var me = this; 25367 this.onLoadAvailability = true; 25368 me.load; 25369 if (!this.firstLoad) { 25370 if (!this.start_date || !this.end_date) { 25371 frescoApp.showError(this.i18n.date_required); 25372 } 25373 } 25374 var startDate = this.start_date; 25375 var endDate = this.end_date; 25376 this.total_days = moment(endDate).diff(moment(startDate), 'days'); 25377 this.firstLoad = false; 25378 this.onLoadAvailability = false; 25379 if (me.end_date != '' && me.start_date != '') { 25380 me.onLoadAvailability = true; 25381 me.rooms = []; 25382 me.recommended_rooms = []; 25383 var start_date = this.start_date; 25384 var end_date = this.end_date; 25385 $.ajax({ 25386 url: fresco.url + '/hotel/checkAvailability', 25387 data: { 25388 hotel_id: this.id, 25389 start_date: this.start_date, 25390 end_date: this.end_date, 25391 firstLoad: me.firstLoad, 25392 coupon: me.couponCode, 25393 adults: this.adults, 25394 children: this.children, 25395 room: this.room 25396 }, 25397 method: 'post', 25398 success: function success(json) { 25399 me.onLoadAvailability = false; 25400 me.firstLoad = false; 25401 if (!json.status) { 25402 me.couponError = json.message; 25403 return true; 25404 } 25405 var r = []; 25406 me.couponError = json.coupon_error; 25407 me.couponMaxAmount = json.coupon_max_amount; 25408 me.couponMinAmount = json.coupon_min_amount; 25409 me.couponValue = json.coupon_value; 25410 me.couponId = json.coupon_id; 25411 me.couponType = json.coupon_type; 25412 me.promotions = json.applied_promotions; 25413 me.booking_description = json.booking_description; 25414 me.startDate = start_date; 25415 me.endDate = end_date; 25416 if (json.coupon_value == 0) { 25417 me.offerSaveRecommended = 0; 25418 } 25419 if (me.end_date != '' && me.start_date != '') { 25420 me.recommended_rooms = me.addTaxesToRecommendedRoom(json.recommended_rooms, me.tax); 25421 } 25422 if (json.rooms) { 25423 me.rooms = json.rooms; 25424 } 25425 if (json.message) { 25426 frescoApp.showAjaxMessage(json); 25427 } 25428 $("body").tooltip({ 25429 selector: '[data-toggle=tooltip]' 25430 }); 25431 me.initTooltips(); 25432 }, 25433 error: function error(e) { 25434 me.firstLoad = false; 25435 frescoApp.showAjaxError(e); 25436 } 25437 }); 25438 } 25439 }), "doSubmit", function doSubmit(e) { 25440 e.preventDefault(); 25441 if (this.onSubmit) return false; 25442 if (!this.validate()) return false; 25443 this.onSubmit = true; 25444 var me = this; 25445 this.message.content = ''; 25446 if (this.step == 1) { 25447 this.html = ''; 25448 } 25449 var rooms = []; 25450 this.rooms.forEach(function (room) { 25451 room.allRooms.forEach(function (value) { 25452 rooms.push(value); 25453 }); 25454 }); 25455 var selected_rooms = _.map(rooms, function (item) { 25456 return _.pick(item, ['id', 'number_selected', 'adults', 'children', 's_adults', 't_adults', 't_children', 'extra_adults', 'extra_children', 'promotions', 'price', 'day_price_data']); 25457 }); 25458 $.ajax({ 25459 url: fresco.url + '/booking/addToCart', 25460 data: { 25461 service_id: this.id, 25462 service_type: "hotel", 25463 start_date: this.startDate, 25464 end_date: this.endDate, 25465 adults: this.adults, 25466 children: this.children, 25467 extra_price: this.extra_price, 25468 couponId: this.couponId, 25469 tax: this.taxes, 25470 tax_value: this.tax_values, 25471 rooms: selected_rooms, 25472 promotions: this.promotions, 25473 reference: this.reference 25474 }, 25475 dataType: 'json', 25476 type: 'post', 25477 success: function success(res) { 25478 if (!res.status) { 25479 me.onSubmit = false;
25480 } 25481 if (res.message) { 25482 frescoApp.showAjaxMessage(res); 25483 } 25484 if (res.step) { 25485 me.step = res.step; 25486 } 25487 if (res.html) { 25488 me.html = res.html; 25489 } 25490 if (res.url) { 25491 window.location.href = res.url; 25492 } 25493 if (res.errors && _typeof(res.errors) == 'object') { 25494 var html = ''; 25495 for (var i in res.errors) { 25496 html += res.errors[i] + '<br>'; 25497 } 25498 me.message.content = html; 25499 frescoApp.showError(html); 25500 } 25501 }, 25502 error: function error(e) { 25503 me.onSubmit = false; 25504 bravo_handle_error_response(e); 25505 if (e.status != 401 && e.responseJSON) { 25506 me.message.content = e.responseJSON.message ? e.responseJSON.message : 'Can not booking'; 25507 me.message.type = false; 25508 } 25509 } 25510 }); 25511 }), "doSubmit1", function doSubmit1(e) { 25512 if (this.onSubmit1) return false; 25513 if (!this.validate(true)) return false; 25514 this.onSubmit1 = true; 25515 var me = this; 25516 this.message.content = ''; 25517 if (this.step == 1) { 25518 this.html = ''; 25519 } 25520 var allRooms = []; 25521 for (var _i5 = 0, _Object$entries5 = Object.entries(this.recommended_rooms); _i5 < _Object$entries5.length; _i5++) { 25522 var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2), 25523 key = _Object$entries5$_i[0], 25524 recommended = _Object$entries5$_i[1]; 25525 for (var _i6 = 0, _Object$entries6 = Object.entries(recommended.allRooms); _i6 < _Object$entries6.length; _i6++) { 25526 var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2), 25527 _key3 = _Object$entries6$_i[0], 25528 room = _Object$entries6$_i[1]; 25529 allRooms.push(room); 25530 } 25531 } 25532 var selected_rooms = _.map(allRooms, function (item) { 25533 return _.pick(item, ['id', 'number_selected', 's_adults', 'adults', 'children', 't_adults', 't_children', 'extra_adults', 'extra_children', 'promotions', 'price', 'day_price_data']); 25534 }); 25535 $.ajax({ 25536 url: fresco.url + '/booking/addToCart', 25537 data: { 25538 service_id: this.id, 25539 service_type: "hotel", 25540 start_date: this.startDate, 25541 end_date: this.endDate, 25542 adults: this.adults, 25543 children: this.children, 25544 extra_price: this.extra_price_recommended, 25545 couponId: this.couponId, 25546 tax: this.r_taxes, 25547 tax_value: this.r_tax_values, 25548 rooms: selected_rooms, 25549 promotions: this.promotions, 25550 reference: this.reference 25551 }, 25552 dataType: 'json', 25553 type: 'post', 25554 success: function success(res) { 25555 if (!res.status) { 25556 me.onSubmit1 = false; 25557 } 25558 if (res.message) { 25559 frescoApp.showAjaxMessage(res); 25560 } 25561 if (res.step) { 25562 me.step = res.step; 25563 } 25564 if (res.html) { 25565 me.html = res.html; 25566 } 25567 if (res.url) { 25568 window.location.href = res.url; 25569 } 25570 if (res.errors && _typeof(res.errors) == 'object') { 25571 var html = ''; 25572 for (var i in res.errors) { 25573 html += res.errors[i] + '<br>'; 25574 } 25575 me.message.content = html; 25576 frescoApp.showError(html); 25577 } 25578 }, 25579 error: function error(e) { 25580 me.onSubmit1 = false; 25581 bravo_handle_error_response(e); 25582 if (e.status != 401 && e.responseJSON) { 25583 me.message.content = e.responseJSON.message ? e.responseJSON.message : 'Can not booking'; 25584 me.message.type = false;
25585 } 25586 } 25587 }); 25588 }), "doEnquirySubmit", function doEnquirySubmit(e) { 25589 e.preventDefault(); 25590 if (this.onSubmit) return false; 25591 if (!this.validateenquiry()) return false; 25592 this.onSubmit = true; 25593 var me = this; 25594 this.message.content = ''; 25595 $.ajax({ 25596 url: fresco.url + '/booking/addEnquiry', 25597 data: { 25598 service_id: this.id, 25599 service_type: 'hotel', 25600 name: this.enquiry_name, 25601 email: this.enquiry_email, 25602 phone: this.enquiry_phone, 25603 note: this.enquiry_note 25604 }, 25605 dataType: 'json', 25606 type: 'post', 25607 success: function success(res) { 25608 if (res.message) { 25609 me.message.content = res.message; 25610 me.message.type = res.status; 25611 } 25612 if (res.errors && _typeof(res.errors) == 'object') { 25613 var html = ''; 25614 for (var i in res.errors) { 25615 html += res.errors[i] + '<br>'; 25616 } 25617 me.message.content = html; 25618 } 25619 if (res.status) { 25620 me.enquiry_is_submit = true; 25621 me.enquiry_name = ""; 25622 me.enquiry_email = ""; 25623 me.enquiry_phone = ""; 25624 me.enquiry_note = ""; 25625 } 25626 me.onSubmit = false; 25627 }, 25628 error: function error(e) { 25629 me.onSubmit = false; 25630 bravo_handle_error_response(e); 25631 if (e.status == 401) { 25632 $('.bravo_single_book_wrap').modal('hide'); 25633 } 25634 if (e.status != 401 && e.responseJSON) { 25635 me.message.content = e.responseJSON.message ? e.responseJSON.message : 'Can not booking'; 25636 me.message.type = false;
25637 } 25638 } 25639 }); 25640 }), "validateenquiry", function validateenquiry() { 25641 if (!this.enquiry_name) { 25642 this.message.status = false; 25643 this.message.content = bravo_booking_i18n.name_required; 25644 return false; 25645 } 25646 if (!this.enquiry_email) { 25647 this.message.status = false; 25648 this.message.content = bravo_booking_i18n.email_required; 25649 return false; 25650 } 25651 return true; 25652 }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_methods, "openStartDate", function openStartDate() {}), "initJs", function initJs() { 25653 // $('.fotorama').fotorama(); 25654 }), "showGallery", function showGallery(e, id, gallery) { 25655 if (gallery !== null) { 25656 var p = $(e.target).closest('.row'); 25657 $('#modal_room_' + id).modal().modal('show'); 25658 p.find('.fotorama').each(function () { 25659 $(this).fotorama(); 25660 }); 25661 } 25662 }), "initializeCarousel", function initializeCarousel() { 25663 $('.near-by-location .owl-carousel').each(function () { 25664 $(this).owlCarousel({ 25665 items: 4, 25666 width: 70, 25667 margin: 15, 25668 dots: false, 25669 autoplay: false, 25670 loop: false, 25671 nav: true 25672 }); 25673 $(this).find('.owl-nav').remove(); 25674 $(this).find('.owl-dots').remove(); 25675 var buttons = $(this).find('.owl-nav button'); 25676 $(buttons[0]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M8.86318 17.726C9.12659 17.7261 9.38411 17.6481 9.60315 17.5018C9.82219 17.3555 9.99289 17.1475 10.0936 16.9041C10.1944 16.6607 10.2207 16.3929 10.1691 16.1346C10.1176 15.8763 9.9906 15.6391 9.80418 15.453L3.21418 8.86298L9.80418 2.27298C9.92782 2.14934 10.0259 2.00256 10.0928 1.84102C10.1597 1.67948 10.1942 1.50633 10.1942 1.33148C10.1942 1.15663 10.1597 0.983489 10.0928 0.821946C10.0259 0.660403 9.92782 0.513621 9.80418 0.389982C9.68054 0.266342 9.53376 0.168266 9.37222 0.101353C9.21068 0.0344395 9.03753 -1.30275e-09 8.86268 0C8.68783 1.30276e-09 8.51469 0.0344395 8.35315 0.101353C8.1916 0.168266 8.04482 0.266342 7.92118 0.389982L0.390182 7.92198C0.266485 8.04559 0.168358 8.19236 0.101409 8.35391C0.0344596 8.51545 0 8.68861 0 8.86348C0 9.03835 0.0344596 9.21151 0.101409 9.37306C0.168358 9.5346 0.266485 9.68137 0.390182 9.8
256760498L7.92218 17.337C8.17189 17.5862 8.51035 17.7262 8.86318 17.726Z\" fill=\"#000\"/></svg>"); 25677 $(buttons[1]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M1.33025 17.7259C1.06766 17.7252 0.811138 17.6469 0.592956 17.5008C0.374773 17.3547 0.204683 17.1473 0.104091 16.9048C0.00349842 16.6622 -0.023101 16.3953 0.0276403 16.1377C0.0783817 15.8801 0.204196 15.6432 0.38925 15.4569L6.97925 8.86689L0.38925 2.27689C0.26561 2.15325 0.167534 2.00647 0.100621 1.84492C0.033708 1.68338 -0.000732421 1.51024 -0.000732422 1.33539C-0.000732423 1.16054 0.033708 0.987395 0.100621 0.825852C0.167534 0.66431 0.26561 0.517528 0.38925 0.393888C0.512889 0.270249 0.659671 0.172173 0.821214 0.105259C0.982757 0.0383462 1.1559 0.00390625 1.33075 0.00390625C1.5056 0.00390625 1.67874 0.0383462 1.84029 0.105259C2.00183 0.172173 2.14861 0.270249 2.27225 0.393888L9.80425 7.92589C9.92795 8.0495 10.0261 8.19627 10.093 8.35781C10.16 8.51936 10.1944 8.69252 10.1944 8.86739C10.1944 9.04226 10.16 9.21542 10.093 9.37696C10.0261 9.53851 9.92795 9.68528 9.80425 9.80889L2.27225 17.3409C2.0227 17.5905 1.68422 17.7308 1.33125 17.7309L1.33025 17.7259Z\" fill=\"#000\"/></svg>"); 25678 }); 25679 $(".review_slider").each(function () { 25680 $(this).find(".owl-carousel").owlCarousel({ 25681 items: 1, 25682 margin: 15, 25683 loop: false, 25684 dots: false, 25685 nav: true, 25686 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 25687 }); 25688 }); 25689 $('.gallery-hotel-page .owl-carousel').each(function () { 25690 $(this).owlCarousel({ 25691 items: 1, 25692 margin: 15, 25693 dots: false, 25694 autoplay: false, 25695 loop: false, 25696 nav: true 25697 }); 25698 var buttons = $(this).find('.owl-nav button'); 25699 $(buttons[0]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M8.86318 17.726C9.12659 17.7261 9.38411 17.6481 9.60315 17.5018C9.82219 17.3555 9.99289 17.1475 10.0936 16.9041C10.1944 16.6607 10.2207 16.3929 10.1691 16.1346C10.1176 15.8763 9.9906 15.6391 9.80418 15.453L3.21418 8.86298L9.80418 2.27298C9.92782 2.14934 10.0259 2.00256 10.0928 1.84102C10.1597 1.67948 10.1942 1.50633 10.1942 1.33148C10.1942 1.15663 10.1597 0.983489 10.0928 0.821946C10.0259 0.660403 9.92782 0.513621 9.80418 0.389982C9.68054 0.266342 9.53376 0.168266 9.37222 0.101353C9.21068 0.0344395 9.03753 -1.30275e-09 8.86268 0C8.68783 1.30276e-09 8.51469 0.0344395 8.35315 0.101353C8.1916 0.168266 8.04482 0.266342 7.92118 0.389982L0.390182 7.92198C0.266485 8.04559 0.168358 8.19236 0.101409 8.35391C0.0344596 8.51545 0 8.68861 0 8.86348C0 9.03835 0.0344596 9.21151 0.101409 9.37306C0.168358 9.5346 0.266485 9.68137 0.390182 9.8
256990498L7.92218 17.337C8.17189 17.5862 8.51035 17.7262 8.86318 17.726Z\" fill=\"#000\"/></svg>"); 25700 $(buttons[1]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M1.33025 17.7259C1.06766 17.7252 0.811138 17.6469 0.592956 17.5008C0.374773 17.3547 0.204683 17.1473 0.104091 16.9048C0.00349842 16.6622 -0.023101 16.3953 0.0276403 16.1377C0.0783817 15.8801 0.204196 15.6432 0.38925 15.4569L6.97925 8.86689L0.38925 2.27689C0.26561 2.15325 0.167534 2.00647 0.100621 1.84492C0.033708 1.68338 -0.000732421 1.51024 -0.000732422 1.33539C-0.000732423 1.16054 0.033708 0.987395 0.100621 0.825852C0.167534 0.66431 0.26561 0.517528 0.38925 0.393888C0.512889 0.270249 0.659671 0.172173 0.821214 0.105259C0.982757 0.0383462 1.1559 0.00390625 1.33075 0.00390625C1.5056 0.00390625 1.67874 0.0383462 1.84029 0.105259C2.00183 0.172173 2.14861 0.270249 2.27225 0.393888L9.80425 7.92589C9.92795 8.0495 10.0261 8.19627 10.093 8.35781C10.16 8.51936 10.1944 8.69252 10.1944 8.86739C10.1944 9.04226 10.16 9.21542 10.093 9.37696C10.0261 9.53851 9.92795 9.68528 9.80425 9.80889L2.27225 17.3409C2.0227 17.5905 1.68422 17.7308 1.33125 17.7309L1.33025 17.7259Z\" fill=\"#000\"/></svg>"); 25701 }); 25702 $('.recommended-room-carousel-container .owl-carousel').each(function () { 25703 $(this).owlCarousel({ 25704 items: 1, 25705 margin: 15, 25706 dots: false, 25707 autoplay: false, 25708 loop: false, 25709 nav: true 25710 }); 25711 var buttons = $(this).find('.owl-nav button'); 25712 $(buttons[0]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M8.86318 17.726C9.12659 17.7261 9.38411 17.6481 9.60315 17.5018C9.82219 17.3555 9.99289 17.1475 10.0936 16.9041C10.1944 16.6607 10.2207 16.3929 10.1691 16.1346C10.1176 15.8763 9.9906 15.6391 9.80418 15.453L3.21418 8.86298L9.80418 2.27298C9.92782 2.14934 10.0259 2.00256 10.0928 1.84102C10.1597 1.67948 10.1942 1.50633 10.1942 1.33148C10.1942 1.15663 10.1597 0.983489 10.0928 0.821946C10.0259 0.660403 9.92782 0.513621 9.80418 0.389982C9.68054 0.266342 9.53376 0.168266 9.37222 0.101353C9.21068 0.0344395 9.03753 -1.30275e-09 8.86268 0C8.68783 1.30276e-09 8.51469 0.0344395 8.35315 0.101353C8.1916 0.168266 8.04482 0.266342 7.92118 0.389982L0.390182 7.92198C0.266485 8.04559 0.168358 8.19236 0.101409 8.35391C0.0344596 8.51545 0 8.68861 0 8.86348C0 9.03835 0.0344596 9.21151 0.101409 9.37306C0.168358 9.5346 0.266485 9.68137 0.390182 9.8
257120498L7.92218 17.337C8.17189 17.5862 8.51035 17.7262 8.86318 17.726Z\" fill=\"#000\"/></svg>"); 25713 $(buttons[1]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M1.33025 17.7259C1.06766 17.7252 0.811138 17.6469 0.592956 17.5008C0.374773 17.3547 0.204683 17.1473 0.104091 16.9048C0.00349842 16.6622 -0.023101 16.3953 0.0276403 16.1377C0.0783817 15.8801 0.204196 15.6432 0.38925 15.4569L6.97925 8.86689L0.38925 2.27689C0.26561 2.15325 0.167534 2.00647 0.100621 1.84492C0.033708 1.68338 -0.000732421 1.51024 -0.000732422 1.33539C-0.000732423 1.16054 0.033708 0.987395 0.100621 0.825852C0.167534 0.66431 0.26561 0.517528 0.38925 0.393888C0.512889 0.270249 0.659671 0.172173 0.821214 0.105259C0.982757 0.0383462 1.1559 0.00390625 1.33075 0.00390625C1.5056 0.00390625 1.67874 0.0383462 1.84029 0.105259C2.00183 0.172173 2.14861 0.270249 2.27225 0.393888L9.80425 7.92589C9.92795 8.0495 10.0261 8.19627 10.093 8.35781C10.16 8.51936 10.1944 8.69252 10.1944 8.86739C10.1944 9.04226 10.16 9.21542 10.093 9.37696C10.0261 9.53851 9.92795 9.68528 9.80425 9.80889L2.27225 17.3409C2.0227 17.5905 1.68422 17.7308 1.33125 17.7309L1.33025 17.7259Z\" fill=\"#000\"/></svg>"); 25714 }); 25715 $('.available-rooms-carousel-container .owl-carousel').each(function () { 25716 $(this).owlCarousel({ 25717 items: 1, 25718 margin: 15, 25719 dots: false, 25720 autoplay: false, 25721 loop: false, 25722 nav: true 25723 }); 25724 var buttons = $(this).find('.owl-nav button'); 25725 $(buttons[0]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M8.86318 17.726C9.12659 17.7261 9.38411 17.6481 9.60315 17.5018C9.82219 17.3555 9.99289 17.1475 10.0936 16.9041C10.1944 16.6607 10.2207 16.3929 10.1691 16.1346C10.1176 15.8763 9.9906 15.6391 9.80418 15.453L3.21418 8.86298L9.80418 2.27298C9.92782 2.14934 10.0259 2.00256 10.0928 1.84102C10.1597 1.67948 10.1942 1.50633 10.1942 1.33148C10.1942 1.15663 10.1597 0.983489 10.0928 0.821946C10.0259 0.660403 9.92782 0.513621 9.80418 0.389982C9.68054 0.266342 9.53376 0.168266 9.37222 0.101353C9.21068 0.0344395 9.03753 -1.30275e-09 8.86268 0C8.68783 1.30276e-09 8.51469 0.0344395 8.35315 0.101353C8.1916 0.168266 8.04482 0.266342 7.92118 0.389982L0.390182 7.92198C0.266485 8.04559 0.168358 8.19236 0.101409 8.35391C0.0344596 8.51545 0 8.68861 0 8.86348C0 9.03835 0.0344596 9.21151 0.101409 9.37306C0.168358 9.5346 0.266485 9.68137 0.390182 9.8
257250498L7.92218 17.337C8.17189 17.5862 8.51035 17.7262 8.86318 17.726Z\" fill=\"#000\"/></svg>"); 25726 $(buttons[1]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M1.33025 17.7259C1.06766 17.7252 0.811138 17.6469 0.592956 17.5008C0.374773 17.3547 0.204683 17.1473 0.104091 16.9048C0.00349842 16.6622 -0.023101 16.3953 0.0276403 16.1377C0.0783817 15.8801 0.204196 15.6432 0.38925 15.4569L6.97925 8.86689L0.38925 2.27689C0.26561 2.15325 0.167534 2.00647 0.100621 1.84492C0.033708 1.68338 -0.000732421 1.51024 -0.000732422 1.33539C-0.000732423 1.16054 0.033708 0.987395 0.100621 0.825852C0.167534 0.66431 0.26561 0.517528 0.38925 0.393888C0.512889 0.270249 0.659671 0.172173 0.821214 0.105259C0.982757 0.0383462 1.1559 0.00390625 1.33075 0.00390625C1.5056 0.00390625 1.67874 0.0383462 1.84029 0.105259C2.00183 0.172173 2.14861 0.270249 2.27225 0.393888L9.80425 7.92589C9.92795 8.0495 10.0261 8.19627 10.093 8.35781C10.16 8.51936 10.1944 8.69252 10.1944 8.86739C10.1944 9.04226 10.16 9.21542 10.093 9.37696C10.0261 9.53851 9.92795 9.68528 9.80425 9.80889L2.27225 17.3409C2.0227 17.5905 1.68422 17.7308 1.33125 17.7309L1.33025 17.7259Z\" fill=\"#000\"/></svg>"); 25727 }); 25728 $('.main-image-carousel .owl-carousel').each(function () { 25729 $(this).owlCarousel({ 25730 items: 1, 25731 margin: 15, 25732 dots: false, 25733 autoplay: false, 25734 loop: false, 25735 nav: true 25736 }); 25737 var buttons = $(this).find('.owl-nav button'); 25738 $(buttons[0]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M8.86318 17.726C9.12659 17.7261 9.38411 17.6481 9.60315 17.5018C9.82219 17.3555 9.99289 17.1475 10.0936 16.9041C10.1944 16.6607 10.2207 16.3929 10.1691 16.1346C10.1176 15.8763 9.9906 15.6391 9.80418 15.453L3.21418 8.86298L9.80418 2.27298C9.92782 2.14934 10.0259 2.00256 10.0928 1.84102C10.1597 1.67948 10.1942 1.50633 10.1942 1.33148C10.1942 1.15663 10.1597 0.983489 10.0928 0.821946C10.0259 0.660403 9.92782 0.513621 9.80418 0.389982C9.68054 0.266342 9.53376 0.168266 9.37222 0.101353C9.21068 0.0344395 9.03753 -1.30275e-09 8.86268 0C8.68783 1.30276e-09 8.51469 0.0344395 8.35315 0.101353C8.1916 0.168266 8.04482 0.266342 7.92118 0.389982L0.390182 7.92198C0.266485 8.04559 0.168358 8.19236 0.101409 8.35391C0.0344596 8.51545 0 8.68861 0 8.86348C0 9.03835 0.0344596 9.21151 0.101409 9.37306C0.168358 9.5346 0.266485 9.68137 0.390182 9.8
257380498L7.92218 17.337C8.17189 17.5862 8.51035 17.7262 8.86318 17.726Z\" fill=\"#000\"/></svg>"); 25739 $(buttons[1]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M1.33025 17.7259C1.06766 17.7252 0.811138 17.6469 0.592956 17.5008C0.374773 17.3547 0.204683 17.1473 0.104091 16.9048C0.00349842 16.6622 -0.023101 16.3953 0.0276403 16.1377C0.0783817 15.8801 0.204196 15.6432 0.38925 15.4569L6.97925 8.86689L0.38925 2.27689C0.26561 2.15325 0.167534 2.00647 0.100621 1.84492C0.033708 1.68338 -0.000732421 1.51024 -0.000732422 1.33539C-0.000732423 1.16054 0.033708 0.987395 0.100621 0.825852C0.167534 0.66431 0.26561 0.517528 0.38925 0.393888C0.512889 0.270249 0.659671 0.172173 0.821214 0.105259C0.982757 0.0383462 1.1559 0.00390625 1.33075 0.00390625C1.5056 0.00390625 1.67874 0.0383462 1.84029 0.105259C2.00183 0.172173 2.14861 0.270249 2.27225 0.393888L9.80425 7.92589C9.92795 8.0495 10.0261 8.19627 10.093 8.35781C10.16 8.51936 10.1944 8.69252 10.1944 8.86739C10.1944 9.04226 10.16 9.21542 10.093 9.37696C10.0261 9.53851 9.92795 9.68528 9.80425 9.80889L2.27225 17.3409C2.0227 17.5905 1.68422 17.7308 1.33125 17.7309L1.33025 17.7259Z\" fill=\"#000\"/></svg>"); 25740 }); 25741 }), "changeSelectBoxSize", function changeSelectBoxSize() { 25742 var width = $('.hotel-rooms .desktop-room-item .dropdown>button').outerWidth(); 25743 var select = $('.hotel-rooms .desktop-room-item .dropdown-menu').css('minWidth', width + 'px'); 25744 var width = $('.hotel-rooms .room-item-mobile-d .dropdown>button').outerWidth(); 25745 var select = $('.hotel-rooms .room-item-mobile-d .dropdown-menu').css('minWidth', width + 'px'); 25746 }), "getLinkHeights", function getLinkHeights() { 25747 this.linkHeights.availableRooms = { 25748 top: $('#available-room-scroll-top').offset().top - 90, 25749 bottom: $('#available-room-scroll-bottom').offset().top - 122 25750 }; 25751 this.linkHeights.description = { 25752 top: $('#description-scroll-top').offset().top - 120, 25753 bottom: $('#description-scroll-bottom').offset().top - 122 25754 }; 25755 this.linkHeights.facilities = { 25756 top: $('#facilities-scroll-top').offset().top - 120, 25757 bottom: $('#facilities-scroll-bottom').offset().top - 122 25758 }; 25759 this.linkHeights.attractions = { 25760 top: $('#attractions-scroll-top').offset().top - 120, 25761 bottom: $('#attractions-scroll-bottom').offset().top - 122 25762 }; 25763 this.linkHeights.location = { 25764 top: $('#location-scroll-top').offset().top - 120, 25765 bottom: $('#location-scroll-bottom').offset().top - 122 25766 }; 25767 this.linkHeights.reviews = { 25768 top: $('#reviews-scroll-top').offset().top - 120, 25769 bottom: $('#reviews-scroll-bottom').offset().top - 122 25770 }; 25771 this.linkHeights.rules = { 25772 top: $('#rules-scroll-top').offset().top - 120, 25773 bottom: $('#rules-scroll-bottom').offset().top - 122 25774 }; 25775 }), "isInViewport", function isInViewport(selector) { 25776 var elementTop = $(selector).offset().top; 25777 var elementBottom = elementTop + $(selector).outerHeight(); 25778 var viewportTop = $(window).scrollTop(); 25779 var viewportBottom = viewportTop + $(window).height(); 25780 return elementBottom > viewportTop && elementTop < viewportBottom; 25781 }), "setStickyPopUpPrice", function setStickyPopUpPrice() { 25782 var isInViewport = this.isInViewport('.desc-prop'); 25783 var window_height = $(window).height(); 25784 var windowTop = $(window).scrollTop(); 25785 var stickyTop = $('.desc-prop').offset().top; 25786 var availableOffset = $('.available-rooms-header').offset().top - 250; 25787 if (!isInViewport && windowTop >= availableOffset && stickyTop > windowTop) { 25788 $(document).find(".save_info").addClass("sticky"); 25789 setTimeout(function () { 25790 $(document).find(".save_info").addClass("active"); 25791 }, 100); 25792 } else { 25793 $(document).find(".save_info").removeClass("sticky"); 25794 setTimeout(function () { 25795 $(document).find(".save_info").removeClass("active"); 25796 }, 100); 25797 } 25798 }), "setHeaderPosition", function setHeaderPosition() { 25799 var topHeader = $('#main-header-top').offset().top;
25800 var end_sticky = $('#main-header-bottom').offset().top; 25801 var currentScroll = $(window).scrollTop(); 25802 var stickyWidth = $('.end_room_sticky').width(); 25803 var isMobile = $(window).width() < 768; 25804 if (currentScroll >= topHeader && currentScroll <= end_sticky) { 25805 $('#navigator-hotel').css({ 25806 position: 'fixed', 25807 top: '0', 25808 zIndex: 1000, 25809 width: stickyWidth + 'px', 25810 padding: isMobile ? '0 18px' : '0 50px', 25811 borderBottom: '1' + 'px solid #e1e1e1' 25812 }); 25813 } else { 25814 $('#navigator-hotel').css({ 25815 position: 'static', 25816 width: 'auto', 25817 padding: '0', 25818 border: '0' 25819 }); 25820 } 25821 }), "tableHeader", function tableHeader() { 25822 try { 25823 var fixmeTop = $('#desktop-room-items').offset().top; 25824 var currentScroll = $(window).scrollTop(); 25825 var table_width_1 = $('#available-room-scroll-top').width(); 25826 if (currentScroll >= fixmeTop && currentScroll <= fixmeTop + this.table_height - 80) { 25827 $('.desktop-secondary-header').css({ 25828 position: 'fixed', 25829 top: '52px', 25830 borderTop: '1px solid #e6e6e6', 25831 width: table_width_1 + 'px' 25832 }); 25833 } else { 25834 $('.desktop-secondary-header').css({ 25835 position: 'static', 25836 width: 'auto' 25837 }); 25838 } 25839 } catch (_unused) { 25840 // console.log("FIX ME TOP NOT RENDERED"); 25841 } 25842 }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_methods, "setLinkOnScroll", function setLinkOnScroll() { 25843 var currentScroll = $(window).scrollTop() + 30; 25844 if (currentScroll >= this.linkHeights.availableRooms.top && currentScroll < this.linkHeights.availableRooms.bottom) { 25845 var activeElement = $('#navigator-hotel').find('li[data-toggle="availableRooms"]'); 25846 if (!$(activeElement).hasClass('active')) { 25847 $('#navigator-hotel li').removeClass('active'); 25848 $(activeElement).addClass('active'); 25849 } 25850 } else if (currentScroll >= this.linkHeights.description.top && currentScroll < this.linkHeights.description.bottom) { 25851 var activeElement = $('#navigator-hotel').find('li[data-toggle="description"]'); 25852 if (!$(activeElement).hasClass('active')) { 25853 $('#navigator-hotel li').removeClass('active'); 25854 $(activeElement).addClass('active'); 25855 } 25856 } else if (currentScroll >= this.linkHeights.facilities.top && currentScroll < this.linkHeights.facilities.bottom) { 25857 var activeElement = $('#navigator-hotel').find('li[data-toggle="facilities"]'); 25858 if (!$(activeElement).hasClass('active')) { 25859 $('#navigator-hotel li').removeClass('active'); 25860 $(activeElement).addClass('active'); 25861 } 25862 } else if (currentScroll >= this.linkHeights.rules.top && currentScroll < this.linkHeights.rules.bottom) { 25863 var activeElement = $('#navigator-hotel').find('li[data-toggle="rules"]'); 25864 if (!$(activeElement).hasClass('active')) { 25865 $('#navigator-hotel li').removeClass('active'); 25866 $(activeElement).addClass('active'); 25867 } 25868 } else if (currentScroll >= this.linkHeights.attractions.top && currentScroll < this.linkHeights.attractions.bottom) { 25869 var activeElement = $('#navigator-hotel').find('li[data-toggle="attractions"]'); 25870 if (!$(activeElement).hasClass('active')) { 25871 $('#navigator-hotel li').removeClass('active'); 25872 $(activeElement).addClass('active'); 25873 } 25874 } else if (currentScroll >= this.linkHeights.reviews.top && currentScroll < this.linkHeights.reviews.bottom) { 25875 var activeElement = $('#navigator-hotel').find('li[data-toggle="reviews"]'); 25876 if (!$(activeElement).hasClass('active')) { 25877 $('#navigator-hotel li').removeClass('active'); 25878 $(activeElement).addClass('active'); 25879 } 25880 } else if (currentScroll >= this.linkHeights.location.top && currentScroll < this.linkHeights.location.bottom) { 25881 var activeElement = $('#navigator-hotel').find('li[data-toggle="location"]'); 25882 if (!$(activeElement).hasClass('active')) { 25883 $('#navigator-hotel li').removeClass('active'); 25884 $(activeElement).addClass('active'); 25885 } 25886 } else { 25887 $('#navigator-hotel li').removeClass('active'); 25888 } 25889 }), "created", function created() { 25890 var _this2 = this; 25891 for (var k in this.bravo_booking_data) { 25892 this[k] = this.bravo_booking_data[k]; 25893 } 25894 this.extra_price.map(function (v) { 25895 return _this2.extra_price_recommended.push(_objectSpread({}, v)); 25896 }); 25897 this.start_date = $('#start_date_from_backend').val(); 25898 this.end_date = $('#end_date_from_backend').val(); 25899 if (this.start_date == this.end_date) { 25900 var endDate = moment(this.end_date, fresco.date_format).add(1, 'days').format(fresco.date_format); 25901 this.end_date = endDate; 25902 $('#end_date_from_backend').val(endDate); 25903 } 25904 this.checkAvailability(); 25905 }), "loadFunctions", function loadFunctions() { 25906 this.created(); 25907 var self = this; 25908 $(document).ready(function () { 25909 var template = '<div class="daterangepicker">' + '<div class="ranges"></div>' + '<div class="drp-calendar left">' + '<div class="calendar-table"></div>' + '<div class="calendar-time"></div>' + '</div>' + '<div class="drp-calendar right">' + '<div class="calendar-table"></div>' + '<div class="calendar-time"></div>' + '</div>' + '<div class="drp-buttons d-block text-center">' + '<span class="drp-selected"></span>' + '<span class="drp-days"></span>' + '</div>' + '</div>'; 25910 var isMobile = $(window).width() < 768; 25911 var options = { 25912 showCalendar: false, 25913 sameDate: true, 25914 autoApply: true, 25915 disabledPast: true, 25916 dateFormat: fresco.date_format, 25917 enableLoading: true, 25918 showEventTooltip: true, 25919 classNotAvailable: ['disabled', 'off'], 25920 disableHightLight: true, 25921 minDate: this.minDate, 25922 opens: isMobile ? 'center' : 'left', 25923 template: template, 25924 locale: { 25925 format: "dddd, DD MMMM YYYY", 25926 direction: fresco.rtl ? 'rtl' : 'ltr', 25927 firstDay: daterangepickerLocale.first_day_of_week 25928 } 25929 }; 25930 if ((typeof daterangepickerLocale === "undefined" ? "undefined" : _typeof(daterangepickerLocale)) == 'object') { 25931 options.locale = _.merge(daterangepickerLocale, options.locale); 25932 } 25933 var daterangepicker_format = fresco.date_format; 25934 var startDate = moment(self.start_date, fresco.date_format); 25935 var endDate = moment(self.end_date, fresco.date_format); 25936 if (self.start_date == self.end_date) { 25937 endDate = endDate.add(1, 'days'); 25938 self.end_date = endDate.format(fresco.date_format); 25939 } 25940 options.startDate = new Date(startDate); 25941 options.endDate = new Date(endDate); 25942 self.start_date_html1 = startDate.format(fresco.date_format); 25943 self.start_date_html = startDate.format(fresco.date_format) + ' - ' + endDate.format(fresco.date_format); 25944 self.end_date_html = endDate.format(fresco.date_format); 25945 $('.start_date').daterangepicker(options); 25946 $('.start_date').on('apply.daterangepicker', function (ev, picker) { 25947 if (picker.endDate.diff(picker.startDate, 'day') <= 0) { 25948 picker.endDate.add(1, 'day'); 25949 } 25950 self.start_date = picker.startDate.format(fresco.date_format); 25951 self.end_date = picker.endDate.format(fresco.date_format); 25952 self.start_date_html = picker.startDate.format(fresco.date_format) + ' - ' + picker.endDate.format(fresco.date_format); 25953 self.start_date_html1 = picker.startDate.format(fresco.date_format); 25954 self.end_date_html = picker.endDate.format(fresco.date_format); 25955 // self.handleTotalPrice(); 25956 self.datePickerShown = false;
25957 }); 25958 $('.start_date').on('hide.daterangepicker', function (ev, picker) { 25959 setTimeout(function () { 25960 self.datePickerShown = false; 25961 }, 500); 25962 }); 25963 $('.start_date').on('click', function (event) { 25964 event.preventDefault(); 25965 event.stopPropagation(); 25966 }); 25967 $('.form-date-search').click(function (event) { 25968 event.preventDefault(); 25969 event.stopPropagation(); 25970 var parent = $(this); 25971 var datepicker = $('.start_date', parent).data('daterangepicker'); 25972 if (self.datePickerShown) { 25973 datepicker.hide(); 25974 } else { 25975 datepicker.show(); 25976 } 25977 self.datePickerShown = !self.datePickerShown; 25978 }); 25979 }); 25980 }), "initMap", function initMap() { 25981 var constantMarkerLat = parseFloat(this.map_lat); 25982 var constantMarkerLng = parseFloat(this.map_lng); 25983 if (typeof BravoMapEngine == 'undefined') { 25984 return false; 25985 } 25986 var singleHotelMap = new BravoMapEngine('map_content', { 25987 disableScripts: true, 25988 fitBounds: true, 25989 center: [constantMarkerLat, constantMarkerLng], 25990 zoom: this.map_zoom 25991 }); 25992 var hotelMarker = { 25993 lat: constantMarkerLat, 25994 lng: constantMarkerLng, 25995 icon: fresco.url + '/images/map.png', 25996 placeName: this.map_data.title, 25997 infobox: "<div><div class=\"p-2\"><div class=\"font-weight-bold mt-1\" style=\"min-height: 20px;font-size:14px;overflow: hidden\">" + this.map_data.title + "</div><div>" + this.map_data.address + "</div></div><div class=\"pl-2 view-link\"> <a target=\"_blank\" href=\"https://maps.google.com/maps?ll=" + constantMarkerLat + "," + constantMarkerLng + "&z=17\"> <span> View on Google Maps </span> </a> </div></div>" 25998 }; 25999 singleHotelMap.addMarker3(hotelMarker, true); 26000 }), "validateReviewFields", function validateReviewFields() { 26001 var form = $('#review-form'); 26002 form.find('.error').hide(); 26003 var result = true; 26004 var input_value = form.find('input[name=review_rate]').val(); 26005 if (input_value == "" || input_value == undefined) { 26006 form.find('.error-review_rate').show().text('This field is required'); 26007 result = false;
26008 } 26009 var input_value = form.find('textarea[name=review_content]').val(); 26010 if (input_value == "" || input_value == undefined) { 26011 form.find('textarea[name=review_content]').addClass('invalid'); 26012 form.find('.error-review_content').show().text('This field is required'); 26013 result = false; 26014 } else if (input_value.length < 10) { 26015 form.find('textarea[name=review_content]').addClass('invalid'); 26016 form.find('.error-review_content').show().text('Your review must be at least 10 characters long'); 26017 result = false; 26018 } else { 26019 form.find('textarea[name=review_content]').removeClass('invalid'); 26020 } 26021 var fields = form.find('input.stats').map(function (item, ele) { 26022 if ($(ele).val() == "" || $(ele).val() == undefined) { 26023 form.find('.error-review_stats_' + item).show().text('This field is required'); 26024 result = false; 26025 } 26026 }); 26027 if (result) { 26028 this.updateReview(); 26029 } 26030 }), "updateReview", function updateReview() { 26031 var form = $('#review-form'); 26032 var url = form.attr('action'); 26033 var data_params = new FormData(document.getElementById('review-form')); 26034 var callback_function = function callback_function(res) { 26035 if (res.status) { 26036 $('#reviewBtn').attr('style', 'pointer-events: none'); 26037 form.addClass('d-none'); 26038 $('.review-form').find('.success-message').removeClass('d-none'); 26039 $('.review-form').find('.success-message').addClass('show'); 26040 setTimeout(function () { 26041 $('.review-form').find('.success-message').addClass('active'); 26042 }, 200); 26043 } else { 26044 form.find('.error-submit').show().text(res.message); 26045 } 26046 }; 26047 this.makePostRequest(url, data_params, callback_function); 26048 }), "openReviewModal", function openReviewModal() { 26049 $('.review_stats').val(''); 26050 $('.review_rate').removeClass('hovered'); 26051 $('.review_rate').removeClass('selected'); 26052 $('.review-parent').removeClass('active'); 26053 $('.review-parent .review-text').text('Not Rated'); 26054 $('.review_content').val(''); 26055 $('#reivew-Modal').modal('show'); 26056 }), "reloadPage", function reloadPage() { 26057 window.location.reload(); 26058 }), "getReviewText", function getReviewText(len) { 26059 var text = 'Not Rated'; 26060 if (len == 5) { 26061 text = 'Excellent'; 26062 } else if (len == 4) { 26063 text = 'Very Good'; 26064 } else if (len == 3) { 26065 text = 'Average'; 26066 } else if (len == 2) { 26067 text = 'Poor'; 26068 } else if (len == 1) { 26069 text = 'Terrible'; 26070 } 26071 return text; 26072 }), "registerEvents", function registerEvents() { 26073 var self = this; 26074 this.getLinkHeights(); 26075 $(document).ready(function () { 26076 $("body").tooltip({ 26077 selector: '[data-toggle=tooltip]' 26078 }); 26079 $(window).on("load", function () { 26080 var urlHash = window.location.href.split("#")[1]; 26081 if (urlHash && $('.' + urlHash).length) { 26082 var offset_other = 70; 26083 if (urlHash === "review-list") { 26084 offset_other = 330; 26085 } 26086 $('html,body').animate({ 26087 scrollTop: $('.' + urlHash).offset().top - offset_other 26088 }, 1000); 26089 } 26090 }); 26091 $(".bravo_detail_space .g-faq .item .header").click(function () { 26092 $(this).parent().toggleClass("active"); 26093 }); 26094 $(".btn-show-all").click(function () { 26095 $(this).parent().find(".d-none").removeClass("d-none"); 26096 $(this).addClass("d-none"); 26097 }); 26098 26099 // HEADER FIXED SCROLL THING 26100 $(window).scroll(function () { 26101 self.setHeaderPosition(); 26102 self.setLinkOnScroll(); 26103 self.setStickyPopUpPrice(); 26104 self.tableHeader(); 26105 }); 26106 26107 // MORE LESS TOGGLE 26108 $(document).on('click', '.hotel-more-toggle', function (event) { 26109 var isExpanded = $(this).attr('aria-expanded'); 26110 var room_id = $(this).data('room_id'); 26111 if (isExpanded == 'true') { 26112 $('.amenity-item-' + room_id).addClass('d-none'); 26113 $(this).attr('aria-expanded', 'false'); 26114 } else { 26115 $('.amenity-item-' + room_id).removeClass('d-none'); 26116 $(this).attr('aria-expanded', 'true'); 26117 } 26118 }); 26119 26120 // NAVIGATOR AUTO CLICK 26121 $(document).on('click', '.navigator-toggle-item', function () { 26122 $('html, body').animate({
26123 scrollTop: self.linkHeights[$(this).data('toggle')].top 26124 }, 1000); 26125 }); 26126 $(window).on('resize', function () { 26127 $(window).scroll(); 26128 }); 26129 $(document).on('click', '.image-card-more', function () { 26130 $('.main-image-carousel').toggleClass('d-none'); 26131 }); 26132 $(document).on('click', '.main-image-carousel .carouse-close', function () { 26133 $('.main-image-carousel').addClass('d-none'); 26134 }); 26135 if (self.popup_code) { 26136 document.getElementById("bravo-reviews").scrollIntoView(); 26137 if (self.popup_code == 1) { 26138 $("#reivew-Modal").modal('show'); 26139 } 26140 } 26141 self.updatePageUrl(); 26142 $('#reivew-Modal').on('hide.bs.modal', function () { 26143 if ($('#review-form').hasClass('d-none')) { 26144 window.location.reload(); 26145 } 26146 }); 26147 $("#apply").click(function () { 26148 $(".select-guests-dropdown").removeClass('.show'); 26149 }); 26150 $('.review-form .review-items .rates .ion').each(function () { 26151 var list = $(this).parent(), 26152 listItems = list.parent().parent(), 26153 listText = listItems.children('.review-parent'), 26154 listVal = listItems.children('.review_stats'), 26155 itemIndex = list.index(), 26156 parentItem = list.parent().children(); 26157 $(this).hover(function () { 26158 for (var i = 0; i <= parentItem.length; i++) { 26159 var child = $(parentItem[i]).children()[0]; 26160 if (i <= itemIndex) { 26161 $(parentItem[i]).addClass('animate'); 26162 $(child).addClass('hovered'); 26163 } else { 26164 $(child).removeClass('selected'); 26165 $(child).removeClass('hovered'); 26166 } 26167 } 26168 listText.children('.review-text').text(self.getReviewText(itemIndex + 1)); 26169 listVal.val(itemIndex + 1); 26170 $(this).click(function () { 26171 var _loop = function _loop() { 26172 var child = $(parentItem[i]).children(); 26173 if (i <= itemIndex) { 26174 $(child[0]).addClass('selected'); 26175 $(child[1]).addClass('is-animated'); 26176 if (i == itemIndex) { 26177 $(child[1]).addClass('icon-change'); 26178 $(child[1]).addClass('pulse'); 26179 setTimeout(function () { 26180 $(child[1]).removeClass('is-animated'); 26181 $(child[1]).removeClass('pulse'); 26182 $(child[1]).removeClass('icon-change'); 26183 }, 800); 26184 } 26185 } else { 26186 $(child[0]).removeClass('selected'); 26187 $(child[1]).addClass('is-animated'); 26188 } 26189 }; 26190 for (var i = 0; i < parentItem.length; i++) { 26191 _loop(); 26192 } 26193 listVal.val(itemIndex + 1); 26194 $(listText).addClass('active'); 26195 }); 26196 }, function () { 26197 var previous = listItems.children('.review_stats').val(); 26198 for (var i = 0; i <= parentItem.length; i++) { 26199 var child = $(parentItem[i]).children()[0]; 26200 $(parentItem[i]).removeClass('animate'); 26201 if (i < previous) { 26202 $(child).addClass('selected'); 26203 } else { 26204 $(child).removeClass('selected'); 26205 } 26206 } 26207 }); 26208 }); 26209 }); 26210 this.tmp_adults = this.adults; 26211 this.tmp_children = this.children; 26212 this.tmp_room = this.room; 26213 this.initMap(); 26214 })) 26215}); 26216 26217/***/ }), 26218
26219/***/ "./resources/js/modules/promotion.js": 26220/*!*******************************************!*\ 26221 !*** ./resources/js/modules/promotion.js ***! 26222 \*******************************************/ 26223/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 26224 26225"use strict"; 26226__webpack_require__.r(__webpack_exports__); 26227/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26228/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 26229/* harmony export */ }); 26230function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 26231function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 26232function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 26233function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 26234function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } 26235function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 26236function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 26237/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 26238 otherData: { 26239 current_page: 'create', 26240 translations: {}, 26241 rooms: {}, 26242 hotel_id: 0, 26243 category: 'customized', 26244 row: {}, 26245 promotion: { 26246 id: 0, 26247 name: '', 26248 category: 'customized', 26249 stackable: 0, 26250 audience: 'everyone', 26251 platform: 'both', 26252 period_type: 'days', 26253 days: 3, 26254 hours: 5, 26255 min_book: 1, 26256 is_max_book: 0, 26257 max_book: '', 26258 is_limit: 0, 26259 room_per_day: '', 26260 room_type: 'all', 26261 rooms: '', 26262 selected_rooms: [], 26263 start_time: '00:00:00', 26264 end_time: '23:59:00', 26265 min_stay: '', 26266 max_stay: '', 26267 blockouts: '', 26268 blockouts_formatted: '', 26269 discount: { 26270 offer_type: 'single', 26271 discount_type: 'percentage', 26272 guest: 10, 26273 member: 5, 26274 monday: 10, 26275 tuesday: 10, 26276 wednesday: 10, 26277 thursday: 10, 26278 friday: 10, 26279 saturday: 10, 26280 sunday: 10 26281 }, 26282 booking: { 26283 start_date: moment().format('YYYY-MM-DD'), 26284 start_date_formatted: moment().format(fresco.date_format), 26285 end_date: moment().add(3, 'months').format('YYYY-MM-DD'), 26286 end_date_formatted: moment().add(3, 'months').format(fresco.date_format), 26287 days: '0,1,2,3,4,5,6', 26288 selected_days: ['0', '1', '2', '3', '4', '5', '6'], 26289 is_forever: '' 26290 }, 26291 stay: { 26292 start_date: moment().format('YYYY-MM-DD'), 26293 start_date_formatted: moment().format(fresco.date_format), 26294 end_date: moment().add(3, 'months').format('YYYY-MM-DD'), 26295 end_date_formatted: moment().add(3, 'months').format(fresco.date_format), 26296 days: '0,1,2,3,4,5,6', 26297 selected_days: ['0', '1', '2', '3', '4', '5', '6'], 26298 is_forever: '' 26299 } 26300 }, 26301 booking_dates: {}, 26302 stay_dates: {}, 26303 block_dates: {}, 26304 custom_date: {}, 26305 filters: { 26306 type: 'all', 26307 start_date: moment().format('YYYY-MM-DD'), 26308 start_date_formatted: moment().format(fresco.date_format), 26309 end_date: moment().add(1, 'day').format('YYYY-MM-DD'), 26310 end_date_formatted: moment().add(1, 'day').format(fresco.date_format) 26311 }, 26312 filter_translations: [], 26313 results: {}, 26314 error_messages: {}, 26315 validation: { 26316 name: false, 26317 guest: false, 26318 member: false, 26319 total: false, 26320 daily: false, 26321 stay_date: false 26322 } 26323 }, 26324 computed: { 26325 getOfferType: function getOfferType() { 26326 if (this.promotion.discount.discount_type == 'percentage') { 26327 return '%'; 26328 } 26329 return fresco.currency_symbol; 26330 }, 26331 getEnableDates: function getEnableDates() { 26332 var date = []; 26333 if (this.promotion.stay.start_date && this.promotion.stay.end_date && this.promotion.stay.is_forever == 0) { 26334 var startDate = moment(this.promotion.stay.start_date); 26335 var endDate = moment(this.promotion.stay.end_date); 26336 for (var m = moment(startDate); m.isSameOrBefore(endDate); m.add(1, 'days')) { 26337 date.push(m.format('YYYY-MM-DD')); 26338 } 26339 } 26340 return date; 26341 }, 26342 getBlockedDates: function getBlockedDates() { 26343 var blocked_dates = []; 26344 if (this.promotion.blockouts) { 26345 blocked_dates = this.promotion.blockouts.split(','); 26346 } 26347 return blocked_dates; 26348 }, 26349 getFilterText: function getFilterText() { 26350 var result = this.filter_translations[this.filters.type]; 26351 if (this.filters.type == 'custom') { 26352 return this.filters.start_date_formatted + ' - ' + this.filters.end_date_formatted; 26353 } 26354 return result; 26355 } 26356 }, 26357 methods: { 26358 initStartDatePicker: function initStartDatePicker() { 26359 var me = this; 26360 var options = { 26361 singleDatePicker: true, 26362 showCalendar: false, 26363 sameDate: true, 26364 autoApply: true, 26365 dateFormat: fresco.date_format, 26366 enableLoading: true, 26367 selectMultiple: true, 26368 minDate: moment().format(fresco.date_format), 26369 opens: fresco.rtl ? 'left' : 'right', 26370 locale: { 26371 direction: fresco.rtl ? 'rtl' : 'ltr', 26372 firstDay: daterangepickerLocale.first_day_of_week 26373 } 26374 }; 26375 $(document).ready(function () { 26376 me.booking_dates['start'] = $('.booking_start').daterangepicker(options).on('apply.daterangepicker', function (ev, picker) { 26377 me.promotion.booking.end_date = ''; 26378 me.promotion.booking.end_date_formatted = ''; 26379 me.promotion.booking.start_date = picker.startDate.format('YYYY-MM-DD'); 26380 me.promotion.booking.start_date_formatted = picker.startDate.format(fresco.date_format); 26381 me.booking_dates['end'].data('daterangepicker').minDate = picker.startDate; 26382 me.booking_dates['end'].focus(); 26383 }); 26384 me.stay_dates['start'] = $('.stay_start').daterangepicker(options).on('apply.daterangepicker', function (ev, picker) { 26385 me.promotion.stay.end_date = ''; 26386 me.promotion.stay.end_date_formatted = ''; 26387 me.promotion.stay.start_date = picker.startDate.format('YYYY-MM-DD'); 26388 me.promotion.stay.start_date_formatted = picker.startDate.format(fresco.date_format); 26389 me.stay_dates['end'].data('daterangepicker').minDate = picker.startDate; 26390 me.stay_dates['end'].focus(); 26391 }); 26392 }); 26393 }, 26394 initEndDatePicker: function initEndDatePicker() { 26395 var me = this; 26396 var options = { 26397 singleDatePicker: true, 26398 showCalendar: false, 26399 sameDate: true, 26400 autoApply: true, 26401 dateFormat: fresco.date_format, 26402 enableLoading: true, 26403 opens: fresco.rtl ? 'left' : 'right', 26404 minDate: moment().format(fresco.date_format), 26405 locale: { 26406 direction: fresco.rtl ? 'rtl' : 'ltr', 26407 firstDay: daterangepickerLocale.first_day_of_week 26408 } 26409 }; 26410 $(document).ready(function () { 26411 me.booking_dates['end'] = $('.booking_end').daterangepicker(options).on('apply.daterangepicker', function (ev, picker) { 26412 me.promotion.booking.end_date = picker.startDate.format('YYYY-MM-DD'); 26413 me.promotion.booking.end_date_formatted = picker.startDate.format(fresco.date_format); 26414 }); 26415 me.stay_dates['end'] = $('.stay_end').daterangepicker(options).on('apply.daterangepicker', function (ev, picker) { 26416 me.promotion.stay.end_date = picker.startDate.format('YYYY-MM-DD'); 26417 me.promotion.stay.end_date_formatted = picker.startDate.format(fresco.date_format);
26418 me.updateBlockoutsCalendar(); 26419 me.checkValidation('stay_date'); 26420 }); 26421 }); 26422 }, 26423 initBlockoutDates: function initBlockoutDates() { 26424 var me = this; 26425 var enableDates = []; 26426 var defaultDates = []; 26427 var selected_days = this.promotion.stay.selected_days; 26428 var forever = this.promotion.stay.is_forever; 26429 if (this.getEnableDates.length > 0) { 26430 enableDates = this.getEnableDates; 26431 } 26432 if (this.getBlockedDates.length > 0) { 26433 defaultDates = this.getBlockedDates; 26434 } 26435 var options = { 26436 inline: true, 26437 showMonths: 2, 26438 altInput: true, 26439 altFormat: fresco.date_format, 26440 dateFormat: "Y-m-d", 26441 mode: "multiple", 26442 minDate: 'today', 26443 // enable: enableDates, 26444 defaultDate: defaultDates, 26445 disable: [function (date) { 26446 var format_date = moment(date).format('YYYY-MM-DD'); 26447 if (enableDates.includes(format_date) || forever == 1) { 26448 if (selected_days.includes(date.getDay().toString())) { 26449 return false; 26450 } 26451 return true; 26452 } 26453 return true; 26454 }], 26455 onChange: function onChange(selectedDates, dateStr, instance) { 26456 var blockouts = []; 26457 var blockouts_formatted = []; 26458 selectedDates.forEach(function (selected) { 26459 selected = moment(selected); 26460 blockouts.push(selected.format('YYYY-MM-DD')); 26461 blockouts_formatted.push(selected.format(fresco.date_format)); 26462 }); 26463 me.promotion.blockouts = blockouts.toString(); 26464 me.promotion.blockouts_formatted = blockouts_formatted.toString(); 26465 } 26466 }; 26467 this.block_dates = flatpickr('.blockout_dates', options); 26468 }, 26469 updateBlockoutsCalendar: function updateBlockoutsCalendar() { 26470 this.promotion.blockouts = ''; 26471 this.promotion.blockouts_formatted = ''; 26472 this.block_dates.clear(); 26473 this.block_dates.destroy(); 26474 this.initBlockoutDates(); 26475 },
26476 initCustomRangePicker: function initCustomRangePicker() { 26477 var me = this; 26478 var options = { 26479 sameDate: true, 26480 autoApply: true, 26481 dateFormat: fresco.date_format, 26482 enableLoading: true, 26483 opens: fresco.rtl ? 'left' : 'right', 26484 locale: { 26485 direction: fresco.rtl ? 'rtl' : 'ltr', 26486 firstDay: daterangepickerLocale.first_day_of_week 26487 } 26488 }; 26489 $(document).ready(function () { 26490 me.custom_date = $('#custom_range').daterangepicker(options).on('apply.daterangepicker', function (ev, picker) { 26491 me.filters.start_date = picker.startDate.format('YYYY-MM-DD'); 26492 me.filters.start_date_formatted = picker.startDate.format(fresco.date_format); 26493 me.filters.end_date = picker.endDate.format('YYYY-MM-DD'); 26494 me.filters.end_date_formatted = picker.endDate.format(fresco.date_format); 26495 me.getPromotionByStatus(); 26496 }); 26497 }); 26498 }, 26499 changeFilters: function changeFilters(type) { 26500 this.filters.type = type; 26501 if (type == 'custom') { 26502 $('#custom_range').click(); 26503 } else { 26504 this.getPromotionByStatus(); 26505 } 26506 }, 26507 getPromotionByStatus: function getPromotionByStatus() { 26508 var me = this; 26509 $('.nav-button').map(function () { 26510 if ($(this).hasClass('active')) { 26511 me.getPromotion($(this).data('status')); 26512 } 26513 }); 26514 }, 26515 getCheckedRooms: function getCheckedRooms(room_id) { 26516 return this.promotion.selected_rooms.includes(room_id); 26517 }, 26518 getSelectedRooms: function getSelectedRooms() { 26519 var selected_rooms = this.getSelectedData('.rooms'); 26520 this.promotion.selected_rooms = selected_rooms; 26521 this.promotion.rooms = selected_rooms.toString(); 26522 }, 26523 getSelectedData: function getSelectedData(selector) { 26524 var value = []; 26525 $(selector + ':checked').each(function () { 26526 value.push($(this).val()); 26527 }); 26528 return value; 26529 }, 26530 getCheckedData: function getCheckedData(type, key) { 26531 return this.promotion[type].selected_days.includes(key); 26532 }, 26533 getBookingDays: function getBookingDays(type) { 26534 var selected_days = this.getSelectedData('.' + type + '_days'); 26535 this.promotion[type].selected_days = selected_days; 26536 this.promotion[type].days = selected_days.toString(); 26537 if (type == 'stay') { 26538 this.updateBlockoutsCalendar(); 26539 } 26540 }, 26541 reviewPromotion: function reviewPromotion() { 26542 var result = this.checkValidation(); 26543 if (result) { 26544 $('#overviewModal').modal('show'); 26545 } 26546 }, 26547 navigateMenu: function navigateMenu(navigation) { 26548 $('#overviewModal').modal('hide'); 26549 if (navigation) { 26550 setTimeout(function () { 26551 document.getElementById(navigation).scrollIntoView(); 26552 }); 26553 } 26554 }, 26555 checkInvalidInputs: function checkInvalidInputs(value) { 26556 if (value == null) { 26557 return true; 26558 } 26559 if (_typeof(value) == 'object') { 26560 return value.length == 0; 26561 } 26562 return value == undefined || value == 0 || value == ''; 26563 }, 26564 checkTextValidation: function checkTextValidation(val) { 26565 var check = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 26566 if (check) { 26567 if (val < 5 || val > 75) { 26568 return true; 26569 } 26570 } 26571 if (val === '' || val < 0) { 26572 return true; 26573 } 26574 return false; 26575 }, 26576 resetValidation: function resetValidation() { 26577 var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; 26578 if (type == 'all') { 26579 for (var _i = 0, _Object$entries = Object.entries(this.validation); _i < _Object$entries.length; _i++) { 26580 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), 26581 key = _Object$entries$_i[0], 26582 value = _Object$entries$_i[1]; 26583 this.validation[key] = false; 26584 } 26585 } else { 26586 this.validation[type] = false; 26587 } 26588 }, 26589 checkValidation: function checkValidation() { 26590 var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; 26591 var result = true; 26592 var navigate = ''; 26593 this.resetValidation(); 26594 if ((type == 'all' || type == 'name') && result) { 26595 if (this.checkInvalidInputs(this.promotion.name)) { 26596 this.validation.name = true; 26597 result = false;
26598 navigate = 'promotion_name'; 26599 } 26600 } 26601 if ((type == 'all' || type == 'stay_date') && result) { 26602 if (this.promotion.booking.end_date > this.promotion.stay.end_date && this.promotion.booking.is_forever == 0 && this.promotion.stay.is_forever == 0) { 26603 this.validation.stay_date = true; 26604 result = false; 26605 navigate = 'stay_dates'; 26606 } 26607 } 26608 if (this.promotion.discount.offer_type == 'single') { 26609 if ((type == 'all' || type == 'guest') && result) { 26610 if (this.checkTextValidation(this.promotion.discount.guest)) { 26611 this.validation.guest = true; 26612 result = false; 26613 navigate = 'offer'; 26614 } 26615 } 26616 if ((type == 'all' || type == 'member') && result) { 26617 if (this.checkTextValidation(this.promotion.discount.member)) { 26618 this.validation.member = true; 26619 result = false; 26620 navigate = 'offer'; 26621 } 26622 } 26623 if ((type == 'all' || ['guest', 'member'].includes(type)) && result) { 26624 this.validation['total'] = false; 26625 var total = parseInt(this.promotion.discount.guest) + parseInt(this.promotion.discount.member); 26626 if (this.checkTextValidation(total, true)) { 26627 this.validation.total = true; 26628 result = false;
26629 navigate = 'offer'; 26630 } 26631 } 26632 } else { 26633 if ((type == 'all' || type == 'daily') && result) { 26634 var week_days = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']; 26635 for (var _i2 = 0, _Object$entries2 = Object.entries(week_days); _i2 < _Object$entries2.length; _i2++) { 26636 var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2), 26637 key = _Object$entries2$_i[0], 26638 day = _Object$entries2$_i[1]; 26639 if (this.checkTextValidation(this.promotion.discount[day], true)) { 26640 this.validation.daily = true; 26641 result = false; 26642 navigate = 'offer'; 26643 } 26644 } 26645 } 26646 } 26647 if (navigate) { 26648 this.navigateMenu(navigate); 26649 } 26650 return result; 26651 }, 26652 updatePromotion: function updatePromotion() { 26653 var me = this; 26654 var url = fresco.url + '/user/hotel/promotion/' + me.hotel_id + '/store'; 26655 var data_params = this.promotion; 26656 var callback_function = function callback_function(res) { 26657 $('#overviewModal').modal('hide'); 26658 window.location.href = res.redirect; 26659 }; 26660 this.makePostRequest(url, data_params, callback_function); 26661 }, 26662 getPromotion: function getPromotion() { 26663 var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'active'; 26664 var me = this; 26665 var url = fresco.url + '/user/hotel/promotion/' + me.hotel_id + '/get'; 26666 var data_params = { 26667 'hotel_id': me.hotel_id, 26668 'status': status, 26669 'filters': me.filters 26670 }; 26671 var callback_function = function callback_function(res) { 26672 me.results = res.data; 26673 }; 26674 this.makePostRequest(url, data_params, callback_function); 26675 }, 26676 updateStatus: function updateStatus(status, id) { 26677 var redirect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 26678 var me = this; 26679 var url = fresco.url + '/user/hotel/promotion/' + me.hotel_id + '/update-status'; 26680 var data_params = { 26681 'hotel_id': me.hotel_id, 26682 'promotion_id': id, 26683 'status': status 26684 }; 26685 var callback_function = function callback_function(res) { 26686 if (redirect) { 26687 window.location.href = res.redirect; 26688 return true; 26689 } 26690 me.getPromotionByStatus(); 26691 }; 26692 this.makePostRequest(url, data_params, callback_function); 26693 }, 26694 registerEvents: function registerEvents() { 26695 var me = this; 26696 if (this.current_page == 'home') { 26697 this.getPromotion(); 26698 this.initCustomRangePicker(); 26699 $(document).ready(function () { 26700 $('.nav-button').on('click', function () { 26701 $('.nav-button').removeClass('active'); 26702 $(this).addClass('active'); 26703 var status = $(this).data('status'); 26704 me.getPromotion(status); 26705 }); 26706 }); 26707 } else { 26708 this.initStartDatePicker(); 26709 this.initEndDatePicker(); 26710 this.initBlockoutDates(); 26711 } 26712 }, 26713 loadFunctions: function loadFunctions() { 26714 for (var _i3 = 0, _Object$entries3 = Object.entries(this.row); _i3 < _Object$entries3.length; _i3++) { 26715 var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2), 26716 key = _Object$entries3$_i[0], 26717 value = _Object$entries3$_i[1]; 26718 this.promotion[key] = value; 26719 } 26720 if (this.category) { 26721 this.promotion.category = this.category; 26722 } 26723 } 26724 } 26725}); 26726 26727/***/ }), 26728
26729/***/ "./resources/js/modules/search.js": 26730/*!****************************************!*\ 26731 !*** ./resources/js/modules/search.js ***! 26732 \****************************************/ 26733/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 26734 26735"use strict"; 26736__webpack_require__.r(__webpack_exports__); 26737/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26738/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 26739/* harmony export */ }); 26740function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 26741function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 26742function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 26743function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 26744function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } 26745function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 26746/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 26747 otherData: { 26748 searchFilter: { 26749 'star_rate': [], 26750 'review_score': [] 26751 }, 26752 tmpFilter: _defineProperty({ 26753 min_price: 0 26754 }, "min_price", 300), 26755 results: { 26756 data: [], 26757 total: 0, 26758 per_page: 20, 26759 from: 0, 26760 to: 0, 26761 current_page: 1, 26762 next_page: 2, 26763 last_page: 1 26764 }, 26765 priceRange: { 26766 min: 0, 26767 max: 300 26768 }, 26769 offset: 4, 26770 showNavigation: false, 26771 main_content_loading: true, 26772 ionRangeSlider: {}, 26773 mapEngine: {}, 26774 markers: {}, 26775 currentMarkers: {} 26776 }, 26777 computed: { 26778 pagesNumber: function pagesNumber() { 26779 if (!this.results.to) { 26780 return [1]; 26781 } 26782 var from = this.results.current_page - this.offset; 26783 if (from < 1) { 26784 from = 1; 26785 } 26786 var to = from + this.offset * 2; 26787 if (to >= this.results.last_page) { 26788 to = this.results.last_page; 26789 } 26790 var pagesArray = []; 26791 for (var page = from; page <= to; page++) { 26792 pagesArray.push(page); 26793 } 26794 return pagesArray; 26795 } 26796 }, 26797 methods: { 26798 addCount: function addCount(type) { 26799 if (type == 'room') { 26800 this.searchFilter.tmp_room += 1; 26801 } else if (type == 'adults') { 26802 this.searchFilter.tmp_adults += 1; 26803 } else if (type == 'children') { 26804 this.searchFilter.tmp_children += 1; 26805 } 26806 }, 26807 minusCount: function minusCount(type) { 26808 if (type == 'room') { 26809 this.searchFilter.tmp_room -= 1; 26810 } else if (type == 'adults') { 26811 this.searchFilter.tmp_adults -= 1; 26812 } else if (type == 'children') { 26813 this.searchFilter.tmp_children -= 1; 26814 } 26815 }, 26816 resetGuestFilter: function resetGuestFilter() { 26817 this.searchFilter.tmp_adults = 1; 26818 this.searchFilter.tmp_children = 0; 26819 this.searchFilter.tmp_room = 1; 26820 this.applyGuestFilter(); 26821 }, 26822 applyGuestFilter: function applyGuestFilter() { 26823 this.searchFilter.adults = this.searchFilter.tmp_adults; 26824 this.searchFilter.children = this.searchFilter.tmp_children; 26825 this.searchFilter.room = this.searchFilter.tmp_room; 26826 var element = document.getElementById('select-guests-dropdown'); 26827 element.classList.remove('show'); 26828 }, 26829 format_money: function format_money(money) { 26830 return window.bravo_format_money(money); 26831 }, 26832 formatQueryString: function formatQueryString(jsonUrl) { 26833 return new URLSearchParams(jsonUrl).toString(); 26834 }, 26835 updateSearchUrl: function updateSearchUrl() { 26836 var formatted_url = this.formatQueryString(this.searchFilter); 26837 var newRelativePathQuery = window.location.pathname + '?' + formatted_url; 26838 history.replaceState(null, '', newRelativePathQuery); 26839 }, 26840 updateSortBy: function updateSortBy(filter) { 26841 this.searchFilter.orderby = filter; 26842 this.changePage(); 26843 }, 26844 changePage: function changePage() { 26845 var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; 26846 this.results.current_page = page; 26847 if (page == 1) { 26848 this.results.data = []; 26849 if (this.searchFilter.layout == 'map') { 26850 this.currentMarkers = {}; 26851 } 26852 } 26853 this.searchResults(); 26854 }, 26855 navigationScroll: function navigationScroll() { 26856 var showNavigation = $(window).scrollTop() > $(".list-view").offset().top + 5; 26857 if (showNavigation) { 26858 $('.bravo_map').css({ 26859 top: 5,
26860 position: 'sticky' 26861 }); 26862 $('.listing-box').css({ 26863 top: -1, 26864 position: 'sticky' 26865 }); 26866 } else { 26867 $('.bravo_map').css({ 26868 top: "" 26869 }); 26870 $('.listing-box').css({ 26871 top: "" 26872 }); 26873 } 26874 }, 26875 searchResults: function searchResults() { 26876 var self = this; 26877 var url = fresco.url + '/hotel/search-results?page=' + this.results.current_page; 26878 var data_params = this.searchFilter; 26879 var callback_function = function callback_function(res) { 26880 // for(const[key,data] of Object.entries(res.data)) { 26881 // self.results.data.push(data); 26882 // } 26883 self.results.data = res.data; 26884 self.results.current_page = res.current_page; 26885 self.results.next_page = res.next_page; 26886 self.results.from = res.from; 26887 self.results.to = res.to; 26888 self.results.total = res.total; 26889 self.results.per_page = res.per_page; 26890 self.results.last_page = res.last_page; 26891 // self.priceRange = res.price_data; 26892 self.updateSearchUrl(); 26893 setTimeout(function () { 26894 self.updateEvents(); 26895 // self.updateRangeSlider(); 26896 }, 10); 26897 if (self.searchFilter.layout == 'map') { 26898 var markers = res.markers; 26899 // for(const[key,marker] of Object.entries(self.currentMarkers)) { 26900 // markers.push(marker); 26901 // } 26902 self.currentMarkers = markers; 26903 self.mapEngine.clearMarkers(); 26904 self.mapEngine.addMarkers2(self.currentMarkers); 26905 } 26906 }; 26907 this.makePostRequest(url, data_params, callback_function); 26908 }, 26909 initMap: function initMap() { 26910 var me = this; 26911 $(document).ready(function () { 26912 me.mapEngine = new BravoMapEngine('bravo_results_map', { 26913 fitBounds: true, 26914 center: [37.09024, -95.712891], 26915 zoom: 5 26916 }); 26917 }); 26918 }, 26919 updateEvents: function updateEvents() { 26920 // Carousel 26921 var me = this; 26922 $(document).ready(function () { 26923 $(".item-loop-list.skyplace-design").each(function () { 26924 $(this).find(".owl-carousel").owlCarousel({ 26925 items: 1, 26926 loop: false, 26927 margin: 15, 26928 nav: true, 26929 dots: false 26930 }); 26931 var buttons = $(this).find('.owl-nav button'); 26932 $(buttons[0]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M8.86318 17.726C9.12659 17.7261 9.38411 17.6481 9.60315 17.5018C9.82219 17.3555 9.99289 17.1475 10.0936 16.9041C10.1944 16.6607 10.2207 16.3929 10.1691 16.1346C10.1176 15.8763 9.9906 15.6391 9.80418 15.453L3.21418 8.86298L9.80418 2.27298C9.92782 2.14934 10.0259 2.00256 10.0928 1.84102C10.1597 1.67948 10.1942 1.50633 10.1942 1.33148C10.1942 1.15663 10.1597 0.983489 10.0928 0.821946C10.0259 0.660403 9.92782 0.513621 9.80418 0.389982C9.68054 0.266342 9.53376 0.168266 9.37222 0.101353C9.21068 0.0344395 9.03753 -1.30275e-09 8.86268 0C8.68783 1.30276e-09 8.51469 0.0344395 8.35315 0.101353C8.1916 0.168266 8.04482 0.266342 7.92118 0.389982L0.390182 7.92198C0.266485 8.04559 0.168358 8.19236 0.101409 8.35391C0.0344596 8.51545 0 8.68861 0 8.86348C0 9.03835 0.0344596 9.21151 0.101409 9.37306C0.168358 9.5346 0.266485 9.68137 0.390182 9.8
269320498L7.92218 17.337C8.17189 17.5862 8.51035 17.7262 8.86318 17.726Z\" fill=\"#000\"/></svg>"); 26933 $(buttons[1]).html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"20\" viewBox=\"0 0 11 18\" fill=\"none\" style=\" \"><path d=\"M1.33025 17.7259C1.06766 17.7252 0.811138 17.6469 0.592956 17.5008C0.374773 17.3547 0.204683 17.1473 0.104091 16.9048C0.00349842 16.6622 -0.023101 16.3953 0.0276403 16.1377C0.0783817 15.8801 0.204196 15.6432 0.38925 15.4569L6.97925 8.86689L0.38925 2.27689C0.26561 2.15325 0.167534 2.00647 0.100621 1.84492C0.033708 1.68338 -0.000732421 1.51024 -0.000732422 1.33539C-0.000732423 1.16054 0.033708 0.987395 0.100621 0.825852C0.167534 0.66431 0.26561 0.517528 0.38925 0.393888C0.512889 0.270249 0.659671 0.172173 0.821214 0.105259C0.982757 0.0383462 1.1559 0.00390625 1.33075 0.00390625C1.5056 0.00390625 1.67874 0.0383462 1.84029 0.105259C2.00183 0.172173 2.14861 0.270249 2.27225 0.393888L9.80425 7.92589C9.92795 8.0495 10.0261 8.19627 10.093 8.35781C10.16 8.51936 10.1944 8.69252 10.1944 8.86739C10.1944 9.04226 10.16 9.21542 10.093 9.37696C10.0261 9.53851 9.92795 9.68528 9.80425 9.80889L2.27225 17.3409C2.0227 17.5905 1.68422 17.7308 1.33125 17.7309L1.33025 17.7259Z\" fill=\"#000\"/></svg>"); 26934 }); 26935 }); 26936 }, 26937 initRangeSlider: function initRangeSlider() { 26938 var me = this; 26939 $(document).ready(function () { 26940 $(".bravo-filter-price").each(function () { 26941 var input_price = $(this).find(".filter-price"); 26942 var min = me.priceRange.min; 26943 var max = me.priceRange.max; 26944 var from = me.searchFilter.min_price; 26945 var to = me.searchFilter.max_price; 26946 var symbol = fresco.currency_symbol; 26947 input_price.ionRangeSlider({ 26948 type: "double", 26949 grid: true, 26950 min: min, 26951 max: max, 26952 prettify_enabled: false, 26953 from: from, 26954 to: to, 26955 prefix: symbol, 26956 max_postfix: "+", 26957 skin: 'round', 26958 onFinish: function onFinish(data) { 26959 me.tmpFilter.min_price = data.from; 26960 me.tmpFilter.max_price = data.to; 26961 } 26962 }); 26963 me.ionRangeSlider = input_price.data("ionRangeSlider"); 26964 }); 26965 }); 26966 }, 26967 isFilterActive: function isFilterActive(type, value) { 26968 if (typeof this.searchFilter[type] == 'undefined') { 26969 return false; 26970 } 26971 var index = this.searchFilter[type].findIndex(function (item) { 26972 return item + '' == value + ''; 26973 }); 26974 return index >= 0; 26975 }, 26976 updateFilter: function updateFilter(type, value) { 26977 if (this.isFilterActive(type, value)) { 26978 var index = this.searchFilter[type].findIndex(function (item) { 26979 return item + '' == value + ''; 26980 }); 26981 this.searchFilter[type].splice(index, 1); 26982 } else { 26983 this.searchFilter[type].push(value); 26984 } 26985 if (this.searchFilter.layout != 'map') { 26986 this.changePage(); 26987 } 26988 }, 26989 getCheckedData: function getCheckedData(type) { 26990 this.searchFilter[type] = this.getSelectedData('.' + type); 26991 if (this.searchFilter.layout != 'map') { 26992 this.changePage(); 26993 } 26994 }, 26995 clearFilter: function clearFilter() { 26996 var me = this; 26997 $(document).ready(function () { 26998 var check_inputs = $('.bravo_hotel_filter_custom').find('input[type=checkbox]'); 26999 for (var i = 0; i < check_inputs.length; i++) { 27000 $(check_inputs[i]).prop('checked', false); 27001 } 27002 me.ionRangeSlider.update({ 27003 from: me.priceRange.min, 27004 to: me.priceRange.max 27005 }); 27006 me.ionRangeSlider.reset(); 27007 me.searchFilter.orderby = ''; 27008 me.searchFilter.star_rate = []; 27009 me.searchFilter.review_score = []; 27010 me.searchFilter.terms = []; 27011 me.searchFilter.min_price = me.priceRange.min; 27012 me.searchFilter.max_price = me.priceRange.max; 27013 me.changePage(); 27014 }); 27015 }, 27016 getSelectedData: function getSelectedData(selector) { 27017 var value = []; 27018 $(selector + ':checked').each(function () { 27019 value.push($(this).val()); 27020 }); 27021 return value; 27022 }, 27023 updateRangeSlider: function updateRangeSlider() { 27024 var me = this; 27025 this.ionRangeSlider.update({ 27026 min: me.searchFilter.min_price, 27027 max: me.searchFilter.max_price 27028 }); 27029 }, 27030 applyPriceFilter: function applyPriceFilter() { 27031 this.searchFilter.min_price = this.tmpFilter.min_price; 27032 this.searchFilter.max_price = this.tmpFilter.max_price; 27033 this.changePage(); 27034 }, 27035 changeFilter: function changeFilter(type) { 27036 $('.map_filters').modal('hide'); 27037 if (type == 'apply') { 27038 this.changePage(); 27039 } else { 27040 this.clearFilter(); 27041 } 27042 }, 27043 registerEvents: function registerEvents() { 27044 var me = this; 27045 this.searchResults(); 27046 this.initRangeSlider(); 27047 if (this.searchFilter.layout == 'map') { 27048 this.initMap(); 27049 $(window).scroll(function () { 27050 me.navigationScroll(); 27051 }); 27052 } 27053 ; 27054 }, 27055 loadFunctions: function loadFunctions() { 27056 var me = this; 27057 var isMoreRoomAmenitiesSelected = false;
27058 var window_hight = $(document).height(); 27059 $('#bravo_results_map').css({ 27060 height: window_hight + 'px' 27061 }); 27062 window.addEventListener('DOMContentLoaded', function () { 27063 $('form.bravo_form.menu-2').find('input[name="location_id"]').change(function () { 27064 $(this).closest('form').find('input[name="date"]').click(); 27065 }); 27066 $('form.bravo_form.menu-2').find('input[name="date"]').change(function () { 27067 $(this).closest('form').find('.form-content.dropdown-toggle').click(); 27068 }); 27069 }); 27070 jQuery(function ($) { 27071 $(".bravo_filter .g-filter-item").each(function () { 27072 if ($(window).width() <= 990) { 27073 $(this).find(".item-title").toggleClass("e-close"); 27074 } 27075 $(this).find(".item-title").click(function () { 27076 $(this).toggleClass("e-close"); 27077 if ($(this).hasClass("e-close")) { 27078 $(this).closest(".g-filter-item").find(".item-content").slideUp(); 27079 } else { 27080 $(this).closest(".g-filter-item").find(".item-content").slideDown(); 27081 } 27082 }); 27083 $(this).find(".btn-more-item").click(function () { 27084 $(this).closest(".g-filter-item").find(".show_hide").toggleClass("hide"); 27085 var action = $(this).data('action'); 27086 if (action == 'more') { 27087 $(this).parent().closest('.item-content').find('button').removeClass('btn-expand-short'); 27088 $(this).parent().closest('.item-content').find('.btn-more-item2').addClass('btn-expand-short'); 27089 } else { 27090 $(this).parent().closest('.item-content').find('.btn-more-item1').addClass('btn-expand-short'); 27091 } 27092 }); 27093 }); 27094 27095 // More attribute setup 27096 $('body').on('click', '.hover-cursor-attribute', function () { 27097 isMoreRoomAmenitiesSelected = true; 27098 if ($(this).find('.attr').text().trim() == "More") { 27099 $(this).find('.attr').text(" Less"); 27100 $(this).find('i').removeClass('ion-ios-add'); 27101 $(this).find('i').addClass('ion-md-remove'); 27102 $(this).parent().find('.hidden-attribute').removeClass('d-none'); 27103 } else { 27104 $(this).find('.attr').text(" More"); 27105 $(this).find('i').addClass('ion-ios-add'); 27106 $(this).find('i').removeClass('ion-md-remove'); 27107 $(this).parent().find('.hidden-attribute').addClass('d-none'); 27108 } 27109 }); 27110 }); 27111 $(document).on('click', '.skypalace-hotel-list-info', function (event) { 27112 if (!isMoreRoomAmenitiesSelected) { 27113 var url = $(this).data('url'); 27114 window.open(url, '_blank'); 27115 } 27116 isMoreRoomAmenitiesSelected = false; 27117 }); 27118 $(window).scroll(function () { 27119 var header_top = $('.hotel-info-header-bind').offset().top; 27120 var header_top_bind = $('.hotel-info-header-bind').offset().top; 27121 header_top_bind += $('.hotel-info-header-bind').height(); 27122 header_top_bind -= $('.hotel-info-header').height() * 2; 27123 var commonWidth = $('.hotel-info-header-bind').width(); 27124 var currentScroll = $(window).scrollTop(); 27125 27126 // Recommeded scroll 27127 if (currentScroll >= header_top && currentScroll <= header_top_bind - $('.hotel-info-header').height()) { 27128 $('.hotel-info-header-m').css({ 27129 'width': commonWidth + "px", 27130 'z-index': '1000', 27131 'display': 'block', 27132 'top': '0' 27133 }); 27134 } else { 27135 $('.hotel-info-header-m').css({ 27136 'display': 'none' 27137 }); 27138 } 27139 }); 27140 $(document).ready(function () { 27141 me.main_content_loading = false; 27142 if (me.searchFilter.layout == 'map') { 27143 $('#show-all-services').click(function () { 27144 $('#advance_filters').toggleClass('d-none'); 27145 }); 27146 var currentActiveMarker = null; 27147 $('body').on('mouseover', '.each-hotels', function () { 27148 if (currentActiveMarker !== $(this).data('hotel-id')) { 27149 me.mapEngine.infoboxs.forEach(function (value) { 27150 value.close(); 27151 }); 27152 currentActiveMarker = $(this).data('hotel-id'); 27153 var deepCopy = me.currentMarkers.map(function (value) { 27154 return _objectSpread({}, value); 27155 }); 27156 me.mapEngine.clearMarkers(); 27157 var newMarkers = deepCopy.filter(function (value) { 27158 return value.id != currentActiveMarker; 27159 }); 27160 var activeMarker = deepCopy.filter(function (value) { 27161 return value.id == currentActiveMarker; 27162 }); 27163 if (activeMarker[0] !== undefined) activeMarker[0].hoverStat = true; 27164 var markerList = newMarkers.concat(activeMarker); 27165 me.mapEngine.addMarkers2(markerList, true); 27166 } 27167 }); 27168 } 27169 }); 27170 } 27171 } 27172}); 27173 27174/***/ }), 27175
27176/***/ "./resources/js/modules/user.js": 27177/*!**************************************!*\ 27178 !*** ./resources/js/modules/user.js ***! 27179 \**************************************/ 27180/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 27181 27182"use strict"; 27183__webpack_require__.r(__webpack_exports__); 27184/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27185/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 27186/* harmony export */ }); 27187/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 27188 otherData: {}, 27189 methods: { 27190 registerEvents: function registerEvents() { 27191 jQuery(function ($) { 27192 //Input group image select 27193 $('.upload-btn-wrapper').each(function () { 27194 var container = $(this); 27195 $(document).on('change', '.btn-file :file', function (event) { 27196 var files = event.target.files; 27197 var input = $(this); 27198 var formData = new FormData(); 27199 $.each(files, function (key, value) { 27200 formData.append('file', value); 27201 }); 27202 formData.append('type', "image"); 27203 $.ajax({ 27204 url: '/admin/module/media/store', 27205 type: 'POST', 27206 data: formData, 27207 enctype: 'multipart/form-data', 27208 beforeSend: function beforeSend() { 27209 input.trigger("bravo-file-before-update"); 27210 }, 27211 success: function success(data) { 27212 if (data.status === 1) { 27213 input.trigger("bravo-file-update-success", data); 27214 } else { 27215 input.trigger("bravo-file-update-error", data.message); 27216 } 27217 }, 27218 error: function error(xhr) { 27219 input.trigger("bravo-file-update-error"); 27220 }, 27221 complete: function complete() { 27222 input.trigger("bravo-file-update-complete"); 27223 }, 27224 cache: false, 27225 contentType: false, 27226 processData: false 27227 }); 27228 }); 27229 container.find('.btn-file :file').on('bravo-file-update-success', function (event, data) { 27230 console.log(data); 27231 container.find("input[type=hidden]").attr('value', data.data.id); 27232 container.find(".image-demo").attr('src', data.data.sizes["default"]); 27233 container.find(".text-view").attr('value', data.data.sizes["default"]); 27234 }); 27235 container.find('.btn-file :file').on('bravo-file-before-update', function () { 27236 container.find(".text-view").attr('value', container.find(".text-view").data("loading")); 27237 }); 27238 container.find('.btn-file :file').on('bravo-file-update-error', function (event, message) { 27239 if (message.length > 0) { 27240 container.find(".text-view").attr('value', message); 27241 } else { 27242 container.find(".text-view").attr('value', container.find(".text-view").data("error")); 27243 } 27244 }); 27245 }); 27246 $(".form-group-item").each(function () { 27247 var container = $(this); 27248 $(this).on('click', '.btn-remove-item', function () { 27249 $(this).closest(".item").remove(); 27250 }); 27251 $(this).on('press', 'input,select', function () { 27252 var value = $(this).val(); 27253 $(this).attr("value", value); 27254 }); 27255 }); 27256 $(document).on('click', ".form-group-item .btn-add-item", function () { 27257 var number = $(this).closest(".form-group-item").find(".g-items .item:last-child").data("number"); 27258 if (number === undefined) number = 0;else number++; 27259 var extra_html = $(this).closest(".form-group-item").find(".g-more").html(); 27260 extra_html = extra_html.replace(/__name__=/gi, "name="); 27261 extra_html = extra_html.replace(/__number__/gi, number); 27262 $(this).closest(".form-group-item").find(".g-items").append(extra_html); 27263 $("select[name=\"select[".concat(number, "]\"")).select2({ 27264 placeholder: "Select rooms" 27265 });
27266 if (extra_html.indexOf('dungdt-select2-field-lazy') > 0) { 27267 p.find('.dungdt-select2-field-lazy').each(function () { 27268 $(this).select2({ 27269 placeholder: "Select rooms" 27270 }); 27271 }); 27272 } 27273 }); 27274 $(document).on('click', '.dungdt-upload-box-normal .btn-field-upload,.dungdt-upload-box-normal .attach-demo', function () { 27275 var p = $(this).closest('.dungdt-upload-box'); 27276 uploaderModal.show({ 27277 multiple: false, 27278 file_type: 'image', 27279 onSelect: function onSelect(files) { 27280 p.addClass('active'); 27281 p.find('.attach-demo').html('<img src="' + files[0].thumb_size + '"/>'); 27282 p.find('input').val(files[0].id); 27283 } 27284 }); 27285 }); 27286 $('.dungdt-upload-box-normal .delete').click(function (e) { 27287 e.preventDefault(); 27288 var p = $(this).closest('.dungdt-upload-box'); 27289 p.find("input").attr('value', ''); 27290 p.removeClass("active"); 27291 }); 27292 $('.dungdt-upload-multiple').find('.btn-field-upload').click(function () { 27293 var p = $(this).closest('.dungdt-upload-multiple'); 27294 uploaderModal.show({ 27295 multiple: true, 27296 file_type: 'image', 27297 onSelect: function onSelect(files) { 27298 console.log(files); 27299 if (typeof files != 'undefined' && files.length) { 27300 var ids = []; 27301 var html = ''; 27302 p.addClass('active'); 27303 for (var i = 0; i < files.length; i++) { 27304 ids.push(files[i].id); 27305 html += '<div class="image-item"><div class="inner"><span class="delete btn btn-sm btn-danger"><i class="fa fa-trash"></i></span><img src="' + files[i].thumb_size + '"/></div></div>'; 27306 } 27307 p.find('.attach-demo').append(html); 27308 var old = p.find('input').val().split(','); 27309 p.find('input').val(ids.concat(old).join(',')); 27310 } 27311 } 27312 }); 27313 }); 27314 $('.dungdt-upload-multiple').on('click', '.image-item .delete', function () { 27315 var i = $(this).closest('.image-item').index(); 27316 var p = $(this).closest('.dungdt-upload-multiple'); 27317 var ids = p.find('input').val().split(','); 27318 ids.splice(i, 1); 27319 p.find('input').val(ids.join(',')); 27320 $(this).closest('.image-item').remove(); 27321 }); 27322 $(".bravo_user_profile .sidebar-menu .caret").click(function () { 27323 $(this).closest("li").toggleClass("active_child"); 27324 }); 27325 $(".bravo_user_profile .bravo-list-item .control-action .btn-danger").click(function () { 27326 var c = confirm($(this).data('confirm')); 27327 if (!c) { 27328 return false; 27329 } 27330 }); 27331 $(".bravo_user_profile .bravo-list-item .control-action .btn-recovery").click(function () { 27332 var c = confirm($(this).data('confirm')); 27333 if (!c) { 27334 return false; 27335 } 27336 }); 27337 function makeid(length) { 27338 var result = ''; 27339 var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; 27340 var charactersLength = characters.length; 27341 for (var i = 0; i < length; i++) { 27342 result += characters.charAt(Math.floor(Math.random() * charactersLength)); 27343 } 27344 return result; 27345 } 27346 // Form Configs 27347 $('.has-ckeditor').each(function () { 27348 var els = $(this); 27349 var id = $(this).attr('id'); 27350 if (!id) { 27351 id = makeid(10); 27352 $(this).attr('id', id); 27353 } 27354 var h = els.data('height'); 27355 if (!h && typeof h == 'undefined') h = 300; 27356 27357 // CKEDITOR.replace( id ); 27358 tinymce.init({ 27359 selector: '#' + id, 27360 plugins: 'preview searchreplace autolink code fullscreen image link media codesample table charmap hr toc advlist lists wordcount imagetools textpattern help pagebreak hr', 27361 toolbar: 'formatselect | bold italic strikethrough forecolor backcolor permanentpen formatpainter | link image media | alignleft aligncenter alignright al
27361ignjustify | numlist bullist outdent indent | pagebreak codesample code| removeformat', 27362 image_advtab: true, 27363 image_caption: true, 27364 toolbar_drawer: 'sliding', 27365 relative_urls: false, 27366 height: h, 27367 file_picker_callback: function file_picker_callback(callback, value, meta) { 27368 /* Provide file and text for the link dialog */ 27369 if (meta.filetype === 'file') { 27370 uploaderModal.show({ 27371 multiple: false, 27372 file_type: 'video', 27373 onSelect: function onSelect(files) { 27374 if (files.length) callback(fresco.url + '/media/preview/' + files[0].id); 27375 } 27376 }); 27377 } 27378 27379 /* Provide image and alt text for the image dialog */ 27380 if (meta.filetype === 'image') { 27381 uploaderModal.show({ 27382 multiple: false, 27383 file_type: 'image', 27384 onSelect: function onSelect(files) { 27385 if (files.length) callback(files[0].thumb_size); 27386 } 27387 }); 27388 } 27389 27390 /* Provide alternative source and posted for the media dialog */ 27391 if (meta.filetype === 'media') { 27392 uploaderModal.show({ 27393 multiple: false, 27394 file_type: 'video', 27395 onSelect: function onSelect(files) { 27396 if (files.length) callback(fresco.url + '/media/preview/' + files[0].id); 27397 } 27398 }); 27399 } 27400 } 27401 }); 27402 }); 27403 $(".bravo_user_profile .sidebar-menu .active_child").each(function () { 27404 $(this).closest('.has-children').addClass('active_child').addClass('active'); 27405 }); 27406 $('.form-add-service .nav-tabs a').click(function () { 27407 setTimeout(function () { 27408 window.dispatchEvent(new Event('resize')); 27409 }, 200); 27410 }); 27411 $('.btn-upload-private-file').change(function () { 27412 var me = $(this); 27413 var p = $(this).closest('.btn-upload-private-wrap'); 27414 var lists = p.find('.private-file-lists'); 27415 me.isLoading = true; 27416 for (var i = 0; i < me.get(0).files.length; i++) { 27417 var d = new FormData(); 27418 d.append('file', me.get(0).files[i]); 27419 $.ajax({ 27420 url: fresco.url + '/media/private/store', 27421 data: d, 27422 dataType: 'json', 27423 type: 'post', 27424 contentType: false, 27425 processData: false, 27426 success: function success(res) { 27427 me.val(''); 27428 if (res.status === 0) { 27429 frescoApp.showError(res); 27430 } 27431 if (res.data) { 27432 var div = $('<div/>'); 27433 var input = $("<input/>"); 27434 input.attr('type', 'hidden'); 27435 input.attr('name', me.data('name')); 27436 input.val(JSON.stringify(res.data)); 27437 div.append(input); 27438 div.append("<a target='_blank' href='" + res.data.download + "'> " + res.data.name + '.' + res.data.file_extension + " <i class=\"fa fa-download\"></i> </a>"); 27439 if (me.data('multiple')) { 27440 lists.append(div); 27441 } else { 27442 lists.html(div); 27443 } 27444 } 27445 }, 27446 error: function error(e) { 27447 frescoApp.showAjaxError(e); 27448 me.val(''); 27449 } 27450 }); 27451 } 27452 }); 27453 }); 27454 var vendorPayout = { 27455 saveAccounts: function saveAccounts(btn) { 27456 var parent = $(btn).closest('.bravo-form'); 27457 parent.addClass('loading'); 27458 $.ajax({ 27459 url: fresco.url + '/vendor/storePayoutAccounts', 27460 method: "post", 27461 data: parent.find('input,select,textarea').serialize(), 27462 dataType: 'json', 27463 success: function success(json) { 27464 parent.removeClass('loading'); 27465 if (json.message) { 27466 frescoApp.showSuccess(json.message); 27467 } 27468 if (json.status) { 27469 window.setTimeout(function () { 27470 window.location.reload(); 27471 }, 2000); 27472 } 27473 }, 27474 error: function error(e) { 27475 console.log(e); 27476 parent.removeClass('loading'); 27477 frescoApp.showAjaxError(e); 27478 } 27479 }); 27480 }, 27481 sendRequest: function sendRequest(btn) { 27482 var parent = $(btn).closest('.modal'); 27483 var form = parent.find('form'); 27484 form.removeClass('was-validated'); 27485 if (form[0].checkValidity() === false) { 27486 form.addClass('was-validated'); 27487 return false;
27488 } 27489 parent.addClass('loading'); 27490 $.ajax({ 27491 url: fresco.url + '/vendor/createPayoutRequest', 27492 method: "post", 27493 data: form.find('input,select,textarea').serialize(), 27494 dataType: 'json', 27495 success: function success(json) { 27496 parent.removeClass('loading'); 27497 if (json.message) { 27498 frescoApp.showSuccess(json.message); 27499 } 27500 if (json.status) { 27501 window.setTimeout(function () { 27502 window.location.reload(); 27503 }, 3000); 27504 } 27505 }, 27506 error: function error(e) { 27507 console.log(e); 27508 parent.removeClass('loading'); 27509 frescoApp.showAjaxError(e); 27510 } 27511 }); 27512 } 27513 }; 27514 } 27515 } 27516}); 27517 27518/***/ }), 27519
vendor: 544,380 bytes, lines 27520-44731
27520/***/ "./node_modules/lodash/lodash.js": 27521/*!***************************************!*\ 27522 !*** ./node_modules/lodash/lodash.js ***! 27523 \***************************************/ 27524/***/ (function(module, exports, __webpack_require__) { 27525 27526/* module decorator */ module = __webpack_require__.nmd(module); 27527var __WEBPACK_AMD_DEFINE_RESULT__;/** 27528 * @license 27529 * Lodash <https://lodash.com/> 27530 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 27531 * Released under MIT license <https://lodash.com/license> 27532 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 27533 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 27534 */ 27535;(function() { 27536 27537 /** Used as a safe reference for `undefined` in pre-ES5 environments. */ 27538 var undefined; 27539 27540 /** Used as the semantic version number. */ 27541 var VERSION = '4.17.21'; 27542 27543 /** Used as the size to enable large array optimizations. */ 27544 var LARGE_ARRAY_SIZE = 200; 27545 27546 /** Error message constants. */ 27547 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', 27548 FUNC_ERROR_TEXT = 'Expected a function', 27549 INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; 27550 27551 /** Used to stand-in for `undefined` hash values. */ 27552 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 27553 27554 /** Used as the maximum memoize cache size. */ 27555 var MAX_MEMOIZE_SIZE = 500; 27556 27557 /** Used as the internal argument placeholder. */ 27558 var PLACEHOLDER = '__lodash_placeholder__'; 27559 27560 /** Used to compose bitmasks for cloning. */ 27561 var CLONE_DEEP_FLAG = 1, 27562 CLONE_FLAT_FLAG = 2, 27563 CLONE_SYMBOLS_FLAG = 4; 27564 27565 /** Used to compose bitmasks for value comparisons. */ 27566 var COMPARE_PARTIAL_FLAG = 1, 27567 COMPARE_UNORDERED_FLAG = 2; 27568 27569 /** Used to compose bitmasks for function metadata. */ 27570 var WRAP_BIND_FLAG = 1, 27571 WRAP_BIND_KEY_FLAG = 2, 27572 WRAP_CURRY_BOUND_FLAG = 4, 27573 WRAP_CURRY_FLAG = 8, 27574 WRAP_CURRY_RIGHT_FLAG = 16, 27575 WRAP_PARTIAL_FLAG = 32, 27576 WRAP_PARTIAL_RIGHT_FLAG = 64, 27577 WRAP_ARY_FLAG = 128, 27578 WRAP_REARG_FLAG = 256, 27579 WRAP_FLIP_FLAG = 512; 27580 27581 /** Used as default options for `_.truncate`. */ 27582 var DEFAULT_TRUNC_LENGTH = 30, 27583 DEFAULT_TRUNC_OMISSION = '...'; 27584 27585 /** Used to detect hot functions by number of calls within a span of milliseconds. */ 27586 var HOT_COUNT = 800, 27587 HOT_SPAN = 16; 27588 27589 /** Used to indicate the type of lazy iteratees. */ 27590 var LAZY_FILTER_FLAG = 1, 27591 LAZY_MAP_FLAG = 2, 27592 LAZY_WHILE_FLAG = 3; 27593 27594 /** Used as references for various `Number` constants. */ 27595 var INFINITY = 1 / 0, 27596 MAX_SAFE_INTEGER = 9007199254740991, 27597 MAX_INTEGER = 1.7976931348623157e+308, 27598 NAN = 0 / 0; 27599 27600 /** Used as references for the maximum length and index of an array. */ 27601 var MAX_ARRAY_LENGTH = 4294967295, 27602 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, 27603 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; 27604 27605 /** Used to associate wrap methods with their bit flags. */ 27606 var wrapFlags = [ 27607 ['ary', WRAP_ARY_FLAG], 27608 ['bind', WRAP_BIND_FLAG], 27609 ['bindKey', WRAP_BIND_KEY_FLAG], 27610 ['curry', WRAP_CURRY_FLAG], 27611 ['curryRight', WRAP_CURRY_RIGHT_FLAG], 27612 ['flip', WRAP_FLIP_FLAG], 27613 ['partial', WRAP_PARTIAL_FLAG], 27614 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], 27615 ['rearg', WRAP_REARG_FLAG] 27616 ]; 27617 27618 /** `Object#toString` result references. */ 27619 var argsTag = '[object Arguments]', 27620 arrayTag = '[object Array]', 27621 asyncTag = '[object AsyncFunction]', 27622 boolTag = '[object Boolean]', 27623 dateTag = '[object Date]', 27624 domExcTag = '[object DOMException]', 27625 errorTag = '[object Error]', 27626 funcTag = '[object Function]', 27627 genTag = '[object GeneratorFunction]', 27628 mapTag = '[object Map]', 27629 numberTag = '[object Number]', 27630 nullTag = '[object Null]', 27631 objectTag = '[object Object]', 27632 promiseTag = '[object Promise]', 27633 proxyTag = '[object Proxy]', 27634 regexpTag = '[object RegExp]', 27635 setTag = '[object Set]', 27636 stringTag = '[object String]', 27637 symbolTag = '[object Symbol]', 27638 undefinedTag = '[object Undefined]', 27639 weakMapTag = '[object WeakMap]', 27640 weakSetTag = '[object WeakSet]'; 27641 27642 var arrayBufferTag = '[object ArrayBuffer]', 27643 dataViewTag = '[object DataView]', 27644 float32Tag = '[object Float32Array]', 27645 float64Tag = '[object Float64Array]', 27646 int8Tag = '[object Int8Array]', 27647 int16Tag = '[object Int16Array]', 27648 int32Tag = '[object Int32Array]', 27649 uint8Tag = '[object Uint8Array]', 27650 uint8ClampedTag = '[object Uint8ClampedArray]', 27651 uint16Tag = '[object Uint16Array]', 27652 uint32Tag = '[object Uint32Array]'; 27653 27654 /** Used to match empty string literals in compiled template source. */ 27655 var reEmptyStringLeading = /\b__p \+= '';/g, 27656 reEmptyStringMiddle = /\b(__p \+=) '' \+/g, 27657 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; 27658 27659 /** Used to match HTML entities and HTML characters. */ 27660 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, 27661 reUnescapedHtml = /[&<>"']/g, 27662 reHasEscapedHtml = RegExp(reEscapedHtml.source), 27663 reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 27664 27665 /** Used to match template delimiters. */ 27666 var reEscape = /<%-([\s\S]+?)%>/g, 27667 reEvaluate = /<%([\s\S]+?)%>/g, 27668 reInterpolate = /<%=([\s\S]+?)%>/g; 27669 27670 /** Used to match property names within property paths. */ 27671 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, 27672 reIsPlainProp = /^\w*$/, 27673 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 27674 27675 /** 27676 * Used to match `RegExp` 27677 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 27678 */ 27679 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, 27680 reHasRegExpChar = RegExp(reRegExpChar.source); 27681 27682 /** Used to match leading whitespace. */ 27683 var reTrimStart = /^\s+/; 27684 27685 /** Used to match a single whitespace character. */ 27686 var reWhitespace = /\s/; 27687 27688 /** Used to match wrap detail comments. */ 27689 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, 27690 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, 27691 reSplitDetails = /,? & /; 27692 27693 /** Used to match words composed of alphanumeric characters. */ 27694 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 27695 27696 /** 27697 * Used to validate the `validate` option in `_.template` variable. 27698 * 27699 * Forbids characters which could potentially change the meaning of the function argument definition: 27700 * - "()," (modification of function parameters) 27701 * - "=" (default value) 27702 * - "[]{}" (destructuring of function parameters) 27703 * - "/" (beginning of a comment) 27704 * - whitespace 27705 */ 27706 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; 27707 27708 /** Used to match backslashes in property paths. */ 27709 var reEscapeChar = /\\(\\)?/g; 27710 27711 /** 27712 * Used to match 27713 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). 27714 */ 27715 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; 27716 27717 /** Used to match `RegExp` flags from their coerced string values. */ 27718 var reFlags = /\w*$/; 27719 27720 /** Used to detect bad signed hexadecimal string values. */ 27721 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 27722 27723 /** Used to detect binary string values. */ 27724 var reIsBinary = /^0b[01]+$/i; 27725 27726 /** Used to detect host constructors (Safari). */ 27727 var reIsHostCtor = /^\[object .+?Constructor\]$/; 27728 27729 /** Used to detect octal string values. */ 27730 var reIsOctal = /^0o[0-7]+$/i; 27731 27732 /** Used to detect unsigned integer values. */ 27733 var reIsUint = /^(?:0|[1-9]\d*)$/; 27734 27735 /** Used to match Latin Unicode letters (excluding mathematical operators). */ 27736 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 27737 27738 /** Used to ensure capturing order of template delimiters. */ 27739 var reNoMatch = /($^)/; 27740 27741 /** Used to match unescaped characters in compiled string literals. */ 27742 var reUnescapedString = /['\n\r\u2028\u2029\\]/g; 27743 27744 /** Used to compose unicode character classes. */ 27745 var rsAstralRange = '\\ud800-\\udfff', 27746 rsComboMarksRange = '\\u0300-\\u036f', 27747 reComboHalfMarksRange = '\\ufe20-\\ufe2f', 27748 rsComboSymbolsRange = '\\u20d0-\\u20ff', 27749 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, 27750 rsDingbatRange = '\\u2700-\\u27bf', 27751 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', 27752 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', 27753 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', 27754 rsPunctuationRange = '\\u2000-\\u206f', 27755 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', 27756 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', 27757 rsVarRange = '\\ufe0e\\ufe0f', 27758 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 27759 27760 /** Used to compose unicode capture groups. */ 27761 var rsApos = "['\u2019]", 27762 rsAstral = '[' + rsAstralRange + ']', 27763 rsBreak = '[' + rsBreakRange + ']', 27764 rsCombo = '[' + rsComboRange + ']', 27765 rsDigits = '\\d+', 27766 rsDingbat = '[' + rsDingbatRange + ']', 27767 rsLower = '[' + rsLowerRange + ']', 27768 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', 27769 rsFitz = '\\ud83c[\\udffb-\\udfff]', 27770 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', 27771 rsNonAstral = '[^' + rsAstralRange + ']', 27772 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', 27773 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', 27774 rsUpper = '[' + rsUpperRange + ']', 27775 rsZWJ = '\\u200d'; 27776 27777 /** Used to compose unicode regexes. */ 27778 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', 27779 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', 27780 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', 27781 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', 27782 reOptMod = rsModifier + '?', 27783 rsOptVar = '[' + rsVarRange + ']?', 27784 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', 27785 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', 27786 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', 27787 rsSeq = rsOptVar + reOptMod + rsOptJoin, 27788 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, 27789 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; 27790 27791 /** Used to match apostrophes. */ 27792 var reApos = RegExp(rsApos, 'g'); 27793 27794 /** 27795 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and 27796 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). 27797 */ 27798 var reComboMark = RegExp(rsCombo, 'g'); 27799 27800 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ 27801 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); 27802 27803 /** Used to match complex or compound words. */ 27804 var reUnicodeWord = RegExp([ 27805 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', 27806 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', 27807 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, 27808 rsUpper + '+' + rsOptContrUpper, 27809 rsOrdUpper, 27810 rsOrdLower, 27811 rsDigits, 27812 rsEmoji 27813 ].join('|'), 'g'); 27814 27815 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ 27816 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); 27817 27818 /** Used to detect strings that need a more robust regexp to match words. */ 27819 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 ]/; 27820 27821 /** Used to assign default `context` object properties. */ 27822 var contextProps = [ 27823 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 27824 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 27825 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 27826 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 27827 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' 27828 ]; 27829 27830 /** Used to make template sourceURLs easier to identify. */ 27831 var templateCounter = -1; 27832 27833 /** Used to identify `toStringTag` values of typed arrays. */ 27834 var typedArrayTags = {}; 27835 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = 27836 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = 27837 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = 27838 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = 27839 typedArrayTags[uint32Tag] = true; 27840 typedArrayTags[argsTag] = typedArrayTags[arrayTag] = 27841 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = 27842 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = 27843 typedArrayTags[errorTag] = typedArrayTags[funcTag] = 27844 typedArrayTags[mapTag] = typedArrayTags[numberTag] = 27845 typedArrayTags[objectTag] = typedArrayTags[regexpTag] = 27846 typedArrayTags[setTag] = typedArrayTags[stringTag] = 27847 typedArrayTags[weakMapTag] = false; 27848 27849 /** Used to identify `toStringTag` values supported by `_.clone`. */ 27850 var cloneableTags = {}; 27851 cloneableTags[argsTag] = cloneableTags[arrayTag] = 27852 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = 27853 cloneableTags[boolTag] = cloneableTags[dateTag] = 27854 cloneableTags[float32Tag] = cloneableTags[float64Tag] = 27855 cloneableTags[int8Tag] = cloneableTags[int16Tag] = 27856 cloneableTags[int32Tag] = cloneableTags[mapTag] = 27857 cloneableTags[numberTag] = cloneableTags[objectTag] = 27858 cloneableTags[regexpTag] = cloneableTags[setTag] = 27859 cloneableTags[stringTag] = cloneableTags[symbolTag] = 27860 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = 27861 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 27862 cloneableTags[errorTag] = cloneableTags[funcTag] = 27863 cloneableTags[weakMapTag] = false; 27864 27865 /** Used to map Latin Unicode letters to basic Latin letters. */ 27866 var deburredLetters = { 27867 // Latin-1 Supplement block. 27868 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', 27869 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', 27870 '\xc7': 'C', '\xe7': 'c', 27871 '\xd0': 'D', '\xf0': 'd', 27872 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', 27873 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', 27874 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', 27875 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', 27876 '\xd1': 'N', '\xf1': 'n', 27877 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', 27878 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', 27879 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', 27880 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', 27881 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', 27882 '\xc6': 'Ae', '\xe6': 'ae', 27883 '\xde': 'Th', '\xfe': 'th', 27884 '\xdf': 'ss', 27885 // Latin Extended-A block. 27886 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', 27887 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', 27888 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', 27889 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', 27890 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', 27891 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', 27892 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', 27893 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', 27894 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', 27895 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', 27896 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', 27897 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', 27898 '\u0134': 'J', '\u0135': 'j', 27899 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', 27900 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', 27901 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', 27902 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', 27903 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', 27904 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', 27905 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', 27906 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', 27907 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', 27908 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', 27909 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', 27910 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', 27911 '\u0163': 't', '\u0165': 't', '\u0167': 't', 27912 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', 27913 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', 27914 '\u0174': 'W', '\u0175': 'w', 27915 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', 27916 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', 27917 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', 27918 '\u0132': 'IJ', '\u0133': 'ij', 27919 '\u0152': 'Oe', '\u0153': 'oe', 27920 '\u0149': "'n", '\u017f': 's' 27921 }; 27922 27923 /** Used to map characters to HTML entities. */ 27924 var htmlEscapes = { 27925 '&': '&', 27926 '<': '<', 27927 '>': '>', 27928 '"': '"', 27929 "'": ''' 27930 }; 27931 27932 /** Used to map HTML entities to characters. */ 27933 var htmlUnescapes = { 27934 '&': '&', 27935 '<': '<', 27936 '>': '>', 27937 '"': '"', 27938 ''': "'" 27939 }; 27940 27941 /** Used to escape characters for inclusion in compiled string literals. */ 27942 var stringEscapes = { 27943 '\\': '\\', 27944 "'": "'", 27945 '\n': 'n', 27946 '\r': 'r', 27947 '\u2028': 'u2028', 27948 '\u2029': 'u2029' 27949 }; 27950 27951 /** Built-in method references without a dependency on `root`. */ 27952 var freeParseFloat = parseFloat, 27953 freeParseInt = parseInt; 27954 27955 /** Detect free variable `global` from Node.js. */ 27956 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; 27957 27958 /** Detect free variable `self`. */ 27959 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 27960 27961 /** Used as a reference to the global object. */ 27962 var root = freeGlobal || freeSelf || Function('return this')(); 27963 27964 /** Detect free variable `exports`. */ 27965 var freeExports = true && exports && !exports.nodeType && exports; 27966 27967 /** Detect free variable `module`. */ 27968 var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; 27969 27970 /** Detect the popular CommonJS extension `module.exports`. */ 27971 var moduleExports = freeModule && freeModule.exports === freeExports; 27972 27973 /** Detect free variable `process` from Node.js. */ 27974 var freeProcess = moduleExports && freeGlobal.process; 27975 27976 /** Used to access faster Node.js helpers. */ 27977 var nodeUtil = (function() { 27978 try { 27979 // Use `util.types` for Node.js 10+. 27980 var types = freeModule && freeModule.require && freeModule.require('util').types; 27981 27982 if (types) { 27983 return types; 27984 } 27985 27986 // Legacy `process.binding('util')` for Node.js < 10. 27987 return freeProcess && freeProcess.binding && freeProcess.binding('util'); 27988 } catch (e) {} 27989 }()); 27990 27991 /* Node.js helper references. */ 27992 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, 27993 nodeIsDate = nodeUtil && nodeUtil.isDate, 27994 nodeIsMap = nodeUtil && nodeUtil.isMap, 27995 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, 27996 nodeIsSet = nodeUtil && nodeUtil.isSet, 27997 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 27998 27999 /*--------------------------------------------------------------------------*/ 28000 28001 /** 28002 * A faster alternative to `Function#apply`, this function invokes `func` 28003 * with the `this` binding of `thisArg` and the arguments of `args`. 28004 * 28005 * @private 28006 * @param {Function} func The function to invoke. 28007 * @param {*} thisArg The `this` binding of `func`. 28008 * @param {Array} args The arguments to invoke `func` with. 28009 * @returns {*} Returns the result of `func`. 28010 */ 28011 function apply(func, thisArg, args) { 28012 switch (args.length) { 28013 case 0: return func.call(thisArg); 28014 case 1: return func.call(thisArg, args[0]); 28015 case 2: return func.call(thisArg, args[0], args[1]); 28016 case 3: return func.call(thisArg, args[0], args[1], args[2]); 28017 } 28018 return func.apply(thisArg, args); 28019 } 28020 28021 /** 28022 * A specialized version of `baseAggregator` for arrays. 28023 * 28024 * @private 28025 * @param {Array} [array] The array to iterate over. 28026 * @param {Function} setter The function to set `accumulator` values. 28027 * @param {Function} iteratee The iteratee to transform keys. 28028 * @param {Object} accumulator The initial aggregated object. 28029 * @returns {Function} Returns `accumulator`. 28030 */ 28031 function arrayAggregator(array, setter, iteratee, accumulator) { 28032 var index = -1, 28033 length = array == null ? 0 : array.length; 28034 28035 while (++index < length) { 28036 var value = array[index]; 28037 setter(accumulator, value, iteratee(value), array); 28038 } 28039 return accumulator; 28040 } 28041 28042 /** 28043 * A specialized version of `_.forEach` for arrays without support for 28044 * iteratee shorthands. 28045 * 28046 * @private 28047 * @param {Array} [array] The array to iterate over. 28048 * @param {Function} iteratee The function invoked per iteration. 28049 * @returns {Array} Returns `array`. 28050 */ 28051 function arrayEach(array, iteratee) { 28052 var index = -1, 28053 length = array == null ? 0 : array.length; 28054 28055 while (++index < length) { 28056 if (iteratee(array[index], index, array) === false) { 28057 break; 28058 } 28059 } 28060 return array; 28061 } 28062 28063 /** 28064 * A specialized version of `_.forEachRight` for arrays without support for 28065 * iteratee shorthands. 28066 * 28067 * @private 28068 * @param {Array} [array] The array to iterate over. 28069 * @param {Function} iteratee The function invoked per iteration. 28070 * @returns {Array} Returns `array`. 28071 */ 28072 function arrayEachRight(array, iteratee) { 28073 var length = array == null ? 0 : array.length; 28074 28075 while (length--) { 28076 if (iteratee(array[length], length, array) === false) { 28077 break; 28078 } 28079 } 28080 return array; 28081 } 28082 28083 /** 28084 * A specialized version of `_.every` for arrays without support for 28085 * iteratee shorthands. 28086 * 28087 * @private 28088 * @param {Array} [array] The array to iterate over. 28089 * @param {Function} predicate The function invoked per iteration. 28090 * @returns {boolean} Returns `true` if all elements pass the predicate check, 28091 * else `false`. 28092 */ 28093 function arrayEvery(array, predicate) { 28094 var index = -1, 28095 length = array == null ? 0 : array.length; 28096 28097 while (++index < length) { 28098 if (!predicate(array[index], index, array)) { 28099 return false; 28100 } 28101 } 28102 return true; 28103 } 28104 28105 /** 28106 * A specialized version of `_.filter` for arrays without support for 28107 * iteratee shorthands. 28108 * 28109 * @private 28110 * @param {Array} [array] The array to iterate over. 28111 * @param {Function} predicate The function invoked per iteration. 28112 * @returns {Array} Returns the new filtered array. 28113 */ 28114 function arrayFilter(array, predicate) { 28115 var index = -1, 28116 length = array == null ? 0 : array.length, 28117 resIndex = 0, 28118 result = []; 28119 28120 while (++index < length) { 28121 var value = array[index]; 28122 if (predicate(value, index, array)) { 28123 result[resIndex++] = value; 28124 } 28125 } 28126 return result; 28127 } 28128 28129 /** 28130 * A specialized version of `_.includes` for arrays without support for 28131 * specifying an index to search from. 28132 * 28133 * @private 28134 * @param {Array} [array] The array to inspect. 28135 * @param {*} target The value to search for. 28136 * @returns {boolean} Returns `true` if `target` is found, else `false`. 28137 */ 28138 function arrayIncludes(array, value) { 28139 var length = array == null ? 0 : array.length; 28140 return !!length && baseIndexOf(array, value, 0) > -1; 28141 } 28142 28143 /** 28144 * This function is like `arrayIncludes` except that it accepts a comparator. 28145 * 28146 * @private 28147 * @param {Array} [array] The array to inspect. 28148 * @param {*} target The value to search for. 28149 * @param {Function} comparator The comparator invoked per element. 28150 * @returns {boolean} Returns `true` if `target` is found, else `false`. 28151 */ 28152 function arrayIncludesWith(array, value, comparator) { 28153 var index = -1, 28154 length = array == null ? 0 : array.length; 28155 28156 while (++index < length) { 28157 if (comparator(value, array[index])) { 28158 return true; 28159 } 28160 } 28161 return false; 28162 } 28163 28164 /** 28165 * A specialized version of `_.map` for arrays without support for iteratee 28166 * shorthands. 28167 * 28168 * @private 28169 * @param {Array} [array] The array to iterate over. 28170 * @param {Function} iteratee The function invoked per iteration. 28171 * @returns {Array} Returns the new mapped array. 28172 */ 28173 function arrayMap(array, iteratee) { 28174 var index = -1, 28175 length = array == null ? 0 : array.length, 28176 result = Array(length); 28177 28178 while (++index < length) { 28179 result[index] = iteratee(array[index], index, array); 28180 } 28181 return result; 28182 } 28183 28184 /** 28185 * Appends the elements of `values` to `array`. 28186 * 28187 * @private 28188 * @param {Array} array The array to modify. 28189 * @param {Array} values The values to append. 28190 * @returns {Array} Returns `array`. 28191 */ 28192 function arrayPush(array, values) { 28193 var index = -1, 28194 length = values.length, 28195 offset = array.length; 28196 28197 while (++index < length) { 28198 array[offset + index] = values[index]; 28199 } 28200 return array; 28201 } 28202 28203 /** 28204 * A specialized version of `_.reduce` for arrays without support for 28205 * iteratee shorthands. 28206 * 28207 * @private 28208 * @param {Array} [array] The array to iterate over. 28209 * @param {Function} iteratee The function invoked per iteration. 28210 * @param {*} [accumulator] The initial value. 28211 * @param {boolean} [initAccum] Specify using the first element of `array` as 28212 * the initial value. 28213 * @returns {*} Returns the accumulated value. 28214 */ 28215 function arrayReduce(array, iteratee, accumulator, initAccum) { 28216 var index = -1, 28217 length = array == null ? 0 : array.length; 28218 28219 if (initAccum && length) { 28220 accumulator = array[++index]; 28221 } 28222 while (++index < length) { 28223 accumulator = iteratee(accumulator, array[index], index, array); 28224 } 28225 return accumulator; 28226 } 28227 28228 /** 28229 * A specialized version of `_.reduceRight` for arrays without support for 28230 * iteratee shorthands. 28231 * 28232 * @private 28233 * @param {Array} [array] The array to iterate over. 28234 * @param {Function} iteratee The function invoked per iteration. 28235 * @param {*} [accumulator] The initial value. 28236 * @param {boolean} [initAccum] Specify using the last element of `array` as 28237 * the initial value. 28238 * @returns {*} Returns the accumulated value. 28239 */ 28240 function arrayReduceRight(array, iteratee, accumulator, initAccum) { 28241 var length = array == null ? 0 : array.length; 28242 if (initAccum && length) { 28243 accumulator = array[--length]; 28244 } 28245 while (length--) { 28246 accumulator = iteratee(accumulator, array[length], length, array); 28247 } 28248 return accumulator; 28249 } 28250 28251 /** 28252 * A specialized version of `_.some` for arrays without support for iteratee 28253 * shorthands. 28254 * 28255 * @private 28256 * @param {Array} [array] The array to iterate over. 28257 * @param {Function} predicate The function invoked per iteration. 28258 * @returns {boolean} Returns `true` if any element passes the predicate check, 28259 * else `false`. 28260 */ 28261 function arraySome(array, predicate) { 28262 var index = -1, 28263 length = array == null ? 0 : array.length; 28264 28265 while (++index < length) { 28266 if (predicate(array[index], index, array)) { 28267 return true; 28268 } 28269 } 28270 return false; 28271 } 28272 28273 /** 28274 * Gets the size of an ASCII `string`. 28275 * 28276 * @private 28277 * @param {string} string The string inspect. 28278 * @returns {number} Returns the string size. 28279 */ 28280 var asciiSize = baseProperty('length'); 28281 28282 /** 28283 * Converts an ASCII `string` to an array. 28284 * 28285 * @private 28286 * @param {string} string The string to convert. 28287 * @returns {Array} Returns the converted array. 28288 */ 28289 function asciiToArray(string) { 28290 return string.split(''); 28291 } 28292 28293 /** 28294 * Splits an ASCII `string` into an array of its words. 28295 * 28296 * @private 28297 * @param {string} The string to inspect. 28298 * @returns {Array} Returns the words of `string`. 28299 */ 28300 function asciiWords(string) { 28301 return string.match(reAsciiWord) || []; 28302 } 28303 28304 /** 28305 * The base implementation of methods like `_.findKey` and `_.findLastKey`, 28306 * without support for iteratee shorthands, which iterates over `collection` 28307 * using `eachFunc`. 28308 * 28309 * @private 28310 * @param {Array|Object} collection The collection to inspect. 28311 * @param {Function} predicate The function invoked per iteration. 28312 * @param {Function} eachFunc The function to iterate over `collection`. 28313 * @returns {*} Returns the found element or its key, else `undefined`. 28314 */ 28315 function baseFindKey(collection, predicate, eachFunc) { 28316 var result; 28317 eachFunc(collection, function(value, key, collection) { 28318 if (predicate(value, key, collection)) { 28319 result = key; 28320 return false; 28321 } 28322 }); 28323 return result; 28324 } 28325 28326 /** 28327 * The base implementation of `_.findIndex` and `_.findLastIndex` without 28328 * support for iteratee shorthands. 28329 * 28330 * @private 28331 * @param {Array} array The array to inspect. 28332 * @param {Function} predicate The function invoked per iteration. 28333 * @param {number} fromIndex The index to search from. 28334 * @param {boolean} [fromRight] Specify iterating from right to left. 28335 * @returns {number} Returns the index of the matched value, else `-1`. 28336 */ 28337 function baseFindIndex(array, predicate, fromIndex, fromRight) { 28338 var length = array.length, 28339 index = fromIndex + (fromRight ? 1 : -1); 28340 28341 while ((fromRight ? index-- : ++index < length)) { 28342 if (predicate(array[index], index, array)) { 28343 return index; 28344 } 28345 } 28346 return -1; 28347 } 28348 28349 /** 28350 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 28351 * 28352 * @private 28353 * @param {Array} array The array to inspect. 28354 * @param {*} value The value to search for. 28355 * @param {number} fromIndex The index to search from. 28356 * @returns {number} Returns the index of the matched value, else `-1`. 28357 */ 28358 function baseIndexOf(array, value, fromIndex) { 28359 return value === value 28360 ? strictIndexOf(array, value, fromIndex) 28361 : baseFindIndex(array, baseIsNaN, fromIndex); 28362 } 28363 28364 /** 28365 * This function is like `baseIndexOf` except that it accepts a comparator. 28366 * 28367 * @private 28368 * @param {Array} array The array to inspect. 28369 * @param {*} value The value to search for. 28370 * @param {number} fromIndex The index to search from. 28371 * @param {Function} comparator The comparator invoked per element. 28372 * @returns {number} Returns the index of the matched value, else `-1`. 28373 */ 28374 function baseIndexOfWith(array, value, fromIndex, comparator) { 28375 var index = fromIndex - 1, 28376 length = array.length; 28377 28378 while (++index < length) { 28379 if (comparator(array[index], value)) { 28380 return index; 28381 } 28382 } 28383 return -1; 28384 } 28385 28386 /** 28387 * The base implementation of `_.isNaN` without support for number objects. 28388 * 28389 * @private 28390 * @param {*} value The value to check. 28391 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 28392 */ 28393 function baseIsNaN(value) { 28394 return value !== value; 28395 } 28396 28397 /** 28398 * The base implementation of `_.mean` and `_.meanBy` without support for 28399 * iteratee shorthands. 28400 * 28401 * @private 28402 * @param {Array} array The array to iterate over. 28403 * @param {Function} iteratee The function invoked per iteration. 28404 * @returns {number} Returns the mean. 28405 */ 28406 function baseMean(array, iteratee) { 28407 var length = array == null ? 0 : array.length; 28408 return length ? (baseSum(array, iteratee) / length) : NAN; 28409 } 28410 28411 /** 28412 * The base implementation of `_.property` without support for deep paths. 28413 * 28414 * @private 28415 * @param {string} key The key of the property to get. 28416 * @returns {Function} Returns the new accessor function. 28417 */ 28418 function baseProperty(key) { 28419 return function(object) { 28420 return object == null ? undefined : object[key]; 28421 }; 28422 } 28423 28424 /** 28425 * The base implementation of `_.propertyOf` without support for deep paths. 28426 * 28427 * @private 28428 * @param {Object} object The object to query. 28429 * @returns {Function} Returns the new accessor function. 28430 */ 28431 function basePropertyOf(object) { 28432 return function(key) { 28433 return object == null ? undefined : object[key]; 28434 }; 28435 } 28436 28437 /** 28438 * The base implementation of `_.reduce` and `_.reduceRight`, without support 28439 * for iteratee shorthands, which iterates over `collection` using `eachFunc`. 28440 * 28441 * @private 28442 * @param {Array|Object} collection The collection to iterate over. 28443 * @param {Function} iteratee The function invoked per iteration. 28444 * @param {*} accumulator The initial value. 28445 * @param {boolean} initAccum Specify using the first or last element of 28446 * `collection` as the initial value. 28447 * @param {Function} eachFunc The function to iterate over `collection`. 28448 * @returns {*} Returns the accumulated value. 28449 */ 28450 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 28451 eachFunc(collection, function(value, index, collection) { 28452 accumulator = initAccum 28453 ? (initAccum = false, value) 28454 : iteratee(accumulator, value, index, collection); 28455 }); 28456 return accumulator; 28457 } 28458 28459 /** 28460 * The base implementation of `_.sortBy` which uses `comparer` to define the 28461 * sort order of `array` and replaces criteria objects with their corresponding 28462 * values. 28463 * 28464 * @private 28465 * @param {Array} array The array to sort. 28466 * @param {Function} comparer The function to define sort order. 28467 * @returns {Array} Returns `array`. 28468 */ 28469 function baseSortBy(array, comparer) { 28470 var length = array.length; 28471 28472 array.sort(comparer); 28473 while (length--) { 28474 array[length] = array[length].value; 28475 } 28476 return array; 28477 } 28478 28479 /** 28480 * The base implementation of `_.sum` and `_.sumBy` without support for 28481 * iteratee shorthands. 28482 * 28483 * @private 28484 * @param {Array} array The array to iterate over. 28485 * @param {Function} iteratee The function invoked per iteration. 28486 * @returns {number} Returns the sum. 28487 */ 28488 function baseSum(array, iteratee) { 28489 var result, 28490 index = -1, 28491 length = array.length; 28492 28493 while (++index < length) { 28494 var current = iteratee(array[index]); 28495 if (current !== undefined) { 28496 result = result === undefined ? current : (result + current); 28497 } 28498 } 28499 return result; 28500 } 28501 28502 /** 28503 * The base implementation of `_.times` without support for iteratee shorthands 28504 * or max array length checks. 28505 * 28506 * @private 28507 * @param {number} n The number of times to invoke `iteratee`. 28508 * @param {Function} iteratee The function invoked per iteration. 28509 * @returns {Array} Returns the array of results. 28510 */ 28511 function baseTimes(n, iteratee) { 28512 var index = -1, 28513 result = Array(n); 28514 28515 while (++index < n) { 28516 result[index] = iteratee(index); 28517 } 28518 return result; 28519 } 28520 28521 /** 28522 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array 28523 * of key-value pairs for `object` corresponding to the property names of `props`. 28524 * 28525 * @private 28526 * @param {Object} object The object to query. 28527 * @param {Array} props The property names to get values for. 28528 * @returns {Object} Returns the key-value pairs. 28529 */ 28530 function baseToPairs(object, props) { 28531 return arrayMap(props, function(key) { 28532 return [key, object[key]]; 28533 }); 28534 } 28535 28536 /** 28537 * The base implementation of `_.trim`. 28538 * 28539 * @private 28540 * @param {string} string The string to trim. 28541 * @returns {string} Returns the trimmed string. 28542 */ 28543 function baseTrim(string) { 28544 return string 28545 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') 28546 : string; 28547 } 28548 28549 /** 28550 * The base implementation of `_.unary` without support for storing metadata. 28551 * 28552 * @private 28553 * @param {Function} func The function to cap arguments for. 28554 * @returns {Function} Returns the new capped function. 28555 */ 28556 function baseUnary(func) { 28557 return function(value) { 28558 return func(value); 28559 }; 28560 } 28561 28562 /** 28563 * The base implementation of `_.values` and `_.valuesIn` which creates an 28564 * array of `object` property values corresponding to the property names 28565 * of `props`. 28566 * 28567 * @private 28568 * @param {Object} object The object to query. 28569 * @param {Array} props The property names to get values for. 28570 * @returns {Object} Returns the array of property values. 28571 */ 28572 function baseValues(object, props) { 28573 return arrayMap(props, function(key) { 28574 return object[key]; 28575 }); 28576 } 28577 28578 /** 28579 * Checks if a `cache` value for `key` exists. 28580 * 28581 * @private 28582 * @param {Object} cache The cache to query. 28583 * @param {string} key The key of the entry to check. 28584 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 28585 */ 28586 function cacheHas(cache, key) { 28587 return cache.has(key); 28588 } 28589 28590 /** 28591 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol 28592 * that is not found in the character symbols. 28593 * 28594 * @private 28595 * @param {Array} strSymbols The string symbols to inspect. 28596 * @param {Array} chrSymbols The character symbols to find. 28597 * @returns {number} Returns the index of the first unmatched string symbol. 28598 */ 28599 function charsStartIndex(strSymbols, chrSymbols) { 28600 var index = -1, 28601 length = strSymbols.length; 28602 28603 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 28604 return index; 28605 } 28606 28607 /** 28608 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol 28609 * that is not found in the character symbols. 28610 * 28611 * @private 28612 * @param {Array} strSymbols The string symbols to inspect. 28613 * @param {Array} chrSymbols The character symbols to find. 28614 * @returns {number} Returns the index of the last unmatched string symbol. 28615 */ 28616 function charsEndIndex(strSymbols, chrSymbols) { 28617 var index = strSymbols.length; 28618 28619 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 28620 return index; 28621 } 28622 28623 /** 28624 * Gets the number of `placeholder` occurrences in `array`. 28625 * 28626 * @private 28627 * @param {Array} array The array to inspect. 28628 * @param {*} placeholder The placeholder to search for. 28629 * @returns {number} Returns the placeholder count. 28630 */ 28631 function countHolders(array, placeholder) { 28632 var length = array.length, 28633 result = 0; 28634 28635 while (length--) { 28636 if (array[length] === placeholder) { 28637 ++result; 28638 } 28639 } 28640 return result; 28641 } 28642 28643 /** 28644 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A 28645 * letters to basic Latin letters. 28646 * 28647 * @private 28648 * @param {string} letter The matched letter to deburr. 28649 * @returns {string} Returns the deburred letter. 28650 */ 28651 var deburrLetter = basePropertyOf(deburredLetters); 28652 28653 /** 28654 * Used by `_.escape` to convert characters to HTML entities. 28655 * 28656 * @private 28657 * @param {string} chr The matched character to escape. 28658 * @returns {string} Returns the escaped character. 28659 */ 28660 var escapeHtmlChar = basePropertyOf(htmlEscapes); 28661 28662 /** 28663 * Used by `_.template` to escape characters for inclusion in compiled string literals. 28664 * 28665 * @private 28666 * @param {string} chr The matched character to escape. 28667 * @returns {string} Returns the escaped character. 28668 */ 28669 function escapeStringChar(chr) { 28670 return '\\' + stringEscapes[chr]; 28671 } 28672 28673 /** 28674 * Gets the value at `key` of `object`. 28675 * 28676 * @private 28677 * @param {Object} [object] The object to query. 28678 * @param {string} key The key of the property to get. 28679 * @returns {*} Returns the property value. 28680 */ 28681 function getValue(object, key) { 28682 return object == null ? undefined : object[key]; 28683 } 28684 28685 /** 28686 * Checks if `string` contains Unicode symbols. 28687 * 28688 * @private 28689 * @param {string} string The string to inspect. 28690 * @returns {boolean} Returns `true` if a symbol is found, else `false`. 28691 */ 28692 function hasUnicode(string) { 28693 return reHasUnicode.test(string); 28694 } 28695 28696 /** 28697 * Checks if `string` contains a word composed of Unicode symbols. 28698 * 28699 * @private 28700 * @param {string} string The string to inspect. 28701 * @returns {boolean} Returns `true` if a word is found, else `false`. 28702 */ 28703 function hasUnicodeWord(string) { 28704 return reHasUnicodeWord.test(string); 28705 } 28706 28707 /** 28708 * Converts `iterator` to an array. 28709 * 28710 * @private 28711 * @param {Object} iterator The iterator to convert. 28712 * @returns {Array} Returns the converted array. 28713 */ 28714 function iteratorToArray(iterator) { 28715 var data, 28716 result = []; 28717 28718 while (!(data = iterator.next()).done) { 28719 result.push(data.value); 28720 } 28721 return result; 28722 } 28723 28724 /** 28725 * Converts `map` to its key-value pairs. 28726 * 28727 * @private 28728 * @param {Object} map The map to convert. 28729 * @returns {Array} Returns the key-value pairs. 28730 */ 28731 function mapToArray(map) { 28732 var index = -1, 28733 result = Array(map.size); 28734 28735 map.forEach(function(value, key) { 28736 result[++index] = [key, value]; 28737 }); 28738 return result; 28739 } 28740 28741 /** 28742 * Creates a unary function that invokes `func` with its argument transformed. 28743 * 28744 * @private 28745 * @param {Function} func The function to wrap. 28746 * @param {Function} transform The argument transform. 28747 * @returns {Function} Returns the new function. 28748 */ 28749 function overArg(func, transform) { 28750 return function(arg) { 28751 return func(transform(arg)); 28752 }; 28753 } 28754 28755 /** 28756 * Replaces all `placeholder` elements in `array` with an internal placeholder 28757 * and returns an array of their indexes. 28758 * 28759 * @private 28760 * @param {Array} array The array to modify. 28761 * @param {*} placeholder The placeholder to replace. 28762 * @returns {Array} Returns the new array of placeholder indexes. 28763 */ 28764 function replaceHolders(array, placeholder) { 28765 var index = -1, 28766 length = array.length, 28767 resIndex = 0, 28768 result = []; 28769 28770 while (++index < length) { 28771 var value = array[index]; 28772 if (value === placeholder || value === PLACEHOLDER) { 28773 array[index] = PLACEHOLDER; 28774 result[resIndex++] = index; 28775 } 28776 } 28777 return result; 28778 } 28779 28780 /** 28781 * Converts `set` to an array of its values. 28782 * 28783 * @private 28784 * @param {Object} set The set to convert. 28785 * @returns {Array} Returns the values. 28786 */ 28787 function setToArray(set) { 28788 var index = -1, 28789 result = Array(set.size); 28790 28791 set.forEach(function(value) { 28792 result[++index] = value; 28793 }); 28794 return result; 28795 } 28796 28797 /** 28798 * Converts `set` to its value-value pairs. 28799 * 28800 * @private 28801 * @param {Object} set The set to convert. 28802 * @returns {Array} Returns the value-value pairs. 28803 */ 28804 function setToPairs(set) { 28805 var index = -1, 28806 result = Array(set.size); 28807 28808 set.forEach(function(value) { 28809 result[++index] = [value, value]; 28810 }); 28811 return result; 28812 } 28813 28814 /** 28815 * A specialized version of `_.indexOf` which performs strict equality 28816 * comparisons of values, i.e. `===`. 28817 * 28818 * @private 28819 * @param {Array} array The array to inspect. 28820 * @param {*} value The value to search for. 28821 * @param {number} fromIndex The index to search from. 28822 * @returns {number} Returns the index of the matched value, else `-1`. 28823 */ 28824 function strictIndexOf(array, value, fromIndex) { 28825 var index = fromIndex - 1, 28826 length = array.length; 28827 28828 while (++index < length) { 28829 if (array[index] === value) { 28830 return index; 28831 } 28832 } 28833 return -1; 28834 } 28835 28836 /** 28837 * A specialized version of `_.lastIndexOf` which performs strict equality 28838 * comparisons of values, i.e. `===`. 28839 * 28840 * @private 28841 * @param {Array} array The array to inspect. 28842 * @param {*} value The value to search for. 28843 * @param {number} fromIndex The index to search from. 28844 * @returns {number} Returns the index of the matched value, else `-1`. 28845 */ 28846 function strictLastIndexOf(array, value, fromIndex) { 28847 var index = fromIndex + 1; 28848 while (index--) { 28849 if (array[index] === value) { 28850 return index; 28851 } 28852 } 28853 return index; 28854 } 28855 28856 /** 28857 * Gets the number of symbols in `string`. 28858 * 28859 * @private 28860 * @param {string} string The string to inspect. 28861 * @returns {number} Returns the string size. 28862 */ 28863 function stringSize(string) { 28864 return hasUnicode(string) 28865 ? unicodeSize(string) 28866 : asciiSize(string); 28867 } 28868 28869 /** 28870 * Converts `string` to an array. 28871 * 28872 * @private 28873 * @param {string} string The string to convert. 28874 * @returns {Array} Returns the converted array. 28875 */ 28876 function stringToArray(string) { 28877 return hasUnicode(string) 28878 ? unicodeToArray(string) 28879 : asciiToArray(string); 28880 } 28881 28882 /** 28883 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 28884 * character of `string`. 28885 * 28886 * @private 28887 * @param {string} string The string to inspect. 28888 * @returns {number} Returns the index of the last non-whitespace character. 28889 */ 28890 function trimmedEndIndex(string) { 28891 var index = string.length; 28892 28893 while (index-- && reWhitespace.test(string.charAt(index))) {} 28894 return index; 28895 } 28896 28897 /** 28898 * Used by `_.unescape` to convert HTML entities to characters. 28899 * 28900 * @private 28901 * @param {string} chr The matched character to unescape. 28902 * @returns {string} Returns the unescaped character. 28903 */ 28904 var unescapeHtmlChar = basePropertyOf(htmlUnescapes); 28905 28906 /** 28907 * Gets the size of a Unicode `string`. 28908 * 28909 * @private 28910 * @param {string} string The string inspect. 28911 * @returns {number} Returns the string size. 28912 */ 28913 function unicodeSize(string) { 28914 var result = reUnicode.lastIndex = 0; 28915 while (reUnicode.test(string)) { 28916 ++result; 28917 } 28918 return result; 28919 } 28920 28921 /** 28922 * Converts a Unicode `string` to an array. 28923 * 28924 * @private 28925 * @param {string} string The string to convert. 28926 * @returns {Array} Returns the converted array. 28927 */ 28928 function unicodeToArray(string) { 28929 return string.match(reUnicode) || []; 28930 } 28931 28932 /** 28933 * Splits a Unicode `string` into an array of its words. 28934 * 28935 * @private 28936 * @param {string} The string to inspect. 28937 * @returns {Array} Returns the words of `string`. 28938 */ 28939 function unicodeWords(string) { 28940 return string.match(reUnicodeWord) || []; 28941 } 28942 28943 /*--------------------------------------------------------------------------*/ 28944 28945 /** 28946 * Create a new pristine `lodash` function using the `context` object. 28947 * 28948 * @static 28949 * @memberOf _ 28950 * @since 1.1.0 28951 * @category Util 28952 * @param {Object} [context=root] The context object. 28953 * @returns {Function} Returns a new `lodash` function. 28954 * @example 28955 * 28956 * _.mixin({ 'foo': _.constant('foo') }); 28957 * 28958 * var lodash = _.runInContext(); 28959 * lodash.mixin({ 'bar': lodash.constant('bar') }); 28960 * 28961 * _.isFunction(_.foo); 28962 * // => true 28963 * _.isFunction(_.bar); 28964 * // => false 28965 * 28966 * lodash.isFunction(lodash.foo); 28967 * // => false 28968 * lodash.isFunction(lodash.bar); 28969 * // => true 28970 * 28971 * // Create a suped-up `defer` in Node.js. 28972 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; 28973 */ 28974 var runInContext = (function runInContext(context) { 28975 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); 28976 28977 /** Built-in constructor references. */ 28978 var Array = context.Array, 28979 Date = context.Date, 28980 Error = context.Error, 28981 Function = context.Function, 28982 Math = context.Math, 28983 Object = context.Object, 28984 RegExp = context.RegExp, 28985 String = context.String, 28986 TypeError = context.TypeError; 28987 28988 /** Used for built-in method references. */ 28989 var arrayProto = Array.prototype, 28990 funcProto = Function.prototype, 28991 objectProto = Object.prototype; 28992 28993 /** Used to detect overreaching core-js shims. */ 28994 var coreJsData = context['__core-js_shared__']; 28995 28996 /** Used to resolve the decompiled source of functions. */ 28997 var funcToString = funcProto.toString; 28998 28999 /** Used to check objects for own properties. */ 29000 var hasOwnProperty = objectProto.hasOwnProperty; 29001 29002 /** Used to generate unique IDs. */ 29003 var idCounter = 0; 29004 29005 /** Used to detect methods masquerading as native. */ 29006 var maskSrcKey = (function() { 29007 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 29008 return uid ? ('Symbol(src)_1.' + uid) : ''; 29009 }()); 29010 29011 /** 29012 * Used to resolve the 29013 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 29014 * of values. 29015 */ 29016 var nativeObjectToString = objectProto.toString; 29017 29018 /** Used to infer the `Object` constructor. */ 29019 var objectCtorString = funcToString.call(Object); 29020 29021 /** Used to restore the original `_` reference in `_.noConflict`. */ 29022 var oldDash = root._; 29023 29024 /** Used to detect if a method is native. */ 29025 var reIsNative = RegExp('^' + 29026 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 29027 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 29028 ); 29029 29030 /** Built-in value references. */ 29031 var Buffer = moduleExports ? context.Buffer : undefined, 29032 Symbol = context.Symbol, 29033 Uint8Array = context.Uint8Array, 29034 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, 29035 getPrototype = overArg(Object.getPrototypeOf, Object), 29036 objectCreate = Object.create, 29037 propertyIsEnumerable = objectProto.propertyIsEnumerable, 29038 splice = arrayProto.splice, 29039 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, 29040 symIterator = Symbol ? Symbol.iterator : undefined, 29041 symToStringTag = Symbol ? Symbol.toStringTag : undefined; 29042 29043 var defineProperty = (function() { 29044 try { 29045 var func = getNative(Object, 'defineProperty'); 29046 func({}, '', {}); 29047 return func; 29048 } catch (e) {} 29049 }()); 29050 29051 /** Mocked built-ins. */ 29052 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, 29053 ctxNow = Date && Date.now !== root.Date.now && Date.now, 29054 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; 29055 29056 /* Built-in method references for those with the same name as other `lodash` methods. */ 29057 var nativeCeil = Math.ceil, 29058 nativeFloor = Math.floor, 29059 nativeGetSymbols = Object.getOwnPropertySymbols, 29060 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, 29061 nativeIsFinite = context.isFinite, 29062 nativeJoin = arrayProto.join, 29063 nativeKeys = overArg(Object.keys, Object), 29064 nativeMax = Math.max, 29065 nativeMin = Math.min, 29066 nativeNow = Date.now, 29067 nativeParseInt = context.parseInt, 29068 nativeRandom = Math.random, 29069 nativeReverse = arrayProto.reverse; 29070 29071 /* Built-in method references that are verified to be native. */ 29072 var DataView = getNative(context, 'DataView'), 29073 Map = getNative(context, 'Map'), 29074 Promise = getNative(context, 'Promise'), 29075 Set = getNative(context, 'Set'), 29076 WeakMap = getNative(context, 'WeakMap'), 29077 nativeCreate = getNative(Object, 'create'); 29078 29079 /** Used to store function metadata. */ 29080 var metaMap = WeakMap && new WeakMap; 29081 29082 /** Used to lookup unminified function names. */ 29083 var realNames = {}; 29084 29085 /** Used to detect maps, sets, and weakmaps. */ 29086 var dataViewCtorString = toSource(DataView), 29087 mapCtorString = toSource(Map), 29088 promiseCtorString = toSource(Promise), 29089 setCtorString = toSource(Set), 29090 weakMapCtorString = toSource(WeakMap); 29091 29092 /** Used to convert symbols to primitives and strings. */ 29093 var symbolProto = Symbol ? Symbol.prototype : undefined, 29094 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, 29095 symbolToString = symbolProto ? symbolProto.toString : undefined; 29096 29097 /*------------------------------------------------------------------------*/ 29098 29099 /** 29100 * Creates a `lodash` object which wraps `value` to enable implicit method 29101 * chain sequences. Methods that operate on and return arrays, collections, 29102 * and functions can be chained together. Methods that retrieve a single value 29103 * or may return a primitive value will automatically end the chain sequence 29104 * and return the unwrapped value. Otherwise, the value must be unwrapped 29105 * with `_#value`. 29106 * 29107 * Explicit chain sequences, which must be unwrapped with `_#value`, may be 29108 * enabled using `_.chain`. 29109 * 29110 * The execution of chained methods is lazy, that is, it's deferred until 29111 * `_#value` is implicitly or explicitly called. 29112 * 29113 * Lazy evaluation allows several methods to support shortcut fusion. 29114 * Shortcut fusion is an optimization to merge iteratee calls; this avoids 29115 * the creation of intermediate arrays and can greatly reduce the number of 29116 * iteratee executions. Sections of a chain sequence qualify for shortcut 29117 * fusion if the section is applied to an array and iteratees accept only 29118 * one argument. The heuristic for whether a section qualifies for shortcut 29119 * fusion is subject to change. 29120 * 29121 * Chaining is supported in custom builds as long as the `_#value` method is 29122 * directly or indirectly included in the build. 29123 * 29124 * In addition to lodash methods, wrappers have `Array` and `String` methods. 29125 * 29126 * The wrapper `Array` methods are: 29127 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` 29128 * 29129 * The wrapper `String` methods are: 29130 * `replace` and `split` 29131 * 29132 * The wrapper methods that support shortcut fusion are: 29133 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, 29134 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, 29135 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` 29136 * 29137 * The chainable wrapper methods are: 29138 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, 29139 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, 29140 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, 29141 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, 29142 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, 29143 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, 29144 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, 29145 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, 29146 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, 29147 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, 29148 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, 29149 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, 29150 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, 29151 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, 29152 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, 29153 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, 29154 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, 29155 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, 29156 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, 29157 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, 29158 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, 29159 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, 29160 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, 29161 * `zipObject`, `zipObjectDeep`, and `zipWith` 29162 * 29163 * The wrapper methods that are **not** chainable by default are: 29164 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, 29165 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, 29166 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, 29167 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, 29168 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, 29169 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, 29170 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, 29171 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, 29172 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, 29173 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, 29174 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, 29175 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, 29176 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, 29177 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, 29178 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, 29179 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, 29180 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, 29181 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, 29182 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, 29183 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, 29184 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, 29185 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, 29186 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, 29187 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, 29188 * `upperFirst`, `value`, and `words` 29189 * 29190 * @name _ 29191 * @constructor 29192 * @category Seq 29193 * @param {*} value The value to wrap in a `lodash` instance. 29194 * @returns {Object} Returns the new `lodash` wrapper instance. 29195 * @example 29196 * 29197 * function square(n) { 29198 * return n * n; 29199 * } 29200 * 29201 * var wrapped = _([1, 2, 3]); 29202 * 29203 * // Returns an unwrapped value. 29204 * wrapped.reduce(_.add); 29205 * // => 6 29206 * 29207 * // Returns a wrapped value. 29208 * var squares = wrapped.map(square); 29209 * 29210 * _.isArray(squares); 29211 * // => false 29212 * 29213 * _.isArray(squares.value()); 29214 * // => true 29215 */ 29216 function lodash(value) { 29217 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { 29218 if (value instanceof LodashWrapper) { 29219 return value; 29220 } 29221 if (hasOwnProperty.call(value, '__wrapped__')) { 29222 return wrapperClone(value); 29223 } 29224 } 29225 return new LodashWrapper(value); 29226 } 29227 29228 /** 29229 * The base implementation of `_.create` without support for assigning 29230 * properties to the created object. 29231 * 29232 * @private 29233 * @param {Object} proto The object to inherit from. 29234 * @returns {Object} Returns the new object. 29235 */ 29236 var baseCreate = (function() { 29237 function object() {} 29238 return function(proto) { 29239 if (!isObject(proto)) { 29240 return {}; 29241 } 29242 if (objectCreate) { 29243 return objectCreate(proto); 29244 } 29245 object.prototype = proto; 29246 var result = new object; 29247 object.prototype = undefined; 29248 return result; 29249 }; 29250 }()); 29251 29252 /** 29253 * The function whose prototype chain sequence wrappers inherit from. 29254 * 29255 * @private 29256 */ 29257 function baseLodash() { 29258 // No operation performed. 29259 } 29260 29261 /** 29262 * The base constructor for creating `lodash` wrapper objects. 29263 * 29264 * @private 29265 * @param {*} value The value to wrap. 29266 * @param {boolean} [chainAll] Enable explicit method chain sequences. 29267 */ 29268 function LodashWrapper(value, chainAll) { 29269 this.__wrapped__ = value; 29270 this.__actions__ = []; 29271 this.__chain__ = !!chainAll; 29272 this.__index__ = 0; 29273 this.__values__ = undefined; 29274 } 29275 29276 /** 29277 * By default, the template delimiters used by lodash are like those in 29278 * embedded Ruby (ERB) as well as ES2015 template strings. Change the 29279 * following template settings to use alternative delimiters. 29280 * 29281 * @static 29282 * @memberOf _ 29283 * @type {Object} 29284 */ 29285 lodash.templateSettings = { 29286 29287 /** 29288 * Used to detect `data` property values to be HTML-escaped. 29289 * 29290 * @memberOf _.templateSettings 29291 * @type {RegExp} 29292 */ 29293 'escape': reEscape, 29294 29295 /** 29296 * Used to detect code to be evaluated. 29297 * 29298 * @memberOf _.templateSettings 29299 * @type {RegExp} 29300 */ 29301 'evaluate': reEvaluate, 29302 29303 /** 29304 * Used to detect `data` property values to inject. 29305 * 29306 * @memberOf _.templateSettings 29307 * @type {RegExp} 29308 */ 29309 'interpolate': reInterpolate, 29310 29311 /** 29312 * Used to reference the data object in the template text. 29313 * 29314 * @memberOf _.templateSettings 29315 * @type {string} 29316 */ 29317 'variable': '', 29318 29319 /** 29320 * Used to import variables into the compiled template. 29321 * 29322 * @memberOf _.templateSettings 29323 * @type {Object} 29324 */ 29325 'imports': { 29326 29327 /** 29328 * A reference to the `lodash` function. 29329 * 29330 * @memberOf _.templateSettings.imports 29331 * @type {Function} 29332 */ 29333 '_': lodash 29334 } 29335 }; 29336 29337 // Ensure wrappers are instances of `baseLodash`. 29338 lodash.prototype = baseLodash.prototype; 29339 lodash.prototype.constructor = lodash; 29340 29341 LodashWrapper.prototype = baseCreate(baseLodash.prototype); 29342 LodashWrapper.prototype.constructor = LodashWrapper; 29343 29344 /*------------------------------------------------------------------------*/ 29345 29346 /** 29347 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. 29348 * 29349 * @private 29350 * @constructor 29351 * @param {*} value The value to wrap. 29352 */ 29353 function LazyWrapper(value) { 29354 this.__wrapped__ = value; 29355 this.__actions__ = []; 29356 this.__dir__ = 1; 29357 this.__filtered__ = false; 29358 this.__iteratees__ = []; 29359 this.__takeCount__ = MAX_ARRAY_LENGTH; 29360 this.__views__ = []; 29361 } 29362 29363 /** 29364 * Creates a clone of the lazy wrapper object. 29365 * 29366 * @private 29367 * @name clone 29368 * @memberOf LazyWrapper 29369 * @returns {Object} Returns the cloned `LazyWrapper` object. 29370 */ 29371 function lazyClone() { 29372 var result = new LazyWrapper(this.__wrapped__); 29373 result.__actions__ = copyArray(this.__actions__); 29374 result.__dir__ = this.__dir__; 29375 result.__filtered__ = this.__filtered__; 29376 result.__iteratees__ = copyArray(this.__iteratees__); 29377 result.__takeCount__ = this.__takeCount__; 29378 result.__views__ = copyArray(this.__views__); 29379 return result; 29380 } 29381 29382 /** 29383 * Reverses the direction of lazy iteration. 29384 * 29385 * @private 29386 * @name reverse 29387 * @memberOf LazyWrapper 29388 * @returns {Object} Returns the new reversed `LazyWrapper` object. 29389 */ 29390 function lazyReverse() { 29391 if (this.__filtered__) { 29392 var result = new LazyWrapper(this); 29393 result.__dir__ = -1; 29394 result.__filtered__ = true; 29395 } else { 29396 result = this.clone(); 29397 result.__dir__ *= -1; 29398 } 29399 return result; 29400 } 29401 29402 /** 29403 * Extracts the unwrapped value from its lazy wrapper. 29404 * 29405 * @private 29406 * @name value 29407 * @memberOf LazyWrapper 29408 * @returns {*} Returns the unwrapped value. 29409 */ 29410 function lazyValue() { 29411 var array = this.__wrapped__.value(), 29412 dir = this.__dir__, 29413 isArr = isArray(array), 29414 isRight = dir < 0, 29415 arrLength = isArr ? array.length : 0, 29416 view = getView(0, arrLength, this.__views__), 29417 start = view.start, 29418 end = view.end, 29419 length = end - start, 29420 index = isRight ? end : (start - 1), 29421 iteratees = this.__iteratees__, 29422 iterLength = iteratees.length, 29423 resIndex = 0, 29424 takeCount = nativeMin(length, this.__takeCount__); 29425 29426 if (!isArr || (!isRight && arrLength == length && takeCount == length)) { 29427 return baseWrapperValue(array, this.__actions__); 29428 } 29429 var result = []; 29430 29431 outer: 29432 while (length-- && resIndex < takeCount) { 29433 index += dir; 29434 29435 var iterIndex = -1, 29436 value = array[index]; 29437 29438 while (++iterIndex < iterLength) { 29439 var data = iteratees[iterIndex], 29440 iteratee = data.iteratee, 29441 type = data.type, 29442 computed = iteratee(value); 29443 29444 if (type == LAZY_MAP_FLAG) { 29445 value = computed; 29446 } else if (!computed) { 29447 if (type == LAZY_FILTER_FLAG) { 29448 continue outer; 29449 } else { 29450 break outer; 29451 } 29452 } 29453 } 29454 result[resIndex++] = value; 29455 } 29456 return result; 29457 } 29458 29459 // Ensure `LazyWrapper` is an instance of `baseLodash`. 29460 LazyWrapper.prototype = baseCreate(baseLodash.prototype); 29461 LazyWrapper.prototype.constructor = LazyWrapper; 29462 29463 /*------------------------------------------------------------------------*/ 29464 29465 /** 29466 * Creates a hash object. 29467 * 29468 * @private 29469 * @constructor 29470 * @param {Array} [entries] The key-value pairs to cache. 29471 */ 29472 function Hash(entries) { 29473 var index = -1, 29474 length = entries == null ? 0 : entries.length; 29475 29476 this.clear(); 29477 while (++index < length) { 29478 var entry = entries[index]; 29479 this.set(entry[0], entry[1]); 29480 } 29481 } 29482 29483 /** 29484 * Removes all key-value entries from the hash. 29485 * 29486 * @private 29487 * @name clear 29488 * @memberOf Hash 29489 */ 29490 function hashClear() { 29491 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 29492 this.size = 0; 29493 } 29494 29495 /** 29496 * Removes `key` and its value from the hash. 29497 * 29498 * @private 29499 * @name delete 29500 * @memberOf Hash 29501 * @param {Object} hash The hash to modify. 29502 * @param {string} key The key of the value to remove. 29503 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 29504 */ 29505 function hashDelete(key) { 29506 var result = this.has(key) && delete this.__data__[key]; 29507 this.size -= result ? 1 : 0; 29508 return result; 29509 } 29510 29511 /** 29512 * Gets the hash value for `key`. 29513 * 29514 * @private 29515 * @name get 29516 * @memberOf Hash 29517 * @param {string} key The key of the value to get. 29518 * @returns {*} Returns the entry value. 29519 */ 29520 function hashGet(key) { 29521 var data = this.__data__; 29522 if (nativeCreate) { 29523 var result = data[key]; 29524 return result === HASH_UNDEFINED ? undefined : result; 29525 } 29526 return hasOwnProperty.call(data, key) ? data[key] : undefined; 29527 } 29528 29529 /** 29530 * Checks if a hash value for `key` exists. 29531 * 29532 * @private 29533 * @name has 29534 * @memberOf Hash 29535 * @param {string} key The key of the entry to check. 29536 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 29537 */ 29538 function hashHas(key) { 29539 var data = this.__data__; 29540 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); 29541 } 29542 29543 /** 29544 * Sets the hash `key` to `value`. 29545 * 29546 * @private 29547 * @name set 29548 * @memberOf Hash 29549 * @param {string} key The key of the value to set. 29550 * @param {*} value The value to set. 29551 * @returns {Object} Returns the hash instance. 29552 */ 29553 function hashSet(key, value) { 29554 var data = this.__data__; 29555 this.size += this.has(key) ? 0 : 1; 29556 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 29557 return this; 29558 } 29559 29560 // Add methods to `Hash`. 29561 Hash.prototype.clear = hashClear; 29562 Hash.prototype['delete'] = hashDelete; 29563 Hash.prototype.get = hashGet; 29564 Hash.prototype.has = hashHas; 29565 Hash.prototype.set = hashSet; 29566 29567 /*------------------------------------------------------------------------*/ 29568 29569 /** 29570 * Creates an list cache object. 29571 * 29572 * @private 29573 * @constructor 29574 * @param {Array} [entries] The key-value pairs to cache. 29575 */ 29576 function ListCache(entries) { 29577 var index = -1, 29578 length = entries == null ? 0 : entries.length; 29579 29580 this.clear(); 29581 while (++index < length) { 29582 var entry = entries[index]; 29583 this.set(entry[0], entry[1]); 29584 } 29585 } 29586 29587 /** 29588 * Removes all key-value entries from the list cache. 29589 * 29590 * @private 29591 * @name clear 29592 * @memberOf ListCache 29593 */ 29594 function listCacheClear() { 29595 this.__data__ = []; 29596 this.size = 0; 29597 } 29598 29599 /** 29600 * Removes `key` and its value from the list cache. 29601 * 29602 * @private 29603 * @name delete 29604 * @memberOf ListCache 29605 * @param {string} key The key of the value to remove. 29606 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 29607 */ 29608 function listCacheDelete(key) { 29609 var data = this.__data__, 29610 index = assocIndexOf(data, key); 29611 29612 if (index < 0) { 29613 return false; 29614 } 29615 var lastIndex = data.length - 1; 29616 if (index == lastIndex) { 29617 data.pop(); 29618 } else { 29619 splice.call(data, index, 1); 29620 } 29621 --this.size; 29622 return true; 29623 } 29624 29625 /** 29626 * Gets the list cache value for `key`. 29627 * 29628 * @private 29629 * @name get 29630 * @memberOf ListCache 29631 * @param {string} key The key of the value to get. 29632 * @returns {*} Returns the entry value. 29633 */ 29634 function listCacheGet(key) { 29635 var data = this.__data__, 29636 index = assocIndexOf(data, key); 29637 29638 return index < 0 ? undefined : data[index][1]; 29639 } 29640 29641 /** 29642 * Checks if a list cache value for `key` exists. 29643 * 29644 * @private 29645 * @name has 29646 * @memberOf ListCache 29647 * @param {string} key The key of the entry to check. 29648 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 29649 */ 29650 function listCacheHas(key) { 29651 return assocIndexOf(this.__data__, key) > -1; 29652 } 29653 29654 /** 29655 * Sets the list cache `key` to `value`. 29656 * 29657 * @private 29658 * @name set 29659 * @memberOf ListCache 29660 * @param {string} key The key of the value to set. 29661 * @param {*} value The value to set. 29662 * @returns {Object} Returns the list cache instance. 29663 */ 29664 function listCacheSet(key, value) { 29665 var data = this.__data__, 29666 index = assocIndexOf(data, key); 29667 29668 if (index < 0) { 29669 ++this.size; 29670 data.push([key, value]); 29671 } else { 29672 data[index][1] = value; 29673 } 29674 return this; 29675 } 29676 29677 // Add methods to `ListCache`. 29678 ListCache.prototype.clear = listCacheClear; 29679 ListCache.prototype['delete'] = listCacheDelete; 29680 ListCache.prototype.get = listCacheGet; 29681 ListCache.prototype.has = listCacheHas; 29682 ListCache.prototype.set = listCacheSet; 29683 29684 /*------------------------------------------------------------------------*/ 29685 29686 /** 29687 * Creates a map cache object to store key-value pairs. 29688 * 29689 * @private 29690 * @constructor 29691 * @param {Array} [entries] The key-value pairs to cache. 29692 */ 29693 function MapCache(entries) { 29694 var index = -1, 29695 length = entries == null ? 0 : entries.length; 29696 29697 this.clear(); 29698 while (++index < length) { 29699 var entry = entries[index]; 29700 this.set(entry[0], entry[1]); 29701 } 29702 } 29703 29704 /** 29705 * Removes all key-value entries from the map. 29706 * 29707 * @private 29708 * @name clear 29709 * @memberOf MapCache 29710 */ 29711 function mapCacheClear() { 29712 this.size = 0; 29713 this.__data__ = { 29714 'hash': new Hash, 29715 'map': new (Map || ListCache), 29716 'string': new Hash 29717 }; 29718 } 29719 29720 /** 29721 * Removes `key` and its value from the map. 29722 * 29723 * @private 29724 * @name delete 29725 * @memberOf MapCache 29726 * @param {string} key The key of the value to remove. 29727 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 29728 */ 29729 function mapCacheDelete(key) { 29730 var result = getMapData(this, key)['delete'](key); 29731 this.size -= result ? 1 : 0; 29732 return result; 29733 } 29734 29735 /** 29736 * Gets the map value for `key`. 29737 * 29738 * @private 29739 * @name get 29740 * @memberOf MapCache 29741 * @param {string} key The key of the value to get. 29742 * @returns {*} Returns the entry value. 29743 */ 29744 function mapCacheGet(key) { 29745 return getMapData(this, key).get(key); 29746 } 29747 29748 /** 29749 * Checks if a map value for `key` exists. 29750 * 29751 * @private 29752 * @name has 29753 * @memberOf MapCache 29754 * @param {string} key The key of the entry to check. 29755 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 29756 */ 29757 function mapCacheHas(key) { 29758 return getMapData(this, key).has(key); 29759 } 29760 29761 /** 29762 * Sets the map `key` to `value`. 29763 * 29764 * @private 29765 * @name set 29766 * @memberOf MapCache 29767 * @param {string} key The key of the value to set. 29768 * @param {*} value The value to set. 29769 * @returns {Object} Returns the map cache instance. 29770 */ 29771 function mapCacheSet(key, value) { 29772 var data = getMapData(this, key), 29773 size = data.size; 29774 29775 data.set(key, value); 29776 this.size += data.size == size ? 0 : 1; 29777 return this; 29778 } 29779 29780 // Add methods to `MapCache`. 29781 MapCache.prototype.clear = mapCacheClear; 29782 MapCache.prototype['delete'] = mapCacheDelete; 29783 MapCache.prototype.get = mapCacheGet; 29784 MapCache.prototype.has = mapCacheHas; 29785 MapCache.prototype.set = mapCacheSet; 29786 29787 /*------------------------------------------------------------------------*/ 29788 29789 /** 29790 * 29791 * Creates an array cache object to store unique values. 29792 * 29793 * @private 29794 * @constructor 29795 * @param {Array} [values] The values to cache. 29796 */ 29797 function SetCache(values) { 29798 var index = -1, 29799 length = values == null ? 0 : values.length; 29800 29801 this.__data__ = new MapCache; 29802 while (++index < length) { 29803 this.add(values[index]); 29804 } 29805 } 29806 29807 /** 29808 * Adds `value` to the array cache. 29809 * 29810 * @private 29811 * @name add 29812 * @memberOf SetCache 29813 * @alias push 29814 * @param {*} value The value to cache. 29815 * @returns {Object} Returns the cache instance. 29816 */ 29817 function setCacheAdd(value) { 29818 this.__data__.set(value, HASH_UNDEFINED); 29819 return this; 29820 } 29821 29822 /** 29823 * Checks if `value` is in the array cache. 29824 * 29825 * @private 29826 * @name has 29827 * @memberOf SetCache 29828 * @param {*} value The value to search for. 29829 * @returns {number} Returns `true` if `value` is found, else `false`. 29830 */ 29831 function setCacheHas(value) { 29832 return this.__data__.has(value); 29833 } 29834 29835 // Add methods to `SetCache`. 29836 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 29837 SetCache.prototype.has = setCacheHas; 29838 29839 /*------------------------------------------------------------------------*/ 29840 29841 /** 29842 * Creates a stack cache object to store key-value pairs. 29843 * 29844 * @private 29845 * @constructor 29846 * @param {Array} [entries] The key-value pairs to cache. 29847 */ 29848 function Stack(entries) { 29849 var data = this.__data__ = new ListCache(entries); 29850 this.size = data.size; 29851 } 29852 29853 /** 29854 * Removes all key-value entries from the stack. 29855 * 29856 * @private 29857 * @name clear 29858 * @memberOf Stack 29859 */ 29860 function stackClear() { 29861 this.__data__ = new ListCache; 29862 this.size = 0; 29863 } 29864 29865 /** 29866 * Removes `key` and its value from the stack. 29867 * 29868 * @private 29869 * @name delete 29870 * @memberOf Stack 29871 * @param {string} key The key of the value to remove. 29872 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 29873 */ 29874 function stackDelete(key) { 29875 var data = this.__data__, 29876 result = data['delete'](key); 29877 29878 this.size = data.size; 29879 return result; 29880 } 29881 29882 /** 29883 * Gets the stack value for `key`. 29884 * 29885 * @private 29886 * @name get 29887 * @memberOf Stack 29888 * @param {string} key The key of the value to get. 29889 * @returns {*} Returns the entry value. 29890 */ 29891 function stackGet(key) { 29892 return this.__data__.get(key); 29893 } 29894 29895 /** 29896 * Checks if a stack value for `key` exists. 29897 * 29898 * @private 29899 * @name has 29900 * @memberOf Stack 29901 * @param {string} key The key of the entry to check. 29902 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 29903 */ 29904 function stackHas(key) { 29905 return this.__data__.has(key); 29906 } 29907 29908 /** 29909 * Sets the stack `key` to `value`. 29910 * 29911 * @private 29912 * @name set 29913 * @memberOf Stack 29914 * @param {string} key The key of the value to set. 29915 * @param {*} value The value to set. 29916 * @returns {Object} Returns the stack cache instance. 29917 */ 29918 function stackSet(key, value) { 29919 var data = this.__data__; 29920 if (data instanceof ListCache) { 29921 var pairs = data.__data__; 29922 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { 29923 pairs.push([key, value]); 29924 this.size = ++data.size; 29925 return this; 29926 } 29927 data = this.__data__ = new MapCache(pairs); 29928 } 29929 data.set(key, value); 29930 this.size = data.size; 29931 return this; 29932 } 29933 29934 // Add methods to `Stack`. 29935 Stack.prototype.clear = stackClear; 29936 Stack.prototype['delete'] = stackDelete; 29937 Stack.prototype.get = stackGet; 29938 Stack.prototype.has = stackHas; 29939 Stack.prototype.set = stackSet; 29940 29941 /*------------------------------------------------------------------------*/ 29942 29943 /** 29944 * Creates an array of the enumerable property names of the array-like `value`. 29945 * 29946 * @private 29947 * @param {*} value The value to query. 29948 * @param {boolean} inherited Specify returning inherited property names. 29949 * @returns {Array} Returns the array of property names. 29950 */ 29951 function arrayLikeKeys(value, inherited) { 29952 var isArr = isArray(value), 29953 isArg = !isArr && isArguments(value), 29954 isBuff = !isArr && !isArg && isBuffer(value), 29955 isType = !isArr && !isArg && !isBuff && isTypedArray(value), 29956 skipIndexes = isArr || isArg || isBuff || isType, 29957 result = skipIndexes ? baseTimes(value.length, String) : [], 29958 length = result.length; 29959 29960 for (var key in value) { 29961 if ((inherited || hasOwnProperty.call(value, key)) && 29962 !(skipIndexes && ( 29963 // Safari 9 has enumerable `arguments.length` in strict mode. 29964 key == 'length' || 29965 // Node.js 0.10 has enumerable non-index properties on buffers. 29966 (isBuff && (key == 'offset' || key == 'parent')) || 29967 // PhantomJS 2 has enumerable non-index properties on typed arrays. 29968 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || 29969 // Skip index properties. 29970 isIndex(key, length) 29971 ))) { 29972 result.push(key); 29973 } 29974 } 29975 return result; 29976 } 29977 29978 /** 29979 * A specialized version of `_.sample` for arrays. 29980 * 29981 * @private 29982 * @param {Array} array The array to sample. 29983 * @returns {*} Returns the random element. 29984 */ 29985 function arraySample(array) { 29986 var length = array.length; 29987 return length ? array[baseRandom(0, length - 1)] : undefined; 29988 } 29989 29990 /** 29991 * A specialized version of `_.sampleSize` for arrays. 29992 * 29993 * @private 29994 * @param {Array} array The array to sample. 29995 * @param {number} n The number of elements to sample. 29996 * @returns {Array} Returns the random elements. 29997 */ 29998 function arraySampleSize(array, n) { 29999 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); 30000 } 30001 30002 /** 30003 * A specialized version of `_.shuffle` for arrays. 30004 * 30005 * @private 30006 * @param {Array} array The array to shuffle. 30007 * @returns {Array} Returns the new shuffled array. 30008 */ 30009 function arrayShuffle(array) { 30010 return shuffleSelf(copyArray(array)); 30011 } 30012 30013 /** 30014 * This function is like `assignValue` except that it doesn't assign 30015 * `undefined` values. 30016 * 30017 * @private 30018 * @param {Object} object The object to modify. 30019 * @param {string} key The key of the property to assign. 30020 * @param {*} value The value to assign. 30021 */ 30022 function assignMergeValue(object, key, value) { 30023 if ((value !== undefined && !eq(object[key], value)) || 30024 (value === undefined && !(key in object))) { 30025 baseAssignValue(object, key, value); 30026 } 30027 } 30028 30029 /** 30030 * Assigns `value` to `key` of `object` if the existing value is not equivalent 30031 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 30032 * for equality comparisons. 30033 * 30034 * @private 30035 * @param {Object} object The object to modify. 30036 * @param {string} key The key of the property to assign. 30037 * @param {*} value The value to assign. 30038 */ 30039 function assignValue(object, key, value) { 30040 var objValue = object[key]; 30041 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 30042 (value === undefined && !(key in object))) { 30043 baseAssignValue(object, key, value); 30044 } 30045 } 30046 30047 /** 30048 * Gets the index at which the `key` is found in `array` of key-value pairs. 30049 * 30050 * @private 30051 * @param {Array} array The array to inspect. 30052 * @param {*} key The key to search for. 30053 * @returns {number} Returns the index of the matched value, else `-1`. 30054 */ 30055 function assocIndexOf(array, key) { 30056 var length = array.length; 30057 while (length--) { 30058 if (eq(array[length][0], key)) { 30059 return length; 30060 } 30061 } 30062 return -1; 30063 } 30064 30065 /** 30066 * Aggregates elements of `collection` on `accumulator` with keys transformed 30067 * by `iteratee` and values set by `setter`. 30068 * 30069 * @private 30070 * @param {Array|Object} collection The collection to iterate over. 30071 * @param {Function} setter The function to set `accumulator` values. 30072 * @param {Function} iteratee The iteratee to transform keys. 30073 * @param {Object} accumulator The initial aggregated object. 30074 * @returns {Function} Returns `accumulator`. 30075 */ 30076 function baseAggregator(collection, setter, iteratee, accumulator) { 30077 baseEach(collection, function(value, key, collection) { 30078 setter(accumulator, value, iteratee(value), collection); 30079 }); 30080 return accumulator; 30081 } 30082 30083 /** 30084 * The base implementation of `_.assign` without support for multiple sources 30085 * or `customizer` functions. 30086 * 30087 * @private 30088 * @param {Object} object The destination object. 30089 * @param {Object} source The source object. 30090 * @returns {Object} Returns `object`. 30091 */ 30092 function baseAssign(object, source) { 30093 return object && copyObject(source, keys(source), object); 30094 } 30095 30096 /** 30097 * The base implementation of `_.assignIn` without support for multiple sources 30098 * or `customizer` functions. 30099 * 30100 * @private 30101 * @param {Object} object The destination object. 30102 * @param {Object} source The source object. 30103 * @returns {Object} Returns `object`. 30104 */ 30105 function baseAssignIn(object, source) { 30106 return object && copyObject(source, keysIn(source), object); 30107 } 30108 30109 /** 30110 * The base implementation of `assignValue` and `assignMergeValue` without 30111 * value checks. 30112 * 30113 * @private 30114 * @param {Object} object The object to modify. 30115 * @param {string} key The key of the property to assign. 30116 * @param {*} value The value to assign. 30117 */ 30118 function baseAssignValue(object, key, value) { 30119 if (key == '__proto__' && defineProperty) { 30120 defineProperty(object, key, { 30121 'configurable': true, 30122 'enumerable': true, 30123 'value': value, 30124 'writable': true 30125 }); 30126 } else { 30127 object[key] = value; 30128 } 30129 } 30130 30131 /** 30132 * The base implementation of `_.at` without support for individual paths. 30133 * 30134 * @private 30135 * @param {Object} object The object to iterate over. 30136 * @param {string[]} paths The property paths to pick. 30137 * @returns {Array} Returns the picked elements. 30138 */ 30139 function baseAt(object, paths) { 30140 var index = -1, 30141 length = paths.length, 30142 result = Array(length), 30143 skip = object == null; 30144 30145 while (++index < length) { 30146 result[index] = skip ? undefined : get(object, paths[index]); 30147 } 30148 return result; 30149 } 30150 30151 /** 30152 * The base implementation of `_.clamp` which doesn't coerce arguments. 30153 * 30154 * @private 30155 * @param {number} number The number to clamp. 30156 * @param {number} [lower] The lower bound. 30157 * @param {number} upper The upper bound. 30158 * @returns {number} Returns the clamped number. 30159 */ 30160 function baseClamp(number, lower, upper) { 30161 if (number === number) { 30162 if (upper !== undefined) { 30163 number = number <= upper ? number : upper; 30164 } 30165 if (lower !== undefined) { 30166 number = number >= lower ? number : lower; 30167 } 30168 } 30169 return number; 30170 } 30171 30172 /** 30173 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 30174 * traversed objects. 30175 * 30176 * @private 30177 * @param {*} value The value to clone. 30178 * @param {boolean} bitmask The bitmask flags. 30179 * 1 - Deep clone 30180 * 2 - Flatten inherited properties 30181 * 4 - Clone symbols 30182 * @param {Function} [customizer] The function to customize cloning. 30183 * @param {string} [key] The key of `value`. 30184 * @param {Object} [object] The parent object of `value`. 30185 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 30186 * @returns {*} Returns the cloned value. 30187 */ 30188 function baseClone(value, bitmask, customizer, key, object, stack) { 30189 var result, 30190 isDeep = bitmask & CLONE_DEEP_FLAG, 30191 isFlat = bitmask & CLONE_FLAT_FLAG, 30192 isFull = bitmask & CLONE_SYMBOLS_FLAG; 30193 30194 if (customizer) { 30195 result = object ? customizer(value, key, object, stack) : customizer(value); 30196 } 30197 if (result !== undefined) { 30198 return result; 30199 } 30200 if (!isObject(value)) { 30201 return value; 30202 } 30203 var isArr = isArray(value); 30204 if (isArr) { 30205 result = initCloneArray(value); 30206 if (!isDeep) { 30207 return copyArray(value, result); 30208 } 30209 } else { 30210 var tag = getTag(value), 30211 isFunc = tag == funcTag || tag == genTag; 30212 30213 if (isBuffer(value)) { 30214 return cloneBuffer(value, isDeep); 30215 } 30216 if (tag == objectTag || tag == argsTag || (isFunc && !object)) { 30217 result = (isFlat || isFunc) ? {} : initCloneObject(value); 30218 if (!isDeep) { 30219 return isFlat 30220 ? copySymbolsIn(value, baseAssignIn(result, value)) 30221 : copySymbols(value, baseAssign(result, value)); 30222 } 30223 } else { 30224 if (!cloneableTags[tag]) { 30225 return object ? value : {}; 30226 } 30227 result = initCloneByTag(value, tag, isDeep); 30228 } 30229 } 30230 // Check for circular references and return its corresponding clone. 30231 stack || (stack = new Stack); 30232 var stacked = stack.get(value); 30233 if (stacked) { 30234 return stacked; 30235 } 30236 stack.set(value, result); 30237 30238 if (isSet(value)) { 30239 value.forEach(function(subValue) { 30240 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); 30241 }); 30242 } else if (isMap(value)) { 30243 value.forEach(function(subValue, key) { 30244 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); 30245 }); 30246 } 30247 30248 var keysFunc = isFull 30249 ? (isFlat ? getAllKeysIn : getAllKeys) 30250 : (isFlat ? keysIn : keys); 30251 30252 var props = isArr ? undefined : keysFunc(value); 30253 arrayEach(props || value, function(subValue, key) { 30254 if (props) { 30255 key = subValue; 30256 subValue = value[key]; 30257 } 30258 // Recursively populate clone (susceptible to call stack limits). 30259 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); 30260 }); 30261 return result; 30262 } 30263 30264 /** 30265 * The base implementation of `_.conforms` which doesn't clone `source`. 30266 * 30267 * @private 30268 * @param {Object} source The object of property predicates to conform to. 30269 * @returns {Function} Returns the new spec function. 30270 */ 30271 function baseConforms(source) { 30272 var props = keys(source); 30273 return function(object) { 30274 return baseConformsTo(object, source, props); 30275 }; 30276 } 30277 30278 /** 30279 * The base implementation of `_.conformsTo` which accepts `props` to check. 30280 * 30281 * @private 30282 * @param {Object} object The object to inspect. 30283 * @param {Object} source The object of property predicates to conform to. 30284 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 30285 */ 30286 function baseConformsTo(object, source, props) { 30287 var length = props.length; 30288 if (object == null) { 30289 return !length; 30290 } 30291 object = Object(object); 30292 while (length--) { 30293 var key = props[length], 30294 predicate = source[key], 30295 value = object[key]; 30296 30297 if ((value === undefined && !(key in object)) || !predicate(value)) { 30298 return false; 30299 } 30300 } 30301 return true; 30302 } 30303 30304 /** 30305 * The base implementation of `_.delay` and `_.defer` which accepts `args` 30306 * to provide to `func`. 30307 * 30308 * @private 30309 * @param {Function} func The function to delay. 30310 * @param {number} wait The number of milliseconds to delay invocation. 30311 * @param {Array} args The arguments to provide to `func`. 30312 * @returns {number|Object} Returns the timer id or timeout object. 30313 */ 30314 function baseDelay(func, wait, args) { 30315 if (typeof func != 'function') { 30316 throw new TypeError(FUNC_ERROR_TEXT); 30317 } 30318 return setTimeout(function() { func.apply(undefined, args); }, wait); 30319 } 30320 30321 /** 30322 * The base implementation of methods like `_.difference` without support 30323 * for excluding multiple arrays or iteratee shorthands. 30324 * 30325 * @private 30326 * @param {Array} array The array to inspect. 30327 * @param {Array} values The values to exclude. 30328 * @param {Function} [iteratee] The iteratee invoked per element. 30329 * @param {Function} [comparator] The comparator invoked per element. 30330 * @returns {Array} Returns the new array of filtered values. 30331 */ 30332 function baseDifference(array, values, iteratee, comparator) { 30333 var index = -1, 30334 includes = arrayIncludes, 30335 isCommon = true, 30336 length = array.length, 30337 result = [], 30338 valuesLength = values.length; 30339 30340 if (!length) { 30341 return result; 30342 } 30343 if (iteratee) { 30344 values = arrayMap(values, baseUnary(iteratee)); 30345 } 30346 if (comparator) { 30347 includes = arrayIncludesWith; 30348 isCommon = false; 30349 } 30350 else if (values.length >= LARGE_ARRAY_SIZE) { 30351 includes = cacheHas; 30352 isCommon = false; 30353 values = new SetCache(values); 30354 } 30355 outer: 30356 while (++index < length) { 30357 var value = array[index], 30358 computed = iteratee == null ? value : iteratee(value); 30359 30360 value = (comparator || value !== 0) ? value : 0; 30361 if (isCommon && computed === computed) { 30362 var valuesIndex = valuesLength; 30363 while (valuesIndex--) { 30364 if (values[valuesIndex] === computed) { 30365 continue outer; 30366 } 30367 } 30368 result.push(value); 30369 } 30370 else if (!includes(values, computed, comparator)) { 30371 result.push(value); 30372 } 30373 } 30374 return result; 30375 } 30376 30377 /** 30378 * The base implementation of `_.forEach` without support for iteratee shorthands. 30379 * 30380 * @private 30381 * @param {Array|Object} collection The collection to iterate over. 30382 * @param {Function} iteratee The function invoked per iteration. 30383 * @returns {Array|Object} Returns `collection`. 30384 */ 30385 var baseEach = createBaseEach(baseForOwn); 30386 30387 /** 30388 * The base implementation of `_.forEachRight` without support for iteratee shorthands. 30389 * 30390 * @private 30391 * @param {Array|Object} collection The collection to iterate over. 30392 * @param {Function} iteratee The function invoked per iteration. 30393 * @returns {Array|Object} Returns `collection`. 30394 */ 30395 var baseEachRight = createBaseEach(baseForOwnRight, true); 30396 30397 /** 30398 * The base implementation of `_.every` without support for iteratee shorthands. 30399 * 30400 * @private 30401 * @param {Array|Object} collection The collection to iterate over. 30402 * @param {Function} predicate The function invoked per iteration. 30403 * @returns {boolean} Returns `true` if all elements pass the predicate check, 30404 * else `false` 30405 */ 30406 function baseEvery(collection, predicate) { 30407 var result = true; 30408 baseEach(collection, function(value, index, collection) { 30409 result = !!predicate(value, index, collection); 30410 return result; 30411 }); 30412 return result; 30413 } 30414 30415 /** 30416 * The base implementation of methods like `_.max` and `_.min` which accepts a 30417 * `comparator` to determine the extremum value. 30418 * 30419 * @private 30420 * @param {Array} array The array to iterate over. 30421 * @param {Function} iteratee The iteratee invoked per iteration. 30422 * @param {Function} comparator The comparator used to compare values. 30423 * @returns {*} Returns the extremum value. 30424 */ 30425 function baseExtremum(array, iteratee, comparator) { 30426 var index = -1, 30427 length = array.length; 30428 30429 while (++index < length) { 30430 var value = array[index], 30431 current = iteratee(value); 30432 30433 if (current != null && (computed === undefined 30434 ? (current === current && !isSymbol(current)) 30435 : comparator(current, computed) 30436 )) { 30437 var computed = current, 30438 result = value; 30439 } 30440 } 30441 return result; 30442 } 30443 30444 /** 30445 * The base implementation of `_.fill` without an iteratee call guard. 30446 * 30447 * @private 30448 * @param {Array} array The array to fill. 30449 * @param {*} value The value to fill `array` with. 30450 * @param {number} [start=0] The start position. 30451 * @param {number} [end=array.length] The end position. 30452 * @returns {Array} Returns `array`. 30453 */ 30454 function baseFill(array, value, start, end) { 30455 var length = array.length; 30456 30457 start = toInteger(start); 30458 if (start < 0) { 30459 start = -start > length ? 0 : (length + start); 30460 } 30461 end = (end === undefined || end > length) ? length : toInteger(end); 30462 if (end < 0) { 30463 end += length; 30464 } 30465 end = start > end ? 0 : toLength(end); 30466 while (start < end) { 30467 array[start++] = value; 30468 } 30469 return array; 30470 } 30471 30472 /** 30473 * The base implementation of `_.filter` without support for iteratee shorthands. 30474 * 30475 * @private 30476 * @param {Array|Object} collection The collection to iterate over. 30477 * @param {Function} predicate The function invoked per iteration. 30478 * @returns {Array} Returns the new filtered array. 30479 */ 30480 function baseFilter(collection, predicate) { 30481 var result = []; 30482 baseEach(collection, function(value, index, collection) { 30483 if (predicate(value, index, collection)) { 30484 result.push(value); 30485 } 30486 }); 30487 return result; 30488 } 30489 30490 /** 30491 * The base implementation of `_.flatten` with support for restricting flattening. 30492 * 30493 * @private 30494 * @param {Array} array The array to flatten. 30495 * @param {number} depth The maximum recursion depth. 30496 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 30497 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 30498 * @param {Array} [result=[]] The initial result value. 30499 * @returns {Array} Returns the new flattened array. 30500 */ 30501 function baseFlatten(array, depth, predicate, isStrict, result) { 30502 var index = -1, 30503 length = array.length; 30504 30505 predicate || (predicate = isFlattenable); 30506 result || (result = []); 30507 30508 while (++index < length) { 30509 var value = array[index]; 30510 if (depth > 0 && predicate(value)) { 30511 if (depth > 1) { 30512 // Recursively flatten arrays (susceptible to call stack limits). 30513 baseFlatten(value, depth - 1, predicate, isStrict, result); 30514 } else { 30515 arrayPush(result, value); 30516 } 30517 } else if (!isStrict) { 30518 result[result.length] = value; 30519 } 30520 } 30521 return result; 30522 } 30523 30524 /** 30525 * The base implementation of `baseForOwn` which iterates over `object` 30526 * properties returned by `keysFunc` and invokes `iteratee` for each property. 30527 * Iteratee functions may exit iteration early by explicitly returning `false`. 30528 * 30529 * @private 30530 * @param {Object} object The object to iterate over. 30531 * @param {Function} iteratee The function invoked per iteration. 30532 * @param {Function} keysFunc The function to get the keys of `object`. 30533 * @returns {Object} Returns `object`. 30534 */ 30535 var baseFor = createBaseFor(); 30536 30537 /** 30538 * This function is like `baseFor` except that it iterates over properties 30539 * in the opposite order. 30540 * 30541 * @private 30542 * @param {Object} object The object to iterate over. 30543 * @param {Function} iteratee The function invoked per iteration. 30544 * @param {Function} keysFunc The function to get the keys of `object`. 30545 * @returns {Object} Returns `object`. 30546 */ 30547 var baseForRight = createBaseFor(true); 30548 30549 /** 30550 * The base implementation of `_.forOwn` without support for iteratee shorthands. 30551 * 30552 * @private 30553 * @param {Object} object The object to iterate over. 30554 * @param {Function} iteratee The function invoked per iteration. 30555 * @returns {Object} Returns `object`. 30556 */ 30557 function baseForOwn(object, iteratee) { 30558 return object && baseFor(object, iteratee, keys); 30559 } 30560 30561 /** 30562 * The base implementation of `_.forOwnRight` without support for iteratee shorthands. 30563 * 30564 * @private 30565 * @param {Object} object The object to iterate over. 30566 * @param {Function} iteratee The function invoked per iteration. 30567 * @returns {Object} Returns `object`. 30568 */ 30569 function baseForOwnRight(object, iteratee) { 30570 return object && baseForRight(object, iteratee, keys); 30571 } 30572 30573 /** 30574 * The base implementation of `_.functions` which creates an array of 30575 * `object` function property names filtered from `props`. 30576 * 30577 * @private 30578 * @param {Object} object The object to inspect. 30579 * @param {Array} props The property names to filter. 30580 * @returns {Array} Returns the function names. 30581 */ 30582 function baseFunctions(object, props) { 30583 return arrayFilter(props, function(key) { 30584 return isFunction(object[key]); 30585 }); 30586 } 30587 30588 /** 30589 * The base implementation of `_.get` without support for default values. 30590 * 30591 * @private 30592 * @param {Object} object The object to query. 30593 * @param {Array|string} path The path of the property to get. 30594 * @returns {*} Returns the resolved value. 30595 */ 30596 function baseGet(object, path) { 30597 path = castPath(path, object); 30598 30599 var index = 0, 30600 length = path.length; 30601 30602 while (object != null && index < length) { 30603 object = object[toKey(path[index++])]; 30604 } 30605 return (index && index == length) ? object : undefined; 30606 } 30607 30608 /** 30609 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 30610 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 30611 * symbols of `object`. 30612 * 30613 * @private 30614 * @param {Object} object The object to query. 30615 * @param {Function} keysFunc The function to get the keys of `object`. 30616 * @param {Function} symbolsFunc The function to get the symbols of `object`. 30617 * @returns {Array} Returns the array of property names and symbols. 30618 */ 30619 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 30620 var result = keysFunc(object); 30621 return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); 30622 } 30623 30624 /** 30625 * The base implementation of `getTag` without fallbacks for buggy environments. 30626 * 30627 * @private 30628 * @param {*} value The value to query. 30629 * @returns {string} Returns the `toStringTag`. 30630 */ 30631 function baseGetTag(value) { 30632 if (value == null) { 30633 return value === undefined ? undefinedTag : nullTag; 30634 } 30635 return (symToStringTag && symToStringTag in Object(value)) 30636 ? getRawTag(value) 30637 : objectToString(value); 30638 } 30639 30640 /** 30641 * The base implementation of `_.gt` which doesn't coerce arguments. 30642 * 30643 * @private 30644 * @param {*} value The value to compare. 30645 * @param {*} other The other value to compare. 30646 * @returns {boolean} Returns `true` if `value` is greater than `other`, 30647 * else `false`. 30648 */ 30649 function baseGt(value, other) { 30650 return value > other; 30651 } 30652 30653 /** 30654 * The base implementation of `_.has` without support for deep paths. 30655 * 30656 * @private 30657 * @param {Object} [object] The object to query. 30658 * @param {Array|string} key The key to check. 30659 * @returns {boolean} Returns `true` if `key` exists, else `false`. 30660 */ 30661 function baseHas(object, key) { 30662 return object != null && hasOwnProperty.call(object, key); 30663 } 30664 30665 /** 30666 * The base implementation of `_.hasIn` without support for deep paths. 30667 * 30668 * @private 30669 * @param {Object} [object] The object to query. 30670 * @param {Array|string} key The key to check. 30671 * @returns {boolean} Returns `true` if `key` exists, else `false`. 30672 */ 30673 function baseHasIn(object, key) { 30674 return object != null && key in Object(object); 30675 } 30676 30677 /** 30678 * The base implementation of `_.inRange` which doesn't coerce arguments. 30679 * 30680 * @private 30681 * @param {number} number The number to check. 30682 * @param {number} start The start of the range. 30683 * @param {number} end The end of the range. 30684 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 30685 */ 30686 function baseInRange(number, start, end) { 30687 return number >= nativeMin(start, end) && number < nativeMax(start, end); 30688 } 30689 30690 /** 30691 * The base implementation of methods like `_.intersection`, without support 30692 * for iteratee shorthands, that accepts an array of arrays to inspect. 30693 * 30694 * @private 30695 * @param {Array} arrays The arrays to inspect. 30696 * @param {Function} [iteratee] The iteratee invoked per element. 30697 * @param {Function} [comparator] The comparator invoked per element. 30698 * @returns {Array} Returns the new array of shared values. 30699 */ 30700 function baseIntersection(arrays, iteratee, comparator) { 30701 var includes = comparator ? arrayIncludesWith : arrayIncludes, 30702 length = arrays[0].length, 30703 othLength = arrays.length, 30704 othIndex = othLength, 30705 caches = Array(othLength), 30706 maxLength = Infinity, 30707 result = []; 30708 30709 while (othIndex--) { 30710 var array = arrays[othIndex]; 30711 if (othIndex && iteratee) { 30712 array = arrayMap(array, baseUnary(iteratee)); 30713 } 30714 maxLength = nativeMin(array.length, maxLength); 30715 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) 30716 ? new SetCache(othIndex && array) 30717 : undefined; 30718 } 30719 array = arrays[0]; 30720 30721 var index = -1, 30722 seen = caches[0]; 30723 30724 outer: 30725 while (++index < length && result.length < maxLength) { 30726 var value = array[index], 30727 computed = iteratee ? iteratee(value) : value; 30728 30729 value = (comparator || value !== 0) ? value : 0; 30730 if (!(seen 30731 ? cacheHas(seen, computed) 30732 : includes(result, computed, comparator) 30733 )) { 30734 othIndex = othLength; 30735 while (--othIndex) { 30736 var cache = caches[othIndex]; 30737 if (!(cache 30738 ? cacheHas(cache, computed) 30739 : includes(arrays[othIndex], computed, comparator)) 30740 ) { 30741 continue outer; 30742 } 30743 } 30744 if (seen) { 30745 seen.push(computed); 30746 } 30747 result.push(value); 30748 } 30749 } 30750 return result; 30751 } 30752 30753 /** 30754 * The base implementation of `_.invert` and `_.invertBy` which inverts 30755 * `object` with values transformed by `iteratee` and set by `setter`. 30756 * 30757 * @private 30758 * @param {Object} object The object to iterate over. 30759 * @param {Function} setter The function to set `accumulator` values. 30760 * @param {Function} iteratee The iteratee to transform values. 30761 * @param {Object} accumulator The initial inverted object. 30762 * @returns {Function} Returns `accumulator`. 30763 */ 30764 function baseInverter(object, setter, iteratee, accumulator) { 30765 baseForOwn(object, function(value, key, object) { 30766 setter(accumulator, iteratee(value), key, object); 30767 }); 30768 return accumulator; 30769 } 30770 30771 /** 30772 * The base implementation of `_.invoke` without support for individual 30773 * method arguments. 30774 * 30775 * @private 30776 * @param {Object} object The object to query. 30777 * @param {Array|string} path The path of the method to invoke. 30778 * @param {Array} args The arguments to invoke the method with. 30779 * @returns {*} Returns the result of the invoked method. 30780 */ 30781 function baseInvoke(object, path, args) { 30782 path = castPath(path, object); 30783 object = parent(object, path); 30784 var func = object == null ? object : object[toKey(last(path))]; 30785 return func == null ? undefined : apply(func, object, args); 30786 } 30787 30788 /** 30789 * The base implementation of `_.isArguments`. 30790 * 30791 * @private 30792 * @param {*} value The value to check. 30793 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 30794 */ 30795 function baseIsArguments(value) { 30796 return isObjectLike(value) && baseGetTag(value) == argsTag; 30797 } 30798 30799 /** 30800 * The base implementation of `_.isArrayBuffer` without Node.js optimizations. 30801 * 30802 * @private 30803 * @param {*} value The value to check. 30804 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 30805 */ 30806 function baseIsArrayBuffer(value) { 30807 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; 30808 } 30809 30810 /** 30811 * The base implementation of `_.isDate` without Node.js optimizations. 30812 * 30813 * @private 30814 * @param {*} value The value to check. 30815 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 30816 */ 30817 function baseIsDate(value) { 30818 return isObjectLike(value) && baseGetTag(value) == dateTag; 30819 } 30820 30821 /** 30822 * The base implementation of `_.isEqual` which supports partial comparisons 30823 * and tracks traversed objects. 30824 * 30825 * @private 30826 * @param {*} value The value to compare. 30827 * @param {*} other The other value to compare. 30828 * @param {boolean} bitmask The bitmask flags. 30829 * 1 - Unordered comparison 30830 * 2 - Partial comparison 30831 * @param {Function} [customizer] The function to customize comparisons. 30832 * @param {Object} [stack] Tracks traversed `value` and `other` objects. 30833 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 30834 */ 30835 function baseIsEqual(value, other, bitmask, customizer, stack) { 30836 if (value === other) { 30837 return true; 30838 } 30839 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { 30840 return value !== value && other !== other; 30841 } 30842 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 30843 } 30844 30845 /** 30846 * A specialized version of `baseIsEqual` for arrays and objects which performs 30847 * deep comparisons and tracks traversed objects enabling objects with circular 30848 * references to be compared. 30849 * 30850 * @private 30851 * @param {Object} object The object to compare. 30852 * @param {Object} other The other object to compare. 30853 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 30854 * @param {Function} customizer The function to customize comparisons. 30855 * @param {Function} equalFunc The function to determine equivalents of values. 30856 * @param {Object} [stack] Tracks traversed `object` and `other` objects. 30857 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 30858 */ 30859 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { 30860 var objIsArr = isArray(object), 30861 othIsArr = isArray(other), 30862 objTag = objIsArr ? arrayTag : getTag(object), 30863 othTag = othIsArr ? arrayTag : getTag(other); 30864 30865 objTag = objTag == argsTag ? objectTag : objTag; 30866 othTag = othTag == argsTag ? objectTag : othTag; 30867 30868 var objIsObj = objTag == objectTag, 30869 othIsObj = othTag == objectTag, 30870 isSameTag = objTag == othTag; 30871 30872 if (isSameTag && isBuffer(object)) { 30873 if (!isBuffer(other)) { 30874 return false; 30875 } 30876 objIsArr = true; 30877 objIsObj = false; 30878 } 30879 if (isSameTag && !objIsObj) { 30880 stack || (stack = new Stack); 30881 return (objIsArr || isTypedArray(object)) 30882 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) 30883 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); 30884 } 30885 if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 30886 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 30887 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 30888 30889 if (objIsWrapped || othIsWrapped) { 30890 var objUnwrapped = objIsWrapped ? object.value() : object, 30891 othUnwrapped = othIsWrapped ? other.value() : other; 30892 30893 stack || (stack = new Stack); 30894 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 30895 } 30896 } 30897 if (!isSameTag) { 30898 return false; 30899 } 30900 stack || (stack = new Stack); 30901 return equalObjects(object, other, bitmask, customizer, equalFunc, stack); 30902 } 30903 30904 /** 30905 * The base implementation of `_.isMap` without Node.js optimizations. 30906 * 30907 * @private 30908 * @param {*} value The value to check. 30909 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 30910 */ 30911 function baseIsMap(value) { 30912 return isObjectLike(value) && getTag(value) == mapTag; 30913 } 30914 30915 /** 30916 * The base implementation of `_.isMatch` without support for iteratee shorthands. 30917 * 30918 * @private 30919 * @param {Object} object The object to inspect. 30920 * @param {Object} source The object of property values to match. 30921 * @param {Array} matchData The property names, values, and compare flags to match. 30922 * @param {Function} [customizer] The function to customize comparisons. 30923 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 30924 */ 30925 function baseIsMatch(object, source, matchData, customizer) { 30926 var index = matchData.length, 30927 length = index, 30928 noCustomizer = !customizer; 30929 30930 if (object == null) { 30931 return !length; 30932 } 30933 object = Object(object); 30934 while (index--) { 30935 var data = matchData[index]; 30936 if ((noCustomizer && data[2]) 30937 ? data[1] !== object[data[0]] 30938 : !(data[0] in object) 30939 ) { 30940 return false; 30941 } 30942 } 30943 while (++index < length) { 30944 data = matchData[index]; 30945 var key = data[0], 30946 objValue = object[key], 30947 srcValue = data[1]; 30948 30949 if (noCustomizer && data[2]) { 30950 if (objValue === undefined && !(key in object)) { 30951 return false; 30952 } 30953 } else { 30954 var stack = new Stack; 30955 if (customizer) { 30956 var result = customizer(objValue, srcValue, key, object, source, stack); 30957 } 30958 if (!(result === undefined 30959 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) 30960 : result 30961 )) { 30962 return false; 30963 } 30964 } 30965 } 30966 return true; 30967 } 30968 30969 /** 30970 * The base implementation of `_.isNative` without bad shim checks. 30971 * 30972 * @private 30973 * @param {*} value The value to check. 30974 * @returns {boolean} Returns `true` if `value` is a native function, 30975 * else `false`. 30976 */ 30977 function baseIsNative(value) { 30978 if (!isObject(value) || isMasked(value)) { 30979 return false; 30980 } 30981 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 30982 return pattern.test(toSource(value)); 30983 } 30984 30985 /** 30986 * The base implementation of `_.isRegExp` without Node.js optimizations. 30987 * 30988 * @private 30989 * @param {*} value The value to check. 30990 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 30991 */ 30992 function baseIsRegExp(value) { 30993 return isObjectLike(value) && baseGetTag(value) == regexpTag; 30994 } 30995 30996 /** 30997 * The base implementation of `_.isSet` without Node.js optimizations. 30998 * 30999 * @private 31000 * @param {*} value The value to check. 31001 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 31002 */ 31003 function baseIsSet(value) { 31004 return isObjectLike(value) && getTag(value) == setTag; 31005 } 31006 31007 /** 31008 * The base implementation of `_.isTypedArray` without Node.js optimizations. 31009 * 31010 * @private 31011 * @param {*} value The value to check. 31012 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 31013 */ 31014 function baseIsTypedArray(value) { 31015 return isObjectLike(value) && 31016 isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 31017 } 31018 31019 /** 31020 * The base implementation of `_.iteratee`. 31021 * 31022 * @private 31023 * @param {*} [value=_.identity] The value to convert to an iteratee. 31024 * @returns {Function} Returns the iteratee. 31025 */ 31026 function baseIteratee(value) { 31027 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. 31028 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. 31029 if (typeof value == 'function') { 31030 return value; 31031 } 31032 if (value == null) { 31033 return identity; 31034 } 31035 if (typeof value == 'object') { 31036 return isArray(value) 31037 ? baseMatchesProperty(value[0], value[1]) 31038 : baseMatches(value); 31039 } 31040 return property(value); 31041 } 31042 31043 /** 31044 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 31045 * 31046 * @private 31047 * @param {Object} object The object to query. 31048 * @returns {Array} Returns the array of property names. 31049 */ 31050 function baseKeys(object) { 31051 if (!isPrototype(object)) { 31052 return nativeKeys(object); 31053 } 31054 var result = []; 31055 for (var key in Object(object)) { 31056 if (hasOwnProperty.call(object, key) && key != 'constructor') { 31057 result.push(key); 31058 } 31059 } 31060 return result; 31061 } 31062 31063 /** 31064 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. 31065 * 31066 * @private 31067 * @param {Object} object The object to query. 31068 * @returns {Array} Returns the array of property names. 31069 */ 31070 function baseKeysIn(object) { 31071 if (!isObject(object)) { 31072 return nativeKeysIn(object); 31073 } 31074 var isProto = isPrototype(object), 31075 result = []; 31076 31077 for (var key in object) { 31078 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 31079 result.push(key); 31080 } 31081 } 31082 return result; 31083 } 31084 31085 /** 31086 * The base implementation of `_.lt` which doesn't coerce arguments. 31087 * 31088 * @private 31089 * @param {*} value The value to compare. 31090 * @param {*} other The other value to compare. 31091 * @returns {boolean} Returns `true` if `value` is less than `other`, 31092 * else `false`. 31093 */ 31094 function baseLt(value, other) { 31095 return value < other; 31096 } 31097 31098 /** 31099 * The base implementation of `_.map` without support for iteratee shorthands. 31100 * 31101 * @private 31102 * @param {Array|Object} collection The collection to iterate over. 31103 * @param {Function} iteratee The function invoked per iteration. 31104 * @returns {Array} Returns the new mapped array. 31105 */ 31106 function baseMap(collection, iteratee) { 31107 var index = -1, 31108 result = isArrayLike(collection) ? Array(collection.length) : []; 31109 31110 baseEach(collection, function(value, key, collection) { 31111 result[++index] = iteratee(value, key, collection); 31112 }); 31113 return result; 31114 } 31115 31116 /** 31117 * The base implementation of `_.matches` which doesn't clone `source`. 31118 * 31119 * @private 31120 * @param {Object} source The object of property values to match. 31121 * @returns {Function} Returns the new spec function. 31122 */ 31123 function baseMatches(source) { 31124 var matchData = getMatchData(source); 31125 if (matchData.length == 1 && matchData[0][2]) { 31126 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 31127 } 31128 return function(object) { 31129 return object === source || baseIsMatch(object, source, matchData); 31130 }; 31131 } 31132 31133 /** 31134 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. 31135 * 31136 * @private 31137 * @param {string} path The path of the property to get. 31138 * @param {*} srcValue The value to match. 31139 * @returns {Function} Returns the new spec function. 31140 */ 31141 function baseMatchesProperty(path, srcValue) { 31142 if (isKey(path) && isStrictComparable(srcValue)) { 31143 return matchesStrictComparable(toKey(path), srcValue); 31144 } 31145 return function(object) { 31146 var objValue = get(object, path); 31147 return (objValue === undefined && objValue === srcValue) 31148 ? hasIn(object, path) 31149 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 31150 }; 31151 } 31152 31153 /** 31154 * The base implementation of `_.merge` without support for multiple sources. 31155 * 31156 * @private 31157 * @param {Object} object The destination object. 31158 * @param {Object} source The source object. 31159 * @param {number} srcIndex The index of `source`. 31160 * @param {Function} [customizer] The function to customize merged values. 31161 * @param {Object} [stack] Tracks traversed source values and their merged 31162 * counterparts. 31163 */ 31164 function baseMerge(object, source, srcIndex, customizer, stack) { 31165 if (object === source) { 31166 return; 31167 } 31168 baseFor(source, function(srcValue, key) { 31169 stack || (stack = new Stack); 31170 if (isObject(srcValue)) { 31171 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); 31172 } 31173 else { 31174 var newValue = customizer 31175 ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) 31176 : undefined; 31177 31178 if (newValue === undefined) { 31179 newValue = srcValue; 31180 } 31181 assignMergeValue(object, key, newValue); 31182 } 31183 }, keysIn); 31184 } 31185 31186 /** 31187 * A specialized version of `baseMerge` for arrays and objects which performs 31188 * deep merges and tracks traversed objects enabling objects with circular 31189 * references to be merged. 31190 * 31191 * @private 31192 * @param {Object} object The destination object. 31193 * @param {Object} source The source object. 31194 * @param {string} key The key of the value to merge. 31195 * @param {number} srcIndex The index of `source`. 31196 * @param {Function} mergeFunc The function to merge values. 31197 * @param {Function} [customizer] The function to customize assigned values. 31198 * @param {Object} [stack] Tracks traversed source values and their merged 31199 * counterparts. 31200 */ 31201 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { 31202 var objValue = safeGet(object, key), 31203 srcValue = safeGet(source, key), 31204 stacked = stack.get(srcValue); 31205 31206 if (stacked) { 31207 assignMergeValue(object, key, stacked); 31208 return; 31209 } 31210 var newValue = customizer 31211 ? customizer(objValue, srcValue, (key + ''), object, source, stack) 31212 : undefined; 31213 31214 var isCommon = newValue === undefined; 31215 31216 if (isCommon) { 31217 var isArr = isArray(srcValue), 31218 isBuff = !isArr && isBuffer(srcValue), 31219 isTyped = !isArr && !isBuff && isTypedArray(srcValue); 31220 31221 newValue = srcValue; 31222 if (isArr || isBuff || isTyped) { 31223 if (isArray(objValue)) { 31224 newValue = objValue; 31225 } 31226 else if (isArrayLikeObject(objValue)) { 31227 newValue = copyArray(objValue); 31228 } 31229 else if (isBuff) { 31230 isCommon = false; 31231 newValue = cloneBuffer(srcValue, true); 31232 } 31233 else if (isTyped) { 31234 isCommon = false; 31235 newValue = cloneTypedArray(srcValue, true); 31236 } 31237 else { 31238 newValue = []; 31239 } 31240 } 31241 else if (isPlainObject(srcValue) || isArguments(srcValue)) { 31242 newValue = objValue; 31243 if (isArguments(objValue)) { 31244 newValue = toPlainObject(objValue); 31245 } 31246 else if (!isObject(objValue) || isFunction(objValue)) { 31247 newValue = initCloneObject(srcValue); 31248 } 31249 } 31250 else { 31251 isCommon = false; 31252 } 31253 } 31254 if (isCommon) { 31255 // Recursively merge objects and arrays (susceptible to call stack limits). 31256 stack.set(srcValue, newValue); 31257 mergeFunc(newValue, srcValue, srcIndex, customizer, stack); 31258 stack['delete'](srcValue); 31259 } 31260 assignMergeValue(object, key, newValue); 31261 } 31262 31263 /** 31264 * The base implementation of `_.nth` which doesn't coerce arguments. 31265 * 31266 * @private 31267 * @param {Array} array The array to query. 31268 * @param {number} n The index of the element to return. 31269 * @returns {*} Returns the nth element of `array`. 31270 */ 31271 function baseNth(array, n) { 31272 var length = array.length; 31273 if (!length) { 31274 return; 31275 } 31276 n += n < 0 ? length : 0; 31277 return isIndex(n, length) ? array[n] : undefined; 31278 } 31279 31280 /** 31281 * The base implementation of `_.orderBy` without param guards. 31282 * 31283 * @private 31284 * @param {Array|Object} collection The collection to iterate over. 31285 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. 31286 * @param {string[]} orders The sort orders of `iteratees`. 31287 * @returns {Array} Returns the new sorted array. 31288 */ 31289 function baseOrderBy(collection, iteratees, orders) { 31290 if (iteratees.length) { 31291 iteratees = arrayMap(iteratees, function(iteratee) { 31292 if (isArray(iteratee)) { 31293 return function(value) { 31294 return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); 31295 } 31296 } 31297 return iteratee; 31298 }); 31299 } else { 31300 iteratees = [identity]; 31301 } 31302 31303 var index = -1; 31304 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 31305 31306 var result = baseMap(collection, function(value, key, collection) { 31307 var criteria = arrayMap(iteratees, function(iteratee) { 31308 return iteratee(value); 31309 }); 31310 return { 'criteria': criteria, 'index': ++index, 'value': value }; 31311 }); 31312 31313 return baseSortBy(result, function(object, other) { 31314 return compareMultiple(object, other, orders); 31315 }); 31316 } 31317 31318 /** 31319 * The base implementation of `_.pick` without support for individual 31320 * property identifiers. 31321 * 31322 * @private 31323 * @param {Object} object The source object. 31324 * @param {string[]} paths The property paths to pick. 31325 * @returns {Object} Returns the new object. 31326 */ 31327 function basePick(object, paths) { 31328 return basePickBy(object, paths, function(value, path) { 31329 return hasIn(object, path); 31330 }); 31331 } 31332 31333 /** 31334 * The base implementation of `_.pickBy` without support for iteratee shorthands. 31335 * 31336 * @private 31337 * @param {Object} object The source object. 31338 * @param {string[]} paths The property paths to pick. 31339 * @param {Function} predicate The function invoked per property. 31340 * @returns {Object} Returns the new object. 31341 */ 31342 function basePickBy(object, paths, predicate) { 31343 var index = -1, 31344 length = paths.length, 31345 result = {}; 31346 31347 while (++index < length) { 31348 var path = paths[index], 31349 value = baseGet(object, path); 31350 31351 if (predicate(value, path)) { 31352 baseSet(result, castPath(path, object), value); 31353 } 31354 } 31355 return result; 31356 } 31357 31358 /** 31359 * A specialized version of `baseProperty` which supports deep paths. 31360 * 31361 * @private 31362 * @param {Array|string} path The path of the property to get. 31363 * @returns {Function} Returns the new accessor function. 31364 */ 31365 function basePropertyDeep(path) { 31366 return function(object) { 31367 return baseGet(object, path); 31368 }; 31369 } 31370 31371 /** 31372 * The base implementation of `_.pullAllBy` without support for iteratee 31373 * shorthands. 31374 * 31375 * @private 31376 * @param {Array} array The array to modify. 31377 * @param {Array} values The values to remove. 31378 * @param {Function} [iteratee] The iteratee invoked per element. 31379 * @param {Function} [comparator] The comparator invoked per element. 31380 * @returns {Array} Returns `array`. 31381 */ 31382 function basePullAll(array, values, iteratee, comparator) { 31383 var indexOf = comparator ? baseIndexOfWith : baseIndexOf, 31384 index = -1, 31385 length = values.length, 31386 seen = array; 31387 31388 if (array === values) { 31389 values = copyArray(values); 31390 } 31391 if (iteratee) { 31392 seen = arrayMap(array, baseUnary(iteratee)); 31393 } 31394 while (++index < length) { 31395 var fromIndex = 0, 31396 value = values[index], 31397 computed = iteratee ? iteratee(value) : value; 31398 31399 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { 31400 if (seen !== array) { 31401 splice.call(seen, fromIndex, 1); 31402 } 31403 splice.call(array, fromIndex, 1); 31404 } 31405 } 31406 return array; 31407 } 31408 31409 /** 31410 * The base implementation of `_.pullAt` without support for individual 31411 * indexes or capturing the removed elements. 31412 * 31413 * @private 31414 * @param {Array} array The array to modify. 31415 * @param {number[]} indexes The indexes of elements to remove. 31416 * @returns {Array} Returns `array`. 31417 */ 31418 function basePullAt(array, indexes) { 31419 var length = array ? indexes.length : 0, 31420 lastIndex = length - 1; 31421 31422 while (length--) { 31423 var index = indexes[length]; 31424 if (length == lastIndex || index !== previous) { 31425 var previous = index; 31426 if (isIndex(index)) { 31427 splice.call(array, index, 1); 31428 } else { 31429 baseUnset(array, index); 31430 } 31431 } 31432 } 31433 return array; 31434 } 31435 31436 /** 31437 * The base implementation of `_.random` without support for returning 31438 * floating-point numbers. 31439 * 31440 * @private 31441 * @param {number} lower The lower bound. 31442 * @param {number} upper The upper bound. 31443 * @returns {number} Returns the random number. 31444 */ 31445 function baseRandom(lower, upper) { 31446 return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); 31447 } 31448 31449 /** 31450 * The base implementation of `_.range` and `_.rangeRight` which doesn't 31451 * coerce arguments. 31452 * 31453 * @private 31454 * @param {number} start The start of the range. 31455 * @param {number} end The end of the range. 31456 * @param {number} step The value to increment or decrement by. 31457 * @param {boolean} [fromRight] Specify iterating from right to left. 31458 * @returns {Array} Returns the range of numbers. 31459 */ 31460 function baseRange(start, end, step, fromRight) { 31461 var index = -1, 31462 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), 31463 result = Array(length); 31464 31465 while (length--) { 31466 result[fromRight ? length : ++index] = start; 31467 start += step; 31468 } 31469 return result; 31470 } 31471 31472 /** 31473 * The base implementation of `_.repeat` which doesn't coerce arguments. 31474 * 31475 * @private 31476 * @param {string} string The string to repeat. 31477 * @param {number} n The number of times to repeat the string. 31478 * @returns {string} Returns the repeated string. 31479 */ 31480 function baseRepeat(string, n) { 31481 var result = ''; 31482 if (!string || n < 1 || n > MAX_SAFE_INTEGER) { 31483 return result; 31484 } 31485 // Leverage the exponentiation by squaring algorithm for a faster repeat. 31486 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. 31487 do { 31488 if (n % 2) { 31489 result += string; 31490 } 31491 n = nativeFloor(n / 2); 31492 if (n) { 31493 string += string; 31494 } 31495 } while (n); 31496 31497 return result; 31498 } 31499 31500 /** 31501 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 31502 * 31503 * @private 31504 * @param {Function} func The function to apply a rest parameter to. 31505 * @param {number} [start=func.length-1] The start position of the rest parameter. 31506 * @returns {Function} Returns the new function. 31507 */ 31508 function baseRest(func, start) { 31509 return setToString(overRest(func, start, identity), func + ''); 31510 } 31511 31512 /** 31513 * The base implementation of `_.sample`. 31514 * 31515 * @private 31516 * @param {Array|Object} collection The collection to sample. 31517 * @returns {*} Returns the random element. 31518 */ 31519 function baseSample(collection) { 31520 return arraySample(values(collection)); 31521 } 31522 31523 /** 31524 * The base implementation of `_.sampleSize` without param guards. 31525 * 31526 * @private 31527 * @param {Array|Object} collection The collection to sample. 31528 * @param {number} n The number of elements to sample. 31529 * @returns {Array} Returns the random elements. 31530 */ 31531 function baseSampleSize(collection, n) { 31532 var array = values(collection); 31533 return shuffleSelf(array, baseClamp(n, 0, array.length)); 31534 } 31535 31536 /** 31537 * The base implementation of `_.set`. 31538 * 31539 * @private 31540 * @param {Object} object The object to modify. 31541 * @param {Array|string} path The path of the property to set. 31542 * @param {*} value The value to set. 31543 * @param {Function} [customizer] The function to customize path creation. 31544 * @returns {Object} Returns `object`. 31545 */ 31546 function baseSet(object, path, value, customizer) { 31547 if (!isObject(object)) { 31548 return object; 31549 } 31550 path = castPath(path, object); 31551 31552 var index = -1, 31553 length = path.length, 31554 lastIndex = length - 1, 31555 nested = object; 31556 31557 while (nested != null && ++index < length) { 31558 var key = toKey(path[index]), 31559 newValue = value; 31560 31561 if (key === '__proto__' || key === 'constructor' || key === 'prototype') { 31562 return object; 31563 } 31564 31565 if (index != lastIndex) { 31566 var objValue = nested[key]; 31567 newValue = customizer ? customizer(objValue, key, nested) : undefined; 31568 if (newValue === undefined) { 31569 newValue = isObject(objValue) 31570 ? objValue 31571 : (isIndex(path[index + 1]) ? [] : {}); 31572 } 31573 } 31574 assignValue(nested, key, newValue); 31575 nested = nested[key]; 31576 } 31577 return object; 31578 } 31579 31580 /** 31581 * The base implementation of `setData` without support for hot loop shorting. 31582 * 31583 * @private 31584 * @param {Function} func The function to associate metadata with. 31585 * @param {*} data The metadata. 31586 * @returns {Function} Returns `func`. 31587 */ 31588 var baseSetData = !metaMap ? identity : function(func, data) { 31589 metaMap.set(func, data); 31590 return func; 31591 }; 31592 31593 /** 31594 * The base implementation of `setToString` without support for hot loop shorting. 31595 * 31596 * @private 31597 * @param {Function} func The function to modify. 31598 * @param {Function} string The `toString` result. 31599 * @returns {Function} Returns `func`. 31600 */ 31601 var baseSetToString = !defineProperty ? identity : function(func, string) { 31602 return defineProperty(func, 'toString', { 31603 'configurable': true, 31604 'enumerable': false, 31605 'value': constant(string), 31606 'writable': true 31607 }); 31608 }; 31609 31610 /** 31611 * The base implementation of `_.shuffle`. 31612 * 31613 * @private 31614 * @param {Array|Object} collection The collection to shuffle. 31615 * @returns {Array} Returns the new shuffled array. 31616 */ 31617 function baseShuffle(collection) { 31618 return shuffleSelf(values(collection)); 31619 } 31620 31621 /** 31622 * The base implementation of `_.slice` without an iteratee call guard. 31623 * 31624 * @private 31625 * @param {Array} array The array to slice. 31626 * @param {number} [start=0] The start position. 31627 * @param {number} [end=array.length] The end position. 31628 * @returns {Array} Returns the slice of `array`. 31629 */ 31630 function baseSlice(array, start, end) { 31631 var index = -1, 31632 length = array.length; 31633 31634 if (start < 0) { 31635 start = -start > length ? 0 : (length + start); 31636 } 31637 end = end > length ? length : end; 31638 if (end < 0) { 31639 end += length; 31640 } 31641 length = start > end ? 0 : ((end - start) >>> 0); 31642 start >>>= 0; 31643 31644 var result = Array(length); 31645 while (++index < length) { 31646 result[index] = array[index + start]; 31647 } 31648 return result; 31649 } 31650 31651 /** 31652 * The base implementation of `_.some` without support for iteratee shorthands. 31653 * 31654 * @private 31655 * @param {Array|Object} collection The collection to iterate over. 31656 * @param {Function} predicate The function invoked per iteration. 31657 * @returns {boolean} Returns `true` if any element passes the predicate check, 31658 * else `false`. 31659 */ 31660 function baseSome(collection, predicate) { 31661 var result; 31662 31663 baseEach(collection, function(value, index, collection) { 31664 result = predicate(value, index, collection); 31665 return !result; 31666 }); 31667 return !!result; 31668 } 31669 31670 /** 31671 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which 31672 * performs a binary search of `array` to determine the index at which `value` 31673 * should be inserted into `array` in order to maintain its sort order. 31674 * 31675 * @private 31676 * @param {Array} array The sorted array to inspect. 31677 * @param {*} value The value to evaluate. 31678 * @param {boolean} [retHighest] Specify returning the highest qualified index. 31679 * @returns {number} Returns the index at which `value` should be inserted 31680 * into `array`. 31681 */ 31682 function baseSortedIndex(array, value, retHighest) { 31683 var low = 0, 31684 high = array == null ? low : array.length; 31685 31686 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { 31687 while (low < high) { 31688 var mid = (low + high) >>> 1, 31689 computed = array[mid]; 31690 31691 if (computed !== null && !isSymbol(computed) && 31692 (retHighest ? (computed <= value) : (computed < value))) { 31693 low = mid + 1; 31694 } else { 31695 high = mid; 31696 } 31697 } 31698 return high; 31699 } 31700 return baseSortedIndexBy(array, value, identity, retHighest); 31701 } 31702 31703 /** 31704 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` 31705 * which invokes `iteratee` for `value` and each element of `array` to compute 31706 * their sort ranking. The iteratee is invoked with one argument; (value). 31707 * 31708 * @private 31709 * @param {Array} array The sorted array to inspect. 31710 * @param {*} value The value to evaluate. 31711 * @param {Function} iteratee The iteratee invoked per element. 31712 * @param {boolean} [retHighest] Specify returning the highest qualified index. 31713 * @returns {number} Returns the index at which `value` should be inserted 31714 * into `array`. 31715 */ 31716 function baseSortedIndexBy(array, value, iteratee, retHighest) { 31717 var low = 0, 31718 high = array == null ? 0 : array.length; 31719 if (high === 0) { 31720 return 0; 31721 } 31722 31723 value = iteratee(value); 31724 var valIsNaN = value !== value, 31725 valIsNull = value === null, 31726 valIsSymbol = isSymbol(value), 31727 valIsUndefined = value === undefined; 31728 31729 while (low < high) { 31730 var mid = nativeFloor((low + high) / 2), 31731 computed = iteratee(array[mid]), 31732 othIsDefined = computed !== undefined, 31733 othIsNull = computed === null, 31734 othIsReflexive = computed === computed, 31735 othIsSymbol = isSymbol(computed); 31736 31737 if (valIsNaN) { 31738 var setLow = retHighest || othIsReflexive; 31739 } else if (valIsUndefined) { 31740 setLow = othIsReflexive && (retHighest || othIsDefined); 31741 } else if (valIsNull) { 31742 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); 31743 } else if (valIsSymbol) { 31744 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); 31745 } else if (othIsNull || othIsSymbol) { 31746 setLow = false; 31747 } else { 31748 setLow = retHighest ? (computed <= value) : (computed < value); 31749 } 31750 if (setLow) { 31751 low = mid + 1; 31752 } else { 31753 high = mid; 31754 } 31755 } 31756 return nativeMin(high, MAX_ARRAY_INDEX); 31757 } 31758 31759 /** 31760 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without 31761 * support for iteratee shorthands. 31762 * 31763 * @private 31764 * @param {Array} array The array to inspect. 31765 * @param {Function} [iteratee] The iteratee invoked per element. 31766 * @returns {Array} Returns the new duplicate free array. 31767 */ 31768 function baseSortedUniq(array, iteratee) { 31769 var index = -1, 31770 length = array.length, 31771 resIndex = 0, 31772 result = []; 31773 31774 while (++index < length) { 31775 var value = array[index], 31776 computed = iteratee ? iteratee(value) : value; 31777 31778 if (!index || !eq(computed, seen)) { 31779 var seen = computed; 31780 result[resIndex++] = value === 0 ? 0 : value; 31781 } 31782 } 31783 return result; 31784 } 31785 31786 /** 31787 * The base implementation of `_.toNumber` which doesn't ensure correct 31788 * conversions of binary, hexadecimal, or octal string values. 31789 * 31790 * @private 31791 * @param {*} value The value to process. 31792 * @returns {number} Returns the number. 31793 */ 31794 function baseToNumber(value) { 31795 if (typeof value == 'number') { 31796 return value; 31797 } 31798 if (isSymbol(value)) { 31799 return NAN; 31800 } 31801 return +value; 31802 } 31803 31804 /** 31805 * The base implementation of `_.toString` which doesn't convert nullish 31806 * values to empty strings. 31807 * 31808 * @private 31809 * @param {*} value The value to process. 31810 * @returns {string} Returns the string. 31811 */ 31812 function baseToString(value) { 31813 // Exit early for strings to avoid a performance hit in some environments. 31814 if (typeof value == 'string') { 31815 return value; 31816 } 31817 if (isArray(value)) { 31818 // Recursively convert values (susceptible to call stack limits). 31819 return arrayMap(value, baseToString) + ''; 31820 } 31821 if (isSymbol(value)) { 31822 return symbolToString ? symbolToString.call(value) : ''; 31823 } 31824 var result = (value + ''); 31825 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 31826 } 31827 31828 /** 31829 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 31830 * 31831 * @private 31832 * @param {Array} array The array to inspect. 31833 * @param {Function} [iteratee] The iteratee invoked per element. 31834 * @param {Function} [comparator] The comparator invoked per element. 31835 * @returns {Array} Returns the new duplicate free array. 31836 */ 31837 function baseUniq(array, iteratee, comparator) { 31838 var index = -1, 31839 includes = arrayIncludes, 31840 length = array.length, 31841 isCommon = true, 31842 result = [], 31843 seen = result; 31844 31845 if (comparator) { 31846 isCommon = false; 31847 includes = arrayIncludesWith; 31848 } 31849 else if (length >= LARGE_ARRAY_SIZE) { 31850 var set = iteratee ? null : createSet(array); 31851 if (set) { 31852 return setToArray(set); 31853 } 31854 isCommon = false; 31855 includes = cacheHas; 31856 seen = new SetCache; 31857 } 31858 else { 31859 seen = iteratee ? [] : result; 31860 } 31861 outer: 31862 while (++index < length) { 31863 var value = array[index], 31864 computed = iteratee ? iteratee(value) : value; 31865 31866 value = (comparator || value !== 0) ? value : 0; 31867 if (isCommon && computed === computed) { 31868 var seenIndex = seen.length; 31869 while (seenIndex--) { 31870 if (seen[seenIndex] === computed) { 31871 continue outer; 31872 } 31873 } 31874 if (iteratee) { 31875 seen.push(computed); 31876 } 31877 result.push(value); 31878 } 31879 else if (!includes(seen, computed, comparator)) { 31880 if (seen !== result) { 31881 seen.push(computed); 31882 } 31883 result.push(value); 31884 } 31885 } 31886 return result; 31887 } 31888 31889 /** 31890 * The base implementation of `_.unset`. 31891 * 31892 * @private 31893 * @param {Object} object The object to modify. 31894 * @param {Array|string} path The property path to unset. 31895 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 31896 */ 31897 function baseUnset(object, path) { 31898 path = castPath(path, object); 31899 object = parent(object, path); 31900 return object == null || delete object[toKey(last(path))]; 31901 } 31902 31903 /** 31904 * The base implementation of `_.update`. 31905 * 31906 * @private 31907 * @param {Object} object The object to modify. 31908 * @param {Array|string} path The path of the property to update. 31909 * @param {Function} updater The function to produce the updated value. 31910 * @param {Function} [customizer] The function to customize path creation. 31911 * @returns {Object} Returns `object`. 31912 */ 31913 function baseUpdate(object, path, updater, customizer) { 31914 return baseSet(object, path, updater(baseGet(object, path)), customizer); 31915 } 31916 31917 /** 31918 * The base implementation of methods like `_.dropWhile` and `_.takeWhile` 31919 * without support for iteratee shorthands. 31920 * 31921 * @private 31922 * @param {Array} array The array to query. 31923 * @param {Function} predicate The function invoked per iteration. 31924 * @param {boolean} [isDrop] Specify dropping elements instead of taking them. 31925 * @param {boolean} [fromRight] Specify iterating from right to left. 31926 * @returns {Array} Returns the slice of `array`. 31927 */ 31928 function baseWhile(array, predicate, isDrop, fromRight) { 31929 var length = array.length, 31930 index = fromRight ? length : -1; 31931 31932 while ((fromRight ? index-- : ++index < length) && 31933 predicate(array[index], index, array)) {} 31934 31935 return isDrop 31936 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) 31937 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); 31938 } 31939 31940 /** 31941 * The base implementation of `wrapperValue` which returns the result of 31942 * performing a sequence of actions on the unwrapped `value`, where each 31943 * successive action is supplied the return value of the previous. 31944 * 31945 * @private 31946 * @param {*} value The unwrapped value. 31947 * @param {Array} actions Actions to perform to resolve the unwrapped value. 31948 * @returns {*} Returns the resolved value. 31949 */ 31950 function baseWrapperValue(value, actions) { 31951 var result = value; 31952 if (result instanceof LazyWrapper) { 31953 result = result.value(); 31954 } 31955 return arrayReduce(actions, function(result, action) { 31956 return action.func.apply(action.thisArg, arrayPush([result], action.args)); 31957 }, result); 31958 } 31959 31960 /** 31961 * The base implementation of methods like `_.xor`, without support for 31962 * iteratee shorthands, that accepts an array of arrays to inspect. 31963 * 31964 * @private 31965 * @param {Array} arrays The arrays to inspect. 31966 * @param {Function} [iteratee] The iteratee invoked per element. 31967 * @param {Function} [comparator] The comparator invoked per element. 31968 * @returns {Array} Returns the new array of values. 31969 */ 31970 function baseXor(arrays, iteratee, comparator) { 31971 var length = arrays.length; 31972 if (length < 2) { 31973 return length ? baseUniq(arrays[0]) : []; 31974 } 31975 var index = -1, 31976 result = Array(length); 31977 31978 while (++index < length) { 31979 var array = arrays[index], 31980 othIndex = -1; 31981 31982 while (++othIndex < length) { 31983 if (othIndex != index) { 31984 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); 31985 } 31986 } 31987 } 31988 return baseUniq(baseFlatten(result, 1), iteratee, comparator); 31989 } 31990 31991 /** 31992 * This base implementation of `_.zipObject` which assigns values using `assignFunc`. 31993 * 31994 * @private 31995 * @param {Array} props The property identifiers. 31996 * @param {Array} values The property values. 31997 * @param {Function} assignFunc The function to assign values. 31998 * @returns {Object} Returns the new object. 31999 */ 32000 function baseZipObject(props, values, assignFunc) { 32001 var index = -1, 32002 length = props.length, 32003 valsLength = values.length, 32004 result = {}; 32005 32006 while (++index < length) { 32007 var value = index < valsLength ? values[index] : undefined; 32008 assignFunc(result, props[index], value); 32009 } 32010 return result; 32011 } 32012 32013 /** 32014 * Casts `value` to an empty array if it's not an array like object. 32015 * 32016 * @private 32017 * @param {*} value The value to inspect. 32018 * @returns {Array|Object} Returns the cast array-like object. 32019 */ 32020 function castArrayLikeObject(value) { 32021 return isArrayLikeObject(value) ? value : []; 32022 } 32023 32024 /** 32025 * Casts `value` to `identity` if it's not a function. 32026 * 32027 * @private 32028 * @param {*} value The value to inspect. 32029 * @returns {Function} Returns cast function. 32030 */ 32031 function castFunction(value) { 32032 return typeof value == 'function' ? value : identity; 32033 } 32034 32035 /** 32036 * Casts `value` to a path array if it's not one. 32037 * 32038 * @private 32039 * @param {*} value The value to inspect. 32040 * @param {Object} [object] The object to query keys on. 32041 * @returns {Array} Returns the cast property path array. 32042 */ 32043 function castPath(value, object) { 32044 if (isArray(value)) { 32045 return value; 32046 } 32047 return isKey(value, object) ? [value] : stringToPath(toString(value)); 32048 } 32049 32050 /** 32051 * A `baseRest` alias which can be replaced with `identity` by module 32052 * replacement plugins. 32053 * 32054 * @private 32055 * @type {Function} 32056 * @param {Function} func The function to apply a rest parameter to. 32057 * @returns {Function} Returns the new function. 32058 */ 32059 var castRest = baseRest; 32060 32061 /** 32062 * Casts `array` to a slice if it's needed. 32063 * 32064 * @private 32065 * @param {Array} array The array to inspect. 32066 * @param {number} start The start position. 32067 * @param {number} [end=array.length] The end position. 32068 * @returns {Array} Returns the cast slice. 32069 */ 32070 function castSlice(array, start, end) { 32071 var length = array.length; 32072 end = end === undefined ? length : end; 32073 return (!start && end >= length) ? array : baseSlice(array, start, end); 32074 } 32075 32076 /** 32077 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). 32078 * 32079 * @private 32080 * @param {number|Object} id The timer id or timeout object of the timer to clear. 32081 */ 32082 var clearTimeout = ctxClearTimeout || function(id) { 32083 return root.clearTimeout(id); 32084 }; 32085 32086 /** 32087 * Creates a clone of `buffer`. 32088 * 32089 * @private 32090 * @param {Buffer} buffer The buffer to clone. 32091 * @param {boolean} [isDeep] Specify a deep clone. 32092 * @returns {Buffer} Returns the cloned buffer. 32093 */ 32094 function cloneBuffer(buffer, isDeep) { 32095 if (isDeep) { 32096 return buffer.slice(); 32097 } 32098 var length = buffer.length, 32099 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); 32100 32101 buffer.copy(result); 32102 return result; 32103 } 32104 32105 /** 32106 * Creates a clone of `arrayBuffer`. 32107 * 32108 * @private 32109 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 32110 * @returns {ArrayBuffer} Returns the cloned array buffer. 32111 */ 32112 function cloneArrayBuffer(arrayBuffer) { 32113 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 32114 new Uint8Array(result).set(new Uint8Array(arrayBuffer)); 32115 return result; 32116 } 32117 32118 /** 32119 * Creates a clone of `dataView`. 32120 * 32121 * @private 32122 * @param {Object} dataView The data view to clone. 32123 * @param {boolean} [isDeep] Specify a deep clone. 32124 * @returns {Object} Returns the cloned data view. 32125 */ 32126 function cloneDataView(dataView, isDeep) { 32127 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 32128 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 32129 } 32130 32131 /** 32132 * Creates a clone of `regexp`. 32133 * 32134 * @private 32135 * @param {Object} regexp The regexp to clone. 32136 * @returns {Object} Returns the cloned regexp. 32137 */ 32138 function cloneRegExp(regexp) { 32139 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 32140 result.lastIndex = regexp.lastIndex; 32141 return result; 32142 } 32143 32144 /** 32145 * Creates a clone of the `symbol` object. 32146 * 32147 * @private 32148 * @param {Object} symbol The symbol object to clone. 32149 * @returns {Object} Returns the cloned symbol object. 32150 */ 32151 function cloneSymbol(symbol) { 32152 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 32153 } 32154 32155 /** 32156 * Creates a clone of `typedArray`. 32157 * 32158 * @private 32159 * @param {Object} typedArray The typed array to clone. 32160 * @param {boolean} [isDeep] Specify a deep clone. 32161 * @returns {Object} Returns the cloned typed array. 32162 */ 32163 function cloneTypedArray(typedArray, isDeep) { 32164 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 32165 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 32166 } 32167 32168 /** 32169 * Compares values to sort them in ascending order. 32170 * 32171 * @private 32172 * @param {*} value The value to compare. 32173 * @param {*} other The other value to compare. 32174 * @returns {number} Returns the sort order indicator for `value`. 32175 */ 32176 function compareAscending(value, other) { 32177 if (value !== other) { 32178 var valIsDefined = value !== undefined, 32179 valIsNull = value === null, 32180 valIsReflexive = value === value, 32181 valIsSymbol = isSymbol(value); 32182 32183 var othIsDefined = other !== undefined, 32184 othIsNull = other === null, 32185 othIsReflexive = other === other, 32186 othIsSymbol = isSymbol(other); 32187 32188 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || 32189 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || 32190 (valIsNull && othIsDefined && othIsReflexive) || 32191 (!valIsDefined && othIsReflexive) || 32192 !valIsReflexive) { 32193 return 1; 32194 } 32195 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || 32196 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || 32197 (othIsNull && valIsDefined && valIsReflexive) || 32198 (!othIsDefined && valIsReflexive) || 32199 !othIsReflexive) { 32200 return -1; 32201 } 32202 } 32203 return 0; 32204 } 32205 32206 /** 32207 * Used by `_.orderBy` to compare multiple properties of a value to another 32208 * and stable sort them. 32209 * 32210 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, 32211 * specify an order of "desc" for descending or "asc" for ascending sort order 32212 * of corresponding values. 32213 * 32214 * @private 32215 * @param {Object} object The object to compare. 32216 * @param {Object} other The other object to compare. 32217 * @param {boolean[]|string[]} orders The order to sort by for each property. 32218 * @returns {number} Returns the sort order indicator for `object`. 32219 */ 32220 function compareMultiple(object, other, orders) { 32221 var index = -1, 32222 objCriteria = object.criteria, 32223 othCriteria = other.criteria, 32224 length = objCriteria.length, 32225 ordersLength = orders.length; 32226 32227 while (++index < length) { 32228 var result = compareAscending(objCriteria[index], othCriteria[index]); 32229 if (result) { 32230 if (index >= ordersLength) { 32231 return result; 32232 } 32233 var order = orders[index]; 32234 return result * (order == 'desc' ? -1 : 1); 32235 } 32236 } 32237 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications 32238 // that causes it, under certain circumstances, to provide the same value for 32239 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 32240 // for more details. 32241 // 32242 // This also ensures a stable sort in V8 and other engines. 32243 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. 32244 return object.index - other.index; 32245 } 32246 32247 /** 32248 * Creates an array that is the composition of partially applied arguments, 32249 * placeholders, and provided arguments into a single array of arguments. 32250 * 32251 * @private 32252 * @param {Array} args The provided arguments. 32253 * @param {Array} partials The arguments to prepend to those provided. 32254 * @param {Array} holders The `partials` placeholder indexes. 32255 * @params {boolean} [isCurried] Specify composing for a curried function. 32256 * @returns {Array} Returns the new array of composed arguments. 32257 */ 32258 function composeArgs(args, partials, holders, isCurried) { 32259 var argsIndex = -1, 32260 argsLength = args.length, 32261 holdersLength = holders.length, 32262 leftIndex = -1, 32263 leftLength = partials.length, 32264 rangeLength = nativeMax(argsLength - holdersLength, 0), 32265 result = Array(leftLength + rangeLength), 32266 isUncurried = !isCurried; 32267 32268 while (++leftIndex < leftLength) { 32269 result[leftIndex] = partials[leftIndex]; 32270 } 32271 while (++argsIndex < holdersLength) { 32272 if (isUncurried || argsIndex < argsLength) { 32273 result[holders[argsIndex]] = args[argsIndex]; 32274 } 32275 } 32276 while (rangeLength--) { 32277 result[leftIndex++] = args[argsIndex++]; 32278 } 32279 return result; 32280 } 32281 32282 /** 32283 * This function is like `composeArgs` except that the arguments composition 32284 * is tailored for `_.partialRight`. 32285 * 32286 * @private 32287 * @param {Array} args The provided arguments. 32288 * @param {Array} partials The arguments to append to those provided. 32289 * @param {Array} holders The `partials` placeholder indexes. 32290 * @params {boolean} [isCurried] Specify composing for a curried function. 32291 * @returns {Array} Returns the new array of composed arguments. 32292 */ 32293 function composeArgsRight(args, partials, holders, isCurried) { 32294 var argsIndex = -1, 32295 argsLength = args.length, 32296 holdersIndex = -1, 32297 holdersLength = holders.length, 32298 rightIndex = -1, 32299 rightLength = partials.length, 32300 rangeLength = nativeMax(argsLength - holdersLength, 0), 32301 result = Array(rangeLength + rightLength), 32302 isUncurried = !isCurried; 32303 32304 while (++argsIndex < rangeLength) { 32305 result[argsIndex] = args[argsIndex]; 32306 } 32307 var offset = argsIndex; 32308 while (++rightIndex < rightLength) { 32309 result[offset + rightIndex] = partials[rightIndex]; 32310 } 32311 while (++holdersIndex < holdersLength) { 32312 if (isUncurried || argsIndex < argsLength) { 32313 result[offset + holders[holdersIndex]] = args[argsIndex++]; 32314 } 32315 } 32316 return result; 32317 } 32318 32319 /** 32320 * Copies the values of `source` to `array`. 32321 * 32322 * @private 32323 * @param {Array} source The array to copy values from. 32324 * @param {Array} [array=[]] The array to copy values to. 32325 * @returns {Array} Returns `array`. 32326 */ 32327 function copyArray(source, array) { 32328 var index = -1, 32329 length = source.length; 32330 32331 array || (array = Array(length)); 32332 while (++index < length) { 32333 array[index] = source[index]; 32334 } 32335 return array; 32336 } 32337 32338 /** 32339 * Copies properties of `source` to `object`. 32340 * 32341 * @private 32342 * @param {Object} source The object to copy properties from. 32343 * @param {Array} props The property identifiers to copy. 32344 * @param {Object} [object={}] The object to copy properties to. 32345 * @param {Function} [customizer] The function to customize copied values. 32346 * @returns {Object} Returns `object`. 32347 */ 32348 function copyObject(source, props, object, customizer) { 32349 var isNew = !object; 32350 object || (object = {}); 32351 32352 var index = -1, 32353 length = props.length; 32354 32355 while (++index < length) { 32356 var key = props[index]; 32357 32358 var newValue = customizer 32359 ? customizer(object[key], source[key], key, object, source) 32360 : undefined; 32361 32362 if (newValue === undefined) { 32363 newValue = source[key]; 32364 } 32365 if (isNew) { 32366 baseAssignValue(object, key, newValue); 32367 } else { 32368 assignValue(object, key, newValue); 32369 } 32370 } 32371 return object; 32372 } 32373 32374 /** 32375 * Copies own symbols of `source` to `object`. 32376 * 32377 * @private 32378 * @param {Object} source The object to copy symbols from. 32379 * @param {Object} [object={}] The object to copy symbols to. 32380 * @returns {Object} Returns `object`. 32381 */ 32382 function copySymbols(source, object) { 32383 return copyObject(source, getSymbols(source), object); 32384 } 32385 32386 /** 32387 * Copies own and inherited symbols of `source` to `object`. 32388 * 32389 * @private 32390 * @param {Object} source The object to copy symbols from. 32391 * @param {Object} [object={}] The object to copy symbols to. 32392 * @returns {Object} Returns `object`. 32393 */ 32394 function copySymbolsIn(source, object) { 32395 return copyObject(source, getSymbolsIn(source), object); 32396 } 32397 32398 /** 32399 * Creates a function like `_.groupBy`. 32400 * 32401 * @private 32402 * @param {Function} setter The function to set accumulator values. 32403 * @param {Function} [initializer] The accumulator object initializer. 32404 * @returns {Function} Returns the new aggregator function. 32405 */ 32406 function createAggregator(setter, initializer) { 32407 return function(collection, iteratee) { 32408 var func = isArray(collection) ? arrayAggregator : baseAggregator, 32409 accumulator = initializer ? initializer() : {}; 32410 32411 return func(collection, setter, getIteratee(iteratee, 2), accumulator); 32412 }; 32413 } 32414 32415 /** 32416 * Creates a function like `_.assign`. 32417 * 32418 * @private 32419 * @param {Function} assigner The function to assign values. 32420 * @returns {Function} Returns the new assigner function. 32421 */ 32422 function createAssigner(assigner) { 32423 return baseRest(function(object, sources) { 32424 var index = -1, 32425 length = sources.length, 32426 customizer = length > 1 ? sources[length - 1] : undefined, 32427 guard = length > 2 ? sources[2] : undefined; 32428 32429 customizer = (assigner.length > 3 && typeof customizer == 'function') 32430 ? (length--, customizer) 32431 : undefined; 32432 32433 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 32434 customizer = length < 3 ? undefined : customizer; 32435 length = 1; 32436 } 32437 object = Object(object); 32438 while (++index < length) { 32439 var source = sources[index]; 32440 if (source) { 32441 assigner(object, source, index, customizer); 32442 } 32443 } 32444 return object; 32445 }); 32446 } 32447 32448 /** 32449 * Creates a `baseEach` or `baseEachRight` function. 32450 * 32451 * @private 32452 * @param {Function} eachFunc The function to iterate over a collection. 32453 * @param {boolean} [fromRight] Specify iterating from right to left. 32454 * @returns {Function} Returns the new base function. 32455 */ 32456 function createBaseEach(eachFunc, fromRight) { 32457 return function(collection, iteratee) { 32458 if (collection == null) { 32459 return collection; 32460 } 32461 if (!isArrayLike(collection)) { 32462 return eachFunc(collection, iteratee); 32463 } 32464 var length = collection.length, 32465 index = fromRight ? length : -1, 32466 iterable = Object(collection); 32467 32468 while ((fromRight ? index-- : ++index < length)) { 32469 if (iteratee(iterable[index], index, iterable) === false) { 32470 break; 32471 } 32472 } 32473 return collection; 32474 }; 32475 } 32476 32477 /** 32478 * Creates a base function for methods like `_.forIn` and `_.forOwn`. 32479 * 32480 * @private 32481 * @param {boolean} [fromRight] Specify iterating from right to left. 32482 * @returns {Function} Returns the new base function. 32483 */ 32484 function createBaseFor(fromRight) { 32485 return function(object, iteratee, keysFunc) { 32486 var index = -1, 32487 iterable = Object(object), 32488 props = keysFunc(object), 32489 length = props.length; 32490 32491 while (length--) { 32492 var key = props[fromRight ? length : ++index]; 32493 if (iteratee(iterable[key], key, iterable) === false) { 32494 break; 32495 } 32496 } 32497 return object; 32498 }; 32499 } 32500 32501 /** 32502 * Creates a function that wraps `func` to invoke it with the optional `this` 32503 * binding of `thisArg`. 32504 * 32505 * @private 32506 * @param {Function} func The function to wrap. 32507 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32508 * @param {*} [thisArg] The `this` binding of `func`. 32509 * @returns {Function} Returns the new wrapped function. 32510 */ 32511 function createBind(func, bitmask, thisArg) { 32512 var isBind = bitmask & WRAP_BIND_FLAG, 32513 Ctor = createCtor(func); 32514 32515 function wrapper() { 32516 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 32517 return fn.apply(isBind ? thisArg : this, arguments); 32518 } 32519 return wrapper; 32520 } 32521 32522 /** 32523 * Creates a function like `_.lowerFirst`. 32524 * 32525 * @private 32526 * @param {string} methodName The name of the `String` case method to use. 32527 * @returns {Function} Returns the new case function. 32528 */ 32529 function createCaseFirst(methodName) { 32530 return function(string) { 32531 string = toString(string); 32532 32533 var strSymbols = hasUnicode(string) 32534 ? stringToArray(string) 32535 : undefined; 32536 32537 var chr = strSymbols 32538 ? strSymbols[0] 32539 : string.charAt(0); 32540 32541 var trailing = strSymbols 32542 ? castSlice(strSymbols, 1).join('') 32543 : string.slice(1); 32544 32545 return chr[methodName]() + trailing; 32546 }; 32547 } 32548 32549 /** 32550 * Creates a function like `_.camelCase`. 32551 * 32552 * @private 32553 * @param {Function} callback The function to combine each word. 32554 * @returns {Function} Returns the new compounder function. 32555 */ 32556 function createCompounder(callback) { 32557 return function(string) { 32558 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); 32559 }; 32560 } 32561 32562 /** 32563 * Creates a function that produces an instance of `Ctor` regardless of 32564 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 32565 * 32566 * @private 32567 * @param {Function} Ctor The constructor to wrap. 32568 * @returns {Function} Returns the new wrapped function. 32569 */ 32570 function createCtor(Ctor) { 32571 return function() { 32572 // Use a `switch` statement to work with class constructors. See 32573 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 32574 // for more details. 32575 var args = arguments; 32576 switch (args.length) { 32577 case 0: return new Ctor; 32578 case 1: return new Ctor(args[0]); 32579 case 2: return new Ctor(args[0], args[1]); 32580 case 3: return new Ctor(args[0], args[1], args[2]); 32581 case 4: return new Ctor(args[0], args[1], args[2], args[3]); 32582 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); 32583 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); 32584 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); 32585 } 32586 var thisBinding = baseCreate(Ctor.prototype), 32587 result = Ctor.apply(thisBinding, args); 32588 32589 // Mimic the constructor's `return` behavior. 32590 // See https://es5.github.io/#x13.2.2 for more details. 32591 return isObject(result) ? result : thisBinding; 32592 }; 32593 } 32594 32595 /** 32596 * Creates a function that wraps `func` to enable currying. 32597 * 32598 * @private 32599 * @param {Function} func The function to wrap. 32600 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32601 * @param {number} arity The arity of `func`. 32602 * @returns {Function} Returns the new wrapped function. 32603 */ 32604 function createCurry(func, bitmask, arity) { 32605 var Ctor = createCtor(func); 32606 32607 function wrapper() { 32608 var length = arguments.length, 32609 args = Array(length), 32610 index = length, 32611 placeholder = getHolder(wrapper); 32612 32613 while (index--) { 32614 args[index] = arguments[index]; 32615 } 32616 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) 32617 ? [] 32618 : replaceHolders(args, placeholder); 32619 32620 length -= holders.length; 32621 if (length < arity) { 32622 return createRecurry( 32623 func, bitmask, createHybrid, wrapper.placeholder, undefined, 32624 args, holders, undefined, undefined, arity - length); 32625 } 32626 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 32627 return apply(fn, this, args); 32628 } 32629 return wrapper; 32630 } 32631 32632 /** 32633 * Creates a `_.find` or `_.findLast` function. 32634 * 32635 * @private 32636 * @param {Function} findIndexFunc The function to find the collection index. 32637 * @returns {Function} Returns the new find function. 32638 */ 32639 function createFind(findIndexFunc) { 32640 return function(collection, predicate, fromIndex) { 32641 var iterable = Object(collection); 32642 if (!isArrayLike(collection)) { 32643 var iteratee = getIteratee(predicate, 3); 32644 collection = keys(collection); 32645 predicate = function(key) { return iteratee(iterable[key], key, iterable); }; 32646 } 32647 var index = findIndexFunc(collection, predicate, fromIndex); 32648 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; 32649 }; 32650 } 32651 32652 /** 32653 * Creates a `_.flow` or `_.flowRight` function. 32654 * 32655 * @private 32656 * @param {boolean} [fromRight] Specify iterating from right to left. 32657 * @returns {Function} Returns the new flow function. 32658 */ 32659 function createFlow(fromRight) { 32660 return flatRest(function(funcs) { 32661 var length = funcs.length, 32662 index = length, 32663 prereq = LodashWrapper.prototype.thru; 32664 32665 if (fromRight) { 32666 funcs.reverse(); 32667 } 32668 while (index--) { 32669 var func = funcs[index]; 32670 if (typeof func != 'function') { 32671 throw new TypeError(FUNC_ERROR_TEXT); 32672 } 32673 if (prereq && !wrapper && getFuncName(func) == 'wrapper') { 32674 var wrapper = new LodashWrapper([], true); 32675 } 32676 } 32677 index = wrapper ? index : length; 32678 while (++index < length) { 32679 func = funcs[index]; 32680 32681 var funcName = getFuncName(func), 32682 data = funcName == 'wrapper' ? getData(func) : undefined; 32683 32684 if (data && isLaziable(data[0]) && 32685 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && 32686 !data[4].length && data[9] == 1 32687 ) { 32688 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); 32689 } else { 32690 wrapper = (func.length == 1 && isLaziable(func)) 32691 ? wrapper[funcName]() 32692 : wrapper.thru(func); 32693 } 32694 } 32695 return function() { 32696 var args = arguments, 32697 value = args[0]; 32698 32699 if (wrapper && args.length == 1 && isArray(value)) { 32700 return wrapper.plant(value).value(); 32701 } 32702 var index = 0, 32703 result = length ? funcs[index].apply(this, args) : value; 32704 32705 while (++index < length) { 32706 result = funcs[index].call(this, result); 32707 } 32708 return result; 32709 }; 32710 }); 32711 } 32712 32713 /** 32714 * Creates a function that wraps `func` to invoke it with optional `this` 32715 * binding of `thisArg`, partial application, and currying. 32716 * 32717 * @private 32718 * @param {Function|string} func The function or method name to wrap. 32719 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32720 * @param {*} [thisArg] The `this` binding of `func`. 32721 * @param {Array} [partials] The arguments to prepend to those provided to 32722 * the new function. 32723 * @param {Array} [holders] The `partials` placeholder indexes. 32724 * @param {Array} [partialsRight] The arguments to append to those provided 32725 * to the new function. 32726 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 32727 * @param {Array} [argPos] The argument positions of the new function. 32728 * @param {number} [ary] The arity cap of `func`. 32729 * @param {number} [arity] The arity of `func`. 32730 * @returns {Function} Returns the new wrapped function. 32731 */ 32732 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { 32733 var isAry = bitmask & WRAP_ARY_FLAG, 32734 isBind = bitmask & WRAP_BIND_FLAG, 32735 isBindKey = bitmask & WRAP_BIND_KEY_FLAG, 32736 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), 32737 isFlip = bitmask & WRAP_FLIP_FLAG, 32738 Ctor = isBindKey ? undefined : createCtor(func); 32739 32740 function wrapper() { 32741 var length = arguments.length, 32742 args = Array(length), 32743 index = length; 32744 32745 while (index--) { 32746 args[index] = arguments[index]; 32747 } 32748 if (isCurried) { 32749 var placeholder = getHolder(wrapper), 32750 holdersCount = countHolders(args, placeholder); 32751 } 32752 if (partials) { 32753 args = composeArgs(args, partials, holders, isCurried); 32754 } 32755 if (partialsRight) { 32756 args = composeArgsRight(args, partialsRight, holdersRight, isCurried); 32757 } 32758 length -= holdersCount; 32759 if (isCurried && length < arity) { 32760 var newHolders = replaceHolders(args, placeholder); 32761 return createRecurry( 32762 func, bitmask, createHybrid, wrapper.placeholder, thisArg, 32763 args, newHolders, argPos, ary, arity - length 32764 ); 32765 } 32766 var thisBinding = isBind ? thisArg : this, 32767 fn = isBindKey ? thisBinding[func] : func; 32768 32769 length = args.length; 32770 if (argPos) { 32771 args = reorder(args, argPos); 32772 } else if (isFlip && length > 1) { 32773 args.reverse(); 32774 } 32775 if (isAry && ary < length) { 32776 args.length = ary; 32777 } 32778 if (this && this !== root && this instanceof wrapper) { 32779 fn = Ctor || createCtor(fn); 32780 } 32781 return fn.apply(thisBinding, args); 32782 } 32783 return wrapper; 32784 } 32785 32786 /** 32787 * Creates a function like `_.invertBy`. 32788 * 32789 * @private 32790 * @param {Function} setter The function to set accumulator values. 32791 * @param {Function} toIteratee The function to resolve iteratees. 32792 * @returns {Function} Returns the new inverter function. 32793 */ 32794 function createInverter(setter, toIteratee) { 32795 return function(object, iteratee) { 32796 return baseInverter(object, setter, toIteratee(iteratee), {}); 32797 }; 32798 } 32799 32800 /** 32801 * Creates a function that performs a mathematical operation on two values. 32802 * 32803 * @private 32804 * @param {Function} operator The function to perform the operation. 32805 * @param {number} [defaultValue] The value used for `undefined` arguments. 32806 * @returns {Function} Returns the new mathematical operation function. 32807 */ 32808 function createMathOperation(operator, defaultValue) { 32809 return function(value, other) { 32810 var result; 32811 if (value === undefined && other === undefined) { 32812 return defaultValue; 32813 } 32814 if (value !== undefined) { 32815 result = value; 32816 } 32817 if (other !== undefined) { 32818 if (result === undefined) { 32819 return other; 32820 } 32821 if (typeof value == 'string' || typeof other == 'string') { 32822 value = baseToString(value); 32823 other = baseToString(other); 32824 } else { 32825 value = baseToNumber(value); 32826 other = baseToNumber(other); 32827 } 32828 result = operator(value, other); 32829 } 32830 return result; 32831 }; 32832 } 32833 32834 /** 32835 * Creates a function like `_.over`. 32836 * 32837 * @private 32838 * @param {Function} arrayFunc The function to iterate over iteratees. 32839 * @returns {Function} Returns the new over function. 32840 */ 32841 function createOver(arrayFunc) { 32842 return flatRest(function(iteratees) { 32843 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 32844 return baseRest(function(args) { 32845 var thisArg = this; 32846 return arrayFunc(iteratees, function(iteratee) { 32847 return apply(iteratee, thisArg, args); 32848 }); 32849 }); 32850 }); 32851 } 32852 32853 /** 32854 * Creates the padding for `string` based on `length`. The `chars` string 32855 * is truncated if the number of characters exceeds `length`. 32856 * 32857 * @private 32858 * @param {number} length The padding length. 32859 * @param {string} [chars=' '] The string used as padding. 32860 * @returns {string} Returns the padding for `string`. 32861 */ 32862 function createPadding(length, chars) { 32863 chars = chars === undefined ? ' ' : baseToString(chars); 32864 32865 var charsLength = chars.length; 32866 if (charsLength < 2) { 32867 return charsLength ? baseRepeat(chars, length) : chars; 32868 } 32869 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); 32870 return hasUnicode(chars) 32871 ? castSlice(stringToArray(result), 0, length).join('') 32872 : result.slice(0, length); 32873 } 32874 32875 /** 32876 * Creates a function that wraps `func` to invoke it with the `this` binding 32877 * of `thisArg` and `partials` prepended to the arguments it receives. 32878 * 32879 * @private 32880 * @param {Function} func The function to wrap. 32881 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32882 * @param {*} thisArg The `this` binding of `func`. 32883 * @param {Array} partials The arguments to prepend to those provided to 32884 * the new function. 32885 * @returns {Function} Returns the new wrapped function. 32886 */ 32887 function createPartial(func, bitmask, thisArg, partials) { 32888 var isBind = bitmask & WRAP_BIND_FLAG, 32889 Ctor = createCtor(func); 32890 32891 function wrapper() { 32892 var argsIndex = -1, 32893 argsLength = arguments.length, 32894 leftIndex = -1, 32895 leftLength = partials.length, 32896 args = Array(leftLength + argsLength), 32897 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 32898 32899 while (++leftIndex < leftLength) { 32900 args[leftIndex] = partials[leftIndex]; 32901 } 32902 while (argsLength--) { 32903 args[leftIndex++] = arguments[++argsIndex]; 32904 } 32905 return apply(fn, isBind ? thisArg : this, args); 32906 } 32907 return wrapper; 32908 } 32909 32910 /** 32911 * Creates a `_.range` or `_.rangeRight` function. 32912 * 32913 * @private 32914 * @param {boolean} [fromRight] Specify iterating from right to left. 32915 * @returns {Function} Returns the new range function. 32916 */ 32917 function createRange(fromRight) { 32918 return function(start, end, step) { 32919 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { 32920 end = step = undefined; 32921 } 32922 // Ensure the sign of `-0` is preserved. 32923 start = toFinite(start); 32924 if (end === undefined) { 32925 end = start; 32926 start = 0; 32927 } else { 32928 end = toFinite(end); 32929 } 32930 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); 32931 return baseRange(start, end, step, fromRight); 32932 }; 32933 } 32934 32935 /** 32936 * Creates a function that performs a relational operation on two values. 32937 * 32938 * @private 32939 * @param {Function} operator The function to perform the operation. 32940 * @returns {Function} Returns the new relational operation function. 32941 */ 32942 function createRelationalOperation(operator) { 32943 return function(value, other) { 32944 if (!(typeof value == 'string' && typeof other == 'string')) { 32945 value = toNumber(value); 32946 other = toNumber(other); 32947 } 32948 return operator(value, other); 32949 }; 32950 } 32951 32952 /** 32953 * Creates a function that wraps `func` to continue currying. 32954 * 32955 * @private 32956 * @param {Function} func The function to wrap. 32957 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32958 * @param {Function} wrapFunc The function to create the `func` wrapper. 32959 * @param {*} placeholder The placeholder value. 32960 * @param {*} [thisArg] The `this` binding of `func`. 32961 * @param {Array} [partials] The arguments to prepend to those provided to 32962 * the new function. 32963 * @param {Array} [holders] The `partials` placeholder indexes. 32964 * @param {Array} [argPos] The argument positions of the new function. 32965 * @param {number} [ary] The arity cap of `func`. 32966 * @param {number} [arity] The arity of `func`. 32967 * @returns {Function} Returns the new wrapped function. 32968 */ 32969 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { 32970 var isCurry = bitmask & WRAP_CURRY_FLAG, 32971 newHolders = isCurry ? holders : undefined, 32972 newHoldersRight = isCurry ? undefined : holders, 32973 newPartials = isCurry ? partials : undefined, 32974 newPartialsRight = isCurry ? undefined : partials; 32975 32976 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); 32977 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); 32978 32979 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { 32980 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); 32981 } 32982 var newData = [ 32983 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, 32984 newHoldersRight, argPos, ary, arity 32985 ]; 32986 32987 var result = wrapFunc.apply(undefined, newData); 32988 if (isLaziable(func)) { 32989 setData(result, newData); 32990 } 32991 result.placeholder = placeholder; 32992 return setWrapToString(result, func, bitmask); 32993 } 32994 32995 /** 32996 * Creates a function like `_.round`. 32997 * 32998 * @private 32999 * @param {string} methodName The name of the `Math` method to use when rounding. 33000 * @returns {Function} Returns the new round function. 33001 */ 33002 function createRound(methodName) { 33003 var func = Math[methodName]; 33004 return function(number, precision) { 33005 number = toNumber(number); 33006 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); 33007 if (precision && nativeIsFinite(number)) { 33008 // Shift with exponential notation to avoid floating-point issues. 33009 // See [MDN](https://mdn.io/round#Examples) for more details. 33010 var pair = (toString(number) + 'e').split('e'), 33011 value = func(pair[0] + 'e' + (+pair[1] + precision)); 33012 33013 pair = (toString(value) + 'e').split('e'); 33014 return +(pair[0] + 'e' + (+pair[1] - precision)); 33015 } 33016 return func(number); 33017 }; 33018 } 33019 33020 /** 33021 * Creates a set object of `values`. 33022 * 33023 * @private 33024 * @param {Array} values The values to add to the set. 33025 * @returns {Object} Returns the new set. 33026 */ 33027 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { 33028 return new Set(values); 33029 }; 33030 33031 /** 33032 * Creates a `_.toPairs` or `_.toPairsIn` function. 33033 * 33034 * @private 33035 * @param {Function} keysFunc The function to get the keys of a given object. 33036 * @returns {Function} Returns the new pairs function. 33037 */ 33038 function createToPairs(keysFunc) { 33039 return function(object) { 33040 var tag = getTag(object); 33041 if (tag == mapTag) { 33042 return mapToArray(object); 33043 } 33044 if (tag == setTag) { 33045 return setToPairs(object); 33046 } 33047 return baseToPairs(object, keysFunc(object)); 33048 }; 33049 } 33050 33051 /** 33052 * Creates a function that either curries or invokes `func` with optional 33053 * `this` binding and partially applied arguments. 33054 * 33055 * @private 33056 * @param {Function|string} func The function or method name to wrap. 33057 * @param {number} bitmask The bitmask flags. 33058 * 1 - `_.bind` 33059 * 2 - `_.bindKey` 33060 * 4 - `_.curry` or `_.curryRight` of a bound function 33061 * 8 - `_.curry` 33062 * 16 - `_.curryRight` 33063 * 32 - `_.partial` 33064 * 64 - `_.partialRight` 33065 * 128 - `_.rearg` 33066 * 256 - `_.ary` 33067 * 512 - `_.flip` 33068 * @param {*} [thisArg] The `this` binding of `func`. 33069 * @param {Array} [partials] The arguments to be partially applied. 33070 * @param {Array} [holders] The `partials` placeholder indexes. 33071 * @param {Array} [argPos] The argument positions of the new function. 33072 * @param {number} [ary] The arity cap of `func`. 33073 * @param {number} [arity] The arity of `func`. 33074 * @returns {Function} Returns the new wrapped function. 33075 */ 33076 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { 33077 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; 33078 if (!isBindKey && typeof func != 'function') { 33079 throw new TypeError(FUNC_ERROR_TEXT); 33080 } 33081 var length = partials ? partials.length : 0; 33082 if (!length) { 33083 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); 33084 partials = holders = undefined; 33085 } 33086 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); 33087 arity = arity === undefined ? arity : toInteger(arity); 33088 length -= holders ? holders.length : 0; 33089 33090 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { 33091 var partialsRight = partials, 33092 holdersRight = holders; 33093 33094 partials = holders = undefined; 33095 } 33096 var data = isBindKey ? undefined : getData(func); 33097 33098 var newData = [ 33099 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, 33100 argPos, ary, arity 33101 ]; 33102 33103 if (data) { 33104 mergeData(newData, data); 33105 } 33106 func = newData[0]; 33107 bitmask = newData[1]; 33108 thisArg = newData[2]; 33109 partials = newData[3]; 33110 holders = newData[4]; 33111 arity = newData[9] = newData[9] === undefined 33112 ? (isBindKey ? 0 : func.length) 33113 : nativeMax(newData[9] - length, 0); 33114 33115 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { 33116 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); 33117 } 33118 if (!bitmask || bitmask == WRAP_BIND_FLAG) { 33119 var result = createBind(func, bitmask, thisArg); 33120 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { 33121 result = createCurry(func, bitmask, arity); 33122 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { 33123 result = createPartial(func, bitmask, thisArg, partials); 33124 } else { 33125 result = createHybrid.apply(undefined, newData); 33126 } 33127 var setter = data ? baseSetData : setData; 33128 return setWrapToString(setter(result, newData), func, bitmask); 33129 } 33130 33131 /** 33132 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties 33133 * of source objects to the destination object for all destination properties 33134 * that resolve to `undefined`. 33135 * 33136 * @private 33137 * @param {*} objValue The destination value. 33138 * @param {*} srcValue The source value. 33139 * @param {string} key The key of the property to assign. 33140 * @param {Object} object The parent object of `objValue`. 33141 * @returns {*} Returns the value to assign. 33142 */ 33143 function customDefaultsAssignIn(objValue, srcValue, key, object) { 33144 if (objValue === undefined || 33145 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { 33146 return srcValue; 33147 } 33148 return objValue; 33149 } 33150 33151 /** 33152 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source 33153 * objects into destination objects that are passed thru. 33154 * 33155 * @private 33156 * @param {*} objValue The destination value. 33157 * @param {*} srcValue The source value. 33158 * @param {string} key The key of the property to merge. 33159 * @param {Object} object The parent object of `objValue`. 33160 * @param {Object} source The parent object of `srcValue`. 33161 * @param {Object} [stack] Tracks traversed source values and their merged 33162 * counterparts. 33163 * @returns {*} Returns the value to assign. 33164 */ 33165 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { 33166 if (isObject(objValue) && isObject(srcValue)) { 33167 // Recursively merge objects and arrays (susceptible to call stack limits). 33168 stack.set(srcValue, objValue); 33169 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); 33170 stack['delete'](srcValue); 33171 } 33172 return objValue; 33173 } 33174 33175 /** 33176 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain 33177 * objects. 33178 * 33179 * @private 33180 * @param {*} value The value to inspect. 33181 * @param {string} key The key of the property to inspect. 33182 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. 33183 */ 33184 function customOmitClone(value) { 33185 return isPlainObject(value) ? undefined : value; 33186 } 33187 33188 /** 33189 * A specialized version of `baseIsEqualDeep` for arrays with support for 33190 * partial deep comparisons. 33191 * 33192 * @private 33193 * @param {Array} array The array to compare. 33194 * @param {Array} other The other array to compare. 33195 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 33196 * @param {Function} customizer The function to customize comparisons. 33197 * @param {Function} equalFunc The function to determine equivalents of values. 33198 * @param {Object} stack Tracks traversed `array` and `other` objects. 33199 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 33200 */ 33201 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { 33202 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 33203 arrLength = array.length, 33204 othLength = other.length; 33205 33206 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 33207 return false; 33208 } 33209 // Check that cyclic values are equal. 33210 var arrStacked = stack.get(array); 33211 var othStacked = stack.get(other); 33212 if (arrStacked && othStacked) { 33213 return arrStacked == other && othStacked == array; 33214 } 33215 var index = -1, 33216 result = true, 33217 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; 33218 33219 stack.set(array, other); 33220 stack.set(other, array); 33221 33222 // Ignore non-index properties. 33223 while (++index < arrLength) { 33224 var arrValue = array[index], 33225 othValue = other[index]; 33226 33227 if (customizer) { 33228 var compared = isPartial 33229 ? customizer(othValue, arrValue, index, other, array, stack) 33230 : customizer(arrValue, othValue, index, array, other, stack); 33231 } 33232 if (compared !== undefined) { 33233 if (compared) { 33234 continue; 33235 } 33236 result = false; 33237 break; 33238 } 33239 // Recursively compare arrays (susceptible to call stack limits). 33240 if (seen) { 33241 if (!arraySome(other, function(othValue, othIndex) { 33242 if (!cacheHas(seen, othIndex) && 33243 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 33244 return seen.push(othIndex); 33245 } 33246 })) { 33247 result = false; 33248 break; 33249 } 33250 } else if (!( 33251 arrValue === othValue || 33252 equalFunc(arrValue, othValue, bitmask, customizer, stack) 33253 )) { 33254 result = false; 33255 break; 33256 } 33257 } 33258 stack['delete'](array); 33259 stack['delete'](other); 33260 return result; 33261 } 33262 33263 /** 33264 * A specialized version of `baseIsEqualDeep` for comparing objects of 33265 * the same `toStringTag`. 33266 * 33267 * **Note:** This function only supports comparing values with tags of 33268 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 33269 * 33270 * @private 33271 * @param {Object} object The object to compare. 33272 * @param {Object} other The other object to compare. 33273 * @param {string} tag The `toStringTag` of the objects to compare. 33274 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 33275 * @param {Function} customizer The function to customize comparisons. 33276 * @param {Function} equalFunc The function to determine equivalents of values. 33277 * @param {Object} stack Tracks traversed `object` and `other` objects. 33278 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 33279 */ 33280 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { 33281 switch (tag) { 33282 case dataViewTag: 33283 if ((object.byteLength != other.byteLength) || 33284 (object.byteOffset != other.byteOffset)) { 33285 return false; 33286 } 33287 object = object.buffer; 33288 other = other.buffer; 33289 33290 case arrayBufferTag: 33291 if ((object.byteLength != other.byteLength) || 33292 !equalFunc(new Uint8Array(object), new Uint8Array(other))) { 33293 return false; 33294 } 33295 return true; 33296 33297 case boolTag: 33298 case dateTag: 33299 case numberTag: 33300 // Coerce booleans to `1` or `0` and dates to milliseconds. 33301 // Invalid dates are coerced to `NaN`. 33302 return eq(+object, +other); 33303 33304 case errorTag: 33305 return object.name == other.name && object.message == other.message; 33306 33307 case regexpTag: 33308 case stringTag: 33309 // Coerce regexes to strings and treat strings, primitives and objects, 33310 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 33311 // for more details. 33312 return object == (other + ''); 33313 33314 case mapTag: 33315 var convert = mapToArray; 33316 33317 case setTag: 33318 var isPartial = bitmask & COMPARE_PARTIAL_FLAG; 33319 convert || (convert = setToArray); 33320 33321 if (object.size != other.size && !isPartial) { 33322 return false; 33323 } 33324 // Assume cyclic values are equal. 33325 var stacked = stack.get(object); 33326 if (stacked) { 33327 return stacked == other; 33328 } 33329 bitmask |= COMPARE_UNORDERED_FLAG; 33330 33331 // Recursively compare objects (susceptible to call stack limits). 33332 stack.set(object, other); 33333 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); 33334 stack['delete'](object); 33335 return result; 33336 33337 case symbolTag: 33338 if (symbolValueOf) { 33339 return symbolValueOf.call(object) == symbolValueOf.call(other); 33340 } 33341 } 33342 return false; 33343 } 33344 33345 /** 33346 * A specialized version of `baseIsEqualDeep` for objects with support for 33347 * partial deep comparisons. 33348 * 33349 * @private 33350 * @param {Object} object The object to compare. 33351 * @param {Object} other The other object to compare. 33352 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 33353 * @param {Function} customizer The function to customize comparisons. 33354 * @param {Function} equalFunc The function to determine equivalents of values. 33355 * @param {Object} stack Tracks traversed `object` and `other` objects. 33356 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 33357 */ 33358 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { 33359 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 33360 objProps = getAllKeys(object), 33361 objLength = objProps.length, 33362 othProps = getAllKeys(other), 33363 othLength = othProps.length; 33364 33365 if (objLength != othLength && !isPartial) { 33366 return false; 33367 } 33368 var index = objLength; 33369 while (index--) { 33370 var key = objProps[index]; 33371 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { 33372 return false; 33373 } 33374 } 33375 // Check that cyclic values are equal. 33376 var objStacked = stack.get(object); 33377 var othStacked = stack.get(other); 33378 if (objStacked && othStacked) { 33379 return objStacked == other && othStacked == object; 33380 } 33381 var result = true; 33382 stack.set(object, other); 33383 stack.set(other, object); 33384 33385 var skipCtor = isPartial; 33386 while (++index < objLength) { 33387 key = objProps[index]; 33388 var objValue = object[key], 33389 othValue = other[key]; 33390 33391 if (customizer) { 33392 var compared = isPartial 33393 ? customizer(othValue, objValue, key, other, object, stack) 33394 : customizer(objValue, othValue, key, object, other, stack); 33395 } 33396 // Recursively compare objects (susceptible to call stack limits). 33397 if (!(compared === undefined 33398 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) 33399 : compared 33400 )) { 33401 result = false; 33402 break; 33403 } 33404 skipCtor || (skipCtor = key == 'constructor'); 33405 } 33406 if (result && !skipCtor) { 33407 var objCtor = object.constructor, 33408 othCtor = other.constructor; 33409 33410 // Non `Object` object instances with different constructors are not equal. 33411 if (objCtor != othCtor && 33412 ('constructor' in object && 'constructor' in other) && 33413 !(typeof objCtor == 'function' && objCtor instanceof objCtor && 33414 typeof othCtor == 'function' && othCtor instanceof othCtor)) { 33415 result = false; 33416 } 33417 } 33418 stack['delete'](object); 33419 stack['delete'](other); 33420 return result; 33421 } 33422 33423 /** 33424 * A specialized version of `baseRest` which flattens the rest array. 33425 * 33426 * @private 33427 * @param {Function} func The function to apply a rest parameter to. 33428 * @returns {Function} Returns the new function. 33429 */ 33430 function flatRest(func) { 33431 return setToString(overRest(func, undefined, flatten), func + ''); 33432 } 33433 33434 /** 33435 * Creates an array of own enumerable property names and symbols of `object`. 33436 * 33437 * @private 33438 * @param {Object} object The object to query. 33439 * @returns {Array} Returns the array of property names and symbols. 33440 */ 33441 function getAllKeys(object) { 33442 return baseGetAllKeys(object, keys, getSymbols); 33443 } 33444 33445 /** 33446 * Creates an array of own and inherited enumerable property names and 33447 * symbols of `object`. 33448 * 33449 * @private 33450 * @param {Object} object The object to query. 33451 * @returns {Array} Returns the array of property names and symbols. 33452 */ 33453 function getAllKeysIn(object) { 33454 return baseGetAllKeys(object, keysIn, getSymbolsIn); 33455 } 33456 33457 /** 33458 * Gets metadata for `func`. 33459 * 33460 * @private 33461 * @param {Function} func The function to query. 33462 * @returns {*} Returns the metadata for `func`. 33463 */ 33464 var getData = !metaMap ? noop : function(func) { 33465 return metaMap.get(func); 33466 }; 33467 33468 /** 33469 * Gets the name of `func`. 33470 * 33471 * @private 33472 * @param {Function} func The function to query. 33473 * @returns {string} Returns the function name. 33474 */ 33475 function getFuncName(func) { 33476 var result = (func.name + ''), 33477 array = realNames[result], 33478 length = hasOwnProperty.call(realNames, result) ? array.length : 0; 33479 33480 while (length--) { 33481 var data = array[length], 33482 otherFunc = data.func; 33483 if (otherFunc == null || otherFunc == func) { 33484 return data.name; 33485 } 33486 } 33487 return result; 33488 } 33489 33490 /** 33491 * Gets the argument placeholder value for `func`. 33492 * 33493 * @private 33494 * @param {Function} func The function to inspect. 33495 * @returns {*} Returns the placeholder value. 33496 */ 33497 function getHolder(func) { 33498 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; 33499 return object.placeholder; 33500 } 33501 33502 /** 33503 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, 33504 * this function returns the custom method, otherwise it returns `baseIteratee`. 33505 * If arguments are provided, the chosen function is invoked with them and 33506 * its result is returned. 33507 * 33508 * @private 33509 * @param {*} [value] The value to convert to an iteratee. 33510 * @param {number} [arity] The arity of the created iteratee. 33511 * @returns {Function} Returns the chosen function or its result. 33512 */ 33513 function getIteratee() { 33514 var result = lodash.iteratee || iteratee; 33515 result = result === iteratee ? baseIteratee : result; 33516 return arguments.length ? result(arguments[0], arguments[1]) : result; 33517 } 33518 33519 /** 33520 * Gets the data for `map`. 33521 * 33522 * @private 33523 * @param {Object} map The map to query. 33524 * @param {string} key The reference key. 33525 * @returns {*} Returns the map data. 33526 */ 33527 function getMapData(map, key) { 33528 var data = map.__data__; 33529 return isKeyable(key) 33530 ? data[typeof key == 'string' ? 'string' : 'hash'] 33531 : data.map; 33532 } 33533 33534 /** 33535 * Gets the property names, values, and compare flags of `object`. 33536 * 33537 * @private 33538 * @param {Object} object The object to query. 33539 * @returns {Array} Returns the match data of `object`. 33540 */ 33541 function getMatchData(object) { 33542 var result = keys(object), 33543 length = result.length; 33544 33545 while (length--) { 33546 var key = result[length], 33547 value = object[key]; 33548 33549 result[length] = [key, value, isStrictComparable(value)]; 33550 } 33551 return result; 33552 } 33553 33554 /** 33555 * Gets the native function at `key` of `object`. 33556 * 33557 * @private 33558 * @param {Object} object The object to query. 33559 * @param {string} key The key of the method to get. 33560 * @returns {*} Returns the function if it's native, else `undefined`. 33561 */ 33562 function getNative(object, key) { 33563 var value = getValue(object, key); 33564 return baseIsNative(value) ? value : undefined; 33565 } 33566 33567 /** 33568 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 33569 * 33570 * @private 33571 * @param {*} value The value to query. 33572 * @returns {string} Returns the raw `toStringTag`. 33573 */ 33574 function getRawTag(value) { 33575 var isOwn = hasOwnProperty.call(value, symToStringTag), 33576 tag = value[symToStringTag]; 33577 33578 try { 33579 value[symToStringTag] = undefined; 33580 var unmasked = true; 33581 } catch (e) {} 33582 33583 var result = nativeObjectToString.call(value); 33584 if (unmasked) { 33585 if (isOwn) { 33586 value[symToStringTag] = tag; 33587 } else { 33588 delete value[symToStringTag]; 33589 } 33590 } 33591 return result; 33592 } 33593 33594 /** 33595 * Creates an array of the own enumerable symbols of `object`. 33596 * 33597 * @private 33598 * @param {Object} object The object to query. 33599 * @returns {Array} Returns the array of symbols. 33600 */ 33601 var getSymbols = !nativeGetSymbols ? stubArray : function(object) { 33602 if (object == null) { 33603 return []; 33604 } 33605 object = Object(object); 33606 return arrayFilter(nativeGetSymbols(object), function(symbol) { 33607 return propertyIsEnumerable.call(object, symbol); 33608 }); 33609 }; 33610 33611 /** 33612 * Creates an array of the own and inherited enumerable symbols of `object`. 33613 * 33614 * @private 33615 * @param {Object} object The object to query. 33616 * @returns {Array} Returns the array of symbols. 33617 */ 33618 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { 33619 var result = []; 33620 while (object) { 33621 arrayPush(result, getSymbols(object)); 33622 object = getPrototype(object); 33623 } 33624 return result; 33625 }; 33626 33627 /** 33628 * Gets the `toStringTag` of `value`. 33629 * 33630 * @private 33631 * @param {*} value The value to query. 33632 * @returns {string} Returns the `toStringTag`. 33633 */ 33634 var getTag = baseGetTag; 33635 33636 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 33637 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || 33638 (Map && getTag(new Map) != mapTag) || 33639 (Promise && getTag(Promise.resolve()) != promiseTag) || 33640 (Set && getTag(new Set) != setTag) || 33641 (WeakMap && getTag(new WeakMap) != weakMapTag)) { 33642 getTag = function(value) { 33643 var result = baseGetTag(value), 33644 Ctor = result == objectTag ? value.constructor : undefined, 33645 ctorString = Ctor ? toSource(Ctor) : ''; 33646 33647 if (ctorString) { 33648 switch (ctorString) { 33649 case dataViewCtorString: return dataViewTag; 33650 case mapCtorString: return mapTag; 33651 case promiseCtorString: return promiseTag; 33652 case setCtorString: return setTag; 33653 case weakMapCtorString: return weakMapTag; 33654 } 33655 } 33656 return result; 33657 }; 33658 } 33659 33660 /** 33661 * Gets the view, applying any `transforms` to the `start` and `end` positions. 33662 * 33663 * @private 33664 * @param {number} start The start of the view. 33665 * @param {number} end The end of the view. 33666 * @param {Array} transforms The transformations to apply to the view. 33667 * @returns {Object} Returns an object containing the `start` and `end` 33668 * positions of the view. 33669 */ 33670 function getView(start, end, transforms) { 33671 var index = -1, 33672 length = transforms.length; 33673 33674 while (++index < length) { 33675 var data = transforms[index], 33676 size = data.size; 33677 33678 switch (data.type) { 33679 case 'drop': start += size; break; 33680 case 'dropRight': end -= size; break; 33681 case 'take': end = nativeMin(end, start + size); break; 33682 case 'takeRight': start = nativeMax(start, end - size); break; 33683 } 33684 } 33685 return { 'start': start, 'end': end }; 33686 } 33687 33688 /** 33689 * Extracts wrapper details from the `source` body comment. 33690 * 33691 * @private 33692 * @param {string} source The source to inspect. 33693 * @returns {Array} Returns the wrapper details. 33694 */ 33695 function getWrapDetails(source) { 33696 var match = source.match(reWrapDetails); 33697 return match ? match[1].split(reSplitDetails) : []; 33698 } 33699 33700 /** 33701 * Checks if `path` exists on `object`. 33702 * 33703 * @private 33704 * @param {Object} object The object to query. 33705 * @param {Array|string} path The path to check. 33706 * @param {Function} hasFunc The function to check properties. 33707 * @returns {boolean} Returns `true` if `path` exists, else `false`. 33708 */ 33709 function hasPath(object, path, hasFunc) { 33710 path = castPath(path, object); 33711 33712 var index = -1, 33713 length = path.length, 33714 result = false; 33715 33716 while (++index < length) { 33717 var key = toKey(path[index]); 33718 if (!(result = object != null && hasFunc(object, key))) { 33719 break; 33720 } 33721 object = object[key]; 33722 } 33723 if (result || ++index != length) { 33724 return result; 33725 } 33726 length = object == null ? 0 : object.length; 33727 return !!length && isLength(length) && isIndex(key, length) && 33728 (isArray(object) || isArguments(object)); 33729 } 33730 33731 /** 33732 * Initializes an array clone. 33733 * 33734 * @private 33735 * @param {Array} array The array to clone. 33736 * @returns {Array} Returns the initialized clone. 33737 */ 33738 function initCloneArray(array) { 33739 var length = array.length, 33740 result = new array.constructor(length); 33741 33742 // Add properties assigned by `RegExp#exec`. 33743 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 33744 result.index = array.index; 33745 result.input = array.input; 33746 } 33747 return result; 33748 } 33749 33750 /** 33751 * Initializes an object clone. 33752 * 33753 * @private 33754 * @param {Object} object The object to clone. 33755 * @returns {Object} Returns the initialized clone. 33756 */ 33757 function initCloneObject(object) { 33758 return (typeof object.constructor == 'function' && !isPrototype(object)) 33759 ? baseCreate(getPrototype(object)) 33760 : {}; 33761 } 33762 33763 /** 33764 * Initializes an object clone based on its `toStringTag`. 33765 * 33766 * **Note:** This function only supports cloning values with tags of 33767 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. 33768 * 33769 * @private 33770 * @param {Object} object The object to clone. 33771 * @param {string} tag The `toStringTag` of the object to clone. 33772 * @param {boolean} [isDeep] Specify a deep clone. 33773 * @returns {Object} Returns the initialized clone. 33774 */ 33775 function initCloneByTag(object, tag, isDeep) { 33776 var Ctor = object.constructor; 33777 switch (tag) { 33778 case arrayBufferTag: 33779 return cloneArrayBuffer(object); 33780 33781 case boolTag: 33782 case dateTag: 33783 return new Ctor(+object); 33784 33785 case dataViewTag: 33786 return cloneDataView(object, isDeep); 33787 33788 case float32Tag: case float64Tag: 33789 case int8Tag: case int16Tag: case int32Tag: 33790 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: 33791 return cloneTypedArray(object, isDeep); 33792 33793 case mapTag: 33794 return new Ctor; 33795 33796 case numberTag: 33797 case stringTag: 33798 return new Ctor(object); 33799 33800 case regexpTag: 33801 return cloneRegExp(object); 33802 33803 case setTag: 33804 return new Ctor; 33805 33806 case symbolTag: 33807 return cloneSymbol(object); 33808 } 33809 } 33810 33811 /** 33812 * Inserts wrapper `details` in a comment at the top of the `source` body. 33813 * 33814 * @private 33815 * @param {string} source The source to modify. 33816 * @returns {Array} details The details to insert. 33817 * @returns {string} Returns the modified source. 33818 */ 33819 function insertWrapDetails(source, details) { 33820 var length = details.length; 33821 if (!length) { 33822 return source; 33823 } 33824 var lastIndex = length - 1; 33825 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; 33826 details = details.join(length > 2 ? ', ' : ' '); 33827 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); 33828 } 33829 33830 /** 33831 * Checks if `value` is a flattenable `arguments` object or array. 33832 * 33833 * @private 33834 * @param {*} value The value to check. 33835 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 33836 */ 33837 function isFlattenable(value) { 33838 return isArray(value) || isArguments(value) || 33839 !!(spreadableSymbol && value && value[spreadableSymbol]); 33840 } 33841 33842 /** 33843 * Checks if `value` is a valid array-like index. 33844 * 33845 * @private 33846 * @param {*} value The value to check. 33847 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 33848 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 33849 */ 33850 function isIndex(value, length) { 33851 var type = typeof value; 33852 length = length == null ? MAX_SAFE_INTEGER : length; 33853 33854 return !!length && 33855 (type == 'number' || 33856 (type != 'symbol' && reIsUint.test(value))) && 33857 (value > -1 && value % 1 == 0 && value < length); 33858 } 33859 33860 /** 33861 * Checks if the given arguments are from an iteratee call. 33862 * 33863 * @private 33864 * @param {*} value The potential iteratee value argument. 33865 * @param {*} index The potential iteratee index or key argument. 33866 * @param {*} object The potential iteratee object argument. 33867 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 33868 * else `false`. 33869 */ 33870 function isIterateeCall(value, index, object) { 33871 if (!isObject(object)) { 33872 return false; 33873 } 33874 var type = typeof index; 33875 if (type == 'number' 33876 ? (isArrayLike(object) && isIndex(index, object.length)) 33877 : (type == 'string' && index in object) 33878 ) { 33879 return eq(object[index], value); 33880 } 33881 return false; 33882 } 33883 33884 /** 33885 * Checks if `value` is a property name and not a property path. 33886 * 33887 * @private 33888 * @param {*} value The value to check. 33889 * @param {Object} [object] The object to query keys on. 33890 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 33891 */ 33892 function isKey(value, object) { 33893 if (isArray(value)) { 33894 return false; 33895 } 33896 var type = typeof value; 33897 if (type == 'number' || type == 'symbol' || type == 'boolean' || 33898 value == null || isSymbol(value)) { 33899 return true; 33900 } 33901 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || 33902 (object != null && value in Object(object)); 33903 } 33904 33905 /** 33906 * Checks if `value` is suitable for use as unique object key. 33907 * 33908 * @private 33909 * @param {*} value The value to check. 33910 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 33911 */ 33912 function isKeyable(value) { 33913 var type = typeof value; 33914 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 33915 ? (value !== '__proto__') 33916 : (value === null); 33917 } 33918 33919 /** 33920 * Checks if `func` has a lazy counterpart. 33921 * 33922 * @private 33923 * @param {Function} func The function to check. 33924 * @returns {boolean} Returns `true` if `func` has a lazy counterpart, 33925 * else `false`. 33926 */ 33927 function isLaziable(func) { 33928 var funcName = getFuncName(func), 33929 other = lodash[funcName]; 33930 33931 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { 33932 return false; 33933 } 33934 if (func === other) { 33935 return true; 33936 } 33937 var data = getData(other); 33938 return !!data && func === data[0]; 33939 } 33940 33941 /** 33942 * Checks if `func` has its source masked. 33943 * 33944 * @private 33945 * @param {Function} func The function to check. 33946 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 33947 */ 33948 function isMasked(func) { 33949 return !!maskSrcKey && (maskSrcKey in func); 33950 } 33951 33952 /** 33953 * Checks if `func` is capable of being masked. 33954 * 33955 * @private 33956 * @param {*} value The value to check. 33957 * @returns {boolean} Returns `true` if `func` is maskable, else `false`. 33958 */ 33959 var isMaskable = coreJsData ? isFunction : stubFalse; 33960 33961 /** 33962 * Checks if `value` is likely a prototype object. 33963 * 33964 * @private 33965 * @param {*} value The value to check. 33966 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 33967 */ 33968 function isPrototype(value) { 33969 var Ctor = value && value.constructor, 33970 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; 33971 33972 return value === proto; 33973 } 33974 33975 /** 33976 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 33977 * 33978 * @private 33979 * @param {*} value The value to check. 33980 * @returns {boolean} Returns `true` if `value` if suitable for strict 33981 * equality comparisons, else `false`. 33982 */ 33983 function isStrictComparable(value) { 33984 return value === value && !isObject(value); 33985 } 33986 33987 /** 33988 * A specialized version of `matchesProperty` for source values suitable 33989 * for strict equality comparisons, i.e. `===`. 33990 * 33991 * @private 33992 * @param {string} key The key of the property to get. 33993 * @param {*} srcValue The value to match. 33994 * @returns {Function} Returns the new spec function. 33995 */ 33996 function matchesStrictComparable(key, srcValue) { 33997 return function(object) { 33998 if (object == null) { 33999 return false; 34000 } 34001 return object[key] === srcValue && 34002 (srcValue !== undefined || (key in Object(object))); 34003 }; 34004 } 34005 34006 /** 34007 * A specialized version of `_.memoize` which clears the memoized function's 34008 * cache when it exceeds `MAX_MEMOIZE_SIZE`. 34009 * 34010 * @private 34011 * @param {Function} func The function to have its output memoized. 34012 * @returns {Function} Returns the new memoized function. 34013 */ 34014 function memoizeCapped(func) { 34015 var result = memoize(func, function(key) { 34016 if (cache.size === MAX_MEMOIZE_SIZE) { 34017 cache.clear(); 34018 } 34019 return key; 34020 }); 34021 34022 var cache = result.cache; 34023 return result; 34024 } 34025 34026 /** 34027 * Merges the function metadata of `source` into `data`. 34028 * 34029 * Merging metadata reduces the number of wrappers used to invoke a function. 34030 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` 34031 * may be applied regardless of execution order. Methods like `_.ary` and 34032 * `_.rearg` modify function arguments, making the order in which they are 34033 * executed important, preventing the merging of metadata. However, we make 34034 * an exception for a safe combined case where curried functions have `_.ary` 34035 * and or `_.rearg` applied. 34036 * 34037 * @private 34038 * @param {Array} data The destination metadata. 34039 * @param {Array} source The source metadata. 34040 * @returns {Array} Returns `data`. 34041 */ 34042 function mergeData(data, source) { 34043 var bitmask = data[1], 34044 srcBitmask = source[1], 34045 newBitmask = bitmask | srcBitmask, 34046 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); 34047 34048 var isCombo = 34049 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || 34050 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || 34051 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); 34052 34053 // Exit early if metadata can't be merged. 34054 if (!(isCommon || isCombo)) { 34055 return data; 34056 } 34057 // Use source `thisArg` if available. 34058 if (srcBitmask & WRAP_BIND_FLAG) { 34059 data[2] = source[2]; 34060 // Set when currying a bound function. 34061 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; 34062 } 34063 // Compose partial arguments. 34064 var value = source[3]; 34065 if (value) { 34066 var partials = data[3]; 34067 data[3] = partials ? composeArgs(partials, value, source[4]) : value; 34068 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; 34069 } 34070 // Compose partial right arguments. 34071 value = source[5]; 34072 if (value) { 34073 partials = data[5]; 34074 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; 34075 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; 34076 } 34077 // Use source `argPos` if available. 34078 value = source[7]; 34079 if (value) { 34080 data[7] = value; 34081 } 34082 // Use source `ary` if it's smaller. 34083 if (srcBitmask & WRAP_ARY_FLAG) { 34084 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); 34085 } 34086 // Use source `arity` if one is not provided. 34087 if (data[9] == null) { 34088 data[9] = source[9]; 34089 } 34090 // Use source `func` and merge bitmasks. 34091 data[0] = source[0]; 34092 data[1] = newBitmask; 34093 34094 return data; 34095 } 34096 34097 /** 34098 * This function is like 34099 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 34100 * except that it includes inherited enumerable properties. 34101 * 34102 * @private 34103 * @param {Object} object The object to query. 34104 * @returns {Array} Returns the array of property names. 34105 */ 34106 function nativeKeysIn(object) { 34107 var result = []; 34108 if (object != null) { 34109 for (var key in Object(object)) { 34110 result.push(key); 34111 } 34112 } 34113 return result; 34114 } 34115 34116 /** 34117 * Converts `value` to a string using `Object.prototype.toString`. 34118 * 34119 * @private 34120 * @param {*} value The value to convert. 34121 * @returns {string} Returns the converted string. 34122 */ 34123 function objectToString(value) { 34124 return nativeObjectToString.call(value); 34125 } 34126 34127 /** 34128 * A specialized version of `baseRest` which transforms the rest array. 34129 * 34130 * @private 34131 * @param {Function} func The function to apply a rest parameter to. 34132 * @param {number} [start=func.length-1] The start position of the rest parameter. 34133 * @param {Function} transform The rest array transform. 34134 * @returns {Function} Returns the new function. 34135 */ 34136 function overRest(func, start, transform) { 34137 start = nativeMax(start === undefined ? (func.length - 1) : start, 0); 34138 return function() { 34139 var args = arguments, 34140 index = -1, 34141 length = nativeMax(args.length - start, 0), 34142 array = Array(length); 34143 34144 while (++index < length) { 34145 array[index] = args[start + index]; 34146 } 34147 index = -1; 34148 var otherArgs = Array(start + 1); 34149 while (++index < start) { 34150 otherArgs[index] = args[index]; 34151 } 34152 otherArgs[start] = transform(array); 34153 return apply(func, this, otherArgs); 34154 }; 34155 } 34156 34157 /** 34158 * Gets the parent value at `path` of `object`. 34159 * 34160 * @private 34161 * @param {Object} object The object to query. 34162 * @param {Array} path The path to get the parent value of. 34163 * @returns {*} Returns the parent value. 34164 */ 34165 function parent(object, path) { 34166 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); 34167 } 34168 34169 /** 34170 * Reorder `array` according to the specified indexes where the element at 34171 * the first index is assigned as the first element, the element at 34172 * the second index is assigned as the second element, and so on. 34173 * 34174 * @private 34175 * @param {Array} array The array to reorder. 34176 * @param {Array} indexes The arranged array indexes. 34177 * @returns {Array} Returns `array`. 34178 */ 34179 function reorder(array, indexes) { 34180 var arrLength = array.length, 34181 length = nativeMin(indexes.length, arrLength), 34182 oldArray = copyArray(array); 34183 34184 while (length--) { 34185 var index = indexes[length]; 34186 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; 34187 } 34188 return array; 34189 } 34190 34191 /** 34192 * Gets the value at `key`, unless `key` is "__proto__" or "constructor". 34193 * 34194 * @private 34195 * @param {Object} object The object to query. 34196 * @param {string} key The key of the property to get. 34197 * @returns {*} Returns the property value. 34198 */ 34199 function safeGet(object, key) { 34200 if (key === 'constructor' && typeof object[key] === 'function') { 34201 return; 34202 } 34203 34204 if (key == '__proto__') { 34205 return; 34206 } 34207 34208 return object[key]; 34209 } 34210 34211 /** 34212 * Sets metadata for `func`. 34213 * 34214 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short 34215 * period of time, it will trip its breaker and transition to an identity 34216 * function to avoid garbage collection pauses in V8. See 34217 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) 34218 * for more details. 34219 * 34220 * @private 34221 * @param {Function} func The function to associate metadata with. 34222 * @param {*} data The metadata. 34223 * @returns {Function} Returns `func`. 34224 */ 34225 var setData = shortOut(baseSetData); 34226 34227 /** 34228 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). 34229 * 34230 * @private 34231 * @param {Function} func The function to delay. 34232 * @param {number} wait The number of milliseconds to delay invocation. 34233 * @returns {number|Object} Returns the timer id or timeout object. 34234 */ 34235 var setTimeout = ctxSetTimeout || function(func, wait) { 34236 return root.setTimeout(func, wait); 34237 }; 34238 34239 /** 34240 * Sets the `toString` method of `func` to return `string`. 34241 * 34242 * @private 34243 * @param {Function} func The function to modify. 34244 * @param {Function} string The `toString` result. 34245 * @returns {Function} Returns `func`. 34246 */ 34247 var setToString = shortOut(baseSetToString); 34248 34249 /** 34250 * Sets the `toString` method of `wrapper` to mimic the source of `reference` 34251 * with wrapper details in a comment at the top of the source body. 34252 * 34253 * @private 34254 * @param {Function} wrapper The function to modify. 34255 * @param {Function} reference The reference function. 34256 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 34257 * @returns {Function} Returns `wrapper`. 34258 */ 34259 function setWrapToString(wrapper, reference, bitmask) { 34260 var source = (reference + ''); 34261 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); 34262 } 34263 34264 /** 34265 * Creates a function that'll short out and invoke `identity` instead 34266 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` 34267 * milliseconds. 34268 * 34269 * @private 34270 * @param {Function} func The function to restrict. 34271 * @returns {Function} Returns the new shortable function. 34272 */ 34273 function shortOut(func) { 34274 var count = 0, 34275 lastCalled = 0; 34276 34277 return function() { 34278 var stamp = nativeNow(), 34279 remaining = HOT_SPAN - (stamp - lastCalled); 34280 34281 lastCalled = stamp; 34282 if (remaining > 0) { 34283 if (++count >= HOT_COUNT) { 34284 return arguments[0]; 34285 } 34286 } else { 34287 count = 0; 34288 } 34289 return func.apply(undefined, arguments); 34290 }; 34291 } 34292 34293 /** 34294 * A specialized version of `_.shuffle` which mutates and sets the size of `array`. 34295 * 34296 * @private 34297 * @param {Array} array The array to shuffle. 34298 * @param {number} [size=array.length] The size of `array`. 34299 * @returns {Array} Returns `array`. 34300 */ 34301 function shuffleSelf(array, size) { 34302 var index = -1, 34303 length = array.length, 34304 lastIndex = length - 1; 34305 34306 size = size === undefined ? length : size; 34307 while (++index < size) { 34308 var rand = baseRandom(index, lastIndex), 34309 value = array[rand]; 34310 34311 array[rand] = array[index]; 34312 array[index] = value; 34313 } 34314 array.length = size; 34315 return array; 34316 } 34317 34318 /** 34319 * Converts `string` to a property path array. 34320 * 34321 * @private 34322 * @param {string} string The string to convert. 34323 * @returns {Array} Returns the property path array. 34324 */ 34325 var stringToPath = memoizeCapped(function(string) { 34326 var result = []; 34327 if (string.charCodeAt(0) === 46 /* . */) { 34328 result.push(''); 34329 } 34330 string.replace(rePropName, function(match, number, quote, subString) { 34331 result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); 34332 }); 34333 return result; 34334 }); 34335 34336 /** 34337 * Converts `value` to a string key if it's not a string or symbol. 34338 * 34339 * @private 34340 * @param {*} value The value to inspect. 34341 * @returns {string|symbol} Returns the key. 34342 */ 34343 function toKey(value) { 34344 if (typeof value == 'string' || isSymbol(value)) { 34345 return value; 34346 } 34347 var result = (value + ''); 34348 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 34349 } 34350 34351 /** 34352 * Converts `func` to its source code. 34353 * 34354 * @private 34355 * @param {Function} func The function to convert. 34356 * @returns {string} Returns the source code. 34357 */ 34358 function toSource(func) { 34359 if (func != null) { 34360 try { 34361 return funcToString.call(func); 34362 } catch (e) {} 34363 try { 34364 return (func + ''); 34365 } catch (e) {} 34366 } 34367 return ''; 34368 } 34369 34370 /** 34371 * Updates wrapper `details` based on `bitmask` flags. 34372 * 34373 * @private 34374 * @returns {Array} details The details to modify. 34375 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 34376 * @returns {Array} Returns `details`. 34377 */ 34378 function updateWrapDetails(details, bitmask) { 34379 arrayEach(wrapFlags, function(pair) { 34380 var value = '_.' + pair[0]; 34381 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { 34382 details.push(value); 34383 } 34384 }); 34385 return details.sort(); 34386 } 34387 34388 /** 34389 * Creates a clone of `wrapper`. 34390 * 34391 * @private 34392 * @param {Object} wrapper The wrapper to clone. 34393 * @returns {Object} Returns the cloned wrapper. 34394 */ 34395 function wrapperClone(wrapper) { 34396 if (wrapper instanceof LazyWrapper) { 34397 return wrapper.clone(); 34398 } 34399 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); 34400 result.__actions__ = copyArray(wrapper.__actions__); 34401 result.__index__ = wrapper.__index__; 34402 result.__values__ = wrapper.__values__; 34403 return result; 34404 } 34405 34406 /*------------------------------------------------------------------------*/ 34407 34408 /** 34409 * Creates an array of elements split into groups the length of `size`. 34410 * If `array` can't be split evenly, the final chunk will be the remaining 34411 * elements. 34412 * 34413 * @static 34414 * @memberOf _ 34415 * @since 3.0.0 34416 * @category Array 34417 * @param {Array} array The array to process. 34418 * @param {number} [size=1] The length of each chunk 34419 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 34420 * @returns {Array} Returns the new array of chunks. 34421 * @example 34422 * 34423 * _.chunk(['a', 'b', 'c', 'd'], 2); 34424 * // => [['a', 'b'], ['c', 'd']] 34425 * 34426 * _.chunk(['a', 'b', 'c', 'd'], 3); 34427 * // => [['a', 'b', 'c'], ['d']] 34428 */ 34429 function chunk(array, size, guard) { 34430 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { 34431 size = 1; 34432 } else { 34433 size = nativeMax(toInteger(size), 0); 34434 } 34435 var length = array == null ? 0 : array.length; 34436 if (!length || size < 1) { 34437 return []; 34438 } 34439 var index = 0, 34440 resIndex = 0, 34441 result = Array(nativeCeil(length / size)); 34442 34443 while (index < length) { 34444 result[resIndex++] = baseSlice(array, index, (index += size)); 34445 } 34446 return result; 34447 } 34448 34449 /** 34450 * Creates an array with all falsey values removed. The values `false`, `null`, 34451 * `0`, `""`, `undefined`, and `NaN` are falsey. 34452 * 34453 * @static 34454 * @memberOf _ 34455 * @since 0.1.0 34456 * @category Array 34457 * @param {Array} array The array to compact. 34458 * @returns {Array} Returns the new array of filtered values. 34459 * @example 34460 * 34461 * _.compact([0, 1, false, 2, '', 3]); 34462 * // => [1, 2, 3] 34463 */ 34464 function compact(array) { 34465 var index = -1, 34466 length = array == null ? 0 : array.length, 34467 resIndex = 0, 34468 result = []; 34469 34470 while (++index < length) { 34471 var value = array[index]; 34472 if (value) { 34473 result[resIndex++] = value; 34474 } 34475 } 34476 return result; 34477 } 34478 34479 /** 34480 * Creates a new array concatenating `array` with any additional arrays 34481 * and/or values. 34482 * 34483 * @static 34484 * @memberOf _ 34485 * @since 4.0.0 34486 * @category Array 34487 * @param {Array} array The array to concatenate. 34488 * @param {...*} [values] The values to concatenate. 34489 * @returns {Array} Returns the new concatenated array. 34490 * @example 34491 * 34492 * var array = [1]; 34493 * var other = _.concat(array, 2, [3], [[4]]); 34494 * 34495 * console.log(other); 34496 * // => [1, 2, 3, [4]] 34497 * 34498 * console.log(array); 34499 * // => [1] 34500 */ 34501 function concat() { 34502 var length = arguments.length; 34503 if (!length) { 34504 return []; 34505 } 34506 var args = Array(length - 1), 34507 array = arguments[0], 34508 index = length; 34509 34510 while (index--) { 34511 args[index - 1] = arguments[index]; 34512 } 34513 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); 34514 } 34515 34516 /** 34517 * Creates an array of `array` values not included in the other given arrays 34518 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 34519 * for equality comparisons. The order and references of result values are 34520 * determined by the first array. 34521 * 34522 * **Note:** Unlike `_.pullAll`, this method returns a new array. 34523 * 34524 * @static 34525 * @memberOf _ 34526 * @since 0.1.0 34527 * @category Array 34528 * @param {Array} array The array to inspect. 34529 * @param {...Array} [values] The values to exclude. 34530 * @returns {Array} Returns the new array of filtered values. 34531 * @see _.without, _.xor 34532 * @example 34533 * 34534 * _.difference([2, 1], [2, 3]); 34535 * // => [1] 34536 */ 34537 var difference = baseRest(function(array, values) { 34538 return isArrayLikeObject(array) 34539 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) 34540 : []; 34541 }); 34542 34543 /** 34544 * This method is like `_.difference` except that it accepts `iteratee` which 34545 * is invoked for each element of `array` and `values` to generate the criterion 34546 * by which they're compared. The order and references of result values are 34547 * determined by the first array. The iteratee is invoked with one argument: 34548 * (value). 34549 * 34550 * **Note:** Unlike `_.pullAllBy`, this method returns a new array. 34551 * 34552 * @static 34553 * @memberOf _ 34554 * @since 4.0.0 34555 * @category Array 34556 * @param {Array} array The array to inspect. 34557 * @param {...Array} [values] The values to exclude. 34558 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 34559 * @returns {Array} Returns the new array of filtered values. 34560 * @example 34561 * 34562 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); 34563 * // => [1.2] 34564 * 34565 * // The `_.property` iteratee shorthand. 34566 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); 34567 * // => [{ 'x': 2 }] 34568 */ 34569 var differenceBy = baseRest(function(array, values) { 34570 var iteratee = last(values); 34571 if (isArrayLikeObject(iteratee)) { 34572 iteratee = undefined; 34573 } 34574 return isArrayLikeObject(array) 34575 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) 34576 : []; 34577 }); 34578 34579 /** 34580 * This method is like `_.difference` except that it accepts `comparator` 34581 * which is invoked to compare elements of `array` to `values`. The order and 34582 * references of result values are determined by the first array. The comparator 34583 * is invoked with two arguments: (arrVal, othVal). 34584 * 34585 * **Note:** Unlike `_.pullAllWith`, this method returns a new array. 34586 * 34587 * @static 34588 * @memberOf _ 34589 * @since 4.0.0 34590 * @category Array 34591 * @param {Array} array The array to inspect. 34592 * @param {...Array} [values] The values to exclude. 34593 * @param {Function} [comparator] The comparator invoked per element. 34594 * @returns {Array} Returns the new array of filtered values. 34595 * @example 34596 * 34597 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 34598 * 34599 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); 34600 * // => [{ 'x': 2, 'y': 1 }] 34601 */ 34602 var differenceWith = baseRest(function(array, values) { 34603 var comparator = last(values); 34604 if (isArrayLikeObject(comparator)) { 34605 comparator = undefined; 34606 } 34607 return isArrayLikeObject(array) 34608 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) 34609 : []; 34610 }); 34611 34612 /** 34613 * Creates a slice of `array` with `n` elements dropped from the beginning. 34614 * 34615 * @static 34616 * @memberOf _ 34617 * @since 0.5.0 34618 * @category Array 34619 * @param {Array} array The array to query. 34620 * @param {number} [n=1] The number of elements to drop. 34621 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 34622 * @returns {Array} Returns the slice of `array`. 34623 * @example 34624 * 34625 * _.drop([1, 2, 3]); 34626 * // => [2, 3] 34627 * 34628 * _.drop([1, 2, 3], 2); 34629 * // => [3] 34630 * 34631 * _.drop([1, 2, 3], 5); 34632 * // => [] 34633 * 34634 * _.drop([1, 2, 3], 0); 34635 * // => [1, 2, 3] 34636 */ 34637 function drop(array, n, guard) { 34638 var length = array == null ? 0 : array.length; 34639 if (!length) { 34640 return []; 34641 } 34642 n = (guard || n === undefined) ? 1 : toInteger(n); 34643 return baseSlice(array, n < 0 ? 0 : n, length); 34644 } 34645 34646 /** 34647 * Creates a slice of `array` with `n` elements dropped from the end. 34648 * 34649 * @static 34650 * @memberOf _ 34651 * @since 3.0.0 34652 * @category Array 34653 * @param {Array} array The array to query. 34654 * @param {number} [n=1] The number of elements to drop. 34655 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 34656 * @returns {Array} Returns the slice of `array`. 34657 * @example 34658 * 34659 * _.dropRight([1, 2, 3]); 34660 * // => [1, 2] 34661 * 34662 * _.dropRight([1, 2, 3], 2); 34663 * // => [1] 34664 * 34665 * _.dropRight([1, 2, 3], 5); 34666 * // => [] 34667 * 34668 * _.dropRight([1, 2, 3], 0); 34669 * // => [1, 2, 3] 34670 */ 34671 function dropRight(array, n, guard) { 34672 var length = array == null ? 0 : array.length; 34673 if (!length) { 34674 return []; 34675 } 34676 n = (guard || n === undefined) ? 1 : toInteger(n); 34677 n = length - n; 34678 return baseSlice(array, 0, n < 0 ? 0 : n); 34679 } 34680 34681 /** 34682 * Creates a slice of `array` excluding elements dropped from the end. 34683 * Elements are dropped until `predicate` returns falsey. The predicate is 34684 * invoked with three arguments: (value, index, array). 34685 * 34686 * @static 34687 * @memberOf _ 34688 * @since 3.0.0 34689 * @category Array 34690 * @param {Array} array The array to query. 34691 * @param {Function} [predicate=_.identity] The function invoked per iteration. 34692 * @returns {Array} Returns the slice of `array`. 34693 * @example 34694 * 34695 * var users = [ 34696 * { 'user': 'barney', 'active': true }, 34697 * { 'user': 'fred', 'active': false }, 34698 * { 'user': 'pebbles', 'active': false } 34699 * ]; 34700 * 34701 * _.dropRightWhile(users, function(o) { return !o.active; }); 34702 * // => objects for ['barney'] 34703 * 34704 * // The `_.matches` iteratee shorthand. 34705 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); 34706 * // => objects for ['barney', 'fred'] 34707 * 34708 * // The `_.matchesProperty` iteratee shorthand. 34709 * _.dropRightWhile(users, ['active', false]); 34710 * // => objects for ['barney'] 34711 * 34712 * // The `_.property` iteratee shorthand. 34713 * _.dropRightWhile(users, 'active'); 34714 * // => objects for ['barney', 'fred', 'pebbles'] 34715 */ 34716 function dropRightWhile(array, predicate) { 34717 return (array && array.length) 34718 ? baseWhile(array, getIteratee(predicate, 3), true, true) 34719 : []; 34720 } 34721 34722 /** 34723 * Creates a slice of `array` excluding elements dropped from the beginning. 34724 * Elements are dropped until `predicate` returns falsey. The predicate is 34725 * invoked with three arguments: (value, index, array). 34726 * 34727 * @static 34728 * @memberOf _ 34729 * @since 3.0.0 34730 * @category Array 34731 * @param {Array} array The array to query. 34732 * @param {Function} [predicate=_.identity] The function invoked per iteration. 34733 * @returns {Array} Returns the slice of `array`. 34734 * @example 34735 * 34736 * var users = [ 34737 * { 'user': 'barney', 'active': false }, 34738 * { 'user': 'fred', 'active': false }, 34739 * { 'user': 'pebbles', 'active': true } 34740 * ]; 34741 * 34742 * _.dropWhile(users, function(o) { return !o.active; }); 34743 * // => objects for ['pebbles'] 34744 * 34745 * // The `_.matches` iteratee shorthand. 34746 * _.dropWhile(users, { 'user': 'barney', 'active': false }); 34747 * // => objects for ['fred', 'pebbles'] 34748 * 34749 * // The `_.matchesProperty` iteratee shorthand. 34750 * _.dropWhile(users, ['active', false]); 34751 * // => objects for ['pebbles'] 34752 * 34753 * // The `_.property` iteratee shorthand. 34754 * _.dropWhile(users, 'active'); 34755 * // => objects for ['barney', 'fred', 'pebbles'] 34756 */ 34757 function dropWhile(array, predicate) { 34758 return (array && array.length) 34759 ? baseWhile(array, getIteratee(predicate, 3), true) 34760 : []; 34761 } 34762 34763 /** 34764 * Fills elements of `array` with `value` from `start` up to, but not 34765 * including, `end`. 34766 * 34767 * **Note:** This method mutates `array`. 34768 * 34769 * @static 34770 * @memberOf _ 34771 * @since 3.2.0 34772 * @category Array 34773 * @param {Array} array The array to fill. 34774 * @param {*} value The value to fill `array` with. 34775 * @param {number} [start=0] The start position. 34776 * @param {number} [end=array.length] The end position. 34777 * @returns {Array} Returns `array`. 34778 * @example 34779 * 34780 * var array = [1, 2, 3]; 34781 * 34782 * _.fill(array, 'a'); 34783 * console.log(array); 34784 * // => ['a', 'a', 'a'] 34785 * 34786 * _.fill(Array(3), 2); 34787 * // => [2, 2, 2] 34788 * 34789 * _.fill([4, 6, 8, 10], '*', 1, 3); 34790 * // => [4, '*', '*', 10] 34791 */ 34792 function fill(array, value, start, end) { 34793 var length = array == null ? 0 : array.length; 34794 if (!length) { 34795 return []; 34796 } 34797 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { 34798 start = 0; 34799 end = length; 34800 } 34801 return baseFill(array, value, start, end); 34802 } 34803 34804 /** 34805 * This method is like `_.find` except that it returns the index of the first 34806 * element `predicate` returns truthy for instead of the element itself. 34807 * 34808 * @static 34809 * @memberOf _ 34810 * @since 1.1.0 34811 * @category Array 34812 * @param {Array} array The array to inspect. 34813 * @param {Function} [predicate=_.identity] The function invoked per iteration. 34814 * @param {number} [fromIndex=0] The index to search from. 34815 * @returns {number} Returns the index of the found element, else `-1`. 34816 * @example 34817 * 34818 * var users = [ 34819 * { 'user': 'barney', 'active': false }, 34820 * { 'user': 'fred', 'active': false }, 34821 * { 'user': 'pebbles', 'active': true } 34822 * ]; 34823 * 34824 * _.findIndex(users, function(o) { return o.user == 'barney'; }); 34825 * // => 0 34826 * 34827 * // The `_.matches` iteratee shorthand. 34828 * _.findIndex(users, { 'user': 'fred', 'active': false }); 34829 * // => 1 34830 * 34831 * // The `_.matchesProperty` iteratee shorthand. 34832 * _.findIndex(users, ['active', false]); 34833 * // => 0 34834 * 34835 * // The `_.property` iteratee shorthand. 34836 * _.findIndex(users, 'active'); 34837 * // => 2 34838 */ 34839 function findIndex(array, predicate, fromIndex) { 34840 var length = array == null ? 0 : array.length; 34841 if (!length) { 34842 return -1; 34843 } 34844 var index = fromIndex == null ? 0 : toInteger(fromIndex); 34845 if (index < 0) { 34846 index = nativeMax(length + index, 0); 34847 } 34848 return baseFindIndex(array, getIteratee(predicate, 3), index); 34849 } 34850 34851 /** 34852 * This method is like `_.findIndex` except that it iterates over elements 34853 * of `collection` from right to left. 34854 * 34855 * @static 34856 * @memberOf _ 34857 * @since 2.0.0 34858 * @category Array 34859 * @param {Array} array The array to inspect. 34860 * @param {Function} [predicate=_.identity] The function invoked per iteration. 34861 * @param {number} [fromIndex=array.length-1] The index to search from. 34862 * @returns {number} Returns the index of the found element, else `-1`. 34863 * @example 34864 * 34865 * var users = [ 34866 * { 'user': 'barney', 'active': true }, 34867 * { 'user': 'fred', 'active': false }, 34868 * { 'user': 'pebbles', 'active': false } 34869 * ]; 34870 * 34871 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); 34872 * // => 2 34873 * 34874 * // The `_.matches` iteratee shorthand. 34875 * _.findLastIndex(users, { 'user': 'barney', 'active': true }); 34876 * // => 0 34877 * 34878 * // The `_.matchesProperty` iteratee shorthand. 34879 * _.findLastIndex(users, ['active', false]); 34880 * // => 2 34881 * 34882 * // The `_.property` iteratee shorthand. 34883 * _.findLastIndex(users, 'active'); 34884 * // => 0 34885 */ 34886 function findLastIndex(array, predicate, fromIndex) { 34887 var length = array == null ? 0 : array.length; 34888 if (!length) { 34889 return -1; 34890 } 34891 var index = length - 1; 34892 if (fromIndex !== undefined) { 34893 index = toInteger(fromIndex); 34894 index = fromIndex < 0 34895 ? nativeMax(length + index, 0) 34896 : nativeMin(index, length - 1); 34897 } 34898 return baseFindIndex(array, getIteratee(predicate, 3), index, true); 34899 } 34900 34901 /** 34902 * Flattens `array` a single level deep. 34903 * 34904 * @static 34905 * @memberOf _ 34906 * @since 0.1.0 34907 * @category Array 34908 * @param {Array} array The array to flatten. 34909 * @returns {Array} Returns the new flattened array. 34910 * @example 34911 * 34912 * _.flatten([1, [2, [3, [4]], 5]]); 34913 * // => [1, 2, [3, [4]], 5] 34914 */ 34915 function flatten(array) { 34916 var length = array == null ? 0 : array.length; 34917 return length ? baseFlatten(array, 1) : []; 34918 } 34919 34920 /** 34921 * Recursively flattens `array`. 34922 * 34923 * @static 34924 * @memberOf _ 34925 * @since 3.0.0 34926 * @category Array 34927 * @param {Array} array The array to flatten. 34928 * @returns {Array} Returns the new flattened array. 34929 * @example 34930 * 34931 * _.flattenDeep([1, [2, [3, [4]], 5]]); 34932 * // => [1, 2, 3, 4, 5] 34933 */ 34934 function flattenDeep(array) { 34935 var length = array == null ? 0 : array.length; 34936 return length ? baseFlatten(array, INFINITY) : []; 34937 } 34938 34939 /** 34940 * Recursively flatten `array` up to `depth` times. 34941 * 34942 * @static 34943 * @memberOf _ 34944 * @since 4.4.0 34945 * @category Array 34946 * @param {Array} array The array to flatten. 34947 * @param {number} [depth=1] The maximum recursion depth. 34948 * @returns {Array} Returns the new flattened array. 34949 * @example 34950 * 34951 * var array = [1, [2, [3, [4]], 5]]; 34952 * 34953 * _.flattenDepth(array, 1); 34954 * // => [1, 2, [3, [4]], 5] 34955 * 34956 * _.flattenDepth(array, 2); 34957 * // => [1, 2, 3, [4], 5] 34958 */ 34959 function flattenDepth(array, depth) { 34960 var length = array == null ? 0 : array.length; 34961 if (!length) { 34962 return []; 34963 } 34964 depth = depth === undefined ? 1 : toInteger(depth); 34965 return baseFlatten(array, depth); 34966 } 34967 34968 /** 34969 * The inverse of `_.toPairs`; this method returns an object composed 34970 * from key-value `pairs`. 34971 * 34972 * @static 34973 * @memberOf _ 34974 * @since 4.0.0 34975 * @category Array 34976 * @param {Array} pairs The key-value pairs. 34977 * @returns {Object} Returns the new object. 34978 * @example 34979 * 34980 * _.fromPairs([['a', 1], ['b', 2]]); 34981 * // => { 'a': 1, 'b': 2 } 34982 */ 34983 function fromPairs(pairs) { 34984 var index = -1, 34985 length = pairs == null ? 0 : pairs.length, 34986 result = {}; 34987 34988 while (++index < length) { 34989 var pair = pairs[index]; 34990 result[pair[0]] = pair[1]; 34991 } 34992 return result; 34993 } 34994 34995 /** 34996 * Gets the first element of `array`. 34997 * 34998 * @static 34999 * @memberOf _ 35000 * @since 0.1.0 35001 * @alias first 35002 * @category Array 35003 * @param {Array} array The array to query. 35004 * @returns {*} Returns the first element of `array`. 35005 * @example 35006 * 35007 * _.head([1, 2, 3]); 35008 * // => 1 35009 * 35010 * _.head([]); 35011 * // => undefined 35012 */ 35013 function head(array) { 35014 return (array && array.length) ? array[0] : undefined; 35015 } 35016 35017 /** 35018 * Gets the index at which the first occurrence of `value` is found in `array` 35019 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35020 * for equality comparisons. If `fromIndex` is negative, it's used as the 35021 * offset from the end of `array`. 35022 * 35023 * @static 35024 * @memberOf _ 35025 * @since 0.1.0 35026 * @category Array 35027 * @param {Array} array The array to inspect. 35028 * @param {*} value The value to search for. 35029 * @param {number} [fromIndex=0] The index to search from. 35030 * @returns {number} Returns the index of the matched value, else `-1`. 35031 * @example 35032 * 35033 * _.indexOf([1, 2, 1, 2], 2); 35034 * // => 1 35035 * 35036 * // Search from the `fromIndex`. 35037 * _.indexOf([1, 2, 1, 2], 2, 2); 35038 * // => 3 35039 */ 35040 function indexOf(array, value, fromIndex) { 35041 var length = array == null ? 0 : array.length; 35042 if (!length) { 35043 return -1; 35044 } 35045 var index = fromIndex == null ? 0 : toInteger(fromIndex); 35046 if (index < 0) { 35047 index = nativeMax(length + index, 0); 35048 } 35049 return baseIndexOf(array, value, index); 35050 } 35051 35052 /** 35053 * Gets all but the last element of `array`. 35054 * 35055 * @static 35056 * @memberOf _ 35057 * @since 0.1.0 35058 * @category Array 35059 * @param {Array} array The array to query. 35060 * @returns {Array} Returns the slice of `array`. 35061 * @example 35062 * 35063 * _.initial([1, 2, 3]); 35064 * // => [1, 2] 35065 */ 35066 function initial(array) { 35067 var length = array == null ? 0 : array.length; 35068 return length ? baseSlice(array, 0, -1) : []; 35069 } 35070 35071 /** 35072 * Creates an array of unique values that are included in all given arrays 35073 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35074 * for equality comparisons. The order and references of result values are 35075 * determined by the first array. 35076 * 35077 * @static 35078 * @memberOf _ 35079 * @since 0.1.0 35080 * @category Array 35081 * @param {...Array} [arrays] The arrays to inspect. 35082 * @returns {Array} Returns the new array of intersecting values. 35083 * @example 35084 * 35085 * _.intersection([2, 1], [2, 3]); 35086 * // => [2] 35087 */ 35088 var intersection = baseRest(function(arrays) { 35089 var mapped = arrayMap(arrays, castArrayLikeObject); 35090 return (mapped.length && mapped[0] === arrays[0]) 35091 ? baseIntersection(mapped) 35092 : []; 35093 }); 35094 35095 /** 35096 * This method is like `_.intersection` except that it accepts `iteratee` 35097 * which is invoked for each element of each `arrays` to generate the criterion 35098 * by which they're compared. The order and references of result values are 35099 * determined by the first array. The iteratee is invoked with one argument: 35100 * (value). 35101 * 35102 * @static 35103 * @memberOf _ 35104 * @since 4.0.0 35105 * @category Array 35106 * @param {...Array} [arrays] The arrays to inspect. 35107 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35108 * @returns {Array} Returns the new array of intersecting values. 35109 * @example 35110 * 35111 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); 35112 * // => [2.1] 35113 * 35114 * // The `_.property` iteratee shorthand. 35115 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 35116 * // => [{ 'x': 1 }] 35117 */ 35118 var intersectionBy = baseRest(function(arrays) { 35119 var iteratee = last(arrays), 35120 mapped = arrayMap(arrays, castArrayLikeObject); 35121 35122 if (iteratee === last(mapped)) { 35123 iteratee = undefined; 35124 } else { 35125 mapped.pop(); 35126 } 35127 return (mapped.length && mapped[0] === arrays[0]) 35128 ? baseIntersection(mapped, getIteratee(iteratee, 2)) 35129 : []; 35130 }); 35131 35132 /** 35133 * This method is like `_.intersection` except that it accepts `comparator` 35134 * which is invoked to compare elements of `arrays`. The order and references 35135 * of result values are determined by the first array. The comparator is 35136 * invoked with two arguments: (arrVal, othVal). 35137 * 35138 * @static 35139 * @memberOf _ 35140 * @since 4.0.0 35141 * @category Array 35142 * @param {...Array} [arrays] The arrays to inspect. 35143 * @param {Function} [comparator] The comparator invoked per element. 35144 * @returns {Array} Returns the new array of intersecting values. 35145 * @example 35146 * 35147 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 35148 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 35149 * 35150 * _.intersectionWith(objects, others, _.isEqual); 35151 * // => [{ 'x': 1, 'y': 2 }] 35152 */ 35153 var intersectionWith = baseRest(function(arrays) { 35154 var comparator = last(arrays), 35155 mapped = arrayMap(arrays, castArrayLikeObject); 35156 35157 comparator = typeof comparator == 'function' ? comparator : undefined; 35158 if (comparator) { 35159 mapped.pop(); 35160 } 35161 return (mapped.length && mapped[0] === arrays[0]) 35162 ? baseIntersection(mapped, undefined, comparator) 35163 : []; 35164 }); 35165 35166 /** 35167 * Converts all elements in `array` into a string separated by `separator`. 35168 * 35169 * @static 35170 * @memberOf _ 35171 * @since 4.0.0 35172 * @category Array 35173 * @param {Array} array The array to convert. 35174 * @param {string} [separator=','] The element separator. 35175 * @returns {string} Returns the joined string. 35176 * @example 35177 * 35178 * _.join(['a', 'b', 'c'], '~'); 35179 * // => 'a~b~c' 35180 */ 35181 function join(array, separator) { 35182 return array == null ? '' : nativeJoin.call(array, separator); 35183 } 35184 35185 /** 35186 * Gets the last element of `array`. 35187 * 35188 * @static 35189 * @memberOf _ 35190 * @since 0.1.0 35191 * @category Array 35192 * @param {Array} array The array to query. 35193 * @returns {*} Returns the last element of `array`. 35194 * @example 35195 * 35196 * _.last([1, 2, 3]); 35197 * // => 3 35198 */ 35199 function last(array) { 35200 var length = array == null ? 0 : array.length; 35201 return length ? array[length - 1] : undefined; 35202 } 35203 35204 /** 35205 * This method is like `_.indexOf` except that it iterates over elements of 35206 * `array` from right to left. 35207 * 35208 * @static 35209 * @memberOf _ 35210 * @since 0.1.0 35211 * @category Array 35212 * @param {Array} array The array to inspect. 35213 * @param {*} value The value to search for. 35214 * @param {number} [fromIndex=array.length-1] The index to search from. 35215 * @returns {number} Returns the index of the matched value, else `-1`. 35216 * @example 35217 * 35218 * _.lastIndexOf([1, 2, 1, 2], 2); 35219 * // => 3 35220 * 35221 * // Search from the `fromIndex`. 35222 * _.lastIndexOf([1, 2, 1, 2], 2, 2); 35223 * // => 1 35224 */ 35225 function lastIndexOf(array, value, fromIndex) { 35226 var length = array == null ? 0 : array.length; 35227 if (!length) { 35228 return -1; 35229 } 35230 var index = length; 35231 if (fromIndex !== undefined) { 35232 index = toInteger(fromIndex); 35233 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); 35234 } 35235 return value === value 35236 ? strictLastIndexOf(array, value, index) 35237 : baseFindIndex(array, baseIsNaN, index, true); 35238 } 35239 35240 /** 35241 * Gets the element at index `n` of `array`. If `n` is negative, the nth 35242 * element from the end is returned. 35243 * 35244 * @static 35245 * @memberOf _ 35246 * @since 4.11.0 35247 * @category Array 35248 * @param {Array} array The array to query. 35249 * @param {number} [n=0] The index of the element to return. 35250 * @returns {*} Returns the nth element of `array`. 35251 * @example 35252 * 35253 * var array = ['a', 'b', 'c', 'd']; 35254 * 35255 * _.nth(array, 1); 35256 * // => 'b' 35257 * 35258 * _.nth(array, -2); 35259 * // => 'c'; 35260 */ 35261 function nth(array, n) { 35262 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; 35263 } 35264 35265 /** 35266 * Removes all given values from `array` using 35267 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35268 * for equality comparisons. 35269 * 35270 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` 35271 * to remove elements from an array by predicate. 35272 * 35273 * @static 35274 * @memberOf _ 35275 * @since 2.0.0 35276 * @category Array 35277 * @param {Array} array The array to modify. 35278 * @param {...*} [values] The values to remove. 35279 * @returns {Array} Returns `array`. 35280 * @example 35281 * 35282 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 35283 * 35284 * _.pull(array, 'a', 'c'); 35285 * console.log(array); 35286 * // => ['b', 'b'] 35287 */ 35288 var pull = baseRest(pullAll); 35289 35290 /** 35291 * This method is like `_.pull` except that it accepts an array of values to remove. 35292 * 35293 * **Note:** Unlike `_.difference`, this method mutates `array`. 35294 * 35295 * @static 35296 * @memberOf _ 35297 * @since 4.0.0 35298 * @category Array 35299 * @param {Array} array The array to modify. 35300 * @param {Array} values The values to remove. 35301 * @returns {Array} Returns `array`. 35302 * @example 35303 * 35304 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 35305 * 35306 * _.pullAll(array, ['a', 'c']); 35307 * console.log(array); 35308 * // => ['b', 'b'] 35309 */ 35310 function pullAll(array, values) { 35311 return (array && array.length && values && values.length) 35312 ? basePullAll(array, values) 35313 : array; 35314 } 35315 35316 /** 35317 * This method is like `_.pullAll` except that it accepts `iteratee` which is 35318 * invoked for each element of `array` and `values` to generate the criterion 35319 * by which they're compared. The iteratee is invoked with one argument: (value). 35320 * 35321 * **Note:** Unlike `_.differenceBy`, this method mutates `array`. 35322 * 35323 * @static 35324 * @memberOf _ 35325 * @since 4.0.0 35326 * @category Array 35327 * @param {Array} array The array to modify. 35328 * @param {Array} values The values to remove. 35329 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35330 * @returns {Array} Returns `array`. 35331 * @example 35332 * 35333 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; 35334 * 35335 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); 35336 * console.log(array); 35337 * // => [{ 'x': 2 }] 35338 */ 35339 function pullAllBy(array, values, iteratee) { 35340 return (array && array.length && values && values.length) 35341 ? basePullAll(array, values, getIteratee(iteratee, 2)) 35342 : array; 35343 } 35344 35345 /** 35346 * This method is like `_.pullAll` except that it accepts `comparator` which 35347 * is invoked to compare elements of `array` to `values`. The comparator is 35348 * invoked with two arguments: (arrVal, othVal). 35349 * 35350 * **Note:** Unlike `_.differenceWith`, this method mutates `array`. 35351 * 35352 * @static 35353 * @memberOf _ 35354 * @since 4.6.0 35355 * @category Array 35356 * @param {Array} array The array to modify. 35357 * @param {Array} values The values to remove. 35358 * @param {Function} [comparator] The comparator invoked per element. 35359 * @returns {Array} Returns `array`. 35360 * @example 35361 * 35362 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; 35363 * 35364 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); 35365 * console.log(array); 35366 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] 35367 */ 35368 function pullAllWith(array, values, comparator) { 35369 return (array && array.length && values && values.length) 35370 ? basePullAll(array, values, undefined, comparator) 35371 : array; 35372 } 35373 35374 /** 35375 * Removes elements from `array` corresponding to `indexes` and returns an 35376 * array of removed elements. 35377 * 35378 * **Note:** Unlike `_.at`, this method mutates `array`. 35379 * 35380 * @static 35381 * @memberOf _ 35382 * @since 3.0.0 35383 * @category Array 35384 * @param {Array} array The array to modify. 35385 * @param {...(number|number[])} [indexes] The indexes of elements to remove. 35386 * @returns {Array} Returns the new array of removed elements. 35387 * @example 35388 * 35389 * var array = ['a', 'b', 'c', 'd']; 35390 * var pulled = _.pullAt(array, [1, 3]); 35391 * 35392 * console.log(array); 35393 * // => ['a', 'c'] 35394 * 35395 * console.log(pulled); 35396 * // => ['b', 'd'] 35397 */ 35398 var pullAt = flatRest(function(array, indexes) { 35399 var length = array == null ? 0 : array.length, 35400 result = baseAt(array, indexes); 35401 35402 basePullAt(array, arrayMap(indexes, function(index) { 35403 return isIndex(index, length) ? +index : index; 35404 }).sort(compareAscending)); 35405 35406 return result; 35407 }); 35408 35409 /** 35410 * Removes all elements from `array` that `predicate` returns truthy for 35411 * and returns an array of the removed elements. The predicate is invoked 35412 * with three arguments: (value, index, array). 35413 * 35414 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` 35415 * to pull elements from an array by value. 35416 * 35417 * @static 35418 * @memberOf _ 35419 * @since 2.0.0 35420 * @category Array 35421 * @param {Array} array The array to modify. 35422 * @param {Function} [predicate=_.identity] The function invoked per iteration. 35423 * @returns {Array} Returns the new array of removed elements. 35424 * @example 35425 * 35426 * var array = [1, 2, 3, 4]; 35427 * var evens = _.remove(array, function(n) { 35428 * return n % 2 == 0; 35429 * }); 35430 * 35431 * console.log(array); 35432 * // => [1, 3] 35433 * 35434 * console.log(evens); 35435 * // => [2, 4] 35436 */ 35437 function remove(array, predicate) { 35438 var result = []; 35439 if (!(array && array.length)) { 35440 return result; 35441 } 35442 var index = -1, 35443 indexes = [], 35444 length = array.length; 35445 35446 predicate = getIteratee(predicate, 3); 35447 while (++index < length) { 35448 var value = array[index]; 35449 if (predicate(value, index, array)) { 35450 result.push(value); 35451 indexes.push(index); 35452 } 35453 } 35454 basePullAt(array, indexes); 35455 return result; 35456 } 35457 35458 /** 35459 * Reverses `array` so that the first element becomes the last, the second 35460 * element becomes the second to last, and so on. 35461 * 35462 * **Note:** This method mutates `array` and is based on 35463 * [`Array#reverse`](https://mdn.io/Array/reverse). 35464 * 35465 * @static 35466 * @memberOf _ 35467 * @since 4.0.0 35468 * @category Array 35469 * @param {Array} array The array to modify. 35470 * @returns {Array} Returns `array`. 35471 * @example 35472 * 35473 * var array = [1, 2, 3]; 35474 * 35475 * _.reverse(array); 35476 * // => [3, 2, 1] 35477 * 35478 * console.log(array); 35479 * // => [3, 2, 1] 35480 */ 35481 function reverse(array) { 35482 return array == null ? array : nativeReverse.call(array); 35483 } 35484 35485 /** 35486 * Creates a slice of `array` from `start` up to, but not including, `end`. 35487 * 35488 * **Note:** This method is used instead of 35489 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are 35490 * returned. 35491 * 35492 * @static 35493 * @memberOf _ 35494 * @since 3.0.0 35495 * @category Array 35496 * @param {Array} array The array to slice. 35497 * @param {number} [start=0] The start position. 35498 * @param {number} [end=array.length] The end position. 35499 * @returns {Array} Returns the slice of `array`. 35500 */ 35501 function slice(array, start, end) { 35502 var length = array == null ? 0 : array.length; 35503 if (!length) { 35504 return []; 35505 } 35506 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { 35507 start = 0; 35508 end = length; 35509 } 35510 else { 35511 start = start == null ? 0 : toInteger(start); 35512 end = end === undefined ? length : toInteger(end); 35513 } 35514 return baseSlice(array, start, end); 35515 } 35516 35517 /** 35518 * Uses a binary search to determine the lowest index at which `value` 35519 * should be inserted into `array` in order to maintain its sort order. 35520 * 35521 * @static 35522 * @memberOf _ 35523 * @since 0.1.0 35524 * @category Array 35525 * @param {Array} array The sorted array to inspect. 35526 * @param {*} value The value to evaluate. 35527 * @returns {number} Returns the index at which `value` should be inserted 35528 * into `array`. 35529 * @example 35530 * 35531 * _.sortedIndex([30, 50], 40); 35532 * // => 1 35533 */ 35534 function sortedIndex(array, value) { 35535 return baseSortedIndex(array, value); 35536 } 35537 35538 /** 35539 * This method is like `_.sortedIndex` except that it accepts `iteratee` 35540 * which is invoked for `value` and each element of `array` to compute their 35541 * sort ranking. The iteratee is invoked with one argument: (value). 35542 * 35543 * @static 35544 * @memberOf _ 35545 * @since 4.0.0 35546 * @category Array 35547 * @param {Array} array The sorted array to inspect. 35548 * @param {*} value The value to evaluate. 35549 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35550 * @returns {number} Returns the index at which `value` should be inserted 35551 * into `array`. 35552 * @example 35553 * 35554 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 35555 * 35556 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 35557 * // => 0 35558 * 35559 * // The `_.property` iteratee shorthand. 35560 * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); 35561 * // => 0 35562 */ 35563 function sortedIndexBy(array, value, iteratee) { 35564 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); 35565 } 35566 35567 /** 35568 * This method is like `_.indexOf` except that it performs a binary 35569 * search on a sorted `array`. 35570 * 35571 * @static 35572 * @memberOf _ 35573 * @since 4.0.0 35574 * @category Array 35575 * @param {Array} array The array to inspect. 35576 * @param {*} value The value to search for. 35577 * @returns {number} Returns the index of the matched value, else `-1`. 35578 * @example 35579 * 35580 * _.sortedIndexOf([4, 5, 5, 5, 6], 5); 35581 * // => 1 35582 */ 35583 function sortedIndexOf(array, value) { 35584 var length = array == null ? 0 : array.length; 35585 if (length) { 35586 var index = baseSortedIndex(array, value); 35587 if (index < length && eq(array[index], value)) { 35588 return index; 35589 } 35590 } 35591 return -1; 35592 } 35593 35594 /** 35595 * This method is like `_.sortedIndex` except that it returns the highest 35596 * index at which `value` should be inserted into `array` in order to 35597 * maintain its sort order. 35598 * 35599 * @static 35600 * @memberOf _ 35601 * @since 3.0.0 35602 * @category Array 35603 * @param {Array} array The sorted array to inspect. 35604 * @param {*} value The value to evaluate. 35605 * @returns {number} Returns the index at which `value` should be inserted 35606 * into `array`. 35607 * @example 35608 * 35609 * _.sortedLastIndex([4, 5, 5, 5, 6], 5); 35610 * // => 4 35611 */ 35612 function sortedLastIndex(array, value) { 35613 return baseSortedIndex(array, value, true); 35614 } 35615 35616 /** 35617 * This method is like `_.sortedLastIndex` except that it accepts `iteratee` 35618 * which is invoked for `value` and each element of `array` to compute their 35619 * sort ranking. The iteratee is invoked with one argument: (value). 35620 * 35621 * @static 35622 * @memberOf _ 35623 * @since 4.0.0 35624 * @category Array 35625 * @param {Array} array The sorted array to inspect. 35626 * @param {*} value The value to evaluate. 35627 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35628 * @returns {number} Returns the index at which `value` should be inserted 35629 * into `array`. 35630 * @example 35631 * 35632 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 35633 * 35634 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 35635 * // => 1 35636 * 35637 * // The `_.property` iteratee shorthand. 35638 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); 35639 * // => 1 35640 */ 35641 function sortedLastIndexBy(array, value, iteratee) { 35642 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); 35643 } 35644 35645 /** 35646 * This method is like `_.lastIndexOf` except that it performs a binary 35647 * search on a sorted `array`. 35648 * 35649 * @static 35650 * @memberOf _ 35651 * @since 4.0.0 35652 * @category Array 35653 * @param {Array} array The array to inspect. 35654 * @param {*} value The value to search for. 35655 * @returns {number} Returns the index of the matched value, else `-1`. 35656 * @example 35657 * 35658 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); 35659 * // => 3 35660 */ 35661 function sortedLastIndexOf(array, value) { 35662 var length = array == null ? 0 : array.length; 35663 if (length) { 35664 var index = baseSortedIndex(array, value, true) - 1; 35665 if (eq(array[index], value)) { 35666 return index; 35667 } 35668 } 35669 return -1; 35670 } 35671 35672 /** 35673 * This method is like `_.uniq` except that it's designed and optimized 35674 * for sorted arrays. 35675 * 35676 * @static 35677 * @memberOf _ 35678 * @since 4.0.0 35679 * @category Array 35680 * @param {Array} array The array to inspect. 35681 * @returns {Array} Returns the new duplicate free array. 35682 * @example 35683 * 35684 * _.sortedUniq([1, 1, 2]); 35685 * // => [1, 2] 35686 */ 35687 function sortedUniq(array) { 35688 return (array && array.length) 35689 ? baseSortedUniq(array) 35690 : []; 35691 } 35692 35693 /** 35694 * This method is like `_.uniqBy` except that it's designed and optimized 35695 * for sorted arrays. 35696 * 35697 * @static 35698 * @memberOf _ 35699 * @since 4.0.0 35700 * @category Array 35701 * @param {Array} array The array to inspect. 35702 * @param {Function} [iteratee] The iteratee invoked per element. 35703 * @returns {Array} Returns the new duplicate free array. 35704 * @example 35705 * 35706 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); 35707 * // => [1.1, 2.3] 35708 */ 35709 function sortedUniqBy(array, iteratee) { 35710 return (array && array.length) 35711 ? baseSortedUniq(array, getIteratee(iteratee, 2)) 35712 : []; 35713 } 35714 35715 /** 35716 * Gets all but the first element of `array`. 35717 * 35718 * @static 35719 * @memberOf _ 35720 * @since 4.0.0 35721 * @category Array 35722 * @param {Array} array The array to query. 35723 * @returns {Array} Returns the slice of `array`. 35724 * @example 35725 * 35726 * _.tail([1, 2, 3]); 35727 * // => [2, 3] 35728 */ 35729 function tail(array) { 35730 var length = array == null ? 0 : array.length; 35731 return length ? baseSlice(array, 1, length) : []; 35732 } 35733 35734 /** 35735 * Creates a slice of `array` with `n` elements taken from the beginning. 35736 * 35737 * @static 35738 * @memberOf _ 35739 * @since 0.1.0 35740 * @category Array 35741 * @param {Array} array The array to query. 35742 * @param {number} [n=1] The number of elements to take. 35743 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 35744 * @returns {Array} Returns the slice of `array`. 35745 * @example 35746 * 35747 * _.take([1, 2, 3]); 35748 * // => [1] 35749 * 35750 * _.take([1, 2, 3], 2); 35751 * // => [1, 2] 35752 * 35753 * _.take([1, 2, 3], 5); 35754 * // => [1, 2, 3] 35755 * 35756 * _.take([1, 2, 3], 0); 35757 * // => [] 35758 */ 35759 function take(array, n, guard) { 35760 if (!(array && array.length)) { 35761 return []; 35762 } 35763 n = (guard || n === undefined) ? 1 : toInteger(n); 35764 return baseSlice(array, 0, n < 0 ? 0 : n); 35765 } 35766 35767 /** 35768 * Creates a slice of `array` with `n` elements taken from the end. 35769 * 35770 * @static 35771 * @memberOf _ 35772 * @since 3.0.0 35773 * @category Array 35774 * @param {Array} array The array to query. 35775 * @param {number} [n=1] The number of elements to take. 35776 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 35777 * @returns {Array} Returns the slice of `array`. 35778 * @example 35779 * 35780 * _.takeRight([1, 2, 3]); 35781 * // => [3] 35782 * 35783 * _.takeRight([1, 2, 3], 2); 35784 * // => [2, 3] 35785 * 35786 * _.takeRight([1, 2, 3], 5); 35787 * // => [1, 2, 3] 35788 * 35789 * _.takeRight([1, 2, 3], 0); 35790 * // => [] 35791 */ 35792 function takeRight(array, n, guard) { 35793 var length = array == null ? 0 : array.length; 35794 if (!length) { 35795 return []; 35796 } 35797 n = (guard || n === undefined) ? 1 : toInteger(n); 35798 n = length - n; 35799 return baseSlice(array, n < 0 ? 0 : n, length); 35800 } 35801 35802 /** 35803 * Creates a slice of `array` with elements taken from the end. Elements are 35804 * taken until `predicate` returns falsey. The predicate is invoked with 35805 * three arguments: (value, index, array). 35806 * 35807 * @static 35808 * @memberOf _ 35809 * @since 3.0.0 35810 * @category Array 35811 * @param {Array} array The array to query. 35812 * @param {Function} [predicate=_.identity] The function invoked per iteration. 35813 * @returns {Array} Returns the slice of `array`. 35814 * @example 35815 * 35816 * var users = [ 35817 * { 'user': 'barney', 'active': true }, 35818 * { 'user': 'fred', 'active': false }, 35819 * { 'user': 'pebbles', 'active': false } 35820 * ]; 35821 * 35822 * _.takeRightWhile(users, function(o) { return !o.active; }); 35823 * // => objects for ['fred', 'pebbles'] 35824 * 35825 * // The `_.matches` iteratee shorthand. 35826 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); 35827 * // => objects for ['pebbles'] 35828 * 35829 * // The `_.matchesProperty` iteratee shorthand. 35830 * _.takeRightWhile(users, ['active', false]); 35831 * // => objects for ['fred', 'pebbles'] 35832 * 35833 * // The `_.property` iteratee shorthand. 35834 * _.takeRightWhile(users, 'active'); 35835 * // => [] 35836 */ 35837 function takeRightWhile(array, predicate) { 35838 return (array && array.length) 35839 ? baseWhile(array, getIteratee(predicate, 3), false, true) 35840 : []; 35841 } 35842 35843 /** 35844 * Creates a slice of `array` with elements taken from the beginning. Elements 35845 * are taken until `predicate` returns falsey. The predicate is invoked with 35846 * three arguments: (value, index, array). 35847 * 35848 * @static 35849 * @memberOf _ 35850 * @since 3.0.0 35851 * @category Array 35852 * @param {Array} array The array to query. 35853 * @param {Function} [predicate=_.identity] The function invoked per iteration. 35854 * @returns {Array} Returns the slice of `array`. 35855 * @example 35856 * 35857 * var users = [ 35858 * { 'user': 'barney', 'active': false }, 35859 * { 'user': 'fred', 'active': false }, 35860 * { 'user': 'pebbles', 'active': true } 35861 * ]; 35862 * 35863 * _.takeWhile(users, function(o) { return !o.active; }); 35864 * // => objects for ['barney', 'fred'] 35865 * 35866 * // The `_.matches` iteratee shorthand. 35867 * _.takeWhile(users, { 'user': 'barney', 'active': false }); 35868 * // => objects for ['barney'] 35869 * 35870 * // The `_.matchesProperty` iteratee shorthand. 35871 * _.takeWhile(users, ['active', false]); 35872 * // => objects for ['barney', 'fred'] 35873 * 35874 * // The `_.property` iteratee shorthand. 35875 * _.takeWhile(users, 'active'); 35876 * // => [] 35877 */ 35878 function takeWhile(array, predicate) { 35879 return (array && array.length) 35880 ? baseWhile(array, getIteratee(predicate, 3)) 35881 : []; 35882 } 35883 35884 /** 35885 * Creates an array of unique values, in order, from all given arrays using 35886 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35887 * for equality comparisons. 35888 * 35889 * @static 35890 * @memberOf _ 35891 * @since 0.1.0 35892 * @category Array 35893 * @param {...Array} [arrays] The arrays to inspect. 35894 * @returns {Array} Returns the new array of combined values. 35895 * @example 35896 * 35897 * _.union([2], [1, 2]); 35898 * // => [2, 1] 35899 */ 35900 var union = baseRest(function(arrays) { 35901 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); 35902 }); 35903 35904 /** 35905 * This method is like `_.union` except that it accepts `iteratee` which is 35906 * invoked for each element of each `arrays` to generate the criterion by 35907 * which uniqueness is computed. Result values are chosen from the first 35908 * array in which the value occurs. The iteratee is invoked with one argument: 35909 * (value). 35910 * 35911 * @static 35912 * @memberOf _ 35913 * @since 4.0.0 35914 * @category Array 35915 * @param {...Array} [arrays] The arrays to inspect. 35916 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35917 * @returns {Array} Returns the new array of combined values. 35918 * @example 35919 * 35920 * _.unionBy([2.1], [1.2, 2.3], Math.floor); 35921 * // => [2.1, 1.2] 35922 * 35923 * // The `_.property` iteratee shorthand. 35924 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 35925 * // => [{ 'x': 1 }, { 'x': 2 }] 35926 */ 35927 var unionBy = baseRest(function(arrays) { 35928 var iteratee = last(arrays); 35929 if (isArrayLikeObject(iteratee)) { 35930 iteratee = undefined; 35931 } 35932 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); 35933 }); 35934 35935 /** 35936 * This method is like `_.union` except that it accepts `comparator` which 35937 * is invoked to compare elements of `arrays`. Result values are chosen from 35938 * the first array in which the value occurs. The comparator is invoked 35939 * with two arguments: (arrVal, othVal). 35940 * 35941 * @static 35942 * @memberOf _ 35943 * @since 4.0.0 35944 * @category Array 35945 * @param {...Array} [arrays] The arrays to inspect. 35946 * @param {Function} [comparator] The comparator invoked per element. 35947 * @returns {Array} Returns the new array of combined values. 35948 * @example 35949 * 35950 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 35951 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 35952 * 35953 * _.unionWith(objects, others, _.isEqual); 35954 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 35955 */ 35956 var unionWith = baseRest(function(arrays) { 35957 var comparator = last(arrays); 35958 comparator = typeof comparator == 'function' ? comparator : undefined; 35959 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); 35960 }); 35961 35962 /** 35963 * Creates a duplicate-free version of an array, using 35964 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35965 * for equality comparisons, in which only the first occurrence of each element 35966 * is kept. The order of result values is determined by the order they occur 35967 * in the array. 35968 * 35969 * @static 35970 * @memberOf _ 35971 * @since 0.1.0 35972 * @category Array 35973 * @param {Array} array The array to inspect. 35974 * @returns {Array} Returns the new duplicate free array. 35975 * @example 35976 * 35977 * _.uniq([2, 1, 2]); 35978 * // => [2, 1] 35979 */ 35980 function uniq(array) { 35981 return (array && array.length) ? baseUniq(array) : []; 35982 } 35983 35984 /** 35985 * This method is like `_.uniq` except that it accepts `iteratee` which is 35986 * invoked for each element in `array` to generate the criterion by which 35987 * uniqueness is computed. The order of result values is determined by the 35988 * order they occur in the array. The iteratee is invoked with one argument: 35989 * (value). 35990 * 35991 * @static 35992 * @memberOf _ 35993 * @since 4.0.0 35994 * @category Array 35995 * @param {Array} array The array to inspect. 35996 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35997 * @returns {Array} Returns the new duplicate free array. 35998 * @example 35999 * 36000 * _.uniqBy([2.1, 1.2, 2.3], Math.floor); 36001 * // => [2.1, 1.2] 36002 * 36003 * // The `_.property` iteratee shorthand. 36004 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); 36005 * // => [{ 'x': 1 }, { 'x': 2 }] 36006 */ 36007 function uniqBy(array, iteratee) { 36008 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; 36009 } 36010 36011 /** 36012 * This method is like `_.uniq` except that it accepts `comparator` which 36013 * is invoked to compare elements of `array`. The order of result values is 36014 * determined by the order they occur in the array.The comparator is invoked 36015 * with two arguments: (arrVal, othVal). 36016 * 36017 * @static 36018 * @memberOf _ 36019 * @since 4.0.0 36020 * @category Array 36021 * @param {Array} array The array to inspect. 36022 * @param {Function} [comparator] The comparator invoked per element. 36023 * @returns {Array} Returns the new duplicate free array. 36024 * @example 36025 * 36026 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; 36027 * 36028 * _.uniqWith(objects, _.isEqual); 36029 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] 36030 */ 36031 function uniqWith(array, comparator) { 36032 comparator = typeof comparator == 'function' ? comparator : undefined; 36033 return (array && array.length) ? baseUniq(array, undefined, comparator) : []; 36034 } 36035 36036 /** 36037 * This method is like `_.zip` except that it accepts an array of grouped 36038 * elements and creates an array regrouping the elements to their pre-zip 36039 * configuration. 36040 * 36041 * @static 36042 * @memberOf _ 36043 * @since 1.2.0 36044 * @category Array 36045 * @param {Array} array The array of grouped elements to process. 36046 * @returns {Array} Returns the new array of regrouped elements. 36047 * @example 36048 * 36049 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); 36050 * // => [['a', 1, true], ['b', 2, false]] 36051 * 36052 * _.unzip(zipped); 36053 * // => [['a', 'b'], [1, 2], [true, false]] 36054 */ 36055 function unzip(array) { 36056 if (!(array && array.length)) { 36057 return []; 36058 } 36059 var length = 0; 36060 array = arrayFilter(array, function(group) { 36061 if (isArrayLikeObject(group)) { 36062 length = nativeMax(group.length, length); 36063 return true; 36064 } 36065 }); 36066 return baseTimes(length, function(index) { 36067 return arrayMap(array, baseProperty(index)); 36068 }); 36069 } 36070 36071 /** 36072 * This method is like `_.unzip` except that it accepts `iteratee` to specify 36073 * how regrouped values should be combined. The iteratee is invoked with the 36074 * elements of each group: (...group). 36075 * 36076 * @static 36077 * @memberOf _ 36078 * @since 3.8.0 36079 * @category Array 36080 * @param {Array} array The array of grouped elements to process. 36081 * @param {Function} [iteratee=_.identity] The function to combine 36082 * regrouped values. 36083 * @returns {Array} Returns the new array of regrouped elements. 36084 * @example 36085 * 36086 * var zipped = _.zip([1, 2], [10, 20], [100, 200]); 36087 * // => [[1, 10, 100], [2, 20, 200]] 36088 * 36089 * _.unzipWith(zipped, _.add); 36090 * // => [3, 30, 300] 36091 */ 36092 function unzipWith(array, iteratee) { 36093 if (!(array && array.length)) { 36094 return []; 36095 } 36096 var result = unzip(array); 36097 if (iteratee == null) { 36098 return result; 36099 } 36100 return arrayMap(result, function(group) { 36101 return apply(iteratee, undefined, group); 36102 }); 36103 } 36104 36105 /** 36106 * Creates an array excluding all given values using 36107 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 36108 * for equality comparisons. 36109 * 36110 * **Note:** Unlike `_.pull`, this method returns a new array. 36111 * 36112 * @static 36113 * @memberOf _ 36114 * @since 0.1.0 36115 * @category Array 36116 * @param {Array} array The array to inspect. 36117 * @param {...*} [values] The values to exclude. 36118 * @returns {Array} Returns the new array of filtered values. 36119 * @see _.difference, _.xor 36120 * @example 36121 * 36122 * _.without([2, 1, 2, 3], 1, 2); 36123 * // => [3] 36124 */ 36125 var without = baseRest(function(array, values) { 36126 return isArrayLikeObject(array) 36127 ? baseDifference(array, values) 36128 : []; 36129 }); 36130 36131 /** 36132 * Creates an array of unique values that is the 36133 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) 36134 * of the given arrays. The order of result values is determined by the order 36135 * they occur in the arrays. 36136 * 36137 * @static 36138 * @memberOf _ 36139 * @since 2.4.0 36140 * @category Array 36141 * @param {...Array} [arrays] The arrays to inspect. 36142 * @returns {Array} Returns the new array of filtered values. 36143 * @see _.difference, _.without 36144 * @example 36145 * 36146 * _.xor([2, 1], [2, 3]); 36147 * // => [1, 3] 36148 */ 36149 var xor = baseRest(function(arrays) { 36150 return baseXor(arrayFilter(arrays, isArrayLikeObject)); 36151 }); 36152 36153 /** 36154 * This method is like `_.xor` except that it accepts `iteratee` which is 36155 * invoked for each element of each `arrays` to generate the criterion by 36156 * which by which they're compared. The order of result values is determined 36157 * by the order they occur in the arrays. The iteratee is invoked with one 36158 * argument: (value). 36159 * 36160 * @static 36161 * @memberOf _ 36162 * @since 4.0.0 36163 * @category Array 36164 * @param {...Array} [arrays] The arrays to inspect. 36165 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 36166 * @returns {Array} Returns the new array of filtered values. 36167 * @example 36168 * 36169 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); 36170 * // => [1.2, 3.4] 36171 * 36172 * // The `_.property` iteratee shorthand. 36173 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 36174 * // => [{ 'x': 2 }] 36175 */ 36176 var xorBy = baseRest(function(arrays) { 36177 var iteratee = last(arrays); 36178 if (isArrayLikeObject(iteratee)) { 36179 iteratee = undefined; 36180 } 36181 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); 36182 }); 36183 36184 /** 36185 * This method is like `_.xor` except that it accepts `comparator` which is 36186 * invoked to compare elements of `arrays`. The order of result values is 36187 * determined by the order they occur in the arrays. The comparator is invoked 36188 * with two arguments: (arrVal, othVal). 36189 * 36190 * @static 36191 * @memberOf _ 36192 * @since 4.0.0 36193 * @category Array 36194 * @param {...Array} [arrays] The arrays to inspect. 36195 * @param {Function} [comparator] The comparator invoked per element. 36196 * @returns {Array} Returns the new array of filtered values. 36197 * @example 36198 * 36199 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 36200 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 36201 * 36202 * _.xorWith(objects, others, _.isEqual); 36203 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 36204 */ 36205 var xorWith = baseRest(function(arrays) { 36206 var comparator = last(arrays); 36207 comparator = typeof comparator == 'function' ? comparator : undefined; 36208 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); 36209 }); 36210 36211 /** 36212 * Creates an array of grouped elements, the first of which contains the 36213 * first elements of the given arrays, the second of which contains the 36214 * second elements of the given arrays, and so on. 36215 * 36216 * @static 36217 * @memberOf _ 36218 * @since 0.1.0 36219 * @category Array 36220 * @param {...Array} [arrays] The arrays to process. 36221 * @returns {Array} Returns the new array of grouped elements. 36222 * @example 36223 * 36224 * _.zip(['a', 'b'], [1, 2], [true, false]); 36225 * // => [['a', 1, true], ['b', 2, false]] 36226 */ 36227 var zip = baseRest(unzip); 36228 36229 /** 36230 * This method is like `_.fromPairs` except that it accepts two arrays, 36231 * one of property identifiers and one of corresponding values. 36232 * 36233 * @static 36234 * @memberOf _ 36235 * @since 0.4.0 36236 * @category Array 36237 * @param {Array} [props=[]] The property identifiers. 36238 * @param {Array} [values=[]] The property values. 36239 * @returns {Object} Returns the new object. 36240 * @example 36241 * 36242 * _.zipObject(['a', 'b'], [1, 2]); 36243 * // => { 'a': 1, 'b': 2 } 36244 */ 36245 function zipObject(props, values) { 36246 return baseZipObject(props || [], values || [], assignValue); 36247 } 36248 36249 /** 36250 * This method is like `_.zipObject` except that it supports property paths. 36251 * 36252 * @static 36253 * @memberOf _ 36254 * @since 4.1.0 36255 * @category Array 36256 * @param {Array} [props=[]] The property identifiers. 36257 * @param {Array} [values=[]] The property values. 36258 * @returns {Object} Returns the new object. 36259 * @example 36260 * 36261 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); 36262 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } 36263 */ 36264 function zipObjectDeep(props, values) { 36265 return baseZipObject(props || [], values || [], baseSet); 36266 } 36267 36268 /** 36269 * This method is like `_.zip` except that it accepts `iteratee` to specify 36270 * how grouped values should be combined. The iteratee is invoked with the 36271 * elements of each group: (...group). 36272 * 36273 * @static 36274 * @memberOf _ 36275 * @since 3.8.0 36276 * @category Array 36277 * @param {...Array} [arrays] The arrays to process. 36278 * @param {Function} [iteratee=_.identity] The function to combine 36279 * grouped values. 36280 * @returns {Array} Returns the new array of grouped elements. 36281 * @example 36282 * 36283 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { 36284 * return a + b + c; 36285 * }); 36286 * // => [111, 222] 36287 */ 36288 var zipWith = baseRest(function(arrays) { 36289 var length = arrays.length, 36290 iteratee = length > 1 ? arrays[length - 1] : undefined; 36291 36292 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; 36293 return unzipWith(arrays, iteratee); 36294 }); 36295 36296 /*------------------------------------------------------------------------*/ 36297 36298 /** 36299 * Creates a `lodash` wrapper instance that wraps `value` with explicit method 36300 * chain sequences enabled. The result of such sequences must be unwrapped 36301 * with `_#value`. 36302 * 36303 * @static 36304 * @memberOf _ 36305 * @since 1.3.0 36306 * @category Seq 36307 * @param {*} value The value to wrap. 36308 * @returns {Object} Returns the new `lodash` wrapper instance. 36309 * @example 36310 * 36311 * var users = [ 36312 * { 'user': 'barney', 'age': 36 }, 36313 * { 'user': 'fred', 'age': 40 }, 36314 * { 'user': 'pebbles', 'age': 1 } 36315 * ]; 36316 * 36317 * var youngest = _ 36318 * .chain(users) 36319 * .sortBy('age') 36320 * .map(function(o) { 36321 * return o.user + ' is ' + o.age; 36322 * }) 36323 * .head() 36324 * .value(); 36325 * // => 'pebbles is 1' 36326 */ 36327 function chain(value) { 36328 var result = lodash(value); 36329 result.__chain__ = true; 36330 return result; 36331 } 36332 36333 /** 36334 * This method invokes `interceptor` and returns `value`. The interceptor 36335 * is invoked with one argument; (value). The purpose of this method is to 36336 * "tap into" a method chain sequence in order to modify intermediate results. 36337 * 36338 * @static 36339 * @memberOf _ 36340 * @since 0.1.0 36341 * @category Seq 36342 * @param {*} value The value to provide to `interceptor`. 36343 * @param {Function} interceptor The function to invoke. 36344 * @returns {*} Returns `value`. 36345 * @example 36346 * 36347 * _([1, 2, 3]) 36348 * .tap(function(array) { 36349 * // Mutate input array. 36350 * array.pop(); 36351 * }) 36352 * .reverse() 36353 * .value(); 36354 * // => [2, 1] 36355 */ 36356 function tap(value, interceptor) { 36357 interceptor(value); 36358 return value; 36359 } 36360 36361 /** 36362 * This method is like `_.tap` except that it returns the result of `interceptor`. 36363 * The purpose of this method is to "pass thru" values replacing intermediate 36364 * results in a method chain sequence. 36365 * 36366 * @static 36367 * @memberOf _ 36368 * @since 3.0.0 36369 * @category Seq 36370 * @param {*} value The value to provide to `interceptor`. 36371 * @param {Function} interceptor The function to invoke. 36372 * @returns {*} Returns the result of `interceptor`. 36373 * @example 36374 * 36375 * _(' abc ') 36376 * .chain() 36377 * .trim() 36378 * .thru(function(value) { 36379 * return [value]; 36380 * }) 36381 * .value(); 36382 * // => ['abc'] 36383 */ 36384 function thru(value, interceptor) { 36385 return interceptor(value); 36386 } 36387 36388 /** 36389 * This method is the wrapper version of `_.at`. 36390 * 36391 * @name at 36392 * @memberOf _ 36393 * @since 1.0.0 36394 * @category Seq 36395 * @param {...(string|string[])} [paths] The property paths to pick. 36396 * @returns {Object} Returns the new `lodash` wrapper instance. 36397 * @example 36398 * 36399 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 36400 * 36401 * _(object).at(['a[0].b.c', 'a[1]']).value(); 36402 * // => [3, 4] 36403 */ 36404 var wrapperAt = flatRest(function(paths) { 36405 var length = paths.length, 36406 start = length ? paths[0] : 0, 36407 value = this.__wrapped__, 36408 interceptor = function(object) { return baseAt(object, paths); }; 36409 36410 if (length > 1 || this.__actions__.length || 36411 !(value instanceof LazyWrapper) || !isIndex(start)) { 36412 return this.thru(interceptor); 36413 } 36414 value = value.slice(start, +start + (length ? 1 : 0)); 36415 value.__actions__.push({ 36416 'func': thru, 36417 'args': [interceptor], 36418 'thisArg': undefined 36419 }); 36420 return new LodashWrapper(value, this.__chain__).thru(function(array) { 36421 if (length && !array.length) { 36422 array.push(undefined); 36423 } 36424 return array; 36425 }); 36426 }); 36427 36428 /** 36429 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. 36430 * 36431 * @name chain 36432 * @memberOf _ 36433 * @since 0.1.0 36434 * @category Seq 36435 * @returns {Object} Returns the new `lodash` wrapper instance. 36436 * @example 36437 * 36438 * var users = [ 36439 * { 'user': 'barney', 'age': 36 }, 36440 * { 'user': 'fred', 'age': 40 } 36441 * ]; 36442 * 36443 * // A sequence without explicit chaining. 36444 * _(users).head(); 36445 * // => { 'user': 'barney', 'age': 36 } 36446 * 36447 * // A sequence with explicit chaining. 36448 * _(users) 36449 * .chain() 36450 * .head() 36451 * .pick('user') 36452 * .value(); 36453 * // => { 'user': 'barney' } 36454 */ 36455 function wrapperChain() { 36456 return chain(this); 36457 } 36458 36459 /** 36460 * Executes the chain sequence and returns the wrapped result. 36461 * 36462 * @name commit 36463 * @memberOf _ 36464 * @since 3.2.0 36465 * @category Seq 36466 * @returns {Object} Returns the new `lodash` wrapper instance. 36467 * @example 36468 * 36469 * var array = [1, 2]; 36470 * var wrapped = _(array).push(3); 36471 * 36472 * console.log(array); 36473 * // => [1, 2] 36474 * 36475 * wrapped = wrapped.commit(); 36476 * console.log(array); 36477 * // => [1, 2, 3] 36478 * 36479 * wrapped.last(); 36480 * // => 3 36481 * 36482 * console.log(array); 36483 * // => [1, 2, 3] 36484 */ 36485 function wrapperCommit() { 36486 return new LodashWrapper(this.value(), this.__chain__); 36487 } 36488 36489 /** 36490 * Gets the next value on a wrapped object following the 36491 * [iterator protocol](https://mdn.io/iteration_protocols#iterator). 36492 * 36493 * @name next 36494 * @memberOf _ 36495 * @since 4.0.0 36496 * @category Seq 36497 * @returns {Object} Returns the next iterator value. 36498 * @example 36499 * 36500 * var wrapped = _([1, 2]); 36501 * 36502 * wrapped.next(); 36503 * // => { 'done': false, 'value': 1 } 36504 * 36505 * wrapped.next(); 36506 * // => { 'done': false, 'value': 2 } 36507 * 36508 * wrapped.next(); 36509 * // => { 'done': true, 'value': undefined } 36510 */ 36511 function wrapperNext() { 36512 if (this.__values__ === undefined) { 36513 this.__values__ = toArray(this.value()); 36514 } 36515 var done = this.__index__ >= this.__values__.length, 36516 value = done ? undefined : this.__values__[this.__index__++]; 36517 36518 return { 'done': done, 'value': value }; 36519 } 36520 36521 /** 36522 * Enables the wrapper to be iterable. 36523 * 36524 * @name Symbol.iterator 36525 * @memberOf _ 36526 * @since 4.0.0 36527 * @category Seq 36528 * @returns {Object} Returns the wrapper object. 36529 * @example 36530 * 36531 * var wrapped = _([1, 2]); 36532 * 36533 * wrapped[Symbol.iterator]() === wrapped; 36534 * // => true 36535 * 36536 * Array.from(wrapped); 36537 * // => [1, 2] 36538 */ 36539 function wrapperToIterator() { 36540 return this; 36541 } 36542 36543 /** 36544 * Creates a clone of the chain sequence planting `value` as the wrapped value. 36545 * 36546 * @name plant 36547 * @memberOf _ 36548 * @since 3.2.0 36549 * @category Seq 36550 * @param {*} value The value to plant. 36551 * @returns {Object} Returns the new `lodash` wrapper instance. 36552 * @example 36553 * 36554 * function square(n) { 36555 * return n * n; 36556 * } 36557 * 36558 * var wrapped = _([1, 2]).map(square); 36559 * var other = wrapped.plant([3, 4]); 36560 * 36561 * other.value(); 36562 * // => [9, 16] 36563 * 36564 * wrapped.value(); 36565 * // => [1, 4] 36566 */ 36567 function wrapperPlant(value) { 36568 var result, 36569 parent = this; 36570 36571 while (parent instanceof baseLodash) { 36572 var clone = wrapperClone(parent); 36573 clone.__index__ = 0; 36574 clone.__values__ = undefined; 36575 if (result) { 36576 previous.__wrapped__ = clone; 36577 } else { 36578 result = clone; 36579 } 36580 var previous = clone; 36581 parent = parent.__wrapped__; 36582 } 36583 previous.__wrapped__ = value; 36584 return result; 36585 } 36586 36587 /** 36588 * This method is the wrapper version of `_.reverse`. 36589 * 36590 * **Note:** This method mutates the wrapped array. 36591 * 36592 * @name reverse 36593 * @memberOf _ 36594 * @since 0.1.0 36595 * @category Seq 36596 * @returns {Object} Returns the new `lodash` wrapper instance. 36597 * @example 36598 * 36599 * var array = [1, 2, 3]; 36600 * 36601 * _(array).reverse().value() 36602 * // => [3, 2, 1] 36603 * 36604 * console.log(array); 36605 * // => [3, 2, 1] 36606 */ 36607 function wrapperReverse() { 36608 var value = this.__wrapped__; 36609 if (value instanceof LazyWrapper) { 36610 var wrapped = value; 36611 if (this.__actions__.length) { 36612 wrapped = new LazyWrapper(this); 36613 } 36614 wrapped = wrapped.reverse(); 36615 wrapped.__actions__.push({ 36616 'func': thru, 36617 'args': [reverse], 36618 'thisArg': undefined 36619 }); 36620 return new LodashWrapper(wrapped, this.__chain__); 36621 } 36622 return this.thru(reverse); 36623 } 36624 36625 /** 36626 * Executes the chain sequence to resolve the unwrapped value. 36627 * 36628 * @name value 36629 * @memberOf _ 36630 * @since 0.1.0 36631 * @alias toJSON, valueOf 36632 * @category Seq 36633 * @returns {*} Returns the resolved unwrapped value. 36634 * @example 36635 * 36636 * _([1, 2, 3]).value(); 36637 * // => [1, 2, 3] 36638 */ 36639 function wrapperValue() { 36640 return baseWrapperValue(this.__wrapped__, this.__actions__); 36641 } 36642 36643 /*------------------------------------------------------------------------*/ 36644 36645 /** 36646 * Creates an object composed of keys generated from the results of running 36647 * each element of `collection` thru `iteratee`. The corresponding value of 36648 * each key is the number of times the key was returned by `iteratee`. The 36649 * iteratee is invoked with one argument: (value). 36650 * 36651 * @static 36652 * @memberOf _ 36653 * @since 0.5.0 36654 * @category Collection 36655 * @param {Array|Object} collection The collection to iterate over. 36656 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 36657 * @returns {Object} Returns the composed aggregate object. 36658 * @example 36659 * 36660 * _.countBy([6.1, 4.2, 6.3], Math.floor); 36661 * // => { '4': 1, '6': 2 } 36662 * 36663 * // The `_.property` iteratee shorthand. 36664 * _.countBy(['one', 'two', 'three'], 'length'); 36665 * // => { '3': 2, '5': 1 } 36666 */ 36667 var countBy = createAggregator(function(result, value, key) { 36668 if (hasOwnProperty.call(result, key)) { 36669 ++result[key]; 36670 } else { 36671 baseAssignValue(result, key, 1); 36672 } 36673 }); 36674 36675 /** 36676 * Checks if `predicate` returns truthy for **all** elements of `collection`. 36677 * Iteration is stopped once `predicate` returns falsey. The predicate is 36678 * invoked with three arguments: (value, index|key, collection). 36679 * 36680 * **Note:** This method returns `true` for 36681 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because 36682 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of 36683 * elements of empty collections. 36684 * 36685 * @static 36686 * @memberOf _ 36687 * @since 0.1.0 36688 * @category Collection 36689 * @param {Array|Object} collection The collection to iterate over. 36690 * @param {Function} [predicate=_.identity] The function invoked per iteration. 36691 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 36692 * @returns {boolean} Returns `true` if all elements pass the predicate check, 36693 * else `false`. 36694 * @example 36695 * 36696 * _.every([true, 1, null, 'yes'], Boolean); 36697 * // => false 36698 * 36699 * var users = [ 36700 * { 'user': 'barney', 'age': 36, 'active': false }, 36701 * { 'user': 'fred', 'age': 40, 'active': false } 36702 * ]; 36703 * 36704 * // The `_.matches` iteratee shorthand. 36705 * _.every(users, { 'user': 'barney', 'active': false }); 36706 * // => false 36707 * 36708 * // The `_.matchesProperty` iteratee shorthand. 36709 * _.every(users, ['active', false]); 36710 * // => true 36711 * 36712 * // The `_.property` iteratee shorthand. 36713 * _.every(users, 'active'); 36714 * // => false 36715 */ 36716 function every(collection, predicate, guard) { 36717 var func = isArray(collection) ? arrayEvery : baseEvery; 36718 if (guard && isIterateeCall(collection, predicate, guard)) { 36719 predicate = undefined; 36720 } 36721 return func(collection, getIteratee(predicate, 3)); 36722 } 36723 36724 /** 36725 * Iterates over elements of `collection`, returning an array of all elements 36726 * `predicate` returns truthy for. The predicate is invoked with three 36727 * arguments: (value, index|key, collection). 36728 * 36729 * **Note:** Unlike `_.remove`, this method returns a new array. 36730 * 36731 * @static 36732 * @memberOf _ 36733 * @since 0.1.0 36734 * @category Collection 36735 * @param {Array|Object} collection The collection to iterate over. 36736 * @param {Function} [predicate=_.identity] The function invoked per iteration. 36737 * @returns {Array} Returns the new filtered array. 36738 * @see _.reject 36739 * @example 36740 * 36741 * var users = [ 36742 * { 'user': 'barney', 'age': 36, 'active': true }, 36743 * { 'user': 'fred', 'age': 40, 'active': false } 36744 * ]; 36745 * 36746 * _.filter(users, function(o) { return !o.active; }); 36747 * // => objects for ['fred'] 36748 * 36749 * // The `_.matches` iteratee shorthand. 36750 * _.filter(users, { 'age': 36, 'active': true }); 36751 * // => objects for ['barney'] 36752 * 36753 * // The `_.matchesProperty` iteratee shorthand. 36754 * _.filter(users, ['active', false]); 36755 * // => objects for ['fred'] 36756 * 36757 * // The `_.property` iteratee shorthand. 36758 * _.filter(users, 'active'); 36759 * // => objects for ['barney'] 36760 * 36761 * // Combining several predicates using `_.overEvery` or `_.overSome`. 36762 * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); 36763 * // => objects for ['fred', 'barney'] 36764 */ 36765 function filter(collection, predicate) { 36766 var func = isArray(collection) ? arrayFilter : baseFilter; 36767 return func(collection, getIteratee(predicate, 3)); 36768 } 36769 36770 /** 36771 * Iterates over elements of `collection`, returning the first element 36772 * `predicate` returns truthy for. The predicate is invoked with three 36773 * arguments: (value, index|key, collection). 36774 * 36775 * @static 36776 * @memberOf _ 36777 * @since 0.1.0 36778 * @category Collection 36779 * @param {Array|Object} collection The collection to inspect. 36780 * @param {Function} [predicate=_.identity] The function invoked per iteration. 36781 * @param {number} [fromIndex=0] The index to search from. 36782 * @returns {*} Returns the matched element, else `undefined`. 36783 * @example 36784 * 36785 * var users = [ 36786 * { 'user': 'barney', 'age': 36, 'active': true }, 36787 * { 'user': 'fred', 'age': 40, 'active': false }, 36788 * { 'user': 'pebbles', 'age': 1, 'active': true } 36789 * ]; 36790 * 36791 * _.find(users, function(o) { return o.age < 40; }); 36792 * // => object for 'barney' 36793 * 36794 * // The `_.matches` iteratee shorthand. 36795 * _.find(users, { 'age': 1, 'active': true }); 36796 * // => object for 'pebbles' 36797 * 36798 * // The `_.matchesProperty` iteratee shorthand. 36799 * _.find(users, ['active', false]); 36800 * // => object for 'fred' 36801 * 36802 * // The `_.property` iteratee shorthand. 36803 * _.find(users, 'active'); 36804 * // => object for 'barney' 36805 */ 36806 var find = createFind(findIndex); 36807 36808 /** 36809 * This method is like `_.find` except that it iterates over elements of 36810 * `collection` from right to left. 36811 * 36812 * @static 36813 * @memberOf _ 36814 * @since 2.0.0 36815 * @category Collection 36816 * @param {Array|Object} collection The collection to inspect. 36817 * @param {Function} [predicate=_.identity] The function invoked per iteration. 36818 * @param {number} [fromIndex=collection.length-1] The index to search from. 36819 * @returns {*} Returns the matched element, else `undefined`. 36820 * @example 36821 * 36822 * _.findLast([1, 2, 3, 4], function(n) { 36823 * return n % 2 == 1; 36824 * }); 36825 * // => 3 36826 */ 36827 var findLast = createFind(findLastIndex); 36828 36829 /** 36830 * Creates a flattened array of values by running each element in `collection` 36831 * thru `iteratee` and flattening the mapped results. The iteratee is invoked 36832 * with three arguments: (value, index|key, collection). 36833 * 36834 * @static 36835 * @memberOf _ 36836 * @since 4.0.0 36837 * @category Collection 36838 * @param {Array|Object} collection The collection to iterate over. 36839 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36840 * @returns {Array} Returns the new flattened array. 36841 * @example 36842 * 36843 * function duplicate(n) { 36844 * return [n, n]; 36845 * } 36846 * 36847 * _.flatMap([1, 2], duplicate); 36848 * // => [1, 1, 2, 2] 36849 */ 36850 function flatMap(collection, iteratee) { 36851 return baseFlatten(map(collection, iteratee), 1); 36852 } 36853 36854 /** 36855 * This method is like `_.flatMap` except that it recursively flattens the 36856 * mapped results. 36857 * 36858 * @static 36859 * @memberOf _ 36860 * @since 4.7.0 36861 * @category Collection 36862 * @param {Array|Object} collection The collection to iterate over. 36863 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36864 * @returns {Array} Returns the new flattened array. 36865 * @example 36866 * 36867 * function duplicate(n) { 36868 * return [[[n, n]]]; 36869 * } 36870 * 36871 * _.flatMapDeep([1, 2], duplicate); 36872 * // => [1, 1, 2, 2] 36873 */ 36874 function flatMapDeep(collection, iteratee) { 36875 return baseFlatten(map(collection, iteratee), INFINITY); 36876 } 36877 36878 /** 36879 * This method is like `_.flatMap` except that it recursively flattens the 36880 * mapped results up to `depth` times. 36881 * 36882 * @static 36883 * @memberOf _ 36884 * @since 4.7.0 36885 * @category Collection 36886 * @param {Array|Object} collection The collection to iterate over. 36887 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36888 * @param {number} [depth=1] The maximum recursion depth. 36889 * @returns {Array} Returns the new flattened array. 36890 * @example 36891 * 36892 * function duplicate(n) { 36893 * return [[[n, n]]]; 36894 * } 36895 * 36896 * _.flatMapDepth([1, 2], duplicate, 2); 36897 * // => [[1, 1], [2, 2]] 36898 */ 36899 function flatMapDepth(collection, iteratee, depth) { 36900 depth = depth === undefined ? 1 : toInteger(depth); 36901 return baseFlatten(map(collection, iteratee), depth); 36902 } 36903 36904 /** 36905 * Iterates over elements of `collection` and invokes `iteratee` for each element. 36906 * The iteratee is invoked with three arguments: (value, index|key, collection). 36907 * Iteratee functions may exit iteration early by explicitly returning `false`. 36908 * 36909 * **Note:** As with other "Collections" methods, objects with a "length" 36910 * property are iterated like arrays. To avoid this behavior use `_.forIn` 36911 * or `_.forOwn` for object iteration. 36912 * 36913 * @static 36914 * @memberOf _ 36915 * @since 0.1.0 36916 * @alias each 36917 * @category Collection 36918 * @param {Array|Object} collection The collection to iterate over. 36919 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36920 * @returns {Array|Object} Returns `collection`. 36921 * @see _.forEachRight 36922 * @example 36923 * 36924 * _.forEach([1, 2], function(value) { 36925 * console.log(value); 36926 * }); 36927 * // => Logs `1` then `2`. 36928 * 36929 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { 36930 * console.log(key); 36931 * }); 36932 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 36933 */ 36934 function forEach(collection, iteratee) { 36935 var func = isArray(collection) ? arrayEach : baseEach; 36936 return func(collection, getIteratee(iteratee, 3)); 36937 } 36938 36939 /** 36940 * This method is like `_.forEach` except that it iterates over elements of 36941 * `collection` from right to left. 36942 * 36943 * @static 36944 * @memberOf _ 36945 * @since 2.0.0 36946 * @alias eachRight 36947 * @category Collection 36948 * @param {Array|Object} collection The collection to iterate over. 36949 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36950 * @returns {Array|Object} Returns `collection`. 36951 * @see _.forEach 36952 * @example 36953 * 36954 * _.forEachRight([1, 2], function(value) { 36955 * console.log(value); 36956 * }); 36957 * // => Logs `2` then `1`. 36958 */ 36959 function forEachRight(collection, iteratee) { 36960 var func = isArray(collection) ? arrayEachRight : baseEachRight; 36961 return func(collection, getIteratee(iteratee, 3)); 36962 } 36963 36964 /** 36965 * Creates an object composed of keys generated from the results of running 36966 * each element of `collection` thru `iteratee`. The order of grouped values 36967 * is determined by the order they occur in `collection`. The corresponding 36968 * value of each key is an array of elements responsible for generating the 36969 * key. The iteratee is invoked with one argument: (value). 36970 * 36971 * @static 36972 * @memberOf _ 36973 * @since 0.1.0 36974 * @category Collection 36975 * @param {Array|Object} collection The collection to iterate over. 36976 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 36977 * @returns {Object} Returns the composed aggregate object. 36978 * @example 36979 * 36980 * _.groupBy([6.1, 4.2, 6.3], Math.floor); 36981 * // => { '4': [4.2], '6': [6.1, 6.3] } 36982 * 36983 * // The `_.property` iteratee shorthand. 36984 * _.groupBy(['one', 'two', 'three'], 'length'); 36985 * // => { '3': ['one', 'two'], '5': ['three'] } 36986 */ 36987 var groupBy = createAggregator(function(result, value, key) { 36988 if (hasOwnProperty.call(result, key)) { 36989 result[key].push(value); 36990 } else { 36991 baseAssignValue(result, key, [value]); 36992 } 36993 }); 36994 36995 /** 36996 * Checks if `value` is in `collection`. If `collection` is a string, it's 36997 * checked for a substring of `value`, otherwise 36998 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 36999 * is used for equality comparisons. If `fromIndex` is negative, it's used as 37000 * the offset from the end of `collection`. 37001 * 37002 * @static 37003 * @memberOf _ 37004 * @since 0.1.0 37005 * @category Collection 37006 * @param {Array|Object|string} collection The collection to inspect. 37007 * @param {*} value The value to search for. 37008 * @param {number} [fromIndex=0] The index to search from. 37009 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 37010 * @returns {boolean} Returns `true` if `value` is found, else `false`. 37011 * @example 37012 * 37013 * _.includes([1, 2, 3], 1); 37014 * // => true 37015 * 37016 * _.includes([1, 2, 3], 1, 2); 37017 * // => false 37018 * 37019 * _.includes({ 'a': 1, 'b': 2 }, 1); 37020 * // => true 37021 * 37022 * _.includes('abcd', 'bc'); 37023 * // => true 37024 */ 37025 function includes(collection, value, fromIndex, guard) { 37026 collection = isArrayLike(collection) ? collection : values(collection); 37027 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; 37028 37029 var length = collection.length; 37030 if (fromIndex < 0) { 37031 fromIndex = nativeMax(length + fromIndex, 0); 37032 } 37033 return isString(collection) 37034 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) 37035 : (!!length && baseIndexOf(collection, value, fromIndex) > -1); 37036 } 37037 37038 /** 37039 * Invokes the method at `path` of each element in `collection`, returning 37040 * an array of the results of each invoked method. Any additional arguments 37041 * are provided to each invoked method. If `path` is a function, it's invoked 37042 * for, and `this` bound to, each element in `collection`. 37043 * 37044 * @static 37045 * @memberOf _ 37046 * @since 4.0.0 37047 * @category Collection 37048 * @param {Array|Object} collection The collection to iterate over. 37049 * @param {Array|Function|string} path The path of the method to invoke or 37050 * the function invoked per iteration. 37051 * @param {...*} [args] The arguments to invoke each method with. 37052 * @returns {Array} Returns the array of results. 37053 * @example 37054 * 37055 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); 37056 * // => [[1, 5, 7], [1, 2, 3]] 37057 * 37058 * _.invokeMap([123, 456], String.prototype.split, ''); 37059 * // => [['1', '2', '3'], ['4', '5', '6']] 37060 */ 37061 var invokeMap = baseRest(function(collection, path, args) { 37062 var index = -1, 37063 isFunc = typeof path == 'function', 37064 result = isArrayLike(collection) ? Array(collection.length) : []; 37065 37066 baseEach(collection, function(value) { 37067 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); 37068 }); 37069 return result; 37070 }); 37071 37072 /** 37073 * Creates an object composed of keys generated from the results of running 37074 * each element of `collection` thru `iteratee`. The corresponding value of 37075 * each key is the last element responsible for generating the key. The 37076 * iteratee is invoked with one argument: (value). 37077 * 37078 * @static 37079 * @memberOf _ 37080 * @since 4.0.0 37081 * @category Collection 37082 * @param {Array|Object} collection The collection to iterate over. 37083 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 37084 * @returns {Object} Returns the composed aggregate object. 37085 * @example 37086 * 37087 * var array = [ 37088 * { 'dir': 'left', 'code': 97 }, 37089 * { 'dir': 'right', 'code': 100 } 37090 * ]; 37091 * 37092 * _.keyBy(array, function(o) { 37093 * return String.fromCharCode(o.code); 37094 * }); 37095 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } 37096 * 37097 * _.keyBy(array, 'dir'); 37098 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } 37099 */ 37100 var keyBy = createAggregator(function(result, value, key) { 37101 baseAssignValue(result, key, value); 37102 }); 37103 37104 /** 37105 * Creates an array of values by running each element in `collection` thru 37106 * `iteratee`. The iteratee is invoked with three arguments: 37107 * (value, index|key, collection). 37108 * 37109 * Many lodash methods are guarded to work as iteratees for methods like 37110 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 37111 * 37112 * The guarded methods are: 37113 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 37114 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 37115 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 37116 * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 37117 * 37118 * @static 37119 * @memberOf _ 37120 * @since 0.1.0 37121 * @category Collection 37122 * @param {Array|Object} collection The collection to iterate over. 37123 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 37124 * @returns {Array} Returns the new mapped array. 37125 * @example 37126 * 37127 * function square(n) { 37128 * return n * n; 37129 * } 37130 * 37131 * _.map([4, 8], square); 37132 * // => [16, 64] 37133 * 37134 * _.map({ 'a': 4, 'b': 8 }, square); 37135 * // => [16, 64] (iteration order is not guaranteed) 37136 * 37137 * var users = [ 37138 * { 'user': 'barney' }, 37139 * { 'user': 'fred' } 37140 * ]; 37141 * 37142 * // The `_.property` iteratee shorthand. 37143 * _.map(users, 'user'); 37144 * // => ['barney', 'fred'] 37145 */ 37146 function map(collection, iteratee) { 37147 var func = isArray(collection) ? arrayMap : baseMap; 37148 return func(collection, getIteratee(iteratee, 3)); 37149 } 37150 37151 /** 37152 * This method is like `_.sortBy` except that it allows specifying the sort 37153 * orders of the iteratees to sort by. If `orders` is unspecified, all values 37154 * are sorted in ascending order. Otherwise, specify an order of "desc" for 37155 * descending or "asc" for ascending sort order of corresponding values. 37156 * 37157 * @static 37158 * @memberOf _ 37159 * @since 4.0.0 37160 * @category Collection 37161 * @param {Array|Object} collection The collection to iterate over. 37162 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] 37163 * The iteratees to sort by. 37164 * @param {string[]} [orders] The sort orders of `iteratees`. 37165 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 37166 * @returns {Array} Returns the new sorted array. 37167 * @example 37168 * 37169 * var users = [ 37170 * { 'user': 'fred', 'age': 48 }, 37171 * { 'user': 'barney', 'age': 34 }, 37172 * { 'user': 'fred', 'age': 40 }, 37173 * { 'user': 'barney', 'age': 36 } 37174 * ]; 37175 * 37176 * // Sort by `user` in ascending order and by `age` in descending order. 37177 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); 37178 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] 37179 */ 37180 function orderBy(collection, iteratees, orders, guard) { 37181 if (collection == null) { 37182 return []; 37183 } 37184 if (!isArray(iteratees)) { 37185 iteratees = iteratees == null ? [] : [iteratees]; 37186 } 37187 orders = guard ? undefined : orders; 37188 if (!isArray(orders)) { 37189 orders = orders == null ? [] : [orders]; 37190 } 37191 return baseOrderBy(collection, iteratees, orders); 37192 } 37193 37194 /** 37195 * Creates an array of elements split into two groups, the first of which 37196 * contains elements `predicate` returns truthy for, the second of which 37197 * contains elements `predicate` returns falsey for. The predicate is 37198 * invoked with one argument: (value). 37199 * 37200 * @static 37201 * @memberOf _ 37202 * @since 3.0.0 37203 * @category Collection 37204 * @param {Array|Object} collection The collection to iterate over. 37205 * @param {Function} [predicate=_.identity] The function invoked per iteration. 37206 * @returns {Array} Returns the array of grouped elements. 37207 * @example 37208 * 37209 * var users = [ 37210 * { 'user': 'barney', 'age': 36, 'active': false }, 37211 * { 'user': 'fred', 'age': 40, 'active': true }, 37212 * { 'user': 'pebbles', 'age': 1, 'active': false } 37213 * ]; 37214 * 37215 * _.partition(users, function(o) { return o.active; }); 37216 * // => objects for [['fred'], ['barney', 'pebbles']] 37217 * 37218 * // The `_.matches` iteratee shorthand. 37219 * _.partition(users, { 'age': 1, 'active': false }); 37220 * // => objects for [['pebbles'], ['barney', 'fred']] 37221 * 37222 * // The `_.matchesProperty` iteratee shorthand. 37223 * _.partition(users, ['active', false]); 37224 * // => objects for [['barney', 'pebbles'], ['fred']] 37225 * 37226 * // The `_.property` iteratee shorthand. 37227 * _.partition(users, 'active'); 37228 * // => objects for [['fred'], ['barney', 'pebbles']] 37229 */ 37230 var partition = createAggregator(function(result, value, key) { 37231 result[key ? 0 : 1].push(value); 37232 }, function() { return [[], []]; }); 37233 37234 /** 37235 * Reduces `collection` to a value which is the accumulated result of running 37236 * each element in `collection` thru `iteratee`, where each successive 37237 * invocation is supplied the return value of the previous. If `accumulator` 37238 * is not given, the first element of `collection` is used as the initial 37239 * value. The iteratee is invoked with four arguments: 37240 * (accumulator, value, index|key, collection). 37241 * 37242 * Many lodash methods are guarded to work as iteratees for methods like 37243 * `_.reduce`, `_.reduceRight`, and `_.transform`. 37244 * 37245 * The guarded methods are: 37246 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, 37247 * and `sortBy` 37248 * 37249 * @static 37250 * @memberOf _ 37251 * @since 0.1.0 37252 * @category Collection 37253 * @param {Array|Object} collection The collection to iterate over. 37254 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 37255 * @param {*} [accumulator] The initial value. 37256 * @returns {*} Returns the accumulated value. 37257 * @see _.reduceRight 37258 * @example 37259 * 37260 * _.reduce([1, 2], function(sum, n) { 37261 * return sum + n; 37262 * }, 0); 37263 * // => 3 37264 * 37265 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 37266 * (result[value] || (result[value] = [])).push(key); 37267 * return result; 37268 * }, {}); 37269 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) 37270 */ 37271 function reduce(collection, iteratee, accumulator) { 37272 var func = isArray(collection) ? arrayReduce : baseReduce, 37273 initAccum = arguments.length < 3; 37274 37275 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); 37276 } 37277 37278 /** 37279 * This method is like `_.reduce` except that it iterates over elements of 37280 * `collection` from right to left. 37281 * 37282 * @static 37283 * @memberOf _ 37284 * @since 0.1.0 37285 * @category Collection 37286 * @param {Array|Object} collection The collection to iterate over. 37287 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 37288 * @param {*} [accumulator] The initial value. 37289 * @returns {*} Returns the accumulated value. 37290 * @see _.reduce 37291 * @example 37292 * 37293 * var array = [[0, 1], [2, 3], [4, 5]]; 37294 * 37295 * _.reduceRight(array, function(flattened, other) { 37296 * return flattened.concat(other); 37297 * }, []); 37298 * // => [4, 5, 2, 3, 0, 1] 37299 */ 37300 function reduceRight(collection, iteratee, accumulator) { 37301 var func = isArray(collection) ? arrayReduceRight : baseReduce, 37302 initAccum = arguments.length < 3; 37303 37304 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); 37305 } 37306 37307 /** 37308 * The opposite of `_.filter`; this method returns the elements of `collection` 37309 * that `predicate` does **not** return truthy for. 37310 * 37311 * @static 37312 * @memberOf _ 37313 * @since 0.1.0 37314 * @category Collection 37315 * @param {Array|Object} collection The collection to iterate over. 37316 * @param {Function} [predicate=_.identity] The function invoked per iteration. 37317 * @returns {Array} Returns the new filtered array. 37318 * @see _.filter 37319 * @example 37320 * 37321 * var users = [ 37322 * { 'user': 'barney', 'age': 36, 'active': false }, 37323 * { 'user': 'fred', 'age': 40, 'active': true } 37324 * ]; 37325 * 37326 * _.reject(users, function(o) { return !o.active; }); 37327 * // => objects for ['fred'] 37328 * 37329 * // The `_.matches` iteratee shorthand. 37330 * _.reject(users, { 'age': 40, 'active': true }); 37331 * // => objects for ['barney'] 37332 * 37333 * // The `_.matchesProperty` iteratee shorthand. 37334 * _.reject(users, ['active', false]); 37335 * // => objects for ['fred'] 37336 * 37337 * // The `_.property` iteratee shorthand. 37338 * _.reject(users, 'active'); 37339 * // => objects for ['barney'] 37340 */ 37341 function reject(collection, predicate) { 37342 var func = isArray(collection) ? arrayFilter : baseFilter; 37343 return func(collection, negate(getIteratee(predicate, 3))); 37344 } 37345 37346 /** 37347 * Gets a random element from `collection`. 37348 * 37349 * @static 37350 * @memberOf _ 37351 * @since 2.0.0 37352 * @category Collection 37353 * @param {Array|Object} collection The collection to sample. 37354 * @returns {*} Returns the random element. 37355 * @example 37356 * 37357 * _.sample([1, 2, 3, 4]); 37358 * // => 2 37359 */ 37360 function sample(collection) { 37361 var func = isArray(collection) ? arraySample : baseSample; 37362 return func(collection); 37363 } 37364 37365 /** 37366 * Gets `n` random elements at unique keys from `collection` up to the 37367 * size of `collection`. 37368 * 37369 * @static 37370 * @memberOf _ 37371 * @since 4.0.0 37372 * @category Collection 37373 * @param {Array|Object} collection The collection to sample. 37374 * @param {number} [n=1] The number of elements to sample. 37375 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37376 * @returns {Array} Returns the random elements. 37377 * @example 37378 * 37379 * _.sampleSize([1, 2, 3], 2); 37380 * // => [3, 1] 37381 * 37382 * _.sampleSize([1, 2, 3], 4); 37383 * // => [2, 3, 1] 37384 */ 37385 function sampleSize(collection, n, guard) { 37386 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { 37387 n = 1; 37388 } else { 37389 n = toInteger(n); 37390 } 37391 var func = isArray(collection) ? arraySampleSize : baseSampleSize; 37392 return func(collection, n); 37393 } 37394 37395 /** 37396 * Creates an array of shuffled values, using a version of the 37397 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). 37398 * 37399 * @static 37400 * @memberOf _ 37401 * @since 0.1.0 37402 * @category Collection 37403 * @param {Array|Object} collection The collection to shuffle. 37404 * @returns {Array} Returns the new shuffled array. 37405 * @example 37406 * 37407 * _.shuffle([1, 2, 3, 4]); 37408 * // => [4, 1, 3, 2] 37409 */ 37410 function shuffle(collection) { 37411 var func = isArray(collection) ? arrayShuffle : baseShuffle; 37412 return func(collection); 37413 } 37414 37415 /** 37416 * Gets the size of `collection` by returning its length for array-like 37417 * values or the number of own enumerable string keyed properties for objects. 37418 * 37419 * @static 37420 * @memberOf _ 37421 * @since 0.1.0 37422 * @category Collection 37423 * @param {Array|Object|string} collection The collection to inspect. 37424 * @returns {number} Returns the collection size. 37425 * @example 37426 * 37427 * _.size([1, 2, 3]); 37428 * // => 3 37429 * 37430 * _.size({ 'a': 1, 'b': 2 }); 37431 * // => 2 37432 * 37433 * _.size('pebbles'); 37434 * // => 7 37435 */ 37436 function size(collection) { 37437 if (collection == null) { 37438 return 0; 37439 } 37440 if (isArrayLike(collection)) { 37441 return isString(collection) ? stringSize(collection) : collection.length; 37442 } 37443 var tag = getTag(collection); 37444 if (tag == mapTag || tag == setTag) { 37445 return collection.size; 37446 } 37447 return baseKeys(collection).length; 37448 } 37449 37450 /** 37451 * Checks if `predicate` returns truthy for **any** element of `collection`. 37452 * Iteration is stopped once `predicate` returns truthy. The predicate is 37453 * invoked with three arguments: (value, index|key, collection). 37454 * 37455 * @static 37456 * @memberOf _ 37457 * @since 0.1.0 37458 * @category Collection 37459 * @param {Array|Object} collection The collection to iterate over. 37460 * @param {Function} [predicate=_.identity] The function invoked per iteration. 37461 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37462 * @returns {boolean} Returns `true` if any element passes the predicate check, 37463 * else `false`. 37464 * @example 37465 * 37466 * _.some([null, 0, 'yes', false], Boolean); 37467 * // => true 37468 * 37469 * var users = [ 37470 * { 'user': 'barney', 'active': true }, 37471 * { 'user': 'fred', 'active': false } 37472 * ]; 37473 * 37474 * // The `_.matches` iteratee shorthand. 37475 * _.some(users, { 'user': 'barney', 'active': false }); 37476 * // => false 37477 * 37478 * // The `_.matchesProperty` iteratee shorthand. 37479 * _.some(users, ['active', false]); 37480 * // => true 37481 * 37482 * // The `_.property` iteratee shorthand. 37483 * _.some(users, 'active'); 37484 * // => true 37485 */ 37486 function some(collection, predicate, guard) { 37487 var func = isArray(collection) ? arraySome : baseSome; 37488 if (guard && isIterateeCall(collection, predicate, guard)) { 37489 predicate = undefined; 37490 } 37491 return func(collection, getIteratee(predicate, 3)); 37492 } 37493 37494 /** 37495 * Creates an array of elements, sorted in ascending order by the results of 37496 * running each element in a collection thru each iteratee. This method 37497 * performs a stable sort, that is, it preserves the original sort order of 37498 * equal elements. The iteratees are invoked with one argument: (value). 37499 * 37500 * @static 37501 * @memberOf _ 37502 * @since 0.1.0 37503 * @category Collection 37504 * @param {Array|Object} collection The collection to iterate over. 37505 * @param {...(Function|Function[])} [iteratees=[_.identity]] 37506 * The iteratees to sort by. 37507 * @returns {Array} Returns the new sorted array. 37508 * @example 37509 * 37510 * var users = [ 37511 * { 'user': 'fred', 'age': 48 }, 37512 * { 'user': 'barney', 'age': 36 }, 37513 * { 'user': 'fred', 'age': 30 }, 37514 * { 'user': 'barney', 'age': 34 } 37515 * ]; 37516 * 37517 * _.sortBy(users, [function(o) { return o.user; }]); 37518 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] 37519 * 37520 * _.sortBy(users, ['user', 'age']); 37521 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] 37522 */ 37523 var sortBy = baseRest(function(collection, iteratees) { 37524 if (collection == null) { 37525 return []; 37526 } 37527 var length = iteratees.length; 37528 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { 37529 iteratees = []; 37530 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { 37531 iteratees = [iteratees[0]]; 37532 } 37533 return baseOrderBy(collection, baseFlatten(iteratees, 1), []); 37534 }); 37535 37536 /*------------------------------------------------------------------------*/ 37537 37538 /** 37539 * Gets the timestamp of the number of milliseconds that have elapsed since 37540 * the Unix epoch (1 January 1970 00:00:00 UTC). 37541 * 37542 * @static 37543 * @memberOf _ 37544 * @since 2.4.0 37545 * @category Date 37546 * @returns {number} Returns the timestamp. 37547 * @example 37548 * 37549 * _.defer(function(stamp) { 37550 * console.log(_.now() - stamp); 37551 * }, _.now()); 37552 * // => Logs the number of milliseconds it took for the deferred invocation. 37553 */ 37554 var now = ctxNow || function() { 37555 return root.Date.now(); 37556 }; 37557 37558 /*------------------------------------------------------------------------*/ 37559 37560 /** 37561 * The opposite of `_.before`; this method creates a function that invokes 37562 * `func` once it's called `n` or more times. 37563 * 37564 * @static 37565 * @memberOf _ 37566 * @since 0.1.0 37567 * @category Function 37568 * @param {number} n The number of calls before `func` is invoked. 37569 * @param {Function} func The function to restrict. 37570 * @returns {Function} Returns the new restricted function. 37571 * @example 37572 * 37573 * var saves = ['profile', 'settings']; 37574 * 37575 * var done = _.after(saves.length, function() { 37576 * console.log('done saving!'); 37577 * }); 37578 * 37579 * _.forEach(saves, function(type) { 37580 * asyncSave({ 'type': type, 'complete': done }); 37581 * }); 37582 * // => Logs 'done saving!' after the two async saves have completed. 37583 */ 37584 function after(n, func) { 37585 if (typeof func != 'function') { 37586 throw new TypeError(FUNC_ERROR_TEXT); 37587 } 37588 n = toInteger(n); 37589 return function() { 37590 if (--n < 1) { 37591 return func.apply(this, arguments); 37592 } 37593 }; 37594 } 37595 37596 /** 37597 * Creates a function that invokes `func`, with up to `n` arguments, 37598 * ignoring any additional arguments. 37599 * 37600 * @static 37601 * @memberOf _ 37602 * @since 3.0.0 37603 * @category Function 37604 * @param {Function} func The function to cap arguments for. 37605 * @param {number} [n=func.length] The arity cap. 37606 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37607 * @returns {Function} Returns the new capped function. 37608 * @example 37609 * 37610 * _.map(['6', '8', '10'], _.ary(parseInt, 1)); 37611 * // => [6, 8, 10] 37612 */ 37613 function ary(func, n, guard) { 37614 n = guard ? undefined : n; 37615 n = (func && n == null) ? func.length : n; 37616 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); 37617 } 37618 37619 /** 37620 * Creates a function that invokes `func`, with the `this` binding and arguments 37621 * of the created function, while it's called less than `n` times. Subsequent 37622 * calls to the created function return the result of the last `func` invocation. 37623 * 37624 * @static 37625 * @memberOf _ 37626 * @since 3.0.0 37627 * @category Function 37628 * @param {number} n The number of calls at which `func` is no longer invoked. 37629 * @param {Function} func The function to restrict. 37630 * @returns {Function} Returns the new restricted function. 37631 * @example 37632 * 37633 * jQuery(element).on('click', _.before(5, addContactToList)); 37634 * // => Allows adding up to 4 contacts to the list. 37635 */ 37636 function before(n, func) { 37637 var result; 37638 if (typeof func != 'function') { 37639 throw new TypeError(FUNC_ERROR_TEXT); 37640 } 37641 n = toInteger(n); 37642 return function() { 37643 if (--n > 0) { 37644 result = func.apply(this, arguments); 37645 } 37646 if (n <= 1) { 37647 func = undefined; 37648 } 37649 return result; 37650 }; 37651 } 37652 37653 /** 37654 * Creates a function that invokes `func` with the `this` binding of `thisArg` 37655 * and `partials` prepended to the arguments it receives. 37656 * 37657 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 37658 * may be used as a placeholder for partially applied arguments. 37659 * 37660 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" 37661 * property of bound functions. 37662 * 37663 * @static 37664 * @memberOf _ 37665 * @since 0.1.0 37666 * @category Function 37667 * @param {Function} func The function to bind. 37668 * @param {*} thisArg The `this` binding of `func`. 37669 * @param {...*} [partials] The arguments to be partially applied. 37670 * @returns {Function} Returns the new bound function. 37671 * @example 37672 * 37673 * function greet(greeting, punctuation) { 37674 * return greeting + ' ' + this.user + punctuation; 37675 * } 37676 * 37677 * var object = { 'user': 'fred' }; 37678 * 37679 * var bound = _.bind(greet, object, 'hi'); 37680 * bound('!'); 37681 * // => 'hi fred!' 37682 * 37683 * // Bound with placeholders. 37684 * var bound = _.bind(greet, object, _, '!'); 37685 * bound('hi'); 37686 * // => 'hi fred!' 37687 */ 37688 var bind = baseRest(function(func, thisArg, partials) { 37689 var bitmask = WRAP_BIND_FLAG; 37690 if (partials.length) { 37691 var holders = replaceHolders(partials, getHolder(bind)); 37692 bitmask |= WRAP_PARTIAL_FLAG; 37693 } 37694 return createWrap(func, bitmask, thisArg, partials, holders); 37695 }); 37696 37697 /** 37698 * Creates a function that invokes the method at `object[key]` with `partials` 37699 * prepended to the arguments it receives. 37700 * 37701 * This method differs from `_.bind` by allowing bound functions to reference 37702 * methods that may be redefined or don't yet exist. See 37703 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) 37704 * for more details. 37705 * 37706 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic 37707 * builds, may be used as a placeholder for partially applied arguments. 37708 * 37709 * @static 37710 * @memberOf _ 37711 * @since 0.10.0 37712 * @category Function 37713 * @param {Object} object The object to invoke the method on. 37714 * @param {string} key The key of the method. 37715 * @param {...*} [partials] The arguments to be partially applied. 37716 * @returns {Function} Returns the new bound function. 37717 * @example 37718 * 37719 * var object = { 37720 * 'user': 'fred', 37721 * 'greet': function(greeting, punctuation) { 37722 * return greeting + ' ' + this.user + punctuation; 37723 * } 37724 * }; 37725 * 37726 * var bound = _.bindKey(object, 'greet', 'hi'); 37727 * bound('!'); 37728 * // => 'hi fred!' 37729 * 37730 * object.greet = function(greeting, punctuation) { 37731 * return greeting + 'ya ' + this.user + punctuation; 37732 * }; 37733 * 37734 * bound('!'); 37735 * // => 'hiya fred!' 37736 * 37737 * // Bound with placeholders. 37738 * var bound = _.bindKey(object, 'greet', _, '!'); 37739 * bound('hi'); 37740 * // => 'hiya fred!' 37741 */ 37742 var bindKey = baseRest(function(object, key, partials) { 37743 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; 37744 if (partials.length) { 37745 var holders = replaceHolders(partials, getHolder(bindKey)); 37746 bitmask |= WRAP_PARTIAL_FLAG; 37747 } 37748 return createWrap(key, bitmask, object, partials, holders); 37749 }); 37750 37751 /** 37752 * Creates a function that accepts arguments of `func` and either invokes 37753 * `func` returning its result, if at least `arity` number of arguments have 37754 * been provided, or returns a function that accepts the remaining `func` 37755 * arguments, and so on. The arity of `func` may be specified if `func.length` 37756 * is not sufficient. 37757 * 37758 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, 37759 * may be used as a placeholder for provided arguments. 37760 * 37761 * **Note:** This method doesn't set the "length" property of curried functions. 37762 * 37763 * @static 37764 * @memberOf _ 37765 * @since 2.0.0 37766 * @category Function 37767 * @param {Function} func The function to curry. 37768 * @param {number} [arity=func.length] The arity of `func`. 37769 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37770 * @returns {Function} Returns the new curried function. 37771 * @example 37772 * 37773 * var abc = function(a, b, c) { 37774 * return [a, b, c]; 37775 * }; 37776 * 37777 * var curried = _.curry(abc); 37778 * 37779 * curried(1)(2)(3); 37780 * // => [1, 2, 3] 37781 * 37782 * curried(1, 2)(3); 37783 * // => [1, 2, 3] 37784 * 37785 * curried(1, 2, 3); 37786 * // => [1, 2, 3] 37787 * 37788 * // Curried with placeholders. 37789 * curried(1)(_, 3)(2); 37790 * // => [1, 2, 3] 37791 */ 37792 function curry(func, arity, guard) { 37793 arity = guard ? undefined : arity; 37794 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 37795 result.placeholder = curry.placeholder; 37796 return result; 37797 } 37798 37799 /** 37800 * This method is like `_.curry` except that arguments are applied to `func` 37801 * in the manner of `_.partialRight` instead of `_.partial`. 37802 * 37803 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic 37804 * builds, may be used as a placeholder for provided arguments. 37805 * 37806 * **Note:** This method doesn't set the "length" property of curried functions. 37807 * 37808 * @static 37809 * @memberOf _ 37810 * @since 3.0.0 37811 * @category Function 37812 * @param {Function} func The function to curry. 37813 * @param {number} [arity=func.length] The arity of `func`. 37814 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37815 * @returns {Function} Returns the new curried function. 37816 * @example 37817 * 37818 * var abc = function(a, b, c) { 37819 * return [a, b, c]; 37820 * }; 37821 * 37822 * var curried = _.curryRight(abc); 37823 * 37824 * curried(3)(2)(1); 37825 * // => [1, 2, 3] 37826 * 37827 * curried(2, 3)(1); 37828 * // => [1, 2, 3] 37829 * 37830 * curried(1, 2, 3); 37831 * // => [1, 2, 3] 37832 * 37833 * // Curried with placeholders. 37834 * curried(3)(1, _)(2); 37835 * // => [1, 2, 3] 37836 */ 37837 function curryRight(func, arity, guard) { 37838 arity = guard ? undefined : arity; 37839 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 37840 result.placeholder = curryRight.placeholder; 37841 return result; 37842 } 37843 37844 /** 37845 * Creates a debounced function that delays invoking `func` until after `wait` 37846 * milliseconds have elapsed since the last time the debounced function was 37847 * invoked. The debounced function comes with a `cancel` method to cancel 37848 * delayed `func` invocations and a `flush` method to immediately invoke them. 37849 * Provide `options` to indicate whether `func` should be invoked on the 37850 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 37851 * with the last arguments provided to the debounced function. Subsequent 37852 * calls to the debounced function return the result of the last `func` 37853 * invocation. 37854 * 37855 * **Note:** If `leading` and `trailing` options are `true`, `func` is 37856 * invoked on the trailing edge of the timeout only if the debounced function 37857 * is invoked more than once during the `wait` timeout. 37858 * 37859 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 37860 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 37861 * 37862 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 37863 * for details over the differences between `_.debounce` and `_.throttle`. 37864 * 37865 * @static 37866 * @memberOf _ 37867 * @since 0.1.0 37868 * @category Function 37869 * @param {Function} func The function to debounce. 37870 * @param {number} [wait=0] The number of milliseconds to delay. 37871 * @param {Object} [options={}] The options object. 37872 * @param {boolean} [options.leading=false] 37873 * Specify invoking on the leading edge of the timeout. 37874 * @param {number} [options.maxWait] 37875 * The maximum time `func` is allowed to be delayed before it's invoked. 37876 * @param {boolean} [options.trailing=true] 37877 * Specify invoking on the trailing edge of the timeout. 37878 * @returns {Function} Returns the new debounced function. 37879 * @example 37880 * 37881 * // Avoid costly calculations while the window size is in flux. 37882 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 37883 * 37884 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 37885 * jQuery(element).on('click', _.debounce(sendMail, 300, { 37886 * 'leading': true, 37887 * 'trailing': false 37888 * })); 37889 * 37890 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 37891 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 37892 * var source = new EventSource('/stream'); 37893 * jQuery(source).on('message', debounced); 37894 * 37895 * // Cancel the trailing debounced invocation. 37896 * jQuery(window).on('popstate', debounced.cancel); 37897 */ 37898 function debounce(func, wait, options) { 37899 var lastArgs, 37900 lastThis, 37901 maxWait, 37902 result, 37903 timerId, 37904 lastCallTime, 37905 lastInvokeTime = 0, 37906 leading = false, 37907 maxing = false, 37908 trailing = true; 37909 37910 if (typeof func != 'function') { 37911 throw new TypeError(FUNC_ERROR_TEXT); 37912 } 37913 wait = toNumber(wait) || 0; 37914 if (isObject(options)) { 37915 leading = !!options.leading; 37916 maxing = 'maxWait' in options; 37917 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 37918 trailing = 'trailing' in options ? !!options.trailing : trailing; 37919 } 37920 37921 function invokeFunc(time) { 37922 var args = lastArgs, 37923 thisArg = lastThis; 37924 37925 lastArgs = lastThis = undefined; 37926 lastInvokeTime = time; 37927 result = func.apply(thisArg, args); 37928 return result; 37929 } 37930 37931 function leadingEdge(time) { 37932 // Reset any `maxWait` timer. 37933 lastInvokeTime = time; 37934 // Start the timer for the trailing edge. 37935 timerId = setTimeout(timerExpired, wait); 37936 // Invoke the leading edge. 37937 return leading ? invokeFunc(time) : result; 37938 } 37939 37940 function remainingWait(time) { 37941 var timeSinceLastCall = time - lastCallTime, 37942 timeSinceLastInvoke = time - lastInvokeTime, 37943 timeWaiting = wait - timeSinceLastCall; 37944 37945 return maxing 37946 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) 37947 : timeWaiting; 37948 } 37949 37950 function shouldInvoke(time) { 37951 var timeSinceLastCall = time - lastCallTime, 37952 timeSinceLastInvoke = time - lastInvokeTime; 37953 37954 // Either this is the first call, activity has stopped and we're at the 37955 // trailing edge, the system time has gone backwards and we're treating 37956 // it as the trailing edge, or we've hit the `maxWait` limit. 37957 return (lastCallTime === undefined || (timeSinceLastCall >= wait) || 37958 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); 37959 } 37960 37961 function timerExpired() { 37962 var time = now(); 37963 if (shouldInvoke(time)) { 37964 return trailingEdge(time); 37965 } 37966 // Restart the timer. 37967 timerId = setTimeout(timerExpired, remainingWait(time)); 37968 } 37969 37970 function trailingEdge(time) { 37971 timerId = undefined; 37972 37973 // Only invoke if we have `lastArgs` which means `func` has been 37974 // debounced at least once. 37975 if (trailing && lastArgs) { 37976 return invokeFunc(time); 37977 } 37978 lastArgs = lastThis = undefined; 37979 return result; 37980 } 37981 37982 function cancel() { 37983 if (timerId !== undefined) { 37984 clearTimeout(timerId); 37985 } 37986 lastInvokeTime = 0; 37987 lastArgs = lastCallTime = lastThis = timerId = undefined; 37988 } 37989 37990 function flush() { 37991 return timerId === undefined ? result : trailingEdge(now()); 37992 } 37993 37994 function debounced() { 37995 var time = now(), 37996 isInvoking = shouldInvoke(time); 37997 37998 lastArgs = arguments; 37999 lastThis = this; 38000 lastCallTime = time; 38001 38002 if (isInvoking) { 38003 if (timerId === undefined) { 38004 return leadingEdge(lastCallTime); 38005 } 38006 if (maxing) { 38007 // Handle invocations in a tight loop. 38008 clearTimeout(timerId); 38009 timerId = setTimeout(timerExpired, wait); 38010 return invokeFunc(lastCallTime); 38011 } 38012 } 38013 if (timerId === undefined) { 38014 timerId = setTimeout(timerExpired, wait); 38015 } 38016 return result; 38017 } 38018 debounced.cancel = cancel; 38019 debounced.flush = flush; 38020 return debounced; 38021 } 38022 38023 /** 38024 * Defers invoking the `func` until the current call stack has cleared. Any 38025 * additional arguments are provided to `func` when it's invoked. 38026 * 38027 * @static 38028 * @memberOf _ 38029 * @since 0.1.0 38030 * @category Function 38031 * @param {Function} func The function to defer. 38032 * @param {...*} [args] The arguments to invoke `func` with. 38033 * @returns {number} Returns the timer id. 38034 * @example 38035 * 38036 * _.defer(function(text) { 38037 * console.log(text); 38038 * }, 'deferred'); 38039 * // => Logs 'deferred' after one millisecond. 38040 */ 38041 var defer = baseRest(function(func, args) { 38042 return baseDelay(func, 1, args); 38043 }); 38044 38045 /** 38046 * Invokes `func` after `wait` milliseconds. Any additional arguments are 38047 * provided to `func` when it's invoked. 38048 * 38049 * @static 38050 * @memberOf _ 38051 * @since 0.1.0 38052 * @category Function 38053 * @param {Function} func The function to delay. 38054 * @param {number} wait The number of milliseconds to delay invocation. 38055 * @param {...*} [args] The arguments to invoke `func` with. 38056 * @returns {number} Returns the timer id. 38057 * @example 38058 * 38059 * _.delay(function(text) { 38060 * console.log(text); 38061 * }, 1000, 'later'); 38062 * // => Logs 'later' after one second. 38063 */ 38064 var delay = baseRest(function(func, wait, args) { 38065 return baseDelay(func, toNumber(wait) || 0, args); 38066 }); 38067 38068 /** 38069 * Creates a function that invokes `func` with arguments reversed. 38070 * 38071 * @static 38072 * @memberOf _ 38073 * @since 4.0.0 38074 * @category Function 38075 * @param {Function} func The function to flip arguments for. 38076 * @returns {Function} Returns the new flipped function. 38077 * @example 38078 * 38079 * var flipped = _.flip(function() { 38080 * return _.toArray(arguments); 38081 * }); 38082 * 38083 * flipped('a', 'b', 'c', 'd'); 38084 * // => ['d', 'c', 'b', 'a'] 38085 */ 38086 function flip(func) { 38087 return createWrap(func, WRAP_FLIP_FLAG); 38088 } 38089 38090 /** 38091 * Creates a function that memoizes the result of `func`. If `resolver` is 38092 * provided, it determines the cache key for storing the result based on the 38093 * arguments provided to the memoized function. By default, the first argument 38094 * provided to the memoized function is used as the map cache key. The `func` 38095 * is invoked with the `this` binding of the memoized function. 38096 * 38097 * **Note:** The cache is exposed as the `cache` property on the memoized 38098 * function. Its creation may be customized by replacing the `_.memoize.Cache` 38099 * constructor with one whose instances implement the 38100 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 38101 * method interface of `clear`, `delete`, `get`, `has`, and `set`. 38102 * 38103 * @static 38104 * @memberOf _ 38105 * @since 0.1.0 38106 * @category Function 38107 * @param {Function} func The function to have its output memoized. 38108 * @param {Function} [resolver] The function to resolve the cache key. 38109 * @returns {Function} Returns the new memoized function. 38110 * @example 38111 * 38112 * var object = { 'a': 1, 'b': 2 }; 38113 * var other = { 'c': 3, 'd': 4 }; 38114 * 38115 * var values = _.memoize(_.values); 38116 * values(object); 38117 * // => [1, 2] 38118 * 38119 * values(other); 38120 * // => [3, 4] 38121 * 38122 * object.a = 2; 38123 * values(object); 38124 * // => [1, 2] 38125 * 38126 * // Modify the result cache. 38127 * values.cache.set(object, ['a', 'b']); 38128 * values(object); 38129 * // => ['a', 'b'] 38130 * 38131 * // Replace `_.memoize.Cache`. 38132 * _.memoize.Cache = WeakMap; 38133 */ 38134 function memoize(func, resolver) { 38135 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { 38136 throw new TypeError(FUNC_ERROR_TEXT); 38137 } 38138 var memoized = function() { 38139 var args = arguments, 38140 key = resolver ? resolver.apply(this, args) : args[0], 38141 cache = memoized.cache; 38142 38143 if (cache.has(key)) { 38144 return cache.get(key); 38145 } 38146 var result = func.apply(this, args); 38147 memoized.cache = cache.set(key, result) || cache; 38148 return result; 38149 }; 38150 memoized.cache = new (memoize.Cache || MapCache); 38151 return memoized; 38152 } 38153 38154 // Expose `MapCache`. 38155 memoize.Cache = MapCache; 38156 38157 /** 38158 * Creates a function that negates the result of the predicate `func`. The 38159 * `func` predicate is invoked with the `this` binding and arguments of the 38160 * created function. 38161 * 38162 * @static 38163 * @memberOf _ 38164 * @since 3.0.0 38165 * @category Function 38166 * @param {Function} predicate The predicate to negate. 38167 * @returns {Function} Returns the new negated function. 38168 * @example 38169 * 38170 * function isEven(n) { 38171 * return n % 2 == 0; 38172 * } 38173 * 38174 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 38175 * // => [1, 3, 5] 38176 */ 38177 function negate(predicate) { 38178 if (typeof predicate != 'function') { 38179 throw new TypeError(FUNC_ERROR_TEXT); 38180 } 38181 return function() { 38182 var args = arguments; 38183 switch (args.length) { 38184 case 0: return !predicate.call(this); 38185 case 1: return !predicate.call(this, args[0]); 38186 case 2: return !predicate.call(this, args[0], args[1]); 38187 case 3: return !predicate.call(this, args[0], args[1], args[2]); 38188 } 38189 return !predicate.apply(this, args); 38190 }; 38191 } 38192 38193 /** 38194 * Creates a function that is restricted to invoking `func` once. Repeat calls 38195 * to the function return the value of the first invocation. The `func` is 38196 * invoked with the `this` binding and arguments of the created function. 38197 * 38198 * @static 38199 * @memberOf _ 38200 * @since 0.1.0 38201 * @category Function 38202 * @param {Function} func The function to restrict. 38203 * @returns {Function} Returns the new restricted function. 38204 * @example 38205 * 38206 * var initialize = _.once(createApplication); 38207 * initialize(); 38208 * initialize(); 38209 * // => `createApplication` is invoked once 38210 */ 38211 function once(func) { 38212 return before(2, func); 38213 } 38214 38215 /** 38216 * Creates a function that invokes `func` with its arguments transformed. 38217 * 38218 * @static 38219 * @since 4.0.0 38220 * @memberOf _ 38221 * @category Function 38222 * @param {Function} func The function to wrap. 38223 * @param {...(Function|Function[])} [transforms=[_.identity]] 38224 * The argument transforms. 38225 * @returns {Function} Returns the new function. 38226 * @example 38227 * 38228 * function doubled(n) { 38229 * return n * 2; 38230 * } 38231 * 38232 * function square(n) { 38233 * return n * n; 38234 * } 38235 * 38236 * var func = _.overArgs(function(x, y) { 38237 * return [x, y]; 38238 * }, [square, doubled]); 38239 * 38240 * func(9, 3); 38241 * // => [81, 6] 38242 * 38243 * func(10, 5); 38244 * // => [100, 10] 38245 */ 38246 var overArgs = castRest(function(func, transforms) { 38247 transforms = (transforms.length == 1 && isArray(transforms[0])) 38248 ? arrayMap(transforms[0], baseUnary(getIteratee())) 38249 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); 38250 38251 var funcsLength = transforms.length; 38252 return baseRest(function(args) { 38253 var index = -1, 38254 length = nativeMin(args.length, funcsLength); 38255 38256 while (++index < length) { 38257 args[index] = transforms[index].call(this, args[index]); 38258 } 38259 return apply(func, this, args); 38260 }); 38261 }); 38262 38263 /** 38264 * Creates a function that invokes `func` with `partials` prepended to the 38265 * arguments it receives. This method is like `_.bind` except it does **not** 38266 * alter the `this` binding. 38267 * 38268 * The `_.partial.placeholder` value, which defaults to `_` in monolithic 38269 * builds, may be used as a placeholder for partially applied arguments. 38270 * 38271 * **Note:** This method doesn't set the "length" property of partially 38272 * applied functions. 38273 * 38274 * @static 38275 * @memberOf _ 38276 * @since 0.2.0 38277 * @category Function 38278 * @param {Function} func The function to partially apply arguments to. 38279 * @param {...*} [partials] The arguments to be partially applied. 38280 * @returns {Function} Returns the new partially applied function. 38281 * @example 38282 * 38283 * function greet(greeting, name) { 38284 * return greeting + ' ' + name; 38285 * } 38286 * 38287 * var sayHelloTo = _.partial(greet, 'hello'); 38288 * sayHelloTo('fred'); 38289 * // => 'hello fred' 38290 * 38291 * // Partially applied with placeholders. 38292 * var greetFred = _.partial(greet, _, 'fred'); 38293 * greetFred('hi'); 38294 * // => 'hi fred' 38295 */ 38296 var partial = baseRest(function(func, partials) { 38297 var holders = replaceHolders(partials, getHolder(partial)); 38298 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); 38299 }); 38300 38301 /** 38302 * This method is like `_.partial` except that partially applied arguments 38303 * are appended to the arguments it receives. 38304 * 38305 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic 38306 * builds, may be used as a placeholder for partially applied arguments. 38307 * 38308 * **Note:** This method doesn't set the "length" property of partially 38309 * applied functions. 38310 * 38311 * @static 38312 * @memberOf _ 38313 * @since 1.0.0 38314 * @category Function 38315 * @param {Function} func The function to partially apply arguments to. 38316 * @param {...*} [partials] The arguments to be partially applied. 38317 * @returns {Function} Returns the new partially applied function. 38318 * @example 38319 * 38320 * function greet(greeting, name) { 38321 * return greeting + ' ' + name; 38322 * } 38323 * 38324 * var greetFred = _.partialRight(greet, 'fred'); 38325 * greetFred('hi'); 38326 * // => 'hi fred' 38327 * 38328 * // Partially applied with placeholders. 38329 * var sayHelloTo = _.partialRight(greet, 'hello', _); 38330 * sayHelloTo('fred'); 38331 * // => 'hello fred' 38332 */ 38333 var partialRight = baseRest(function(func, partials) { 38334 var holders = replaceHolders(partials, getHolder(partialRight)); 38335 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); 38336 }); 38337 38338 /** 38339 * Creates a function that invokes `func` with arguments arranged according 38340 * to the specified `indexes` where the argument value at the first index is 38341 * provided as the first argument, the argument value at the second index is 38342 * provided as the second argument, and so on. 38343 * 38344 * @static 38345 * @memberOf _ 38346 * @since 3.0.0 38347 * @category Function 38348 * @param {Function} func The function to rearrange arguments for. 38349 * @param {...(number|number[])} indexes The arranged argument indexes. 38350 * @returns {Function} Returns the new function. 38351 * @example 38352 * 38353 * var rearged = _.rearg(function(a, b, c) { 38354 * return [a, b, c]; 38355 * }, [2, 0, 1]); 38356 * 38357 * rearged('b', 'c', 'a') 38358 * // => ['a', 'b', 'c'] 38359 */ 38360 var rearg = flatRest(function(func, indexes) { 38361 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); 38362 }); 38363 38364 /** 38365 * Creates a function that invokes `func` with the `this` binding of the 38366 * created function and arguments from `start` and beyond provided as 38367 * an array. 38368 * 38369 * **Note:** This method is based on the 38370 * [rest parameter](https://mdn.io/rest_parameters). 38371 * 38372 * @static 38373 * @memberOf _ 38374 * @since 4.0.0 38375 * @category Function 38376 * @param {Function} func The function to apply a rest parameter to. 38377 * @param {number} [start=func.length-1] The start position of the rest parameter. 38378 * @returns {Function} Returns the new function. 38379 * @example 38380 * 38381 * var say = _.rest(function(what, names) { 38382 * return what + ' ' + _.initial(names).join(', ') + 38383 * (_.size(names) > 1 ? ', & ' : '') + _.last(names); 38384 * }); 38385 * 38386 * say('hello', 'fred', 'barney', 'pebbles'); 38387 * // => 'hello fred, barney, & pebbles' 38388 */ 38389 function rest(func, start) { 38390 if (typeof func != 'function') { 38391 throw new TypeError(FUNC_ERROR_TEXT); 38392 } 38393 start = start === undefined ? start : toInteger(start); 38394 return baseRest(func, start); 38395 } 38396 38397 /** 38398 * Creates a function that invokes `func` with the `this` binding of the 38399 * create function and an array of arguments much like 38400 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). 38401 * 38402 * **Note:** This method is based on the 38403 * [spread operator](https://mdn.io/spread_operator). 38404 * 38405 * @static 38406 * @memberOf _ 38407 * @since 3.2.0 38408 * @category Function 38409 * @param {Function} func The function to spread arguments over. 38410 * @param {number} [start=0] The start position of the spread. 38411 * @returns {Function} Returns the new function. 38412 * @example 38413 * 38414 * var say = _.spread(function(who, what) { 38415 * return who + ' says ' + what; 38416 * }); 38417 * 38418 * say(['fred', 'hello']); 38419 * // => 'fred says hello' 38420 * 38421 * var numbers = Promise.all([ 38422 * Promise.resolve(40), 38423 * Promise.resolve(36) 38424 * ]); 38425 * 38426 * numbers.then(_.spread(function(x, y) { 38427 * return x + y; 38428 * })); 38429 * // => a Promise of 76 38430 */ 38431 function spread(func, start) { 38432 if (typeof func != 'function') { 38433 throw new TypeError(FUNC_ERROR_TEXT); 38434 } 38435 start = start == null ? 0 : nativeMax(toInteger(start), 0); 38436 return baseRest(function(args) { 38437 var array = args[start], 38438 otherArgs = castSlice(args, 0, start); 38439 38440 if (array) { 38441 arrayPush(otherArgs, array); 38442 } 38443 return apply(func, this, otherArgs); 38444 }); 38445 } 38446 38447 /** 38448 * Creates a throttled function that only invokes `func` at most once per 38449 * every `wait` milliseconds. The throttled function comes with a `cancel` 38450 * method to cancel delayed `func` invocations and a `flush` method to 38451 * immediately invoke them. Provide `options` to indicate whether `func` 38452 * should be invoked on the leading and/or trailing edge of the `wait` 38453 * timeout. The `func` is invoked with the last arguments provided to the 38454 * throttled function. Subsequent calls to the throttled function return the 38455 * result of the last `func` invocation. 38456 * 38457 * **Note:** If `leading` and `trailing` options are `true`, `func` is 38458 * invoked on the trailing edge of the timeout only if the throttled function 38459 * is invoked more than once during the `wait` timeout. 38460 * 38461 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 38462 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 38463 * 38464 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 38465 * for details over the differences between `_.throttle` and `_.debounce`. 38466 * 38467 * @static 38468 * @memberOf _ 38469 * @since 0.1.0 38470 * @category Function 38471 * @param {Function} func The function to throttle. 38472 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 38473 * @param {Object} [options={}] The options object. 38474 * @param {boolean} [options.leading=true] 38475 * Specify invoking on the leading edge of the timeout. 38476 * @param {boolean} [options.trailing=true] 38477 * Specify invoking on the trailing edge of the timeout. 38478 * @returns {Function} Returns the new throttled function. 38479 * @example 38480 * 38481 * // Avoid excessively updating the position while scrolling. 38482 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 38483 * 38484 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 38485 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 38486 * jQuery(element).on('click', throttled); 38487 * 38488 * // Cancel the trailing throttled invocation. 38489 * jQuery(window).on('popstate', throttled.cancel); 38490 */ 38491 function throttle(func, wait, options) { 38492 var leading = true, 38493 trailing = true; 38494 38495 if (typeof func != 'function') { 38496 throw new TypeError(FUNC_ERROR_TEXT); 38497 } 38498 if (isObject(options)) { 38499 leading = 'leading' in options ? !!options.leading : leading; 38500 trailing = 'trailing' in options ? !!options.trailing : trailing; 38501 } 38502 return debounce(func, wait, { 38503 'leading': leading, 38504 'maxWait': wait, 38505 'trailing': trailing 38506 }); 38507 } 38508 38509 /** 38510 * Creates a function that accepts up to one argument, ignoring any 38511 * additional arguments. 38512 * 38513 * @static 38514 * @memberOf _ 38515 * @since 4.0.0 38516 * @category Function 38517 * @param {Function} func The function to cap arguments for. 38518 * @returns {Function} Returns the new capped function. 38519 * @example 38520 * 38521 * _.map(['6', '8', '10'], _.unary(parseInt)); 38522 * // => [6, 8, 10] 38523 */ 38524 function unary(func) { 38525 return ary(func, 1); 38526 } 38527 38528 /** 38529 * Creates a function that provides `value` to `wrapper` as its first 38530 * argument. Any additional arguments provided to the function are appended 38531 * to those provided to the `wrapper`. The wrapper is invoked with the `this` 38532 * binding of the created function. 38533 * 38534 * @static 38535 * @memberOf _ 38536 * @since 0.1.0 38537 * @category Function 38538 * @param {*} value The value to wrap. 38539 * @param {Function} [wrapper=identity] The wrapper function. 38540 * @returns {Function} Returns the new function. 38541 * @example 38542 * 38543 * var p = _.wrap(_.escape, function(func, text) { 38544 * return '<p>' + func(text) + '</p>'; 38545 * }); 38546 * 38547 * p('fred, barney, & pebbles'); 38548 * // => '<p>fred, barney, & pebbles</p>' 38549 */ 38550 function wrap(value, wrapper) { 38551 return partial(castFunction(wrapper), value); 38552 } 38553 38554 /*------------------------------------------------------------------------*/ 38555 38556 /** 38557 * Casts `value` as an array if it's not one. 38558 * 38559 * @static 38560 * @memberOf _ 38561 * @since 4.4.0 38562 * @category Lang 38563 * @param {*} value The value to inspect. 38564 * @returns {Array} Returns the cast array. 38565 * @example 38566 * 38567 * _.castArray(1); 38568 * // => [1] 38569 * 38570 * _.castArray({ 'a': 1 }); 38571 * // => [{ 'a': 1 }] 38572 * 38573 * _.castArray('abc'); 38574 * // => ['abc'] 38575 * 38576 * _.castArray(null); 38577 * // => [null] 38578 * 38579 * _.castArray(undefined); 38580 * // => [undefined] 38581 * 38582 * _.castArray(); 38583 * // => [] 38584 * 38585 * var array = [1, 2, 3]; 38586 * console.log(_.castArray(array) === array); 38587 * // => true 38588 */ 38589 function castArray() { 38590 if (!arguments.length) { 38591 return []; 38592 } 38593 var value = arguments[0]; 38594 return isArray(value) ? value : [value]; 38595 } 38596 38597 /** 38598 * Creates a shallow clone of `value`. 38599 * 38600 * **Note:** This method is loosely based on the 38601 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 38602 * and supports cloning arrays, array buffers, booleans, date objects, maps, 38603 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 38604 * arrays. The own enumerable properties of `arguments` objects are cloned 38605 * as plain objects. An empty object is returned for uncloneable values such 38606 * as error objects, functions, DOM nodes, and WeakMaps. 38607 * 38608 * @static 38609 * @memberOf _ 38610 * @since 0.1.0 38611 * @category Lang 38612 * @param {*} value The value to clone. 38613 * @returns {*} Returns the cloned value. 38614 * @see _.cloneDeep 38615 * @example 38616 * 38617 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 38618 * 38619 * var shallow = _.clone(objects); 38620 * console.log(shallow[0] === objects[0]); 38621 * // => true 38622 */ 38623 function clone(value) { 38624 return baseClone(value, CLONE_SYMBOLS_FLAG); 38625 } 38626 38627 /** 38628 * This method is like `_.clone` except that it accepts `customizer` which 38629 * is invoked to produce the cloned value. If `customizer` returns `undefined`, 38630 * cloning is handled by the method instead. The `customizer` is invoked with 38631 * up to four arguments; (value [, index|key, object, stack]). 38632 * 38633 * @static 38634 * @memberOf _ 38635 * @since 4.0.0 38636 * @category Lang 38637 * @param {*} value The value to clone. 38638 * @param {Function} [customizer] The function to customize cloning. 38639 * @returns {*} Returns the cloned value. 38640 * @see _.cloneDeepWith 38641 * @example 38642 * 38643 * function customizer(value) { 38644 * if (_.isElement(value)) { 38645 * return value.cloneNode(false); 38646 * } 38647 * } 38648 * 38649 * var el = _.cloneWith(document.body, customizer); 38650 * 38651 * console.log(el === document.body); 38652 * // => false 38653 * console.log(el.nodeName); 38654 * // => 'BODY' 38655 * console.log(el.childNodes.length); 38656 * // => 0 38657 */ 38658 function cloneWith(value, customizer) { 38659 customizer = typeof customizer == 'function' ? customizer : undefined; 38660 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); 38661 } 38662 38663 /** 38664 * This method is like `_.clone` except that it recursively clones `value`. 38665 * 38666 * @static 38667 * @memberOf _ 38668 * @since 1.0.0 38669 * @category Lang 38670 * @param {*} value The value to recursively clone. 38671 * @returns {*} Returns the deep cloned value. 38672 * @see _.clone 38673 * @example 38674 * 38675 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 38676 * 38677 * var deep = _.cloneDeep(objects); 38678 * console.log(deep[0] === objects[0]); 38679 * // => false 38680 */ 38681 function cloneDeep(value) { 38682 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 38683 } 38684 38685 /** 38686 * This method is like `_.cloneWith` except that it recursively clones `value`. 38687 * 38688 * @static 38689 * @memberOf _ 38690 * @since 4.0.0 38691 * @category Lang 38692 * @param {*} value The value to recursively clone. 38693 * @param {Function} [customizer] The function to customize cloning. 38694 * @returns {*} Returns the deep cloned value. 38695 * @see _.cloneWith 38696 * @example 38697 * 38698 * function customizer(value) { 38699 * if (_.isElement(value)) { 38700 * return value.cloneNode(true); 38701 * } 38702 * } 38703 * 38704 * var el = _.cloneDeepWith(document.body, customizer); 38705 * 38706 * console.log(el === document.body); 38707 * // => false 38708 * console.log(el.nodeName); 38709 * // => 'BODY' 38710 * console.log(el.childNodes.length); 38711 * // => 20 38712 */ 38713 function cloneDeepWith(value, customizer) { 38714 customizer = typeof customizer == 'function' ? customizer : undefined; 38715 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); 38716 } 38717 38718 /** 38719 * Checks if `object` conforms to `source` by invoking the predicate 38720 * properties of `source` with the corresponding property values of `object`. 38721 * 38722 * **Note:** This method is equivalent to `_.conforms` when `source` is 38723 * partially applied. 38724 * 38725 * @static 38726 * @memberOf _ 38727 * @since 4.14.0 38728 * @category Lang 38729 * @param {Object} object The object to inspect. 38730 * @param {Object} source The object of property predicates to conform to. 38731 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 38732 * @example 38733 * 38734 * var object = { 'a': 1, 'b': 2 }; 38735 * 38736 * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); 38737 * // => true 38738 * 38739 * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); 38740 * // => false 38741 */ 38742 function conformsTo(object, source) { 38743 return source == null || baseConformsTo(object, source, keys(source)); 38744 } 38745 38746 /** 38747 * Performs a 38748 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 38749 * comparison between two values to determine if they are equivalent. 38750 * 38751 * @static 38752 * @memberOf _ 38753 * @since 4.0.0 38754 * @category Lang 38755 * @param {*} value The value to compare. 38756 * @param {*} other The other value to compare. 38757 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 38758 * @example 38759 * 38760 * var object = { 'a': 1 }; 38761 * var other = { 'a': 1 }; 38762 * 38763 * _.eq(object, object); 38764 * // => true 38765 * 38766 * _.eq(object, other); 38767 * // => false 38768 * 38769 * _.eq('a', 'a'); 38770 * // => true 38771 * 38772 * _.eq('a', Object('a')); 38773 * // => false 38774 * 38775 * _.eq(NaN, NaN); 38776 * // => true 38777 */ 38778 function eq(value, other) { 38779 return value === other || (value !== value && other !== other); 38780 } 38781 38782 /** 38783 * Checks if `value` is greater than `other`. 38784 * 38785 * @static 38786 * @memberOf _ 38787 * @since 3.9.0 38788 * @category Lang 38789 * @param {*} value The value to compare. 38790 * @param {*} other The other value to compare. 38791 * @returns {boolean} Returns `true` if `value` is greater than `other`, 38792 * else `false`. 38793 * @see _.lt 38794 * @example 38795 * 38796 * _.gt(3, 1); 38797 * // => true 38798 * 38799 * _.gt(3, 3); 38800 * // => false 38801 * 38802 * _.gt(1, 3); 38803 * // => false 38804 */ 38805 var gt = createRelationalOperation(baseGt); 38806 38807 /** 38808 * Checks if `value` is greater than or equal to `other`. 38809 * 38810 * @static 38811 * @memberOf _ 38812 * @since 3.9.0 38813 * @category Lang 38814 * @param {*} value The value to compare. 38815 * @param {*} other The other value to compare. 38816 * @returns {boolean} Returns `true` if `value` is greater than or equal to 38817 * `other`, else `false`. 38818 * @see _.lte 38819 * @example 38820 * 38821 * _.gte(3, 1); 38822 * // => true 38823 * 38824 * _.gte(3, 3); 38825 * // => true 38826 * 38827 * _.gte(1, 3); 38828 * // => false 38829 */ 38830 var gte = createRelationalOperation(function(value, other) { 38831 return value >= other; 38832 }); 38833 38834 /** 38835 * Checks if `value` is likely an `arguments` object. 38836 * 38837 * @static 38838 * @memberOf _ 38839 * @since 0.1.0 38840 * @category Lang 38841 * @param {*} value The value to check. 38842 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 38843 * else `false`. 38844 * @example 38845 * 38846 * _.isArguments(function() { return arguments; }()); 38847 * // => true 38848 * 38849 * _.isArguments([1, 2, 3]); 38850 * // => false 38851 */ 38852 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 38853 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 38854 !propertyIsEnumerable.call(value, 'callee'); 38855 }; 38856 38857 /** 38858 * Checks if `value` is classified as an `Array` object. 38859 * 38860 * @static 38861 * @memberOf _ 38862 * @since 0.1.0 38863 * @category Lang 38864 * @param {*} value The value to check. 38865 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 38866 * @example 38867 * 38868 * _.isArray([1, 2, 3]); 38869 * // => true 38870 * 38871 * _.isArray(document.body.children); 38872 * // => false 38873 * 38874 * _.isArray('abc'); 38875 * // => false 38876 * 38877 * _.isArray(_.noop); 38878 * // => false 38879 */ 38880 var isArray = Array.isArray; 38881 38882 /** 38883 * Checks if `value` is classified as an `ArrayBuffer` object. 38884 * 38885 * @static 38886 * @memberOf _ 38887 * @since 4.3.0 38888 * @category Lang 38889 * @param {*} value The value to check. 38890 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 38891 * @example 38892 * 38893 * _.isArrayBuffer(new ArrayBuffer(2)); 38894 * // => true 38895 * 38896 * _.isArrayBuffer(new Array(2)); 38897 * // => false 38898 */ 38899 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; 38900 38901 /** 38902 * Checks if `value` is array-like. A value is considered array-like if it's 38903 * not a function and has a `value.length` that's an integer greater than or 38904 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 38905 * 38906 * @static 38907 * @memberOf _ 38908 * @since 4.0.0 38909 * @category Lang 38910 * @param {*} value The value to check. 38911 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 38912 * @example 38913 * 38914 * _.isArrayLike([1, 2, 3]); 38915 * // => true 38916 * 38917 * _.isArrayLike(document.body.children); 38918 * // => true 38919 * 38920 * _.isArrayLike('abc'); 38921 * // => true 38922 * 38923 * _.isArrayLike(_.noop); 38924 * // => false 38925 */ 38926 function isArrayLike(value) { 38927 return value != null && isLength(value.length) && !isFunction(value); 38928 } 38929 38930 /** 38931 * This method is like `_.isArrayLike` except that it also checks if `value` 38932 * is an object. 38933 * 38934 * @static 38935 * @memberOf _ 38936 * @since 4.0.0 38937 * @category Lang 38938 * @param {*} value The value to check. 38939 * @returns {boolean} Returns `true` if `value` is an array-like object, 38940 * else `false`. 38941 * @example 38942 * 38943 * _.isArrayLikeObject([1, 2, 3]); 38944 * // => true 38945 * 38946 * _.isArrayLikeObject(document.body.children); 38947 * // => true 38948 * 38949 * _.isArrayLikeObject('abc'); 38950 * // => false 38951 * 38952 * _.isArrayLikeObject(_.noop); 38953 * // => false 38954 */ 38955 function isArrayLikeObject(value) { 38956 return isObjectLike(value) && isArrayLike(value); 38957 } 38958 38959 /** 38960 * Checks if `value` is classified as a boolean primitive or object. 38961 * 38962 * @static 38963 * @memberOf _ 38964 * @since 0.1.0 38965 * @category Lang 38966 * @param {*} value The value to check. 38967 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. 38968 * @example 38969 * 38970 * _.isBoolean(false); 38971 * // => true 38972 * 38973 * _.isBoolean(null); 38974 * // => false 38975 */ 38976 function isBoolean(value) { 38977 return value === true || value === false || 38978 (isObjectLike(value) && baseGetTag(value) == boolTag); 38979 } 38980 38981 /** 38982 * Checks if `value` is a buffer. 38983 * 38984 * @static 38985 * @memberOf _ 38986 * @since 4.3.0 38987 * @category Lang 38988 * @param {*} value The value to check. 38989 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 38990 * @example 38991 * 38992 * _.isBuffer(new Buffer(2)); 38993 * // => true 38994 * 38995 * _.isBuffer(new Uint8Array(2)); 38996 * // => false 38997 */ 38998 var isBuffer = nativeIsBuffer || stubFalse; 38999 39000 /** 39001 * Checks if `value` is classified as a `Date` object. 39002 * 39003 * @static 39004 * @memberOf _ 39005 * @since 0.1.0 39006 * @category Lang 39007 * @param {*} value The value to check. 39008 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 39009 * @example 39010 * 39011 * _.isDate(new Date); 39012 * // => true 39013 * 39014 * _.isDate('Mon April 23 2012'); 39015 * // => false 39016 */ 39017 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; 39018 39019 /** 39020 * Checks if `value` is likely a DOM element. 39021 * 39022 * @static 39023 * @memberOf _ 39024 * @since 0.1.0 39025 * @category Lang 39026 * @param {*} value The value to check. 39027 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. 39028 * @example 39029 * 39030 * _.isElement(document.body); 39031 * // => true 39032 * 39033 * _.isElement('<body>'); 39034 * // => false 39035 */ 39036 function isElement(value) { 39037 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); 39038 } 39039 39040 /** 39041 * Checks if `value` is an empty object, collection, map, or set. 39042 * 39043 * Objects are considered empty if they have no own enumerable string keyed 39044 * properties. 39045 * 39046 * Array-like values such as `arguments` objects, arrays, buffers, strings, or 39047 * jQuery-like collections are considered empty if they have a `length` of `0`. 39048 * Similarly, maps and sets are considered empty if they have a `size` of `0`. 39049 * 39050 * @static 39051 * @memberOf _ 39052 * @since 0.1.0 39053 * @category Lang 39054 * @param {*} value The value to check. 39055 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 39056 * @example 39057 * 39058 * _.isEmpty(null); 39059 * // => true 39060 * 39061 * _.isEmpty(true); 39062 * // => true 39063 * 39064 * _.isEmpty(1); 39065 * // => true 39066 * 39067 * _.isEmpty([1, 2, 3]); 39068 * // => false 39069 * 39070 * _.isEmpty({ 'a': 1 }); 39071 * // => false 39072 */ 39073 function isEmpty(value) { 39074 if (value == null) { 39075 return true; 39076 } 39077 if (isArrayLike(value) && 39078 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || 39079 isBuffer(value) || isTypedArray(value) || isArguments(value))) { 39080 return !value.length; 39081 } 39082 var tag = getTag(value); 39083 if (tag == mapTag || tag == setTag) { 39084 return !value.size; 39085 } 39086 if (isPrototype(value)) { 39087 return !baseKeys(value).length; 39088 } 39089 for (var key in value) { 39090 if (hasOwnProperty.call(value, key)) { 39091 return false; 39092 } 39093 } 39094 return true; 39095 } 39096 39097 /** 39098 * Performs a deep comparison between two values to determine if they are 39099 * equivalent. 39100 * 39101 * **Note:** This method supports comparing arrays, array buffers, booleans, 39102 * date objects, error objects, maps, numbers, `Object` objects, regexes, 39103 * sets, strings, symbols, and typed arrays. `Object` objects are compared 39104 * by their own, not inherited, enumerable properties. Functions and DOM 39105 * nodes are compared by strict equality, i.e. `===`. 39106 * 39107 * @static 39108 * @memberOf _ 39109 * @since 0.1.0 39110 * @category Lang 39111 * @param {*} value The value to compare. 39112 * @param {*} other The other value to compare. 39113 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 39114 * @example 39115 * 39116 * var object = { 'a': 1 }; 39117 * var other = { 'a': 1 }; 39118 * 39119 * _.isEqual(object, other); 39120 * // => true 39121 * 39122 * object === other; 39123 * // => false 39124 */ 39125 function isEqual(value, other) { 39126 return baseIsEqual(value, other); 39127 } 39128 39129 /** 39130 * This method is like `_.isEqual` except that it accepts `customizer` which 39131 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 39132 * are handled by the method instead. The `customizer` is invoked with up to 39133 * six arguments: (objValue, othValue [, index|key, object, other, stack]). 39134 * 39135 * @static 39136 * @memberOf _ 39137 * @since 4.0.0 39138 * @category Lang 39139 * @param {*} value The value to compare. 39140 * @param {*} other The other value to compare. 39141 * @param {Function} [customizer] The function to customize comparisons. 39142 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 39143 * @example 39144 * 39145 * function isGreeting(value) { 39146 * return /^h(?:i|ello)$/.test(value); 39147 * } 39148 * 39149 * function customizer(objValue, othValue) { 39150 * if (isGreeting(objValue) && isGreeting(othValue)) { 39151 * return true; 39152 * } 39153 * } 39154 * 39155 * var array = ['hello', 'goodbye']; 39156 * var other = ['hi', 'goodbye']; 39157 * 39158 * _.isEqualWith(array, other, customizer); 39159 * // => true 39160 */ 39161 function isEqualWith(value, other, customizer) { 39162 customizer = typeof customizer == 'function' ? customizer : undefined; 39163 var result = customizer ? customizer(value, other) : undefined; 39164 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; 39165 } 39166 39167 /** 39168 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, 39169 * `SyntaxError`, `TypeError`, or `URIError` object. 39170 * 39171 * @static 39172 * @memberOf _ 39173 * @since 3.0.0 39174 * @category Lang 39175 * @param {*} value The value to check. 39176 * @returns {boolean} Returns `true` if `value` is an error object, else `false`. 39177 * @example 39178 * 39179 * _.isError(new Error); 39180 * // => true 39181 * 39182 * _.isError(Error); 39183 * // => false 39184 */ 39185 function isError(value) { 39186 if (!isObjectLike(value)) { 39187 return false; 39188 } 39189 var tag = baseGetTag(value); 39190 return tag == errorTag || tag == domExcTag || 39191 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); 39192 } 39193 39194 /** 39195 * Checks if `value` is a finite primitive number. 39196 * 39197 * **Note:** This method is based on 39198 * [`Number.isFinite`](https://mdn.io/Number/isFinite). 39199 * 39200 * @static 39201 * @memberOf _ 39202 * @since 0.1.0 39203 * @category Lang 39204 * @param {*} value The value to check. 39205 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 39206 * @example 39207 * 39208 * _.isFinite(3); 39209 * // => true 39210 * 39211 * _.isFinite(Number.MIN_VALUE); 39212 * // => true 39213 * 39214 * _.isFinite(Infinity); 39215 * // => false 39216 * 39217 * _.isFinite('3'); 39218 * // => false 39219 */ 39220 function isFinite(value) { 39221 return typeof value == 'number' && nativeIsFinite(value); 39222 } 39223 39224 /** 39225 * Checks if `value` is classified as a `Function` object. 39226 * 39227 * @static 39228 * @memberOf _ 39229 * @since 0.1.0 39230 * @category Lang 39231 * @param {*} value The value to check. 39232 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 39233 * @example 39234 * 39235 * _.isFunction(_); 39236 * // => true 39237 * 39238 * _.isFunction(/abc/); 39239 * // => false 39240 */ 39241 function isFunction(value) { 39242 if (!isObject(value)) { 39243 return false; 39244 } 39245 // The use of `Object#toString` avoids issues with the `typeof` operator 39246 // in Safari 9 which returns 'object' for typed arrays and other constructors. 39247 var tag = baseGetTag(value); 39248 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 39249 } 39250 39251 /** 39252 * Checks if `value` is an integer. 39253 * 39254 * **Note:** This method is based on 39255 * [`Number.isInteger`](https://mdn.io/Number/isInteger). 39256 * 39257 * @static 39258 * @memberOf _ 39259 * @since 4.0.0 39260 * @category Lang 39261 * @param {*} value The value to check. 39262 * @returns {boolean} Returns `true` if `value` is an integer, else `false`. 39263 * @example 39264 * 39265 * _.isInteger(3); 39266 * // => true 39267 * 39268 * _.isInteger(Number.MIN_VALUE); 39269 * // => false 39270 * 39271 * _.isInteger(Infinity); 39272 * // => false 39273 * 39274 * _.isInteger('3'); 39275 * // => false 39276 */ 39277 function isInteger(value) { 39278 return typeof value == 'number' && value == toInteger(value); 39279 } 39280 39281 /** 39282 * Checks if `value` is a valid array-like length. 39283 * 39284 * **Note:** This method is loosely based on 39285 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 39286 * 39287 * @static 39288 * @memberOf _ 39289 * @since 4.0.0 39290 * @category Lang 39291 * @param {*} value The value to check. 39292 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 39293 * @example 39294 * 39295 * _.isLength(3); 39296 * // => true 39297 * 39298 * _.isLength(Number.MIN_VALUE); 39299 * // => false 39300 * 39301 * _.isLength(Infinity); 39302 * // => false 39303 * 39304 * _.isLength('3'); 39305 * // => false 39306 */ 39307 function isLength(value) { 39308 return typeof value == 'number' && 39309 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 39310 } 39311 39312 /** 39313 * Checks if `value` is the 39314 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 39315 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 39316 * 39317 * @static 39318 * @memberOf _ 39319 * @since 0.1.0 39320 * @category Lang 39321 * @param {*} value The value to check. 39322 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 39323 * @example 39324 * 39325 * _.isObject({}); 39326 * // => true 39327 * 39328 * _.isObject([1, 2, 3]); 39329 * // => true 39330 * 39331 * _.isObject(_.noop); 39332 * // => true 39333 * 39334 * _.isObject(null); 39335 * // => false 39336 */ 39337 function isObject(value) { 39338 var type = typeof value; 39339 return value != null && (type == 'object' || type == 'function'); 39340 } 39341 39342 /** 39343 * Checks if `value` is object-like. A value is object-like if it's not `null` 39344 * and has a `typeof` result of "object". 39345 * 39346 * @static 39347 * @memberOf _ 39348 * @since 4.0.0 39349 * @category Lang 39350 * @param {*} value The value to check. 39351 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 39352 * @example 39353 * 39354 * _.isObjectLike({}); 39355 * // => true 39356 * 39357 * _.isObjectLike([1, 2, 3]); 39358 * // => true 39359 * 39360 * _.isObjectLike(_.noop); 39361 * // => false 39362 * 39363 * _.isObjectLike(null); 39364 * // => false 39365 */ 39366 function isObjectLike(value) { 39367 return value != null && typeof value == 'object'; 39368 } 39369 39370 /** 39371 * Checks if `value` is classified as a `Map` object. 39372 * 39373 * @static 39374 * @memberOf _ 39375 * @since 4.3.0 39376 * @category Lang 39377 * @param {*} value The value to check. 39378 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 39379 * @example 39380 * 39381 * _.isMap(new Map); 39382 * // => true 39383 * 39384 * _.isMap(new WeakMap); 39385 * // => false 39386 */ 39387 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 39388 39389 /** 39390 * Performs a partial deep comparison between `object` and `source` to 39391 * determine if `object` contains equivalent property values. 39392 * 39393 * **Note:** This method is equivalent to `_.matches` when `source` is 39394 * partially applied. 39395 * 39396 * Partial comparisons will match empty array and empty object `source` 39397 * values against any array or object value, respectively. See `_.isEqual` 39398 * for a list of supported value comparisons. 39399 * 39400 * @static 39401 * @memberOf _ 39402 * @since 3.0.0 39403 * @category Lang 39404 * @param {Object} object The object to inspect. 39405 * @param {Object} source The object of property values to match. 39406 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 39407 * @example 39408 * 39409 * var object = { 'a': 1, 'b': 2 }; 39410 * 39411 * _.isMatch(object, { 'b': 2 }); 39412 * // => true 39413 * 39414 * _.isMatch(object, { 'b': 1 }); 39415 * // => false 39416 */ 39417 function isMatch(object, source) { 39418 return object === source || baseIsMatch(object, source, getMatchData(source)); 39419 } 39420 39421 /** 39422 * This method is like `_.isMatch` except that it accepts `customizer` which 39423 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 39424 * are handled by the method instead. The `customizer` is invoked with five 39425 * arguments: (objValue, srcValue, index|key, object, source). 39426 * 39427 * @static 39428 * @memberOf _ 39429 * @since 4.0.0 39430 * @category Lang 39431 * @param {Object} object The object to inspect. 39432 * @param {Object} source The object of property values to match. 39433 * @param {Function} [customizer] The function to customize comparisons. 39434 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 39435 * @example 39436 * 39437 * function isGreeting(value) { 39438 * return /^h(?:i|ello)$/.test(value); 39439 * } 39440 * 39441 * function customizer(objValue, srcValue) { 39442 * if (isGreeting(objValue) && isGreeting(srcValue)) { 39443 * return true; 39444 * } 39445 * } 39446 * 39447 * var object = { 'greeting': 'hello' }; 39448 * var source = { 'greeting': 'hi' }; 39449 * 39450 * _.isMatchWith(object, source, customizer); 39451 * // => true 39452 */ 39453 function isMatchWith(object, source, customizer) { 39454 customizer = typeof customizer == 'function' ? customizer : undefined; 39455 return baseIsMatch(object, source, getMatchData(source), customizer); 39456 } 39457 39458 /** 39459 * Checks if `value` is `NaN`. 39460 * 39461 * **Note:** This method is based on 39462 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as 39463 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for 39464 * `undefined` and other non-number values. 39465 * 39466 * @static 39467 * @memberOf _ 39468 * @since 0.1.0 39469 * @category Lang 39470 * @param {*} value The value to check. 39471 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 39472 * @example 39473 * 39474 * _.isNaN(NaN); 39475 * // => true 39476 * 39477 * _.isNaN(new Number(NaN)); 39478 * // => true 39479 * 39480 * isNaN(undefined); 39481 * // => true 39482 * 39483 * _.isNaN(undefined); 39484 * // => false 39485 */ 39486 function isNaN(value) { 39487 // An `NaN` primitive is the only value that is not equal to itself. 39488 // Perform the `toStringTag` check first to avoid errors with some 39489 // ActiveX objects in IE. 39490 return isNumber(value) && value != +value; 39491 } 39492 39493 /** 39494 * Checks if `value` is a pristine native function. 39495 * 39496 * **Note:** This method can't reliably detect native functions in the presence 39497 * of the core-js package because core-js circumvents this kind of detection. 39498 * Despite multiple requests, the core-js maintainer has made it clear: any 39499 * attempt to fix the detection will be obstructed. As a result, we're left 39500 * with little choice but to throw an error. Unfortunately, this also affects 39501 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), 39502 * which rely on core-js. 39503 * 39504 * @static 39505 * @memberOf _ 39506 * @since 3.0.0 39507 * @category Lang 39508 * @param {*} value The value to check. 39509 * @returns {boolean} Returns `true` if `value` is a native function, 39510 * else `false`. 39511 * @example 39512 * 39513 * _.isNative(Array.prototype.push); 39514 * // => true 39515 * 39516 * _.isNative(_); 39517 * // => false 39518 */ 39519 function isNative(value) { 39520 if (isMaskable(value)) { 39521 throw new Error(CORE_ERROR_TEXT); 39522 } 39523 return baseIsNative(value); 39524 } 39525 39526 /** 39527 * Checks if `value` is `null`. 39528 * 39529 * @static 39530 * @memberOf _ 39531 * @since 0.1.0 39532 * @category Lang 39533 * @param {*} value The value to check. 39534 * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 39535 * @example 39536 * 39537 * _.isNull(null); 39538 * // => true 39539 * 39540 * _.isNull(void 0); 39541 * // => false 39542 */ 39543 function isNull(value) { 39544 return value === null; 39545 } 39546 39547 /** 39548 * Checks if `value` is `null` or `undefined`. 39549 * 39550 * @static 39551 * @memberOf _ 39552 * @since 4.0.0 39553 * @category Lang 39554 * @param {*} value The value to check. 39555 * @returns {boolean} Returns `true` if `value` is nullish, else `false`. 39556 * @example 39557 * 39558 * _.isNil(null); 39559 * // => true 39560 * 39561 * _.isNil(void 0); 39562 * // => true 39563 * 39564 * _.isNil(NaN); 39565 * // => false 39566 */ 39567 function isNil(value) { 39568 return value == null; 39569 } 39570 39571 /** 39572 * Checks if `value` is classified as a `Number` primitive or object. 39573 * 39574 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 39575 * classified as numbers, use the `_.isFinite` method. 39576 * 39577 * @static 39578 * @memberOf _ 39579 * @since 0.1.0 39580 * @category Lang 39581 * @param {*} value The value to check. 39582 * @returns {boolean} Returns `true` if `value` is a number, else `false`. 39583 * @example 39584 * 39585 * _.isNumber(3); 39586 * // => true 39587 * 39588 * _.isNumber(Number.MIN_VALUE); 39589 * // => true 39590 * 39591 * _.isNumber(Infinity); 39592 * // => true 39593 * 39594 * _.isNumber('3'); 39595 * // => false 39596 */ 39597 function isNumber(value) { 39598 return typeof value == 'number' || 39599 (isObjectLike(value) && baseGetTag(value) == numberTag); 39600 } 39601 39602 /** 39603 * Checks if `value` is a plain object, that is, an object created by the 39604 * `Object` constructor or one with a `[[Prototype]]` of `null`. 39605 * 39606 * @static 39607 * @memberOf _ 39608 * @since 0.8.0 39609 * @category Lang 39610 * @param {*} value The value to check. 39611 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 39612 * @example 39613 * 39614 * function Foo() { 39615 * this.a = 1; 39616 * } 39617 * 39618 * _.isPlainObject(new Foo); 39619 * // => false 39620 * 39621 * _.isPlainObject([1, 2, 3]); 39622 * // => false 39623 * 39624 * _.isPlainObject({ 'x': 0, 'y': 0 }); 39625 * // => true 39626 * 39627 * _.isPlainObject(Object.create(null)); 39628 * // => true 39629 */ 39630 function isPlainObject(value) { 39631 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 39632 return false; 39633 } 39634 var proto = getPrototype(value); 39635 if (proto === null) { 39636 return true; 39637 } 39638 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; 39639 return typeof Ctor == 'function' && Ctor instanceof Ctor && 39640 funcToString.call(Ctor) == objectCtorString; 39641 } 39642 39643 /** 39644 * Checks if `value` is classified as a `RegExp` object. 39645 * 39646 * @static 39647 * @memberOf _ 39648 * @since 0.1.0 39649 * @category Lang 39650 * @param {*} value The value to check. 39651 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 39652 * @example 39653 * 39654 * _.isRegExp(/abc/); 39655 * // => true 39656 * 39657 * _.isRegExp('/abc/'); 39658 * // => false 39659 */ 39660 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; 39661 39662 /** 39663 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 39664 * double precision number which isn't the result of a rounded unsafe integer. 39665 * 39666 * **Note:** This method is based on 39667 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). 39668 * 39669 * @static 39670 * @memberOf _ 39671 * @since 4.0.0 39672 * @category Lang 39673 * @param {*} value The value to check. 39674 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. 39675 * @example 39676 * 39677 * _.isSafeInteger(3); 39678 * // => true 39679 * 39680 * _.isSafeInteger(Number.MIN_VALUE); 39681 * // => false 39682 * 39683 * _.isSafeInteger(Infinity); 39684 * // => false 39685 * 39686 * _.isSafeInteger('3'); 39687 * // => false 39688 */ 39689 function isSafeInteger(value) { 39690 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; 39691 } 39692 39693 /** 39694 * Checks if `value` is classified as a `Set` object. 39695 * 39696 * @static 39697 * @memberOf _ 39698 * @since 4.3.0 39699 * @category Lang 39700 * @param {*} value The value to check. 39701 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 39702 * @example 39703 * 39704 * _.isSet(new Set); 39705 * // => true 39706 * 39707 * _.isSet(new WeakSet); 39708 * // => false 39709 */ 39710 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 39711 39712 /** 39713 * Checks if `value` is classified as a `String` primitive or object. 39714 * 39715 * @static 39716 * @since 0.1.0 39717 * @memberOf _ 39718 * @category Lang 39719 * @param {*} value The value to check. 39720 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 39721 * @example 39722 * 39723 * _.isString('abc'); 39724 * // => true 39725 * 39726 * _.isString(1); 39727 * // => false 39728 */ 39729 function isString(value) { 39730 return typeof value == 'string' || 39731 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); 39732 } 39733 39734 /** 39735 * Checks if `value` is classified as a `Symbol` primitive or object. 39736 * 39737 * @static 39738 * @memberOf _ 39739 * @since 4.0.0 39740 * @category Lang 39741 * @param {*} value The value to check. 39742 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 39743 * @example 39744 * 39745 * _.isSymbol(Symbol.iterator); 39746 * // => true 39747 * 39748 * _.isSymbol('abc'); 39749 * // => false 39750 */ 39751 function isSymbol(value) { 39752 return typeof value == 'symbol' || 39753 (isObjectLike(value) && baseGetTag(value) == symbolTag); 39754 } 39755 39756 /** 39757 * Checks if `value` is classified as a typed array. 39758 * 39759 * @static 39760 * @memberOf _ 39761 * @since 3.0.0 39762 * @category Lang 39763 * @param {*} value The value to check. 39764 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 39765 * @example 39766 * 39767 * _.isTypedArray(new Uint8Array); 39768 * // => true 39769 * 39770 * _.isTypedArray([]); 39771 * // => false 39772 */ 39773 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 39774 39775 /** 39776 * Checks if `value` is `undefined`. 39777 * 39778 * @static 39779 * @since 0.1.0 39780 * @memberOf _ 39781 * @category Lang 39782 * @param {*} value The value to check. 39783 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 39784 * @example 39785 * 39786 * _.isUndefined(void 0); 39787 * // => true 39788 * 39789 * _.isUndefined(null); 39790 * // => false 39791 */ 39792 function isUndefined(value) { 39793 return value === undefined; 39794 } 39795 39796 /** 39797 * Checks if `value` is classified as a `WeakMap` object. 39798 * 39799 * @static 39800 * @memberOf _ 39801 * @since 4.3.0 39802 * @category Lang 39803 * @param {*} value The value to check. 39804 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. 39805 * @example 39806 * 39807 * _.isWeakMap(new WeakMap); 39808 * // => true 39809 * 39810 * _.isWeakMap(new Map); 39811 * // => false 39812 */ 39813 function isWeakMap(value) { 39814 return isObjectLike(value) && getTag(value) == weakMapTag; 39815 } 39816 39817 /** 39818 * Checks if `value` is classified as a `WeakSet` object. 39819 * 39820 * @static 39821 * @memberOf _ 39822 * @since 4.3.0 39823 * @category Lang 39824 * @param {*} value The value to check. 39825 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. 39826 * @example 39827 * 39828 * _.isWeakSet(new WeakSet); 39829 * // => true 39830 * 39831 * _.isWeakSet(new Set); 39832 * // => false 39833 */ 39834 function isWeakSet(value) { 39835 return isObjectLike(value) && baseGetTag(value) == weakSetTag; 39836 } 39837 39838 /** 39839 * Checks if `value` is less than `other`. 39840 * 39841 * @static 39842 * @memberOf _ 39843 * @since 3.9.0 39844 * @category Lang 39845 * @param {*} value The value to compare. 39846 * @param {*} other The other value to compare. 39847 * @returns {boolean} Returns `true` if `value` is less than `other`, 39848 * else `false`. 39849 * @see _.gt 39850 * @example 39851 * 39852 * _.lt(1, 3); 39853 * // => true 39854 * 39855 * _.lt(3, 3); 39856 * // => false 39857 * 39858 * _.lt(3, 1); 39859 * // => false 39860 */ 39861 var lt = createRelationalOperation(baseLt); 39862 39863 /** 39864 * Checks if `value` is less than or equal to `other`. 39865 * 39866 * @static 39867 * @memberOf _ 39868 * @since 3.9.0 39869 * @category Lang 39870 * @param {*} value The value to compare. 39871 * @param {*} other The other value to compare. 39872 * @returns {boolean} Returns `true` if `value` is less than or equal to 39873 * `other`, else `false`. 39874 * @see _.gte 39875 * @example 39876 * 39877 * _.lte(1, 3); 39878 * // => true 39879 * 39880 * _.lte(3, 3); 39881 * // => true 39882 * 39883 * _.lte(3, 1); 39884 * // => false 39885 */ 39886 var lte = createRelationalOperation(function(value, other) { 39887 return value <= other; 39888 }); 39889 39890 /** 39891 * Converts `value` to an array. 39892 * 39893 * @static 39894 * @since 0.1.0 39895 * @memberOf _ 39896 * @category Lang 39897 * @param {*} value The value to convert. 39898 * @returns {Array} Returns the converted array. 39899 * @example 39900 * 39901 * _.toArray({ 'a': 1, 'b': 2 }); 39902 * // => [1, 2] 39903 * 39904 * _.toArray('abc'); 39905 * // => ['a', 'b', 'c'] 39906 * 39907 * _.toArray(1); 39908 * // => [] 39909 * 39910 * _.toArray(null); 39911 * // => [] 39912 */ 39913 function toArray(value) { 39914 if (!value) { 39915 return []; 39916 } 39917 if (isArrayLike(value)) { 39918 return isString(value) ? stringToArray(value) : copyArray(value); 39919 } 39920 if (symIterator && value[symIterator]) { 39921 return iteratorToArray(value[symIterator]()); 39922 } 39923 var tag = getTag(value), 39924 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); 39925 39926 return func(value); 39927 } 39928 39929 /** 39930 * Converts `value` to a finite number. 39931 * 39932 * @static 39933 * @memberOf _ 39934 * @since 4.12.0 39935 * @category Lang 39936 * @param {*} value The value to convert. 39937 * @returns {number} Returns the converted number. 39938 * @example 39939 * 39940 * _.toFinite(3.2); 39941 * // => 3.2 39942 * 39943 * _.toFinite(Number.MIN_VALUE); 39944 * // => 5e-324 39945 * 39946 * _.toFinite(Infinity); 39947 * // => 1.7976931348623157e+308 39948 * 39949 * _.toFinite('3.2'); 39950 * // => 3.2 39951 */ 39952 function toFinite(value) { 39953 if (!value) { 39954 return value === 0 ? value : 0; 39955 } 39956 value = toNumber(value); 39957 if (value === INFINITY || value === -INFINITY) { 39958 var sign = (value < 0 ? -1 : 1); 39959 return sign * MAX_INTEGER; 39960 } 39961 return value === value ? value : 0; 39962 } 39963 39964 /** 39965 * Converts `value` to an integer. 39966 * 39967 * **Note:** This method is loosely based on 39968 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 39969 * 39970 * @static 39971 * @memberOf _ 39972 * @since 4.0.0 39973 * @category Lang 39974 * @param {*} value The value to convert. 39975 * @returns {number} Returns the converted integer. 39976 * @example 39977 * 39978 * _.toInteger(3.2); 39979 * // => 3 39980 * 39981 * _.toInteger(Number.MIN_VALUE); 39982 * // => 0 39983 * 39984 * _.toInteger(Infinity); 39985 * // => 1.7976931348623157e+308 39986 * 39987 * _.toInteger('3.2'); 39988 * // => 3 39989 */ 39990 function toInteger(value) { 39991 var result = toFinite(value), 39992 remainder = result % 1; 39993 39994 return result === result ? (remainder ? result - remainder : result) : 0; 39995 } 39996 39997 /** 39998 * Converts `value` to an integer suitable for use as the length of an 39999 * array-like object. 40000 * 40001 * **Note:** This method is based on 40002 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 40003 * 40004 * @static 40005 * @memberOf _ 40006 * @since 4.0.0 40007 * @category Lang 40008 * @param {*} value The value to convert. 40009 * @returns {number} Returns the converted integer. 40010 * @example 40011 * 40012 * _.toLength(3.2); 40013 * // => 3 40014 * 40015 * _.toLength(Number.MIN_VALUE); 40016 * // => 0 40017 * 40018 * _.toLength(Infinity); 40019 * // => 4294967295 40020 * 40021 * _.toLength('3.2'); 40022 * // => 3 40023 */ 40024 function toLength(value) { 40025 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; 40026 } 40027 40028 /** 40029 * Converts `value` to a number. 40030 * 40031 * @static 40032 * @memberOf _ 40033 * @since 4.0.0 40034 * @category Lang 40035 * @param {*} value The value to process. 40036 * @returns {number} Returns the number. 40037 * @example 40038 * 40039 * _.toNumber(3.2); 40040 * // => 3.2 40041 * 40042 * _.toNumber(Number.MIN_VALUE); 40043 * // => 5e-324 40044 * 40045 * _.toNumber(Infinity); 40046 * // => Infinity 40047 * 40048 * _.toNumber('3.2'); 40049 * // => 3.2 40050 */ 40051 function toNumber(value) { 40052 if (typeof value == 'number') { 40053 return value; 40054 } 40055 if (isSymbol(value)) { 40056 return NAN; 40057 } 40058 if (isObject(value)) { 40059 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 40060 value = isObject(other) ? (other + '') : other; 40061 } 40062 if (typeof value != 'string') { 40063 return value === 0 ? value : +value; 40064 } 40065 value = baseTrim(value); 40066 var isBinary = reIsBinary.test(value); 40067 return (isBinary || reIsOctal.test(value)) 40068 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 40069 : (reIsBadHex.test(value) ? NAN : +value); 40070 } 40071 40072 /** 40073 * Converts `value` to a plain object flattening inherited enumerable string 40074 * keyed properties of `value` to own properties of the plain object. 40075 * 40076 * @static 40077 * @memberOf _ 40078 * @since 3.0.0 40079 * @category Lang 40080 * @param {*} value The value to convert. 40081 * @returns {Object} Returns the converted plain object. 40082 * @example 40083 * 40084 * function Foo() { 40085 * this.b = 2; 40086 * } 40087 * 40088 * Foo.prototype.c = 3; 40089 * 40090 * _.assign({ 'a': 1 }, new Foo); 40091 * // => { 'a': 1, 'b': 2 } 40092 * 40093 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); 40094 * // => { 'a': 1, 'b': 2, 'c': 3 } 40095 */ 40096 function toPlainObject(value) { 40097 return copyObject(value, keysIn(value)); 40098 } 40099 40100 /** 40101 * Converts `value` to a safe integer. A safe integer can be compared and 40102 * represented correctly. 40103 * 40104 * @static 40105 * @memberOf _ 40106 * @since 4.0.0 40107 * @category Lang 40108 * @param {*} value The value to convert. 40109 * @returns {number} Returns the converted integer. 40110 * @example 40111 * 40112 * _.toSafeInteger(3.2); 40113 * // => 3 40114 * 40115 * _.toSafeInteger(Number.MIN_VALUE); 40116 * // => 0 40117 * 40118 * _.toSafeInteger(Infinity); 40119 * // => 9007199254740991 40120 * 40121 * _.toSafeInteger('3.2'); 40122 * // => 3 40123 */ 40124 function toSafeInteger(value) { 40125 return value 40126 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) 40127 : (value === 0 ? value : 0); 40128 } 40129 40130 /** 40131 * Converts `value` to a string. An empty string is returned for `null` 40132 * and `undefined` values. The sign of `-0` is preserved. 40133 * 40134 * @static 40135 * @memberOf _ 40136 * @since 4.0.0 40137 * @category Lang 40138 * @param {*} value The value to convert. 40139 * @returns {string} Returns the converted string. 40140 * @example 40141 * 40142 * _.toString(null); 40143 * // => '' 40144 * 40145 * _.toString(-0); 40146 * // => '-0' 40147 * 40148 * _.toString([1, 2, 3]); 40149 * // => '1,2,3' 40150 */ 40151 function toString(value) { 40152 return value == null ? '' : baseToString(value); 40153 } 40154 40155 /*------------------------------------------------------------------------*/ 40156 40157 /** 40158 * Assigns own enumerable string keyed properties of source objects to the 40159 * destination object. Source objects are applied from left to right. 40160 * Subsequent sources overwrite property assignments of previous sources. 40161 * 40162 * **Note:** This method mutates `object` and is loosely based on 40163 * [`Object.assign`](https://mdn.io/Object/assign). 40164 * 40165 * @static 40166 * @memberOf _ 40167 * @since 0.10.0 40168 * @category Object 40169 * @param {Object} object The destination object. 40170 * @param {...Object} [sources] The source objects. 40171 * @returns {Object} Returns `object`. 40172 * @see _.assignIn 40173 * @example 40174 * 40175 * function Foo() { 40176 * this.a = 1; 40177 * } 40178 * 40179 * function Bar() { 40180 * this.c = 3; 40181 * } 40182 * 40183 * Foo.prototype.b = 2; 40184 * Bar.prototype.d = 4; 40185 * 40186 * _.assign({ 'a': 0 }, new Foo, new Bar); 40187 * // => { 'a': 1, 'c': 3 } 40188 */ 40189 var assign = createAssigner(function(object, source) { 40190 if (isPrototype(source) || isArrayLike(source)) { 40191 copyObject(source, keys(source), object); 40192 return; 40193 } 40194 for (var key in source) { 40195 if (hasOwnProperty.call(source, key)) { 40196 assignValue(object, key, source[key]); 40197 } 40198 } 40199 }); 40200 40201 /** 40202 * This method is like `_.assign` except that it iterates over own and 40203 * inherited source properties. 40204 * 40205 * **Note:** This method mutates `object`. 40206 * 40207 * @static 40208 * @memberOf _ 40209 * @since 4.0.0 40210 * @alias extend 40211 * @category Object 40212 * @param {Object} object The destination object. 40213 * @param {...Object} [sources] The source objects. 40214 * @returns {Object} Returns `object`. 40215 * @see _.assign 40216 * @example 40217 * 40218 * function Foo() { 40219 * this.a = 1; 40220 * } 40221 * 40222 * function Bar() { 40223 * this.c = 3; 40224 * } 40225 * 40226 * Foo.prototype.b = 2; 40227 * Bar.prototype.d = 4; 40228 * 40229 * _.assignIn({ 'a': 0 }, new Foo, new Bar); 40230 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 40231 */ 40232 var assignIn = createAssigner(function(object, source) { 40233 copyObject(source, keysIn(source), object); 40234 }); 40235 40236 /** 40237 * This method is like `_.assignIn` except that it accepts `customizer` 40238 * which is invoked to produce the assigned values. If `customizer` returns 40239 * `undefined`, assignment is handled by the method instead. The `customizer` 40240 * is invoked with five arguments: (objValue, srcValue, key, object, source). 40241 * 40242 * **Note:** This method mutates `object`. 40243 * 40244 * @static 40245 * @memberOf _ 40246 * @since 4.0.0 40247 * @alias extendWith 40248 * @category Object 40249 * @param {Object} object The destination object. 40250 * @param {...Object} sources The source objects. 40251 * @param {Function} [customizer] The function to customize assigned values. 40252 * @returns {Object} Returns `object`. 40253 * @see _.assignWith 40254 * @example 40255 * 40256 * function customizer(objValue, srcValue) { 40257 * return _.isUndefined(objValue) ? srcValue : objValue; 40258 * } 40259 * 40260 * var defaults = _.partialRight(_.assignInWith, customizer); 40261 * 40262 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 40263 * // => { 'a': 1, 'b': 2 } 40264 */ 40265 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { 40266 copyObject(source, keysIn(source), object, customizer); 40267 }); 40268 40269 /** 40270 * This method is like `_.assign` except that it accepts `customizer` 40271 * which is invoked to produce the assigned values. If `customizer` returns 40272 * `undefined`, assignment is handled by the method instead. The `customizer` 40273 * is invoked with five arguments: (objValue, srcValue, key, object, source). 40274 * 40275 * **Note:** This method mutates `object`. 40276 * 40277 * @static 40278 * @memberOf _ 40279 * @since 4.0.0 40280 * @category Object 40281 * @param {Object} object The destination object. 40282 * @param {...Object} sources The source objects. 40283 * @param {Function} [customizer] The function to customize assigned values. 40284 * @returns {Object} Returns `object`. 40285 * @see _.assignInWith 40286 * @example 40287 * 40288 * function customizer(objValue, srcValue) { 40289 * return _.isUndefined(objValue) ? srcValue : objValue; 40290 * } 40291 * 40292 * var defaults = _.partialRight(_.assignWith, customizer); 40293 * 40294 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 40295 * // => { 'a': 1, 'b': 2 } 40296 */ 40297 var assignWith = createAssigner(function(object, source, srcIndex, customizer) { 40298 copyObject(source, keys(source), object, customizer); 40299 }); 40300 40301 /** 40302 * Creates an array of values corresponding to `paths` of `object`. 40303 * 40304 * @static 40305 * @memberOf _ 40306 * @since 1.0.0 40307 * @category Object 40308 * @param {Object} object The object to iterate over. 40309 * @param {...(string|string[])} [paths] The property paths to pick. 40310 * @returns {Array} Returns the picked values. 40311 * @example 40312 * 40313 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 40314 * 40315 * _.at(object, ['a[0].b.c', 'a[1]']); 40316 * // => [3, 4] 40317 */ 40318 var at = flatRest(baseAt); 40319 40320 /** 40321 * Creates an object that inherits from the `prototype` object. If a 40322 * `properties` object is given, its own enumerable string keyed properties 40323 * are assigned to the created object. 40324 * 40325 * @static 40326 * @memberOf _ 40327 * @since 2.3.0 40328 * @category Object 40329 * @param {Object} prototype The object to inherit from. 40330 * @param {Object} [properties] The properties to assign to the object. 40331 * @returns {Object} Returns the new object. 40332 * @example 40333 * 40334 * function Shape() { 40335 * this.x = 0; 40336 * this.y = 0; 40337 * } 40338 * 40339 * function Circle() { 40340 * Shape.call(this); 40341 * } 40342 * 40343 * Circle.prototype = _.create(Shape.prototype, { 40344 * 'constructor': Circle 40345 * }); 40346 * 40347 * var circle = new Circle; 40348 * circle instanceof Circle; 40349 * // => true 40350 * 40351 * circle instanceof Shape; 40352 * // => true 40353 */ 40354 function create(prototype, properties) { 40355 var result = baseCreate(prototype); 40356 return properties == null ? result : baseAssign(result, properties); 40357 } 40358 40359 /** 40360 * Assigns own and inherited enumerable string keyed properties of source 40361 * objects to the destination object for all destination properties that 40362 * resolve to `undefined`. Source objects are applied from left to right. 40363 * Once a property is set, additional values of the same property are ignored. 40364 * 40365 * **Note:** This method mutates `object`. 40366 * 40367 * @static 40368 * @since 0.1.0 40369 * @memberOf _ 40370 * @category Object 40371 * @param {Object} object The destination object. 40372 * @param {...Object} [sources] The source objects. 40373 * @returns {Object} Returns `object`. 40374 * @see _.defaultsDeep 40375 * @example 40376 * 40377 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 40378 * // => { 'a': 1, 'b': 2 } 40379 */ 40380 var defaults = baseRest(function(object, sources) { 40381 object = Object(object); 40382 40383 var index = -1; 40384 var length = sources.length; 40385 var guard = length > 2 ? sources[2] : undefined; 40386 40387 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 40388 length = 1; 40389 } 40390 40391 while (++index < length) { 40392 var source = sources[index]; 40393 var props = keysIn(source); 40394 var propsIndex = -1; 40395 var propsLength = props.length; 40396 40397 while (++propsIndex < propsLength) { 40398 var key = props[propsIndex]; 40399 var value = object[key]; 40400 40401 if (value === undefined || 40402 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { 40403 object[key] = source[key]; 40404 } 40405 } 40406 } 40407 40408 return object; 40409 }); 40410 40411 /** 40412 * This method is like `_.defaults` except that it recursively assigns 40413 * default properties. 40414 * 40415 * **Note:** This method mutates `object`. 40416 * 40417 * @static 40418 * @memberOf _ 40419 * @since 3.10.0 40420 * @category Object 40421 * @param {Object} object The destination object. 40422 * @param {...Object} [sources] The source objects. 40423 * @returns {Object} Returns `object`. 40424 * @see _.defaults 40425 * @example 40426 * 40427 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); 40428 * // => { 'a': { 'b': 2, 'c': 3 } } 40429 */ 40430 var defaultsDeep = baseRest(function(args) { 40431 args.push(undefined, customDefaultsMerge); 40432 return apply(mergeWith, undefined, args); 40433 }); 40434 40435 /** 40436 * This method is like `_.find` except that it returns the key of the first 40437 * element `predicate` returns truthy for instead of the element itself. 40438 * 40439 * @static 40440 * @memberOf _ 40441 * @since 1.1.0 40442 * @category Object 40443 * @param {Object} object The object to inspect. 40444 * @param {Function} [predicate=_.identity] The function invoked per iteration. 40445 * @returns {string|undefined} Returns the key of the matched element, 40446 * else `undefined`. 40447 * @example 40448 * 40449 * var users = { 40450 * 'barney': { 'age': 36, 'active': true }, 40451 * 'fred': { 'age': 40, 'active': false }, 40452 * 'pebbles': { 'age': 1, 'active': true } 40453 * }; 40454 * 40455 * _.findKey(users, function(o) { return o.age < 40; }); 40456 * // => 'barney' (iteration order is not guaranteed) 40457 * 40458 * // The `_.matches` iteratee shorthand. 40459 * _.findKey(users, { 'age': 1, 'active': true }); 40460 * // => 'pebbles' 40461 * 40462 * // The `_.matchesProperty` iteratee shorthand. 40463 * _.findKey(users, ['active', false]); 40464 * // => 'fred' 40465 * 40466 * // The `_.property` iteratee shorthand. 40467 * _.findKey(users, 'active'); 40468 * // => 'barney' 40469 */ 40470 function findKey(object, predicate) { 40471 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); 40472 } 40473 40474 /** 40475 * This method is like `_.findKey` except that it iterates over elements of 40476 * a collection in the opposite order. 40477 * 40478 * @static 40479 * @memberOf _ 40480 * @since 2.0.0 40481 * @category Object 40482 * @param {Object} object The object to inspect. 40483 * @param {Function} [predicate=_.identity] The function invoked per iteration. 40484 * @returns {string|undefined} Returns the key of the matched element, 40485 * else `undefined`. 40486 * @example 40487 * 40488 * var users = { 40489 * 'barney': { 'age': 36, 'active': true }, 40490 * 'fred': { 'age': 40, 'active': false }, 40491 * 'pebbles': { 'age': 1, 'active': true } 40492 * }; 40493 * 40494 * _.findLastKey(users, function(o) { return o.age < 40; }); 40495 * // => returns 'pebbles' assuming `_.findKey` returns 'barney' 40496 * 40497 * // The `_.matches` iteratee shorthand. 40498 * _.findLastKey(users, { 'age': 36, 'active': true }); 40499 * // => 'barney' 40500 * 40501 * // The `_.matchesProperty` iteratee shorthand. 40502 * _.findLastKey(users, ['active', false]); 40503 * // => 'fred' 40504 * 40505 * // The `_.property` iteratee shorthand. 40506 * _.findLastKey(users, 'active'); 40507 * // => 'pebbles' 40508 */ 40509 function findLastKey(object, predicate) { 40510 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); 40511 } 40512 40513 /** 40514 * Iterates over own and inherited enumerable string keyed properties of an 40515 * object and invokes `iteratee` for each property. The iteratee is invoked 40516 * with three arguments: (value, key, object). Iteratee functions may exit 40517 * iteration early by explicitly returning `false`. 40518 * 40519 * @static 40520 * @memberOf _ 40521 * @since 0.3.0 40522 * @category Object 40523 * @param {Object} object The object to iterate over. 40524 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40525 * @returns {Object} Returns `object`. 40526 * @see _.forInRight 40527 * @example 40528 * 40529 * function Foo() { 40530 * this.a = 1; 40531 * this.b = 2; 40532 * } 40533 * 40534 * Foo.prototype.c = 3; 40535 * 40536 * _.forIn(new Foo, function(value, key) { 40537 * console.log(key); 40538 * }); 40539 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). 40540 */ 40541 function forIn(object, iteratee) { 40542 return object == null 40543 ? object 40544 : baseFor(object, getIteratee(iteratee, 3), keysIn); 40545 } 40546 40547 /** 40548 * This method is like `_.forIn` except that it iterates over properties of 40549 * `object` in the opposite order. 40550 * 40551 * @static 40552 * @memberOf _ 40553 * @since 2.0.0 40554 * @category Object 40555 * @param {Object} object The object to iterate over. 40556 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40557 * @returns {Object} Returns `object`. 40558 * @see _.forIn 40559 * @example 40560 * 40561 * function Foo() { 40562 * this.a = 1; 40563 * this.b = 2; 40564 * } 40565 * 40566 * Foo.prototype.c = 3; 40567 * 40568 * _.forInRight(new Foo, function(value, key) { 40569 * console.log(key); 40570 * }); 40571 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. 40572 */ 40573 function forInRight(object, iteratee) { 40574 return object == null 40575 ? object 40576 : baseForRight(object, getIteratee(iteratee, 3), keysIn); 40577 } 40578 40579 /** 40580 * Iterates over own enumerable string keyed properties of an object and 40581 * invokes `iteratee` for each property. The iteratee is invoked with three 40582 * arguments: (value, key, object). Iteratee functions may exit iteration 40583 * early by explicitly returning `false`. 40584 * 40585 * @static 40586 * @memberOf _ 40587 * @since 0.3.0 40588 * @category Object 40589 * @param {Object} object The object to iterate over. 40590 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40591 * @returns {Object} Returns `object`. 40592 * @see _.forOwnRight 40593 * @example 40594 * 40595 * function Foo() { 40596 * this.a = 1; 40597 * this.b = 2; 40598 * } 40599 * 40600 * Foo.prototype.c = 3; 40601 * 40602 * _.forOwn(new Foo, function(value, key) { 40603 * console.log(key); 40604 * }); 40605 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 40606 */ 40607 function forOwn(object, iteratee) { 40608 return object && baseForOwn(object, getIteratee(iteratee, 3)); 40609 } 40610 40611 /** 40612 * This method is like `_.forOwn` except that it iterates over properties of 40613 * `object` in the opposite order. 40614 * 40615 * @static 40616 * @memberOf _ 40617 * @since 2.0.0 40618 * @category Object 40619 * @param {Object} object The object to iterate over. 40620 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40621 * @returns {Object} Returns `object`. 40622 * @see _.forOwn 40623 * @example 40624 * 40625 * function Foo() { 40626 * this.a = 1; 40627 * this.b = 2; 40628 * } 40629 * 40630 * Foo.prototype.c = 3; 40631 * 40632 * _.forOwnRight(new Foo, function(value, key) { 40633 * console.log(key); 40634 * }); 40635 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. 40636 */ 40637 function forOwnRight(object, iteratee) { 40638 return object && baseForOwnRight(object, getIteratee(iteratee, 3)); 40639 } 40640 40641 /** 40642 * Creates an array of function property names from own enumerable properties 40643 * of `object`. 40644 * 40645 * @static 40646 * @since 0.1.0 40647 * @memberOf _ 40648 * @category Object 40649 * @param {Object} object The object to inspect. 40650 * @returns {Array} Returns the function names. 40651 * @see _.functionsIn 40652 * @example 40653 * 40654 * function Foo() { 40655 * this.a = _.constant('a'); 40656 * this.b = _.constant('b'); 40657 * } 40658 * 40659 * Foo.prototype.c = _.constant('c'); 40660 * 40661 * _.functions(new Foo); 40662 * // => ['a', 'b'] 40663 */ 40664 function functions(object) { 40665 return object == null ? [] : baseFunctions(object, keys(object)); 40666 } 40667 40668 /** 40669 * Creates an array of function property names from own and inherited 40670 * enumerable properties of `object`. 40671 * 40672 * @static 40673 * @memberOf _ 40674 * @since 4.0.0 40675 * @category Object 40676 * @param {Object} object The object to inspect. 40677 * @returns {Array} Returns the function names. 40678 * @see _.functions 40679 * @example 40680 * 40681 * function Foo() { 40682 * this.a = _.constant('a'); 40683 * this.b = _.constant('b'); 40684 * } 40685 * 40686 * Foo.prototype.c = _.constant('c'); 40687 * 40688 * _.functionsIn(new Foo); 40689 * // => ['a', 'b', 'c'] 40690 */ 40691 function functionsIn(object) { 40692 return object == null ? [] : baseFunctions(object, keysIn(object)); 40693 } 40694 40695 /** 40696 * Gets the value at `path` of `object`. If the resolved value is 40697 * `undefined`, the `defaultValue` is returned in its place. 40698 * 40699 * @static 40700 * @memberOf _ 40701 * @since 3.7.0 40702 * @category Object 40703 * @param {Object} object The object to query. 40704 * @param {Array|string} path The path of the property to get. 40705 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 40706 * @returns {*} Returns the resolved value. 40707 * @example 40708 * 40709 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 40710 * 40711 * _.get(object, 'a[0].b.c'); 40712 * // => 3 40713 * 40714 * _.get(object, ['a', '0', 'b', 'c']); 40715 * // => 3 40716 * 40717 * _.get(object, 'a.b.c', 'default'); 40718 * // => 'default' 40719 */ 40720 function get(object, path, defaultValue) { 40721 var result = object == null ? undefined : baseGet(object, path); 40722 return result === undefined ? defaultValue : result; 40723 } 40724 40725 /** 40726 * Checks if `path` is a direct property of `object`. 40727 * 40728 * @static 40729 * @since 0.1.0 40730 * @memberOf _ 40731 * @category Object 40732 * @param {Object} object The object to query. 40733 * @param {Array|string} path The path to check. 40734 * @returns {boolean} Returns `true` if `path` exists, else `false`. 40735 * @example 40736 * 40737 * var object = { 'a': { 'b': 2 } }; 40738 * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 40739 * 40740 * _.has(object, 'a'); 40741 * // => true 40742 * 40743 * _.has(object, 'a.b'); 40744 * // => true 40745 * 40746 * _.has(object, ['a', 'b']); 40747 * // => true 40748 * 40749 * _.has(other, 'a'); 40750 * // => false 40751 */ 40752 function has(object, path) { 40753 return object != null && hasPath(object, path, baseHas); 40754 } 40755 40756 /** 40757 * Checks if `path` is a direct or inherited property of `object`. 40758 * 40759 * @static 40760 * @memberOf _ 40761 * @since 4.0.0 40762 * @category Object 40763 * @param {Object} object The object to query. 40764 * @param {Array|string} path The path to check. 40765 * @returns {boolean} Returns `true` if `path` exists, else `false`. 40766 * @example 40767 * 40768 * var object = _.create({ 'a': _.create({ 'b': 2 }) }); 40769 * 40770 * _.hasIn(object, 'a'); 40771 * // => true 40772 * 40773 * _.hasIn(object, 'a.b'); 40774 * // => true 40775 * 40776 * _.hasIn(object, ['a', 'b']); 40777 * // => true 40778 * 40779 * _.hasIn(object, 'b'); 40780 * // => false 40781 */ 40782 function hasIn(object, path) { 40783 return object != null && hasPath(object, path, baseHasIn); 40784 } 40785 40786 /** 40787 * Creates an object composed of the inverted keys and values of `object`. 40788 * If `object` contains duplicate values, subsequent values overwrite 40789 * property assignments of previous values. 40790 * 40791 * @static 40792 * @memberOf _ 40793 * @since 0.7.0 40794 * @category Object 40795 * @param {Object} object The object to invert. 40796 * @returns {Object} Returns the new inverted object. 40797 * @example 40798 * 40799 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 40800 * 40801 * _.invert(object); 40802 * // => { '1': 'c', '2': 'b' } 40803 */ 40804 var invert = createInverter(function(result, value, key) { 40805 if (value != null && 40806 typeof value.toString != 'function') { 40807 value = nativeObjectToString.call(value); 40808 } 40809 40810 result[value] = key; 40811 }, constant(identity)); 40812 40813 /** 40814 * This method is like `_.invert` except that the inverted object is generated 40815 * from the results of running each element of `object` thru `iteratee`. The 40816 * corresponding inverted value of each inverted key is an array of keys 40817 * responsible for generating the inverted value. The iteratee is invoked 40818 * with one argument: (value). 40819 * 40820 * @static 40821 * @memberOf _ 40822 * @since 4.1.0 40823 * @category Object 40824 * @param {Object} object The object to invert. 40825 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 40826 * @returns {Object} Returns the new inverted object. 40827 * @example 40828 * 40829 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 40830 * 40831 * _.invertBy(object); 40832 * // => { '1': ['a', 'c'], '2': ['b'] } 40833 * 40834 * _.invertBy(object, function(value) { 40835 * return 'group' + value; 40836 * }); 40837 * // => { 'group1': ['a', 'c'], 'group2': ['b'] } 40838 */ 40839 var invertBy = createInverter(function(result, value, key) { 40840 if (value != null && 40841 typeof value.toString != 'function') { 40842 value = nativeObjectToString.call(value); 40843 } 40844 40845 if (hasOwnProperty.call(result, value)) { 40846 result[value].push(key); 40847 } else { 40848 result[value] = [key]; 40849 } 40850 }, getIteratee); 40851 40852 /** 40853 * Invokes the method at `path` of `object`. 40854 * 40855 * @static 40856 * @memberOf _ 40857 * @since 4.0.0 40858 * @category Object 40859 * @param {Object} object The object to query. 40860 * @param {Array|string} path The path of the method to invoke. 40861 * @param {...*} [args] The arguments to invoke the method with. 40862 * @returns {*} Returns the result of the invoked method. 40863 * @example 40864 * 40865 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; 40866 * 40867 * _.invoke(object, 'a[0].b.c.slice', 1, 3); 40868 * // => [2, 3] 40869 */ 40870 var invoke = baseRest(baseInvoke); 40871 40872 /** 40873 * Creates an array of the own enumerable property names of `object`. 40874 * 40875 * **Note:** Non-object values are coerced to objects. See the 40876 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 40877 * for more details. 40878 * 40879 * @static 40880 * @since 0.1.0 40881 * @memberOf _ 40882 * @category Object 40883 * @param {Object} object The object to query. 40884 * @returns {Array} Returns the array of property names. 40885 * @example 40886 * 40887 * function Foo() { 40888 * this.a = 1; 40889 * this.b = 2; 40890 * } 40891 * 40892 * Foo.prototype.c = 3; 40893 * 40894 * _.keys(new Foo); 40895 * // => ['a', 'b'] (iteration order is not guaranteed) 40896 * 40897 * _.keys('hi'); 40898 * // => ['0', '1'] 40899 */ 40900 function keys(object) { 40901 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 40902 } 40903 40904 /** 40905 * Creates an array of the own and inherited enumerable property names of `object`. 40906 * 40907 * **Note:** Non-object values are coerced to objects. 40908 * 40909 * @static 40910 * @memberOf _ 40911 * @since 3.0.0 40912 * @category Object 40913 * @param {Object} object The object to query. 40914 * @returns {Array} Returns the array of property names. 40915 * @example 40916 * 40917 * function Foo() { 40918 * this.a = 1; 40919 * this.b = 2; 40920 * } 40921 * 40922 * Foo.prototype.c = 3; 40923 * 40924 * _.keysIn(new Foo); 40925 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 40926 */ 40927 function keysIn(object) { 40928 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); 40929 } 40930 40931 /** 40932 * The opposite of `_.mapValues`; this method creates an object with the 40933 * same values as `object` and keys generated by running each own enumerable 40934 * string keyed property of `object` thru `iteratee`. The iteratee is invoked 40935 * with three arguments: (value, key, object). 40936 * 40937 * @static 40938 * @memberOf _ 40939 * @since 3.8.0 40940 * @category Object 40941 * @param {Object} object The object to iterate over. 40942 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40943 * @returns {Object} Returns the new mapped object. 40944 * @see _.mapValues 40945 * @example 40946 * 40947 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { 40948 * return key + value; 40949 * }); 40950 * // => { 'a1': 1, 'b2': 2 } 40951 */ 40952 function mapKeys(object, iteratee) { 40953 var result = {}; 40954 iteratee = getIteratee(iteratee, 3); 40955 40956 baseForOwn(object, function(value, key, object) { 40957 baseAssignValue(result, iteratee(value, key, object), value); 40958 }); 40959 return result; 40960 } 40961 40962 /** 40963 * Creates an object with the same keys as `object` and values generated 40964 * by running each own enumerable string keyed property of `object` thru 40965 * `iteratee`. The iteratee is invoked with three arguments: 40966 * (value, key, object). 40967 * 40968 * @static 40969 * @memberOf _ 40970 * @since 2.4.0 40971 * @category Object 40972 * @param {Object} object The object to iterate over. 40973 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40974 * @returns {Object} Returns the new mapped object. 40975 * @see _.mapKeys 40976 * @example 40977 * 40978 * var users = { 40979 * 'fred': { 'user': 'fred', 'age': 40 }, 40980 * 'pebbles': { 'user': 'pebbles', 'age': 1 } 40981 * }; 40982 * 40983 * _.mapValues(users, function(o) { return o.age; }); 40984 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 40985 * 40986 * // The `_.property` iteratee shorthand. 40987 * _.mapValues(users, 'age'); 40988 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 40989 */ 40990 function mapValues(object, iteratee) { 40991 var result = {}; 40992 iteratee = getIteratee(iteratee, 3); 40993 40994 baseForOwn(object, function(value, key, object) { 40995 baseAssignValue(result, key, iteratee(value, key, object)); 40996 }); 40997 return result; 40998 } 40999 41000 /** 41001 * This method is like `_.assign` except that it recursively merges own and 41002 * inherited enumerable string keyed properties of source objects into the 41003 * destination object. Source properties that resolve to `undefined` are 41004 * skipped if a destination value exists. Array and plain object properties 41005 * are merged recursively. Other objects and value types are overridden by 41006 * assignment. Source objects are applied from left to right. Subsequent 41007 * sources overwrite property assignments of previous sources. 41008 * 41009 * **Note:** This method mutates `object`. 41010 * 41011 * @static 41012 * @memberOf _ 41013 * @since 0.5.0 41014 * @category Object 41015 * @param {Object} object The destination object. 41016 * @param {...Object} [sources] The source objects. 41017 * @returns {Object} Returns `object`. 41018 * @example 41019 * 41020 * var object = { 41021 * 'a': [{ 'b': 2 }, { 'd': 4 }] 41022 * }; 41023 * 41024 * var other = { 41025 * 'a': [{ 'c': 3 }, { 'e': 5 }] 41026 * }; 41027 * 41028 * _.merge(object, other); 41029 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } 41030 */ 41031 var merge = createAssigner(function(object, source, srcIndex) { 41032 baseMerge(object, source, srcIndex); 41033 }); 41034 41035 /** 41036 * This method is like `_.merge` except that it accepts `customizer` which 41037 * is invoked to produce the merged values of the destination and source 41038 * properties. If `customizer` returns `undefined`, merging is handled by the 41039 * method instead. The `customizer` is invoked with six arguments: 41040 * (objValue, srcValue, key, object, source, stack). 41041 * 41042 * **Note:** This method mutates `object`. 41043 * 41044 * @static 41045 * @memberOf _ 41046 * @since 4.0.0 41047 * @category Object 41048 * @param {Object} object The destination object. 41049 * @param {...Object} sources The source objects. 41050 * @param {Function} customizer The function to customize assigned values. 41051 * @returns {Object} Returns `object`. 41052 * @example 41053 * 41054 * function customizer(objValue, srcValue) { 41055 * if (_.isArray(objValue)) { 41056 * return objValue.concat(srcValue); 41057 * } 41058 * } 41059 * 41060 * var object = { 'a': [1], 'b': [2] }; 41061 * var other = { 'a': [3], 'b': [4] }; 41062 * 41063 * _.mergeWith(object, other, customizer); 41064 * // => { 'a': [1, 3], 'b': [2, 4] } 41065 */ 41066 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { 41067 baseMerge(object, source, srcIndex, customizer); 41068 }); 41069 41070 /** 41071 * The opposite of `_.pick`; this method creates an object composed of the 41072 * own and inherited enumerable property paths of `object` that are not omitted. 41073 * 41074 * **Note:** This method is considerably slower than `_.pick`. 41075 * 41076 * @static 41077 * @since 0.1.0 41078 * @memberOf _ 41079 * @category Object 41080 * @param {Object} object The source object. 41081 * @param {...(string|string[])} [paths] The property paths to omit. 41082 * @returns {Object} Returns the new object. 41083 * @example 41084 * 41085 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 41086 * 41087 * _.omit(object, ['a', 'c']); 41088 * // => { 'b': '2' } 41089 */ 41090 var omit = flatRest(function(object, paths) { 41091 var result = {}; 41092 if (object == null) { 41093 return result; 41094 } 41095 var isDeep = false; 41096 paths = arrayMap(paths, function(path) { 41097 path = castPath(path, object); 41098 isDeep || (isDeep = path.length > 1); 41099 return path; 41100 }); 41101 copyObject(object, getAllKeysIn(object), result); 41102 if (isDeep) { 41103 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); 41104 } 41105 var length = paths.length; 41106 while (length--) { 41107 baseUnset(result, paths[length]); 41108 } 41109 return result; 41110 }); 41111 41112 /** 41113 * The opposite of `_.pickBy`; this method creates an object composed of 41114 * the own and inherited enumerable string keyed properties of `object` that 41115 * `predicate` doesn't return truthy for. The predicate is invoked with two 41116 * arguments: (value, key). 41117 * 41118 * @static 41119 * @memberOf _ 41120 * @since 4.0.0 41121 * @category Object 41122 * @param {Object} object The source object. 41123 * @param {Function} [predicate=_.identity] The function invoked per property. 41124 * @returns {Object} Returns the new object. 41125 * @example 41126 * 41127 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 41128 * 41129 * _.omitBy(object, _.isNumber); 41130 * // => { 'b': '2' } 41131 */ 41132 function omitBy(object, predicate) { 41133 return pickBy(object, negate(getIteratee(predicate))); 41134 } 41135 41136 /** 41137 * Creates an object composed of the picked `object` properties. 41138 * 41139 * @static 41140 * @since 0.1.0 41141 * @memberOf _ 41142 * @category Object 41143 * @param {Object} object The source object. 41144 * @param {...(string|string[])} [paths] The property paths to pick. 41145 * @returns {Object} Returns the new object. 41146 * @example 41147 * 41148 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 41149 * 41150 * _.pick(object, ['a', 'c']); 41151 * // => { 'a': 1, 'c': 3 } 41152 */ 41153 var pick = flatRest(function(object, paths) { 41154 return object == null ? {} : basePick(object, paths); 41155 }); 41156 41157 /** 41158 * Creates an object composed of the `object` properties `predicate` returns 41159 * truthy for. The predicate is invoked with two arguments: (value, key). 41160 * 41161 * @static 41162 * @memberOf _ 41163 * @since 4.0.0 41164 * @category Object 41165 * @param {Object} object The source object. 41166 * @param {Function} [predicate=_.identity] The function invoked per property. 41167 * @returns {Object} Returns the new object. 41168 * @example 41169 * 41170 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 41171 * 41172 * _.pickBy(object, _.isNumber); 41173 * // => { 'a': 1, 'c': 3 } 41174 */ 41175 function pickBy(object, predicate) { 41176 if (object == null) { 41177 return {}; 41178 } 41179 var props = arrayMap(getAllKeysIn(object), function(prop) { 41180 return [prop]; 41181 }); 41182 predicate = getIteratee(predicate); 41183 return basePickBy(object, props, function(value, path) { 41184 return predicate(value, path[0]); 41185 }); 41186 } 41187 41188 /** 41189 * This method is like `_.get` except that if the resolved value is a 41190 * function it's invoked with the `this` binding of its parent object and 41191 * its result is returned. 41192 * 41193 * @static 41194 * @since 0.1.0 41195 * @memberOf _ 41196 * @category Object 41197 * @param {Object} object The object to query. 41198 * @param {Array|string} path The path of the property to resolve. 41199 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 41200 * @returns {*} Returns the resolved value. 41201 * @example 41202 * 41203 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 41204 * 41205 * _.result(object, 'a[0].b.c1'); 41206 * // => 3 41207 * 41208 * _.result(object, 'a[0].b.c2'); 41209 * // => 4 41210 * 41211 * _.result(object, 'a[0].b.c3', 'default'); 41212 * // => 'default' 41213 * 41214 * _.result(object, 'a[0].b.c3', _.constant('default')); 41215 * // => 'default' 41216 */ 41217 function result(object, path, defaultValue) { 41218 path = castPath(path, object); 41219 41220 var index = -1, 41221 length = path.length; 41222 41223 // Ensure the loop is entered when path is empty. 41224 if (!length) { 41225 length = 1; 41226 object = undefined; 41227 } 41228 while (++index < length) { 41229 var value = object == null ? undefined : object[toKey(path[index])]; 41230 if (value === undefined) { 41231 index = length; 41232 value = defaultValue; 41233 } 41234 object = isFunction(value) ? value.call(object) : value; 41235 } 41236 return object; 41237 } 41238 41239 /** 41240 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, 41241 * it's created. Arrays are created for missing index properties while objects 41242 * are created for all other missing properties. Use `_.setWith` to customize 41243 * `path` creation. 41244 * 41245 * **Note:** This method mutates `object`. 41246 * 41247 * @static 41248 * @memberOf _ 41249 * @since 3.7.0 41250 * @category Object 41251 * @param {Object} object The object to modify. 41252 * @param {Array|string} path The path of the property to set. 41253 * @param {*} value The value to set. 41254 * @returns {Object} Returns `object`. 41255 * @example 41256 * 41257 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 41258 * 41259 * _.set(object, 'a[0].b.c', 4); 41260 * console.log(object.a[0].b.c); 41261 * // => 4 41262 * 41263 * _.set(object, ['x', '0', 'y', 'z'], 5); 41264 * console.log(object.x[0].y.z); 41265 * // => 5 41266 */ 41267 function set(object, path, value) { 41268 return object == null ? object : baseSet(object, path, value); 41269 } 41270 41271 /** 41272 * This method is like `_.set` except that it accepts `customizer` which is 41273 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 41274 * path creation is handled by the method instead. The `customizer` is invoked 41275 * with three arguments: (nsValue, key, nsObject). 41276 * 41277 * **Note:** This method mutates `object`. 41278 * 41279 * @static 41280 * @memberOf _ 41281 * @since 4.0.0 41282 * @category Object 41283 * @param {Object} object The object to modify. 41284 * @param {Array|string} path The path of the property to set. 41285 * @param {*} value The value to set. 41286 * @param {Function} [customizer] The function to customize assigned values. 41287 * @returns {Object} Returns `object`. 41288 * @example 41289 * 41290 * var object = {}; 41291 * 41292 * _.setWith(object, '[0][1]', 'a', Object); 41293 * // => { '0': { '1': 'a' } } 41294 */ 41295 function setWith(object, path, value, customizer) { 41296 customizer = typeof customizer == 'function' ? customizer : undefined; 41297 return object == null ? object : baseSet(object, path, value, customizer); 41298 } 41299 41300 /** 41301 * Creates an array of own enumerable string keyed-value pairs for `object` 41302 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its 41303 * entries are returned. 41304 * 41305 * @static 41306 * @memberOf _ 41307 * @since 4.0.0 41308 * @alias entries 41309 * @category Object 41310 * @param {Object} object The object to query. 41311 * @returns {Array} Returns the key-value pairs. 41312 * @example 41313 * 41314 * function Foo() { 41315 * this.a = 1; 41316 * this.b = 2; 41317 * } 41318 * 41319 * Foo.prototype.c = 3; 41320 * 41321 * _.toPairs(new Foo); 41322 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) 41323 */ 41324 var toPairs = createToPairs(keys); 41325 41326 /** 41327 * Creates an array of own and inherited enumerable string keyed-value pairs 41328 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map 41329 * or set, its entries are returned. 41330 * 41331 * @static 41332 * @memberOf _ 41333 * @since 4.0.0 41334 * @alias entriesIn 41335 * @category Object 41336 * @param {Object} object The object to query. 41337 * @returns {Array} Returns the key-value pairs. 41338 * @example 41339 * 41340 * function Foo() { 41341 * this.a = 1; 41342 * this.b = 2; 41343 * } 41344 * 41345 * Foo.prototype.c = 3; 41346 * 41347 * _.toPairsIn(new Foo); 41348 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) 41349 */ 41350 var toPairsIn = createToPairs(keysIn); 41351 41352 /** 41353 * An alternative to `_.reduce`; this method transforms `object` to a new 41354 * `accumulator` object which is the result of running each of its own 41355 * enumerable string keyed properties thru `iteratee`, with each invocation 41356 * potentially mutating the `accumulator` object. If `accumulator` is not 41357 * provided, a new object with the same `[[Prototype]]` will be used. The 41358 * iteratee is invoked with four arguments: (accumulator, value, key, object). 41359 * Iteratee functions may exit iteration early by explicitly returning `false`. 41360 * 41361 * @static 41362 * @memberOf _ 41363 * @since 1.3.0 41364 * @category Object 41365 * @param {Object} object The object to iterate over. 41366 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 41367 * @param {*} [accumulator] The custom accumulator value. 41368 * @returns {*} Returns the accumulated value. 41369 * @example 41370 * 41371 * _.transform([2, 3, 4], function(result, n) { 41372 * result.push(n *= n); 41373 * return n % 2 == 0; 41374 * }, []); 41375 * // => [4, 9] 41376 * 41377 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 41378 * (result[value] || (result[value] = [])).push(key); 41379 * }, {}); 41380 * // => { '1': ['a', 'c'], '2': ['b'] } 41381 */ 41382 function transform(object, iteratee, accumulator) { 41383 var isArr = isArray(object), 41384 isArrLike = isArr || isBuffer(object) || isTypedArray(object); 41385 41386 iteratee = getIteratee(iteratee, 4); 41387 if (accumulator == null) { 41388 var Ctor = object && object.constructor; 41389 if (isArrLike) { 41390 accumulator = isArr ? new Ctor : []; 41391 } 41392 else if (isObject(object)) { 41393 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; 41394 } 41395 else { 41396 accumulator = {}; 41397 } 41398 } 41399 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { 41400 return iteratee(accumulator, value, index, object); 41401 }); 41402 return accumulator; 41403 } 41404 41405 /** 41406 * Removes the property at `path` of `object`. 41407 * 41408 * **Note:** This method mutates `object`. 41409 * 41410 * @static 41411 * @memberOf _ 41412 * @since 4.0.0 41413 * @category Object 41414 * @param {Object} object The object to modify. 41415 * @param {Array|string} path The path of the property to unset. 41416 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 41417 * @example 41418 * 41419 * var object = { 'a': [{ 'b': { 'c': 7 } }] }; 41420 * _.unset(object, 'a[0].b.c'); 41421 * // => true 41422 * 41423 * console.log(object); 41424 * // => { 'a': [{ 'b': {} }] }; 41425 * 41426 * _.unset(object, ['a', '0', 'b', 'c']); 41427 * // => true 41428 * 41429 * console.log(object); 41430 * // => { 'a': [{ 'b': {} }] }; 41431 */ 41432 function unset(object, path) { 41433 return object == null ? true : baseUnset(object, path); 41434 } 41435 41436 /** 41437 * This method is like `_.set` except that accepts `updater` to produce the 41438 * value to set. Use `_.updateWith` to customize `path` creation. The `updater` 41439 * is invoked with one argument: (value). 41440 * 41441 * **Note:** This method mutates `object`. 41442 * 41443 * @static 41444 * @memberOf _ 41445 * @since 4.6.0 41446 * @category Object 41447 * @param {Object} object The object to modify. 41448 * @param {Array|string} path The path of the property to set. 41449 * @param {Function} updater The function to produce the updated value. 41450 * @returns {Object} Returns `object`. 41451 * @example 41452 * 41453 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 41454 * 41455 * _.update(object, 'a[0].b.c', function(n) { return n * n; }); 41456 * console.log(object.a[0].b.c); 41457 * // => 9 41458 * 41459 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); 41460 * console.log(object.x[0].y.z); 41461 * // => 0 41462 */ 41463 function update(object, path, updater) { 41464 return object == null ? object : baseUpdate(object, path, castFunction(updater)); 41465 } 41466 41467 /** 41468 * This method is like `_.update` except that it accepts `customizer` which is 41469 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 41470 * path creation is handled by the method instead. The `customizer` is invoked 41471 * with three arguments: (nsValue, key, nsObject). 41472 * 41473 * **Note:** This method mutates `object`. 41474 * 41475 * @static 41476 * @memberOf _ 41477 * @since 4.6.0 41478 * @category Object 41479 * @param {Object} object The object to modify. 41480 * @param {Array|string} path The path of the property to set. 41481 * @param {Function} updater The function to produce the updated value. 41482 * @param {Function} [customizer] The function to customize assigned values. 41483 * @returns {Object} Returns `object`. 41484 * @example 41485 * 41486 * var object = {}; 41487 * 41488 * _.updateWith(object, '[0][1]', _.constant('a'), Object); 41489 * // => { '0': { '1': 'a' } } 41490 */ 41491 function updateWith(object, path, updater, customizer) { 41492 customizer = typeof customizer == 'function' ? customizer : undefined; 41493 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); 41494 } 41495 41496 /** 41497 * Creates an array of the own enumerable string keyed property values of `object`. 41498 * 41499 * **Note:** Non-object values are coerced to objects. 41500 * 41501 * @static 41502 * @since 0.1.0 41503 * @memberOf _ 41504 * @category Object 41505 * @param {Object} object The object to query. 41506 * @returns {Array} Returns the array of property values. 41507 * @example 41508 * 41509 * function Foo() { 41510 * this.a = 1; 41511 * this.b = 2; 41512 * } 41513 * 41514 * Foo.prototype.c = 3; 41515 * 41516 * _.values(new Foo); 41517 * // => [1, 2] (iteration order is not guaranteed) 41518 * 41519 * _.values('hi'); 41520 * // => ['h', 'i'] 41521 */ 41522 function values(object) { 41523 return object == null ? [] : baseValues(object, keys(object)); 41524 } 41525 41526 /** 41527 * Creates an array of the own and inherited enumerable string keyed property 41528 * values of `object`. 41529 * 41530 * **Note:** Non-object values are coerced to objects. 41531 * 41532 * @static 41533 * @memberOf _ 41534 * @since 3.0.0 41535 * @category Object 41536 * @param {Object} object The object to query. 41537 * @returns {Array} Returns the array of property values. 41538 * @example 41539 * 41540 * function Foo() { 41541 * this.a = 1; 41542 * this.b = 2; 41543 * } 41544 * 41545 * Foo.prototype.c = 3; 41546 * 41547 * _.valuesIn(new Foo); 41548 * // => [1, 2, 3] (iteration order is not guaranteed) 41549 */ 41550 function valuesIn(object) { 41551 return object == null ? [] : baseValues(object, keysIn(object)); 41552 } 41553 41554 /*------------------------------------------------------------------------*/ 41555 41556 /** 41557 * Clamps `number` within the inclusive `lower` and `upper` bounds. 41558 * 41559 * @static 41560 * @memberOf _ 41561 * @since 4.0.0 41562 * @category Number 41563 * @param {number} number The number to clamp. 41564 * @param {number} [lower] The lower bound. 41565 * @param {number} upper The upper bound. 41566 * @returns {number} Returns the clamped number. 41567 * @example 41568 * 41569 * _.clamp(-10, -5, 5); 41570 * // => -5 41571 * 41572 * _.clamp(10, -5, 5); 41573 * // => 5 41574 */ 41575 function clamp(number, lower, upper) { 41576 if (upper === undefined) { 41577 upper = lower; 41578 lower = undefined; 41579 } 41580 if (upper !== undefined) { 41581 upper = toNumber(upper); 41582 upper = upper === upper ? upper : 0; 41583 } 41584 if (lower !== undefined) { 41585 lower = toNumber(lower); 41586 lower = lower === lower ? lower : 0; 41587 } 41588 return baseClamp(toNumber(number), lower, upper); 41589 } 41590 41591 /** 41592 * Checks if `n` is between `start` and up to, but not including, `end`. If 41593 * `end` is not specified, it's set to `start` with `start` then set to `0`. 41594 * If `start` is greater than `end` the params are swapped to support 41595 * negative ranges. 41596 * 41597 * @static 41598 * @memberOf _ 41599 * @since 3.3.0 41600 * @category Number 41601 * @param {number} number The number to check. 41602 * @param {number} [start=0] The start of the range. 41603 * @param {number} end The end of the range. 41604 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 41605 * @see _.range, _.rangeRight 41606 * @example 41607 * 41608 * _.inRange(3, 2, 4); 41609 * // => true 41610 * 41611 * _.inRange(4, 8); 41612 * // => true 41613 * 41614 * _.inRange(4, 2); 41615 * // => false 41616 * 41617 * _.inRange(2, 2); 41618 * // => false 41619 * 41620 * _.inRange(1.2, 2); 41621 * // => true 41622 * 41623 * _.inRange(5.2, 4); 41624 * // => false 41625 * 41626 * _.inRange(-3, -2, -6); 41627 * // => true 41628 */ 41629 function inRange(number, start, end) { 41630 start = toFinite(start); 41631 if (end === undefined) { 41632 end = start; 41633 start = 0; 41634 } else { 41635 end = toFinite(end); 41636 } 41637 number = toNumber(number); 41638 return baseInRange(number, start, end); 41639 } 41640 41641 /** 41642 * Produces a random number between the inclusive `lower` and `upper` bounds. 41643 * If only one argument is provided a number between `0` and the given number 41644 * is returned. If `floating` is `true`, or either `lower` or `upper` are 41645 * floats, a floating-point number is returned instead of an integer. 41646 * 41647 * **Note:** JavaScript follows the IEEE-754 standard for resolving 41648 * floating-point values which can produce unexpected results. 41649 * 41650 * @static 41651 * @memberOf _ 41652 * @since 0.7.0 41653 * @category Number 41654 * @param {number} [lower=0] The lower bound. 41655 * @param {number} [upper=1] The upper bound. 41656 * @param {boolean} [floating] Specify returning a floating-point number. 41657 * @returns {number} Returns the random number. 41658 * @example 41659 * 41660 * _.random(0, 5); 41661 * // => an integer between 0 and 5 41662 * 41663 * _.random(5); 41664 * // => also an integer between 0 and 5 41665 * 41666 * _.random(5, true); 41667 * // => a floating-point number between 0 and 5 41668 * 41669 * _.random(1.2, 5.2); 41670 * // => a floating-point number between 1.2 and 5.2 41671 */ 41672 function random(lower, upper, floating) { 41673 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { 41674 upper = floating = undefined; 41675 } 41676 if (floating === undefined) { 41677 if (typeof upper == 'boolean') { 41678 floating = upper; 41679 upper = undefined; 41680 } 41681 else if (typeof lower == 'boolean') { 41682 floating = lower; 41683 lower = undefined; 41684 } 41685 } 41686 if (lower === undefined && upper === undefined) { 41687 lower = 0; 41688 upper = 1; 41689 } 41690 else { 41691 lower = toFinite(lower); 41692 if (upper === undefined) { 41693 upper = lower; 41694 lower = 0; 41695 } else { 41696 upper = toFinite(upper); 41697 } 41698 } 41699 if (lower > upper) { 41700 var temp = lower; 41701 lower = upper; 41702 upper = temp; 41703 } 41704 if (floating || lower % 1 || upper % 1) { 41705 var rand = nativeRandom(); 41706 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); 41707 } 41708 return baseRandom(lower, upper); 41709 } 41710 41711 /*------------------------------------------------------------------------*/ 41712 41713 /** 41714 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). 41715 * 41716 * @static 41717 * @memberOf _ 41718 * @since 3.0.0 41719 * @category String 41720 * @param {string} [string=''] The string to convert. 41721 * @returns {string} Returns the camel cased string. 41722 * @example 41723 * 41724 * _.camelCase('Foo Bar'); 41725 * // => 'fooBar' 41726 * 41727 * _.camelCase('--foo-bar--'); 41728 * // => 'fooBar' 41729 * 41730 * _.camelCase('__FOO_BAR__'); 41731 * // => 'fooBar' 41732 */ 41733 var camelCase = createCompounder(function(result, word, index) { 41734 word = word.toLowerCase(); 41735 return result + (index ? capitalize(word) : word); 41736 }); 41737 41738 /** 41739 * Converts the first character of `string` to upper case and the remaining 41740 * to lower case. 41741 * 41742 * @static 41743 * @memberOf _ 41744 * @since 3.0.0 41745 * @category String 41746 * @param {string} [string=''] The string to capitalize. 41747 * @returns {string} Returns the capitalized string. 41748 * @example 41749 * 41750 * _.capitalize('FRED'); 41751 * // => 'Fred' 41752 */ 41753 function capitalize(string) { 41754 return upperFirst(toString(string).toLowerCase()); 41755 } 41756 41757 /** 41758 * Deburrs `string` by converting 41759 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) 41760 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) 41761 * letters to basic Latin letters and removing 41762 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). 41763 * 41764 * @static 41765 * @memberOf _ 41766 * @since 3.0.0 41767 * @category String 41768 * @param {string} [string=''] The string to deburr. 41769 * @returns {string} Returns the deburred string. 41770 * @example 41771 * 41772 * _.deburr('déjàvu'); 41773 * // => 'deja vu' 41774 */ 41775 function deburr(string) { 41776 string = toString(string); 41777 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); 41778 } 41779 41780 /** 41781 * Checks if `string` ends with the given target string. 41782 * 41783 * @static 41784 * @memberOf _ 41785 * @since 3.0.0 41786 * @category String 41787 * @param {string} [string=''] The string to inspect. 41788 * @param {string} [target] The string to search for. 41789 * @param {number} [position=string.length] The position to search up to. 41790 * @returns {boolean} Returns `true` if `string` ends with `target`, 41791 * else `false`. 41792 * @example 41793 * 41794 * _.endsWith('abc', 'c'); 41795 * // => true 41796 * 41797 * _.endsWith('abc', 'b'); 41798 * // => false 41799 * 41800 * _.endsWith('abc', 'b', 2); 41801 * // => true 41802 */ 41803 function endsWith(string, target, position) { 41804 string = toString(string); 41805 target = baseToString(target); 41806 41807 var length = string.length; 41808 position = position === undefined 41809 ? length 41810 : baseClamp(toInteger(position), 0, length); 41811 41812 var end = position; 41813 position -= target.length; 41814 return position >= 0 && string.slice(position, end) == target; 41815 } 41816 41817 /** 41818 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their 41819 * corresponding HTML entities. 41820 * 41821 * **Note:** No other characters are escaped. To escape additional 41822 * characters use a third-party library like [_he_](https://mths.be/he). 41823 * 41824 * Though the ">" character is escaped for symmetry, characters like 41825 * ">" and "/" don't need escaping in HTML and have no special meaning 41826 * unless they're part of a tag or unquoted attribute value. See 41827 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 41828 * (under "semi-related fun fact") for more details. 41829 * 41830 * When working with HTML you should always 41831 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce 41832 * XSS vectors. 41833 * 41834 * @static 41835 * @since 0.1.0 41836 * @memberOf _ 41837 * @category String 41838 * @param {string} [string=''] The string to escape. 41839 * @returns {string} Returns the escaped string. 41840 * @example 41841 * 41842 * _.escape('fred, barney, & pebbles'); 41843 * // => 'fred, barney, & pebbles' 41844 */ 41845 function escape(string) { 41846 string = toString(string); 41847 return (string && reHasUnescapedHtml.test(string)) 41848 ? string.replace(reUnescapedHtml, escapeHtmlChar) 41849 : string; 41850 } 41851 41852 /** 41853 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", 41854 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. 41855 * 41856 * @static 41857 * @memberOf _ 41858 * @since 3.0.0 41859 * @category String 41860 * @param {string} [string=''] The string to escape. 41861 * @returns {string} Returns the escaped string. 41862 * @example 41863 * 41864 * _.escapeRegExp('[lodash](https://lodash.com/)'); 41865 * // => '\[lodash\]\(https://lodash\.com/\)' 41866 */ 41867 function escapeRegExp(string) { 41868 string = toString(string); 41869 return (string && reHasRegExpChar.test(string)) 41870 ? string.replace(reRegExpChar, '\\$&') 41871 : string; 41872 } 41873 41874 /** 41875 * Converts `string` to 41876 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). 41877 * 41878 * @static 41879 * @memberOf _ 41880 * @since 3.0.0 41881 * @category String 41882 * @param {string} [string=''] The string to convert. 41883 * @returns {string} Returns the kebab cased string. 41884 * @example 41885 * 41886 * _.kebabCase('Foo Bar'); 41887 * // => 'foo-bar' 41888 * 41889 * _.kebabCase('fooBar'); 41890 * // => 'foo-bar' 41891 * 41892 * _.kebabCase('__FOO_BAR__'); 41893 * // => 'foo-bar' 41894 */ 41895 var kebabCase = createCompounder(function(result, word, index) { 41896 return result + (index ? '-' : '') + word.toLowerCase(); 41897 }); 41898 41899 /** 41900 * Converts `string`, as space separated words, to lower case. 41901 * 41902 * @static 41903 * @memberOf _ 41904 * @since 4.0.0 41905 * @category String 41906 * @param {string} [string=''] The string to convert. 41907 * @returns {string} Returns the lower cased string. 41908 * @example 41909 * 41910 * _.lowerCase('--Foo-Bar--'); 41911 * // => 'foo bar' 41912 * 41913 * _.lowerCase('fooBar'); 41914 * // => 'foo bar' 41915 * 41916 * _.lowerCase('__FOO_BAR__'); 41917 * // => 'foo bar' 41918 */ 41919 var lowerCase = createCompounder(function(result, word, index) { 41920 return result + (index ? ' ' : '') + word.toLowerCase(); 41921 }); 41922 41923 /** 41924 * Converts the first character of `string` to lower case. 41925 * 41926 * @static 41927 * @memberOf _ 41928 * @since 4.0.0 41929 * @category String 41930 * @param {string} [string=''] The string to convert. 41931 * @returns {string} Returns the converted string. 41932 * @example 41933 * 41934 * _.lowerFirst('Fred'); 41935 * // => 'fred' 41936 * 41937 * _.lowerFirst('FRED'); 41938 * // => 'fRED' 41939 */ 41940 var lowerFirst = createCaseFirst('toLowerCase'); 41941 41942 /** 41943 * Pads `string` on the left and right sides if it's shorter than `length`. 41944 * Padding characters are truncated if they can't be evenly divided by `length`. 41945 * 41946 * @static 41947 * @memberOf _ 41948 * @since 3.0.0 41949 * @category String 41950 * @param {string} [string=''] The string to pad. 41951 * @param {number} [length=0] The padding length. 41952 * @param {string} [chars=' '] The string used as padding. 41953 * @returns {string} Returns the padded string. 41954 * @example 41955 * 41956 * _.pad('abc', 8); 41957 * // => ' abc ' 41958 * 41959 * _.pad('abc', 8, '_-'); 41960 * // => '_-abc_-_' 41961 * 41962 * _.pad('abc', 3); 41963 * // => 'abc' 41964 */ 41965 function pad(string, length, chars) { 41966 string = toString(string); 41967 length = toInteger(length); 41968 41969 var strLength = length ? stringSize(string) : 0; 41970 if (!length || strLength >= length) { 41971 return string; 41972 } 41973 var mid = (length - strLength) / 2; 41974 return ( 41975 createPadding(nativeFloor(mid), chars) + 41976 string + 41977 createPadding(nativeCeil(mid), chars) 41978 ); 41979 } 41980 41981 /** 41982 * Pads `string` on the right side if it's shorter than `length`. Padding 41983 * characters are truncated if they exceed `length`. 41984 * 41985 * @static 41986 * @memberOf _ 41987 * @since 4.0.0 41988 * @category String 41989 * @param {string} [string=''] The string to pad. 41990 * @param {number} [length=0] The padding length. 41991 * @param {string} [chars=' '] The string used as padding. 41992 * @returns {string} Returns the padded string. 41993 * @example 41994 * 41995 * _.padEnd('abc', 6); 41996 * // => 'abc ' 41997 * 41998 * _.padEnd('abc', 6, '_-'); 41999 * // => 'abc_-_' 42000 * 42001 * _.padEnd('abc', 3); 42002 * // => 'abc' 42003 */ 42004 function padEnd(string, length, chars) { 42005 string = toString(string); 42006 length = toInteger(length); 42007 42008 var strLength = length ? stringSize(string) : 0; 42009 return (length && strLength < length) 42010 ? (string + createPadding(length - strLength, chars)) 42011 : string; 42012 } 42013 42014 /** 42015 * Pads `string` on the left side if it's shorter than `length`. Padding 42016 * characters are truncated if they exceed `length`. 42017 * 42018 * @static 42019 * @memberOf _ 42020 * @since 4.0.0 42021 * @category String 42022 * @param {string} [string=''] The string to pad. 42023 * @param {number} [length=0] The padding length. 42024 * @param {string} [chars=' '] The string used as padding. 42025 * @returns {string} Returns the padded string. 42026 * @example 42027 * 42028 * _.padStart('abc', 6); 42029 * // => ' abc' 42030 * 42031 * _.padStart('abc', 6, '_-'); 42032 * // => '_-_abc' 42033 * 42034 * _.padStart('abc', 3); 42035 * // => 'abc' 42036 */ 42037 function padStart(string, length, chars) { 42038 string = toString(string); 42039 length = toInteger(length); 42040 42041 var strLength = length ? stringSize(string) : 0; 42042 return (length && strLength < length) 42043 ? (createPadding(length - strLength, chars) + string) 42044 : string; 42045 } 42046 42047 /** 42048 * Converts `string` to an integer of the specified radix. If `radix` is 42049 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a 42050 * hexadecimal, in which case a `radix` of `16` is used. 42051 * 42052 * **Note:** This method aligns with the 42053 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. 42054 * 42055 * @static 42056 * @memberOf _ 42057 * @since 1.1.0 42058 * @category String 42059 * @param {string} string The string to convert. 42060 * @param {number} [radix=10] The radix to interpret `value` by. 42061 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42062 * @returns {number} Returns the converted integer. 42063 * @example 42064 * 42065 * _.parseInt('08'); 42066 * // => 8 42067 * 42068 * _.map(['6', '08', '10'], _.parseInt); 42069 * // => [6, 8, 10] 42070 */ 42071 function parseInt(string, radix, guard) { 42072 if (guard || radix == null) { 42073 radix = 0; 42074 } else if (radix) { 42075 radix = +radix; 42076 } 42077 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); 42078 } 42079 42080 /** 42081 * Repeats the given string `n` times. 42082 * 42083 * @static 42084 * @memberOf _ 42085 * @since 3.0.0 42086 * @category String 42087 * @param {string} [string=''] The string to repeat. 42088 * @param {number} [n=1] The number of times to repeat the string. 42089 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42090 * @returns {string} Returns the repeated string. 42091 * @example 42092 * 42093 * _.repeat('*', 3); 42094 * // => '***' 42095 * 42096 * _.repeat('abc', 2); 42097 * // => 'abcabc' 42098 * 42099 * _.repeat('abc', 0); 42100 * // => '' 42101 */ 42102 function repeat(string, n, guard) { 42103 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { 42104 n = 1; 42105 } else { 42106 n = toInteger(n); 42107 } 42108 return baseRepeat(toString(string), n); 42109 } 42110 42111 /** 42112 * Replaces matches for `pattern` in `string` with `replacement`. 42113 * 42114 * **Note:** This method is based on 42115 * [`String#replace`](https://mdn.io/String/replace). 42116 * 42117 * @static 42118 * @memberOf _ 42119 * @since 4.0.0 42120 * @category String 42121 * @param {string} [string=''] The string to modify. 42122 * @param {RegExp|string} pattern The pattern to replace. 42123 * @param {Function|string} replacement The match replacement. 42124 * @returns {string} Returns the modified string. 42125 * @example 42126 * 42127 * _.replace('Hi Fred', 'Fred', 'Barney'); 42128 * // => 'Hi Barney' 42129 */ 42130 function replace() { 42131 var args = arguments, 42132 string = toString(args[0]); 42133 42134 return args.length < 3 ? string : string.replace(args[1], args[2]); 42135 } 42136 42137 /** 42138 * Converts `string` to 42139 * [snake case](https://en.wikipedia.org/wiki/Snake_case). 42140 * 42141 * @static 42142 * @memberOf _ 42143 * @since 3.0.0 42144 * @category String 42145 * @param {string} [string=''] The string to convert. 42146 * @returns {string} Returns the snake cased string. 42147 * @example 42148 * 42149 * _.snakeCase('Foo Bar'); 42150 * // => 'foo_bar' 42151 * 42152 * _.snakeCase('fooBar'); 42153 * // => 'foo_bar' 42154 * 42155 * _.snakeCase('--FOO-BAR--'); 42156 * // => 'foo_bar' 42157 */ 42158 var snakeCase = createCompounder(function(result, word, index) { 42159 return result + (index ? '_' : '') + word.toLowerCase(); 42160 }); 42161 42162 /** 42163 * Splits `string` by `separator`. 42164 * 42165 * **Note:** This method is based on 42166 * [`String#split`](https://mdn.io/String/split). 42167 * 42168 * @static 42169 * @memberOf _ 42170 * @since 4.0.0 42171 * @category String 42172 * @param {string} [string=''] The string to split. 42173 * @param {RegExp|string} separator The separator pattern to split by. 42174 * @param {number} [limit] The length to truncate results to. 42175 * @returns {Array} Returns the string segments. 42176 * @example 42177 * 42178 * _.split('a-b-c', '-', 2); 42179 * // => ['a', 'b'] 42180 */ 42181 function split(string, separator, limit) { 42182 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { 42183 separator = limit = undefined; 42184 } 42185 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; 42186 if (!limit) { 42187 return []; 42188 } 42189 string = toString(string); 42190 if (string && ( 42191 typeof separator == 'string' || 42192 (separator != null && !isRegExp(separator)) 42193 )) { 42194 separator = baseToString(separator); 42195 if (!separator && hasUnicode(string)) { 42196 return castSlice(stringToArray(string), 0, limit); 42197 } 42198 } 42199 return string.split(separator, limit); 42200 } 42201 42202 /** 42203 * Converts `string` to 42204 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). 42205 * 42206 * @static 42207 * @memberOf _ 42208 * @since 3.1.0 42209 * @category String 42210 * @param {string} [string=''] The string to convert. 42211 * @returns {string} Returns the start cased string. 42212 * @example 42213 * 42214 * _.startCase('--foo-bar--'); 42215 * // => 'Foo Bar' 42216 * 42217 * _.startCase('fooBar'); 42218 * // => 'Foo Bar' 42219 * 42220 * _.startCase('__FOO_BAR__'); 42221 * // => 'FOO BAR' 42222 */ 42223 var startCase = createCompounder(function(result, word, index) { 42224 return result + (index ? ' ' : '') + upperFirst(word); 42225 }); 42226 42227 /** 42228 * Checks if `string` starts with the given target string. 42229 * 42230 * @static 42231 * @memberOf _ 42232 * @since 3.0.0 42233 * @category String 42234 * @param {string} [string=''] The string to inspect. 42235 * @param {string} [target] The string to search for. 42236 * @param {number} [position=0] The position to search from. 42237 * @returns {boolean} Returns `true` if `string` starts with `target`, 42238 * else `false`. 42239 * @example 42240 * 42241 * _.startsWith('abc', 'a'); 42242 * // => true 42243 * 42244 * _.startsWith('abc', 'b'); 42245 * // => false 42246 * 42247 * _.startsWith('abc', 'b', 1); 42248 * // => true 42249 */ 42250 function startsWith(string, target, position) { 42251 string = toString(string); 42252 position = position == null 42253 ? 0 42254 : baseClamp(toInteger(position), 0, string.length); 42255 42256 target = baseToString(target); 42257 return string.slice(position, position + target.length) == target; 42258 } 42259 42260 /** 42261 * Creates a compiled template function that can interpolate data properties 42262 * in "interpolate" delimiters, HTML-escape interpolated data properties in 42263 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data 42264 * properties may be accessed as free variables in the template. If a setting 42265 * object is given, it takes precedence over `_.templateSettings` values. 42266 * 42267 * **Note:** In the development build `_.template` utilizes 42268 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) 42269 * for easier debugging. 42270 * 42271 * For more information on precompiling templates see 42272 * [lodash's custom builds documentation](https://lodash.com/custom-builds). 42273 * 42274 * For more information on Chrome extension sandboxes see 42275 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). 42276 * 42277 * @static 42278 * @since 0.1.0 42279 * @memberOf _ 42280 * @category String 42281 * @param {string} [string=''] The template string. 42282 * @param {Object} [options={}] The options object. 42283 * @param {RegExp} [options.escape=_.templateSettings.escape] 42284 * The HTML "escape" delimiter. 42285 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] 42286 * The "evaluate" delimiter. 42287 * @param {Object} [options.imports=_.templateSettings.imports] 42288 * An object to import into the template as free variables. 42289 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] 42290 * The "interpolate" delimiter. 42291 * @param {string} [options.sourceURL='lodash.templateSources[n]'] 42292 * The sourceURL of the compiled template. 42293 * @param {string} [options.variable='obj'] 42294 * The data object variable name. 42295 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42296 * @returns {Function} Returns the compiled template function. 42297 * @example 42298 * 42299 * // Use the "interpolate" delimiter to create a compiled template. 42300 * var compiled = _.template('hello <%= user %>!'); 42301 * compiled({ 'user': 'fred' }); 42302 * // => 'hello fred!' 42303 * 42304 * // Use the HTML "escape" delimiter to escape data property values. 42305 * var compiled = _.template('<b><%- value %></b>'); 42306 * compiled({ 'value': '<script>' }); 42307 * // => '<b><script></b>' 42308 * 42309 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. 42310 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); 42311 * compiled({ 'users': ['fred', 'barney'] }); 42312 * // => '<li>fred</li><li>barney</li>' 42313 * 42314 * // Use the internal `print` function in "evaluate" delimiters. 42315 * var compiled = _.template('<% print("hello " + user); %>!'); 42316 * compiled({ 'user': 'barney' }); 42317 * // => 'hello barney!' 42318 * 42319 * // Use the ES template literal delimiter as an "interpolate" delimiter. 42320 * // Disable support by replacing the "interpolate" delimiter. 42321 * var compiled = _.template('hello ${ user }!'); 42322 * compiled({ 'user': 'pebbles' }); 42323 * // => 'hello pebbles!' 42324 * 42325 * // Use backslashes to treat delimiters as plain text. 42326 * var compiled = _.template('<%= "\\<%- value %\\>" %>'); 42327 * compiled({ 'value': 'ignored' }); 42328 * // => '<%- value %>' 42329 * 42330 * // Use the `imports` option to import `jQuery` as `jq`. 42331 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; 42332 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); 42333 * compiled({ 'users': ['fred', 'barney'] }); 42334 * // => '<li>fred</li><li>barney</li>' 42335 * 42336 * // Use the `sourceURL` option to specify a custom sourceURL for the template. 42337 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); 42338 * compiled(data); 42339 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. 42340 * 42341 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. 42342 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); 42343 * compiled.source; 42344 * // => function(data) { 42345 * // var __t, __p = ''; 42346 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; 42347 * // return __p; 42348 * // } 42349 * 42350 * // Use custom template delimiters. 42351 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; 42352 * var compiled = _.template('hello {{ user }}!'); 42353 * compiled({ 'user': 'mustache' }); 42354 * // => 'hello mustache!' 42355 * 42356 * // Use the `source` property to inline compiled templates for meaningful 42357 * // line numbers in error messages and stack traces. 42358 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ 42359 * var JST = {\ 42360 * "main": ' + _.template(mainText).source + '\ 42361 * };\ 42362 * '); 42363 */ 42364 function template(string, options, guard) { 42365 // Based on John Resig's `tmpl` implementation 42366 // (http://ejohn.org/blog/javascript-micro-templating/) 42367 // and Laura Doktorova's doT.js (https://github.com/olado/doT). 42368 var settings = lodash.templateSettings; 42369 42370 if (guard && isIterateeCall(string, options, guard)) { 42371 options = undefined; 42372 } 42373 string = toString(string); 42374 options = assignInWith({}, options, settings, customDefaultsAssignIn); 42375 42376 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), 42377 importsKeys = keys(imports), 42378 importsValues = baseValues(imports, importsKeys); 42379 42380 var isEscaping, 42381 isEvaluating, 42382 index = 0, 42383 interpolate = options.interpolate || reNoMatch, 42384 source = "__p += '"; 42385 42386 // Compile the regexp to match each delimiter. 42387 var reDelimiters = RegExp( 42388 (options.escape || reNoMatch).source + '|' + 42389 interpolate.source + '|' + 42390 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + 42391 (options.evaluate || reNoMatch).source + '|$' 42392 , 'g'); 42393 42394 // Use a sourceURL for easier debugging. 42395 // The sourceURL gets injected into the source that's eval-ed, so be careful 42396 // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in 42397 // and escape the comment, thus injecting code that gets evaled. 42398 var sourceURL = '//# sourceURL=' + 42399 (hasOwnProperty.call(options, 'sourceURL') 42400 ? (options.sourceURL + '').replace(/\s/g, ' ') 42401 : ('lodash.templateSources[' + (++templateCounter) + ']') 42402 ) + '\n'; 42403 42404 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { 42405 interpolateValue || (interpolateValue = esTemplateValue); 42406 42407 // Escape characters that can't be included in string literals. 42408 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); 42409 42410 // Replace delimiters with snippets. 42411 if (escapeValue) { 42412 isEscaping = true; 42413 source += "' +\n__e(" + escapeValue + ") +\n'"; 42414 } 42415 if (evaluateValue) { 42416 isEvaluating = true; 42417 source += "';\n" + evaluateValue + ";\n__p += '"; 42418 } 42419 if (interpolateValue) { 42420 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; 42421 } 42422 index = offset + match.length; 42423 42424 // The JS engine embedded in Adobe products needs `match` returned in 42425 // order to produce the correct `offset` value. 42426 return match; 42427 }); 42428 42429 source += "';\n"; 42430 42431 // If `variable` is not specified wrap a with-statement around the generated 42432 // code to add the data object to the top of the scope chain. 42433 var variable = hasOwnProperty.call(options, 'variable') && options.variable; 42434 if (!variable) { 42435 source = 'with (obj) {\n' + source + '\n}\n'; 42436 } 42437 // Throw an error if a forbidden character was found in `variable`, to prevent 42438 // potential command injection attacks. 42439 else if (reForbiddenIdentifierChars.test(variable)) { 42440 throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); 42441 } 42442 42443 // Cleanup code by stripping empty strings. 42444 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) 42445 .replace(reEmptyStringMiddle, '$1') 42446 .replace(reEmptyStringTrailing, '$1;'); 42447 42448 // Frame code as the function body. 42449 source = 'function(' + (variable || 'obj') + ') {\n' + 42450 (variable 42451 ? '' 42452 : 'obj || (obj = {});\n' 42453 ) + 42454 "var __t, __p = ''" + 42455 (isEscaping 42456 ? ', __e = _.escape' 42457 : '' 42458 ) + 42459 (isEvaluating 42460 ? ', __j = Array.prototype.join;\n' + 42461 "function print() { __p += __j.call(arguments, '') }\n" 42462 : ';\n' 42463 ) + 42464 source + 42465 'return __p\n}'; 42466 42467 var result = attempt(function() { 42468 return Function(importsKeys, sourceURL + 'return ' + source) 42469 .apply(undefined, importsValues); 42470 }); 42471 42472 // Provide the compiled function's source by its `toString` method or 42473 // the `source` property as a convenience for inlining compiled templates. 42474 result.source = source; 42475 if (isError(result)) { 42476 throw result; 42477 } 42478 return result; 42479 } 42480 42481 /** 42482 * Converts `string`, as a whole, to lower case just like 42483 * [String#toLowerCase](https://mdn.io/toLowerCase). 42484 * 42485 * @static 42486 * @memberOf _ 42487 * @since 4.0.0 42488 * @category String 42489 * @param {string} [string=''] The string to convert. 42490 * @returns {string} Returns the lower cased string. 42491 * @example 42492 * 42493 * _.toLower('--Foo-Bar--'); 42494 * // => '--foo-bar--' 42495 * 42496 * _.toLower('fooBar'); 42497 * // => 'foobar' 42498 * 42499 * _.toLower('__FOO_BAR__'); 42500 * // => '__foo_bar__' 42501 */ 42502 function toLower(value) { 42503 return toString(value).toLowerCase(); 42504 } 42505 42506 /** 42507 * Converts `string`, as a whole, to upper case just like 42508 * [String#toUpperCase](https://mdn.io/toUpperCase). 42509 * 42510 * @static 42511 * @memberOf _ 42512 * @since 4.0.0 42513 * @category String 42514 * @param {string} [string=''] The string to convert. 42515 * @returns {string} Returns the upper cased string. 42516 * @example 42517 * 42518 * _.toUpper('--foo-bar--'); 42519 * // => '--FOO-BAR--' 42520 * 42521 * _.toUpper('fooBar'); 42522 * // => 'FOOBAR' 42523 * 42524 * _.toUpper('__foo_bar__'); 42525 * // => '__FOO_BAR__' 42526 */ 42527 function toUpper(value) { 42528 return toString(value).toUpperCase(); 42529 } 42530 42531 /** 42532 * Removes leading and trailing whitespace or specified characters from `string`. 42533 * 42534 * @static 42535 * @memberOf _ 42536 * @since 3.0.0 42537 * @category String 42538 * @param {string} [string=''] The string to trim. 42539 * @param {string} [chars=whitespace] The characters to trim. 42540 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42541 * @returns {string} Returns the trimmed string. 42542 * @example 42543 * 42544 * _.trim(' abc '); 42545 * // => 'abc' 42546 * 42547 * _.trim('-_-abc-_-', '_-'); 42548 * // => 'abc' 42549 * 42550 * _.map([' foo ', ' bar '], _.trim); 42551 * // => ['foo', 'bar'] 42552 */ 42553 function trim(string, chars, guard) { 42554 string = toString(string); 42555 if (string && (guard || chars === undefined)) { 42556 return baseTrim(string); 42557 } 42558 if (!string || !(chars = baseToString(chars))) { 42559 return string; 42560 } 42561 var strSymbols = stringToArray(string), 42562 chrSymbols = stringToArray(chars), 42563 start = charsStartIndex(strSymbols, chrSymbols), 42564 end = charsEndIndex(strSymbols, chrSymbols) + 1; 42565 42566 return castSlice(strSymbols, start, end).join(''); 42567 } 42568 42569 /** 42570 * Removes trailing whitespace or specified characters from `string`. 42571 * 42572 * @static 42573 * @memberOf _ 42574 * @since 4.0.0 42575 * @category String 42576 * @param {string} [string=''] The string to trim. 42577 * @param {string} [chars=whitespace] The characters to trim. 42578 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42579 * @returns {string} Returns the trimmed string. 42580 * @example 42581 * 42582 * _.trimEnd(' abc '); 42583 * // => ' abc' 42584 * 42585 * _.trimEnd('-_-abc-_-', '_-'); 42586 * // => '-_-abc' 42587 */ 42588 function trimEnd(string, chars, guard) { 42589 string = toString(string); 42590 if (string && (guard || chars === undefined)) { 42591 return string.slice(0, trimmedEndIndex(string) + 1); 42592 } 42593 if (!string || !(chars = baseToString(chars))) { 42594 return string; 42595 } 42596 var strSymbols = stringToArray(string), 42597 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; 42598 42599 return castSlice(strSymbols, 0, end).join(''); 42600 } 42601 42602 /** 42603 * Removes leading whitespace or specified characters from `string`. 42604 * 42605 * @static 42606 * @memberOf _ 42607 * @since 4.0.0 42608 * @category String 42609 * @param {string} [string=''] The string to trim. 42610 * @param {string} [chars=whitespace] The characters to trim. 42611 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42612 * @returns {string} Returns the trimmed string. 42613 * @example 42614 * 42615 * _.trimStart(' abc '); 42616 * // => 'abc ' 42617 * 42618 * _.trimStart('-_-abc-_-', '_-'); 42619 * // => 'abc-_-' 42620 */ 42621 function trimStart(string, chars, guard) { 42622 string = toString(string); 42623 if (string && (guard || chars === undefined)) { 42624 return string.replace(reTrimStart, ''); 42625 } 42626 if (!string || !(chars = baseToString(chars))) { 42627 return string; 42628 } 42629 var strSymbols = stringToArray(string), 42630 start = charsStartIndex(strSymbols, stringToArray(chars)); 42631 42632 return castSlice(strSymbols, start).join(''); 42633 } 42634 42635 /** 42636 * Truncates `string` if it's longer than the given maximum string length. 42637 * The last characters of the truncated string are replaced with the omission 42638 * string which defaults to "...". 42639 * 42640 * @static 42641 * @memberOf _ 42642 * @since 4.0.0 42643 * @category String 42644 * @param {string} [string=''] The string to truncate. 42645 * @param {Object} [options={}] The options object. 42646 * @param {number} [options.length=30] The maximum string length. 42647 * @param {string} [options.omission='...'] The string to indicate text is omitted. 42648 * @param {RegExp|string} [options.separator] The separator pattern to truncate to. 42649 * @returns {string} Returns the truncated string. 42650 * @example 42651 * 42652 * _.truncate('hi-diddly-ho there, neighborino'); 42653 * // => 'hi-diddly-ho there, neighbo...' 42654 * 42655 * _.truncate('hi-diddly-ho there, neighborino', { 42656 * 'length': 24, 42657 * 'separator': ' ' 42658 * }); 42659 * // => 'hi-diddly-ho there,...' 42660 * 42661 * _.truncate('hi-diddly-ho there, neighborino', { 42662 * 'length': 24, 42663 * 'separator': /,? +/ 42664 * }); 42665 * // => 'hi-diddly-ho there...' 42666 * 42667 * _.truncate('hi-diddly-ho there, neighborino', { 42668 * 'omission': ' [...]' 42669 * }); 42670 * // => 'hi-diddly-ho there, neig [...]' 42671 */ 42672 function truncate(string, options) { 42673 var length = DEFAULT_TRUNC_LENGTH, 42674 omission = DEFAULT_TRUNC_OMISSION; 42675 42676 if (isObject(options)) { 42677 var separator = 'separator' in options ? options.separator : separator; 42678 length = 'length' in options ? toInteger(options.length) : length; 42679 omission = 'omission' in options ? baseToString(options.omission) : omission; 42680 } 42681 string = toString(string); 42682 42683 var strLength = string.length; 42684 if (hasUnicode(string)) { 42685 var strSymbols = stringToArray(string); 42686 strLength = strSymbols.length; 42687 } 42688 if (length >= strLength) { 42689 return string; 42690 } 42691 var end = length - stringSize(omission); 42692 if (end < 1) { 42693 return omission; 42694 } 42695 var result = strSymbols 42696 ? castSlice(strSymbols, 0, end).join('') 42697 : string.slice(0, end); 42698 42699 if (separator === undefined) { 42700 return result + omission; 42701 } 42702 if (strSymbols) { 42703 end += (result.length - end); 42704 } 42705 if (isRegExp(separator)) { 42706 if (string.slice(end).search(separator)) { 42707 var match, 42708 substring = result; 42709 42710 if (!separator.global) { 42711 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); 42712 } 42713 separator.lastIndex = 0; 42714 while ((match = separator.exec(substring))) { 42715 var newEnd = match.index; 42716 } 42717 result = result.slice(0, newEnd === undefined ? end : newEnd); 42718 } 42719 } else if (string.indexOf(baseToString(separator), end) != end) { 42720 var index = result.lastIndexOf(separator); 42721 if (index > -1) { 42722 result = result.slice(0, index); 42723 } 42724 } 42725 return result + omission; 42726 } 42727 42728 /** 42729 * The inverse of `_.escape`; this method converts the HTML entities 42730 * `&`, `<`, `>`, `"`, and `'` in `string` to 42731 * their corresponding characters. 42732 * 42733 * **Note:** No other HTML entities are unescaped. To unescape additional 42734 * HTML entities use a third-party library like [_he_](https://mths.be/he). 42735 * 42736 * @static 42737 * @memberOf _ 42738 * @since 0.6.0 42739 * @category String 42740 * @param {string} [string=''] The string to unescape. 42741 * @returns {string} Returns the unescaped string. 42742 * @example 42743 * 42744 * _.unescape('fred, barney, & pebbles'); 42745 * // => 'fred, barney, & pebbles' 42746 */ 42747 function unescape(string) { 42748 string = toString(string); 42749 return (string && reHasEscapedHtml.test(string)) 42750 ? string.replace(reEscapedHtml, unescapeHtmlChar) 42751 : string; 42752 } 42753 42754 /** 42755 * Converts `string`, as space separated words, to upper case. 42756 * 42757 * @static 42758 * @memberOf _ 42759 * @since 4.0.0 42760 * @category String 42761 * @param {string} [string=''] The string to convert. 42762 * @returns {string} Returns the upper cased string. 42763 * @example 42764 * 42765 * _.upperCase('--foo-bar'); 42766 * // => 'FOO BAR' 42767 * 42768 * _.upperCase('fooBar'); 42769 * // => 'FOO BAR' 42770 * 42771 * _.upperCase('__foo_bar__'); 42772 * // => 'FOO BAR' 42773 */ 42774 var upperCase = createCompounder(function(result, word, index) { 42775 return result + (index ? ' ' : '') + word.toUpperCase(); 42776 }); 42777 42778 /** 42779 * Converts the first character of `string` to upper case. 42780 * 42781 * @static 42782 * @memberOf _ 42783 * @since 4.0.0 42784 * @category String 42785 * @param {string} [string=''] The string to convert. 42786 * @returns {string} Returns the converted string. 42787 * @example 42788 * 42789 * _.upperFirst('fred'); 42790 * // => 'Fred' 42791 * 42792 * _.upperFirst('FRED'); 42793 * // => 'FRED' 42794 */ 42795 var upperFirst = createCaseFirst('toUpperCase'); 42796 42797 /** 42798 * Splits `string` into an array of its words. 42799 * 42800 * @static 42801 * @memberOf _ 42802 * @since 3.0.0 42803 * @category String 42804 * @param {string} [string=''] The string to inspect. 42805 * @param {RegExp|string} [pattern] The pattern to match words. 42806 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42807 * @returns {Array} Returns the words of `string`. 42808 * @example 42809 * 42810 * _.words('fred, barney, & pebbles'); 42811 * // => ['fred', 'barney', 'pebbles'] 42812 * 42813 * _.words('fred, barney, & pebbles', /[^, ]+/g); 42814 * // => ['fred', 'barney', '&', 'pebbles'] 42815 */ 42816 function words(string, pattern, guard) { 42817 string = toString(string); 42818 pattern = guard ? undefined : pattern; 42819 42820 if (pattern === undefined) { 42821 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); 42822 } 42823 return string.match(pattern) || []; 42824 } 42825 42826 /*------------------------------------------------------------------------*/ 42827 42828 /** 42829 * Attempts to invoke `func`, returning either the result or the caught error 42830 * object. Any additional arguments are provided to `func` when it's invoked. 42831 * 42832 * @static 42833 * @memberOf _ 42834 * @since 3.0.0 42835 * @category Util 42836 * @param {Function} func The function to attempt. 42837 * @param {...*} [args] The arguments to invoke `func` with. 42838 * @returns {*} Returns the `func` result or error object. 42839 * @example 42840 * 42841 * // Avoid throwing errors for invalid selectors. 42842 * var elements = _.attempt(function(selector) { 42843 * return document.querySelectorAll(selector); 42844 * }, '>_>'); 42845 * 42846 * if (_.isError(elements)) { 42847 * elements = []; 42848 * } 42849 */ 42850 var attempt = baseRest(function(func, args) { 42851 try { 42852 return apply(func, undefined, args); 42853 } catch (e) { 42854 return isError(e) ? e : new Error(e); 42855 } 42856 }); 42857 42858 /** 42859 * Binds methods of an object to the object itself, overwriting the existing 42860 * method. 42861 * 42862 * **Note:** This method doesn't set the "length" property of bound functions. 42863 * 42864 * @static 42865 * @since 0.1.0 42866 * @memberOf _ 42867 * @category Util 42868 * @param {Object} object The object to bind and assign the bound methods to. 42869 * @param {...(string|string[])} methodNames The object method names to bind. 42870 * @returns {Object} Returns `object`. 42871 * @example 42872 * 42873 * var view = { 42874 * 'label': 'docs', 42875 * 'click': function() { 42876 * console.log('clicked ' + this.label); 42877 * } 42878 * }; 42879 * 42880 * _.bindAll(view, ['click']); 42881 * jQuery(element).on('click', view.click); 42882 * // => Logs 'clicked docs' when clicked. 42883 */ 42884 var bindAll = flatRest(function(object, methodNames) { 42885 arrayEach(methodNames, function(key) { 42886 key = toKey(key); 42887 baseAssignValue(object, key, bind(object[key], object)); 42888 }); 42889 return object; 42890 }); 42891 42892 /** 42893 * Creates a function that iterates over `pairs` and invokes the corresponding 42894 * function of the first predicate to return truthy. The predicate-function 42895 * pairs are invoked with the `this` binding and arguments of the created 42896 * function. 42897 * 42898 * @static 42899 * @memberOf _ 42900 * @since 4.0.0 42901 * @category Util 42902 * @param {Array} pairs The predicate-function pairs. 42903 * @returns {Function} Returns the new composite function. 42904 * @example 42905 * 42906 * var func = _.cond([ 42907 * [_.matches({ 'a': 1 }), _.constant('matches A')], 42908 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], 42909 * [_.stubTrue, _.constant('no match')] 42910 * ]); 42911 * 42912 * func({ 'a': 1, 'b': 2 }); 42913 * // => 'matches A' 42914 * 42915 * func({ 'a': 0, 'b': 1 }); 42916 * // => 'matches B' 42917 * 42918 * func({ 'a': '1', 'b': '2' }); 42919 * // => 'no match' 42920 */ 42921 function cond(pairs) { 42922 var length = pairs == null ? 0 : pairs.length, 42923 toIteratee = getIteratee(); 42924 42925 pairs = !length ? [] : arrayMap(pairs, function(pair) { 42926 if (typeof pair[1] != 'function') { 42927 throw new TypeError(FUNC_ERROR_TEXT); 42928 } 42929 return [toIteratee(pair[0]), pair[1]]; 42930 }); 42931 42932 return baseRest(function(args) { 42933 var index = -1; 42934 while (++index < length) { 42935 var pair = pairs[index]; 42936 if (apply(pair[0], this, args)) { 42937 return apply(pair[1], this, args); 42938 } 42939 } 42940 }); 42941 } 42942 42943 /** 42944 * Creates a function that invokes the predicate properties of `source` with 42945 * the corresponding property values of a given object, returning `true` if 42946 * all predicates return truthy, else `false`. 42947 * 42948 * **Note:** The created function is equivalent to `_.conformsTo` with 42949 * `source` partially applied. 42950 * 42951 * @static 42952 * @memberOf _ 42953 * @since 4.0.0 42954 * @category Util 42955 * @param {Object} source The object of property predicates to conform to. 42956 * @returns {Function} Returns the new spec function. 42957 * @example 42958 * 42959 * var objects = [ 42960 * { 'a': 2, 'b': 1 }, 42961 * { 'a': 1, 'b': 2 } 42962 * ]; 42963 * 42964 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); 42965 * // => [{ 'a': 1, 'b': 2 }] 42966 */ 42967 function conforms(source) { 42968 return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); 42969 } 42970 42971 /** 42972 * Creates a function that returns `value`. 42973 * 42974 * @static 42975 * @memberOf _ 42976 * @since 2.4.0 42977 * @category Util 42978 * @param {*} value The value to return from the new function. 42979 * @returns {Function} Returns the new constant function. 42980 * @example 42981 * 42982 * var objects = _.times(2, _.constant({ 'a': 1 })); 42983 * 42984 * console.log(objects); 42985 * // => [{ 'a': 1 }, { 'a': 1 }] 42986 * 42987 * console.log(objects[0] === objects[1]); 42988 * // => true 42989 */ 42990 function constant(value) { 42991 return function() { 42992 return value; 42993 }; 42994 } 42995 42996 /** 42997 * Checks `value` to determine whether a default value should be returned in 42998 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, 42999 * or `undefined`. 43000 * 43001 * @static 43002 * @memberOf _ 43003 * @since 4.14.0 43004 * @category Util 43005 * @param {*} value The value to check. 43006 * @param {*} defaultValue The default value. 43007 * @returns {*} Returns the resolved value. 43008 * @example 43009 * 43010 * _.defaultTo(1, 10); 43011 * // => 1 43012 * 43013 * _.defaultTo(undefined, 10); 43014 * // => 10 43015 */ 43016 function defaultTo(value, defaultValue) { 43017 return (value == null || value !== value) ? defaultValue : value; 43018 } 43019 43020 /** 43021 * Creates a function that returns the result of invoking the given functions 43022 * with the `this` binding of the created function, where each successive 43023 * invocation is supplied the return value of the previous. 43024 * 43025 * @static 43026 * @memberOf _ 43027 * @since 3.0.0 43028 * @category Util 43029 * @param {...(Function|Function[])} [funcs] The functions to invoke. 43030 * @returns {Function} Returns the new composite function. 43031 * @see _.flowRight 43032 * @example 43033 * 43034 * function square(n) { 43035 * return n * n; 43036 * } 43037 * 43038 * var addSquare = _.flow([_.add, square]); 43039 * addSquare(1, 2); 43040 * // => 9 43041 */ 43042 var flow = createFlow(); 43043 43044 /** 43045 * This method is like `_.flow` except that it creates a function that 43046 * invokes the given functions from right to left. 43047 * 43048 * @static 43049 * @since 3.0.0 43050 * @memberOf _ 43051 * @category Util 43052 * @param {...(Function|Function[])} [funcs] The functions to invoke. 43053 * @returns {Function} Returns the new composite function. 43054 * @see _.flow 43055 * @example 43056 * 43057 * function square(n) { 43058 * return n * n; 43059 * } 43060 * 43061 * var addSquare = _.flowRight([square, _.add]); 43062 * addSquare(1, 2); 43063 * // => 9 43064 */ 43065 var flowRight = createFlow(true); 43066 43067 /** 43068 * This method returns the first argument it receives. 43069 * 43070 * @static 43071 * @since 0.1.0 43072 * @memberOf _ 43073 * @category Util 43074 * @param {*} value Any value. 43075 * @returns {*} Returns `value`. 43076 * @example 43077 * 43078 * var object = { 'a': 1 }; 43079 * 43080 * console.log(_.identity(object) === object); 43081 * // => true 43082 */ 43083 function identity(value) { 43084 return value; 43085 } 43086 43087 /** 43088 * Creates a function that invokes `func` with the arguments of the created 43089 * function. If `func` is a property name, the created function returns the 43090 * property value for a given element. If `func` is an array or object, the 43091 * created function returns `true` for elements that contain the equivalent 43092 * source properties, otherwise it returns `false`. 43093 * 43094 * @static 43095 * @since 4.0.0 43096 * @memberOf _ 43097 * @category Util 43098 * @param {*} [func=_.identity] The value to convert to a callback. 43099 * @returns {Function} Returns the callback. 43100 * @example 43101 * 43102 * var users = [ 43103 * { 'user': 'barney', 'age': 36, 'active': true }, 43104 * { 'user': 'fred', 'age': 40, 'active': false } 43105 * ]; 43106 * 43107 * // The `_.matches` iteratee shorthand. 43108 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); 43109 * // => [{ 'user': 'barney', 'age': 36, 'active': true }] 43110 * 43111 * // The `_.matchesProperty` iteratee shorthand. 43112 * _.filter(users, _.iteratee(['user', 'fred'])); 43113 * // => [{ 'user': 'fred', 'age': 40 }] 43114 * 43115 * // The `_.property` iteratee shorthand. 43116 * _.map(users, _.iteratee('user')); 43117 * // => ['barney', 'fred'] 43118 * 43119 * // Create custom iteratee shorthands. 43120 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { 43121 * return !_.isRegExp(func) ? iteratee(func) : function(string) { 43122 * return func.test(string); 43123 * }; 43124 * }); 43125 * 43126 * _.filter(['abc', 'def'], /ef/); 43127 * // => ['def'] 43128 */ 43129 function iteratee(func) { 43130 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); 43131 } 43132 43133 /** 43134 * Creates a function that performs a partial deep comparison between a given 43135 * object and `source`, returning `true` if the given object has equivalent 43136 * property values, else `false`. 43137 * 43138 * **Note:** The created function is equivalent to `_.isMatch` with `source` 43139 * partially applied. 43140 * 43141 * Partial comparisons will match empty array and empty object `source` 43142 * values against any array or object value, respectively. See `_.isEqual` 43143 * for a list of supported value comparisons. 43144 * 43145 * **Note:** Multiple values can be checked by combining several matchers 43146 * using `_.overSome` 43147 * 43148 * @static 43149 * @memberOf _ 43150 * @since 3.0.0 43151 * @category Util 43152 * @param {Object} source The object of property values to match. 43153 * @returns {Function} Returns the new spec function. 43154 * @example 43155 * 43156 * var objects = [ 43157 * { 'a': 1, 'b': 2, 'c': 3 }, 43158 * { 'a': 4, 'b': 5, 'c': 6 } 43159 * ]; 43160 * 43161 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); 43162 * // => [{ 'a': 4, 'b': 5, 'c': 6 }] 43163 * 43164 * // Checking for several possible values 43165 * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); 43166 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 43167 */ 43168 function matches(source) { 43169 return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); 43170 } 43171 43172 /** 43173 * Creates a function that performs a partial deep comparison between the 43174 * value at `path` of a given object to `srcValue`, returning `true` if the 43175 * object value is equivalent, else `false`. 43176 * 43177 * **Note:** Partial comparisons will match empty array and empty object 43178 * `srcValue` values against any array or object value, respectively. See 43179 * `_.isEqual` for a list of supported value comparisons. 43180 * 43181 * **Note:** Multiple values can be checked by combining several matchers 43182 * using `_.overSome` 43183 * 43184 * @static 43185 * @memberOf _ 43186 * @since 3.2.0 43187 * @category Util 43188 * @param {Array|string} path The path of the property to get. 43189 * @param {*} srcValue The value to match. 43190 * @returns {Function} Returns the new spec function. 43191 * @example 43192 * 43193 * var objects = [ 43194 * { 'a': 1, 'b': 2, 'c': 3 }, 43195 * { 'a': 4, 'b': 5, 'c': 6 } 43196 * ]; 43197 * 43198 * _.find(objects, _.matchesProperty('a', 4)); 43199 * // => { 'a': 4, 'b': 5, 'c': 6 } 43200 * 43201 * // Checking for several possible values 43202 * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); 43203 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 43204 */ 43205 function matchesProperty(path, srcValue) { 43206 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); 43207 } 43208 43209 /** 43210 * Creates a function that invokes the method at `path` of a given object. 43211 * Any additional arguments are provided to the invoked method. 43212 * 43213 * @static 43214 * @memberOf _ 43215 * @since 3.7.0 43216 * @category Util 43217 * @param {Array|string} path The path of the method to invoke. 43218 * @param {...*} [args] The arguments to invoke the method with. 43219 * @returns {Function} Returns the new invoker function. 43220 * @example 43221 * 43222 * var objects = [ 43223 * { 'a': { 'b': _.constant(2) } }, 43224 * { 'a': { 'b': _.constant(1) } } 43225 * ]; 43226 * 43227 * _.map(objects, _.method('a.b')); 43228 * // => [2, 1] 43229 * 43230 * _.map(objects, _.method(['a', 'b'])); 43231 * // => [2, 1] 43232 */ 43233 var method = baseRest(function(path, args) { 43234 return function(object) { 43235 return baseInvoke(object, path, args); 43236 }; 43237 }); 43238 43239 /** 43240 * The opposite of `_.method`; this method creates a function that invokes 43241 * the method at a given path of `object`. Any additional arguments are 43242 * provided to the invoked method. 43243 * 43244 * @static 43245 * @memberOf _ 43246 * @since 3.7.0 43247 * @category Util 43248 * @param {Object} object The object to query. 43249 * @param {...*} [args] The arguments to invoke the method with. 43250 * @returns {Function} Returns the new invoker function. 43251 * @example 43252 * 43253 * var array = _.times(3, _.constant), 43254 * object = { 'a': array, 'b': array, 'c': array }; 43255 * 43256 * _.map(['a[2]', 'c[0]'], _.methodOf(object)); 43257 * // => [2, 0] 43258 * 43259 * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); 43260 * // => [2, 0] 43261 */ 43262 var methodOf = baseRest(function(object, args) { 43263 return function(path) { 43264 return baseInvoke(object, path, args); 43265 }; 43266 }); 43267 43268 /** 43269 * Adds all own enumerable string keyed function properties of a source 43270 * object to the destination object. If `object` is a function, then methods 43271 * are added to its prototype as well. 43272 * 43273 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to 43274 * avoid conflicts caused by modifying the original. 43275 * 43276 * @static 43277 * @since 0.1.0 43278 * @memberOf _ 43279 * @category Util 43280 * @param {Function|Object} [object=lodash] The destination object. 43281 * @param {Object} source The object of functions to add. 43282 * @param {Object} [options={}] The options object. 43283 * @param {boolean} [options.chain=true] Specify whether mixins are chainable. 43284 * @returns {Function|Object} Returns `object`. 43285 * @example 43286 * 43287 * function vowels(string) { 43288 * return _.filter(string, function(v) { 43289 * return /[aeiou]/i.test(v); 43290 * }); 43291 * } 43292 * 43293 * _.mixin({ 'vowels': vowels }); 43294 * _.vowels('fred'); 43295 * // => ['e'] 43296 * 43297 * _('fred').vowels().value(); 43298 * // => ['e'] 43299 * 43300 * _.mixin({ 'vowels': vowels }, { 'chain': false }); 43301 * _('fred').vowels(); 43302 * // => ['e'] 43303 */ 43304 function mixin(object, source, options) { 43305 var props = keys(source), 43306 methodNames = baseFunctions(source, props); 43307 43308 if (options == null && 43309 !(isObject(source) && (methodNames.length || !props.length))) { 43310 options = source; 43311 source = object; 43312 object = this; 43313 methodNames = baseFunctions(source, keys(source)); 43314 } 43315 var chain = !(isObject(options) && 'chain' in options) || !!options.chain, 43316 isFunc = isFunction(object); 43317 43318 arrayEach(methodNames, function(methodName) { 43319 var func = source[methodName]; 43320 object[methodName] = func; 43321 if (isFunc) { 43322 object.prototype[methodName] = function() { 43323 var chainAll = this.__chain__; 43324 if (chain || chainAll) { 43325 var result = object(this.__wrapped__), 43326 actions = result.__actions__ = copyArray(this.__actions__); 43327 43328 actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); 43329 result.__chain__ = chainAll; 43330 return result; 43331 } 43332 return func.apply(object, arrayPush([this.value()], arguments)); 43333 }; 43334 } 43335 }); 43336 43337 return object; 43338 } 43339 43340 /** 43341 * Reverts the `_` variable to its previous value and returns a reference to 43342 * the `lodash` function. 43343 * 43344 * @static 43345 * @since 0.1.0 43346 * @memberOf _ 43347 * @category Util 43348 * @returns {Function} Returns the `lodash` function. 43349 * @example 43350 * 43351 * var lodash = _.noConflict(); 43352 */ 43353 function noConflict() { 43354 if (root._ === this) { 43355 root._ = oldDash; 43356 } 43357 return this; 43358 } 43359 43360 /** 43361 * This method returns `undefined`. 43362 * 43363 * @static 43364 * @memberOf _ 43365 * @since 2.3.0 43366 * @category Util 43367 * @example 43368 * 43369 * _.times(2, _.noop); 43370 * // => [undefined, undefined] 43371 */ 43372 function noop() { 43373 // No operation performed. 43374 } 43375 43376 /** 43377 * Creates a function that gets the argument at index `n`. If `n` is negative, 43378 * the nth argument from the end is returned. 43379 * 43380 * @static 43381 * @memberOf _ 43382 * @since 4.0.0 43383 * @category Util 43384 * @param {number} [n=0] The index of the argument to return. 43385 * @returns {Function} Returns the new pass-thru function. 43386 * @example 43387 * 43388 * var func = _.nthArg(1); 43389 * func('a', 'b', 'c', 'd'); 43390 * // => 'b' 43391 * 43392 * var func = _.nthArg(-2); 43393 * func('a', 'b', 'c', 'd'); 43394 * // => 'c' 43395 */ 43396 function nthArg(n) { 43397 n = toInteger(n); 43398 return baseRest(function(args) { 43399 return baseNth(args, n); 43400 }); 43401 } 43402 43403 /** 43404 * Creates a function that invokes `iteratees` with the arguments it receives 43405 * and returns their results. 43406 * 43407 * @static 43408 * @memberOf _ 43409 * @since 4.0.0 43410 * @category Util 43411 * @param {...(Function|Function[])} [iteratees=[_.identity]] 43412 * The iteratees to invoke. 43413 * @returns {Function} Returns the new function. 43414 * @example 43415 * 43416 * var func = _.over([Math.max, Math.min]); 43417 * 43418 * func(1, 2, 3, 4); 43419 * // => [4, 1] 43420 */ 43421 var over = createOver(arrayMap); 43422 43423 /** 43424 * Creates a function that checks if **all** of the `predicates` return 43425 * truthy when invoked with the arguments it receives. 43426 * 43427 * Following shorthands are possible for providing predicates. 43428 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 43429 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 43430 * 43431 * @static 43432 * @memberOf _ 43433 * @since 4.0.0 43434 * @category Util 43435 * @param {...(Function|Function[])} [predicates=[_.identity]] 43436 * The predicates to check. 43437 * @returns {Function} Returns the new function. 43438 * @example 43439 * 43440 * var func = _.overEvery([Boolean, isFinite]); 43441 * 43442 * func('1'); 43443 * // => true 43444 * 43445 * func(null); 43446 * // => false 43447 * 43448 * func(NaN); 43449 * // => false 43450 */ 43451 var overEvery = createOver(arrayEvery); 43452 43453 /** 43454 * Creates a function that checks if **any** of the `predicates` return 43455 * truthy when invoked with the arguments it receives. 43456 * 43457 * Following shorthands are possible for providing predicates. 43458 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 43459 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 43460 * 43461 * @static 43462 * @memberOf _ 43463 * @since 4.0.0 43464 * @category Util 43465 * @param {...(Function|Function[])} [predicates=[_.identity]] 43466 * The predicates to check. 43467 * @returns {Function} Returns the new function. 43468 * @example 43469 * 43470 * var func = _.overSome([Boolean, isFinite]); 43471 * 43472 * func('1'); 43473 * // => true 43474 * 43475 * func(null); 43476 * // => true 43477 * 43478 * func(NaN); 43479 * // => false 43480 * 43481 * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) 43482 * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) 43483 */ 43484 var overSome = createOver(arraySome); 43485 43486 /** 43487 * Creates a function that returns the value at `path` of a given object. 43488 * 43489 * @static 43490 * @memberOf _ 43491 * @since 2.4.0 43492 * @category Util 43493 * @param {Array|string} path The path of the property to get. 43494 * @returns {Function} Returns the new accessor function. 43495 * @example 43496 * 43497 * var objects = [ 43498 * { 'a': { 'b': 2 } }, 43499 * { 'a': { 'b': 1 } } 43500 * ]; 43501 * 43502 * _.map(objects, _.property('a.b')); 43503 * // => [2, 1] 43504 * 43505 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); 43506 * // => [1, 2] 43507 */ 43508 function property(path) { 43509 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 43510 } 43511 43512 /** 43513 * The opposite of `_.property`; this method creates a function that returns 43514 * the value at a given path of `object`. 43515 * 43516 * @static 43517 * @memberOf _ 43518 * @since 3.0.0 43519 * @category Util 43520 * @param {Object} object The object to query. 43521 * @returns {Function} Returns the new accessor function. 43522 * @example 43523 * 43524 * var array = [0, 1, 2], 43525 * object = { 'a': array, 'b': array, 'c': array }; 43526 * 43527 * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); 43528 * // => [2, 0] 43529 * 43530 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); 43531 * // => [2, 0] 43532 */ 43533 function propertyOf(object) { 43534 return function(path) { 43535 return object == null ? undefined : baseGet(object, path); 43536 }; 43537 } 43538 43539 /** 43540 * Creates an array of numbers (positive and/or negative) progressing from 43541 * `start` up to, but not including, `end`. A step of `-1` is used if a negative 43542 * `start` is specified without an `end` or `step`. If `end` is not specified, 43543 * it's set to `start` with `start` then set to `0`. 43544 * 43545 * **Note:** JavaScript follows the IEEE-754 standard for resolving 43546 * floating-point values which can produce unexpected results. 43547 * 43548 * @static 43549 * @since 0.1.0 43550 * @memberOf _ 43551 * @category Util 43552 * @param {number} [start=0] The start of the range. 43553 * @param {number} end The end of the range. 43554 * @param {number} [step=1] The value to increment or decrement by. 43555 * @returns {Array} Returns the range of numbers. 43556 * @see _.inRange, _.rangeRight 43557 * @example 43558 * 43559 * _.range(4); 43560 * // => [0, 1, 2, 3] 43561 * 43562 * _.range(-4); 43563 * // => [0, -1, -2, -3] 43564 * 43565 * _.range(1, 5); 43566 * // => [1, 2, 3, 4] 43567 * 43568 * _.range(0, 20, 5); 43569 * // => [0, 5, 10, 15] 43570 * 43571 * _.range(0, -4, -1); 43572 * // => [0, -1, -2, -3] 43573 * 43574 * _.range(1, 4, 0); 43575 * // => [1, 1, 1] 43576 * 43577 * _.range(0); 43578 * // => [] 43579 */ 43580 var range = createRange(); 43581 43582 /** 43583 * This method is like `_.range` except that it populates values in 43584 * descending order. 43585 * 43586 * @static 43587 * @memberOf _ 43588 * @since 4.0.0 43589 * @category Util 43590 * @param {number} [start=0] The start of the range. 43591 * @param {number} end The end of the range. 43592 * @param {number} [step=1] The value to increment or decrement by. 43593 * @returns {Array} Returns the range of numbers. 43594 * @see _.inRange, _.range 43595 * @example 43596 * 43597 * _.rangeRight(4); 43598 * // => [3, 2, 1, 0] 43599 * 43600 * _.rangeRight(-4); 43601 * // => [-3, -2, -1, 0] 43602 * 43603 * _.rangeRight(1, 5); 43604 * // => [4, 3, 2, 1] 43605 * 43606 * _.rangeRight(0, 20, 5); 43607 * // => [15, 10, 5, 0] 43608 * 43609 * _.rangeRight(0, -4, -1); 43610 * // => [-3, -2, -1, 0] 43611 * 43612 * _.rangeRight(1, 4, 0); 43613 * // => [1, 1, 1] 43614 * 43615 * _.rangeRight(0); 43616 * // => [] 43617 */ 43618 var rangeRight = createRange(true); 43619 43620 /** 43621 * This method returns a new empty array. 43622 * 43623 * @static 43624 * @memberOf _ 43625 * @since 4.13.0 43626 * @category Util 43627 * @returns {Array} Returns the new empty array. 43628 * @example 43629 * 43630 * var arrays = _.times(2, _.stubArray); 43631 * 43632 * console.log(arrays); 43633 * // => [[], []] 43634 * 43635 * console.log(arrays[0] === arrays[1]); 43636 * // => false 43637 */ 43638 function stubArray() { 43639 return []; 43640 } 43641 43642 /** 43643 * This method returns `false`. 43644 * 43645 * @static 43646 * @memberOf _ 43647 * @since 4.13.0 43648 * @category Util 43649 * @returns {boolean} Returns `false`. 43650 * @example 43651 * 43652 * _.times(2, _.stubFalse); 43653 * // => [false, false] 43654 */ 43655 function stubFalse() { 43656 return false; 43657 } 43658 43659 /** 43660 * This method returns a new empty object. 43661 * 43662 * @static 43663 * @memberOf _ 43664 * @since 4.13.0 43665 * @category Util 43666 * @returns {Object} Returns the new empty object. 43667 * @example 43668 * 43669 * var objects = _.times(2, _.stubObject); 43670 * 43671 * console.log(objects); 43672 * // => [{}, {}] 43673 * 43674 * console.log(objects[0] === objects[1]); 43675 * // => false 43676 */ 43677 function stubObject() { 43678 return {}; 43679 } 43680 43681 /** 43682 * This method returns an empty string. 43683 * 43684 * @static 43685 * @memberOf _ 43686 * @since 4.13.0 43687 * @category Util 43688 * @returns {string} Returns the empty string. 43689 * @example 43690 * 43691 * _.times(2, _.stubString); 43692 * // => ['', ''] 43693 */ 43694 function stubString() { 43695 return ''; 43696 } 43697 43698 /** 43699 * This method returns `true`. 43700 * 43701 * @static 43702 * @memberOf _ 43703 * @since 4.13.0 43704 * @category Util 43705 * @returns {boolean} Returns `true`. 43706 * @example 43707 * 43708 * _.times(2, _.stubTrue); 43709 * // => [true, true] 43710 */ 43711 function stubTrue() { 43712 return true; 43713 } 43714 43715 /** 43716 * Invokes the iteratee `n` times, returning an array of the results of 43717 * each invocation. The iteratee is invoked with one argument; (index). 43718 * 43719 * @static 43720 * @since 0.1.0 43721 * @memberOf _ 43722 * @category Util 43723 * @param {number} n The number of times to invoke `iteratee`. 43724 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 43725 * @returns {Array} Returns the array of results. 43726 * @example 43727 * 43728 * _.times(3, String); 43729 * // => ['0', '1', '2'] 43730 * 43731 * _.times(4, _.constant(0)); 43732 * // => [0, 0, 0, 0] 43733 */ 43734 function times(n, iteratee) { 43735 n = toInteger(n); 43736 if (n < 1 || n > MAX_SAFE_INTEGER) { 43737 return []; 43738 } 43739 var index = MAX_ARRAY_LENGTH, 43740 length = nativeMin(n, MAX_ARRAY_LENGTH); 43741 43742 iteratee = getIteratee(iteratee); 43743 n -= MAX_ARRAY_LENGTH; 43744 43745 var result = baseTimes(length, iteratee); 43746 while (++index < n) { 43747 iteratee(index); 43748 } 43749 return result; 43750 } 43751 43752 /** 43753 * Converts `value` to a property path array. 43754 * 43755 * @static 43756 * @memberOf _ 43757 * @since 4.0.0 43758 * @category Util 43759 * @param {*} value The value to convert. 43760 * @returns {Array} Returns the new property path array. 43761 * @example 43762 * 43763 * _.toPath('a.b.c'); 43764 * // => ['a', 'b', 'c'] 43765 * 43766 * _.toPath('a[0].b.c'); 43767 * // => ['a', '0', 'b', 'c'] 43768 */ 43769 function toPath(value) { 43770 if (isArray(value)) { 43771 return arrayMap(value, toKey); 43772 } 43773 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); 43774 } 43775 43776 /** 43777 * Generates a unique ID. If `prefix` is given, the ID is appended to it. 43778 * 43779 * @static 43780 * @since 0.1.0 43781 * @memberOf _ 43782 * @category Util 43783 * @param {string} [prefix=''] The value to prefix the ID with. 43784 * @returns {string} Returns the unique ID. 43785 * @example 43786 * 43787 * _.uniqueId('contact_'); 43788 * // => 'contact_104' 43789 * 43790 * _.uniqueId(); 43791 * // => '105' 43792 */ 43793 function uniqueId(prefix) { 43794 var id = ++idCounter; 43795 return toString(prefix) + id; 43796 } 43797 43798 /*------------------------------------------------------------------------*/ 43799 43800 /** 43801 * Adds two numbers. 43802 * 43803 * @static 43804 * @memberOf _ 43805 * @since 3.4.0 43806 * @category Math 43807 * @param {number} augend The first number in an addition. 43808 * @param {number} addend The second number in an addition. 43809 * @returns {number} Returns the total. 43810 * @example 43811 * 43812 * _.add(6, 4); 43813 * // => 10 43814 */ 43815 var add = createMathOperation(function(augend, addend) { 43816 return augend + addend; 43817 }, 0); 43818 43819 /** 43820 * Computes `number` rounded up to `precision`. 43821 * 43822 * @static 43823 * @memberOf _ 43824 * @since 3.10.0 43825 * @category Math 43826 * @param {number} number The number to round up. 43827 * @param {number} [precision=0] The precision to round up to. 43828 * @returns {number} Returns the rounded up number. 43829 * @example 43830 * 43831 * _.ceil(4.006); 43832 * // => 5 43833 * 43834 * _.ceil(6.004, 2); 43835 * // => 6.01 43836 * 43837 * _.ceil(6040, -2); 43838 * // => 6100 43839 */ 43840 var ceil = createRound('ceil'); 43841 43842 /** 43843 * Divide two numbers. 43844 * 43845 * @static 43846 * @memberOf _ 43847 * @since 4.7.0 43848 * @category Math 43849 * @param {number} dividend The first number in a division. 43850 * @param {number} divisor The second number in a division. 43851 * @returns {number} Returns the quotient. 43852 * @example 43853 * 43854 * _.divide(6, 4); 43855 * // => 1.5 43856 */ 43857 var divide = createMathOperation(function(dividend, divisor) { 43858 return dividend / divisor; 43859 }, 1); 43860 43861 /** 43862 * Computes `number` rounded down to `precision`. 43863 * 43864 * @static 43865 * @memberOf _ 43866 * @since 3.10.0 43867 * @category Math 43868 * @param {number} number The number to round down. 43869 * @param {number} [precision=0] The precision to round down to. 43870 * @returns {number} Returns the rounded down number. 43871 * @example 43872 * 43873 * _.floor(4.006); 43874 * // => 4 43875 * 43876 * _.floor(0.046, 2); 43877 * // => 0.04 43878 * 43879 * _.floor(4060, -2); 43880 * // => 4000 43881 */ 43882 var floor = createRound('floor'); 43883 43884 /** 43885 * Computes the maximum value of `array`. If `array` is empty or falsey, 43886 * `undefined` is returned. 43887 * 43888 * @static 43889 * @since 0.1.0 43890 * @memberOf _ 43891 * @category Math 43892 * @param {Array} array The array to iterate over. 43893 * @returns {*} Returns the maximum value. 43894 * @example 43895 * 43896 * _.max([4, 2, 8, 6]); 43897 * // => 8 43898 * 43899 * _.max([]); 43900 * // => undefined 43901 */ 43902 function max(array) { 43903 return (array && array.length) 43904 ? baseExtremum(array, identity, baseGt) 43905 : undefined; 43906 } 43907 43908 /** 43909 * This method is like `_.max` except that it accepts `iteratee` which is 43910 * invoked for each element in `array` to generate the criterion by which 43911 * the value is ranked. The iteratee is invoked with one argument: (value). 43912 * 43913 * @static 43914 * @memberOf _ 43915 * @since 4.0.0 43916 * @category Math 43917 * @param {Array} array The array to iterate over. 43918 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 43919 * @returns {*} Returns the maximum value. 43920 * @example 43921 * 43922 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 43923 * 43924 * _.maxBy(objects, function(o) { return o.n; }); 43925 * // => { 'n': 2 } 43926 * 43927 * // The `_.property` iteratee shorthand. 43928 * _.maxBy(objects, 'n'); 43929 * // => { 'n': 2 } 43930 */ 43931 function maxBy(array, iteratee) { 43932 return (array && array.length) 43933 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) 43934 : undefined; 43935 } 43936 43937 /** 43938 * Computes the mean of the values in `array`. 43939 * 43940 * @static 43941 * @memberOf _ 43942 * @since 4.0.0 43943 * @category Math 43944 * @param {Array} array The array to iterate over. 43945 * @returns {number} Returns the mean. 43946 * @example 43947 * 43948 * _.mean([4, 2, 8, 6]); 43949 * // => 5 43950 */ 43951 function mean(array) { 43952 return baseMean(array, identity); 43953 } 43954 43955 /** 43956 * This method is like `_.mean` except that it accepts `iteratee` which is 43957 * invoked for each element in `array` to generate the value to be averaged. 43958 * The iteratee is invoked with one argument: (value). 43959 * 43960 * @static 43961 * @memberOf _ 43962 * @since 4.7.0 43963 * @category Math 43964 * @param {Array} array The array to iterate over. 43965 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 43966 * @returns {number} Returns the mean. 43967 * @example 43968 * 43969 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 43970 * 43971 * _.meanBy(objects, function(o) { return o.n; }); 43972 * // => 5 43973 * 43974 * // The `_.property` iteratee shorthand. 43975 * _.meanBy(objects, 'n'); 43976 * // => 5 43977 */ 43978 function meanBy(array, iteratee) { 43979 return baseMean(array, getIteratee(iteratee, 2)); 43980 } 43981 43982 /** 43983 * Computes the minimum value of `array`. If `array` is empty or falsey, 43984 * `undefined` is returned. 43985 * 43986 * @static 43987 * @since 0.1.0 43988 * @memberOf _ 43989 * @category Math 43990 * @param {Array} array The array to iterate over. 43991 * @returns {*} Returns the minimum value. 43992 * @example 43993 * 43994 * _.min([4, 2, 8, 6]); 43995 * // => 2 43996 * 43997 * _.min([]); 43998 * // => undefined 43999 */ 44000 function min(array) { 44001 return (array && array.length) 44002 ? baseExtremum(array, identity, baseLt) 44003 : undefined; 44004 } 44005 44006 /** 44007 * This method is like `_.min` except that it accepts `iteratee` which is 44008 * invoked for each element in `array` to generate the criterion by which 44009 * the value is ranked. The iteratee is invoked with one argument: (value). 44010 * 44011 * @static 44012 * @memberOf _ 44013 * @since 4.0.0 44014 * @category Math 44015 * @param {Array} array The array to iterate over. 44016 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 44017 * @returns {*} Returns the minimum value. 44018 * @example 44019 * 44020 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 44021 * 44022 * _.minBy(objects, function(o) { return o.n; }); 44023 * // => { 'n': 1 } 44024 * 44025 * // The `_.property` iteratee shorthand. 44026 * _.minBy(objects, 'n'); 44027 * // => { 'n': 1 } 44028 */ 44029 function minBy(array, iteratee) { 44030 return (array && array.length) 44031 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) 44032 : undefined; 44033 } 44034 44035 /** 44036 * Multiply two numbers. 44037 * 44038 * @static 44039 * @memberOf _ 44040 * @since 4.7.0 44041 * @category Math 44042 * @param {number} multiplier The first number in a multiplication. 44043 * @param {number} multiplicand The second number in a multiplication. 44044 * @returns {number} Returns the product. 44045 * @example 44046 * 44047 * _.multiply(6, 4); 44048 * // => 24 44049 */ 44050 var multiply = createMathOperation(function(multiplier, multiplicand) { 44051 return multiplier * multiplicand; 44052 }, 1); 44053 44054 /** 44055 * Computes `number` rounded to `precision`. 44056 * 44057 * @static 44058 * @memberOf _ 44059 * @since 3.10.0 44060 * @category Math 44061 * @param {number} number The number to round. 44062 * @param {number} [precision=0] The precision to round to. 44063 * @returns {number} Returns the rounded number. 44064 * @example 44065 * 44066 * _.round(4.006); 44067 * // => 4 44068 * 44069 * _.round(4.006, 2); 44070 * // => 4.01 44071 * 44072 * _.round(4060, -2); 44073 * // => 4100 44074 */ 44075 var round = createRound('round'); 44076 44077 /** 44078 * Subtract two numbers. 44079 * 44080 * @static 44081 * @memberOf _ 44082 * @since 4.0.0 44083 * @category Math 44084 * @param {number} minuend The first number in a subtraction. 44085 * @param {number} subtrahend The second number in a subtraction. 44086 * @returns {number} Returns the difference. 44087 * @example 44088 * 44089 * _.subtract(6, 4); 44090 * // => 2 44091 */ 44092 var subtract = createMathOperation(function(minuend, subtrahend) { 44093 return minuend - subtrahend; 44094 }, 0); 44095 44096 /** 44097 * Computes the sum of the values in `array`. 44098 * 44099 * @static 44100 * @memberOf _ 44101 * @since 3.4.0 44102 * @category Math 44103 * @param {Array} array The array to iterate over. 44104 * @returns {number} Returns the sum. 44105 * @example 44106 * 44107 * _.sum([4, 2, 8, 6]); 44108 * // => 20 44109 */ 44110 function sum(array) { 44111 return (array && array.length) 44112 ? baseSum(array, identity) 44113 : 0; 44114 } 44115 44116 /** 44117 * This method is like `_.sum` except that it accepts `iteratee` which is 44118 * invoked for each element in `array` to generate the value to be summed. 44119 * The iteratee is invoked with one argument: (value). 44120 * 44121 * @static 44122 * @memberOf _ 44123 * @since 4.0.0 44124 * @category Math 44125 * @param {Array} array The array to iterate over. 44126 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 44127 * @returns {number} Returns the sum. 44128 * @example 44129 * 44130 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 44131 * 44132 * _.sumBy(objects, function(o) { return o.n; }); 44133 * // => 20 44134 * 44135 * // The `_.property` iteratee shorthand. 44136 * _.sumBy(objects, 'n'); 44137 * // => 20 44138 */ 44139 function sumBy(array, iteratee) { 44140 return (array && array.length) 44141 ? baseSum(array, getIteratee(iteratee, 2)) 44142 : 0; 44143 } 44144 44145 /*------------------------------------------------------------------------*/ 44146 44147 // Add methods that return wrapped values in chain sequences. 44148 lodash.after = after; 44149 lodash.ary = ary; 44150 lodash.assign = assign; 44151 lodash.assignIn = assignIn; 44152 lodash.assignInWith = assignInWith; 44153 lodash.assignWith = assignWith; 44154 lodash.at = at; 44155 lodash.before = before; 44156 lodash.bind = bind; 44157 lodash.bindAll = bindAll; 44158 lodash.bindKey = bindKey; 44159 lodash.castArray = castArray; 44160 lodash.chain = chain; 44161 lodash.chunk = chunk; 44162 lodash.compact = compact; 44163 lodash.concat = concat; 44164 lodash.cond = cond; 44165 lodash.conforms = conforms; 44166 lodash.constant = constant; 44167 lodash.countBy = countBy; 44168 lodash.create = create; 44169 lodash.curry = curry; 44170 lodash.curryRight = curryRight; 44171 lodash.debounce = debounce; 44172 lodash.defaults = defaults; 44173 lodash.defaultsDeep = defaultsDeep; 44174 lodash.defer = defer; 44175 lodash.delay = delay; 44176 lodash.difference = difference; 44177 lodash.differenceBy = differenceBy; 44178 lodash.differenceWith = differenceWith; 44179 lodash.drop = drop; 44180 lodash.dropRight = dropRight; 44181 lodash.dropRightWhile = dropRightWhile; 44182 lodash.dropWhile = dropWhile; 44183 lodash.fill = fill; 44184 lodash.filter = filter; 44185 lodash.flatMap = flatMap; 44186 lodash.flatMapDeep = flatMapDeep; 44187 lodash.flatMapDepth = flatMapDepth; 44188 lodash.flatten = flatten; 44189 lodash.flattenDeep = flattenDeep; 44190 lodash.flattenDepth = flattenDepth; 44191 lodash.flip = flip; 44192 lodash.flow = flow; 44193 lodash.flowRight = flowRight; 44194 lodash.fromPairs = fromPairs; 44195 lodash.functions = functions; 44196 lodash.functionsIn = functionsIn; 44197 lodash.groupBy = groupBy; 44198 lodash.initial = initial; 44199 lodash.intersection = intersection; 44200 lodash.intersectionBy = intersectionBy; 44201 lodash.intersectionWith = intersectionWith; 44202 lodash.invert = invert; 44203 lodash.invertBy = invertBy; 44204 lodash.invokeMap = invokeMap; 44205 lodash.iteratee = iteratee; 44206 lodash.keyBy = keyBy; 44207 lodash.keys = keys; 44208 lodash.keysIn = keysIn; 44209 lodash.map = map; 44210 lodash.mapKeys = mapKeys; 44211 lodash.mapValues = mapValues; 44212 lodash.matches = matches; 44213 lodash.matchesProperty = matchesProperty; 44214 lodash.memoize = memoize; 44215 lodash.merge = merge; 44216 lodash.mergeWith = mergeWith; 44217 lodash.method = method; 44218 lodash.methodOf = methodOf; 44219 lodash.mixin = mixin; 44220 lodash.negate = negate; 44221 lodash.nthArg = nthArg; 44222 lodash.omit = omit; 44223 lodash.omitBy = omitBy; 44224 lodash.once = once; 44225 lodash.orderBy = orderBy; 44226 lodash.over = over; 44227 lodash.overArgs = overArgs; 44228 lodash.overEvery = overEvery; 44229 lodash.overSome = overSome; 44230 lodash.partial = partial; 44231 lodash.partialRight = partialRight; 44232 lodash.partition = partition; 44233 lodash.pick = pick; 44234 lodash.pickBy = pickBy; 44235 lodash.property = property; 44236 lodash.propertyOf = propertyOf; 44237 lodash.pull = pull; 44238 lodash.pullAll = pullAll; 44239 lodash.pullAllBy = pullAllBy; 44240 lodash.pullAllWith = pullAllWith; 44241 lodash.pullAt = pullAt; 44242 lodash.range = range; 44243 lodash.rangeRight = rangeRight; 44244 lodash.rearg = rearg; 44245 lodash.reject = reject; 44246 lodash.remove = remove; 44247 lodash.rest = rest; 44248 lodash.reverse = reverse; 44249 lodash.sampleSize = sampleSize; 44250 lodash.set = set; 44251 lodash.setWith = setWith; 44252 lodash.shuffle = shuffle; 44253 lodash.slice = slice; 44254 lodash.sortBy = sortBy; 44255 lodash.sortedUniq = sortedUniq; 44256 lodash.sortedUniqBy = sortedUniqBy; 44257 lodash.split = split; 44258 lodash.spread = spread; 44259 lodash.tail = tail; 44260 lodash.take = take; 44261 lodash.takeRight = takeRight; 44262 lodash.takeRightWhile = takeRightWhile; 44263 lodash.takeWhile = takeWhile; 44264 lodash.tap = tap; 44265 lodash.throttle = throttle; 44266 lodash.thru = thru; 44267 lodash.toArray = toArray; 44268 lodash.toPairs = toPairs; 44269 lodash.toPairsIn = toPairsIn; 44270 lodash.toPath = toPath; 44271 lodash.toPlainObject = toPlainObject; 44272 lodash.transform = transform; 44273 lodash.unary = unary; 44274 lodash.union = union; 44275 lodash.unionBy = unionBy; 44276 lodash.unionWith = unionWith; 44277 lodash.uniq = uniq; 44278 lodash.uniqBy = uniqBy; 44279 lodash.uniqWith = uniqWith; 44280 lodash.unset = unset; 44281 lodash.unzip = unzip; 44282 lodash.unzipWith = unzipWith; 44283 lodash.update = update; 44284 lodash.updateWith = updateWith; 44285 lodash.values = values; 44286 lodash.valuesIn = valuesIn; 44287 lodash.without = without; 44288 lodash.words = words; 44289 lodash.wrap = wrap; 44290 lodash.xor = xor; 44291 lodash.xorBy = xorBy; 44292 lodash.xorWith = xorWith; 44293 lodash.zip = zip; 44294 lodash.zipObject = zipObject; 44295 lodash.zipObjectDeep = zipObjectDeep; 44296 lodash.zipWith = zipWith; 44297 44298 // Add aliases. 44299 lodash.entries = toPairs; 44300 lodash.entriesIn = toPairsIn; 44301 lodash.extend = assignIn; 44302 lodash.extendWith = assignInWith; 44303 44304 // Add methods to `lodash.prototype`. 44305 mixin(lodash, lodash); 44306 44307 /*------------------------------------------------------------------------*/ 44308 44309 // Add methods that return unwrapped values in chain sequences. 44310 lodash.add = add; 44311 lodash.attempt = attempt; 44312 lodash.camelCase = camelCase; 44313 lodash.capitalize = capitalize; 44314 lodash.ceil = ceil; 44315 lodash.clamp = clamp; 44316 lodash.clone = clone; 44317 lodash.cloneDeep = cloneDeep; 44318 lodash.cloneDeepWith = cloneDeepWith; 44319 lodash.cloneWith = cloneWith; 44320 lodash.conformsTo = conformsTo; 44321 lodash.deburr = deburr; 44322 lodash.defaultTo = defaultTo; 44323 lodash.divide = divide; 44324 lodash.endsWith = endsWith; 44325 lodash.eq = eq; 44326 lodash.escape = escape; 44327 lodash.escapeRegExp = escapeRegExp; 44328 lodash.every = every; 44329 lodash.find = find; 44330 lodash.findIndex = findIndex; 44331 lodash.findKey = findKey; 44332 lodash.findLast = findLast; 44333 lodash.findLastIndex = findLastIndex; 44334 lodash.findLastKey = findLastKey; 44335 lodash.floor = floor; 44336 lodash.forEach = forEach; 44337 lodash.forEachRight = forEachRight; 44338 lodash.forIn = forIn; 44339 lodash.forInRight = forInRight; 44340 lodash.forOwn = forOwn; 44341 lodash.forOwnRight = forOwnRight; 44342 lodash.get = get; 44343 lodash.gt = gt; 44344 lodash.gte = gte; 44345 lodash.has = has; 44346 lodash.hasIn = hasIn; 44347 lodash.head = head; 44348 lodash.identity = identity; 44349 lodash.includes = includes; 44350 lodash.indexOf = indexOf; 44351 lodash.inRange = inRange; 44352 lodash.invoke = invoke; 44353 lodash.isArguments = isArguments; 44354 lodash.isArray = isArray; 44355 lodash.isArrayBuffer = isArrayBuffer; 44356 lodash.isArrayLike = isArrayLike; 44357 lodash.isArrayLikeObject = isArrayLikeObject; 44358 lodash.isBoolean = isBoolean; 44359 lodash.isBuffer = isBuffer; 44360 lodash.isDate = isDate; 44361 lodash.isElement = isElement; 44362 lodash.isEmpty = isEmpty; 44363 lodash.isEqual = isEqual; 44364 lodash.isEqualWith = isEqualWith; 44365 lodash.isError = isError; 44366 lodash.isFinite = isFinite; 44367 lodash.isFunction = isFunction; 44368 lodash.isInteger = isInteger; 44369 lodash.isLength = isLength; 44370 lodash.isMap = isMap; 44371 lodash.isMatch = isMatch; 44372 lodash.isMatchWith = isMatchWith; 44373 lodash.isNaN = isNaN; 44374 lodash.isNative = isNative; 44375 lodash.isNil = isNil; 44376 lodash.isNull = isNull; 44377 lodash.isNumber = isNumber; 44378 lodash.isObject = isObject; 44379 lodash.isObjectLike = isObjectLike; 44380 lodash.isPlainObject = isPlainObject; 44381 lodash.isRegExp = isRegExp; 44382 lodash.isSafeInteger = isSafeInteger; 44383 lodash.isSet = isSet; 44384 lodash.isString = isString; 44385 lodash.isSymbol = isSymbol; 44386 lodash.isTypedArray = isTypedArray; 44387 lodash.isUndefined = isUndefined; 44388 lodash.isWeakMap = isWeakMap; 44389 lodash.isWeakSet = isWeakSet; 44390 lodash.join = join; 44391 lodash.kebabCase = kebabCase; 44392 lodash.last = last; 44393 lodash.lastIndexOf = lastIndexOf; 44394 lodash.lowerCase = lowerCase; 44395 lodash.lowerFirst = lowerFirst; 44396 lodash.lt = lt; 44397 lodash.lte = lte; 44398 lodash.max = max; 44399 lodash.maxBy = maxBy; 44400 lodash.mean = mean; 44401 lodash.meanBy = meanBy; 44402 lodash.min = min; 44403 lodash.minBy = minBy; 44404 lodash.stubArray = stubArray; 44405 lodash.stubFalse = stubFalse; 44406 lodash.stubObject = stubObject; 44407 lodash.stubString = stubString; 44408 lodash.stubTrue = stubTrue; 44409 lodash.multiply = multiply; 44410 lodash.nth = nth; 44411 lodash.noConflict = noConflict; 44412 lodash.noop = noop; 44413 lodash.now = now; 44414 lodash.pad = pad; 44415 lodash.padEnd = padEnd; 44416 lodash.padStart = padStart; 44417 lodash.parseInt = parseInt; 44418 lodash.random = random; 44419 lodash.reduce = reduce; 44420 lodash.reduceRight = reduceRight; 44421 lodash.repeat = repeat; 44422 lodash.replace = replace; 44423 lodash.result = result; 44424 lodash.round = round; 44425 lodash.runInContext = runInContext; 44426 lodash.sample = sample; 44427 lodash.size = size; 44428 lodash.snakeCase = snakeCase; 44429 lodash.some = some; 44430 lodash.sortedIndex = sortedIndex; 44431 lodash.sortedIndexBy = sortedIndexBy; 44432 lodash.sortedIndexOf = sortedIndexOf; 44433 lodash.sortedLastIndex = sortedLastIndex; 44434 lodash.sortedLastIndexBy = sortedLastIndexBy; 44435 lodash.sortedLastIndexOf = sortedLastIndexOf; 44436 lodash.startCase = startCase; 44437 lodash.startsWith = startsWith; 44438 lodash.subtract = subtract; 44439 lodash.sum = sum; 44440 lodash.sumBy = sumBy; 44441 lodash.template = template; 44442 lodash.times = times; 44443 lodash.toFinite = toFinite; 44444 lodash.toInteger = toInteger; 44445 lodash.toLength = toLength; 44446 lodash.toLower = toLower; 44447 lodash.toNumber = toNumber; 44448 lodash.toSafeInteger = toSafeInteger; 44449 lodash.toString = toString; 44450 lodash.toUpper = toUpper; 44451 lodash.trim = trim; 44452 lodash.trimEnd = trimEnd; 44453 lodash.trimStart = trimStart; 44454 lodash.truncate = truncate; 44455 lodash.unescape = unescape; 44456 lodash.uniqueId = uniqueId; 44457 lodash.upperCase = upperCase; 44458 lodash.upperFirst = upperFirst; 44459 44460 // Add aliases. 44461 lodash.each = forEach; 44462 lodash.eachRight = forEachRight; 44463 lodash.first = head; 44464 44465 mixin(lodash, (function() { 44466 var source = {}; 44467 baseForOwn(lodash, function(func, methodName) { 44468 if (!hasOwnProperty.call(lodash.prototype, methodName)) { 44469 source[methodName] = func; 44470 } 44471 }); 44472 return source; 44473 }()), { 'chain': false }); 44474 44475 /*------------------------------------------------------------------------*/ 44476 44477 /** 44478 * The semantic version number. 44479 * 44480 * @static 44481 * @memberOf _ 44482 * @type {string} 44483 */ 44484 lodash.VERSION = VERSION; 44485 44486 // Assign default placeholders. 44487 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { 44488 lodash[methodName].placeholder = lodash; 44489 }); 44490 44491 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. 44492 arrayEach(['drop', 'take'], function(methodName, index) { 44493 LazyWrapper.prototype[methodName] = function(n) { 44494 n = n === undefined ? 1 : nativeMax(toInteger(n), 0); 44495 44496 var result = (this.__filtered__ && !index) 44497 ? new LazyWrapper(this) 44498 : this.clone(); 44499 44500 if (result.__filtered__) { 44501 result.__takeCount__ = nativeMin(n, result.__takeCount__); 44502 } else { 44503 result.__views__.push({ 44504 'size': nativeMin(n, MAX_ARRAY_LENGTH), 44505 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') 44506 }); 44507 } 44508 return result; 44509 }; 44510 44511 LazyWrapper.prototype[methodName + 'Right'] = function(n) { 44512 return this.reverse()[methodName](n).reverse(); 44513 }; 44514 }); 44515 44516 // Add `LazyWrapper` methods that accept an `iteratee` value. 44517 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { 44518 var type = index + 1, 44519 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; 44520 44521 LazyWrapper.prototype[methodName] = function(iteratee) { 44522 var result = this.clone(); 44523 result.__iteratees__.push({ 44524 'iteratee': getIteratee(iteratee, 3), 44525 'type': type 44526 }); 44527 result.__filtered__ = result.__filtered__ || isFilter; 44528 return result; 44529 }; 44530 }); 44531 44532 // Add `LazyWrapper` methods for `_.head` and `_.last`. 44533 arrayEach(['head', 'last'], function(methodName, index) { 44534 var takeName = 'take' + (index ? 'Right' : ''); 44535 44536 LazyWrapper.prototype[methodName] = function() { 44537 return this[takeName](1).value()[0]; 44538 }; 44539 }); 44540 44541 // Add `LazyWrapper` methods for `_.initial` and `_.tail`. 44542 arrayEach(['initial', 'tail'], function(methodName, index) { 44543 var dropName = 'drop' + (index ? '' : 'Right'); 44544 44545 LazyWrapper.prototype[methodName] = function() { 44546 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); 44547 }; 44548 }); 44549 44550 LazyWrapper.prototype.compact = function() { 44551 return this.filter(identity); 44552 }; 44553 44554 LazyWrapper.prototype.find = function(predicate) { 44555 return this.filter(predicate).head(); 44556 }; 44557 44558 LazyWrapper.prototype.findLast = function(predicate) { 44559 return this.reverse().find(predicate); 44560 }; 44561 44562 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { 44563 if (typeof path == 'function') { 44564 return new LazyWrapper(this); 44565 } 44566 return this.map(function(value) { 44567 return baseInvoke(value, path, args); 44568 }); 44569 }); 44570 44571 LazyWrapper.prototype.reject = function(predicate) { 44572 return this.filter(negate(getIteratee(predicate))); 44573 }; 44574 44575 LazyWrapper.prototype.slice = function(start, end) { 44576 start = toInteger(start); 44577 44578 var result = this; 44579 if (result.__filtered__ && (start > 0 || end < 0)) { 44580 return new LazyWrapper(result); 44581 } 44582 if (start < 0) { 44583 result = result.takeRight(-start); 44584 } else if (start) { 44585 result = result.drop(start); 44586 } 44587 if (end !== undefined) { 44588 end = toInteger(end); 44589 result = end < 0 ? result.dropRight(-end) : result.take(end - start); 44590 } 44591 return result; 44592 }; 44593 44594 LazyWrapper.prototype.takeRightWhile = function(predicate) { 44595 return this.reverse().takeWhile(predicate).reverse(); 44596 }; 44597 44598 LazyWrapper.prototype.toArray = function() { 44599 return this.take(MAX_ARRAY_LENGTH); 44600 }; 44601 44602 // Add `LazyWrapper` methods to `lodash.prototype`. 44603 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 44604 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), 44605 isTaker = /^(?:head|last)$/.test(methodName), 44606 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], 44607 retUnwrapped = isTaker || /^find/.test(methodName); 44608 44609 if (!lodashFunc) { 44610 return; 44611 } 44612 lodash.prototype[methodName] = function() { 44613 var value = this.__wrapped__, 44614 args = isTaker ? [1] : arguments, 44615 isLazy = value instanceof LazyWrapper, 44616 iteratee = args[0], 44617 useLazy = isLazy || isArray(value); 44618 44619 var interceptor = function(value) { 44620 var result = lodashFunc.apply(lodash, arrayPush([value], args)); 44621 return (isTaker && chainAll) ? result[0] : result; 44622 }; 44623 44624 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { 44625 // Avoid lazy use if the iteratee has a "length" value other than `1`. 44626 isLazy = useLazy = false; 44627 } 44628 var chainAll = this.__chain__, 44629 isHybrid = !!this.__actions__.length, 44630 isUnwrapped = retUnwrapped && !chainAll, 44631 onlyLazy = isLazy && !isHybrid; 44632 44633 if (!retUnwrapped && useLazy) { 44634 value = onlyLazy ? value : new LazyWrapper(this); 44635 var result = func.apply(value, args); 44636 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); 44637 return new LodashWrapper(result, chainAll); 44638 } 44639 if (isUnwrapped && onlyLazy) { 44640 return func.apply(this, args); 44641 } 44642 result = this.thru(interceptor); 44643 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; 44644 }; 44645 }); 44646 44647 // Add `Array` methods to `lodash.prototype`. 44648 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { 44649 var func = arrayProto[methodName], 44650 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', 44651 retUnwrapped = /^(?:pop|shift)$/.test(methodName); 44652 44653 lodash.prototype[methodName] = function() { 44654 var args = arguments; 44655 if (retUnwrapped && !this.__chain__) { 44656 var value = this.value(); 44657 return func.apply(isArray(value) ? value : [], args); 44658 } 44659 return this[chainName](function(value) { 44660 return func.apply(isArray(value) ? value : [], args); 44661 }); 44662 }; 44663 }); 44664 44665 // Map minified method names to their real names. 44666 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 44667 var lodashFunc = lodash[methodName]; 44668 if (lodashFunc) { 44669 var key = lodashFunc.name + ''; 44670 if (!hasOwnProperty.call(realNames, key)) { 44671 realNames[key] = []; 44672 } 44673 realNames[key].push({ 'name': methodName, 'func': lodashFunc }); 44674 } 44675 }); 44676 44677 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ 44678 'name': 'wrapper', 44679 'func': undefined 44680 }]; 44681 44682 // Add methods to `LazyWrapper`. 44683 LazyWrapper.prototype.clone = lazyClone; 44684 LazyWrapper.prototype.reverse = lazyReverse; 44685 LazyWrapper.prototype.value = lazyValue; 44686 44687 // Add chain sequence methods to the `lodash` wrapper. 44688 lodash.prototype.at = wrapperAt; 44689 lodash.prototype.chain = wrapperChain; 44690 lodash.prototype.commit = wrapperCommit; 44691 lodash.prototype.next = wrapperNext; 44692 lodash.prototype.plant = wrapperPlant; 44693 lodash.prototype.reverse = wrapperReverse; 44694 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; 44695 44696 // Add lazy aliases. 44697 lodash.prototype.first = lodash.prototype.head; 44698 44699 if (symIterator) { 44700 lodash.prototype[symIterator] = wrapperToIterator; 44701 } 44702 return lodash; 44703 }); 44704 44705 /*--------------------------------------------------------------------------*/ 44706 44707 // Export lodash. 44708 var _ = runInContext(); 44709 44710 // Some AMD build optimizers, like r.js, check for condition patterns like: 44711 if (true) { 44712 // Expose Lodash on the global object to prevent errors when Lodash is 44713 // loaded by a script tag in the presence of an AMD loader. 44714 // See http://requirejs.org/docs/errors.html#mismatch for more details. 44715 // Use `_.noConflict` to remove Lodash from the global object. 44716 root._ = _; 44717 44718 // Define as an anonymous module so, through path mapping, it can be 44719 // referenced as the "underscore" module. 44720 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { 44721 return _; 44722 }).call(exports, __webpack_require__, exports, module), 44723 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 44724 } 44725 // Check for `exports` after `define` in case a build optimizer adds it. 44726 else {} 44727}.call(this)); 44728 44729 44730/***/ }), 44731
44732/***/ "./public/module/user/scss/user.scss": 44733/*!*******************************************!*\ 44734 !*** ./public/module/user/scss/user.scss ***! 44735 \*******************************************/ 44736/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44737 44738"use strict"; 44739__webpack_require__.r(__webpack_exports__); 44740// extracted by mini-css-extract-plugin 44741 44742 44743/***/ }), 44744
44745/***/ "./public/module/user/scss/profile.scss": 44746/*!**********************************************!*\ 44747 !*** ./public/module/user/scss/profile.scss ***! 44748 \**********************************************/ 44749/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44750 44751"use strict"; 44752__webpack_require__.r(__webpack_exports__); 44753// extracted by mini-css-extract-plugin 44754 44755 44756/***/ }), 44757
44758/***/ "./public/module/hotel/scss/hotel.scss": 44759/*!*********************************************!*\ 44760 !*** ./public/module/hotel/scss/hotel.scss ***! 44761 \*********************************************/ 44762/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44763 44764"use strict"; 44765__webpack_require__.r(__webpack_exports__); 44766// extracted by mini-css-extract-plugin 44767 44768 44769/***/ }), 44770
44771/***/ "./public/module/news/scss/news.scss": 44772/*!*******************************************!*\ 44773 !*** ./public/module/news/scss/news.scss ***! 44774 \*******************************************/ 44775/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44776 44777"use strict"; 44778__webpack_require__.r(__webpack_exports__); 44779// extracted by mini-css-extract-plugin 44780 44781 44782/***/ }), 44783
44784/***/ "./public/module/media/scss/browser.scss": 44785/*!***********************************************!*\ 44786 !*** ./public/module/media/scss/browser.scss ***! 44787 \***********************************************/ 44788/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44789 44790"use strict"; 44791__webpack_require__.r(__webpack_exports__); 44792// extracted by mini-css-extract-plugin 44793 44794 44795/***/ }), 44796
44797/***/ "./public/module/location/scss/location.scss": 44798/*!***************************************************!*\ 44799 !*** ./public/module/location/scss/location.scss ***! 44800 \***************************************************/ 44801/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44802 44803"use strict"; 44804__webpack_require__.r(__webpack_exports__); 44805// extracted by mini-css-extract-plugin 44806 44807 44808/***/ }), 44809
44810/***/ "./public/module/social/scss/social.scss": 44811/*!***********************************************!*\ 44812 !*** ./public/module/social/scss/social.scss ***! 44813 \***********************************************/ 44814/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44815 44816"use strict"; 44817__webpack_require__.r(__webpack_exports__); 44818// extracted by mini-css-extract-plugin 44819 44820 44821/***/ }), 44822
44823/***/ "./resources/sass/admin/vendors.scss": 44824/*!*******************************************!*\ 44825 !*** ./resources/sass/admin/vendors.scss ***! 44826 \*******************************************/ 44827/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44828 44829"use strict"; 44830__webpack_require__.r(__webpack_exports__); 44831// extracted by mini-css-extract-plugin 44832 44833 44834/***/ }), 44835
44836/***/ "./resources/sass/admin/app.scss": 44837/*!***************************************!*\ 44838 !*** ./resources/sass/admin/app.scss ***! 44839 \***************************************/ 44840/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44841 44842"use strict"; 44843__webpack_require__.r(__webpack_exports__); 44844// extracted by mini-css-extract-plugin 44845 44846 44847/***/ }), 44848
44849/***/ "./public/sass/app.scss": 44850/*!******************************!*\ 44851 !*** ./public/sass/app.scss ***! 44852 \******************************/ 44853/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44854 44855"use strict"; 44856__webpack_require__.r(__webpack_exports__); 44857// extracted by mini-css-extract-plugin 44858 44859 44860/***/ }), 44861
44862/***/ "./public/sass/contact.scss": 44863/*!**********************************!*\ 44864 !*** ./public/sass/contact.scss ***! 44865 \**********************************/ 44866/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44867 44868"use strict"; 44869__webpack_require__.r(__webpack_exports__); 44870// extracted by mini-css-extract-plugin 44871 44872 44873/***/ }), 44874
44875/***/ "./public/sass/rtl.scss": 44876/*!******************************!*\ 44877 !*** ./public/sass/rtl.scss ***! 44878 \******************************/ 44879/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44880 44881"use strict"; 44882__webpack_require__.r(__webpack_exports__); 44883// extracted by mini-css-extract-plugin 44884 44885 44886/***/ }), 44887
44888/***/ "./public/module/booking/scss/checkout.scss": 44889/*!**************************************************!*\ 44890 !*** ./public/module/booking/scss/checkout.scss ***! 44891 \**************************************************/ 44892/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44893 44894"use strict"; 44895__webpack_require__.r(__webpack_exports__); 44896// extracted by mini-css-extract-plugin 44897 44898 44899/***/ }), 44900
vendor: 89,083 bytes, lines 44901-47531
44901/***/ "./node_modules/popper.js/dist/esm/popper.js": 44902/*!***************************************************!*\ 44903 !*** ./node_modules/popper.js/dist/esm/popper.js ***! 44904 \***************************************************/ 44905/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 44906 44907"use strict"; 44908__webpack_require__.r(__webpack_exports__); 44909/* harmony export */ __webpack_require__.d(__webpack_exports__, { 44910/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 44911/* harmony export */ }); 44912/**! 44913 * @fileOverview Kickass library to create and place poppers near their reference elements. 44914 * @version 1.16.1 44915 * @license 44916 * Copyright (c) 2016 Federico Zivolo and contributors 44917 * 44918 * Permission is hereby granted, free of charge, to any person obtaining a copy 44919 * of this software and associated documentation files (the "Software"), to deal 44920 * in the Software without restriction, including without limitation the rights 44921 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 44922 * copies of the Software, and to permit persons to whom the Software is 44923 * furnished to do so, subject to the following conditions: 44924 * 44925 * The above copyright notice and this permission notice shall be included in all 44926 * copies or substantial portions of the Software. 44927 * 44928 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44929 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 44930 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44931 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 44932 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 44933 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 44934 * SOFTWARE. 44935 */ 44936var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 44937 44938var timeoutDuration = function () { 44939 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 44940 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 44941 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 44942 return 1; 44943 } 44944 } 44945 return 0; 44946}(); 44947 44948function microtaskDebounce(fn) { 44949 var called = false; 44950 return function () { 44951 if (called) { 44952 return; 44953 } 44954 called = true; 44955 window.Promise.resolve().then(function () { 44956 called = false; 44957 fn(); 44958 }); 44959 }; 44960} 44961 44962function taskDebounce(fn) { 44963 var scheduled = false; 44964 return function () { 44965 if (!scheduled) { 44966 scheduled = true; 44967 setTimeout(function () { 44968 scheduled = false; 44969 fn(); 44970 }, timeoutDuration); 44971 } 44972 }; 44973} 44974 44975var supportsMicroTasks = isBrowser && window.Promise; 44976 44977/** 44978* Create a debounced version of a method, that's asynchronously deferred 44979* but called in the minimum time possible. 44980* 44981* @method 44982* @memberof Popper.Utils 44983* @argument {Function} fn 44984* @returns {Function} 44985*/ 44986var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 44987 44988/** 44989 * Check if the given variable is a function 44990 * @method 44991 * @memberof Popper.Utils 44992 * @argument {Any} functionToCheck - variable to check 44993 * @returns {Boolean} answer to: is a function? 44994 */ 44995function isFunction(functionToCheck) { 44996 var getType = {}; 44997 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 44998} 44999 45000/** 45001 * Get CSS computed property of the given element 45002 * @method 45003 * @memberof Popper.Utils 45004 * @argument {Eement} element 45005 * @argument {String} property 45006 */ 45007function getStyleComputedProperty(element, property) { 45008 if (element.nodeType !== 1) { 45009 return []; 45010 } 45011 // NOTE: 1 DOM access here 45012 var window = element.ownerDocument.defaultView; 45013 var css = window.getComputedStyle(element, null); 45014 return property ? css[property] : css; 45015} 45016 45017/** 45018 * Returns the parentNode or the host of the element 45019 * @method 45020 * @memberof Popper.Utils 45021 * @argument {Element} element 45022 * @returns {Element} parent 45023 */ 45024function getParentNode(element) { 45025 if (element.nodeName === 'HTML') { 45026 return element; 45027 } 45028 return element.parentNode || element.host; 45029} 45030 45031/** 45032 * Returns the scrolling parent of the given element 45033 * @method 45034 * @memberof Popper.Utils 45035 * @argument {Element} element 45036 * @returns {Element} scroll parent 45037 */ 45038function getScrollParent(element) { 45039 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 45040 if (!element) { 45041 return document.body; 45042 } 45043 45044 switch (element.nodeName) { 45045 case 'HTML': 45046 case 'BODY': 45047 return element.ownerDocument.body; 45048 case '#document': 45049 return element.body; 45050 } 45051 45052 // Firefox want us to check `-x` and `-y` variations as well 45053 45054 var _getStyleComputedProp = getStyleComputedProperty(element), 45055 overflow = _getStyleComputedProp.overflow, 45056 overflowX = _getStyleComputedProp.overflowX, 45057 overflowY = _getStyleComputedProp.overflowY; 45058 45059 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 45060 return element; 45061 } 45062 45063 return getScrollParent(getParentNode(element)); 45064} 45065 45066/** 45067 * Returns the reference node of the reference object, or the reference object itself. 45068 * @method 45069 * @memberof Popper.Utils 45070 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 45071 * @returns {Element} parent 45072 */ 45073function getReferenceNode(reference) { 45074 return reference && reference.referenceNode ? reference.referenceNode : reference; 45075} 45076 45077var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 45078var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 45079 45080/** 45081 * Determines if the browser is Internet Explorer 45082 * @method 45083 * @memberof Popper.Utils 45084 * @param {Number} version to check 45085 * @returns {Boolean} isIE 45086 */ 45087function isIE(version) { 45088 if (version === 11) { 45089 return isIE11; 45090 } 45091 if (version === 10) { 45092 return isIE10; 45093 } 45094 return isIE11 || isIE10; 45095} 45096 45097/** 45098 * Returns the offset parent of the given element 45099 * @method 45100 * @memberof Popper.Utils 45101 * @argument {Element} element 45102 * @returns {Element} offset parent 45103 */ 45104function getOffsetParent(element) { 45105 if (!element) { 45106 return document.documentElement; 45107 } 45108 45109 var noOffsetParent = isIE(10) ? document.body : null; 45110 45111 // NOTE: 1 DOM access here 45112 var offsetParent = element.offsetParent || null; 45113 // Skip hidden elements which don't have an offsetParent 45114 while (offsetParent === noOffsetParent && element.nextElementSibling) { 45115 offsetParent = (element = element.nextElementSibling).offsetParent; 45116 } 45117 45118 var nodeName = offsetParent && offsetParent.nodeName; 45119 45120 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 45121 return element ? element.ownerDocument.documentElement : document.documentElement; 45122 } 45123 45124 // .offsetParent will return the closest TH, TD or TABLE in case 45125 // no offsetParent is present, I hate this job... 45126 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 45127 return getOffsetParent(offsetParent); 45128 } 45129 45130 return offsetParent; 45131} 45132 45133function isOffsetContainer(element) { 45134 var nodeName = element.nodeName; 45135 45136 if (nodeName === 'BODY') { 45137 return false; 45138 } 45139 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 45140} 45141 45142/** 45143 * Finds the root node (document, shadowDOM root) of the given element 45144 * @method 45145 * @memberof Popper.Utils 45146 * @argument {Element} node 45147 * @returns {Element} root node 45148 */ 45149function getRoot(node) { 45150 if (node.parentNode !== null) { 45151 return getRoot(node.parentNode); 45152 } 45153 45154 return node; 45155} 45156 45157/** 45158 * Finds the offset parent common to the two provided nodes 45159 * @method 45160 * @memberof Popper.Utils 45161 * @argument {Element} element1 45162 * @argument {Element} element2 45163 * @returns {Element} common offset parent 45164 */ 45165function findCommonOffsetParent(element1, element2) { 45166 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 45167 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 45168 return document.documentElement; 45169 } 45170 45171 // Here we make sure to give as "start" the element that comes first in the DOM 45172 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 45173 var start = order ? element1 : element2; 45174 var end = order ? element2 : element1; 45175 45176 // Get common ancestor container 45177 var range = document.createRange(); 45178 range.setStart(start, 0); 45179 range.setEnd(end, 0); 45180 var commonAncestorContainer = range.commonAncestorContainer; 45181 45182 // Both nodes are inside #document 45183 45184 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 45185 if (isOffsetContainer(commonAncestorContainer)) { 45186 return commonAncestorContainer; 45187 } 45188 45189 return getOffsetParent(commonAncestorContainer); 45190 } 45191 45192 // one of the nodes is inside shadowDOM, find which one 45193 var element1root = getRoot(element1); 45194 if (element1root.host) { 45195 return findCommonOffsetParent(element1root.host, element2); 45196 } else { 45197 return findCommonOffsetParent(element1, getRoot(element2).host); 45198 } 45199} 45200 45201/** 45202 * Gets the scroll value of the given element in the given side (top and left) 45203 * @method 45204 * @memberof Popper.Utils 45205 * @argument {Element} element 45206 * @argument {String} side `top` or `left` 45207 * @returns {number} amount of scrolled pixels 45208 */ 45209function getScroll(element) { 45210 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 45211 45212 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 45213 var nodeName = element.nodeName; 45214 45215 if (nodeName === 'BODY' || nodeName === 'HTML') { 45216 var html = element.ownerDocument.documentElement; 45217 var scrollingElement = element.ownerDocument.scrollingElement || html; 45218 return scrollingElement[upperSide]; 45219 } 45220 45221 return element[upperSide]; 45222} 45223 45224/* 45225 * Sum or subtract the element scroll values (left and top) from a given rect object 45226 * @method 45227 * @memberof Popper.Utils 45228 * @param {Object} rect - Rect object you want to change 45229 * @param {HTMLElement} element - The element from the function reads the scroll values 45230 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 45231 * @return {Object} rect - The modifier rect object 45232 */ 45233function includeScroll(rect, element) { 45234 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 45235 45236 var scrollTop = getScroll(element, 'top'); 45237 var scrollLeft = getScroll(element, 'left'); 45238 var modifier = subtract ? -1 : 1; 45239 rect.top += scrollTop * modifier; 45240 rect.bottom += scrollTop * modifier; 45241 rect.left += scrollLeft * modifier; 45242 rect.right += scrollLeft * modifier; 45243 return rect; 45244} 45245 45246/* 45247 * Helper to detect borders of a given element 45248 * @method 45249 * @memberof Popper.Utils 45250 * @param {CSSStyleDeclaration} styles 45251 * Result of `getStyleComputedProperty` on the given element 45252 * @param {String} axis - `x` or `y` 45253 * @return {number} borders - The borders size of the given axis 45254 */ 45255 45256function getBordersSize(styles, axis) { 45257 var sideA = axis === 'x' ? 'Left' : 'Top'; 45258 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 45259 45260 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 45261} 45262 45263function getSize(axis, body, html, computedStyle) { 45264 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 45265} 45266 45267function getWindowSizes(document) { 45268 var body = document.body; 45269 var html = document.documentElement; 45270 var computedStyle = isIE(10) && getComputedStyle(html); 45271 45272 return { 45273 height: getSize('Height', body, html, computedStyle), 45274 width: getSize('Width', body, html, computedStyle) 45275 }; 45276} 45277 45278var classCallCheck = function (instance, Constructor) { 45279 if (!(instance instanceof Constructor)) { 45280 throw new TypeError("Cannot call a class as a function"); 45281 } 45282}; 45283 45284var createClass = function () { 45285 function defineProperties(target, props) { 45286 for (var i = 0; i < props.length; i++) { 45287 var descriptor = props[i]; 45288 descriptor.enumerable = descriptor.enumerable || false; 45289 descriptor.configurable = true; 45290 if ("value" in descriptor) descriptor.writable = true; 45291 Object.defineProperty(target, descriptor.key, descriptor); 45292 } 45293 } 45294 45295 return function (Constructor, protoProps, staticProps) { 45296 if (protoProps) defineProperties(Constructor.prototype, protoProps); 45297 if (staticProps) defineProperties(Constructor, staticProps); 45298 return Constructor; 45299 }; 45300}(); 45301 45302 45303 45304 45305 45306var defineProperty = function (obj, key, value) { 45307 if (key in obj) { 45308 Object.defineProperty(obj, key, { 45309 value: value, 45310 enumerable: true, 45311 configurable: true, 45312 writable: true 45313 }); 45314 } else { 45315 obj[key] = value; 45316 } 45317 45318 return obj; 45319}; 45320 45321var _extends = Object.assign || function (target) { 45322 for (var i = 1; i < arguments.length; i++) { 45323 var source = arguments[i]; 45324 45325 for (var key in source) { 45326 if (Object.prototype.hasOwnProperty.call(source, key)) { 45327 target[key] = source[key]; 45328 } 45329 } 45330 } 45331 45332 return target; 45333}; 45334 45335/** 45336 * Given element offsets, generate an output similar to getBoundingClientRect 45337 * @method 45338 * @memberof Popper.Utils 45339 * @argument {Object} offsets 45340 * @returns {Object} ClientRect like output 45341 */ 45342function getClientRect(offsets) { 45343 return _extends({}, offsets, { 45344 right: offsets.left + offsets.width, 45345 bottom: offsets.top + offsets.height 45346 }); 45347} 45348 45349/** 45350 * Get bounding client rect of given element 45351 * @method 45352 * @memberof Popper.Utils 45353 * @param {HTMLElement} element 45354 * @return {Object} client rect 45355 */ 45356function getBoundingClientRect(element) { 45357 var rect = {}; 45358 45359 // IE10 10 FIX: Please, don't ask, the element isn't 45360 // considered in DOM in some circumstances... 45361 // This isn't reproducible in IE10 compatibility mode of IE11 45362 try { 45363 if (isIE(10)) { 45364 rect = element.getBoundingClientRect(); 45365 var scrollTop = getScroll(element, 'top'); 45366 var scrollLeft = getScroll(element, 'left'); 45367 rect.top += scrollTop; 45368 rect.left += scrollLeft; 45369 rect.bottom += scrollTop; 45370 rect.right += scrollLeft; 45371 } else { 45372 rect = element.getBoundingClientRect(); 45373 } 45374 } catch (e) {} 45375 45376 var result = { 45377 left: rect.left, 45378 top: rect.top, 45379 width: rect.right - rect.left, 45380 height: rect.bottom - rect.top 45381 }; 45382 45383 // subtract scrollbar size from sizes 45384 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 45385 var width = sizes.width || element.clientWidth || result.width; 45386 var height = sizes.height || element.clientHeight || result.height; 45387 45388 var horizScrollbar = element.offsetWidth - width; 45389 var vertScrollbar = element.offsetHeight - height; 45390 45391 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 45392 // we make this check conditional for performance reasons 45393 if (horizScrollbar || vertScrollbar) { 45394 var styles = getStyleComputedProperty(element); 45395 horizScrollbar -= getBordersSize(styles, 'x'); 45396 vertScrollbar -= getBordersSize(styles, 'y'); 45397 45398 result.width -= horizScrollbar; 45399 result.height -= vertScrollbar; 45400 } 45401 45402 return getClientRect(result); 45403} 45404 45405function getOffsetRectRelativeToArbitraryNode(children, parent) { 45406 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 45407 45408 var isIE10 = isIE(10); 45409 var isHTML = parent.nodeName === 'HTML'; 45410 var childrenRect = getBoundingClientRect(children); 45411 var parentRect = getBoundingClientRect(parent); 45412 var scrollParent = getScrollParent(children); 45413 45414 var styles = getStyleComputedProperty(parent); 45415 var borderTopWidth = parseFloat(styles.borderTopWidth); 45416 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 45417 45418 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 45419 if (fixedPosition && isHTML) { 45420 parentRect.top = Math.max(parentRect.top, 0); 45421 parentRect.left = Math.max(parentRect.left, 0); 45422 } 45423 var offsets = getClientRect({ 45424 top: childrenRect.top - parentRect.top - borderTopWidth, 45425 left: childrenRect.left - parentRect.left - borderLeftWidth, 45426 width: childrenRect.width, 45427 height: childrenRect.height 45428 }); 45429 offsets.marginTop = 0; 45430 offsets.marginLeft = 0; 45431 45432 // Subtract margins of documentElement in case it's being used as parent 45433 // we do this only on HTML because it's the only element that behaves 45434 // differently when margins are applied to it. The margins are included in 45435 // the box of the documentElement, in the other cases not. 45436 if (!isIE10 && isHTML) { 45437 var marginTop = parseFloat(styles.marginTop); 45438 var marginLeft = parseFloat(styles.marginLeft); 45439 45440 offsets.top -= borderTopWidth - marginTop; 45441 offsets.bottom -= borderTopWidth - marginTop; 45442 offsets.left -= borderLeftWidth - marginLeft; 45443 offsets.right -= borderLeftWidth - marginLeft; 45444 45445 // Attach marginTop and marginLeft because in some circumstances we may need them 45446 offsets.marginTop = marginTop; 45447 offsets.marginLeft = marginLeft; 45448 } 45449 45450 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 45451 offsets = includeScroll(offsets, parent); 45452 } 45453 45454 return offsets; 45455} 45456 45457function getViewportOffsetRectRelativeToArtbitraryNode(element) { 45458 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 45459 45460 var html = element.ownerDocument.documentElement; 45461 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 45462 var width = Math.max(html.clientWidth, window.innerWidth || 0); 45463 var height = Math.max(html.clientHeight, window.innerHeight || 0); 45464 45465 var scrollTop = !excludeScroll ? getScroll(html) : 0; 45466 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 45467 45468 var offset = { 45469 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 45470 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 45471 width: width, 45472 height: height 45473 }; 45474 45475 return getClientRect(offset); 45476} 45477 45478/** 45479 * Check if the given element is fixed or is inside a fixed parent 45480 * @method 45481 * @memberof Popper.Utils 45482 * @argument {Element} element 45483 * @argument {Element} customContainer 45484 * @returns {Boolean} answer to "isFixed?" 45485 */ 45486function isFixed(element) { 45487 var nodeName = element.nodeName; 45488 if (nodeName === 'BODY' || nodeName === 'HTML') { 45489 return false; 45490 } 45491 if (getStyleComputedProperty(element, 'position') === 'fixed') { 45492 return true; 45493 } 45494 var parentNode = getParentNode(element); 45495 if (!parentNode) { 45496 return false; 45497 } 45498 return isFixed(parentNode); 45499} 45500 45501/** 45502 * Finds the first parent of an element that has a transformed property defined 45503 * @method 45504 * @memberof Popper.Utils 45505 * @argument {Element} element 45506 * @returns {Element} first transformed parent or documentElement 45507 */ 45508 45509function getFixedPositionOffsetParent(element) { 45510 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 45511 if (!element || !element.parentElement || isIE()) { 45512 return document.documentElement; 45513 } 45514 var el = element.parentElement; 45515 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 45516 el = el.parentElement; 45517 } 45518 return el || document.documentElement; 45519} 45520 45521/** 45522 * Computed the boundaries limits and return them 45523 * @method 45524 * @memberof Popper.Utils 45525 * @param {HTMLElement} popper 45526 * @param {HTMLElement} reference 45527 * @param {number} padding 45528 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 45529 * @param {Boolean} fixedPosition - Is in fixed position mode 45530 * @returns {Object} Coordinates of the boundaries 45531 */ 45532function getBoundaries(popper, reference, padding, boundariesElement) { 45533 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 45534 45535 // NOTE: 1 DOM access here 45536 45537 var boundaries = { top: 0, left: 0 }; 45538 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 45539 45540 // Handle viewport case 45541 if (boundariesElement === 'viewport') { 45542 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 45543 } else { 45544 // Handle other cases based on DOM element used as boundaries 45545 var boundariesNode = void 0; 45546 if (boundariesElement === 'scrollParent') { 45547 boundariesNode = getScrollParent(getParentNode(reference)); 45548 if (boundariesNode.nodeName === 'BODY') { 45549 boundariesNode = popper.ownerDocument.documentElement; 45550 } 45551 } else if (boundariesElement === 'window') { 45552 boundariesNode = popper.ownerDocument.documentElement; 45553 } else { 45554 boundariesNode = boundariesElement; 45555 } 45556 45557 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 45558 45559 // In case of HTML, we need a different computation 45560 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 45561 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 45562 height = _getWindowSizes.height, 45563 width = _getWindowSizes.width; 45564 45565 boundaries.top += offsets.top - offsets.marginTop; 45566 boundaries.bottom = height + offsets.top; 45567 boundaries.left += offsets.left - offsets.marginLeft; 45568 boundaries.right = width + offsets.left; 45569 } else { 45570 // for all the other DOM elements, this one is good 45571 boundaries = offsets; 45572 } 45573 } 45574 45575 // Add paddings 45576 padding = padding || 0; 45577 var isPaddingNumber = typeof padding === 'number'; 45578 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 45579 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 45580 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 45581 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 45582 45583 return boundaries; 45584} 45585 45586function getArea(_ref) { 45587 var width = _ref.width, 45588 height = _ref.height; 45589 45590 return width * height; 45591} 45592 45593/** 45594 * Utility used to transform the `auto` placement to the placement with more 45595 * available space. 45596 * @method 45597 * @memberof Popper.Utils 45598 * @argument {Object} data - The data object generated by update method 45599 * @argument {Object} options - Modifiers configuration and options 45600 * @returns {Object} The data object, properly modified 45601 */ 45602function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 45603 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 45604 45605 if (placement.indexOf('auto') === -1) { 45606 return placement; 45607 } 45608 45609 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 45610 45611 var rects = { 45612 top: { 45613 width: boundaries.width, 45614 height: refRect.top - boundaries.top 45615 }, 45616 right: { 45617 width: boundaries.right - refRect.right, 45618 height: boundaries.height 45619 }, 45620 bottom: { 45621 width: boundaries.width, 45622 height: boundaries.bottom - refRect.bottom 45623 }, 45624 left: { 45625 width: refRect.left - boundaries.left, 45626 height: boundaries.height 45627 } 45628 }; 45629 45630 var sortedAreas = Object.keys(rects).map(function (key) { 45631 return _extends({ 45632 key: key 45633 }, rects[key], { 45634 area: getArea(rects[key]) 45635 }); 45636 }).sort(function (a, b) { 45637 return b.area - a.area; 45638 }); 45639 45640 var filteredAreas = sortedAreas.filter(function (_ref2) { 45641 var width = _ref2.width, 45642 height = _ref2.height; 45643 return width >= popper.clientWidth && height >= popper.clientHeight; 45644 }); 45645 45646 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 45647 45648 var variation = placement.split('-')[1]; 45649 45650 return computedPlacement + (variation ? '-' + variation : ''); 45651} 45652 45653/** 45654 * Get offsets to the reference element 45655 * @method 45656 * @memberof Popper.Utils 45657 * @param {Object} state 45658 * @param {Element} popper - the popper element 45659 * @param {Element} reference - the reference element (the popper will be relative to this) 45660 * @param {Element} fixedPosition - is in fixed position mode 45661 * @returns {Object} An object containing the offsets which will be applied to the popper 45662 */ 45663function getReferenceOffsets(state, popper, reference) { 45664 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 45665 45666 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 45667 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 45668} 45669 45670/** 45671 * Get the outer sizes of the given element (offset size + margins) 45672 * @method 45673 * @memberof Popper.Utils 45674 * @argument {Element} element 45675 * @returns {Object} object containing width and height properties 45676 */ 45677function getOuterSizes(element) { 45678 var window = element.ownerDocument.defaultView; 45679 var styles = window.getComputedStyle(element); 45680 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 45681 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 45682 var result = { 45683 width: element.offsetWidth + y, 45684 height: element.offsetHeight + x 45685 }; 45686 return result; 45687} 45688 45689/** 45690 * Get the opposite placement of the given one 45691 * @method 45692 * @memberof Popper.Utils 45693 * @argument {String} placement 45694 * @returns {String} flipped placement 45695 */ 45696function getOppositePlacement(placement) { 45697 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 45698 return placement.replace(/left|right|bottom|top/g, function (matched) { 45699 return hash[matched]; 45700 }); 45701} 45702 45703/** 45704 * Get offsets to the popper 45705 * @method 45706 * @memberof Popper.Utils 45707 * @param {Object} position - CSS position the Popper will get applied 45708 * @param {HTMLElement} popper - the popper element 45709 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 45710 * @param {String} placement - one of the valid placement options 45711 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 45712 */ 45713function getPopperOffsets(popper, referenceOffsets, placement) { 45714 placement = placement.split('-')[0]; 45715 45716 // Get popper node sizes 45717 var popperRect = getOuterSizes(popper); 45718 45719 // Add position, width and height to our offsets object 45720 var popperOffsets = { 45721 width: popperRect.width, 45722 height: popperRect.height 45723 }; 45724 45725 // depending by the popper placement we have to compute its offsets slightly differently 45726 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 45727 var mainSide = isHoriz ? 'top' : 'left'; 45728 var secondarySide = isHoriz ? 'left' : 'top'; 45729 var measurement = isHoriz ? 'height' : 'width'; 45730 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 45731 45732 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 45733 if (placement === secondarySide) { 45734 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 45735 } else { 45736 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 45737 } 45738 45739 return popperOffsets; 45740} 45741 45742/** 45743 * Mimics the `find` method of Array 45744 * @method 45745 * @memberof Popper.Utils 45746 * @argument {Array} arr 45747 * @argument prop 45748 * @argument value 45749 * @returns index or -1 45750 */ 45751function find(arr, check) { 45752 // use native find if supported 45753 if (Array.prototype.find) { 45754 return arr.find(check); 45755 } 45756 45757 // use `filter` to obtain the same behavior of `find` 45758 return arr.filter(check)[0]; 45759} 45760 45761/** 45762 * Return the index of the matching object 45763 * @method 45764 * @memberof Popper.Utils 45765 * @argument {Array} arr 45766 * @argument prop 45767 * @argument value 45768 * @returns index or -1 45769 */ 45770function findIndex(arr, prop, value) { 45771 // use native findIndex if supported 45772 if (Array.prototype.findIndex) { 45773 return arr.findIndex(function (cur) { 45774 return cur[prop] === value; 45775 }); 45776 } 45777 45778 // use `find` + `indexOf` if `findIndex` isn't supported 45779 var match = find(arr, function (obj) { 45780 return obj[prop] === value; 45781 }); 45782 return arr.indexOf(match); 45783} 45784 45785/** 45786 * Loop trough the list of modifiers and run them in order, 45787 * each of them will then edit the data object. 45788 * @method 45789 * @memberof Popper.Utils 45790 * @param {dataObject} data 45791 * @param {Array} modifiers 45792 * @param {String} ends - Optional modifier name used as stopper 45793 * @returns {dataObject} 45794 */ 45795function runModifiers(modifiers, data, ends) { 45796 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 45797 45798 modifiersToRun.forEach(function (modifier) { 45799 if (modifier['function']) { 45800 // eslint-disable-line dot-notation 45801 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 45802 } 45803 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 45804 if (modifier.enabled && isFunction(fn)) { 45805 // Add properties to offsets to make them a complete clientRect object 45806 // we do this before each modifier to make sure the previous one doesn't 45807 // mess with these values 45808 data.offsets.popper = getClientRect(data.offsets.popper); 45809 data.offsets.reference = getClientRect(data.offsets.reference); 45810 45811 data = fn(data, modifier); 45812 } 45813 }); 45814 45815 return data; 45816} 45817 45818/** 45819 * Updates the position of the popper, computing the new offsets and applying 45820 * the new style.<br /> 45821 * Prefer `scheduleUpdate` over `update` because of performance reasons. 45822 * @method 45823 * @memberof Popper 45824 */ 45825function update() { 45826 // if popper is destroyed, don't perform any further update 45827 if (this.state.isDestroyed) { 45828 return; 45829 } 45830 45831 var data = { 45832 instance: this, 45833 styles: {}, 45834 arrowStyles: {}, 45835 attributes: {}, 45836 flipped: false, 45837 offsets: {} 45838 }; 45839 45840 // compute reference element offsets 45841 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 45842 45843 // compute auto placement, store placement inside the data object, 45844 // modifiers will be able to edit `placement` if needed 45845 // and refer to originalPlacement to know the original value 45846 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 45847 45848 // store the computed placement inside `originalPlacement` 45849 data.originalPlacement = data.placement; 45850 45851 data.positionFixed = this.options.positionFixed; 45852 45853 // compute the popper offsets 45854 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 45855 45856 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 45857 45858 // run the modifiers 45859 data = runModifiers(this.modifiers, data); 45860 45861 // the first `update` will call `onCreate` callback 45862 // the other ones will call `onUpdate` callback 45863 if (!this.state.isCreated) { 45864 this.state.isCreated = true; 45865 this.options.onCreate(data); 45866 } else { 45867 this.options.onUpdate(data); 45868 } 45869} 45870 45871/** 45872 * Helper used to know if the given modifier is enabled. 45873 * @method 45874 * @memberof Popper.Utils 45875 * @returns {Boolean} 45876 */ 45877function isModifierEnabled(modifiers, modifierName) { 45878 return modifiers.some(function (_ref) { 45879 var name = _ref.name, 45880 enabled = _ref.enabled; 45881 return enabled && name === modifierName; 45882 }); 45883} 45884 45885/** 45886 * Get the prefixed supported property name 45887 * @method 45888 * @memberof Popper.Utils 45889 * @argument {String} property (camelCase) 45890 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 45891 */ 45892function getSupportedPropertyName(property) { 45893 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 45894 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 45895 45896 for (var i = 0; i < prefixes.length; i++) { 45897 var prefix = prefixes[i]; 45898 var toCheck = prefix ? '' + prefix + upperProp : property; 45899 if (typeof document.body.style[toCheck] !== 'undefined') { 45900 return toCheck; 45901 } 45902 } 45903 return null; 45904} 45905 45906/** 45907 * Destroys the popper. 45908 * @method 45909 * @memberof Popper 45910 */ 45911function destroy() { 45912 this.state.isDestroyed = true; 45913 45914 // touch DOM only if `applyStyle` modifier is enabled 45915 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 45916 this.popper.removeAttribute('x-placement'); 45917 this.popper.style.position = ''; 45918 this.popper.style.top = ''; 45919 this.popper.style.left = ''; 45920 this.popper.style.right = ''; 45921 this.popper.style.bottom = ''; 45922 this.popper.style.willChange = ''; 45923 this.popper.style[getSupportedPropertyName('transform')] = ''; 45924 } 45925 45926 this.disableEventListeners(); 45927 45928 // remove the popper if user explicitly asked for the deletion on destroy 45929 // do not use `remove` because IE11 doesn't support it 45930 if (this.options.removeOnDestroy) { 45931 this.popper.parentNode.removeChild(this.popper); 45932 } 45933 return this; 45934} 45935 45936/** 45937 * Get the window associated with the element 45938 * @argument {Element} element 45939 * @returns {Window} 45940 */ 45941function getWindow(element) { 45942 var ownerDocument = element.ownerDocument; 45943 return ownerDocument ? ownerDocument.defaultView : window; 45944} 45945 45946function attachToScrollParents(scrollParent, event, callback, scrollParents) { 45947 var isBody = scrollParent.nodeName === 'BODY'; 45948 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 45949 target.addEventListener(event, callback, { passive: true }); 45950 45951 if (!isBody) { 45952 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 45953 } 45954 scrollParents.push(target); 45955} 45956 45957/** 45958 * Setup needed event listeners used to update the popper position 45959 * @method 45960 * @memberof Popper.Utils 45961 * @private 45962 */ 45963function setupEventListeners(reference, options, state, updateBound) { 45964 // Resize event listener on window 45965 state.updateBound = updateBound; 45966 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 45967 45968 // Scroll event listener on scroll parents 45969 var scrollElement = getScrollParent(reference); 45970 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 45971 state.scrollElement = scrollElement; 45972 state.eventsEnabled = true; 45973 45974 return state; 45975} 45976 45977/** 45978 * It will add resize/scroll events and start recalculating 45979 * position of the popper element when they are triggered. 45980 * @method 45981 * @memberof Popper 45982 */ 45983function enableEventListeners() { 45984 if (!this.state.eventsEnabled) { 45985 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 45986 } 45987} 45988 45989/** 45990 * Remove event listeners used to update the popper position 45991 * @method 45992 * @memberof Popper.Utils 45993 * @private 45994 */ 45995function removeEventListeners(reference, state) { 45996 // Remove resize event listener on window 45997 getWindow(reference).removeEventListener('resize', state.updateBound); 45998 45999 // Remove scroll event listener on scroll parents 46000 state.scrollParents.forEach(function (target) { 46001 target.removeEventListener('scroll', state.updateBound); 46002 }); 46003 46004 // Reset state 46005 state.updateBound = null; 46006 state.scrollParents = []; 46007 state.scrollElement = null; 46008 state.eventsEnabled = false; 46009 return state; 46010} 46011 46012/** 46013 * It will remove resize/scroll events and won't recalculate popper position 46014 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 46015 * unless you call `update` method manually. 46016 * @method 46017 * @memberof Popper 46018 */ 46019function disableEventListeners() { 46020 if (this.state.eventsEnabled) { 46021 cancelAnimationFrame(this.scheduleUpdate); 46022 this.state = removeEventListeners(this.reference, this.state); 46023 } 46024} 46025 46026/** 46027 * Tells if a given input is a number 46028 * @method 46029 * @memberof Popper.Utils 46030 * @param {*} input to check 46031 * @return {Boolean} 46032 */ 46033function isNumeric(n) { 46034 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 46035} 46036 46037/** 46038 * Set the style to the given popper 46039 * @method 46040 * @memberof Popper.Utils 46041 * @argument {Element} element - Element to apply the style to 46042 * @argument {Object} styles 46043 * Object with a list of properties and values which will be applied to the element 46044 */ 46045function setStyles(element, styles) { 46046 Object.keys(styles).forEach(function (prop) { 46047 var unit = ''; 46048 // add unit if the value is numeric and is one of the following 46049 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 46050 unit = 'px'; 46051 } 46052 element.style[prop] = styles[prop] + unit; 46053 }); 46054} 46055 46056/** 46057 * Set the attributes to the given popper 46058 * @method 46059 * @memberof Popper.Utils 46060 * @argument {Element} element - Element to apply the attributes to 46061 * @argument {Object} styles 46062 * Object with a list of properties and values which will be applied to the element 46063 */ 46064function setAttributes(element, attributes) { 46065 Object.keys(attributes).forEach(function (prop) { 46066 var value = attributes[prop]; 46067 if (value !== false) { 46068 element.setAttribute(prop, attributes[prop]); 46069 } else { 46070 element.removeAttribute(prop); 46071 } 46072 }); 46073} 46074 46075/** 46076 * @function 46077 * @memberof Modifiers 46078 * @argument {Object} data - The data object generated by `update` method 46079 * @argument {Object} data.styles - List of style properties - values to apply to popper element 46080 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 46081 * @argument {Object} options - Modifiers configuration and options 46082 * @returns {Object} The same data object 46083 */ 46084function applyStyle(data) { 46085 // any property present in `data.styles` will be applied to the popper, 46086 // in this way we can make the 3rd party modifiers add custom styles to it 46087 // Be aware, modifiers could override the properties defined in the previous 46088 // lines of this modifier! 46089 setStyles(data.instance.popper, data.styles); 46090 46091 // any property present in `data.attributes` will be applied to the popper, 46092 // they will be set as HTML attributes of the element 46093 setAttributes(data.instance.popper, data.attributes); 46094 46095 // if arrowElement is defined and arrowStyles has some properties 46096 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 46097 setStyles(data.arrowElement, data.arrowStyles); 46098 } 46099 46100 return data; 46101} 46102 46103/** 46104 * Set the x-placement attribute before everything else because it could be used 46105 * to add margins to the popper margins needs to be calculated to get the 46106 * correct popper offsets. 46107 * @method 46108 * @memberof Popper.modifiers 46109 * @param {HTMLElement} reference - The reference element used to position the popper 46110 * @param {HTMLElement} popper - The HTML element used as popper 46111 * @param {Object} options - Popper.js options 46112 */ 46113function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 46114 // compute reference element offsets 46115 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 46116 46117 // compute auto placement, store placement inside the data object, 46118 // modifiers will be able to edit `placement` if needed 46119 // and refer to originalPlacement to know the original value 46120 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 46121 46122 popper.setAttribute('x-placement', placement); 46123 46124 // Apply `position` to popper before anything else because 46125 // without the position applied we can't guarantee correct computations 46126 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 46127 46128 return options; 46129} 46130 46131/** 46132 * @function 46133 * @memberof Popper.Utils 46134 * @argument {Object} data - The data object generated by `update` method 46135 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 46136 * @returns {Object} The popper's position offsets rounded 46137 * 46138 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 46139 * good as it can be within reason. 46140 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 46141 * 46142 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 46143 * as well on High DPI screens). 46144 * 46145 * Firefox prefers no rounding for positioning and does not have blurriness on 46146 * high DPI screens. 46147 * 46148 * Only horizontal placement and left/right values need to be considered. 46149 */ 46150function getRoundedOffsets(data, shouldRound) { 46151 var _data$offsets = data.offsets, 46152 popper = _data$offsets.popper, 46153 reference = _data$offsets.reference; 46154 var round = Math.round, 46155 floor = Math.floor; 46156 46157 var noRound = function noRound(v) { 46158 return v; 46159 }; 46160 46161 var referenceWidth = round(reference.width); 46162 var popperWidth = round(popper.width); 46163 46164 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 46165 var isVariation = data.placement.indexOf('-') !== -1; 46166 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 46167 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 46168 46169 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 46170 var verticalToInteger = !shouldRound ? noRound : round; 46171 46172 return { 46173 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 46174 top: verticalToInteger(popper.top), 46175 bottom: verticalToInteger(popper.bottom), 46176 right: horizontalToInteger(popper.right) 46177 }; 46178} 46179 46180var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 46181 46182/** 46183 * @function 46184 * @memberof Modifiers 46185 * @argument {Object} data - The data object generated by `update` method 46186 * @argument {Object} options - Modifiers configuration and options 46187 * @returns {Object} The data object, properly modified 46188 */ 46189function computeStyle(data, options) { 46190 var x = options.x, 46191 y = options.y; 46192 var popper = data.offsets.popper; 46193 46194 // Remove this legacy support in Popper.js v2 46195 46196 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 46197 return modifier.name === 'applyStyle'; 46198 }).gpuAcceleration; 46199 if (legacyGpuAccelerationOption !== undefined) { 46200 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 46201 } 46202 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 46203 46204 var offsetParent = getOffsetParent(data.instance.popper); 46205 var offsetParentRect = getBoundingClientRect(offsetParent); 46206 46207 // Styles 46208 var styles = { 46209 position: popper.position 46210 }; 46211 46212 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 46213 46214 var sideA = x === 'bottom' ? 'top' : 'bottom'; 46215 var sideB = y === 'right' ? 'left' : 'right'; 46216 46217 // if gpuAcceleration is set to `true` and transform is supported, 46218 // we use `translate3d` to apply the position to the popper we 46219 // automatically use the supported prefixed version if needed 46220 var prefixedProperty = getSupportedPropertyName('transform'); 46221 46222 // now, let's make a step back and look at this code closely (wtf?) 46223 // If the content of the popper grows once it's been positioned, it 46224 // may happen that the popper gets misplaced because of the new content 46225 // overflowing its reference element 46226 // To avoid this problem, we provide two options (x and y), which allow 46227 // the consumer to define the offset origin. 46228 // If we position a popper on top of a reference element, we can set 46229 // `x` to `top` to make the popper grow towards its top instead of 46230 // its bottom. 46231 var left = void 0, 46232 top = void 0; 46233 if (sideA === 'bottom') { 46234 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 46235 // and not the bottom of the html element 46236 if (offsetParent.nodeName === 'HTML') { 46237 top = -offsetParent.clientHeight + offsets.bottom; 46238 } else { 46239 top = -offsetParentRect.height + offsets.bottom; 46240 } 46241 } else { 46242 top = offsets.top; 46243 } 46244 if (sideB === 'right') { 46245 if (offsetParent.nodeName === 'HTML') { 46246 left = -offsetParent.clientWidth + offsets.right; 46247 } else { 46248 left = -offsetParentRect.width + offsets.right; 46249 } 46250 } else { 46251 left = offsets.left; 46252 } 46253 if (gpuAcceleration && prefixedProperty) { 46254 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 46255 styles[sideA] = 0; 46256 styles[sideB] = 0; 46257 styles.willChange = 'transform'; 46258 } else { 46259 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 46260 var invertTop = sideA === 'bottom' ? -1 : 1; 46261 var invertLeft = sideB === 'right' ? -1 : 1; 46262 styles[sideA] = top * invertTop; 46263 styles[sideB] = left * invertLeft; 46264 styles.willChange = sideA + ', ' + sideB; 46265 } 46266 46267 // Attributes 46268 var attributes = { 46269 'x-placement': data.placement 46270 }; 46271 46272 // Update `data` attributes, styles and arrowStyles 46273 data.attributes = _extends({}, attributes, data.attributes); 46274 data.styles = _extends({}, styles, data.styles); 46275 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 46276 46277 return data; 46278} 46279 46280/** 46281 * Helper used to know if the given modifier depends from another one.<br /> 46282 * It checks if the needed modifier is listed and enabled. 46283 * @method 46284 * @memberof Popper.Utils 46285 * @param {Array} modifiers - list of modifiers 46286 * @param {String} requestingName - name of requesting modifier 46287 * @param {String} requestedName - name of requested modifier 46288 * @returns {Boolean} 46289 */ 46290function isModifierRequired(modifiers, requestingName, requestedName) { 46291 var requesting = find(modifiers, function (_ref) { 46292 var name = _ref.name; 46293 return name === requestingName; 46294 }); 46295 46296 var isRequired = !!requesting && modifiers.some(function (modifier) { 46297 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 46298 }); 46299 46300 if (!isRequired) { 46301 var _requesting = '`' + requestingName + '`'; 46302 var requested = '`' + requestedName + '`'; 46303 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 46304 } 46305 return isRequired; 46306} 46307 46308/** 46309 * @function 46310 * @memberof Modifiers 46311 * @argument {Object} data - The data object generated by update method 46312 * @argument {Object} options - Modifiers configuration and options 46313 * @returns {Object} The data object, properly modified 46314 */ 46315function arrow(data, options) { 46316 var _data$offsets$arrow; 46317 46318 // arrow depends on keepTogether in order to work 46319 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 46320 return data; 46321 } 46322 46323 var arrowElement = options.element; 46324 46325 // if arrowElement is a string, suppose it's a CSS selector 46326 if (typeof arrowElement === 'string') { 46327 arrowElement = data.instance.popper.querySelector(arrowElement); 46328 46329 // if arrowElement is not found, don't run the modifier 46330 if (!arrowElement) { 46331 return data; 46332 } 46333 } else { 46334 // if the arrowElement isn't a query selector we must check that the 46335 // provided DOM node is child of its popper node 46336 if (!data.instance.popper.contains(arrowElement)) { 46337 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 46338 return data; 46339 } 46340 } 46341 46342 var placement = data.placement.split('-')[0]; 46343 var _data$offsets = data.offsets, 46344 popper = _data$offsets.popper, 46345 reference = _data$offsets.reference; 46346 46347 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 46348 46349 var len = isVertical ? 'height' : 'width'; 46350 var sideCapitalized = isVertical ? 'Top' : 'Left'; 46351 var side = sideCapitalized.toLowerCase(); 46352 var altSide = isVertical ? 'left' : 'top'; 46353 var opSide = isVertical ? 'bottom' : 'right'; 46354 var arrowElementSize = getOuterSizes(arrowElement)[len]; 46355 46356 // 46357 // extends keepTogether behavior making sure the popper and its 46358 // reference have enough pixels in conjunction 46359 // 46360 46361 // top/left side 46362 if (reference[opSide] - arrowElementSize < popper[side]) { 46363 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 46364 } 46365 // bottom/right side 46366 if (reference[side] + arrowElementSize > popper[opSide]) { 46367 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 46368 } 46369 data.offsets.popper = getClientRect(data.offsets.popper); 46370 46371 // compute center of the popper 46372 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 46373 46374 // Compute the sideValue using the updated popper offsets 46375 // take popper margin in account because we don't have this info available 46376 var css = getStyleComputedProperty(data.instance.popper); 46377 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 46378 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 46379 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 46380 46381 // prevent arrowElement from being placed not contiguously to its popper 46382 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 46383 46384 data.arrowElement = arrowElement; 46385 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 46386 46387 return data; 46388} 46389 46390/** 46391 * Get the opposite placement variation of the given one 46392 * @method 46393 * @memberof Popper.Utils 46394 * @argument {String} placement variation 46395 * @returns {String} flipped placement variation 46396 */ 46397function getOppositeVariation(variation) { 46398 if (variation === 'end') { 46399 return 'start'; 46400 } else if (variation === 'start') { 46401 return 'end'; 46402 } 46403 return variation; 46404} 46405 46406/** 46407 * List of accepted placements to use as values of the `placement` option.<br /> 46408 * Valid placements are: 46409 * - `auto` 46410 * - `top` 46411 * - `right` 46412 * - `bottom` 46413 * - `left` 46414 * 46415 * Each placement can have a variation from this list: 46416 * - `-start` 46417 * - `-end` 46418 * 46419 * Variations are interpreted easily if you think of them as the left to right 46420 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 46421 * is right.<br /> 46422 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 46423 * 46424 * Some valid examples are: 46425 * - `top-end` (on top of reference, right aligned) 46426 * - `right-start` (on right of reference, top aligned) 46427 * - `bottom` (on bottom, centered) 46428 * - `auto-end` (on the side with more space available, alignment depends by placement) 46429 * 46430 * @static 46431 * @type {Array} 46432 * @enum {String} 46433 * @readonly 46434 * @method placements 46435 * @memberof Popper 46436 */ 46437var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 46438 46439// Get rid of `auto` `auto-start` and `auto-end` 46440var validPlacements = placements.slice(3); 46441 46442/** 46443 * Given an initial placement, returns all the subsequent placements 46444 * clockwise (or counter-clockwise). 46445 * 46446 * @method 46447 * @memberof Popper.Utils 46448 * @argument {String} placement - A valid placement (it accepts variations) 46449 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 46450 * @returns {Array} placements including their variations 46451 */ 46452function clockwise(placement) { 46453 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 46454 46455 var index = validPlacements.indexOf(placement); 46456 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 46457 return counter ? arr.reverse() : arr; 46458} 46459 46460var BEHAVIORS = { 46461 FLIP: 'flip', 46462 CLOCKWISE: 'clockwise', 46463 COUNTERCLOCKWISE: 'counterclockwise' 46464}; 46465 46466/** 46467 * @function 46468 * @memberof Modifiers 46469 * @argument {Object} data - The data object generated by update method 46470 * @argument {Object} options - Modifiers configuration and options 46471 * @returns {Object} The data object, properly modified 46472 */ 46473function flip(data, options) { 46474 // if `inner` modifier is enabled, we can't use the `flip` modifier 46475 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 46476 return data; 46477 } 46478 46479 if (data.flipped && data.placement === data.originalPlacement) { 46480 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 46481 return data; 46482 } 46483 46484 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 46485 46486 var placement = data.placement.split('-')[0]; 46487 var placementOpposite = getOppositePlacement(placement); 46488 var variation = data.placement.split('-')[1] || ''; 46489 46490 var flipOrder = []; 46491 46492 switch (options.behavior) { 46493 case BEHAVIORS.FLIP: 46494 flipOrder = [placement, placementOpposite]; 46495 break; 46496 case BEHAVIORS.CLOCKWISE: 46497 flipOrder = clockwise(placement); 46498 break; 46499 case BEHAVIORS.COUNTERCLOCKWISE: 46500 flipOrder = clockwise(placement, true); 46501 break; 46502 default: 46503 flipOrder = options.behavior; 46504 } 46505 46506 flipOrder.forEach(function (step, index) { 46507 if (placement !== step || flipOrder.length === index + 1) { 46508 return data; 46509 } 46510 46511 placement = data.placement.split('-')[0]; 46512 placementOpposite = getOppositePlacement(placement); 46513 46514 var popperOffsets = data.offsets.popper; 46515 var refOffsets = data.offsets.reference; 46516 46517 // using floor because the reference offsets may contain decimals we are not going to consider here 46518 var floor = Math.floor; 46519 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 46520 46521 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 46522 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 46523 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 46524 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 46525 46526 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 46527 46528 // flip the variation if required 46529 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 46530 46531 // flips variation if reference element overflows boundaries 46532 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 46533 46534 // flips variation if popper content overflows boundaries 46535 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 46536 46537 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 46538 46539 if (overlapsRef || overflowsBoundaries || flippedVariation) { 46540 // this boolean to detect any flip loop 46541 data.flipped = true; 46542 46543 if (overlapsRef || overflowsBoundaries) { 46544 placement = flipOrder[index + 1]; 46545 } 46546 46547 if (flippedVariation) { 46548 variation = getOppositeVariation(variation); 46549 } 46550 46551 data.placement = placement + (variation ? '-' + variation : ''); 46552 46553 // this object contains `position`, we want to preserve it along with 46554 // any additional property we may add in the future 46555 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 46556 46557 data = runModifiers(data.instance.modifiers, data, 'flip'); 46558 } 46559 }); 46560 return data; 46561} 46562 46563/** 46564 * @function 46565 * @memberof Modifiers 46566 * @argument {Object} data - The data object generated by update method 46567 * @argument {Object} options - Modifiers configuration and options 46568 * @returns {Object} The data object, properly modified 46569 */ 46570function keepTogether(data) { 46571 var _data$offsets = data.offsets, 46572 popper = _data$offsets.popper, 46573 reference = _data$offsets.reference; 46574 46575 var placement = data.placement.split('-')[0]; 46576 var floor = Math.floor; 46577 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 46578 var side = isVertical ? 'right' : 'bottom'; 46579 var opSide = isVertical ? 'left' : 'top'; 46580 var measurement = isVertical ? 'width' : 'height'; 46581 46582 if (popper[side] < floor(reference[opSide])) { 46583 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 46584 } 46585 if (popper[opSide] > floor(reference[side])) { 46586 data.offsets.popper[opSide] = floor(reference[side]); 46587 } 46588 46589 return data; 46590} 46591 46592/** 46593 * Converts a string containing value + unit into a px value number 46594 * @function 46595 * @memberof {modifiers~offset} 46596 * @private 46597 * @argument {String} str - Value + unit string 46598 * @argument {String} measurement - `height` or `width` 46599 * @argument {Object} popperOffsets 46600 * @argument {Object} referenceOffsets 46601 * @returns {Number|String} 46602 * Value in pixels, or original string if no values were extracted 46603 */ 46604function toValue(str, measurement, popperOffsets, referenceOffsets) { 46605 // separate value from unit 46606 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 46607 var value = +split[1]; 46608 var unit = split[2]; 46609 46610 // If it's not a number it's an operator, I guess 46611 if (!value) { 46612 return str; 46613 } 46614 46615 if (unit.indexOf('%') === 0) { 46616 var element = void 0; 46617 switch (unit) { 46618 case '%p': 46619 element = popperOffsets; 46620 break; 46621 case '%': 46622 case '%r': 46623 default: 46624 element = referenceOffsets; 46625 } 46626 46627 var rect = getClientRect(element); 46628 return rect[measurement] / 100 * value; 46629 } else if (unit === 'vh' || unit === 'vw') { 46630 // if is a vh or vw, we calculate the size based on the viewport 46631 var size = void 0; 46632 if (unit === 'vh') { 46633 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 46634 } else { 46635 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 46636 } 46637 return size / 100 * value; 46638 } else { 46639 // if is an explicit pixel unit, we get rid of the unit and keep the value 46640 // if is an implicit unit, it's px, and we return just the value 46641 return value; 46642 } 46643} 46644 46645/** 46646 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 46647 * @function 46648 * @memberof {modifiers~offset} 46649 * @private 46650 * @argument {String} offset 46651 * @argument {Object} popperOffsets 46652 * @argument {Object} referenceOffsets 46653 * @argument {String} basePlacement 46654 * @returns {Array} a two cells array with x and y offsets in numbers 46655 */ 46656function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 46657 var offsets = [0, 0]; 46658 46659 // Use height if placement is left or right and index is 0 otherwise use width 46660 // in this way the first offset will use an axis and the second one 46661 // will use the other one 46662 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 46663 46664 // Split the offset string to obtain a list of values and operands 46665 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 46666 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 46667 return frag.trim(); 46668 }); 46669 46670 // Detect if the offset string contains a pair of values or a single one 46671 // they could be separated by comma or space 46672 var divider = fragments.indexOf(find(fragments, function (frag) { 46673 return frag.search(/,|\s/) !== -1; 46674 })); 46675 46676 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 46677 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 46678 } 46679 46680 // If divider is found, we divide the list of values and operands to divide 46681 // them by ofset X and Y. 46682 var splitRegex = /\s*,\s*|\s+/; 46683 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 46684 46685 // Convert the values with units to absolute pixels to allow our computations 46686 ops = ops.map(function (op, index) { 46687 // Most of the units rely on the orientation of the popper 46688 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 46689 var mergeWithPrevious = false; 46690 return op 46691 // This aggregates any `+` or `-` sign that aren't considered operators 46692 // e.g.: 10 + +5 => [10, +, +5] 46693 .reduce(function (a, b) { 46694 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 46695 a[a.length - 1] = b; 46696 mergeWithPrevious = true; 46697 return a; 46698 } else if (mergeWithPrevious) { 46699 a[a.length - 1] += b; 46700 mergeWithPrevious = false; 46701 return a; 46702 } else { 46703 return a.concat(b); 46704 } 46705 }, []) 46706 // Here we convert the string values into number values (in px) 46707 .map(function (str) { 46708 return toValue(str, measurement, popperOffsets, referenceOffsets); 46709 }); 46710 }); 46711 46712 // Loop trough the offsets arrays and execute the operations 46713 ops.forEach(function (op, index) { 46714 op.forEach(function (frag, index2) { 46715 if (isNumeric(frag)) { 46716 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 46717 } 46718 }); 46719 }); 46720 return offsets; 46721} 46722 46723/** 46724 * @function 46725 * @memberof Modifiers 46726 * @argument {Object} data - The data object generated by update method 46727 * @argument {Object} options - Modifiers configuration and options 46728 * @argument {Number|String} options.offset=0 46729 * The offset value as described in the modifier description 46730 * @returns {Object} The data object, properly modified 46731 */ 46732function offset(data, _ref) { 46733 var offset = _ref.offset; 46734 var placement = data.placement, 46735 _data$offsets = data.offsets, 46736 popper = _data$offsets.popper, 46737 reference = _data$offsets.reference; 46738 46739 var basePlacement = placement.split('-')[0]; 46740 46741 var offsets = void 0; 46742 if (isNumeric(+offset)) { 46743 offsets = [+offset, 0]; 46744 } else { 46745 offsets = parseOffset(offset, popper, reference, basePlacement); 46746 } 46747 46748 if (basePlacement === 'left') { 46749 popper.top += offsets[0]; 46750 popper.left -= offsets[1]; 46751 } else if (basePlacement === 'right') { 46752 popper.top += offsets[0]; 46753 popper.left += offsets[1]; 46754 } else if (basePlacement === 'top') { 46755 popper.left += offsets[0]; 46756 popper.top -= offsets[1]; 46757 } else if (basePlacement === 'bottom') { 46758 popper.left += offsets[0]; 46759 popper.top += offsets[1]; 46760 } 46761 46762 data.popper = popper; 46763 return data; 46764} 46765 46766/** 46767 * @function 46768 * @memberof Modifiers 46769 * @argument {Object} data - The data object generated by `update` method 46770 * @argument {Object} options - Modifiers configuration and options 46771 * @returns {Object} The data object, properly modified 46772 */ 46773function preventOverflow(data, options) { 46774 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 46775 46776 // If offsetParent is the reference element, we really want to 46777 // go one step up and use the next offsetParent as reference to 46778 // avoid to make this modifier completely useless and look like broken 46779 if (data.instance.reference === boundariesElement) { 46780 boundariesElement = getOffsetParent(boundariesElement); 46781 } 46782 46783 // NOTE: DOM access here 46784 // resets the popper's position so that the document size can be calculated excluding 46785 // the size of the popper element itself 46786 var transformProp = getSupportedPropertyName('transform'); 46787 var popperStyles = data.instance.popper.style; // assignment to help minification 46788 var top = popperStyles.top, 46789 left = popperStyles.left, 46790 transform = popperStyles[transformProp]; 46791 46792 popperStyles.top = ''; 46793 popperStyles.left = ''; 46794 popperStyles[transformProp] = ''; 46795 46796 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 46797 46798 // NOTE: DOM access here 46799 // restores the original style properties after the offsets have been computed 46800 popperStyles.top = top; 46801 popperStyles.left = left; 46802 popperStyles[transformProp] = transform; 46803 46804 options.boundaries = boundaries; 46805 46806 var order = options.priority; 46807 var popper = data.offsets.popper; 46808 46809 var check = { 46810 primary: function primary(placement) { 46811 var value = popper[placement]; 46812 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 46813 value = Math.max(popper[placement], boundaries[placement]); 46814 } 46815 return defineProperty({}, placement, value); 46816 }, 46817 secondary: function secondary(placement) { 46818 var mainSide = placement === 'right' ? 'left' : 'top'; 46819 var value = popper[mainSide]; 46820 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 46821 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 46822 } 46823 return defineProperty({}, mainSide, value); 46824 } 46825 }; 46826 46827 order.forEach(function (placement) { 46828 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 46829 popper = _extends({}, popper, check[side](placement)); 46830 }); 46831 46832 data.offsets.popper = popper; 46833 46834 return data; 46835} 46836 46837/** 46838 * @function 46839 * @memberof Modifiers 46840 * @argument {Object} data - The data object generated by `update` method 46841 * @argument {Object} options - Modifiers configuration and options 46842 * @returns {Object} The data object, properly modified 46843 */ 46844function shift(data) { 46845 var placement = data.placement; 46846 var basePlacement = placement.split('-')[0]; 46847 var shiftvariation = placement.split('-')[1]; 46848 46849 // if shift shiftvariation is specified, run the modifier 46850 if (shiftvariation) { 46851 var _data$offsets = data.offsets, 46852 reference = _data$offsets.reference, 46853 popper = _data$offsets.popper; 46854 46855 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 46856 var side = isVertical ? 'left' : 'top'; 46857 var measurement = isVertical ? 'width' : 'height'; 46858 46859 var shiftOffsets = { 46860 start: defineProperty({}, side, reference[side]), 46861 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 46862 }; 46863 46864 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 46865 } 46866 46867 return data; 46868} 46869 46870/** 46871 * @function 46872 * @memberof Modifiers 46873 * @argument {Object} data - The data object generated by update method 46874 * @argument {Object} options - Modifiers configuration and options 46875 * @returns {Object} The data object, properly modified 46876 */ 46877function hide(data) { 46878 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 46879 return data; 46880 } 46881 46882 var refRect = data.offsets.reference; 46883 var bound = find(data.instance.modifiers, function (modifier) { 46884 return modifier.name === 'preventOverflow'; 46885 }).boundaries; 46886 46887 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 46888 // Avoid unnecessary DOM access if visibility hasn't changed 46889 if (data.hide === true) { 46890 return data; 46891 } 46892 46893 data.hide = true; 46894 data.attributes['x-out-of-boundaries'] = ''; 46895 } else { 46896 // Avoid unnecessary DOM access if visibility hasn't changed 46897 if (data.hide === false) { 46898 return data; 46899 } 46900 46901 data.hide = false; 46902 data.attributes['x-out-of-boundaries'] = false; 46903 } 46904 46905 return data; 46906} 46907 46908/** 46909 * @function 46910 * @memberof Modifiers 46911 * @argument {Object} data - The data object generated by `update` method 46912 * @argument {Object} options - Modifiers configuration and options 46913 * @returns {Object} The data object, properly modified 46914 */ 46915function inner(data) { 46916 var placement = data.placement; 46917 var basePlacement = placement.split('-')[0]; 46918 var _data$offsets = data.offsets, 46919 popper = _data$offsets.popper, 46920 reference = _data$offsets.reference; 46921 46922 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 46923 46924 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 46925 46926 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 46927 46928 data.placement = getOppositePlacement(placement); 46929 data.offsets.popper = getClientRect(popper); 46930 46931 return data; 46932} 46933 46934/** 46935 * Modifier function, each modifier can have a function of this type assigned 46936 * to its `fn` property.<br /> 46937 * These functions will be called on each update, this means that you must 46938 * make sure they are performant enough to avoid performance bottlenecks. 46939 * 46940 * @function ModifierFn 46941 * @argument {dataObject} data - The data object generated by `update` method 46942 * @argument {Object} options - Modifiers configuration and options 46943 * @returns {dataObject} The data object, properly modified 46944 */ 46945 46946/** 46947 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 46948 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 46949 * needed by the library. 46950 * 46951 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 46952 * All the other properties are configurations that could be tweaked. 46953 * @namespace modifiers 46954 */ 46955var modifiers = { 46956 /** 46957 * Modifier used to shift the popper on the start or end of its reference 46958 * element.<br /> 46959 * It will read the variation of the `placement` property.<br /> 46960 * It can be one either `-end` or `-start`. 46961 * @memberof modifiers 46962 * @inner 46963 */ 46964 shift: { 46965 /** @prop {number} order=100 - Index used to define the order of execution */ 46966 order: 100, 46967 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 46968 enabled: true, 46969 /** @prop {ModifierFn} */ 46970 fn: shift 46971 }, 46972 46973 /** 46974 * The `offset` modifier can shift your popper on both its axis. 46975 * 46976 * It accepts the following units: 46977 * - `px` or unit-less, interpreted as pixels 46978 * - `%` or `%r`, percentage relative to the length of the reference element 46979 * - `%p`, percentage relative to the length of the popper element 46980 * - `vw`, CSS viewport width unit 46981 * - `vh`, CSS viewport height unit 46982 * 46983 * For length is intended the main axis relative to the placement of the popper.<br /> 46984 * This means that if the placement is `top` or `bottom`, the length will be the 46985 * `width`. In case of `left` or `right`, it will be the `height`. 46986 * 46987 * You can provide a single value (as `Number` or `String`), or a pair of values 46988 * as `String` divided by a comma or one (or more) white spaces.<br /> 46989 * The latter is a deprecated method because it leads to confusion and will be 46990 * removed in v2.<br /> 46991 * Additionally, it accepts additions and subtractions between different units. 46992 * Note that multiplications and divisions aren't supported. 46993 * 46994 * Valid examples are: 46995 * ``` 46996 * 10 46997 * '10%' 46998 * '10, 10' 46999 * '10%, 10' 47000 * '10 + 10%' 47001 * '10 - 5vh + 3%' 47002 * '-10px + 5vh, 5px - 6%' 47003 * ``` 47004 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 47005 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 47006 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 47007 * 47008 * @memberof modifiers 47009 * @inner 47010 */ 47011 offset: { 47012 /** @prop {number} order=200 - Index used to define the order of execution */ 47013 order: 200, 47014 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47015 enabled: true, 47016 /** @prop {ModifierFn} */ 47017 fn: offset, 47018 /** @prop {Number|String} offset=0 47019 * The offset value as described in the modifier description 47020 */ 47021 offset: 0 47022 }, 47023 47024 /** 47025 * Modifier used to prevent the popper from being positioned outside the boundary. 47026 * 47027 * A scenario exists where the reference itself is not within the boundaries.<br /> 47028 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 47029 * In this case we need to decide whether the popper should either: 47030 * 47031 * - detach from the reference and remain "trapped" in the boundaries, or 47032 * - if it should ignore the boundary and "escape with its reference" 47033 * 47034 * When `escapeWithReference` is set to`true` and reference is completely 47035 * outside its boundaries, the popper will overflow (or completely leave) 47036 * the boundaries in order to remain attached to the edge of the reference. 47037 * 47038 * @memberof modifiers 47039 * @inner 47040 */ 47041 preventOverflow: { 47042 /** @prop {number} order=300 - Index used to define the order of execution */ 47043 order: 300, 47044 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47045 enabled: true, 47046 /** @prop {ModifierFn} */ 47047 fn: preventOverflow, 47048 /** 47049 * @prop {Array} [priority=['left','right','top','bottom']] 47050 * Popper will try to prevent overflow following these priorities by default, 47051 * then, it could overflow on the left and on top of the `boundariesElement` 47052 */ 47053 priority: ['left', 'right', 'top', 'bottom'], 47054 /** 47055 * @prop {number} padding=5 47056 * Amount of pixel used to define a minimum distance between the boundaries 47057 * and the popper. This makes sure the popper always has a little padding 47058 * between the edges of its container 47059 */ 47060 padding: 5, 47061 /** 47062 * @prop {String|HTMLElement} boundariesElement='scrollParent' 47063 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 47064 * `viewport` or any DOM element. 47065 */ 47066 boundariesElement: 'scrollParent' 47067 }, 47068 47069 /** 47070 * Modifier used to make sure the reference and its popper stay near each other 47071 * without leaving any gap between the two. Especially useful when the arrow is 47072 * enabled and you want to ensure that it points to its reference element. 47073 * It cares only about the first axis. You can still have poppers with margin 47074 * between the popper and its reference element. 47075 * @memberof modifiers 47076 * @inner 47077 */ 47078 keepTogether: { 47079 /** @prop {number} order=400 - Index used to define the order of execution */ 47080 order: 400, 47081 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47082 enabled: true, 47083 /** @prop {ModifierFn} */ 47084 fn: keepTogether 47085 }, 47086 47087 /** 47088 * This modifier is used to move the `arrowElement` of the popper to make 47089 * sure it is positioned between the reference element and its popper element. 47090 * It will read the outer size of the `arrowElement` node to detect how many 47091 * pixels of conjunction are needed. 47092 * 47093 * It has no effect if no `arrowElement` is provided. 47094 * @memberof modifiers 47095 * @inner 47096 */ 47097 arrow: { 47098 /** @prop {number} order=500 - Index used to define the order of execution */ 47099 order: 500, 47100 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47101 enabled: true, 47102 /** @prop {ModifierFn} */ 47103 fn: arrow, 47104 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 47105 element: '[x-arrow]' 47106 }, 47107 47108 /** 47109 * Modifier used to flip the popper's placement when it starts to overlap its 47110 * reference element. 47111 * 47112 * Requires the `preventOverflow` modifier before it in order to work. 47113 * 47114 * **NOTE:** this modifier will interrupt the current update cycle and will 47115 * restart it if it detects the need to flip the placement. 47116 * @memberof modifiers 47117 * @inner 47118 */ 47119 flip: { 47120 /** @prop {number} order=600 - Index used to define the order of execution */ 47121 order: 600, 47122 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47123 enabled: true, 47124 /** @prop {ModifierFn} */ 47125 fn: flip, 47126 /** 47127 * @prop {String|Array} behavior='flip' 47128 * The behavior used to change the popper's placement. It can be one of 47129 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 47130 * placements (with optional variations) 47131 */ 47132 behavior: 'flip', 47133 /** 47134 * @prop {number} padding=5 47135 * The popper will flip if it hits the edges of the `boundariesElement` 47136 */ 47137 padding: 5, 47138 /** 47139 * @prop {String|HTMLElement} boundariesElement='viewport' 47140 * The element which will define the boundaries of the popper position. 47141 * The popper will never be placed outside of the defined boundaries 47142 * (except if `keepTogether` is enabled) 47143 */ 47144 boundariesElement: 'viewport', 47145 /** 47146 * @prop {Boolean} flipVariations=false 47147 * The popper will switch placement variation between `-start` and `-end` when 47148 * the reference element overlaps its boundaries. 47149 * 47150 * The original placement should have a set variation. 47151 */ 47152 flipVariations: false, 47153 /** 47154 * @prop {Boolean} flipVariationsByContent=false 47155 * The popper will switch placement variation between `-start` and `-end` when 47156 * the popper element overlaps its reference boundaries. 47157 * 47158 * The original placement should have a set variation. 47159 */ 47160 flipVariationsByContent: false 47161 }, 47162 47163 /** 47164 * Modifier used to make the popper flow toward the inner of the reference element. 47165 * By default, when this modifier is disabled, the popper will be placed outside 47166 * the reference element. 47167 * @memberof modifiers 47168 * @inner 47169 */ 47170 inner: { 47171 /** @prop {number} order=700 - Index used to define the order of execution */ 47172 order: 700, 47173 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 47174 enabled: false, 47175 /** @prop {ModifierFn} */ 47176 fn: inner 47177 }, 47178 47179 /** 47180 * Modifier used to hide the popper when its reference element is outside of the 47181 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 47182 * be used to hide with a CSS selector the popper when its reference is 47183 * out of boundaries. 47184 * 47185 * Requires the `preventOverflow` modifier before it in order to work. 47186 * @memberof modifiers 47187 * @inner 47188 */ 47189 hide: { 47190 /** @prop {number} order=800 - Index used to define the order of execution */ 47191 order: 800, 47192 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47193 enabled: true, 47194 /** @prop {ModifierFn} */ 47195 fn: hide 47196 }, 47197 47198 /** 47199 * Computes the style that will be applied to the popper element to gets 47200 * properly positioned. 47201 * 47202 * Note that this modifier will not touch the DOM, it just prepares the styles 47203 * so that `applyStyle` modifier can apply it. This separation is useful 47204 * in case you need to replace `applyStyle` with a custom implementation. 47205 * 47206 * This modifier has `850` as `order` value to maintain backward compatibility 47207 * with previous versions of Popper.js. Expect the modifiers ordering method 47208 * to change in future major versions of the library. 47209 * 47210 * @memberof modifiers 47211 * @inner 47212 */ 47213 computeStyle: { 47214 /** @prop {number} order=850 - Index used to define the order of execution */ 47215 order: 850, 47216 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47217 enabled: true, 47218 /** @prop {ModifierFn} */ 47219 fn: computeStyle, 47220 /** 47221 * @prop {Boolean} gpuAcceleration=true 47222 * If true, it uses the CSS 3D transformation to position the popper. 47223 * Otherwise, it will use the `top` and `left` properties 47224 */ 47225 gpuAcceleration: true, 47226 /** 47227 * @prop {string} [x='bottom'] 47228 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 47229 * Change this if your popper should grow in a direction different from `bottom` 47230 */ 47231 x: 'bottom', 47232 /** 47233 * @prop {string} [x='left'] 47234 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 47235 * Change this if your popper should grow in a direction different from `right` 47236 */ 47237 y: 'right' 47238 }, 47239 47240 /** 47241 * Applies the computed styles to the popper element. 47242 * 47243 * All the DOM manipulations are limited to this modifier. This is useful in case 47244 * you want to integrate Popper.js inside a framework or view library and you 47245 * want to delegate all the DOM manipulations to it. 47246 * 47247 * Note that if you disable this modifier, you must make sure the popper element 47248 * has its position set to `absolute` before Popper.js can do its work! 47249 * 47250 * Just disable this modifier and define your own to achieve the desired effect. 47251 * 47252 * @memberof modifiers 47253 * @inner 47254 */ 47255 applyStyle: { 47256 /** @prop {number} order=900 - Index used to define the order of execution */ 47257 order: 900, 47258 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47259 enabled: true, 47260 /** @prop {ModifierFn} */ 47261 fn: applyStyle, 47262 /** @prop {Function} */ 47263 onLoad: applyStyleOnLoad, 47264 /** 47265 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 47266 * @prop {Boolean} gpuAcceleration=true 47267 * If true, it uses the CSS 3D transformation to position the popper. 47268 * Otherwise, it will use the `top` and `left` properties 47269 */ 47270 gpuAcceleration: undefined 47271 } 47272}; 47273 47274/** 47275 * The `dataObject` is an object containing all the information used by Popper.js. 47276 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 47277 * @name dataObject 47278 * @property {Object} data.instance The Popper.js instance 47279 * @property {String} data.placement Placement applied to popper 47280 * @property {String} data.originalPlacement Placement originally defined on init 47281 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 47282 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 47283 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 47284 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 47285 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 47286 * @property {Object} data.boundaries Offsets of the popper boundaries 47287 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 47288 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 47289 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 47290 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 47291 */ 47292 47293/** 47294 * Default options provided to Popper.js constructor.<br /> 47295 * These can be overridden using the `options` argument of Popper.js.<br /> 47296 * To override an option, simply pass an object with the same 47297 * structure of the `options` object, as the 3rd argument. For example: 47298 * ``` 47299 * new Popper(ref, pop, { 47300 * modifiers: { 47301 * preventOverflow: { enabled: false } 47302 * } 47303 * }) 47304 * ``` 47305 * @type {Object} 47306 * @static 47307 * @memberof Popper 47308 */ 47309var Defaults = { 47310 /** 47311 * Popper's placement. 47312 * @prop {Popper.placements} placement='bottom' 47313 */ 47314 placement: 'bottom', 47315 47316 /** 47317 * Set this to true if you want popper to position it self in 'fixed' mode 47318 * @prop {Boolean} positionFixed=false 47319 */ 47320 positionFixed: false, 47321 47322 /** 47323 * Whether events (resize, scroll) are initially enabled. 47324 * @prop {Boolean} eventsEnabled=true 47325 */ 47326 eventsEnabled: true, 47327 47328 /** 47329 * Set to true if you want to automatically remove the popper when 47330 * you call the `destroy` method. 47331 * @prop {Boolean} removeOnDestroy=false 47332 */ 47333 removeOnDestroy: false, 47334 47335 /** 47336 * Callback called when the popper is created.<br /> 47337 * By default, it is set to no-op.<br /> 47338 * Access Popper.js instance with `data.instance`. 47339 * @prop {onCreate} 47340 */ 47341 onCreate: function onCreate() {}, 47342 47343 /** 47344 * Callback called when the popper is updated. This callback is not called 47345 * on the initialization/creation of the popper, but only on subsequent 47346 * updates.<br /> 47347 * By default, it is set to no-op.<br /> 47348 * Access Popper.js instance with `data.instance`. 47349 * @prop {onUpdate} 47350 */ 47351 onUpdate: function onUpdate() {}, 47352 47353 /** 47354 * List of modifiers used to modify the offsets before they are applied to the popper. 47355 * They provide most of the functionalities of Popper.js. 47356 * @prop {modifiers} 47357 */ 47358 modifiers: modifiers 47359}; 47360 47361/** 47362 * @callback onCreate 47363 * @param {dataObject} data 47364 */ 47365 47366/** 47367 * @callback onUpdate 47368 * @param {dataObject} data 47369 */ 47370 47371// Utils 47372// Methods 47373var Popper = function () { 47374 /** 47375 * Creates a new Popper.js instance. 47376 * @class Popper 47377 * @param {Element|referenceObject} reference - The reference element used to position the popper 47378 * @param {Element} popper - The HTML / XML element used as the popper 47379 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 47380 * @return {Object} instance - The generated Popper.js instance 47381 */ 47382 function Popper(reference, popper) { 47383 var _this = this; 47384 47385 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 47386 classCallCheck(this, Popper); 47387 47388 this.scheduleUpdate = function () { 47389 return requestAnimationFrame(_this.update); 47390 }; 47391 47392 // make update() debounced, so that it only runs at most once-per-tick 47393 this.update = debounce(this.update.bind(this)); 47394 47395 // with {} we create a new object with the options inside it 47396 this.options = _extends({}, Popper.Defaults, options); 47397 47398 // init state 47399 this.state = { 47400 isDestroyed: false, 47401 isCreated: false, 47402 scrollParents: [] 47403 }; 47404 47405 // get reference and popper elements (allow jQuery wrappers) 47406 this.reference = reference && reference.jquery ? reference[0] : reference; 47407 this.popper = popper && popper.jquery ? popper[0] : popper; 47408 47409 // Deep merge modifiers options 47410 this.options.modifiers = {}; 47411 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 47412 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 47413 }); 47414 47415 // Refactoring modifiers' list (Object => Array) 47416 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 47417 return _extends({ 47418 name: name 47419 }, _this.options.modifiers[name]); 47420 }) 47421 // sort the modifiers by order 47422 .sort(function (a, b) { 47423 return a.order - b.order; 47424 }); 47425 47426 // modifiers have the ability to execute arbitrary code when Popper.js get inited 47427 // such code is executed in the same order of its modifier 47428 // they could add new properties to their options configuration 47429 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 47430 this.modifiers.forEach(function (modifierOptions) { 47431 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 47432 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 47433 } 47434 }); 47435 47436 // fire the first update to position the popper in the right place 47437 this.update(); 47438 47439 var eventsEnabled = this.options.eventsEnabled; 47440 if (eventsEnabled) { 47441 // setup event listeners, they will take care of update the position in specific situations 47442 this.enableEventListeners(); 47443 } 47444 47445 this.state.eventsEnabled = eventsEnabled; 47446 } 47447 47448 // We can't use class properties because they don't get listed in the 47449 // class prototype and break stuff like Sinon stubs 47450 47451 47452 createClass(Popper, [{ 47453 key: 'update', 47454 value: function update$$1() { 47455 return update.call(this); 47456 } 47457 }, { 47458 key: 'destroy', 47459 value: function destroy$$1() { 47460 return destroy.call(this); 47461 } 47462 }, { 47463 key: 'enableEventListeners', 47464 value: function enableEventListeners$$1() { 47465 return enableEventListeners.call(this); 47466 } 47467 }, { 47468 key: 'disableEventListeners', 47469 value: function disableEventListeners$$1() { 47470 return disableEventListeners.call(this); 47471 } 47472 47473 /** 47474 * Schedules an update. It will run on the next UI update available. 47475 * @method scheduleUpdate 47476 * @memberof Popper 47477 */ 47478 47479 47480 /** 47481 * Collection of utilities useful when writing custom modifiers. 47482 * Starting from version 1.7, this method is available only if you 47483 * include `popper-utils.js` before `popper.js`. 47484 * 47485 * **DEPRECATION**: This way to access PopperUtils is deprecated 47486 * and will be removed in v2! Use the PopperUtils module directly instead. 47487 * Due to the high instability of the methods contained in Utils, we can't 47488 * guarantee them to follow semver. Use them at your own risk! 47489 * @static 47490 * @private 47491 * @type {Object} 47492 * @deprecated since version 1.8 47493 * @member Utils 47494 * @memberof Popper 47495 */ 47496 47497 }]); 47498 return Popper; 47499}(); 47500 47501/** 47502 * The `referenceObject` is an object that provides an interface compatible with Popper.js 47503 * and lets you use it as replacement of a real DOM node.<br /> 47504 * You can use this method to position a popper relatively to a set of coordinates 47505 * in case you don't have a DOM node to use as reference. 47506 * 47507 * ``` 47508 * new Popper(referenceObject, popperNode); 47509 * ``` 47510 * 47511 * NB: This feature isn't supported in Internet Explorer 10. 47512 * @name referenceObject 47513 * @property {Function} data.getBoundingClientRect 47514 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 47515 * @property {number} data.clientWidth 47516 * An ES6 getter that will return the width of the virtual reference element. 47517 * @property {number} data.clientHeight 47518 * An ES6 getter that will return the height of the virtual reference element. 47519 */ 47520 47521 47522Popper.Utils = (typeof window !== 'undefined' ? window : __webpack_require__.g).PopperUtils; 47523Popper.placements = placements; 47524Popper.Defaults = Defaults; 47525 47526/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Popper); 47527//# sourceMappingURL=popper.js.map 47528 47529 47530/***/ }), 47531
vendor: 5,636 bytes, lines 47532-47725
47532/***/ "./node_modules/process/browser.js": 47533/*!*****************************************!*\ 47534 !*** ./node_modules/process/browser.js ***! 47535 \*****************************************/ 47536/***/ ((module) => { 47537 47538// shim for using process in browser 47539var process = module.exports = {}; 47540 47541// cached from whatever global is present so that test runners that stub it 47542// don't break things. But we need to wrap it in a try catch in case it is 47543// wrapped in strict mode code which doesn't define any globals. It's inside a 47544// function because try/catches deoptimize in certain engines. 47545 47546var cachedSetTimeout; 47547var cachedClearTimeout; 47548 47549function defaultSetTimout() { 47550 throw new Error('setTimeout has not been defined'); 47551} 47552function defaultClearTimeout () { 47553 throw new Error('clearTimeout has not been defined'); 47554} 47555(function () { 47556 try { 47557 if (typeof setTimeout === 'function') { 47558 cachedSetTimeout = setTimeout; 47559 } else { 47560 cachedSetTimeout = defaultSetTimout; 47561 } 47562 } catch (e) { 47563 cachedSetTimeout = defaultSetTimout; 47564 } 47565 try { 47566 if (typeof clearTimeout === 'function') { 47567 cachedClearTimeout = clearTimeout; 47568 } else { 47569 cachedClearTimeout = defaultClearTimeout; 47570 } 47571 } catch (e) { 47572 cachedClearTimeout = defaultClearTimeout; 47573 } 47574} ()) 47575function runTimeout(fun) { 47576 if (cachedSetTimeout === setTimeout) { 47577 //normal enviroments in sane situations 47578 return setTimeout(fun, 0); 47579 } 47580 // if setTimeout wasn't available but was latter defined 47581 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 47582 cachedSetTimeout = setTimeout; 47583 return setTimeout(fun, 0); 47584 } 47585 try { 47586 // when when somebody has screwed with setTimeout but no I.E. maddness 47587 return cachedSetTimeout(fun, 0); 47588 } catch(e){ 47589 try { 47590 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 47591 return cachedSetTimeout.call(null, fun, 0); 47592 } catch(e){ 47593 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 47594 return cachedSetTimeout.call(this, fun, 0); 47595 } 47596 } 47597 47598 47599} 47600function runClearTimeout(marker) { 47601 if (cachedClearTimeout === clearTimeout) { 47602 //normal enviroments in sane situations 47603 return clearTimeout(marker); 47604 } 47605 // if clearTimeout wasn't available but was latter defined 47606 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 47607 cachedClearTimeout = clearTimeout; 47608 return clearTimeout(marker); 47609 } 47610 try { 47611 // when when somebody has screwed with setTimeout but no I.E. maddness 47612 return cachedClearTimeout(marker); 47613 } catch (e){ 47614 try { 47615 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 47616 return cachedClearTimeout.call(null, marker); 47617 } catch (e){ 47618 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 47619 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 47620 return cachedClearTimeout.call(this, marker); 47621 } 47622 } 47623 47624 47625 47626} 47627var queue = []; 47628var draining = false; 47629var currentQueue; 47630var queueIndex = -1; 47631 47632function cleanUpNextTick() { 47633 if (!draining || !currentQueue) { 47634 return; 47635 } 47636 draining = false; 47637 if (currentQueue.length) { 47638 queue = currentQueue.concat(queue); 47639 } else { 47640 queueIndex = -1; 47641 } 47642 if (queue.length) { 47643 drainQueue(); 47644 } 47645} 47646 47647function drainQueue() { 47648 if (draining) { 47649 return; 47650 } 47651 var timeout = runTimeout(cleanUpNextTick); 47652 draining = true; 47653 47654 var len = queue.length; 47655 while(len) { 47656 currentQueue = queue; 47657 queue = []; 47658 while (++queueIndex < len) { 47659 if (currentQueue) { 47660 currentQueue[queueIndex].run(); 47661 } 47662 } 47663 queueIndex = -1; 47664 len = queue.length; 47665 } 47666 currentQueue = null; 47667 draining = false; 47668 runClearTimeout(timeout); 47669} 47670 47671process.nextTick = function (fun) { 47672 var args = new Array(arguments.length - 1); 47673 if (arguments.length > 1) { 47674 for (var i = 1; i < arguments.length; i++) { 47675 args[i - 1] = arguments[i]; 47676 } 47677 } 47678 queue.push(new Item(fun, args)); 47679 if (queue.length === 1 && !draining) { 47680 runTimeout(drainQueue); 47681 } 47682}; 47683 47684// v8 likes predictible objects 47685function Item(fun, array) { 47686 this.fun = fun; 47687 this.array = array; 47688} 47689Item.prototype.run = function () { 47690 this.fun.apply(null, this.array); 47691}; 47692process.title = 'browser'; 47693process.browser = true; 47694process.env = {}; 47695process.argv = []; 47696process.version = ''; // empty string to avoid regexp issues 47697process.versions = {}; 47698 47699function noop() {} 47700 47701process.on = noop; 47702process.addListener = noop; 47703process.once = noop; 47704process.off = noop; 47705process.removeListener = noop; 47706process.removeAllListeners = noop; 47707process.emit = noop; 47708process.prependListener = noop; 47709process.prependOnceListener = noop; 47710 47711process.listeners = function (name) { return [] } 47712 47713process.binding = function (name) { 47714 throw new Error('process.binding is not supported'); 47715}; 47716 47717process.cwd = function () { return '/' }; 47718process.chdir = function (dir) { 47719 throw new Error('process.chdir is not supported'); 47720}; 47721process.umask = function() { return 0; }; 47722 47723 47724/***/ }), 47725
vendor: 630 bytes, lines 47726-47747
47726/***/ "./node_modules/vue-loader/dist/exportHelper.js": 47727/*!******************************************************!*\ 47728 !*** ./node_modules/vue-loader/dist/exportHelper.js ***! 47729 \******************************************************/ 47730/***/ ((__unused_webpack_module, exports) => { 47731 47732"use strict"; 47733 47734Object.defineProperty(exports, "__esModule", ({ value: true })); 47735// runtime helper for setting properties on components 47736// in a tree-shakable way 47737exports["default"] = (sfc, props) => { 47738 const target = sfc.__vccOpts || sfc; 47739 for (const [key, val] of props) { 47740 target[key] = val; 47741 } 47742 return target; 47743}; 47744 47745 47746/***/ }), 47747
47748/***/ "./resources/js/components/VariablePriceComponent.vue": 47749/*!************************************************************!*\ 47750 !*** ./resources/js/components/VariablePriceComponent.vue ***! 47751 \************************************************************/ 47752/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 47753 47754"use strict"; 47755__webpack_require__.r(__webpack_exports__); 47756/* harmony export */ __webpack_require__.d(__webpack_exports__, { 47757/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 47758/* harmony export */ }); 47759/* harmony import */ var _VariablePriceComponent_vue_vue_type_template_id_70a0f90a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VariablePriceComponent.vue?vue&type=template&id=70a0f90a */ "./resources/js/components/VariablePriceComponent.vue?vue&type=template&id=70a0f90a"); 47760/* harmony import */ var _VariablePriceComponent_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VariablePriceComponent.vue?vue&type=script&lang=js */ "./resources/js/components/VariablePriceComponent.vue?vue&type=script&lang=js"); 47761/* harmony import */ var _opt_lampp8_htdocs_hotelsbyweek_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); 47762 47763 47764 47765 47766; 47767const __exports__ = /*#__PURE__*/(0,_opt_lampp8_htdocs_hotelsbyweek_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_VariablePriceComponent_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_VariablePriceComponent_vue_vue_type_template_id_70a0f90a__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/VariablePriceComponent.vue"]]) 47768/* hot reload */ 47769if (false) {} 47770 47771 47772/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); 47773 47774/***/ }), 47775 47776/***/ "./resources/js/components/VariablePriceComponent.vue?vue&type=script&lang=js": 47777/*!************************************************************************************!*\ 47778 !*** ./resources/js/components/VariablePriceComponent.vue?vue&type=script&lang=js ***! 47779 \************************************************************************************/ 47780/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 47781 47782"use strict"; 47783__webpack_require__.r(__webpack_exports__); 47784/* harmony export */ __webpack_require__.d(__webpack_exports__, { 47785/* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_VariablePriceComponent_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) 47786/* harmony export */ }); 47787/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_VariablePriceComponent_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./VariablePriceComponent.vue?vue&type=script&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/VariablePriceComponent.vue?vue&type=script&lang=js"); 47788 47789 47790/***/ }), 47791 47792/***/ "./resources/js/components/VariablePriceComponent.vue?vue&type=template&id=70a0f90a": 47793/*!******************************************************************************************!*\ 47794 !*** ./resources/js/components/VariablePriceComponent.vue?vue&type=template&id=70a0f90a ***! 47795 \******************************************************************************************/ 47796/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 47797 47798"use strict"; 47799__webpack_require__.r(__webpack_exports__); 47800/* harmony export */ __webpack_require__.d(__webpack_exports__, { 47801/* harmony export */ render: () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_VariablePriceComponent_vue_vue_type_template_id_70a0f90a__WEBPACK_IMPORTED_MODULE_0__.render) 47802/* harmony export */ }); 47803/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_VariablePriceComponent_vue_vue_type_template_id_70a0f90a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./VariablePriceComponent.vue?vue&type=template&id=70a0f90a */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/VariablePriceComponent.vue?vue&type=template&id=70a0f90a"); 47804 47805 47806/***/ }), 47807
vendor: 23,431 bytes, lines 47808-48059
47808/***/ "./node_modules/vue/dist/vue.esm-bundler.js": 47809/*!**************************************************!*\ 47810 !*** ./node_modules/vue/dist/vue.esm-bundler.js ***! 47811 \**************************************************/ 47812/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 47813 47814"use strict"; 47815__webpack_require__.r(__webpack_exports__); 47816/* harmony export */ __webpack_require__.d(__webpack_exports__, { 47817/* harmony export */ BaseTransition: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.BaseTransition), 47818/* harmony export */ BaseTransitionPropsValidators: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators), 47819/* harmony export */ Comment: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Comment), 47820/* harmony export */ DeprecationTypes: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.DeprecationTypes), 47821/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.EffectScope), 47822/* harmony export */ ErrorCodes: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ErrorCodes), 47823/* harmony export */ ErrorTypeStrings: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ErrorTypeStrings), 47824/* harmony export */ Fragment: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Fragment), 47825/* harmony export */ KeepAlive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.KeepAlive), 47826/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), 47827/* harmony export */ Static: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Static), 47828/* harmony export */ Suspense: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Suspense), 47829/* harmony export */ Teleport: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Teleport), 47830/* harmony export */ Text: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Text), 47831/* harmony export */ TrackOpTypes: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.TrackOpTypes), 47832/* harmony export */ Transition: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Transition), 47833/* harmony export */ TransitionGroup: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.TransitionGroup), 47834/* harmony export */ TriggerOpTypes: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.TriggerOpTypes), 47835/* harmony export */ VueElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.VueElement), 47836/* harmony export */ assertNumber: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.assertNumber), 47837/* harmony export */ callWithAsyncErrorHandling: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling), 47838/* harmony export */ callWithErrorHandling: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.callWithErrorHandling), 47839/* harmony export */ camelize: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.camelize), 47840/* harmony export */ capitalize: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.capitalize), 47841/* harmony export */ cloneVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.cloneVNode), 47842/* harmony export */ compatUtils: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.compatUtils), 47843/* harmony export */ compile: () => (/* binding */ compileToFunction), 47844/* harmony export */ computed: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.computed), 47845/* harmony export */ createApp: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createApp), 47846/* harmony export */ createBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createBlock), 47847/* harmony export */ createCommentVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode), 47848/* harmony export */ createElementBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createElementBlock), 47849/* harmony export */ createElementVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createElementVNode), 47850/* harmony export */ createHydrationRenderer: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer), 47851/* harmony export */ createPropsRestProxy: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createPropsRestProxy), 47852/* harmony export */ createRenderer: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createRenderer), 47853/* harmony export */ createSSRApp: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createSSRApp), 47854/* harmony export */ createSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createSlots), 47855/* harmony export */ createStaticVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createStaticVNode), 47856/* harmony export */ createTextVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createTextVNode), 47857/* harmony export */ createVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createVNode), 47858/* harmony export */ customRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.customRef), 47859/* harmony export */ defineAsyncComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineAsyncComponent), 47860/* harmony export */ defineComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineComponent), 47861/* harmony export */ defineCustomElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineCustomElement), 47862/* harmony export */ defineEmits: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineEmits), 47863/* harmony export */ defineExpose: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineExpose), 47864/* harmony export */ defineModel: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineModel), 47865/* harmony export */ defineOptions: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineOptions), 47866/* harmony export */ defineProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineProps), 47867/* harmony export */ defineSSRCustomElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineSSRCustomElement), 47868/* harmony export */ defineSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineSlots), 47869/* harmony export */ devtools: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.devtools), 47870/* harmony export */ effect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.effect), 47871/* harmony export */ effectScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.effectScope), 47872/* harmony export */ getCurrentInstance: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance), 47873/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), 47874/* harmony export */ getTransitionRawChildren: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren), 47875/* harmony export */ guardReactiveProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps), 47876/* harmony export */ h: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.h), 47877/* harmony export */ handleError: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.handleError), 47878/* harmony export */ hasInjectionContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.hasInjectionContext), 47879/* harmony export */ hydrate: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.hydrate), 47880/* harmony export */ initCustomFormatter: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.initCustomFormatter), 47881/* harmony export */ initDirectivesForSSR: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.initDirectivesForSSR), 47882/* harmony export */ inject: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.inject), 47883/* harmony export */ isMemoSame: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isMemoSame), 47884/* harmony export */ isProxy: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isProxy), 47885/* harmony export */ isReactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isReactive), 47886/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isReadonly), 47887/* harmony export */ isRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isRef), 47888/* harmony export */ isRuntimeOnly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly), 47889/* harmony export */ isShallow: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isShallow), 47890/* harmony export */ isVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isVNode), 47891/* harmony export */ markRaw: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.markRaw), 47892/* harmony export */ mergeDefaults: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeDefaults), 47893/* harmony export */ mergeModels: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeModels), 47894/* harmony export */ mergeProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeProps), 47895/* harmony export */ nextTick: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.nextTick), 47896/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeClass), 47897/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeProps), 47898/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle), 47899/* harmony export */ onActivated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onActivated), 47900/* harmony export */ onBeforeMount: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount), 47901/* harmony export */ onBeforeUnmount: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount), 47902/* harmony export */ onBeforeUpdate: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate), 47903/* harmony export */ onDeactivated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onDeactivated), 47904/* harmony export */ onErrorCaptured: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onErrorCaptured), 47905/* harmony export */ onMounted: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onMounted), 47906/* harmony export */ onRenderTracked: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onRenderTracked), 47907/* harmony export */ onRenderTriggered: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onRenderTriggered), 47908/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), 47909/* harmony export */ onServerPrefetch: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onServerPrefetch), 47910/* harmony export */ onUnmounted: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onUnmounted), 47911/* harmony export */ onUpdated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onUpdated), 47912/* harmony export */ openBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.openBlock), 47913/* harmony export */ popScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.popScopeId), 47914/* harmony export */ provide: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.provide), 47915/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), 47916/* harmony export */ pushScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.pushScopeId), 47917/* harmony export */ queuePostFlushCb: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.queuePostFlushCb), 47918/* harmony export */ reactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.reactive), 47919/* harmony export */ readonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.readonly), 47920/* harmony export */ ref: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ref), 47921/* harmony export */ registerRuntimeCompiler: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeCompiler), 47922/* harmony export */ render: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.render), 47923/* harmony export */ renderList: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.renderList), 47924/* harmony export */ renderSlot: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.renderSlot), 47925/* harmony export */ resolveComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveComponent), 47926/* harmony export */ resolveDirective: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveDirective), 47927/* harmony export */ resolveDynamicComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent), 47928/* harmony export */ resolveFilter: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveFilter), 47929/* harmony export */ resolveTransitionHooks: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks), 47930/* harmony export */ setBlockTracking: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setBlockTracking), 47931/* harmony export */ setDevtoolsHook: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setDevtoolsHook), 47932/* harmony export */ setTransitionHooks: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks), 47933/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), 47934/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), 47935/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowRef), 47936/* harmony export */ ssrContextKey: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ssrContextKey), 47937/* harmony export */ ssrUtils: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ssrUtils), 47938/* harmony export */ stop: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.stop), 47939/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toDisplayString), 47940/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey), 47941/* harmony export */ toHandlers: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toHandlers), 47942/* harmony export */ toRaw: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRaw), 47943/* harmony export */ toRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRef), 47944/* harmony export */ toRefs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRefs), 47945/* harmony export */ toValue: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toValue), 47946/* harmony export */ transformVNodeArgs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.transformVNodeArgs), 47947/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.triggerRef), 47948/* harmony export */ unref: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.unref), 47949/* harmony export */ useAttrs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useAttrs), 47950/* harmony export */ useCssModule: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useCssModule), 47951/* harmony export */ useCssVars: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useCssVars), 47952/* harmony export */ useModel: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useModel), 47953/* harmony export */ useSSRContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useSSRContext), 47954/* harmony export */ useSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useSlots), 47955/* harmony export */ useTransitionState: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useTransitionState), 47956/* harmony export */ vModelCheckbox: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox), 47957/* harmony export */ vModelDynamic: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelDynamic), 47958/* harmony export */ vModelRadio: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelRadio), 47959/* harmony export */ vModelSelect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelSelect), 47960/* harmony export */ vModelText: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelText), 47961/* harmony export */ vShow: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vShow), 47962/* harmony export */ version: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.version), 47963/* harmony export */ warn: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.warn), 47964/* harmony export */ watch: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watch), 47965/* harmony export */ watchEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchEffect), 47966/* harmony export */ watchPostEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect), 47967/* harmony export */ watchSyncEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchSyncEffect), 47968/* harmony export */ withAsyncContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withAsyncContext), 47969/* harmony export */ withCtx: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withCtx), 47970/* harmony export */ withDefaults: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withDefaults), 47971/* harmony export */ withDirectives: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withDirectives), 47972/* harmony export */ withKeys: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withKeys), 47973/* harmony export */ withMemo: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withMemo), 47974/* harmony export */ withModifiers: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withModifiers), 47975/* harmony export */ withScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withScopeId) 47976/* harmony export */ }); 47977/* harmony import */ var _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js"); 47978/* harmony import */ var _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"); 47979/* harmony import */ var _vue_compiler_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @vue/compiler-dom */ "./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js"); 47980/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); 47981 47982 47983 47984 47985 47986 47987function initDev() { 47988 { 47989 (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.initCustomFormatter)(); 47990 } 47991} 47992 47993if (true) { 47994 initDev(); 47995} 47996const compileCache = /* @__PURE__ */ new WeakMap(); 47997function getCache(options) { 47998 let c = compileCache.get(options != null ? options : _vue_shared__WEBPACK_IMPORTED_MODULE_2__.EMPTY_OBJ); 47999 if (!c) { 48000 c = /* @__PURE__ */ Object.create(null); 48001 compileCache.set(options != null ? options : _vue_shared__WEBPACK_IMPORTED_MODULE_2__.EMPTY_OBJ, c); 48002 } 48003 return c; 48004} 48005function compileToFunction(template, options) { 48006 if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.isString)(template)) { 48007 if (template.nodeType) { 48008 template = template.innerHTML; 48009 } else { 48010 true && (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(`invalid template option: `, template); 48011 return _vue_shared__WEBPACK_IMPORTED_MODULE_2__.NOOP; 48012 } 48013 } 48014 const key = template; 48015 const cache = getCache(options); 48016 const cached = cache[key]; 48017 if (cached) { 48018 return cached; 48019 } 48020 if (template[0] === "#") { 48021 const el = document.querySelector(template); 48022 if ( true && !el) { 48023 (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(`Template element not found or is empty: ${template}`); 48024 } 48025 template = el ? el.innerHTML : ``; 48026 } 48027 const opts = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.extend)( 48028 { 48029 hoistStatic: true, 48030 onError: true ? onError : 0, 48031 onWarn: true ? (e) => onError(e, true) : 0 48032 }, 48033 options 48034 ); 48035 if (!opts.isCustomElement && typeof customElements !== "undefined") { 48036 opts.isCustomElement = (tag) => !!customElements.get(tag); 48037 } 48038 const { code } = (0,_vue_compiler_dom__WEBPACK_IMPORTED_MODULE_3__.compile)(template, opts); 48039 function onError(err, asWarning = false) { 48040 const message = asWarning ? err.message : `Template compilation error: ${err.message}`; 48041 const codeFrame = err.loc && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.generateCodeFrame)( 48042 template, 48043 err.loc.start.offset, 48044 err.loc.end.offset 48045 ); 48046 (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(codeFrame ? `${message} 48047${codeFrame}` : message); 48048 } 48049 const render = new Function("Vue", code)(_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__); 48050 render._rc = true; 48051 return cache[key] = render; 48052} 48053(0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.registerRuntimeCompiler)(compileToFunction); 48054 48055 48056 48057 48058/***/ }), 48059
vendor: 12,842 bytes, lines 48060-48468
48060/***/ "./node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js": 48061/*!**************************************************************!*\ 48062 !*** ./node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js ***! 48063 \**************************************************************/ 48064/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 48065 48066"use strict"; 48067__webpack_require__.r(__webpack_exports__); 48068/* harmony export */ __webpack_require__.d(__webpack_exports__, { 48069/* harmony export */ "default": () => (/* binding */ index) 48070/* harmony export */ }); 48071/*! 48072 * Vue3-Lazyload.js v0.2.5-beta 48073 * A Vue3.x image lazyload plugin 48074 * (c) 2021 MuRong <[email protected]> 48075 * Released under the MIT License. 48076 */ 48077var LifecycleEnum; 48078(function (LifecycleEnum) { 48079 LifecycleEnum["LOADING"] = "loading"; 48080 LifecycleEnum["LOADED"] = "loaded"; 48081 LifecycleEnum["ERROR"] = "error"; 48082})(LifecycleEnum || (LifecycleEnum = {})); 48083 48084/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 48085var inBrowser = typeof window !== 'undefined' && window !== null; 48086var hasIntersectionObserver = checkIntersectionObserver(); 48087var isEnumerable = Object.prototype.propertyIsEnumerable; 48088var getSymbols = Object.getOwnPropertySymbols; 48089/** 48090 * is object 48091 * 48092 * @param {*} val 48093 * @returns {boolean} 48094 */ 48095function isObject(val) { 48096 return typeof val === 'function' || toString.call(val) === '[object Object]'; 48097} 48098/** 48099 * is primitive 48100 * 48101 * @param {*} val 48102 * @returns {boolean} 48103 */ 48104function isPrimitive(val) { 48105 return typeof val === 'object' ? val === null : typeof val !== 'function'; 48106} 48107/** 48108 * check private key 48109 * 48110 * @export 48111 * @param {*} key 48112 * @returns {boolean} 48113 */ 48114function isValidKey(key) { 48115 return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'; 48116} 48117/** 48118 * Check if IntersectionObserver can be used 48119 * 48120 * @returns {boolean} 48121 */ 48122function checkIntersectionObserver() { 48123 if (inBrowser && 48124 'IntersectionObserver' in window && 48125 'IntersectionObserverEntry' in window && 48126 'intersectionRatio' in window.IntersectionObserverEntry.prototype) { 48127 // Minimal polyfill for Edge 15's lack of `isIntersecting` 48128 // See: https://github.com/w3c/IntersectionObserver/issues/211 48129 if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) { 48130 Object.defineProperty(window.IntersectionObserverEntry.prototype, 'isIntersecting', { 48131 get: function () { 48132 return this.intersectionRatio > 0; 48133 } 48134 }); 48135 } 48136 return true; 48137 } 48138 return false; 48139} 48140/** 48141 * Assign the enumerable es6 Symbol properties from one 48142 * or more objects to the first object passed on the arguments. 48143 * Can be used as a supplement to other extend, assign or 48144 * merge methods as a polyfill for the Symbols part of 48145 * the es6 Object.assign method. 48146 * https://github.com/jonschlinkert/assign-symbols 48147 * 48148 * @param {*} target 48149 * @param {...any[]} args 48150 * @returns 48151 */ 48152function assignSymbols(target) { 48153 var args = []; 48154 for (var _i = 1; _i < arguments.length; _i++) { 48155 args[_i - 1] = arguments[_i]; 48156 } 48157 if (!isObject(target)) { 48158 throw new TypeError('expected the first argument to be an object'); 48159 } 48160 if (args.length === 0 || typeof Symbol !== 'function' || typeof getSymbols !== 'function') { 48161 return target; 48162 } 48163 for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { 48164 var arg = args_1[_a]; 48165 var names = getSymbols(arg); 48166 for (var _b = 0, names_1 = names; _b < names_1.length; _b++) { 48167 var key = names_1[_b]; 48168 if (isEnumerable.call(arg, key)) { 48169 target[key] = arg[key]; 48170 } 48171 } 48172 } 48173 return target; 48174} 48175/** 48176 * Deeply assign the values of all enumerable-own-properties and symbols 48177 * from one or more source objects to a target object. Returns the target object. 48178 * https://github.com/jonschlinkert/assign-deep 48179 * 48180 * @param {*} target 48181 * @param {...any[]} args 48182 * @returns 48183 */ 48184function assign(target) { 48185 var args = []; 48186 for (var _i = 1; _i < arguments.length; _i++) { 48187 args[_i - 1] = arguments[_i]; 48188 } 48189 var i = 0; 48190 if (isPrimitive(target)) 48191 target = args[i++]; 48192 if (!target) 48193 target = {}; 48194 for (; i < args.length; i++) { 48195 if (isObject(args[i])) { 48196 for (var _a = 0, _b = Object.keys(args[i]); _a < _b.length; _a++) { 48197 var key = _b[_a]; 48198 if (isValidKey(key)) { 48199 if (isObject(target[key]) && isObject(args[i][key])) { 48200 assign(target[key], args[i][key]); 48201 } 48202 else { 48203 target[key] = args[i][key]; 48204 } 48205 } 48206 } 48207 assignSymbols(target, args[i]); 48208 } 48209 } 48210 return target; 48211} 48212 48213/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 48214var DEFAULT_OBSERVER_OPTIONS = { 48215 rootMargin: '0px', 48216 threshold: 0 48217}; 48218var DEFAULT_LOADING = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; 48219var DEFAULT_ERROR = ''; 48220/** 48221 * Lazyload 48222 * 48223 * @export 48224 * @class Lazy 48225 */ 48226var Lazy = /** @class */ (function () { 48227 function Lazy(options) { 48228 this.options = { 48229 loading: DEFAULT_LOADING, 48230 error: DEFAULT_ERROR, 48231 observerOptions: DEFAULT_OBSERVER_OPTIONS, 48232 log: true, 48233 lifecycle: {} 48234 }; 48235 this._images = new WeakMap(); 48236 this.config(options); 48237 } 48238 /** 48239 * merge config 48240 * 48241 * @param {*} [options={}] 48242 * @memberof Lazy 48243 */ 48244 Lazy.prototype.config = function (options) { 48245 if (options === void 0) { options = {}; } 48246 assign(this.options, options); 48247 }; 48248 /** 48249 * mount 48250 * 48251 * @param {HTMLElement} el 48252 * @param {DirectiveBinding<string>} binding 48253 * @memberof Lazy 48254 */ 48255 Lazy.prototype.mount = function (el, binding) { 48256 var _a = this._valueFormatter(binding.value), src = _a.src, loading = _a.loading, error = _a.error, lifecycle = _a.lifecycle; 48257 this._lifecycle(LifecycleEnum.LOADING, lifecycle, el); 48258 el.setAttribute('src', loading || DEFAULT_LOADING); 48259 if (!hasIntersectionObserver) { 48260 this.loadImages(el, src, error, lifecycle); 48261 this._log(function () { 48262 throw new Error('Not support IntersectionObserver!'); 48263 }); 48264 } 48265 this._initIntersectionObserver(el, src, error, lifecycle); 48266 }; 48267 /** 48268 * update 48269 * 48270 * @param {HTMLElement} el 48271 * @memberof Lazy 48272 */ 48273 Lazy.prototype.update = function (el, binding) { 48274 var _a; 48275 (_a = this._realObserver(el)) === null || _a === void 0 ? void 0 : _a.unobserve(el); 48276 var _b = this._valueFormatter(binding.value), src = _b.src, error = _b.error, lifecycle = _b.lifecycle; 48277 this._initIntersectionObserver(el, src, error, lifecycle); 48278 }; 48279 /** 48280 * unmount 48281 * 48282 * @param {HTMLElement} el 48283 * @memberof Lazy 48284 */ 48285 Lazy.prototype.unmount = function (el) { 48286 var _a; 48287 (_a = this._realObserver(el)) === null || _a === void 0 ? void 0 : _a.unobserve(el); 48288 this._images.delete(el); 48289 }; 48290 /** 48291 * force loading 48292 * 48293 * @param {HTMLElement} el 48294 * @param {string} src 48295 * @memberof Lazy 48296 */ 48297 Lazy.prototype.loadImages = function (el, src, error, lifecycle) { 48298 this._setImageSrc(el, src, error, lifecycle); 48299 }; 48300 /** 48301 * set img tag src 48302 * 48303 * @private 48304 * @param {HTMLElement} el 48305 * @param {string} src 48306 * @memberof Lazy 48307 */ 48308 Lazy.prototype._setImageSrc = function (el, src, error, lifecycle) { 48309 var _this = this; 48310 if ('img' === el.tagName.toLowerCase()) { 48311 if (src) { 48312 var preSrc = el.getAttribute('src'); 48313 if (preSrc !== src) { 48314 el.setAttribute('src', src); 48315 } 48316 } 48317 this._listenImageStatus(el, function () { 48318 _this._lifecycle(LifecycleEnum.LOADED, lifecycle, el); 48319 }, function () { 48320 var _a; 48321 // Fix onload trigger twice, clear onload event 48322 // Reload on update 48323 el.onload = null; 48324 _this._lifecycle(LifecycleEnum.ERROR, lifecycle, el); 48325 (_a = _this._realObserver(el)) === null || _a === void 0 ? void 0 : _a.disconnect(); 48326 if (error) 48327 el.setAttribute('src', error); 48328 _this._log(function () { throw new Error('Image failed to load!'); }); 48329 }); 48330 } 48331 else { 48332 el.style.backgroundImage = 'url(\'' + src + '\')'; 48333 } 48334 }; 48335 /** 48336 * init IntersectionObserver 48337 * 48338 * @private 48339 * @param {HTMLElement} el 48340 * @param {string} src 48341 * @memberof Lazy 48342 */ 48343 Lazy.prototype._initIntersectionObserver = function (el, src, error, lifecycle) { 48344 var _this = this; 48345 var _a; 48346 var observerOptions = this.options.observerOptions; 48347 this._images.set(el, new IntersectionObserver(function (entries) { 48348 Array.prototype.forEach.call(entries, function (entry) { 48349 var _a; 48350 if (entry.isIntersecting) { 48351 (_a = _this._realObserver(el)) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target); 48352 _this._setImageSrc(el, src, error, lifecycle); 48353 } 48354 }); 48355 }, observerOptions)); 48356 (_a = this._realObserver(el)) === null || _a === void 0 ? void 0 : _a.observe(el); 48357 }; 48358 /** 48359 * only listen to image status 48360 * 48361 * @private 48362 * @param {string} src 48363 * @param {(string | null)} cors 48364 * @param {() => void} success 48365 * @param {() => void} error 48366 * @memberof Lazy 48367 */ 48368 Lazy.prototype._listenImageStatus = function (image, success, error) { 48369 image.onload = success; 48370 image.onerror = error; 48371 }; 48372 /** 48373 * to do it differently for object and string 48374 * 48375 * @public 48376 * @param {(ValueFormatterObject | string)} value 48377 * @returns {*} 48378 * @memberof Lazy 48379 */ 48380 Lazy.prototype._valueFormatter = function (value) { 48381 var src = value; 48382 var loading = this.options.loading; 48383 var error = this.options.error; 48384 var lifecycle = this.options.lifecycle; 48385 if (isObject(value)) { 48386 src = value.src; 48387 loading = value.loading || this.options.loading; 48388 error = value.error || this.options.error; 48389 lifecycle = (value.lifecycle || this.options.lifecycle); 48390 } 48391 return { 48392 src: src, 48393 loading: loading, 48394 error: error, 48395 lifecycle: lifecycle 48396 }; 48397 }; 48398 /** 48399 * log 48400 * 48401 * @param {() => void} callback 48402 * @memberof Lazy 48403 */ 48404 Lazy.prototype._log = function (callback) { 48405 if (this.options.log) { 48406 callback(); 48407 } 48408 }; 48409 /** 48410 * lifecycle easy 48411 * 48412 * @private 48413 * @param {LifecycleEnum} life 48414 * @param {Lifecycle} [lifecycle] 48415 * @memberof Lazy 48416 */ 48417 Lazy.prototype._lifecycle = function (life, lifecycle, el) { 48418 switch (life) { 48419 case LifecycleEnum.LOADING: 48420 el === null || el === void 0 ? void 0 : el.setAttribute('lazy', LifecycleEnum.LOADING); 48421 if (lifecycle === null || lifecycle === void 0 ? void 0 : lifecycle.loading) { 48422 lifecycle.loading(el); 48423 } 48424 break; 48425 case LifecycleEnum.LOADED: 48426 el === null || el === void 0 ? void 0 : el.setAttribute('lazy', LifecycleEnum.LOADED); 48427 if (lifecycle === null || lifecycle === void 0 ? void 0 : lifecycle.loaded) { 48428 lifecycle.loaded(el); 48429 } 48430 break; 48431 case LifecycleEnum.ERROR: 48432 el === null || el === void 0 ? void 0 : el.setAttribute('lazy', LifecycleEnum.ERROR); 48433 if (lifecycle === null || lifecycle === void 0 ? void 0 : lifecycle.error) { 48434 lifecycle.error(el); 48435 } 48436 break; 48437 } 48438 }; 48439 Lazy.prototype._realObserver = function (el) { 48440 return this._images.get(el); 48441 }; 48442 return Lazy; 48443}()); 48444 48445var index = { 48446 /** 48447 * install plugin 48448 * 48449 * @param {App} Vue 48450 * @param {LazyOptions} options 48451 */ 48452 install: function (Vue, options) { 48453 var lazy = new Lazy(options); 48454 Vue.config.globalProperties.$Lazyload = lazy; 48455 Vue.provide('Lazyload', lazy); 48456 Vue.directive('lazy', { 48457 mounted: lazy.mount.bind(lazy), 48458 updated: lazy.update.bind(lazy), 48459 unmounted: lazy.unmount.bind(lazy) 48460 }); 48461 } 48462}; 48463 48464 48465 48466 48467/***/ }), 48468
48469/***/ "./resources/js/countries.json": 48470/*!*************************************!*\ 48471 !*** ./resources/js/countries.json ***! 48472 \*************************************/ 48473/***/ ((module) => { 48474 48475"use strict"; 48476module.exports = JSON.parse('[{"name":"Afghanistan","prefix":93,"flag":"AF"},{"name":"Albania","prefix":355,"flag":"AL"},{"name":"Algeria","prefix":213,"flag":"DZ"},{"name":"American Samoa","prefix":1,"flag":"AS"},{"name":"Andorra","prefix":376,"flag":"AD"},{"name":"Angola","prefix":244,"flag":"AO"},{"name":"Anguilla","prefix":1,"flag":"AI"},{"name":"Antarctica","prefix":672,"flag":"AQ"},{"name":"Antigua and Barbuda","prefix":1,"flag":"AG"},{"name":"Argentina","prefix":54,"flag":"AR"},{"name":"Armenia","prefix":374,"flag":"AM"},{"name":"Aruba","prefix":297,"flag":"AW"},{"name":"Australia","prefix":61,"flag":"AU"},{"name":"Austria","prefix":43,"flag":"AT"},{"name":"Azerbaijan","prefix":994,"flag":"AZ"},{"name":"Bahamas","prefix":1,"flag":"BS"},{"name":"Bahrain","prefix":973,"flag":"BH"},{"name":"Bangladesh","prefix":880,"flag":"BD"},{"name":"Barbados","prefix":1,"flag":"BB"},{"name":"Belarus","prefix":375,"flag":"BY"},{"name":"Belgium","prefix":32,"flag":"BE"},{"name":"Belize","prefix":501,"flag":"BZ"},{"name":"Benin","prefix":229,"flag":"BJ"},{"name":"Bermuda","prefix":1,"flag":"BM"},{"name":"Bhutan","prefix":975,"flag":"BT"},{"name":"Bolivia","prefix":591,"flag":"BO"},{"name":"Bosnia and Herzegovina","prefix":387,"flag":"BA"},{"name":"Botswana","prefix":267,"flag":"BW"},{"name":"Brazil","prefix":55,"flag":"BR"},{"name":"British Indian Ocean Territory","prefix":246,"flag":"IO"},{"name":"British Virgin Islands","prefix":1,"flag":"VG"},{"name":"Brunei","prefix":673,"flag":"BN"},{"name":"Bulgaria","prefix":359,"flag":"BG"},{"name":"Burkina Faso","prefix":226,"flag":"BF"},{"name":"Burundi","prefix":257,"flag":"BI"},{"name":"Cambodia","prefix":855,"flag":"KH"},{"name":"Cameroon","prefix":237,"flag":"CM"},{"name":"Canada","prefix":1,"flag":"CA"},{"name":"Cape Verde","prefix":238,"flag":"CV"},{"name":"Cayman Islands","prefix":1,"flag":"KY"},{"name":"Central African Republic","prefix":236,"flag":"CF"},{"name":"Chad","prefix":235,"flag":"TD"},{"name":"Chile","prefix":56,"flag":"CL"},{"name":"China","prefix":86,"flag":"CN"},{"name":"Christmas Island","prefix":61,"flag":"CX"},{"name":"Cocos Islands","prefix":61,"flag":"CC"},{"name":"Colombia","prefix":57,"flag":"CO"},{"name":"Comoros","prefix":269,"flag":"KM"},{"name":"Cook Islands","prefix":682,"flag":"CK"},{"name":"Costa Rica","prefix":506,"flag":"CR"},{"name":"Croatia","prefix":385,"flag":"HR"},{"name":"Cuba","prefix":53,"flag":"CU"},{"name":"Curacao","prefix":599,"flag":"CW"},{"name":"Cyprus","prefix":357,"flag":"CY"},{"name":"Czech Republic","prefix":420,"flag":"CZ"},{"name":"Denmark","prefix":45,"flag":"DK"},{"name":"Djibouti","prefix":253,"flag":"DJ"},{"name":"Dominica","prefix":1,"flag":"DM"},{"name":"Dominican Republic","prefix":1,"flag":"DO"},{"name":"East Timor","prefix":670,"flag":"TL"},{"name":"Ecuador","prefix":593,"flag":"EC"},{"name":"Egypt","prefix":20,"flag":"EG"},{"name":"El Salvador","prefix":503,"flag":"SV"},{"name":"Equatorial Guinea","prefix":240,"flag":"GQ"},{"name":"Eritrea","prefix":291,"flag":"ER"},{"name":"Estonia","prefix":372,"flag":"EE"},{"name":"Ethiopia","prefix":251,"flag":"ET"},{"name":"Falkland Islands","prefix":500,"flag":"FK"},{"name":"Faroe Islands","prefix":298,"flag":"FO"},{"name":"Fiji","prefix":679,"flag":"FJ"},{"name":"Finland","prefix":358,"flag":"FI"},{"name":"France","prefix":33,"flag":"FR"},{"name":"French Polynesia","prefix":689,"flag":"PF"},{"name":"Gabon","prefix":241,"flag":"GA"},{"name":"Gambia","prefix":220,"flag":"GM"},{"name":"Georgia","prefix":995,"flag":"GE"},{"name":"Germany","prefix":49,"flag":"DE"},{"name":"Ghana","prefix":233,"flag":"GH"},{"name":"Gibraltar","prefix":350,"flag":"GI"},{"name":"Greece","prefix":30,"flag":"GR"},{"name":"Greenland","prefix":299,"flag":"GL"},{"name":"Grenada","prefix":1,"flag":"GD"},{"name":"Guam","prefix":1671,"flag":"GU"},{"name":"Guatemala","prefix":502,"flag":"GT"},{"name":"Guernsey","prefix":44,"flag":"GG"},{"name":"Guinea","prefix":224,"flag":"GN"},{"name":"Guinea-Bissau","prefix":245,"flag":"GW"},{"name":"Guyana","prefix":592,"flag":"GY"},{"name":"Haiti","prefix":509,"flag":"HT"},{"name":"Honduras","prefix":504,"flag":"HN"},{"name":"Hong Kong","prefix":852,"flag":"HK"},{"name":"Hungary","prefix":36,"flag":"HU"},{"name":"Iceland","prefix":354,"flag":"IS"},{"name":"India","prefix":91,"flag":"IN"},{"name":"Indonesia","prefix":62,"flag":"ID"},{"name":"Iran","prefix":98,"flag":"IR"},{"name":"Iraq","prefix":964,"flag":"IQ"},{"name":"Ireland","prefix":353,"flag":"IE"},{"name":"Isle of Man","prefix":44,"flag":"IM"},{"name":"Israel","prefix":972,"flag":"IL"},{"name":"Italy","prefix":39,"flag":"IT"},{"name":"Jamaica","prefix":1,"flag":"JM"},{"name":"Japan","prefix":81,"flag":"JP"},{"name":"Jersey","prefix":44,"flag":"JE"},{"name":"Jordan","prefix":962,"flag":"JO"},{"name":"Kazakhstan","prefix":7,"flag":"KZ"},{"name":"Kenya","prefix":254,"flag":"KE"},{"name":"Kiribati","prefix":686,"flag":"KI"},{"name":"Kosovo","prefix":383,"flag":"XK"},{"name":"Kuwait","prefix":965,"flag":"KW"},{"name":"Kyrgyzstan","prefix":996,"flag":"KG"},{"name":"Laos","prefix":856,"flag":"LA"},{"name":"Latvia","prefix":371,"flag":"LV"},{"name":"Lebanon","prefix":961,"flag":"LB"},{"name":"Lesotho","prefix":266,"flag":"LS"},{"name":"Liberia","prefix":231,"flag":"LR"},{"name":"Libya","prefix":218,"flag":"LY"},{"name":"Liechtenstein","prefix":423,"flag":"LI"},{"name":"Lithuania","prefix":370,"flag":"LT"},{"name":"Luxembourg","prefix":352,"flag":"LU"},{"name":"Macau","prefix":853,"flag":"MO"},{"name":"Macedonia","prefix":389,"flag":"MK"},{"name":"Madagascar","prefix":261,"flag":"MG"},{"name":"Malawi","prefix":265,"flag":"MW"},{"name":"Malaysia","prefix":60,"flag":"MY"},{"name":"Maldives","prefix":960,"flag":"MV"},{"name":"Mali","prefix":223,"flag":"ML"},{"name":"Malta","prefix":356,"flag":"MT"},{"name":"Marshall Islands","prefix":692,"flag":"MH"},{"name":"Mauritania","prefix":222,"flag":"MR"},{"name":"Mauritius","prefix":230,"flag":"MU"},{"name":"Mayotte","prefix":262,"flag":"YT"},{"name":"Mexico","prefix":52,"flag":"MX"},{"name":"Micronesia","prefix":691,"flag":"FM"},{"name":"Moldova","prefix":373,"flag":"MD"},{"name":"Monaco","prefix":377,"flag":"MC"},{"name":"Mongolia","prefix":976,"flag":"MN"},{"name":"Montenegro","prefix":382,"flag":"ME"},{"name":"Montserrat","prefix":1,"flag":"MS"},{"name":"Morocco","prefix":212,"flag":"MA"},{"name":"Mozambique","prefix":258,"flag":"MZ"},{"name":"Myanmar","prefix":95,"flag":"MM"},{"name":"Namibia","prefix":264,"flag":"NA"},{"name":"Nauru","prefix":674,"flag":"NR"},{"name":"Nepal","prefix":977,"flag":"NP"},{"name":"Netherlands","prefix":31,"flag":"NL"},{"name":"New Caledonia","prefix":687,"flag":"NC"},{"name":"New Zealand","prefix":64,"flag":"NZ"},{"name":"Nicaragua","prefix":505,"flag":"NI"},{"name":"Niger","prefix":227,"flag":"NE"},{"name":"Nigeria","prefix":234,"flag":"NG"},{"name":"Niue","prefix":683,"flag":"NU"},{"name":"North Korea","prefix":850,"flag":"KP"},{"name":"Northern Mariana Islands","prefix":1670,"flag":"MP"},{"name":"Norway","prefix":47,"flag":"NO"},{"name":"Oman","prefix":968,"flag":"OM"},{"name":"Pakistan","prefix":92,"flag":"PK"},{"name":"Palau","prefix":680,"flag":"PW"},{"name":"Palestine","prefix":970,"flag":"PS"},{"name":"Panama","prefix":507,"flag":"PA"},{"name":"Papua New Guinea","prefix":675,"flag":"PG"},{"name":"Paraguay","prefix":595,"flag":"PY"},{"name":"Peru","prefix":51,"flag":"PE"},{"name":"Philippines","prefix":63,"flag":"PH"},{"name":"Pitcairn","prefix":64,"flag":"PN"},{"name":"Poland","prefix":48,"flag":"PL"},{"name":"Portugal","prefix":351,"flag":"PT"},{"name":"Puerto Rico","prefix":1787,"flag":"PR"},{"name":"Qatar","prefix":974,"flag":"QA"},{"name":"Republic of the Congo","prefix":242,"flag":"CG"},{"name":"Reunion","prefix":262,"flag":"RE"},{"name":"Romania","prefix":40,"flag":"RO"},{"name":"Russia","prefix":7,"flag":"RU"},{"name":"Rwanda","prefix":250,"flag":"RW"},{"name":"Saint Barthelemy","prefix":590,"flag":"BL"},{"name":"Saint Helena","prefix":290,"flag":"SH"},{"name":"Saint Kitts and Nevis","prefix":1869,"flag":"KN"},{"name":"Saint Lucia","prefix":1758,"flag":"LC"},{"name":"Saint Martin","prefix":590,"flag":"MF"},{"name":"Saint Pierre and Miquelon","prefix":508,"flag":"PM"},{"name":"Saint Vincent and the Grenadines","prefix":1,"flag":"VC"},{"name":"Samoa","prefix":685,"flag":"WS"},{"name":"San Marino","prefix":378,"flag":"SM"},{"name":"Sao Tome and Principe","prefix":239,"flag":"ST"},{"name":"Saudi Arabia","prefix":966,"flag":"SA"},{"name":"Senegal","prefix":221,"flag":"SN"},{"name":"Serbia","prefix":381,"flag":"RS"},{"name":"Seychelles","prefix":248,"flag":"SC"},{"name":"Sierra Leone","prefix":232,"flag":"SL"},{"name":"Singapore","prefix":65,"flag":"SG"},{"name":"Sint Maarten","prefix":1,"flag":"SX"},{"name":"Slovakia","prefix":421,"flag":"SK"},{"name":"Slovenia","prefix":386,"flag":"SI"},{"name":"Solomon Islands","prefix":677,"flag":"SB"},{"name":"Somalia","prefix":252,"flag":"SO"},{"name":"South Africa","prefix":27,"flag":"ZA"},{"name":"South Korea","prefix":82,"flag":"KR"},{"name":"South Sudan","prefix":211,"flag":"SS"},{"name":"Spain","prefix":34,"flag":"ES"},{"name":"Sri Lanka","prefix":94,"flag":"LK"},{"name":"Sudan","prefix":249,"flag":"SD"},{"name":"Suriname","prefix":597,"flag":"SR"},{"name":"Svalbard and Jan Mayen","prefix":47,"flag":"SJ"},{"name":"Swaziland","prefix":268,"flag":"SZ"},{"name":"Sweden","prefix":46,"flag":"SE"},{"name":"Switzerland","prefix":41,"flag":"CH"},{"name":"Syria","prefix":963,"flag":"SY"},{"name":"Taiwan","prefix":886,"flag":"TW"},{"name":"Tajikistan","prefix":992,"flag":"TJ"},{"name":"Tanzania","prefix":255,"flag":"TZ"},{"name":"Thailand","prefix":66,"flag":"TH"},{"name":"Togo","prefix":228,"flag":"TG"},{"name":"Tokelau","prefix":690,"flag":"TK"},{"name":"Tonga","prefix":676,"flag":"TO"},{"name":"Trinidad and Tobago","prefix":1,"flag":"TT"},{"name":"Tunisia","prefix":216,"flag":"TN"},{"name":"Turkey","prefix":90,"flag":"TR"},{"name":"Turkmenistan","prefix":993,"flag":"TM"},{"name":"Turks and Caicos Islands","prefix":1,"flag":"TC"},{"name":"Tuvalu","prefix":688,"flag":"TV"},{"name":"U.S. Virgin Islands","prefix":1,"flag":"VI"},{"name":"Uganda","prefix":256,"flag":"UG"},{"name":"Ukraine","prefix":380,"flag":"UA"},{"name":"United Arab Emirates","prefix":971,"flag":"AE"},{"name":"United Kingdom","prefix":44,"flag":"GB"},{"name":"United States","prefix":1,"flag":"US"},{"name":"Uruguay","prefix":598,"flag":"UY"},{"name":"Uzbekistan","prefix":998,"flag":"UZ"},{"name":"Vanuatu","prefix":678,"flag":"VU"},{"name":"Vatican","prefix":379,"flag":"VA"},{"name":"Venezuela","prefix":58,"flag":"VE"},{"name":"Vietnam","prefix":84,"flag":"VN"},{"name":"Wallis and Futuna","prefix":681,"flag":"WF"},{"name":"Western Sahara","prefix":212,"flag":"EH"},{"name":"Yemen","prefix":967,"flag":"YE"},{"name":"Zambia","prefix":260,"flag":"ZM"},{"name":"Zimbabwe","prefix":263,"flag":"ZW"}]'); 48477 48478/***/ })
vendor: 14,426 bytes, lines 48478-48682
48478 48479 48480/******/ }); 48481/************************************************************************/ 48482/******/ // The module cache 48483/******/ var __webpack_module_cache__ = {}; 48484/******/ 48485/******/ // The require function 48486/******/ function __webpack_require__(moduleId) { 48487/******/ // Check if module is in cache 48488/******/ var cachedModule = __webpack_module_cache__[moduleId]; 48489/******/ if (cachedModule !== undefined) { 48490/******/ return cachedModule.exports; 48491/******/ } 48492/******/ // Create a new module (and put it into the cache) 48493/******/ var module = __webpack_module_cache__[moduleId] = { 48494/******/ id: moduleId, 48495/******/ loaded: false, 48496/******/ exports: {} 48497/******/ }; 48498/******/ 48499/******/ // Execute the module function 48500/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 48501/******/ 48502/******/ // Flag the module as loaded 48503/******/ module.loaded = true; 48504/******/ 48505/******/ // Return the exports of the module 48506/******/ return module.exports; 48507/******/ } 48508/******/ 48509/******/ // expose the modules object (__webpack_modules__) 48510/******/ __webpack_require__.m = __webpack_modules__; 48511/******/ 48512/************************************************************************/ 48513/******/ /* webpack/runtime/chunk loaded */ 48514/******/ (() => { 48515/******/ var deferred = []; 48516/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 48517/******/ if(chunkIds) { 48518/******/ priority = priority || 0; 48519/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 48520/******/ deferred[i] = [chunkIds, fn, priority]; 48521/******/ return; 48522/******/ } 48523/******/ var notFulfilled = Infinity; 48524/******/ for (var i = 0; i < deferred.length; i++) { 48525/******/ var [chunkIds, fn, priority] = deferred[i]; 48526/******/ var fulfilled = true; 48527/******/ for (var j = 0; j < chunkIds.length; j++) { 48528/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 48529/******/ chunkIds.splice(j--, 1); 48530/******/ } else { 48531/******/ fulfilled = false; 48532/******/ if(priority < notFulfilled) notFulfilled = priority; 48533/******/ } 48534/******/ } 48535/******/ if(fulfilled) { 48536/******/ deferred.splice(i--, 1) 48537/******/ var r = fn(); 48538/******/ if (r !== undefined) result = r; 48539/******/ } 48540/******/ } 48541/******/ return result; 48542/******/ }; 48543/******/ })(); 48544/******/ 48545/******/ /* webpack/runtime/define property getters */ 48546/******/ (() => { 48547/******/ // define getter functions for harmony exports 48548/******/ __webpack_require__.d = (exports, definition) => { 48549/******/ for(var key in definition) { 48550/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 48551/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 48552/******/ } 48553/******/ } 48554/******/ }; 48555/******/ })(); 48556/******/ 48557/******/ /* webpack/runtime/global */ 48558/******/ (() => { 48559/******/ __webpack_require__.g = (function() { 48560/******/ if (typeof globalThis === 'object') return globalThis; 48561/******/ try { 48562/******/ return this || new Function('return this')(); 48563/******/ } catch (e) { 48564/******/ if (typeof window === 'object') return window; 48565/******/ } 48566/******/ })(); 48567/******/ })(); 48568/******/ 48569/******/ /* webpack/runtime/hasOwnProperty shorthand */ 48570/******/ (() => { 48571/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 48572/******/ })(); 48573/******/ 48574/******/ /* webpack/runtime/make namespace object */ 48575/******/ (() => { 48576/******/ // define __esModule on exports 48577/******/ __webpack_require__.r = (exports) => { 48578/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 48579/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 48580/******/ } 48581/******/ Object.defineProperty(exports, '__esModule', { value: true }); 48582/******/ }; 48583/******/ })(); 48584/******/ 48585/******/ /* webpack/runtime/node module decorator */ 48586/******/ (() => { 48587/******/ __webpack_require__.nmd = (module) => { 48588/******/ module.paths = []; 48589/******/ if (!module.children) module.children = []; 48590/******/ return module; 48591/******/ }; 48592/******/ })(); 48593/******/ 48594/******/ /* webpack/runtime/jsonp chunk loading */ 48595/******/ (() => { 48596/******/ // no baseURI 48597/******/ 48598/******/ // object to store loaded and loading chunks 48599/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 48600/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 48601/******/ var installedChunks = { 48602/******/ "/frontend/js/app": 0, 48603/******/ "frontend/css/app": 0, 48604/******/ "frontend/module/hotel/css/hotel": 0, 48605/******/ "admin/css/app": 0, 48606/******/ "frontend/module/booking/css/checkout": 0, 48607/******/ "frontend/css/rtl": 0, 48608/******/ "frontend/css/contact": 0, 48609/******/ "admin/css/vendors": 0, 48610/******/ "frontend/module/social/css/social": 0, 48611/******/ "frontend/module/location/css/location": 0, 48612/******/ "frontend/module/media/css/browser": 0, 48613/******/ "frontend/module/news/css/news": 0, 48614/******/ "frontend/module/user/css/profile": 0, 48615/******/ "frontend/module/user/css/user": 0 48616/******/ }; 48617/******/ 48618/******/ // no chunk on demand loading 48619/******/ 48620/******/ // no prefetching 48621/******/ 48622/******/ // no preloaded 48623/******/ 48624/******/ // no HMR 48625/******/ 48626/******/ // no HMR manifest 48627/******/ 48628/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 48629/******/ 48630/******/ // install a JSONP callback for chunk loading 48631/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 48632/******/ var [chunkIds, moreModules, runtime] = data; 48633/******/ // add "moreModules" to the modules object, 48634/******/ // then flag all "chunkIds" as loaded and fire callback 48635/******/ var moduleId, chunkId, i = 0; 48636/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 48637/******/ for(moduleId in moreModules) { 48638/******/ if(__webpack_require__.o(moreModules, moduleId)) { 48639/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 48640/******/ } 48641/******/ } 48642/******/ if(runtime) var result = runtime(__webpack_require__); 48643/******/ } 48644/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 48645/******/ for(;i < chunkIds.length; i++) { 48646/******/ chunkId = chunkIds[i]; 48647/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 48648/******/ installedChunks[chunkId][0](); 48649/******/ } 48650/******/ installedChunks[chunkId] = 0; 48651/******/ } 48652/******/ return __webpack_require__.O(result); 48653/******/ } 48654/******/ 48655/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; 48656/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 48657/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 48658/******/ })(); 48659/******/ 48660/************************************************************************/ 48661/******/ 48662/******/ // startup 48663/******/ // Load entry module and return exports 48664/******/ // This entry module depends on other loaded chunks and execution need to be delayed 48665/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./resources/js/app.js"))) 48666/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/sass/app.scss"))) 48667/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/sass/contact.scss"))) 48668/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/sass/rtl.scss"))) 48669/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/module/booking/scss/checkout.scss"))) 48670/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/module/user/scss/user.scss"))) 48671/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/module/user/scss/profile.scss"))) 48672/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/module/hotel/scss/hotel.scss"))) 48673/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/module/news/scss/news.scss"))) 48674/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/module/media/scss/browser.scss"))) 48675/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/module/location/scss/location.scss"))) 48676/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./public/module/social/scss/social.scss"))) 48677/******/ __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./resources/sass/admin/vendors.scss"))) 48678/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["frontend/css/app","frontend/module/hotel/css/hotel","admin/css/app","frontend/module/booking/css/checkout","frontend/css/rtl","frontend/css/contact","admin/css/vendors","frontend/module/social/css/social","frontend/module/location/css/location","frontend/module/media/css/browser","frontend/module/news/css/news","frontend/module/user/css/profile","frontend/module/user/css/user"], () => (__webpack_require__("./resources/sass/admin/app.scss"))) 48679/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 48680/******/ 48681/******/ })() 48682;
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.