@mherod/get-cookie 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/commit-msg +0 -0
- package/.husky/pre-commit +0 -0
- package/.husky/pre-push +0 -0
- package/README.md +76 -117
- package/dist/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.js +6 -1
- package/examples/basic-usage.ts +9 -10
- package/examples/cli-examples.sh +0 -0
- package/package.json +29 -19
- package/dist/chunk-GVQTX3C5.js +0 -2
- package/dist/chunk-GVQTX3C5.js.map +0 -1
- package/dist/getChromePassword-6XZINNNO.js +0 -2
- package/dist/getChromePassword-6XZINNNO.js.map +0 -1
package/dist/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts","../src/utils/logger.ts","../src/utils/logHelpers.ts","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayAggregator.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseEach.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAggregator.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAggregator.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/groupBy.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/lodash.js","../src/utils/execSimple.ts","../src/core/browsers/chrome/macos/getChromePassword.ts","../src/core/cookies/cookieSpecsFromUrl.ts","../src/utils/argv.ts","../src/cli/cli.ts","../src/cli/cliQueryCookies.ts","../src/cli/handlers/DefaultOutputHandler.ts","../src/cli/handlers/DumpOutputHandler.ts","../src/cli/handlers/GroupedDumpOutputHandler.ts","../src/core/cookies/renderCookies.ts","../src/cli/handlers/GroupedRenderOutputHandler.ts","../src/cli/handlers/JsonOutputHandler.ts","../src/cli/handlers/RenderOutputHandler.ts","../src/cli/handlers/OutputHandlerFactory.ts","../src/cli/services/CookieExpiryService.ts","../src/cli/services/CookieQueryService.ts","../src/core/browsers/chrome/ChromeCookieQueryStrategy.ts","../src/core/browsers/getEncryptedChromeCookie.ts","../src/core/browsers/chrome/ChromeApplicationSupport.ts","../src/core/browsers/QuerySqliteThenTransform.ts","../src/core/browsers/listChromeProfiles.ts","../src/core/browsers/chrome/decrypt.ts","../src/core/browsers/chrome/getChromePassword.ts","../src/utils/flatMapAsync.ts","../src/core/browsers/CompositeCookieQueryStrategy.ts","../src/core/browsers/firefox/FirefoxCookieQueryStrategy.ts","../src/core/browsers/safari/SafariCookieQueryStrategy.ts","../src/core/browsers/safari/BinaryCodableCookies.ts","../src/core/browsers/safari/BinaryCodablePage.ts","../src/core/browsers/safari/BinaryCodableCookie.ts","../src/types/schemas.ts","../src/core/browsers/safari/decodeBinaryCookies.ts","../src/cli/services/CookieStrategyFactory.ts"],"sourcesContent":["import { homedir } from \"os\";\n\nimport { config } from \"dotenv\";\nimport { z } from \"zod\";\n\n// Load environment variables from .env file\nconfig();\n\nconst EnvironmentSchema = z.object({\n LOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n HOME: z\n .string()\n .optional()\n .transform((val) => val ?? process.env.USERPROFILE ?? \"\")\n .pipe(z.string().min(1)),\n});\n\n/**\n * Validated environment variables with type safety and fallbacks\n * @example\n * // Using the environment variables\n * if (env.LOG_LEVEL === \"debug\") {\n * console.log(\"Debug mode enabled\");\n * }\n *\n * // Accessing home directory\n * const cookiePath = join(env.HOME, \"Library/Cookies\");\n */\nexport const env = EnvironmentSchema.parse({\n LOG_LEVEL: process.env.LOG_LEVEL,\n HOME: homedir(),\n});\n","import { createConsola } from \"consola\";\n\nimport { env } from \"../config\";\n\n/**\n * Standard log levels and their usage:\n * - debug: Detailed information for debugging\n * - info: General operational information\n * - success: Successful operations\n * - warn: Warning conditions\n * - error: Error conditions that might still allow the app to continue\n * - fatal: Critical errors that prevent the app from continuing\n */\nconst consola = createConsola({\n fancy: true,\n formatOptions: {\n showLogLevel: false,\n colors: true,\n date: false,\n compact: true,\n columns:\n typeof process.stdout.columns === \"number\" ? process.stdout.columns : 80,\n },\n level: env.LOG_LEVEL === \"debug\" ? 5 : 2,\n});\n\n/**\n * Indicates whether debug logging is enabled\n * @example\n * if (isDebug) {\n * logger.debug(\"Detailed debugging information\");\n * }\n */\nexport const isDebug = env.LOG_LEVEL === \"debug\";\n\n/**\n * Configured consola logger instance with standardized formatting and colored output.\n * Used for consistent logging throughout the application.\n * @example\n * // Basic usage\n * logger.info('Operation started');\n * logger.success('Task completed');\n * logger.error('Failed to process', error);\n *\n * // Tagged logging for module context\n * const moduleLogger = logger.withTag('ModuleName');\n * moduleLogger.info('Module specific log');\n *\n * // Structured logging\n * logger.info('User action', {\n * userId: '123',\n * action: 'login',\n * timestamp: new Date()\n * });\n *\n * // Error logging with full context\n * logger.error('Operation failed', {\n * error: error,\n * context: 'operation name',\n * input: data\n * });\n */\nexport default consola;\n","import logger from \"./logger\";\n\n/**\n * Helper functions for common logging patterns.\n * @module\n * @example\n * ```typescript\n * import { logOperationResult, logError } from './logHelpers';\n *\n * try {\n * const result = await someOperation();\n * logOperationResult('Operation', true, { data: result });\n * } catch (error) {\n * logError('Operation failed', error);\n * }\n * ```\n */\n\ninterface OperationContext {\n [key: string]: unknown;\n}\n\n/**\n * Logs the result of an operation with consistent formatting.\n * @param operation - Name of the operation.\n * @param success - Whether the operation succeeded.\n * @param [context] - Additional context about the operation.\n * @example\n * ```typescript\n * logOperationResult('Database Backup', true, { size: '1.2GB' });\n * // ✅ Database Backup succeeded\n *\n * logOperationResult('File Upload', false, { error: 'Network timeout' });\n * // ❌ File Upload failed\n * ```\n */\nexport function logOperationResult(\n operation: string,\n success: boolean,\n context?: OperationContext,\n): void {\n const icon = success ? \"✅\" : \"❌\";\n const message = `${icon} ${operation} ${success ? \"succeeded\" : \"failed\"}`;\n\n if (success) {\n logger.success(message, context);\n } else {\n logger.error(message, context);\n }\n}\n\n/**\n * Logs an error with consistent formatting and context.\n * @param message - Error message to display.\n * @param error - Error object or error information.\n * @param [context] - Additional context about the error.\n * @example\n * ```typescript\n * try {\n * throw new Error('Connection failed');\n * } catch (error) {\n * logError('Database error', error, { retries: 3 });\n * }\n * ```\n */\nexport function logError(\n message: string,\n error: unknown,\n context?: OperationContext,\n): void {\n const errorContext = {\n ...(context ?? {}),\n error:\n error instanceof Error\n ? {\n name: error.name,\n message: error.message,\n stack: error.stack,\n }\n : error,\n };\n\n logger.error(message, errorContext);\n}\n\n/**\n * Logs debug information with consistent formatting.\n * @param component - Component or module name.\n * @param message - Debug message to log.\n * @param [data] - Optional debug data to include.\n * @example\n * ```typescript\n * logDebug('AuthService', 'Token refresh started', { userId: '123' });\n * ```\n */\nexport function logDebug(\n component: string,\n message: string,\n data?: unknown,\n): void {\n const componentLogger = logger.withTag(component);\n componentLogger.debug(message, data);\n}\n\n/**\n * Creates a tagged logger with consistent naming.\n * @param component - Component or module name.\n * @returns A tagged logger instance.\n * @example\n * ```typescript\n * const dbLogger = createTaggedLogger('Database');\n * dbLogger.info('Connection established');\n * ```\n */\nexport function createTaggedLogger(\n component: string,\n): ReturnType<typeof logger.withTag> {\n return logger.withTag(component);\n}\n\n/**\n * Logs a warning with consistent formatting.\n * @param component - Component or module name.\n * @param message - Warning message to display.\n * @param [context] - Additional context about the warning.\n * @example\n * ```typescript\n * logWarn('Cache', 'Cache miss', { key: 'user-123' });\n * ```\n */\nexport function logWarn(\n component: string,\n message: string,\n context?: OperationContext,\n): void {\n const componentLogger = logger.withTag(component);\n componentLogger.warn(message, context);\n}\n\n// Re-export the base logger for direct usage\n/**\n * Re-export of the base logger for direct usage.\n */\nexport { default as logger } from \"./logger\";\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import Stack from './_Stack.js';\nimport baseIsEqual from './_baseIsEqual.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nexport default baseIsMatch;\n","import isObject from './isObject.js';\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nexport default isStrictComparable;\n","import isStrictComparable from './_isStrictComparable.js';\nimport keys from './keys.js';\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nexport default getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nexport default matchesStrictComparable;\n","import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nexport default baseMatches;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nexport default baseHasIn;\n","import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n","import baseHasIn from './_baseHasIn.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nexport default hasIn;\n","import baseIsEqual from './_baseIsEqual.js';\nimport get from './get.js';\nimport hasIn from './hasIn.js';\nimport isKey from './_isKey.js';\nimport isStrictComparable from './_isStrictComparable.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\nimport toKey from './_toKey.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nexport default baseMatchesProperty;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default baseProperty;\n","import baseGet from './_baseGet.js';\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nexport default basePropertyDeep;\n","import baseProperty from './_baseProperty.js';\nimport basePropertyDeep from './_basePropertyDeep.js';\nimport isKey from './_isKey.js';\nimport toKey from './_toKey.js';\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nexport default property;\n","import baseMatches from './_baseMatches.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\nimport property from './property.js';\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nexport default baseIteratee;\n","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nexport default arrayAggregator;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","import baseFor from './_baseFor.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nexport default baseForOwn;\n","import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n","import baseEach from './_baseEach.js';\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nexport default baseAggregator;\n","import arrayAggregator from './_arrayAggregator.js';\nimport baseAggregator from './_baseAggregator.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nexport default createAggregator;\n","import baseAssignValue from './_baseAssignValue.js';\nimport createAggregator from './_createAggregator.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n});\n\nexport default groupBy;\n","/**\n * @license\n * Lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"es\" -o ./`\n * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\nexport { default as add } from './add.js';\nexport { default as after } from './after.js';\nexport { default as ary } from './ary.js';\nexport { default as assign } from './assign.js';\nexport { default as assignIn } from './assignIn.js';\nexport { default as assignInWith } from './assignInWith.js';\nexport { default as assignWith } from './assignWith.js';\nexport { default as at } from './at.js';\nexport { default as attempt } from './attempt.js';\nexport { default as before } from './before.js';\nexport { default as bind } from './bind.js';\nexport { default as bindAll } from './bindAll.js';\nexport { default as bindKey } from './bindKey.js';\nexport { default as camelCase } from './camelCase.js';\nexport { default as capitalize } from './capitalize.js';\nexport { default as castArray } from './castArray.js';\nexport { default as ceil } from './ceil.js';\nexport { default as chain } from './chain.js';\nexport { default as chunk } from './chunk.js';\nexport { default as clamp } from './clamp.js';\nexport { default as clone } from './clone.js';\nexport { default as cloneDeep } from './cloneDeep.js';\nexport { default as cloneDeepWith } from './cloneDeepWith.js';\nexport { default as cloneWith } from './cloneWith.js';\nexport { default as commit } from './commit.js';\nexport { default as compact } from './compact.js';\nexport { default as concat } from './concat.js';\nexport { default as cond } from './cond.js';\nexport { default as conforms } from './conforms.js';\nexport { default as conformsTo } from './conformsTo.js';\nexport { default as constant } from './constant.js';\nexport { default as countBy } from './countBy.js';\nexport { default as create } from './create.js';\nexport { default as curry } from './curry.js';\nexport { default as curryRight } from './curryRight.js';\nexport { default as debounce } from './debounce.js';\nexport { default as deburr } from './deburr.js';\nexport { default as defaultTo } from './defaultTo.js';\nexport { default as defaults } from './defaults.js';\nexport { default as defaultsDeep } from './defaultsDeep.js';\nexport { default as defer } from './defer.js';\nexport { default as delay } from './delay.js';\nexport { default as difference } from './difference.js';\nexport { default as differenceBy } from './differenceBy.js';\nexport { default as differenceWith } from './differenceWith.js';\nexport { default as divide } from './divide.js';\nexport { default as drop } from './drop.js';\nexport { default as dropRight } from './dropRight.js';\nexport { default as dropRightWhile } from './dropRightWhile.js';\nexport { default as dropWhile } from './dropWhile.js';\nexport { default as each } from './each.js';\nexport { default as eachRight } from './eachRight.js';\nexport { default as endsWith } from './endsWith.js';\nexport { default as entries } from './entries.js';\nexport { default as entriesIn } from './entriesIn.js';\nexport { default as eq } from './eq.js';\nexport { default as escape } from './escape.js';\nexport { default as escapeRegExp } from './escapeRegExp.js';\nexport { default as every } from './every.js';\nexport { default as extend } from './extend.js';\nexport { default as extendWith } from './extendWith.js';\nexport { default as fill } from './fill.js';\nexport { default as filter } from './filter.js';\nexport { default as find } from './find.js';\nexport { default as findIndex } from './findIndex.js';\nexport { default as findKey } from './findKey.js';\nexport { default as findLast } from './findLast.js';\nexport { default as findLastIndex } from './findLastIndex.js';\nexport { default as findLastKey } from './findLastKey.js';\nexport { default as first } from './first.js';\nexport { default as flatMap } from './flatMap.js';\nexport { default as flatMapDeep } from './flatMapDeep.js';\nexport { default as flatMapDepth } from './flatMapDepth.js';\nexport { default as flatten } from './flatten.js';\nexport { default as flattenDeep } from './flattenDeep.js';\nexport { default as flattenDepth } from './flattenDepth.js';\nexport { default as flip } from './flip.js';\nexport { default as floor } from './floor.js';\nexport { default as flow } from './flow.js';\nexport { default as flowRight } from './flowRight.js';\nexport { default as forEach } from './forEach.js';\nexport { default as forEachRight } from './forEachRight.js';\nexport { default as forIn } from './forIn.js';\nexport { default as forInRight } from './forInRight.js';\nexport { default as forOwn } from './forOwn.js';\nexport { default as forOwnRight } from './forOwnRight.js';\nexport { default as fromPairs } from './fromPairs.js';\nexport { default as functions } from './functions.js';\nexport { default as functionsIn } from './functionsIn.js';\nexport { default as get } from './get.js';\nexport { default as groupBy } from './groupBy.js';\nexport { default as gt } from './gt.js';\nexport { default as gte } from './gte.js';\nexport { default as has } from './has.js';\nexport { default as hasIn } from './hasIn.js';\nexport { default as head } from './head.js';\nexport { default as identity } from './identity.js';\nexport { default as inRange } from './inRange.js';\nexport { default as includes } from './includes.js';\nexport { default as indexOf } from './indexOf.js';\nexport { default as initial } from './initial.js';\nexport { default as intersection } from './intersection.js';\nexport { default as intersectionBy } from './intersectionBy.js';\nexport { default as intersectionWith } from './intersectionWith.js';\nexport { default as invert } from './invert.js';\nexport { default as invertBy } from './invertBy.js';\nexport { default as invoke } from './invoke.js';\nexport { default as invokeMap } from './invokeMap.js';\nexport { default as isArguments } from './isArguments.js';\nexport { default as isArray } from './isArray.js';\nexport { default as isArrayBuffer } from './isArrayBuffer.js';\nexport { default as isArrayLike } from './isArrayLike.js';\nexport { default as isArrayLikeObject } from './isArrayLikeObject.js';\nexport { default as isBoolean } from './isBoolean.js';\nexport { default as isBuffer } from './isBuffer.js';\nexport { default as isDate } from './isDate.js';\nexport { default as isElement } from './isElement.js';\nexport { default as isEmpty } from './isEmpty.js';\nexport { default as isEqual } from './isEqual.js';\nexport { default as isEqualWith } from './isEqualWith.js';\nexport { default as isError } from './isError.js';\nexport { default as isFinite } from './isFinite.js';\nexport { default as isFunction } from './isFunction.js';\nexport { default as isInteger } from './isInteger.js';\nexport { default as isLength } from './isLength.js';\nexport { default as isMap } from './isMap.js';\nexport { default as isMatch } from './isMatch.js';\nexport { default as isMatchWith } from './isMatchWith.js';\nexport { default as isNaN } from './isNaN.js';\nexport { default as isNative } from './isNative.js';\nexport { default as isNil } from './isNil.js';\nexport { default as isNull } from './isNull.js';\nexport { default as isNumber } from './isNumber.js';\nexport { default as isObject } from './isObject.js';\nexport { default as isObjectLike } from './isObjectLike.js';\nexport { default as isPlainObject } from './isPlainObject.js';\nexport { default as isRegExp } from './isRegExp.js';\nexport { default as isSafeInteger } from './isSafeInteger.js';\nexport { default as isSet } from './isSet.js';\nexport { default as isString } from './isString.js';\nexport { default as isSymbol } from './isSymbol.js';\nexport { default as isTypedArray } from './isTypedArray.js';\nexport { default as isUndefined } from './isUndefined.js';\nexport { default as isWeakMap } from './isWeakMap.js';\nexport { default as isWeakSet } from './isWeakSet.js';\nexport { default as iteratee } from './iteratee.js';\nexport { default as join } from './join.js';\nexport { default as kebabCase } from './kebabCase.js';\nexport { default as keyBy } from './keyBy.js';\nexport { default as keys } from './keys.js';\nexport { default as keysIn } from './keysIn.js';\nexport { default as last } from './last.js';\nexport { default as lastIndexOf } from './lastIndexOf.js';\nexport { default as lodash } from './wrapperLodash.js';\nexport { default as lowerCase } from './lowerCase.js';\nexport { default as lowerFirst } from './lowerFirst.js';\nexport { default as lt } from './lt.js';\nexport { default as lte } from './lte.js';\nexport { default as map } from './map.js';\nexport { default as mapKeys } from './mapKeys.js';\nexport { default as mapValues } from './mapValues.js';\nexport { default as matches } from './matches.js';\nexport { default as matchesProperty } from './matchesProperty.js';\nexport { default as max } from './max.js';\nexport { default as maxBy } from './maxBy.js';\nexport { default as mean } from './mean.js';\nexport { default as meanBy } from './meanBy.js';\nexport { default as memoize } from './memoize.js';\nexport { default as merge } from './merge.js';\nexport { default as mergeWith } from './mergeWith.js';\nexport { default as method } from './method.js';\nexport { default as methodOf } from './methodOf.js';\nexport { default as min } from './min.js';\nexport { default as minBy } from './minBy.js';\nexport { default as mixin } from './mixin.js';\nexport { default as multiply } from './multiply.js';\nexport { default as negate } from './negate.js';\nexport { default as next } from './next.js';\nexport { default as noop } from './noop.js';\nexport { default as now } from './now.js';\nexport { default as nth } from './nth.js';\nexport { default as nthArg } from './nthArg.js';\nexport { default as omit } from './omit.js';\nexport { default as omitBy } from './omitBy.js';\nexport { default as once } from './once.js';\nexport { default as orderBy } from './orderBy.js';\nexport { default as over } from './over.js';\nexport { default as overArgs } from './overArgs.js';\nexport { default as overEvery } from './overEvery.js';\nexport { default as overSome } from './overSome.js';\nexport { default as pad } from './pad.js';\nexport { default as padEnd } from './padEnd.js';\nexport { default as padStart } from './padStart.js';\nexport { default as parseInt } from './parseInt.js';\nexport { default as partial } from './partial.js';\nexport { default as partialRight } from './partialRight.js';\nexport { default as partition } from './partition.js';\nexport { default as pick } from './pick.js';\nexport { default as pickBy } from './pickBy.js';\nexport { default as plant } from './plant.js';\nexport { default as property } from './property.js';\nexport { default as propertyOf } from './propertyOf.js';\nexport { default as pull } from './pull.js';\nexport { default as pullAll } from './pullAll.js';\nexport { default as pullAllBy } from './pullAllBy.js';\nexport { default as pullAllWith } from './pullAllWith.js';\nexport { default as pullAt } from './pullAt.js';\nexport { default as random } from './random.js';\nexport { default as range } from './range.js';\nexport { default as rangeRight } from './rangeRight.js';\nexport { default as rearg } from './rearg.js';\nexport { default as reduce } from './reduce.js';\nexport { default as reduceRight } from './reduceRight.js';\nexport { default as reject } from './reject.js';\nexport { default as remove } from './remove.js';\nexport { default as repeat } from './repeat.js';\nexport { default as replace } from './replace.js';\nexport { default as rest } from './rest.js';\nexport { default as result } from './result.js';\nexport { default as reverse } from './reverse.js';\nexport { default as round } from './round.js';\nexport { default as sample } from './sample.js';\nexport { default as sampleSize } from './sampleSize.js';\nexport { default as set } from './set.js';\nexport { default as setWith } from './setWith.js';\nexport { default as shuffle } from './shuffle.js';\nexport { default as size } from './size.js';\nexport { default as slice } from './slice.js';\nexport { default as snakeCase } from './snakeCase.js';\nexport { default as some } from './some.js';\nexport { default as sortBy } from './sortBy.js';\nexport { default as sortedIndex } from './sortedIndex.js';\nexport { default as sortedIndexBy } from './sortedIndexBy.js';\nexport { default as sortedIndexOf } from './sortedIndexOf.js';\nexport { default as sortedLastIndex } from './sortedLastIndex.js';\nexport { default as sortedLastIndexBy } from './sortedLastIndexBy.js';\nexport { default as sortedLastIndexOf } from './sortedLastIndexOf.js';\nexport { default as sortedUniq } from './sortedUniq.js';\nexport { default as sortedUniqBy } from './sortedUniqBy.js';\nexport { default as split } from './split.js';\nexport { default as spread } from './spread.js';\nexport { default as startCase } from './startCase.js';\nexport { default as startsWith } from './startsWith.js';\nexport { default as stubArray } from './stubArray.js';\nexport { default as stubFalse } from './stubFalse.js';\nexport { default as stubObject } from './stubObject.js';\nexport { default as stubString } from './stubString.js';\nexport { default as stubTrue } from './stubTrue.js';\nexport { default as subtract } from './subtract.js';\nexport { default as sum } from './sum.js';\nexport { default as sumBy } from './sumBy.js';\nexport { default as tail } from './tail.js';\nexport { default as take } from './take.js';\nexport { default as takeRight } from './takeRight.js';\nexport { default as takeRightWhile } from './takeRightWhile.js';\nexport { default as takeWhile } from './takeWhile.js';\nexport { default as tap } from './tap.js';\nexport { default as template } from './template.js';\nexport { default as templateSettings } from './templateSettings.js';\nexport { default as throttle } from './throttle.js';\nexport { default as thru } from './thru.js';\nexport { default as times } from './times.js';\nexport { default as toArray } from './toArray.js';\nexport { default as toFinite } from './toFinite.js';\nexport { default as toInteger } from './toInteger.js';\nexport { default as toIterator } from './toIterator.js';\nexport { default as toJSON } from './toJSON.js';\nexport { default as toLength } from './toLength.js';\nexport { default as toLower } from './toLower.js';\nexport { default as toNumber } from './toNumber.js';\nexport { default as toPairs } from './toPairs.js';\nexport { default as toPairsIn } from './toPairsIn.js';\nexport { default as toPath } from './toPath.js';\nexport { default as toPlainObject } from './toPlainObject.js';\nexport { default as toSafeInteger } from './toSafeInteger.js';\nexport { default as toString } from './toString.js';\nexport { default as toUpper } from './toUpper.js';\nexport { default as transform } from './transform.js';\nexport { default as trim } from './trim.js';\nexport { default as trimEnd } from './trimEnd.js';\nexport { default as trimStart } from './trimStart.js';\nexport { default as truncate } from './truncate.js';\nexport { default as unary } from './unary.js';\nexport { default as unescape } from './unescape.js';\nexport { default as union } from './union.js';\nexport { default as unionBy } from './unionBy.js';\nexport { default as unionWith } from './unionWith.js';\nexport { default as uniq } from './uniq.js';\nexport { default as uniqBy } from './uniqBy.js';\nexport { default as uniqWith } from './uniqWith.js';\nexport { default as uniqueId } from './uniqueId.js';\nexport { default as unset } from './unset.js';\nexport { default as unzip } from './unzip.js';\nexport { default as unzipWith } from './unzipWith.js';\nexport { default as update } from './update.js';\nexport { default as updateWith } from './updateWith.js';\nexport { default as upperCase } from './upperCase.js';\nexport { default as upperFirst } from './upperFirst.js';\nexport { default as value } from './value.js';\nexport { default as valueOf } from './valueOf.js';\nexport { default as values } from './values.js';\nexport { default as valuesIn } from './valuesIn.js';\nexport { default as without } from './without.js';\nexport { default as words } from './words.js';\nexport { default as wrap } from './wrap.js';\nexport { default as wrapperAt } from './wrapperAt.js';\nexport { default as wrapperChain } from './wrapperChain.js';\nexport { default as wrapperCommit } from './commit.js';\nexport { default as wrapperLodash } from './wrapperLodash.js';\nexport { default as wrapperNext } from './next.js';\nexport { default as wrapperPlant } from './plant.js';\nexport { default as wrapperReverse } from './wrapperReverse.js';\nexport { default as wrapperToIterator } from './toIterator.js';\nexport { default as wrapperValue } from './wrapperValue.js';\nexport { default as xor } from './xor.js';\nexport { default as xorBy } from './xorBy.js';\nexport { default as xorWith } from './xorWith.js';\nexport { default as zip } from './zip.js';\nexport { default as zipObject } from './zipObject.js';\nexport { default as zipObjectDeep } from './zipObjectDeep.js';\nexport { default as zipWith } from './zipWith.js';\nexport { default } from './lodash.default.js';\n","// External imports\nimport { exec, ExecOptions } from \"child_process\";\nimport { promisify } from \"util\";\n\n// Internal imports\nimport { logError } from \"@utils/logHelpers\";\n\nconst execPromise = promisify(exec);\n\n/**\n * Custom error class for command execution failures.\n * @property {string} command - The command that failed to execute\n * @property {Error} [originalError] - The underlying error that caused the failure\n * @throws CommandExecutionError Always throws with appropriate error context\n * @example\n * ```typescript\n * throw new CommandExecutionError(\n * 'Command timed out',\n * 'git status',\n * originalError\n * );\n * ```\n */\nclass CommandExecutionError extends Error {\n public constructor(\n message: string,\n public readonly command: string,\n public readonly originalError?: Error,\n ) {\n super(message);\n this.name = \"CommandExecutionError\";\n }\n}\n\n/**\n * Handles execution errors and throws appropriate CommandExecutionError.\n * @internal\n * @param error - The error that occurred during command execution\n * @param command - The command that was being executed when the error occurred\n * @throws CommandExecutionError Always throws with appropriate error context\n * @example\n * ```typescript\n * try {\n * await execPromise('invalid-command');\n * } catch (error) {\n * handleExecutionError(error, 'invalid-command');\n * }\n * ```\n */\nfunction handleExecutionError(error: unknown, command: string): never {\n if (error instanceof CommandExecutionError) {\n logError(\"Command execution failed\", error, {\n command: error.command,\n originalError: error.originalError,\n });\n throw error;\n }\n\n if (error instanceof Error) {\n const commandError = new CommandExecutionError(\n error.message,\n command,\n error,\n );\n logError(\"Failed to execute command\", error, {\n command,\n stack: error.stack,\n });\n throw commandError;\n }\n\n // Handle unknown error types\n const commandError = new CommandExecutionError(\n \"Unknown error occurred during command execution\",\n command,\n );\n logError(\"Failed to execute command\", null, {\n error,\n command,\n });\n throw commandError;\n}\n\n/**\n * Executes a shell command asynchronously and returns its output as a string.\n * @param command - The shell command to execute\n * @param options - Optional execution options that override the defaults\n * @returns A promise that resolves to the trimmed command output\n * @throws CommandExecutionError if the command returns an empty result, times out, or fails to execute\n * @example\n * ```typescript\n * // Basic usage\n * const gitStatus = await execSimple('git status');\n *\n * // With custom timeout\n * const output = await execSimple('long-running-command', { timeout: 60000 });\n *\n * // Error handling\n * try {\n * const result = await execSimple('git push');\n * } catch (error) {\n * if (error instanceof CommandExecutionError) {\n * console.error('Push failed:', error.message);\n * }\n * }\n * ```\n */\nexport async function execSimple(\n command: string,\n options: Partial<ExecOptions> = {},\n): Promise<string> {\n if (!command || typeof command !== \"string\") {\n throw new CommandExecutionError(\n \"Command must be a non-empty string\",\n command,\n );\n }\n\n const defaultOptions = {\n encoding: \"utf8\" as BufferEncoding,\n maxBuffer: 5 * 1024 * 1024, // 5MB buffer\n timeout: 30000, // 30 second timeout\n };\n\n try {\n const { stdout, stderr } = await execPromise(command, {\n ...defaultOptions,\n ...options,\n });\n const result = stdout.trim();\n\n if (!result) {\n if (stderr) {\n throw new CommandExecutionError(\n `Command failed with stderr: ${stderr}`,\n command,\n );\n }\n throw new CommandExecutionError(\"Command returned empty result\", command);\n }\n\n return result;\n } catch (error) {\n handleExecutionError(error, command);\n }\n}\n","import { memoize } from \"lodash-es\";\n\nimport { execSimple } from \"@utils/execSimple\";\n\n/**\n * Retrieves the Chrome Safe Storage password from the macOS keychain\n * @returns A promise that resolves to the Chrome Safe Storage password\n * @throws {Error} If the password cannot be retrieved from the keychain\n */\nconst getChromeSafeStoragePassword = async (): Promise<string> => {\n const command = 'security find-generic-password -w -s \"Chrome Safe Storage\"';\n return execSimple(command);\n};\n\n/**\n * Memoized version of getChromeSafeStoragePassword that caches the result\n * to avoid repeated keychain queries\n * @returns A promise that resolves to the Chrome Safe Storage password\n * @throws {Error} If the password cannot be retrieved from the keychain\n * @example\n */\nexport const getChromePassword: () => Promise<string> = memoize(\n getChromeSafeStoragePassword,\n);\n","import type { CookieSpec } from \"../../types/schemas\";\n\n/**\n * Process a domain into cookie specifications, including parent domains\n * @internal\n * @param domain - The domain to process (e.g., 'api.example.com')\n * @returns Array of cookie specifications for the domain and its parents\n */\nfunction processDomainsIntoCookieSpecs(domain: string): CookieSpec[] {\n const parts = domain.split(\".\");\n const cookieSpecs: CookieSpec[] = [];\n\n /**\n * Add the full domain first to ensure exact matches are prioritized\n * The '%' wildcard in the name field matches any cookie name for this domain\n */\n cookieSpecs.push({\n name: \"%\",\n domain: domain,\n });\n\n /**\n * Add parent domains to support domain-level cookie matching\n * For example, for 'sub.example.com', we also want to match 'example.com'\n * This is important because cookies can be set at parent domain levels\n */\n for (let i = 1; i < parts.length - 1; i++) {\n const subDomain = parts.slice(i).join(\".\");\n cookieSpecs.push({\n name: \"%\",\n domain: subDomain,\n });\n }\n\n return cookieSpecs;\n}\n\n/**\n * Generate cookie specifications from a URL by creating specs for both the exact domain\n * and its parent domains. This allows for proper cookie matching across domain levels.\n * @param url - The URL to generate cookie specs from (e.g., 'https://example.com' or just 'example.com')\n * @returns An array of cookie specifications for the URL and its parent domains\n * @remarks\n * - If the URL is provided without a protocol, it will first try to parse with 'https://' prefix\n * - If parsing fails, it will treat the input as a plain domain name\n * - The function handles invalid URLs gracefully by treating them as domain names\n * - The '%' wildcard is used for the name to match all cookies for the domain\n * @example\n * ```typescript\n * // Basic URL with protocol\n * cookieSpecsFromUrl('https://example.com')\n * // Returns: [{ name: '%', domain: 'example.com' }]\n *\n * // URL with subdomain\n * cookieSpecsFromUrl('https://api.example.com')\n * // Returns: [\n * // { name: '%', domain: 'api.example.com' },\n * // { name: '%', domain: 'example.com' }\n * // ]\n *\n * // Domain without protocol (automatically handled)\n * cookieSpecsFromUrl('example.com')\n * // Returns: [{ name: '%', domain: 'example.com' }]\n * ```\n */\nexport function cookieSpecsFromUrl(url: string): CookieSpec[] {\n // For URLs without protocol, try adding https://\n if (!url.includes(\"://\")) {\n try {\n return cookieSpecsFromUrl(`https://${url}`);\n } catch {\n // If adding protocol fails, treat as domain name\n return [\n {\n name: \"%\",\n domain: url,\n },\n ];\n }\n }\n\n try {\n const urlObj = new URL(url);\n return processDomainsIntoCookieSpecs(urlObj.hostname);\n } catch (_error) {\n /**\n * Fallback handling for any parsing errors\n * This ensures the function remains robust even with invalid input\n * Returns a single spec treating the entire input as a domain name\n */\n return [\n {\n name: \"%\",\n domain: url,\n },\n ];\n }\n}\n","import minimist from \"minimist\";\n\n/**\n * Interface representing parsed command line arguments.\n * @property values - Record of option values parsed from command line\n * @property positionals - Array of positional arguments\n * @example\n * ```typescript\n * const args: ParsedArgs = {\n * values: {\n * browser: 'chrome',\n * profile: 'default',\n * verbose: true\n * },\n * positionals: ['script.js', 'input.txt']\n * }\n * ```\n */\ninterface ParsedArgs {\n /** Record of option values parsed from command line */\n values: Record<string, string | boolean | string[]>;\n /** Array of positional arguments */\n positionals: string[];\n}\n\n/**\n * Parses command line arguments into a structured format.\n * @internal\n * @param argv - Array of command line arguments to parse\n * @returns Parsed command line arguments object\n * @example\n * ```typescript\n * // Basic usage\n * const args = parseArgv(['--browser', 'chrome', '--verbose', 'script.js']);\n * // Returns: { values: { browser: 'chrome', verbose: true }, positionals: ['script.js'] }\n *\n * // Using short options\n * const args = parseArgv(['-b', 'firefox', '-v', 'script.js']);\n * // Returns: { values: { browser: 'firefox', verbose: true }, positionals: ['script.js'] }\n *\n * // Error handling\n * const args = parseArgv(['--invalid']); // Will throw error for unknown option\n * ```\n */\nexport function parseArgv(argv: string[]): ParsedArgs {\n const parsed = minimist(argv, {\n string: [\"browser\", \"profile\", \"url\", \"domain\", \"name\", \"output\"],\n boolean: [\n \"help\",\n \"version\",\n \"verbose\",\n \"dump\",\n \"dump-grouped\",\n \"render\",\n \"render-grouped\",\n ],\n alias: {\n b: \"browser\",\n p: \"profile\",\n u: \"url\",\n d: \"domain\",\n n: \"name\",\n h: \"help\",\n v: \"version\",\n D: \"dump-grouped\",\n r: \"render\",\n R: \"render-grouped\",\n },\n });\n\n const { _, ...values } = parsed;\n return { values, positionals: _ };\n}\n","#!/usr/bin/env node\n\n// Local imports - core\nimport { cookieSpecsFromUrl } from \"@core/cookies/cookieSpecsFromUrl\";\nimport { parseArgv } from \"@utils/argv\";\nimport logger from \"@utils/logger\";\n\nimport type { CookieSpec } from \"../types/schemas\";\n\nimport { cliQueryCookies } from \"./cliQueryCookies\";\n\nfunction showHelp(): void {\n logger.log(`Usage: get-cookie [name] [domain] [options]`);\n logger.log(`Options:`);\n logger.log(` -h, --help: Show this help message`);\n logger.log(` -v, --verbose: Enable verbose output`);\n logger.log(` -d, --dump: Dump all results`);\n logger.log(` -D, --dump-grouped: Dump all results, grouped by profile`);\n logger.log(` -r, --render: Render all results`);\n logger.log(` -u, --url: URL to extract cookie specs from`);\n logger.log(` -n, --name: Cookie name pattern`);\n logger.log(` -d, --domain: Cookie domain pattern`);\n logger.log(` --output: Output format (e.g., json)`);\n}\n\nfunction createCookieSpec(name: string, domain: string): CookieSpec {\n return {\n name: name || \"%\",\n domain: domain || \"%\",\n };\n}\n\nfunction getCookieSpecs(\n values: Record<string, string | boolean | string[]>,\n positionals: string[],\n): CookieSpec[] {\n const url = values.url as string | undefined;\n\n if (typeof url === \"string\") {\n const specs = cookieSpecsFromUrl(url);\n if (!Array.isArray(specs)) {\n logger.error(\"Invalid cookie specs from URL\");\n return [];\n }\n return specs;\n }\n\n const name = (values.name as string) || positionals[0] || \"%\";\n const domain = (values.domain as string) || positionals[1] || \"%\";\n return [createCookieSpec(name, domain)];\n}\n\nasync function handleCookieQuery(\n values: Record<string, string | boolean | string[]>,\n positionals: string[],\n): Promise<void> {\n const cookieSpecs = getCookieSpecs(values, positionals);\n\n if (values.verbose === true) {\n logger.log(\"cookieSpecs\", cookieSpecs);\n }\n\n try {\n await cliQueryCookies(\n values,\n cookieSpecs,\n undefined,\n values.removeExpired === true,\n );\n } catch (error) {\n if (error instanceof Error) {\n logger.error(\"Error querying cookies:\", error.message);\n } else {\n logger.error(\"An unknown error occurred while querying cookies\");\n }\n }\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n const { values, positionals } = parseArgv(args);\n\n if (values.help === true) {\n showHelp();\n return;\n }\n\n await handleCookieQuery(values, positionals);\n}\n\nmain().catch((error) => {\n if (error instanceof Error) {\n logger.error(\"Fatal error:\", error.message);\n } else {\n logger.error(\"An unknown fatal error occurred\");\n }\n process.exit(1);\n});\n","import type { CookieSpec, ExportedCookie } from \"../types/schemas\";\nimport { logger } from \"../utils/logHelpers\";\n\nimport { OutputHandlerFactory } from \"./handlers/OutputHandlerFactory\";\nimport { filterExpired } from \"./services/CookieExpiryService\";\nimport { CookieQueryService } from \"./services/CookieQueryService\";\nimport { CookieStrategyFactory } from \"./services/CookieStrategyFactory\";\n\n/**\n * Query cookies from multiple specs and apply limit\n * @param queryService - The cookie query service\n * @param specs - The cookie specifications to query for\n * @param limit - Optional limit on number of cookies to return\n * @returns Array of exported cookies\n */\nasync function queryCookiesWithLimit(\n queryService: CookieQueryService,\n specs: CookieSpec[],\n limit?: number,\n): Promise<ExportedCookie[]> {\n let results: ExportedCookie[] = [];\n\n for (const spec of specs) {\n const cookies = await queryService.queryCookies(spec, limit);\n results.push(...cookies);\n if (typeof limit === \"number\" && limit > 0 && results.length >= limit) {\n results = results.slice(0, limit);\n break;\n }\n }\n\n return results;\n}\n\n/**\n * Query cookies from the browser using the specified strategy\n * @param args - The command line arguments\n * @param cookieSpec - The cookie specification to query for\n * @param limit - The maximum number of cookies to return\n * @param removeExpired - Whether to remove expired cookies\n */\nexport async function cliQueryCookies(\n args: Record<string, unknown>,\n cookieSpec: CookieSpec | CookieSpec[],\n limit?: number,\n removeExpired = false,\n): Promise<void> {\n try {\n const browser = typeof args.browser === \"string\" ? args.browser : undefined;\n const strategy = CookieStrategyFactory.createStrategy(browser);\n const queryService = new CookieQueryService(strategy);\n\n const specs = Array.isArray(cookieSpec) ? cookieSpec : [cookieSpec];\n let results = await queryCookiesWithLimit(queryService, specs, limit);\n\n if (removeExpired === true) {\n results = filterExpired(results);\n }\n\n if (results.length === 0) {\n logger.error(\"No results\");\n return;\n }\n\n const outputHandlerFactory = new OutputHandlerFactory();\n const handler = outputHandlerFactory.getHandler(args);\n void handler.handle(results);\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error(\"An unknown error occurred\");\n }\n }\n}\n","import logger from \"@utils/logger\";\n\nimport { ExportedCookie } from \"../../types/schemas\";\n\nimport { OutputHandler, ParsedArgs } from \"./types\";\n\n/**\n * Default handler for cookie output when no specific format is requested\n * @example\n * ```typescript\n * const handler = new DefaultOutputHandler();\n * handler.handle([\n * { name: 'session', domain: 'example.com', value: 'abc123' },\n * { name: 'auth', domain: 'api.example.com', value: 'xyz789' }\n * ]);\n * // Outputs:\n * // abc123\n * // xyz789\n * ```\n */\nexport class DefaultOutputHandler implements OutputHandler {\n /**\n * Always returns true as this is the default handler\n * @param _args - The parsed command line arguments\n * @returns Always returns true\n * @example\n * ```typescript\n * const handler = new DefaultOutputHandler();\n * const canHandle = handler.canHandle({ format: 'default' }); // true\n * ```\n */\n public canHandle(_args: ParsedArgs): boolean {\n return true;\n }\n\n /**\n * Outputs unique cookie values\n * @param results - Array of exported cookies to output\n * @example\n * ```typescript\n * const handler = new DefaultOutputHandler();\n * handler.handle([\n * { name: 'session', domain: 'example.com', value: 'abc123' },\n * { name: 'auth', domain: 'example.com', value: 'abc123' }, // Duplicate value\n * { name: 'token', domain: 'api.example.com', value: 'xyz789' }\n * ]);\n * // Outputs only unique values:\n * // abc123\n * // xyz789\n * ```\n */\n public handle(results: ExportedCookie[]): void {\n const uniqueValues = new Set(\n results.map((result) => result.value as string),\n );\n for (const value of uniqueValues) {\n logger.log(value);\n }\n }\n}\n","import logger from \"@utils/logger\";\n\nimport { ExportedCookie } from \"../../types/schemas\";\n\nimport { OutputHandler, ParsedArgs } from \"./types\";\n\n/**\n * Handles raw dump output of cookie data\n * @example\n * ```typescript\n * const handler = new DumpOutputHandler();\n * handler.handle([\n * { name: 'session', domain: 'example.com', value: 'abc123' },\n * { name: 'auth', domain: 'api.example.com', value: 'xyz789' }\n * ]);\n * // Outputs the full cookie objects:\n * // [\n * // { name: 'session', domain: 'example.com', value: 'abc123' },\n * // { name: 'auth', domain: 'api.example.com', value: 'xyz789' }\n * // ]\n * ```\n */\nexport class DumpOutputHandler implements OutputHandler {\n /**\n * Checks if this handler should be used based on dump flags\n * @param args - The parsed command line arguments\n * @returns True if dump flags are set\n * @example\n * ```typescript\n * const handler = new DumpOutputHandler();\n * handler.canHandle({ dump: true }); // true\n * handler.canHandle({ d: true }); // true\n * handler.canHandle({}); // false\n * ```\n */\n public canHandle(args: ParsedArgs): boolean {\n return args.dump === true || args.d === true;\n }\n\n /**\n * Outputs the raw cookie data\n * @param results - Array of exported cookies to output\n * @example\n * ```typescript\n * const handler = new DumpOutputHandler();\n * handler.handle([{\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * meta: {\n * file: '/path/to/cookies.db',\n * browser: 'Chrome'\n * }\n * }]);\n * // Outputs the full cookie object with all properties\n * ```\n */\n public handle(results: ExportedCookie[]): void {\n logger.log(results);\n }\n}\n","import { groupBy } from \"lodash-es\";\n\nimport logger from \"@utils/logger\";\n\nimport { ExportedCookie } from \"../../types/schemas\";\n\nimport { OutputHandler, ParsedArgs } from \"./types\";\n\n/**\n * Handles grouped dump output of cookie data\n * @example\n * ```typescript\n * const handler = new GroupedDumpOutputHandler();\n * handler.handle([\n * {\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * meta: { file: '/path/to/cookies1.db' }\n * },\n * {\n * name: 'auth',\n * domain: 'api.example.com',\n * value: 'xyz789',\n * meta: { file: '/path/to/cookies2.db' }\n * }\n * ]);\n * // Outputs cookies grouped by file:\n * // {\n * // \"/path/to/cookies1.db\": [\n * // { name: \"session\", domain: \"example.com\", value: \"abc123\", ... }\n * // ],\n * // \"/path/to/cookies2.db\": [\n * // { name: \"auth\", domain: \"api.example.com\", value: \"xyz789\", ... }\n * // ]\n * // }\n * ```\n */\nexport class GroupedDumpOutputHandler implements OutputHandler {\n /**\n * Checks if this handler should be used based on grouped dump flags\n * @param args - The parsed command line arguments\n * @returns True if grouped dump flags are set\n * @example\n * ```typescript\n * const handler = new GroupedDumpOutputHandler();\n * handler.canHandle({ 'dump-grouped': true }); // true\n * handler.canHandle({ D: true }); // true\n * handler.canHandle({}); // false\n * ```\n */\n public canHandle(args: ParsedArgs): boolean {\n return args[\"dump-grouped\"] === true || args.D === true;\n }\n\n /**\n * Outputs the cookie data grouped by source file\n * @param results - Array of exported cookies to output\n * @example\n * ```typescript\n * const handler = new GroupedDumpOutputHandler();\n * handler.handle([\n * {\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * meta: { file: '/path/to/chrome/cookies.db' }\n * },\n * {\n * name: 'auth',\n * domain: 'example.com',\n * value: 'xyz789',\n * meta: { file: '/path/to/firefox/cookies.sqlite' }\n * }\n * ]);\n * // Groups and outputs cookies by their source file\n * ```\n */\n public handle(results: ExportedCookie[]): void {\n const groupedByFile = groupBy(results, (r) => r.meta?.file ?? \"unknown\");\n logger.log(JSON.stringify(groupedByFile, null, 2));\n }\n}\n","import { groupBy } from \"lodash-es\";\n\nimport { ExportedCookie, RenderOptions } from \"../../types/schemas\";\n\n/**\n * Renders cookies as a string or array of strings based on the provided format option.\n * Supports merged format for single string output or grouped format for file-based grouping.\n * @param cookies - The cookies to render\n * @param options - Options for rendering\n * @param options.format - The output format ('merged' or 'grouped')\n * @param options.showFilePaths - Whether to include file paths in grouped output\n * @param options.separator - Custom separator for cookie values\n * @returns A string for merged format, or array of strings for grouped format\n * @example\n * ```typescript\n * // Merged format (default)\n * const cookies = [\n * { value: 'sessionId=abc123' },\n * { value: 'theme=dark' }\n * ];\n * renderCookies(cookies);\n * // Returns: \"sessionId=abc123; theme=dark\"\n *\n * // Grouped format with file paths\n * const groupedCookies = [\n * { value: 'sessionId=abc123', meta: { file: 'auth.ts' } },\n * { value: 'theme=dark', meta: { file: 'preferences.ts' } }\n * ];\n * renderCookies(groupedCookies, { format: 'grouped', showFilePaths: true });\n * // Returns: [\"auth.ts: sessionId=abc123\", \"preferences.ts: theme=dark\"]\n * ```\n */\nexport function renderCookies(\n cookies: ExportedCookie[],\n options: RenderOptions = {},\n): string | string[] {\n const { format = \"merged\", showFilePaths = true, separator = \"; \" } = options;\n\n if (cookies.length === 0) {\n return format === \"merged\" ? \"\" : [];\n }\n\n if (format === \"merged\") {\n return cookies.map((c) => c.value as string).join(separator);\n }\n\n const groupedByFile = groupBy(cookies, (c) => c.meta?.file ?? \"unknown\");\n return Object.entries(groupedByFile).map(([file, fileCookies]) => {\n const values = fileCookies.map((c) => c.value as string).join(separator);\n return showFilePaths ? `${file}: ${values}` : values;\n });\n}\n","import { renderCookies } from \"@core/cookies/renderCookies\";\nimport logger from \"@utils/logger\";\n\nimport { ExportedCookie } from \"../../types/schemas\";\n\nimport { OutputHandler, ParsedArgs } from \"./types\";\n\n/**\n * Handles grouped render output of cookie data\n * @example\n * ```typescript\n * const handler = new GroupedRenderOutputHandler();\n * handler.handle([\n * {\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * meta: { file: '/path/to/cookies1.db' }\n * },\n * {\n * name: 'auth',\n * domain: 'api.example.com',\n * value: 'xyz789',\n * meta: { file: '/path/to/cookies2.db' }\n * }\n * ]);\n * // Outputs cookies in a grouped format:\n * // /path/to/cookies1.db:\n * // example.com:\n * // session=abc123\n * // /path/to/cookies2.db:\n * // api.example.com:\n * // auth=xyz789\n * ```\n */\nexport class GroupedRenderOutputHandler implements OutputHandler {\n /**\n * Checks if this handler should be used based on grouped render flags\n * @param args - The parsed command line arguments\n * @returns True if grouped render flags are set\n * @example\n * ```typescript\n * const handler = new GroupedRenderOutputHandler();\n * handler.canHandle({ 'render-grouped': true }); // true\n * handler.canHandle({ R: true }); // true\n * handler.canHandle({}); // false\n * ```\n */\n public canHandle(args: ParsedArgs): boolean {\n return args[\"render-grouped\"] === true || args.R === true;\n }\n\n /**\n * Outputs the cookie data in a grouped format\n * @param results - Array of exported cookies to output\n * @example\n * ```typescript\n * const handler = new GroupedRenderOutputHandler();\n * handler.handle([\n * {\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * meta: { file: '/path/to/chrome/cookies.db' }\n * },\n * {\n * name: 'auth',\n * domain: 'example.com',\n * value: 'xyz789',\n * meta: { file: '/path/to/firefox/cookies.sqlite' }\n * }\n * ]);\n * // Outputs:\n * // /path/to/chrome/cookies.db:\n * // example.com:\n * // session=abc123\n * // /path/to/firefox/cookies.sqlite:\n * // example.com:\n * // auth=xyz789\n * ```\n */\n public handle(results: ExportedCookie[]): void {\n logger.log(renderCookies(results, { format: \"grouped\" }));\n }\n}\n","import logger from \"@utils/logger\";\n\nimport { ExportedCookie } from \"../../types/schemas\";\n\nimport { OutputHandler, ParsedArgs } from \"./types\";\n\n/**\n * Handles JSON output of cookie data\n * @example\n * ```typescript\n * const handler = new JsonOutputHandler();\n * handler.handle([\n * {\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * meta: { file: '/path/to/cookies.db' }\n * }\n * ]);\n * // Outputs:\n * // {\n * // \"name\": \"session\",\n * // \"domain\": \"example.com\",\n * // \"value\": \"abc123\",\n * // \"meta\": {\n * // \"file\": \"/path/to/cookies.db\"\n * // }\n * // }\n * ```\n */\nexport class JsonOutputHandler implements OutputHandler {\n /**\n * Checks if this handler should be used based on JSON output flag\n * @param args - The parsed command line arguments\n * @returns True if output is set to \"json\"\n * @example\n * ```typescript\n * const handler = new JsonOutputHandler();\n * handler.canHandle({ output: 'json' }); // true\n * handler.canHandle({ output: 'text' }); // false\n * handler.canHandle({}); // false\n * ```\n */\n public canHandle(args: ParsedArgs): boolean {\n return args.output === \"json\";\n }\n\n /**\n * Outputs the cookie data in JSON format\n * @param results - Array of exported cookies to output\n * @example\n * ```typescript\n * const handler = new JsonOutputHandler();\n * handler.handle([{\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * expiry: new Date('2024-12-31'),\n * meta: {\n * file: '/path/to/cookies.db',\n * browser: 'Chrome',\n * decrypted: true\n * }\n * }]);\n * // Outputs formatted JSON with all cookie properties\n * ```\n */\n public handle(results: ExportedCookie[]): void {\n logger.log(JSON.stringify(results, null, 2));\n }\n}\n","import { renderCookies } from \"@core/cookies/renderCookies\";\nimport logger from \"@utils/logger\";\n\nimport { ExportedCookie } from \"../../types/schemas\";\n\nimport { OutputHandler, ParsedArgs } from \"./types\";\n\n/**\n * Handles merged render output of cookie data\n * @example\n * ```typescript\n * const handler = new RenderOutputHandler();\n * handler.handle([\n * {\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * meta: { file: '/path/to/cookies.db' }\n * },\n * {\n * name: 'auth',\n * domain: 'api.example.com',\n * value: 'xyz789',\n * meta: { file: '/path/to/cookies.db' }\n * }\n * ]);\n * // Outputs cookies in a merged format:\n * // example.com:\n * // session=abc123\n * // api.example.com:\n * // auth=xyz789\n * ```\n */\nexport class RenderOutputHandler implements OutputHandler {\n /**\n * Checks if this handler should be used based on render flags\n * @param args - The parsed command line arguments\n * @returns True if any render flag is set\n * @example\n * ```typescript\n * const handler = new RenderOutputHandler();\n * handler.canHandle({ render: true }); // true\n * handler.canHandle({ 'render-merged': true }); // true\n * handler.canHandle({ r: true }); // true\n * handler.canHandle({}); // false\n * ```\n */\n public canHandle(args: ParsedArgs): boolean {\n return (\n args.render === true || args[\"render-merged\"] === true || args.r === true\n );\n }\n\n /**\n * Outputs the cookie data in a merged format\n * @param results - Array of exported cookies to output\n * @example\n * ```typescript\n * const handler = new RenderOutputHandler();\n * handler.handle([\n * {\n * name: 'session',\n * domain: 'example.com',\n * value: 'abc123',\n * meta: {\n * file: '/path/to/cookies.db',\n * browser: 'Chrome'\n * }\n * }\n * ]);\n * // Outputs:\n * // example.com:\n * // session=abc123\n * ```\n */\n public handle(results: ExportedCookie[]): void {\n logger.log(renderCookies(results, { format: \"merged\" }));\n }\n}\n","import { DefaultOutputHandler } from \"./DefaultOutputHandler\";\nimport { DumpOutputHandler } from \"./DumpOutputHandler\";\nimport { GroupedDumpOutputHandler } from \"./GroupedDumpOutputHandler\";\nimport { GroupedRenderOutputHandler } from \"./GroupedRenderOutputHandler\";\nimport { JsonOutputHandler } from \"./JsonOutputHandler\";\nimport { RenderOutputHandler } from \"./RenderOutputHandler\";\nimport { OutputHandler, ParsedArgs } from \"./types\";\n\n/**\n * Factory for creating appropriate output handlers based on command-line arguments\n * @example\n * ```typescript\n * const factory = new OutputHandlerFactory();\n *\n * // Get JSON output handler\n * const jsonHandler = factory.getHandler({ output: 'json' });\n *\n * // Get dump output handler\n * const dumpHandler = factory.getHandler({ dump: true });\n *\n * // Get default handler when no matching handler found\n * const defaultHandler = factory.getHandler({});\n * ```\n */\nexport class OutputHandlerFactory {\n private handlers: OutputHandler[];\n\n /**\n * Initializes the factory with all available output handlers\n * @example\n * ```typescript\n * const factory = new OutputHandlerFactory();\n * // Factory is initialized with:\n * // - DumpOutputHandler\n * // - GroupedDumpOutputHandler\n * // - RenderOutputHandler\n * // - GroupedRenderOutputHandler\n * // - JsonOutputHandler\n * // - DefaultOutputHandler\n * ```\n */\n public constructor() {\n this.handlers = [\n new DumpOutputHandler(),\n new GroupedDumpOutputHandler(),\n new RenderOutputHandler(),\n new GroupedRenderOutputHandler(),\n new JsonOutputHandler(),\n new DefaultOutputHandler(),\n ];\n }\n\n /**\n * Returns the first handler that can handle the given arguments\n * @param args - The parsed command line arguments\n * @returns The first handler that can handle the arguments, or DefaultOutputHandler if none found\n * @example\n * ```typescript\n * const factory = new OutputHandlerFactory();\n *\n * // Get JSON handler\n * const jsonHandler = factory.getHandler({ output: 'json' });\n *\n * // Get grouped render handler\n * const groupedHandler = factory.getHandler({ 'render-grouped': true });\n *\n * // Get dump handler\n * const dumpHandler = factory.getHandler({ dump: true });\n *\n * // Get default handler when no specific format requested\n * const defaultHandler = factory.getHandler({});\n * ```\n */\n public getHandler(args: ParsedArgs): OutputHandler {\n return (\n this.handlers.find((handler) => handler.canHandle(args)) ??\n new DefaultOutputHandler()\n );\n }\n}\n","import { isAfter } from \"date-fns\";\n\nimport type { ExportedCookie } from \"../../types/schemas\";\n\n/**\n * Filters out expired cookies from the given list\n * @param cookies - List of cookies to filter\n * @returns List of non-expired cookies\n * @example\n * // Filter expired cookies from a list\n * const validCookies = filterExpired(cookieList);\n */\nexport function filterExpired(cookies: ExportedCookie[]): ExportedCookie[] {\n const now = new Date();\n return cookies.filter((cookie) => {\n if (cookie.expiry === \"Infinity\") {\n return true;\n }\n if (cookie.expiry instanceof Date) {\n return isAfter(cookie.expiry, now);\n }\n if (typeof cookie.expiry === \"number\") {\n return isAfter(new Date(cookie.expiry * 1000), now);\n }\n return true;\n });\n}\n","import type { CookieSpec, ExportedCookie } from \"../../types/schemas\";\n\nimport type { CookieQueryStrategy } from \"./CookieStrategyFactory\";\n\n/**\n * Service for querying cookies using a strategy\n */\nexport class CookieQueryService {\n /**\n * Creates a new CookieQueryService instance\n * @param strategy - The strategy to use for querying cookies\n */\n public constructor(private readonly strategy: CookieQueryStrategy) {}\n\n /**\n * Queries cookies from the strategy with an optional limit\n * @param spec - The cookie specification to query for\n * @param _limit - Optional limit on the number of cookies to return (currently unused)\n * @returns Array of exported cookies\n */\n public async queryCookies(\n spec: CookieSpec,\n _limit?: number,\n ): Promise<ExportedCookie[]> {\n return this.strategy.queryCookies(spec.name, spec.domain);\n }\n}\n","import { createTaggedLogger, logError } from \"@utils/logHelpers\";\n\nimport {\n BrowserName,\n CookieQueryStrategy,\n CookieRow,\n ExportedCookie,\n} from \"../../../types/schemas\";\nimport { getEncryptedChromeCookie } from \"../getEncryptedChromeCookie\";\nimport { listChromeProfilePaths } from \"../listChromeProfiles\";\n\nimport { decrypt } from \"./decrypt\";\nimport { getChromePassword } from \"./getChromePassword\";\n\ninterface DecryptionContext {\n file: string;\n password: string;\n}\n\nfunction getExpiryDate(expiry: number | undefined | null): Date | \"Infinity\" {\n if (typeof expiry !== \"number\" || expiry <= 0) {\n return \"Infinity\";\n }\n return new Date(expiry);\n}\n\nfunction createExportedCookie(\n domain: string,\n name: string,\n value: string,\n expiry: number | undefined | null,\n file: string,\n decrypted: boolean,\n): ExportedCookie {\n return {\n domain,\n name,\n value,\n expiry: getExpiryDate(expiry),\n meta: {\n file,\n browser: \"Chrome\",\n decrypted,\n },\n };\n}\n\n/**\n * Strategy for querying cookies from Chrome browser\n * @example\n * ```typescript\n * const strategy = new ChromeCookieQueryStrategy();\n * const cookies = await strategy.queryCookies('session', 'example.com');\n * ```\n */\nexport class ChromeCookieQueryStrategy implements CookieQueryStrategy {\n private readonly logger = createTaggedLogger(\"ChromeCookieQueryStrategy\");\n\n /**\n * The browser name for this strategy\n */\n public readonly browserName: BrowserName = \"Chrome\";\n\n /**\n * Queries cookies from Chrome's cookie store\n * @param name - The name pattern to match cookies against\n * @param domain - The domain pattern to match cookies against\n * @returns A promise that resolves to an array of exported cookies\n * @example\n * ```typescript\n * const strategy = new ChromeCookieQueryStrategy();\n * const cookies = await strategy.queryCookies('session', 'example.com');\n * console.log(cookies);\n * ```\n */\n public async queryCookies(\n name: string,\n domain: string,\n ): Promise<ExportedCookie[]> {\n try {\n this.logger.info(\"Querying cookies\", { name, domain });\n\n if (process.platform !== \"darwin\") {\n this.logger.warn(\"Platform not supported\", {\n platform: process.platform,\n });\n return [];\n }\n\n const cookieFiles = listChromeProfilePaths();\n if (cookieFiles.length === 0) {\n this.logger.warn(\"No Chrome cookie files found\");\n return [];\n }\n\n const password = await getChromePassword();\n const results = await Promise.all(\n cookieFiles.map((file) =>\n this.processFile(file, name, domain, password),\n ),\n );\n\n return results.flat();\n } catch (error) {\n if (error instanceof Error) {\n logError(\"Failed to query cookies\", error, { name, domain });\n } else {\n logError(\"Failed to query cookies\", new Error(String(error)), {\n name,\n domain,\n });\n }\n return [];\n }\n }\n\n private async processFile(\n file: string,\n name: string,\n domain: string,\n password: string,\n ): Promise<ExportedCookie[]> {\n try {\n const encryptedCookies = await getEncryptedChromeCookie({\n name,\n domain,\n file,\n });\n\n const context: DecryptionContext = { file, password };\n const results = await Promise.allSettled(\n encryptedCookies.map((cookie) => this.processCookie(cookie, context)),\n );\n\n return results\n .map((result) => (result.status === \"fulfilled\" ? result.value : null))\n .filter((cookie): cookie is ExportedCookie => cookie !== null);\n } catch (error) {\n if (error instanceof Error) {\n this.logger.error(\"Failed to process cookie file\", { error, file });\n } else {\n this.logger.error(\"Failed to process cookie file\", {\n error: String(error),\n file,\n });\n }\n return [];\n }\n }\n\n private async processCookie(\n cookie: CookieRow,\n context: DecryptionContext,\n ): Promise<ExportedCookie> {\n try {\n const value = Buffer.isBuffer(cookie.value)\n ? cookie.value\n : Buffer.from(String(cookie.value));\n\n const decryptedValue = await decrypt(value, context.password);\n return createExportedCookie(\n cookie.domain,\n cookie.name,\n decryptedValue,\n cookie.expiry,\n context.file,\n true,\n );\n } catch (error) {\n if (error instanceof Error) {\n this.logger.warn(\"Failed to decrypt cookie\", { error });\n } else {\n this.logger.warn(\"Failed to decrypt cookie\", { error: String(error) });\n }\n return createExportedCookie(\n cookie.domain,\n cookie.name,\n cookie.value.toString(\"utf-8\"),\n cookie.expiry,\n context.file,\n false,\n );\n }\n }\n}\n","import { existsSync } from \"fs\";\nimport { join } from \"path\";\n\nimport glob from \"fast-glob\";\n\nimport { logError, logDebug, logOperationResult } from \"@utils/logHelpers\";\n\nimport type { CookieRow } from \"../../types/schemas\";\n\nimport { chromeApplicationSupport } from \"./chrome/ChromeApplicationSupport\";\nimport { querySqliteThenTransform } from \"./QuerySqliteThenTransform\";\n\ninterface ChromeCookieRow {\n encrypted_value: Buffer;\n name: string;\n host_key: string;\n expires_utc: number;\n}\n\ninterface GetEncryptedCookieOptions {\n name: string;\n domain: string;\n file?: string;\n}\n\ninterface SqlQuery {\n sql: string;\n params: string[];\n}\n\n/**\n * Validates if a path is a valid, existing file\n * @param path - Path to validate\n * @returns true if path is valid and file exists, false otherwise\n */\nfunction isValidFilePath(path: unknown): path is string {\n if (typeof path !== \"string\") {\n return false;\n }\n\n const trimmedPath = path.trim();\n if (trimmedPath.length === 0) {\n return false;\n }\n\n return existsSync(trimmedPath);\n}\n\n/**\n * Get paths to Chrome cookie files\n * @returns A promise that resolves to an array of file paths\n */\nasync function getCookieFiles(): Promise<string[]> {\n const patterns = [\n join(chromeApplicationSupport, \"Default/Cookies\"),\n join(chromeApplicationSupport, \"Profile */Cookies\"),\n join(chromeApplicationSupport, \"Profile Default/Cookies\"),\n ];\n\n const files: string[] = [];\n for (const pattern of patterns) {\n const matches = await glob(pattern);\n files.push(...matches);\n }\n\n logDebug(\"ChromeCookies\", \"Found cookie files\", {\n count: files.length,\n files,\n });\n return files;\n}\n\n/**\n * Builds the SQL query for retrieving cookies\n * @param name - Cookie name to search for\n * @param domain - Domain to filter by\n * @returns SQL query and parameters\n */\nfunction buildSqlQuery(name: string, domain: string): SqlQuery {\n const isWildcard = name === \"%\";\n const sql = isWildcard\n ? `SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE host_key LIKE ?`\n : `SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE name = ? AND host_key LIKE ?`;\n const params = isWildcard ? [`%${domain}%`] : [name, `%${domain}%`];\n\n return { sql, params };\n}\n\n/**\n * Processes a single cookie file to extract matching cookies\n * @param cookieFile - Path to the cookie file\n * @param name - Cookie name to search for\n * @param domain - Domain to filter by\n * @returns Array of matching cookies\n */\nasync function processCookieFile(\n cookieFile: string,\n name: string,\n domain: string,\n): Promise<CookieRow[]> {\n try {\n const { sql, params } = buildSqlQuery(name, domain);\n logDebug(\"ChromeCookies\", \"Executing query\", { sql, params });\n\n const rows = await querySqliteThenTransform<ChromeCookieRow, CookieRow>({\n file: cookieFile,\n sql,\n params,\n rowTransform: (row: ChromeCookieRow): CookieRow => ({\n name: row.name,\n domain: row.host_key,\n value: row.encrypted_value,\n expiry: row.expires_utc,\n }),\n });\n\n logOperationResult(\"QueryCookies\", true, {\n file: cookieFile,\n count: rows.length,\n });\n return rows;\n } catch (error) {\n logError(\"Failed to read cookie file\", error, { file: cookieFile });\n return [];\n }\n}\n\n/**\n * Retrieve encrypted cookies from Chrome's cookie store\n * @param options - Options for querying Chrome cookies\n * @param options.name - The name of the cookie to retrieve\n * @param options.domain - The domain to retrieve cookies from\n * @param options.file - Optional specific cookie file to query\n * @returns Promise resolving to array of encrypted cookies\n */\nexport async function getEncryptedChromeCookie({\n name,\n domain,\n file,\n}: GetEncryptedCookieOptions): Promise<CookieRow[]> {\n const cookieFiles =\n typeof file === \"string\" && file.length > 0\n ? [file]\n : await getCookieFiles();\n\n if (cookieFiles.length === 0) {\n logDebug(\"ChromeCookies\", \"No cookie files found\");\n return [];\n }\n\n const results: CookieRow[] = [];\n for (const cookieFile of cookieFiles) {\n if (!isValidFilePath(cookieFile)) {\n logDebug(\"ChromeCookies\", \"Cookie file missing or invalid\", {\n file: cookieFile,\n });\n continue;\n }\n\n const cookies = await processCookieFile(cookieFile, name, domain);\n results.push(...cookies);\n }\n\n logDebug(\"ChromeCookies\", \"Query complete\", { totalCookies: results.length });\n return results;\n}\n","import { homedir } from \"os\";\nimport { join } from \"path\";\n\n/**\n * The path to Chrome's application support directory on macOS\n * This constant is used to locate Chrome's profile and cookie storage directories\n * @throws {Error} If unable to determine user's home directory\n */\nexport const chromeApplicationSupport = (() => {\n const home = homedir();\n if (!home) {\n throw new Error(\"Unable to determine user home directory\");\n }\n return join(home, \"Library\", \"Application Support\", \"Google\", \"Chrome\");\n})();\n","// External imports\nimport BetterSqlite3, { Database } from \"better-sqlite3\";\n\n// Internal imports\nimport { logError } from \"@utils/logHelpers\";\n\ninterface QuerySqliteThenTransformOptions<TRow, TResult> {\n file: string;\n sql: string;\n params?: unknown[];\n rowFilter?: (row: TRow) => boolean;\n rowTransform?: (row: TRow) => TResult;\n}\n\nfunction openDatabase(file: string): Database {\n try {\n return new BetterSqlite3(file, { readonly: true, fileMustExist: true });\n } catch (error) {\n logError(\"Database open failed\", error, { file });\n throw error;\n }\n}\n\nfunction closeDatabase(db: Database): Promise<void> {\n try {\n db.close();\n return Promise.resolve();\n } catch (error) {\n logError(\"Database close failed\", error);\n return Promise.reject(\n error instanceof Error\n ? error\n : new Error(\"Failed to close database: Unknown error\"),\n );\n }\n}\n\n/**\n * Executes a SQL query on a SQLite database file and transforms the results\n * @param root0 - The options object containing query parameters\n * @param root0.file - The path to the SQLite database file\n * @param root0.sql - The SQL query to execute\n * @param root0.params - Optional parameters for the SQL query\n * @param root0.rowFilter - Optional function to filter rows from the result set\n * @param root0.rowTransform - Optional function to transform each row before returning\n * @returns A promise that resolves to an array of transformed results\n */\nexport async function querySqliteThenTransform<TRow, TResult>({\n file,\n sql,\n params,\n rowFilter,\n rowTransform,\n}: QuerySqliteThenTransformOptions<TRow, TResult>): Promise<TResult[]> {\n let db: Database | undefined;\n\n try {\n db = openDatabase(file);\n const stmt = db.prepare(sql);\n const rows = stmt.all(params) as TRow[];\n\n const filteredRows = rowFilter ? rows.filter(rowFilter) : rows;\n const transformedRows = rowTransform\n ? filteredRows.map(rowTransform)\n : (filteredRows as unknown as TResult[]);\n\n return transformedRows;\n } catch (error) {\n logError(\"Database query failed\", error, { file, sql });\n throw error;\n } finally {\n if (db) {\n await closeDatabase(db);\n }\n }\n}\n","// External imports\nimport { readFileSync } from \"fs\";\nimport { join } from \"path\";\n\nimport fg from \"fast-glob\";\n\n// Internal imports\nimport logger from \"@utils/logger\";\n\nimport { chromeApplicationSupport } from \"./chrome/ChromeApplicationSupport\";\n\nconst consola = logger.withTag(\"listChromeProfiles\");\n\n/**\n * Lists all Chrome profile paths that contain cookie files\n * @internal\n * @returns An array of absolute paths to Chrome cookie files\n * @throws {Error} If Chrome's application support directory cannot be accessed\n * @example\n * ```typescript\n * // Get all Chrome cookie file paths\n * const cookiePaths = listChromeProfilePaths();\n * // Returns: [\n * // '/Users/name/Library/Application Support/Chrome/Profile 1/Cookies',\n * // '/Users/name/Library/Application Support/Chrome/Profile 2/Cookies'\n * // ]\n *\n * // Handle errors\n * try {\n * const paths = listChromeProfilePaths();\n * } catch (error) {\n * console.error('Failed to access Chrome profiles:', error);\n * }\n * ```\n */\nexport function listChromeProfilePaths(): string[] {\n const files: string[] = fg.sync(`./**/Cookies`, {\n cwd: chromeApplicationSupport,\n absolute: true,\n });\n\n consola.debug(\"Found cookie files:\", files);\n return files;\n}\n\n/**\n * Chrome Local State file structure\n * @internal\n */\ninterface ChromeLocalState {\n profile: {\n info_cache: Record<string, ChromeProfileInfo>;\n };\n}\n\n/**\n * Chrome profile information structure\n * @property {string} name - The name of the profile\n * @property {number} active_time - Unix timestamp of last profile activity\n * @property {string} account_id - Unique identifier for the Chrome profile\n * @property {Record<string, unknown>} accountcapabilities - Account feature flags\n * @property {string} email - User's email address\n * @property {string} full_name - User's full name\n * @property {boolean} is_using_default_avatar - Whether using default profile picture\n * @property {boolean} is_using_default_name - Whether using default profile name\n * @property {string} last_downloaded_gaia_picture_url_with_size - Profile picture URL\n * @property {string} local_auth_credentials - Authentication credentials\n * @property {string} shortcut_name - Profile shortcut name\n * @property {string} user_name - Username associated with profile\n */\ninterface ChromeProfileInfo {\n /** The name of the profile */\n name: string;\n /** Unix timestamp of last profile activity */\n active_time: number;\n /** Unique identifier for the Chrome profile */\n account_id: string;\n /** Account feature flags */\n accountcapabilities: Record<string, unknown>;\n /** User's email address */\n email: string;\n /** User's full name */\n full_name: string;\n /** Whether using default profile picture */\n is_using_default_avatar: boolean;\n /** Whether using default profile name */\n is_using_default_name: boolean;\n /** Profile picture URL */\n last_downloaded_gaia_picture_url_with_size: string;\n /** Authentication credentials */\n local_auth_credentials: string;\n /** Profile shortcut name */\n shortcut_name: string;\n /** Username associated with profile */\n user_name: string;\n}\n\n/**\n * Lists all Chrome profiles and their associated information\n * @internal\n * @returns An array of Chrome profile information objects. Returns empty array if profiles cannot be read\n * @throws {Error} If Chrome's application support directory cannot be accessed\n * @example\n * ```typescript\n * // Get all Chrome profiles\n * const profiles = listChromeProfiles();\n * // Returns: [\n * // {\n * // name: \"Default\",\n * // email: \"user@example.com\",\n * // full_name: \"John Doe\",\n * // ...\n * // },\n * // ...\n * // ]\n *\n * // Handle empty or error case\n * const profiles = listChromeProfiles();\n * if (profiles.length === 0) {\n * console.log('No Chrome profiles found or error occurred');\n * }\n * ```\n */\nexport function listChromeProfiles(): ChromeProfileInfo[] {\n try {\n const localStatePath = join(chromeApplicationSupport, \"Local State\");\n const localState = JSON.parse(\n readFileSync(localStatePath, \"utf8\"),\n ) as ChromeLocalState;\n return Object.values(localState.profile.info_cache);\n } catch (error) {\n if (error instanceof Error) {\n consola.error(\"Failed to read Chrome profiles:\", error.message);\n } else {\n consola.error(\"Failed to read Chrome profiles: Unknown error\");\n }\n return [];\n }\n}\n","// External imports\nimport { createDecipheriv, pbkdf2 } from \"crypto\";\n\nimport { memoize } from \"lodash-es\";\n\n/**\n * Removes the v10 prefix from the encrypted value if present\n * @param value - The encrypted value\n * @returns The value without the v10 prefix\n */\nconst removeV10Prefix = memoize(\n (value: Buffer): Buffer => {\n if (\n value.length >= 3 &&\n value[0] === 0x76 && // 'v'\n value[1] === 0x31 && // '1'\n value[2] === 0x30\n ) {\n // '0'\n return value.slice(3);\n }\n return value;\n },\n (value: Buffer) => value.toString(\"hex\"),\n);\n\n/**\n * Removes PKCS7 padding from the decrypted value\n * @param decrypted - The decrypted buffer\n * @returns The buffer without padding\n */\nconst removePadding = memoize(\n (decrypted: Buffer): Buffer => {\n const padding = decrypted[decrypted.length - 1];\n if (padding && padding <= 16) {\n return decrypted.slice(0, -padding);\n }\n return decrypted;\n },\n (decrypted: Buffer) => decrypted.toString(\"hex\"),\n);\n\n/**\n * Extracts the actual value from the decoded string by removing Chrome's prefixes\n * @param decodedString - The decoded string to clean up\n * @returns The cleaned up value\n */\nfunction extractValue(decodedString: string): string {\n const cleanupPatterns = [\n /.*?0t(.+)$/, // Pattern ending in \"0t\" followed by value\n /.*?1e`(.+)$/, // Pattern ending in \"1e`\" followed by value\n /.*?[`'](.+)$/, // Any backtick or quote followed by value\n /[^\\x20-\\x7E]*([\\x20-\\x7E].+)$/, // Non-printable chars followed by printable chars\n ];\n\n for (const pattern of cleanupPatterns) {\n const match = decodedString.match(pattern);\n const value = match?.[1] ?? \"\";\n if (value.length > 0) {\n return value;\n }\n }\n return decodedString;\n}\n\n/**\n * Decrypts Chrome's encrypted cookie values\n * @param encryptedValue - The encrypted cookie value as a Buffer\n * @param password - The Chrome encryption password\n * @returns A promise that resolves to the decrypted cookie value\n * @throws {Error} If decryption fails\n * @example\n */\nexport async function decrypt(\n encryptedValue: Buffer,\n password: string,\n): Promise<string> {\n if (typeof password !== \"string\") {\n throw new Error(\"password must be a string\");\n }\n if (!Buffer.isBuffer(encryptedValue)) {\n throw new Error(\"encryptedData must be a Buffer\");\n }\n\n return new Promise((resolve, reject) => {\n pbkdf2(password, \"saltysalt\", 1003, 16, \"sha1\", (error, key) => {\n try {\n if (error) {\n reject(new Error(\"Failed to derive key: \" + error.message));\n return;\n }\n\n const value = removeV10Prefix(encryptedValue);\n if (value.length % 16 !== 0) {\n reject(new Error(\"Encrypted data length is not a multiple of 16\"));\n return;\n }\n\n // Chrome's encryption parameters\n const iv = Buffer.alloc(16, \" \"); // 16 spaces\n const decipher = createDecipheriv(\"aes-128-cbc\", key, iv);\n decipher.setAutoPadding(false);\n\n // Decrypt the value\n let decrypted = decipher.update(value);\n try {\n decipher.final();\n } catch (e) {\n reject(\n new Error(\"Failed to finalize decryption: \" + (e as Error).message),\n );\n return;\n }\n\n decrypted = removePadding(decrypted);\n const decodedString = decrypted.toString(\"utf8\");\n resolve(extractValue(decodedString));\n } catch (e) {\n reject(new Error(\"Decryption failed: \" + (e as Error).message));\n }\n });\n });\n}\n","import { memoize } from \"lodash-es\";\n\nimport { logError, logDebug } from \"@utils/logHelpers\";\n\n/**\n * Retrieves the Chrome password for decrypting cookies\n * This is only supported on macOS\n * @returns A promise that resolves to the Chrome password\n * @throws {Error} If the platform is not macOS or if password retrieval fails\n * @example\n */\nexport const getChromePassword: () => Promise<string> = memoize(async () => {\n if (process.platform !== \"darwin\") {\n logError(\n \"Chrome password retrieval failed\",\n new Error(\"This only works on macOS\"),\n {\n platform: process.platform,\n },\n );\n throw new Error(\"This only works on macOS\");\n }\n\n try {\n const { getChromePassword: getMacOSPassword } = await import(\n \"./macos/getChromePassword\"\n );\n const password = await getMacOSPassword();\n logDebug(\"ChromePassword\", \"Retrieved password successfully\", {\n platform: \"macOS\",\n });\n return password;\n } catch (error) {\n logError(\"Chrome password retrieval failed\", error, { platform: \"macOS\" });\n throw error;\n }\n});\n","/**\n * Asynchronously maps over an array and flattens the result.\n * Similar to Array.prototype.flatMap but for async operations.\n * @param array - The input array to map over\n * @param callback - The async mapping function to apply to each element\n * @param defaultValue - The default value to return if the array is empty\n * @returns A flattened array of results\n * @example\n * // Basic usage with number arrays\n * const numbers = [1, 2, 3];\n * const result = await flatMapAsync(\n * numbers,\n * async (num) => [num, num * 2]\n * );\n * console.log(result); // [1, 2, 2, 4, 3, 6]\n * @example\n * // Error handling with default value\n * const data = ['valid', 'invalid'];\n * const result = await flatMapAsync(\n * data,\n * async (item) => {\n * if (item === 'invalid') throw new Error();\n * return [item.toUpperCase()];\n * },\n * ['DEFAULT']\n * );\n * console.log(result); // ['VALID', 'DEFAULT']\n */\nexport async function flatMapAsync<T, U>(\n array: T[],\n callback: (item: T) => Promise<U[]>,\n defaultValue: U[] = [],\n): Promise<U[]> {\n if (array.length === 0) {\n return defaultValue;\n }\n\n const results = await Promise.all(\n array.map(async (item) => {\n try {\n return await callback(item);\n } catch (_error) {\n return defaultValue;\n }\n }),\n );\n return results.flat();\n}\n","import { flatMapAsync } from \"@utils/flatMapAsync\";\nimport { createTaggedLogger } from \"@utils/logHelpers\";\n\nimport type {\n BrowserName,\n CookieQueryStrategy,\n ExportedCookie,\n} from \"../../types/schemas\";\n\n/**\n * A composite strategy that combines multiple cookie query strategies.\n * This class implements the CookieQueryStrategy interface and allows querying cookies\n * from multiple browser-specific strategies simultaneously.\n * @example\n * ```typescript\n * const strategy = new CompositeCookieQueryStrategy([\n * new ChromeCookieQueryStrategy(),\n * new FirefoxCookieQueryStrategy(),\n * new SafariCookieQueryStrategy()\n * ]);\n * const cookies = await strategy.queryCookies('sessionId', 'example.com');\n * ```\n */\nexport class CompositeCookieQueryStrategy implements CookieQueryStrategy {\n private readonly logger = createTaggedLogger(\"CompositeCookieQueryStrategy\");\n\n /**\n * The browser name identifier for this strategy\n * @remarks Always returns 'internal' as this is a composite strategy\n */\n public readonly browserName: BrowserName = \"internal\";\n\n /**\n * Creates a new instance of CompositeCookieQueryStrategy\n * @param strategies - Array of browser-specific strategies to use for querying cookies\n * @remarks\n * - Each strategy in the array should implement the CookieQueryStrategy interface\n * - The order of strategies determines the order of cookie querying\n * - Failed strategies will be gracefully handled and skipped\n * @example\n * ```typescript\n * const strategy = new CompositeCookieQueryStrategy([\n * new ChromeCookieQueryStrategy(),\n * new FirefoxCookieQueryStrategy()\n * ]);\n * ```\n */\n public constructor(private strategies: CookieQueryStrategy[]) {}\n\n /**\n * Handles strategy-specific errors and logs them appropriately\n * @internal\n * @param error - The error that occurred during strategy execution\n * @param strategy - The strategy that failed\n */\n private handleStrategyError(\n error: unknown,\n strategy: CookieQueryStrategy,\n ): void {\n if (error instanceof Error) {\n this.logger.error(\"Strategy failed\", { error, strategy });\n } else {\n this.logger.error(\"Strategy failed with unknown error\", {\n error: String(error),\n strategy,\n });\n }\n }\n\n /**\n * Queries cookies using all available strategies in parallel\n * @param name - The name pattern to match cookies against\n * @param domain - The domain pattern to match cookies against\n * @returns Promise resolving to combined array of cookies from all strategies\n * @remarks\n * - Failures in individual strategies are logged but don't affect other strategies\n * - Results are combined from all successful strategy queries\n * - Empty arrays are returned for failed strategy queries\n * @example\n * ```typescript\n * const strategy = new CompositeCookieQueryStrategy([\n * new ChromeCookieQueryStrategy(),\n * new FirefoxCookieQueryStrategy()\n * ]);\n * const cookies = await strategy.queryCookies('sessionId', 'example.com');\n * console.log(cookies); // Combined results from all browsers\n * ```\n */\n public async queryCookies(\n name: string,\n domain: string,\n ): Promise<ExportedCookie[]> {\n try {\n this.logger.info(\"Querying cookies from all strategies\", {\n name,\n domain,\n strategyCount: this.strategies.length,\n });\n\n /**\n * Use flatMapAsync to process strategies in sequence while collecting results\n * This approach provides better error isolation than Promise.all\n * Each strategy failure is handled independently\n */\n return await flatMapAsync(\n this.strategies,\n async (strategy) => {\n try {\n return await strategy.queryCookies(name, domain);\n } catch (error) {\n this.handleStrategyError(error, strategy);\n return [];\n }\n },\n [],\n );\n } catch (error) {\n /**\n * Handle top-level errors that may occur during strategy processing\n * This ensures the function always returns an array, even in catastrophic failure\n */\n if (error instanceof Error) {\n this.logger.error(\"Failed to query cookies\", { error });\n } else {\n this.logger.error(\"Failed to query cookies with unknown error\", {\n error: String(error),\n });\n }\n return [];\n }\n }\n}\n","import { homedir } from \"os\";\nimport { join } from \"path\";\n\nimport fg from \"fast-glob\";\n\nimport { logDebug, logWarn } from \"@utils/logHelpers\";\n\nimport {\n BrowserName,\n CookieQueryStrategy,\n ExportedCookie,\n} from \"../../../types/schemas\";\nimport { querySqliteThenTransform } from \"../QuerySqliteThenTransform\";\n\ninterface FirefoxCookieRow {\n name: string;\n value: string;\n domain: string;\n expiry: number;\n}\n\n/**\n * Find all Firefox cookie database files\n * @returns An array of file paths to Firefox cookie databases\n */\nfunction findFirefoxCookieFiles(): string[] {\n const home = homedir();\n if (!home) {\n logWarn(\"FirefoxCookieQuery\", \"Failed to get home directory\");\n return [];\n }\n\n const patterns = [\n join(home, \"Library/Application Support/Firefox/Profiles/*/cookies.sqlite\"),\n join(home, \".mozilla/firefox/*/cookies.sqlite\"),\n ];\n\n const files: string[] = [];\n for (const pattern of patterns) {\n const matches = fg.sync(pattern);\n files.push(...matches);\n }\n\n logDebug(\"FirefoxCookieQuery\", \"Found Firefox cookie files\", { files });\n return files;\n}\n\n/**\n * Strategy for querying cookies from Firefox browser\n * @example\n */\nexport class FirefoxCookieQueryStrategy implements CookieQueryStrategy {\n /**\n *\n */\n public readonly browserName: BrowserName = \"Firefox\";\n\n /**\n * Queries cookies from Firefox's cookie store\n * @param name - The name pattern to match cookies against\n * @param domain - The domain pattern to match cookies against\n * @returns A promise that resolves to an array of exported cookies\n */\n public async queryCookies(\n name: string,\n domain: string,\n ): Promise<ExportedCookie[]> {\n const files = findFirefoxCookieFiles();\n const results: ExportedCookie[] = [];\n\n for (const file of files) {\n try {\n const cookies = await querySqliteThenTransform<\n FirefoxCookieRow,\n ExportedCookie\n >({\n file,\n sql: \"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?\",\n params: [name, `%${domain}%`],\n rowTransform: (row) => ({\n name: row.name,\n value: row.value,\n domain: row.domain,\n expiry: row.expiry > 0 ? new Date(row.expiry * 1000) : \"Infinity\",\n meta: {\n file,\n browser: \"Firefox\",\n decrypted: false,\n },\n }),\n });\n\n results.push(...cookies);\n } catch (error) {\n if (error instanceof Error) {\n logWarn(\n \"FirefoxCookieQuery\",\n `Error reading Firefox cookie file ${file}`,\n { error: error.message },\n );\n } else {\n logWarn(\n \"FirefoxCookieQuery\",\n `Error reading Firefox cookie file ${file}`,\n );\n }\n }\n }\n\n return results;\n }\n}\n","import { homedir } from \"os\";\nimport { join } from \"path\";\n\nimport { logError } from \"@utils/logHelpers\";\n\nimport type {\n BrowserName,\n CookieQueryStrategy,\n ExportedCookie,\n} from \"../../../types/schemas\";\n\nimport { decodeBinaryCookies } from \"./decodeBinaryCookies\";\n\n/**\n * Strategy for querying cookies from Safari browser\n */\nexport class SafariCookieQueryStrategy implements CookieQueryStrategy {\n /**\n * The browser name for this strategy\n */\n public readonly browserName: BrowserName = \"Safari\";\n\n /**\n * Gets the path to Safari's cookie database\n * @param home - The user's home directory\n * @returns Path to the cookie database\n */\n private getCookieDbPath(home: string): string {\n return join(\n home,\n \"Library\",\n \"Containers\",\n \"com.apple.Safari\",\n \"Data\",\n \"Library\",\n \"Cookies\",\n \"Cookies.binarycookies\",\n );\n }\n\n /**\n * Decodes cookies from Safari's binary cookie file\n * @param cookieDbPath - Path to the cookie database\n * @param name - Name of the cookie to find\n * @param domain - Domain to filter cookies by\n * @returns Array of exported cookies\n */\n private decodeCookies(\n cookieDbPath: string,\n name: string,\n domain: string,\n ): ExportedCookie[] {\n try {\n const cookies = decodeBinaryCookies(cookieDbPath);\n return cookies\n .filter(\n (cookie) =>\n (name === \"%\" || cookie.name === name) &&\n (domain === \"%\" || cookie.domain.includes(domain)),\n )\n .map((cookie) => ({\n domain: cookie.domain,\n name: cookie.name,\n value: Buffer.isBuffer(cookie.value)\n ? cookie.value.toString()\n : String(cookie.value),\n expiry:\n typeof cookie.expiry === \"number\" && cookie.expiry > 0\n ? new Date(cookie.expiry * 1000)\n : \"Infinity\",\n meta: {\n file: cookieDbPath,\n browser: \"Safari\" as const,\n decrypted: false,\n },\n }));\n } catch (error) {\n if (error instanceof Error) {\n logError(\n \"SafariCookieQueryStrategy\",\n `Error decoding ${cookieDbPath}`,\n { error, name, domain },\n );\n } else {\n logError(\n \"SafariCookieQueryStrategy\",\n `Error decoding ${cookieDbPath}`,\n { error: \"Unknown error\", name, domain },\n );\n }\n return [];\n }\n }\n\n /**\n * Query Safari's cookie storage for cookies matching the given criteria\n * @param name - Name of the cookie to find\n * @param domain - Domain to filter cookies by\n * @returns Array of matching cookies, or empty array if none found\n */\n public async queryCookies(\n name: string,\n domain: string,\n ): Promise<ExportedCookie[]> {\n const home = homedir();\n if (typeof home !== \"string\" || home.length === 0) {\n logError(\"SafariCookieQueryStrategy\", \"Failed to get home directory\");\n return Promise.resolve([]);\n }\n\n const cookieDbPath = this.getCookieDbPath(home);\n return Promise.resolve(this.decodeCookies(cookieDbPath, name || \"%\", domain || \"%\"));\n }\n}\n","import { Buffer } from 'buffer';\nimport { readFileSync } from 'fs';\nimport { homedir } from 'os';\nimport { join } from 'path';\n\nimport { BinaryCookieRow } from '../../../types/schemas';\nimport { logWarn } from '../../../utils/logHelpers';\n\nimport { BinaryCodablePage } from './BinaryCodablePage';\nimport { BinaryCodableContainer } from './interfaces/BinaryCodableContainer';\n\n/**\n * Represents a binary cookies file structure used by Safari\n */\nexport class BinaryCodableCookies {\n /**\n *\n */\n public pages: BinaryCodablePage[];\n /**\n *\n */\n public metadata: Record<string, unknown>;\n private static readonly MAGIC = Buffer.from('cook', 'utf8');\n private static readonly FOOTER = BigInt('0x071720050000004b');\n private static readonly DEFAULT_COOKIE_PATH = join(\n homedir(),\n 'Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies'\n );\n\n /**\n * Creates a new BinaryCookies instance from a buffer\n * @param buffer - The raw binary cookie file data\n */\n public constructor(buffer: Buffer) {\n const container: BinaryCodableContainer = { offset: 0, buffer };\n this.pages = [];\n this.metadata = {};\n this.decode(container);\n }\n\n /**\n * Creates a BinaryCookies instance from a file path\n * @param path - Path to the Safari Cookies.binarycookies file\n * @returns A new BinaryCookies instance\n */\n public static fromFile(path: string): BinaryCodableCookies {\n const buffer = readFileSync(path);\n return new BinaryCodableCookies(buffer);\n }\n\n /**\n * Creates a BinaryCookies instance from the default Safari cookies location\n * @returns A new BinaryCookies instance\n */\n public static fromDefaultPath(): BinaryCodableCookies {\n return BinaryCodableCookies.fromFile(BinaryCodableCookies.DEFAULT_COOKIE_PATH);\n }\n\n /**\n * Converts the binary cookie data into a validated array of cookie rows\n * @returns Array of validated cookie objects\n */\n public toCookieRows(): BinaryCookieRow[] {\n const cookies: BinaryCookieRow[] = [];\n\n for (const page of this.pages) {\n try {\n const pageCookies = page.toCookieRows();\n if (Array.isArray(pageCookies)) {\n cookies.push(...pageCookies);\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logWarn('BinaryCookies', 'Error converting page cookies', { error: errorMessage });\n }\n }\n\n return cookies;\n }\n\n private decode(container: BinaryCodableContainer): void {\n try {\n // Check magic value\n const magic = container.buffer.subarray(container.offset, container.offset + 4);\n container.offset += 4;\n if (!magic.equals(BinaryCodableCookies.MAGIC)) {\n throw new Error('Missing magic value');\n }\n\n // Read page count\n const pageCount = container.buffer.readUInt32BE(container.offset);\n container.offset += 4;\n\n // Read page sizes\n const pageSizes: number[] = [];\n for (let i = 0; i < pageCount; i++) {\n pageSizes.push(container.buffer.readUInt32BE(container.offset));\n container.offset += 4;\n }\n\n // Calculate page offsets\n let currentOffset = container.offset;\n for (const pageSize of pageSizes) {\n try {\n const pageBuffer = container.buffer.subarray(currentOffset, currentOffset + pageSize);\n const page = new BinaryCodablePage(pageBuffer);\n this.pages.push(page);\n currentOffset += pageSize;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logWarn('BinaryCookies', `Error decoding page`, { error: errorMessage });\n currentOffset += pageSize; // Skip the problematic page\n }\n }\n container.offset = currentOffset;\n\n // Read checksum\n const _checksum = container.buffer.readUInt32BE(container.offset);\n container.offset += 4;\n\n // Read footer\n const footer = container.buffer.readBigUInt64BE(container.offset);\n container.offset += 8;\n if (footer !== BinaryCodableCookies.FOOTER) {\n logWarn('BinaryCookies', 'Invalid cookie file format: wrong footer');\n }\n\n // Read metadata plist\n const _plistData = container.buffer.subarray(container.offset);\n // Note: You'll need to implement or use a plist parser library here\n this.metadata = {}; // Placeholder for plist data\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logWarn('BinaryCookies', 'Error decoding binary cookies file', { error: errorMessage });\n throw error;\n }\n }\n}\n","import { Buffer } from 'buffer';\n\nimport { BinaryCookieRow } from '../../../types/schemas';\nimport { logWarn } from '../../../utils/logHelpers';\n\nimport { BinaryCodableCookie } from './BinaryCodableCookie';\nimport { BinaryCodableContainer } from './interfaces/BinaryCodableContainer';\n\n/**\n * Represents a page of cookies within the binary cookies file\n */\nexport class BinaryCodablePage {\n /**\n *\n */\n public cookies: BinaryCodableCookie[];\n private static readonly HEADER = 0x00000100;\n private static readonly FOOTER = 0x00000000;\n\n /**\n * Creates a new Page instance from a buffer\n * @param buffer - The raw binary page data\n */\n public constructor(buffer: Buffer) {\n this.cookies = [];\n const container: BinaryCodableContainer = { offset: 0, buffer };\n this.decode(container);\n }\n\n /**\n * Converts the page's cookies into validated cookie rows\n * @returns Array of validated cookie objects\n */\n public toCookieRows(): BinaryCookieRow[] {\n const cookies: BinaryCookieRow[] = [];\n\n for (const cookie of this.cookies) {\n try {\n const cookieRow = cookie.toCookieRow();\n if (cookieRow !== null) {\n cookies.push(cookieRow);\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logWarn('BinaryCookies', 'Error converting cookie', { error: errorMessage });\n }\n }\n\n return cookies;\n }\n\n private decode(container: BinaryCodableContainer): void {\n // Read page tag (4 bytes)\n const header = container.buffer.readUInt32BE(container.offset);\n container.offset += 4;\n if (header !== BinaryCodablePage.HEADER) {\n throw new Error('Invalid page header');\n }\n\n // Read number of cookies (4 bytes)\n const cookieCount = container.buffer.readUInt32LE(container.offset);\n container.offset += 4;\n\n // Store the page start offset for calculating absolute cookie positions\n const pageStart = container.offset - 8;\n\n // Read cookie offsets (4 bytes each)\n const cookieOffsets: number[] = [];\n for (let i = 0; i < cookieCount; i++) {\n const cookieOffset = container.buffer.readUInt32LE(container.offset);\n cookieOffsets.push(cookieOffset);\n container.offset += 4;\n }\n\n // Read page end marker (4 bytes)\n const footer = container.buffer.readUInt32BE(container.offset);\n container.offset += 4;\n if (footer !== BinaryCodablePage.FOOTER) {\n throw new Error('Invalid page footer');\n }\n\n // Read cookies at their offsets\n for (let i = 0; i < cookieCount; i++) {\n try {\n const cookieOffset = cookieOffsets[i];\n // Calculate absolute offset from page start\n const absoluteOffset = pageStart + cookieOffset;\n\n // Read cookie size from the cookie header\n const cookieSize = container.buffer.readUInt32LE(absoluteOffset);\n if (cookieSize < 48) { // Minimum cookie size is 48 bytes (header)\n logWarn('BinaryCookies', `Invalid cookie size ${cookieSize} at index ${i}`);\n continue;\n }\n\n // Ensure we don't read past the buffer\n if (absoluteOffset + cookieSize > container.buffer.length) {\n logWarn('BinaryCookies', `Cookie size ${cookieSize} at index ${i} would exceed buffer length`);\n continue;\n }\n\n const cookieBuffer = container.buffer.subarray(absoluteOffset, absoluteOffset + cookieSize);\n const cookie = new BinaryCodableCookie(cookieBuffer);\n this.cookies.push(cookie);\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logWarn('BinaryCookies', `Error decoding cookie at index ${i}`, { error: errorMessage });\n }\n }\n }\n}\n","import { Buffer } from 'buffer';\n\nimport { BinaryCookieRow, BinaryCookieRowSchema } from '../../../types/schemas';\n\nimport { BinaryCodableContainer } from './interfaces/BinaryCodableContainer';\nimport { BinaryCodableFlags } from './interfaces/BinaryCodableFlags';\nimport { BinaryCodableOffsets } from './interfaces/BinaryCodableOffsets';\n\n/**\n * Represents a single cookie within a page\n */\nexport class BinaryCodableCookie {\n /**\n *\n */\n public version = 0;\n /**\n *\n */\n public url = '';\n /**\n *\n */\n public port?: number;\n /**\n *\n */\n public name = '';\n /**\n *\n */\n public path = '';\n /**\n *\n */\n public value = '';\n /**\n *\n */\n public comment?: string;\n /**\n *\n */\n public commentURL?: string;\n /**\n *\n */\n public flags: BinaryCodableFlags = {\n isSecure: false,\n isHTTPOnly: false,\n unknown1: false,\n unknown2: false\n };\n /**\n *\n */\n public expiration = 0;\n /**\n *\n */\n public creation = 0;\n\n /**\n * Creates a new Cookie instance from a buffer\n * @param buffer - The raw binary cookie data\n */\n public constructor(buffer: Buffer) {\n const container: BinaryCodableContainer = { offset: 0, buffer };\n this.decode(container);\n }\n\n private decodeUrlValue(value: string): string {\n let processed = value;\n let lastProcessed;\n do {\n lastProcessed = processed;\n try {\n processed = decodeURIComponent(processed);\n } catch {\n return lastProcessed;\n }\n } while (processed !== lastProcessed && processed.includes('%'));\n return processed;\n }\n\n private decodeJwtPayload(token: string): string | null {\n const parts = token.split('.');\n if (parts.length !== 3) {\n return null;\n }\n\n try {\n const payload = Buffer.from(parts[1], 'base64').toString('utf8');\n const parsed = JSON.parse(payload) as Record<string, unknown>;\n return JSON.stringify(parsed);\n } catch {\n return null;\n }\n }\n\n private parseJsonValue(value: string): string | null {\n try {\n const parsed = JSON.parse(value) as Record<string, unknown>;\n return JSON.stringify(parsed);\n } catch {\n return null;\n }\n }\n\n private processValue(value: string): string {\n // First, try URL decoding\n const decoded = this.decodeUrlValue(value);\n\n // Then, try JWT decoding if it looks like a JWT token\n if (decoded.match(/^ey[A-Za-z0-9_-]+\\.ey[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$/)) {\n const jwtPayload = this.decodeJwtPayload(decoded);\n if (typeof jwtPayload === 'string' && jwtPayload.length > 0) {\n return jwtPayload;\n }\n }\n\n // Finally, try JSON parsing if it looks like JSON\n if (decoded.startsWith('{') || decoded.startsWith('[')) {\n const jsonValue = this.parseJsonValue(decoded);\n if (typeof jsonValue === 'string' && jsonValue.length > 0) {\n return jsonValue;\n }\n }\n\n return decoded;\n }\n\n /**\n * Converts the cookie to a validated cookie row\n * @returns Validated cookie row object or null if validation fails\n */\n public toCookieRow(): BinaryCookieRow | null {\n try {\n // Convert flags to number\n const flagsValue = this.convertFlags();\n\n // Extract domain from URL\n const domain = this.url.replace(/^https?:\\/\\//, '').replace(/\\/.*$/, '') || 'uk';\n\n // Keep timestamps as they are (seconds since 2001-01-01)\n // The display layer will handle the conversion to human-readable dates\n const cookieRow = BinaryCookieRowSchema.parse({\n name: this.name.replace(/^: /, ''), // Remove leading ': ' if present\n value: this.processValue(this.value) || '', // Process and ensure value is never undefined\n domain,\n path: this.path || '/',\n expiry: this.expiration,\n creation: this.creation,\n flags: flagsValue,\n version: this.version,\n port: this.port,\n comment: this.comment,\n commentURL: this.commentURL\n });\n\n return cookieRow;\n } catch (_error) {\n return null;\n }\n }\n\n private readNullTerminatedString(container: BinaryCodableContainer, offset: number): string {\n let end = offset;\n while (end < container.buffer.length && container.buffer[end] !== 0) {\n end++;\n }\n const value = container.buffer.toString('utf8', offset, end);\n return value || '';\n }\n\n private readHeader(container: BinaryCodableContainer): { size: number; hasPort: number; offsets: BinaryCodableOffsets } {\n // Cookie size (4 bytes)\n const size = container.buffer.readUInt32LE(container.offset);\n container.offset += 4;\n\n // Unknown (4 bytes)\n container.offset += 4;\n\n // Cookie flags (4 bytes)\n const flagsValue = container.buffer.readUInt32LE(container.offset);\n container.offset += 4;\n this.flags = {\n isSecure: (flagsValue & 1) !== 0,\n isHTTPOnly: (flagsValue & 4) !== 0,\n unknown1: (flagsValue & 8) !== 0,\n unknown2: (flagsValue & 16) !== 0\n };\n\n // Unknown (4 bytes)\n const hasPort = container.buffer.readUInt32LE(container.offset);\n container.offset += 4;\n\n // String offsets (24 bytes total)\n const offsets = {\n urlOffset: container.buffer.readUInt32LE(container.offset),\n nameOffset: container.buffer.readUInt32LE(container.offset + 4),\n pathOffset: container.buffer.readUInt32LE(container.offset + 8),\n valueOffset: container.buffer.readUInt32LE(container.offset + 12),\n commentOffset: container.buffer.readUInt32LE(container.offset + 16),\n commentURLOffset: container.buffer.readUInt32LE(container.offset + 20)\n };\n\n return { size, hasPort, offsets };\n }\n\n private readTimestamps(container: BinaryCodableContainer): void {\n // Read expiration time (8 bytes, little-endian double)\n const expirationBuffer = Buffer.alloc(8);\n for (let i = 0; i < 8; i++) {\n expirationBuffer[i] = container.buffer[container.offset + i];\n }\n const expiration = expirationBuffer.readDoubleLE(0);\n container.offset += 8;\n\n // Read creation time (8 bytes, little-endian double)\n const creationBuffer = Buffer.alloc(8);\n for (let i = 0; i < 8; i++) {\n creationBuffer[i] = container.buffer[container.offset + i];\n }\n const creation = creationBuffer.readDoubleLE(0);\n container.offset += 8;\n\n // Store raw timestamps (seconds since 2001-01-01)\n // For expiration time, 0 means \"session cookie\" (expires when browser closes)\n // For creation time, 0 means \"no creation time recorded\"\n this.expiration = expiration;\n this.creation = creation;\n }\n\n private readStrings(container: BinaryCodableContainer, size: number, offsets: BinaryCodableOffsets): void {\n // All offsets are relative to the start of the cookie\n const cookieStart = 0; // Offsets are relative to the cookie buffer start\n\n // Read strings in order of their offsets\n const offsetEntries = [\n { field: 'url', offset: offsets.urlOffset },\n { field: 'name', offset: offsets.nameOffset },\n { field: 'path', offset: offsets.pathOffset },\n { field: 'value', offset: offsets.valueOffset },\n { field: 'comment', offset: offsets.commentOffset }\n ].filter(entry => entry.offset > 0)\n .sort((a, b) => a.offset - b.offset);\n\n // Calculate string lengths based on offset differences\n for (let i = 0; i < offsetEntries.length; i++) {\n const { field, offset } = offsetEntries[i];\n const nextOffset = i < offsetEntries.length - 1 ? offsetEntries[i + 1].offset : size;\n const length = nextOffset - offset;\n\n // Read string up to null terminator\n let end = cookieStart + offset;\n while (end < cookieStart + offset + length && container.buffer[end] !== 0) {\n end++;\n }\n const value = container.buffer.toString('utf8', cookieStart + offset, end);\n\n switch (field) {\n case 'url':\n this.url = value;\n break;\n case 'name':\n this.name = value;\n break;\n case 'path':\n this.path = value;\n break;\n case 'value':\n this.value = value;\n break;\n case 'comment':\n this.comment = value;\n break;\n }\n }\n }\n\n private decode(container: BinaryCodableContainer): void {\n const { size, hasPort, offsets } = this.readHeader(container);\n\n // Skip past all offsets (24 bytes)\n const baseOffset = container.offset;\n container.offset = baseOffset + 24;\n\n this.readTimestamps(container);\n\n if (hasPort > 0) {\n this.port = container.buffer.readUInt16LE(container.offset);\n container.offset += 2;\n }\n\n // Reset offset for string reading\n container.offset = baseOffset;\n this.readStrings(container, size, offsets);\n }\n\n private convertFlags(): number {\n return (this.flags.isSecure ? 0x1 : 0) |\n (this.flags.isHTTPOnly ? 0x4 : 0) |\n (this.flags.unknown1 ? 0x8 : 0) |\n (this.flags.unknown2 ? 0x10 : 0);\n }\n}\n","import destr from \"destr\";\nimport { z } from \"zod\";\n\n/**\n * Zod schema for cookie domain validation.\n * Enforces standard cookie domain rules.\n * @example\n * ```typescript\n * // Valid domains\n * CookieDomainSchema.parse(\"example.com\"); // OK\n * CookieDomainSchema.parse(\".example.com\"); // OK - leading dot is valid\n * CookieDomainSchema.parse(\"sub.example.com\"); // OK\n *\n * // Invalid domains\n * CookieDomainSchema.parse(\"\"); // Error: Domain cannot be empty\n * CookieDomainSchema.parse(\"invalid domain\"); // Error: Invalid domain format\n * ```\n */\nexport const CookieDomainSchema = z\n .string()\n .trim()\n .min(1, \"Domain cannot be empty\")\n .refine(\n (domain) =>\n /^\\.?[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(\n domain,\n ),\n \"Invalid domain format\",\n );\n\n/**\n * Zod schema for cookie name validation.\n * Enforces standard cookie name rules according to RFC 6265.\n * @example\n * ```typescript\n * // Valid names\n * CookieNameSchema.parse(\"session\"); // OK\n * CookieNameSchema.parse(\"auth_token\"); // OK\n * CookieNameSchema.parse(\"user-preference\"); // OK\n *\n * // Invalid names\n * CookieNameSchema.parse(\"\"); // Error: Cookie name cannot be empty\n * CookieNameSchema.parse(\"session;\"); // Error: Invalid cookie name format\n * CookieNameSchema.parse(\"my cookie\"); // Error: Invalid cookie name format\n * ```\n */\nexport const CookieNameSchema = z\n .string()\n .trim()\n .min(1, \"Cookie name cannot be empty\")\n .refine(\n (name) =>\n name === \"%\" || /^[!#$%&'()*+\\-.:0-9A-Z \\^_`a-z|~]+$/.test(name),\n \"Invalid cookie name format - must contain only valid characters (letters, numbers, and certain symbols) or be '%' for wildcard\",\n );\n\n/**\n * Zod schema for cookie path validation.\n * Enforces standard cookie path rules according to RFC 6265.\n * @example\n * ```typescript\n * // Valid paths\n * CookiePathSchema.parse(\"/\"); // OK\n * CookiePathSchema.parse(\"/api\"); // OK\n * CookiePathSchema.parse(\"/path/to/page\"); // OK\n *\n * // Invalid paths\n * CookiePathSchema.parse(\"\"); // Error: Path cannot be empty\n * CookiePathSchema.parse(\"invalid\"); // Error: Path must start with /\n * CookiePathSchema.parse(\"/path?query\"); // Error: Invalid path format\n * ```\n */\nexport const CookiePathSchema = z\n .string()\n .trim()\n .min(1, \"Path cannot be empty\")\n .refine((path) => path.startsWith(\"/\"), \"Path must start with /\")\n .refine(\n (path) => /^\\/[!#$%&'()*+,\\-./:=@\\w~]*$/.test(path),\n \"Invalid path format - must contain only valid URL path characters\",\n )\n .default(\"/\");\n\n/**\n * Zod schema for cookie value.\n * Attempts to parse JSON values using destr for better readability.\n */\nexport const CookieValueSchema = z\n .string()\n .trim()\n .transform((value) => destr(value))\n .pipe(z.any());\n\n/**\n * Zod schema for Safari binary cookie row.\n * Validates and enforces the structure of cookie data read from Safari's Cookies.binarycookies file.\n * @example\n * ```typescript\n * const cookieData = {\n * name: \"session\",\n * value: \"abc123\",\n * domain: \"example.com\",\n * path: \"/\",\n * expiry: 1735689600,\n * creation: 1672531200,\n * flags: 0x5, // Secure + HTTPOnly\n * };\n * const validCookie = BinaryCookieRowSchema.parse(cookieData);\n * ```\n */\nexport const BinaryCookieRowSchema = z.object({\n name: CookieNameSchema,\n value: CookieValueSchema,\n domain: CookieDomainSchema,\n path: CookiePathSchema,\n expiry: z.number().int(),\n creation: z.number().int(),\n flags: z.number().optional(),\n version: z.number().int().optional(),\n port: z.number().int().optional(),\n comment: z.string().optional(),\n commentURL: z.string().optional(),\n});\n\n/**\n * Type representing a decoded Safari binary cookie.\n * This type is inferred from the BinaryCookieRowSchema and includes all cookie properties.\n * @property name - The name of the cookie (non-empty string)\n * @property value - The value stored in the cookie\n * @property domain - The domain the cookie belongs to (non-empty string)\n * @property path - The path where the cookie is valid (defaults to \"/\")\n * @property expiry - Unix timestamp when the cookie expires\n * @property creation - Unix timestamp when the cookie was created\n * @property flags - Optional bit flags (e.g., Secure, HTTPOnly)\n * @property version - Optional cookie version number\n * @property port - Optional port number restriction\n * @property comment - Optional cookie comment\n * @property commentURL - Optional URL for the cookie's comment\n */\nexport type BinaryCookieRow = z.infer<typeof BinaryCookieRowSchema>;\n\n/**\n * Schema for cookie specification parameters\n * Defines the required fields for identifying a cookie\n * @example\n * ```typescript\n * // Validate a cookie specification\n * const spec = {\n * name: 'session',\n * domain: 'example.com'\n * };\n * const result = CookieSpecSchema.safeParse(spec);\n * if (result.success) {\n * console.log('Valid cookie spec:', result.data);\n * } else {\n * console.error('Invalid cookie spec:', result.error);\n * }\n *\n * // Invalid spec (empty name)\n * const invalidSpec = {\n * name: '',\n * domain: 'example.com'\n * };\n * // Throws: \"Cookie name cannot be empty\"\n * CookieSpecSchema.parse(invalidSpec);\n * ```\n */\nexport const CookieSpecSchema = z\n .object({\n name: CookieNameSchema,\n domain: CookieDomainSchema,\n })\n .strict();\n\n/**\n * Type definition for cookie specification\n * Used for specifying which cookie to query\n * @example\n * ```typescript\n * // Basic cookie spec\n * const spec: CookieSpec = {\n * name: 'auth',\n * domain: 'api.example.com'\n * };\n *\n * // Use in function parameters\n * function queryCookie(spec: CookieSpec): Promise<ExportedCookie[]> {\n * return getCookie(spec);\n * }\n *\n * // Array of specs\n * const specs: CookieSpec[] = [\n * { name: 'session', domain: 'app.example.com' },\n * { name: 'theme', domain: 'example.com' }\n * ];\n * ```\n */\nexport type CookieSpec = z.infer<typeof CookieSpecSchema>;\n\n/**\n * Schema for metadata about a cookie\n */\nexport const CookieMetaSchema = z\n .object({\n file: z.string().trim().min(1, \"File path cannot be empty\").optional(),\n browser: z.string().trim().optional(),\n decrypted: z.boolean().optional(),\n secure: z.boolean().optional(),\n httpOnly: z.boolean().optional(),\n path: CookiePathSchema.optional(),\n })\n .catchall(z.unknown())\n .strict();\n\n/**\n * Type definition for cookie metadata\n */\nexport type CookieMeta = z.infer<typeof CookieMetaSchema>;\n\n/**\n * Schema for exported cookie data\n * Represents a cookie with all its properties and metadata\n * @example\n * ```typescript\n * // Validate an exported cookie\n * const cookie = {\n * domain: 'example.com',\n * name: 'session',\n * value: 'abc123',\n * expiry: new Date('2024-12-31'),\n * meta: {\n * file: '/path/to/cookies.db'\n * }\n * };\n * const result = ExportedCookieSchema.safeParse(cookie);\n * if (result.success) {\n * console.log('Valid cookie:', result.data);\n * } else {\n * console.error('Invalid cookie:', result.error);\n * }\n *\n * // Cookie with infinite expiry\n * const infiniteCookie = {\n * ...cookie,\n * expiry: \"Infinity\"\n * };\n * ExportedCookieSchema.parse(infiniteCookie); // OK\n * ```\n */\nexport const ExportedCookieSchema = z\n .object({\n domain: CookieDomainSchema,\n name: CookieNameSchema,\n value: CookieValueSchema,\n expiry: z\n .union([\n z.literal(\"Infinity\"),\n z.date(),\n z.number().int().positive(\"Expiry must be a positive number\"),\n ])\n .optional(),\n meta: CookieMetaSchema.optional(),\n })\n .strict();\n\n/**\n * Type definition for exported cookie data\n * Represents the structure of a cookie after it has been retrieved\n * @example\n * ```typescript\n * // Basic exported cookie\n * const cookie: ExportedCookie = {\n * domain: 'example.com',\n * name: 'session',\n * value: 'abc123',\n * expiry: new Date('2024-12-31'),\n * meta: {\n * file: '/path/to/cookies.db'\n * }\n * };\n *\n * // Process exported cookies\n * function processCookies(cookies: ExportedCookie[]): string[] {\n * return cookies.map(cookie => `${cookie.name}=${cookie.value}`);\n * }\n *\n * // Filter expired cookies\n * function filterExpired(cookies: ExportedCookie[]): ExportedCookie[] {\n * const now = new Date();\n * return cookies.filter(cookie =>\n * cookie.expiry === \"Infinity\" ||\n * (cookie.expiry instanceof Date && cookie.expiry > now)\n * );\n * }\n * ```\n */\nexport type ExportedCookie = z.infer<typeof ExportedCookieSchema>;\n\n/**\n * Schema for raw cookie data from browser stores\n */\nexport const CookieRowSchema = z\n .object({\n expiry: z.number().int().optional(),\n domain: CookieDomainSchema,\n name: CookieNameSchema,\n value: z.union([z.string(), z.instanceof(Buffer)]),\n })\n .strict();\n\n/**\n * Type definition for raw cookie data\n */\nexport type CookieRow = z.infer<typeof CookieRowSchema>;\n\n/**\n * Schema for cookie render options\n */\nexport const RenderOptionsSchema = z\n .object({\n format: z.enum([\"merged\", \"grouped\"]).optional(),\n separator: z.string().optional(),\n showFilePaths: z.boolean().optional(),\n })\n .strict();\n\n/**\n * Type definition for render options\n */\nexport type RenderOptions = z.infer<typeof RenderOptionsSchema>;\n\n/**\n * Schema for browser names\n */\nexport const BrowserNameSchema = z.enum([\n \"Chrome\",\n \"Firefox\",\n \"Safari\",\n \"internal\",\n \"unknown\",\n]);\n\n/**\n * Type definition for browser names\n */\nexport type BrowserName = z.infer<typeof BrowserNameSchema>;\n\n/**\n * Schema for cookie query strategy\n */\nexport const CookieQueryStrategySchema = z\n .object({\n browserName: BrowserNameSchema,\n queryCookies: z\n .function()\n .args(z.string(), z.string())\n .returns(z.promise(z.array(ExportedCookieSchema))),\n })\n .strict();\n\n/**\n * Type definition for cookie query strategy\n */\nexport type CookieQueryStrategy = z.infer<typeof CookieQueryStrategySchema>;\n\n/**\n * Type representing either a single cookie specification or an array of specifications.\n * Useful when you need to query multiple cookies in a single operation.\n * @example\n * ```typescript\n * // Single cookie spec\n * const single: MultiCookieSpec = {\n * domain: \"example.com\",\n * name: \"sessionId\"\n * };\n *\n * // Multiple cookie specs\n * const multiple: MultiCookieSpec = [\n * { domain: \"example.com\", name: \"sessionId\" },\n * { domain: \"api.example.com\", name: \"authToken\" }\n * ];\n * ```\n */\nexport type MultiCookieSpec = CookieSpec | CookieSpec[];\n","import type { BinaryCookieRow } from '../../../types/schemas';\n\nimport { BinaryCodableCookies } from './BinaryCodableCookies';\n\n/**\n * Decodes a Safari binary cookie file into an array of cookie objects.\n * @param cookieDbPath - Path to the Safari Cookies.binarycookies file\n * @returns Array of decoded cookie objects\n * @throws {Error} If the file cannot be read or has invalid format\n */\nexport function decodeBinaryCookies(cookieDbPath: string): BinaryCookieRow[] {\n const cookies = BinaryCodableCookies.fromFile(cookieDbPath);\n return cookies.toCookieRows();\n}\n\n/**\n * Retrieves cookies from Safari's binary cookie store.\n * @returns Array of decoded Safari cookies\n */\nexport function getSafariCookies(): BinaryCookieRow[] {\n const cookies = BinaryCodableCookies.fromDefaultPath();\n return cookies.toCookieRows();\n}\n","import { ChromeCookieQueryStrategy } from \"@core/browsers/chrome/ChromeCookieQueryStrategy\";\nimport { CompositeCookieQueryStrategy } from \"@core/browsers/CompositeCookieQueryStrategy\";\nimport { FirefoxCookieQueryStrategy } from \"@core/browsers/firefox/FirefoxCookieQueryStrategy\";\nimport { SafariCookieQueryStrategy } from \"@core/browsers/safari/SafariCookieQueryStrategy\";\n\n/**\n * Represents a strategy for querying cookies from a browser\n */\nexport type CookieQueryStrategy =\n | CompositeCookieQueryStrategy\n | ChromeCookieQueryStrategy\n | FirefoxCookieQueryStrategy\n | SafariCookieQueryStrategy;\n\n/**\n * Factory for creating browser-specific cookie query strategies\n */\nexport const CookieStrategyFactory = {\n strategies: new Map<string, new () => CookieQueryStrategy>([\n [\"safari\", SafariCookieQueryStrategy],\n [\"firefox\", FirefoxCookieQueryStrategy],\n [\"chrome\", ChromeCookieQueryStrategy],\n ]),\n\n /**\n * Creates a strategy for the specified browser\n * @param browser - The browser to create a strategy for\n * @returns A cookie query strategy for the specified browser\n */\n createStrategy(browser?: string): CookieQueryStrategy {\n if (typeof browser !== \"string\") {\n return new CompositeCookieQueryStrategy([\n new SafariCookieQueryStrategy(),\n new FirefoxCookieQueryStrategy(),\n new ChromeCookieQueryStrategy(),\n ]);\n }\n\n const Strategy = this.strategies.get(browser.toLowerCase());\n if (Strategy !== undefined) {\n return new Strategy();\n }\n\n return new CompositeCookieQueryStrategy([\n new SafariCookieQueryStrategy(),\n new FirefoxCookieQueryStrategy(),\n new ChromeCookieQueryStrategy(),\n ]);\n },\n};\n"],"mappings":";skBAAA,IAAAA,GAEAC,GACAC,GAKMC,GAoBOC,GA5BbC,GAAAC,EAAA,kBAAAN,GAAwB,cAExBC,GAAuB,kBACvBC,GAAkB,kBAGlB,WAAO,EAEDC,GAAoB,KAAE,OAAO,CACjC,UAAW,KAAE,KAAK,CAAC,QAAS,OAAQ,OAAQ,OAAO,CAAC,EAAE,QAAQ,MAAM,EACpE,KAAM,KACH,OAAO,EACP,SAAS,EACT,UAAWI,GAAQA,GAAO,QAAQ,IAAI,aAAe,EAAE,EACvD,KAAK,KAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAC3B,CAAC,EAaYH,GAAMD,GAAkB,MAAM,CACzC,UAAW,QAAQ,IAAI,UACvB,QAAM,YAAQ,CAChB,CAAC,IC/BD,IAAAK,GAaMC,GAoBOC,GA6BNC,EA9DPC,EAAAC,EAAA,kBAAAL,GAA8B,mBAE9BM,KAWML,MAAU,kBAAc,CAC5B,MAAO,GACP,cAAe,CACb,aAAc,GACd,OAAQ,GACR,KAAM,GACN,QAAS,GACT,QACE,OAAO,QAAQ,OAAO,SAAY,SAAW,QAAQ,OAAO,QAAU,EAC1E,EACA,MAAOM,GAAI,YAAc,QAAU,EAAI,CACzC,CAAC,EASYL,GAAUK,GAAI,YAAc,QA6BlCJ,EAAQF,KC1BR,SAASO,GACdC,EACAC,EACAC,EACM,CAEN,IAAMC,EAAU,GADHF,EAAU,SAAM,QACN,IAAID,CAAS,IAAIC,EAAU,YAAc,QAAQ,GAEpEA,EACFG,EAAO,QAAQD,EAASD,CAAO,EAE/BE,EA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["import_os","import_dotenv","import_zod","EnvironmentSchema","env","init_config","__esmMin","val","import_consola","consola","isDebug","logger_default","init_logger","__esmMin","init_config","env","logOperationResult","operation","success","context","message","logger_default","logError","error","errorContext","logDebug","component","data","createTaggedLogger","logWarn","init_logHelpers","__esmMin","init_logger","freeGlobal","freeGlobal_default","init_freeGlobal","__esmMin","freeSelf","root","root_default","init_root","__esmMin","init_freeGlobal","freeGlobal_default","Symbol","Symbol_default","init_Symbol","__esmMin","init_root","root_default","getRawTag","value","isOwn","hasOwnProperty","symToStringTag","tag","unmasked","result","nativeObjectToString","objectProto","getRawTag_default","init_getRawTag","__esmMin","init_Symbol","Symbol_default","objectToString","value","nativeObjectToString","objectProto","objectToString_default","init_objectToString","__esmMin","baseGetTag","value","undefinedTag","nullTag","symToStringTag","getRawTag_default","objectToString_default","baseGetTag_default","init_baseGetTag","__esmMin","init_Symbol","init_getRawTag","init_objectToString","Symbol_default","isObjectLike","value","isObjectLike_default","init_isObjectLike","__esmMin","isSymbol","value","isObjectLike_default","baseGetTag_default","symbolTag","isSymbol_default","init_isSymbol","__esmMin","init_baseGetTag","init_isObjectLike","arrayMap","array","iteratee","index","length","result","arrayMap_default","init_arrayMap","__esmMin","isArray","isArray_default","init_isArray","__esmMin","baseToString","value","isArray_default","arrayMap_default","isSymbol_default","symbolToString","result","INFINITY","symbolProto","baseToString_default","init_baseToString","__esmMin","init_Symbol","init_arrayMap","init_isArray","init_isSymbol","Symbol_default","isObject","value","type","isObject_default","init_isObject","__esmMin","identity","value","identity_default","init_identity","__esmMin","isFunction","value","isObject_default","tag","baseGetTag_default","funcTag","genTag","asyncTag","proxyTag","isFunction_default","init_isFunction","__esmMin","init_baseGetTag","init_isObject","coreJsData","coreJsData_default","init_coreJsData","__esmMin","init_root","root_default","isMasked","func","maskSrcKey","isMasked_default","init_isMasked","__esmMin","init_coreJsData","uid","coreJsData_default","toSource","func","funcToString","funcProto","toSource_default","init_toSource","__esmMin","baseIsNative","value","isObject_default","isMasked_default","pattern","isFunction_default","reIsNative","reIsHostCtor","toSource_default","reRegExpChar","funcProto","objectProto","funcToString","hasOwnProperty","baseIsNative_default","init_baseIsNative","__esmMin","init_isFunction","init_isMasked","init_isObject","init_toSource","getValue","object","key","getValue_default","init_getValue","__esmMin","getNative","object","key","value","getValue_default","baseIsNative_default","getNative_default","init_getNative","__esmMin","init_baseIsNative","init_getValue","WeakMap","WeakMap_default","init_WeakMap","__esmMin","init_getNative","init_root","getNative_default","root_default","defineProperty","defineProperty_default","init_defineProperty","__esmMin","init_getNative","func","getNative_default","isIndex","value","length","type","MAX_SAFE_INTEGER","reIsUint","isIndex_default","init_isIndex","__esmMin","baseAssignValue","object","key","value","defineProperty_default","baseAssignValue_default","init_baseAssignValue","__esmMin","init_defineProperty","eq","value","other","eq_default","init_eq","__esmMin","isLength","value","MAX_SAFE_INTEGER","isLength_default","init_isLength","__esmMin","isArrayLike","value","isLength_default","isFunction_default","isArrayLike_default","init_isArrayLike","__esmMin","init_isFunction","init_isLength","isPrototype","value","Ctor","proto","objectProto","isPrototype_default","init_isPrototype","__esmMin","baseTimes","n","iteratee","index","result","baseTimes_default","init_baseTimes","__esmMin","baseIsArguments","value","isObjectLike_default","baseGetTag_default","argsTag","baseIsArguments_default","init_baseIsArguments","__esmMin","init_baseGetTag","init_isObjectLike","objectProto","hasOwnProperty","propertyIsEnumerable","isArguments","isArguments_default","init_isArguments","__esmMin","init_baseIsArguments","init_isObjectLike","baseIsArguments_default","value","isObjectLike_default","stubFalse","stubFalse_default","init_stubFalse","__esmMin","freeExports","freeModule","moduleExports","Buffer","nativeIsBuffer","isBuffer","isBuffer_default","init_isBuffer","__esmMin","init_root","init_stubFalse","root_default","stubFalse_default","baseIsTypedArray","value","isObjectLike_default","isLength_default","typedArrayTags","baseGetTag_default","argsTag","arrayTag","boolTag","dateTag","errorTag","funcTag","mapTag","numberTag","objectTag","regexpTag","setTag","stringTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","baseIsTypedArray_default","init_baseIsTypedArray","__esmMin","init_baseGetTag","init_isLength","init_isObjectLike","baseUnary","func","value","baseUnary_default","init_baseUnary","__esmMin","freeExports","freeModule","moduleExports","freeProcess","nodeUtil","nodeUtil_default","init_nodeUtil","__esmMin","init_freeGlobal","freeGlobal_default","types","nodeIsTypedArray","isTypedArray","isTypedArray_default","init_isTypedArray","__esmMin","init_baseIsTypedArray","init_baseUnary","init_nodeUtil","nodeUtil_default","baseUnary_default","baseIsTypedArray_default","arrayLikeKeys","value","inherited","isArr","isArray_default","isArg","isArguments_default","isBuff","isBuffer_default","isType","isTypedArray_default","skipIndexes","result","baseTimes_default","length","key","hasOwnProperty","isIndex_default","objectProto","arrayLikeKeys_default","init_arrayLikeKeys","__esmMin","init_baseTimes","init_isArguments","init_isArray","init_isBuffer","init_isIndex","init_isTypedArray","overArg","func","transform","arg","overArg_default","init_overArg","__esmMin","nativeKeys","nativeKeys_default","init_nativeKeys","__esmMin","init_overArg","overArg_default","baseKeys","object","isPrototype_default","nativeKeys_default","result","key","hasOwnProperty","objectProto","baseKeys_default","init_baseKeys","__esmMin","init_isPrototype","init_nativeKeys","keys","object","isArrayLike_default","arrayLikeKeys_default","baseKeys_default","keys_default","init_keys","__esmMin","init_arrayLikeKeys","init_baseKeys","init_isArrayLike","isKey","value","object","isArray_default","type","isSymbol_default","reIsPlainProp","reIsDeepProp","isKey_default","init_isKey","__esmMin","init_isArray","init_isSymbol","nativeCreate","nativeCreate_default","init_nativeCreate","__esmMin","init_getNative","getNative_default","hashClear","nativeCreate_default","hashClear_default","init_hashClear","__esmMin","init_nativeCreate","hashDelete","key","result","hashDelete_default","init_hashDelete","__esmMin","hashGet","key","data","nativeCreate_default","result","HASH_UNDEFINED","hasOwnProperty","objectProto","hashGet_default","init_hashGet","__esmMin","init_nativeCreate","hashHas","key","data","nativeCreate_default","hasOwnProperty","objectProto","hashHas_default","init_hashHas","__esmMin","init_nativeCreate","hashSet","key","value","data","nativeCreate_default","HASH_UNDEFINED","hashSet_default","init_hashSet","__esmMin","init_nativeCreate","Hash","entries","index","length","entry","Hash_default","init_Hash","__esmMin","init_hashClear","init_hashDelete","init_hashGet","init_hashHas","init_hashSet","hashClear_default","hashDelete_default","hashGet_default","hashHas_default","hashSet_default","listCacheClear","listCacheClear_default","init_listCacheClear","__esmMin","assocIndexOf","array","key","length","eq_default","assocIndexOf_default","init_assocIndexOf","__esmMin","init_eq","listCacheDelete","key","data","index","assocIndexOf_default","lastIndex","splice","arrayProto","listCacheDelete_default","init_listCacheDelete","__esmMin","init_assocIndexOf","listCacheGet","key","data","index","assocIndexOf_default","listCacheGet_default","init_listCacheGet","__esmMin","init_assocIndexOf","listCacheHas","key","assocIndexOf_default","listCacheHas_default","init_listCacheHas","__esmMin","init_assocIndexOf","listCacheSet","key","value","data","index","assocIndexOf_default","listCacheSet_default","init_listCacheSet","__esmMin","init_assocIndexOf","ListCache","entries","index","length","entry","ListCache_default","init_ListCache","__esmMin","init_listCacheClear","init_listCacheDelete","init_listCacheGet","init_listCacheHas","init_listCacheSet","listCacheClear_default","listCacheDelete_default","listCacheGet_default","listCacheHas_default","listCacheSet_default","Map","Map_default","init_Map","__esmMin","init_getNative","init_root","getNative_default","root_default","mapCacheClear","Hash_default","Map_default","ListCache_default","mapCacheClear_default","init_mapCacheClear","__esmMin","init_Hash","init_ListCache","init_Map","isKeyable","value","type","isKeyable_default","init_isKeyable","__esmMin","getMapData","map","key","data","isKeyable_default","getMapData_default","init_getMapData","__esmMin","init_isKeyable","mapCacheDelete","key","result","getMapData_default","mapCacheDelete_default","init_mapCacheDelete","__esmMin","init_getMapData","mapCacheGet","key","getMapData_default","mapCacheGet_default","init_mapCacheGet","__esmMin","init_getMapData","mapCacheHas","key","getMapData_default","mapCacheHas_default","init_mapCacheHas","__esmMin","init_getMapData","mapCacheSet","key","value","data","getMapData_default","size","mapCacheSet_default","init_mapCacheSet","__esmMin","init_getMapData","MapCache","entries","index","length","entry","MapCache_default","init_MapCache","__esmMin","init_mapCacheClear","init_mapCacheDelete","init_mapCacheGet","init_mapCacheHas","init_mapCacheSet","mapCacheClear_default","mapCacheDelete_default","mapCacheGet_default","mapCacheHas_default","mapCacheSet_default","memoize","func","resolver","FUNC_ERROR_TEXT","memoized","args","key","cache","result","MapCache_default","memoize_default","init_memoize","__esmMin","init_MapCache","memoizeCapped","func","result","memoize_default","key","cache","MAX_MEMOIZE_SIZE","memoizeCapped_default","init_memoizeCapped","__esmMin","init_memoize","rePropName","reEscapeChar","stringToPath","stringToPath_default","init_stringToPath","__esmMin","init_memoizeCapped","memoizeCapped_default","string","result","match","number","quote","subString","toString","value","baseToString_default","toString_default","init_toString","__esmMin","init_baseToString","castPath","value","object","isArray_default","isKey_default","stringToPath_default","toString_default","castPath_default","init_castPath","__esmMin","init_isArray","init_isKey","init_stringToPath","init_toString","toKey","value","isSymbol_default","result","INFINITY","toKey_default","init_toKey","__esmMin","init_isSymbol","baseGet","object","path","castPath_default","index","length","toKey_default","baseGet_default","init_baseGet","__esmMin","init_castPath","init_toKey","get","object","path","defaultValue","result","baseGet_default","get_default","init_get","__esmMin","init_baseGet","arrayPush","array","values","index","length","offset","arrayPush_default","init_arrayPush","__esmMin","stackClear","ListCache_default","stackClear_default","init_stackClear","__esmMin","init_ListCache","stackDelete","key","data","result","stackDelete_default","init_stackDelete","__esmMin","stackGet","key","stackGet_default","init_stackGet","__esmMin","stackHas","key","stackHas_default","init_stackHas","__esmMin","stackSet","key","value","data","ListCache_default","pairs","Map_default","LARGE_ARRAY_SIZE","MapCache_default","stackSet_default","init_stackSet","__esmMin","init_ListCache","init_Map","init_MapCache","Stack","entries","data","ListCache_default","Stack_default","init_Stack","__esmMin","init_ListCache","init_stackClear","init_stackDelete","init_stackGet","init_stackHas","init_stackSet","stackClear_default","stackDelete_default","stackGet_default","stackHas_default","stackSet_default","arrayFilter","array","predicate","index","length","resIndex","result","value","arrayFilter_default","init_arrayFilter","__esmMin","stubArray","stubArray_default","init_stubArray","__esmMin","objectProto","propertyIsEnumerable","nativeGetSymbols","getSymbols","getSymbols_default","init_getSymbols","__esmMin","init_arrayFilter","init_stubArray","object","arrayFilter_default","symbol","stubArray_default","baseGetAllKeys","object","keysFunc","symbolsFunc","result","isArray_default","arrayPush_default","baseGetAllKeys_default","init_baseGetAllKeys","__esmMin","init_arrayPush","init_isArray","getAllKeys","object","baseGetAllKeys_default","keys_default","getSymbols_default","getAllKeys_default","init_getAllKeys","__esmMin","init_baseGetAllKeys","init_getSymbols","init_keys","DataView","DataView_default","init_DataView","__esmMin","init_getNative","init_root","getNative_default","root_default","Promise","Promise_default","init_Promise","__esmMin","init_getNative","init_root","getNative_default","root_default","Set","Set_default","init_Set","__esmMin","init_getNative","init_root","getNative_default","root_default","mapTag","objectTag","promiseTag","setTag","weakMapTag","dataViewTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","getTag_default","init_getTag","__esmMin","init_DataView","init_Map","init_Promise","init_Set","init_WeakMap","init_baseGetTag","init_toSource","toSource_default","DataView_default","Map_default","Promise_default","Set_default","WeakMap_default","baseGetTag_default","value","result","Ctor","ctorString","Uint8Array","Uint8Array_default","init_Uint8Array","__esmMin","init_root","root_default","setCacheAdd","value","HASH_UNDEFINED","setCacheAdd_default","init_setCacheAdd","__esmMin","setCacheHas","value","setCacheHas_default","init_setCacheHas","__esmMin","SetCache","values","index","length","MapCache_default","SetCache_default","init_SetCache","__esmMin","init_MapCache","init_setCacheAdd","init_setCacheHas","setCacheAdd_default","setCacheHas_default","arraySome","array","predicate","index","length","arraySome_default","init_arraySome","__esmMin","cacheHas","cache","key","cacheHas_default","init_cacheHas","__esmMin","equalArrays","array","other","bitmask","customizer","equalFunc","stack","isPartial","COMPARE_PARTIAL_FLAG","arrLength","othLength","arrStacked","othStacked","index","result","seen","COMPARE_UNORDERED_FLAG","SetCache_default","arrValue","othValue","compared","arraySome_default","othIndex","cacheHas_default","equalArrays_default","init_equalArrays","__esmMin","init_SetCache","init_arraySome","init_cacheHas","mapToArray","map","index","result","value","key","mapToArray_default","init_mapToArray","__esmMin","setToArray","set","index","result","value","setToArray_default","init_setToArray","__esmMin","equalByTag","object","other","tag","bitmask","customizer","equalFunc","stack","dataViewTag","arrayBufferTag","Uint8Array_default","boolTag","dateTag","numberTag","eq_default","errorTag","regexpTag","stringTag","mapTag","convert","mapToArray_default","setTag","isPartial","COMPARE_PARTIAL_FLAG","setToArray_default","stacked","COMPARE_UNORDERED_FLAG","result","equalArrays_default","symbolTag","symbolValueOf","symbolProto","equalByTag_default","init_equalByTag","__esmMin","init_Symbol","init_Uint8Array","init_eq","init_equalArrays","init_mapToArray","init_setToArray","Symbol_default","equalObjects","object","other","bitmask","customizer","equalFunc","stack","isPartial","COMPARE_PARTIAL_FLAG","objProps","getAllKeys_default","objLength","othProps","othLength","index","key","hasOwnProperty","objStacked","othStacked","result","skipCtor","objValue","othValue","compared","objCtor","othCtor","objectProto","equalObjects_default","init_equalObjects","__esmMin","init_getAllKeys","baseIsEqualDeep","object","other","bitmask","customizer","equalFunc","stack","objIsArr","isArray_default","othIsArr","objTag","arrayTag","getTag_default","othTag","argsTag","objectTag","objIsObj","othIsObj","isSameTag","isBuffer_default","Stack_default","isTypedArray_default","equalArrays_default","equalByTag_default","COMPARE_PARTIAL_FLAG","objIsWrapped","hasOwnProperty","othIsWrapped","objUnwrapped","othUnwrapped","equalObjects_default","objectProto","baseIsEqualDeep_default","init_baseIsEqualDeep","__esmMin","init_Stack","init_equalArrays","init_equalByTag","init_equalObjects","init_getTag","init_isArray","init_isBuffer","init_isTypedArray","baseIsEqual","value","other","bitmask","customizer","stack","isObjectLike_default","baseIsEqualDeep_default","baseIsEqual_default","init_baseIsEqual","__esmMin","init_baseIsEqualDeep","init_isObjectLike","baseIsMatch","object","source","matchData","customizer","index","length","noCustomizer","data","key","objValue","srcValue","stack","Stack_default","result","baseIsEqual_default","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","baseIsMatch_default","init_baseIsMatch","__esmMin","init_Stack","init_baseIsEqual","isStrictComparable","value","isObject_default","isStrictComparable_default","init_isStrictComparable","__esmMin","init_isObject","getMatchData","object","result","keys_default","length","key","value","isStrictComparable_default","getMatchData_default","init_getMatchData","__esmMin","init_isStrictComparable","init_keys","matchesStrictComparable","key","srcValue","object","matchesStrictComparable_default","init_matchesStrictComparable","__esmMin","baseMatches","source","matchData","getMatchData_default","matchesStrictComparable_default","object","baseIsMatch_default","baseMatches_default","init_baseMatches","__esmMin","init_baseIsMatch","init_getMatchData","init_matchesStrictComparable","baseHasIn","object","key","baseHasIn_default","init_baseHasIn","__esmMin","hasPath","object","path","hasFunc","castPath_default","index","length","result","key","toKey_default","isLength_default","isIndex_default","isArray_default","isArguments_default","hasPath_default","init_hasPath","__esmMin","init_castPath","init_isArguments","init_isArray","init_isIndex","init_isLength","init_toKey","hasIn","object","path","hasPath_default","baseHasIn_default","hasIn_default","init_hasIn","__esmMin","init_baseHasIn","init_hasPath","baseMatchesProperty","path","srcValue","isKey_default","isStrictComparable_default","matchesStrictComparable_default","toKey_default","object","objValue","get_default","hasIn_default","baseIsEqual_default","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","baseMatchesProperty_default","init_baseMatchesProperty","__esmMin","init_baseIsEqual","init_get","init_hasIn","init_isKey","init_isStrictComparable","init_matchesStrictComparable","init_toKey","baseProperty","key","object","baseProperty_default","init_baseProperty","__esmMin","basePropertyDeep","path","object","baseGet_default","basePropertyDeep_default","init_basePropertyDeep","__esmMin","init_baseGet","property","path","isKey_default","baseProperty_default","toKey_default","basePropertyDeep_default","property_default","init_property","__esmMin","init_baseProperty","init_basePropertyDeep","init_isKey","init_toKey","baseIteratee","value","identity_default","isArray_default","baseMatchesProperty_default","baseMatches_default","property_default","baseIteratee_default","init_baseIteratee","__esmMin","init_baseMatches","init_baseMatchesProperty","init_identity","init_isArray","init_property","arrayAggregator","array","setter","iteratee","accumulator","index","length","value","arrayAggregator_default","init_arrayAggregator","__esmMin","createBaseFor","fromRight","object","iteratee","keysFunc","index","iterable","props","length","key","createBaseFor_default","init_createBaseFor","__esmMin","baseFor","baseFor_default","init_baseFor","__esmMin","init_createBaseFor","createBaseFor_default","baseForOwn","object","iteratee","baseFor_default","keys_default","baseForOwn_default","init_baseForOwn","__esmMin","init_baseFor","init_keys","createBaseEach","eachFunc","fromRight","collection","iteratee","isArrayLike_default","length","index","iterable","createBaseEach_default","init_createBaseEach","__esmMin","init_isArrayLike","baseEach","baseEach_default","init_baseEach","__esmMin","init_baseForOwn","init_createBaseEach","createBaseEach_default","baseForOwn_default","baseAggregator","collection","setter","iteratee","accumulator","baseEach_default","value","key","baseAggregator_default","init_baseAggregator","__esmMin","init_baseEach","createAggregator","setter","initializer","collection","iteratee","func","isArray_default","arrayAggregator_default","baseAggregator_default","accumulator","baseIteratee_default","createAggregator_default","init_createAggregator","__esmMin","init_arrayAggregator","init_baseAggregator","init_baseIteratee","init_isArray","objectProto","hasOwnProperty","groupBy","groupBy_default","init_groupBy","__esmMin","init_baseAssignValue","init_createAggregator","createAggregator_default","result","value","key","baseAssignValue_default","init_lodash","__esmMin","init_groupBy","init_memoize","handleExecutionError","error","command","CommandExecutionError","logError","commandError","execSimple","options","defaultOptions","stdout","stderr","execPromise","result","import_child_process","import_util","init_execSimple","__esmMin","init_logHelpers","message","originalError","getChromePassword_exports","__export","getChromePassword","getChromeSafeStoragePassword","init_getChromePassword","__esmMin","init_lodash","init_execSimple","execSimple","memoize_default","processDomainsIntoCookieSpecs","domain","parts","cookieSpecs","i","subDomain","cookieSpecsFromUrl","url","urlObj","import_minimist","parseArgv","argv","parsed","minimist","_","values","init_logger","init_logHelpers","init_logger","DefaultOutputHandler","_args","results","uniqueValues","result","value","logger_default","init_logger","DumpOutputHandler","args","results","logger_default","init_lodash","init_logger","GroupedDumpOutputHandler","args","results","groupedByFile","groupBy_default","r","logger_default","init_lodash","renderCookies","cookies","options","format","showFilePaths","separator","c","groupedByFile","groupBy_default","file","fileCookies","values","init_logger","GroupedRenderOutputHandler","args","results","logger_default","renderCookies","init_logger","JsonOutputHandler","args","results","logger_default","init_logger","RenderOutputHandler","args","results","logger_default","renderCookies","OutputHandlerFactory","DumpOutputHandler","GroupedDumpOutputHandler","RenderOutputHandler","GroupedRenderOutputHandler","JsonOutputHandler","DefaultOutputHandler","args","handler","import_date_fns","filterExpired","cookies","now","cookie","CookieQueryService","strategy","spec","_limit","init_logHelpers","import_fs","import_path","import_fast_glob","init_logHelpers","import_os","import_path","chromeApplicationSupport","home","import_better_sqlite3","init_logHelpers","openDatabase","file","BetterSqlite3","error","logError","closeDatabase","db","querySqliteThenTransform","sql","params","rowFilter","rowTransform","rows","filteredRows","isValidFilePath","path","trimmedPath","getCookieFiles","patterns","chromeApplicationSupport","files","pattern","matches","glob","logDebug","buildSqlQuery","name","domain","isWildcard","sql","params","processCookieFile","cookieFile","rows","querySqliteThenTransform","row","logOperationResult","error","logError","getEncryptedChromeCookie","file","cookieFiles","results","cookies","import_fast_glob","init_logger","consola","logger_default","listChromeProfilePaths","files","fg","chromeApplicationSupport","import_crypto","init_lodash","removeV10Prefix","memoize_default","value","removePadding","decrypted","padding","extractValue","decodedString","cleanupPatterns","pattern","decrypt","encryptedValue","password","resolve","reject","error","key","iv","decipher","e","init_lodash","init_logHelpers","getChromePassword","memoize_default","logError","getMacOSPassword","password","logDebug","error","getExpiryDate","expiry","createExportedCookie","domain","name","value","file","decrypted","ChromeCookieQueryStrategy","createTaggedLogger","cookieFiles","listChromeProfilePaths","password","getChromePassword","error","logError","encryptedCookies","getEncryptedChromeCookie","context","cookie","result","decryptedValue","decrypt","flatMapAsync","array","callback","defaultValue","item","init_logHelpers","CompositeCookieQueryStrategy","strategies","createTaggedLogger","error","strategy","name","domain","flatMapAsync","import_os","import_path","import_fast_glob","init_logHelpers","findFirefoxCookieFiles","home","logWarn","patterns","files","pattern","matches","fg","logDebug","FirefoxCookieQueryStrategy","name","domain","results","file","cookies","querySqliteThenTransform","row","error","import_os","import_path","init_logHelpers","import_buffer","import_fs","import_os","import_path","init_logHelpers","init_logHelpers","import_buffer","import_destr","import_zod","CookieDomainSchema","domain","CookieNameSchema","name","CookiePathSchema","path","CookieValueSchema","value","destr","BinaryCookieRowSchema","CookieSpecSchema","CookieMetaSchema","ExportedCookieSchema","CookieRowSchema","RenderOptionsSchema","BrowserNameSchema","CookieQueryStrategySchema","BinaryCodableCookie","buffer","container","value","processed","lastProcessed","token","parts","payload","parsed","decoded","jwtPayload","jsonValue","flagsValue","domain","BinaryCookieRowSchema","offset","end","size","hasPort","offsets","expirationBuffer","i","expiration","creationBuffer","creation","offsetEntries","entry","a","b","field","length","baseOffset","_BinaryCodablePage","buffer","container","cookies","cookie","cookieRow","error","errorMessage","logWarn","header","cookieCount","pageStart","cookieOffsets","i","cookieOffset","footer","absoluteOffset","cookieSize","cookieBuffer","BinaryCodableCookie","BinaryCodablePage","_BinaryCodableCookies","buffer","container","path","cookies","page","pageCookies","error","errorMessage","logWarn","magic","pageCount","pageSizes","i","currentOffset","pageSize","pageBuffer","BinaryCodablePage","_checksum","footer","_plistData","BinaryCodableCookies","decodeBinaryCookies","cookieDbPath","BinaryCodableCookies","SafariCookieQueryStrategy","home","cookieDbPath","name","domain","decodeBinaryCookies","cookie","error","logError","CookieStrategyFactory","SafariCookieQueryStrategy","FirefoxCookieQueryStrategy","ChromeCookieQueryStrategy","browser","CompositeCookieQueryStrategy","Strategy","queryCookiesWithLimit","queryService","specs","limit","results","spec","cookies","cliQueryCookies","args","cookieSpec","removeExpired","browser","strategy","CookieStrategyFactory","CookieQueryService","filterExpired","logger_default","OutputHandlerFactory","error","showHelp","logger_default","createCookieSpec","name","domain","getCookieSpecs","values","positionals","url","specs","cookieSpecsFromUrl","handleCookieQuery","cookieSpecs","cliQueryCookies","error","main","args","parseArgv"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/cookies/cookieSpecsFromUrl.ts","../src/utils/argv.ts","../src/utils/logger.ts","../src/config.ts","../src/utils/logHelpers.ts","../src/cli/services/CookieQueryService.ts","../src/core/browsers/getEncryptedChromeCookie.ts","../src/core/browsers/chrome/ChromeApplicationSupport.ts","../src/core/browsers/QuerySqliteThenTransform.ts","../src/core/browsers/listChromeProfiles.ts","../src/core/browsers/chrome/decrypt.ts","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js","../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js","../src/core/browsers/chrome/getChromePassword.ts","../src/utils/execSimple.ts","../src/core/browsers/chrome/macos/getChromePassword.ts","../src/core/browsers/chrome/ChromeCookieQueryStrategy.ts","../src/utils/flatMapAsync.ts","../src/core/browsers/CompositeCookieQueryStrategy.ts","../src/core/browsers/firefox/FirefoxCookieQueryStrategy.ts","../src/core/browsers/safari/SafariCookieQueryStrategy.ts","../src/core/browsers/safari/BinaryCodableCookies.ts","../src/core/browsers/safari/BinaryCodableCookie.ts","../src/types/schemas.ts","../src/core/browsers/safari/BinaryCodablePage.ts","../src/core/browsers/safari/decodeBinaryCookies.ts","../src/cli/services/CookieStrategyFactory.ts","../src/cli/cliQueryCookies.ts","../src/cli/cli.ts"],"sourcesContent":["import type { CookieSpec } from \"../../types/schemas\";\n\n/**\n * Process a domain into cookie specifications, including parent domains\n * @internal\n * @param domain - The domain to process (e.g., 'api.example.com')\n * @returns Array of cookie specifications for the domain and its parents\n */\nfunction processDomainsIntoCookieSpecs(domain: string): CookieSpec[] {\n const parts = domain.split(\".\");\n const cookieSpecs: CookieSpec[] = [];\n\n /**\n * Add the full domain first to ensure exact matches are prioritized\n * The '%' wildcard in the name field matches any cookie name for this domain\n */\n cookieSpecs.push({\n name: \"%\",\n domain: domain,\n });\n\n /**\n * Add parent domains to support domain-level cookie matching\n * For example, for 'sub.example.com', we also want to match 'example.com'\n * This is important because cookies can be set at parent domain levels\n */\n for (let i = 1; i < parts.length - 1; i++) {\n const subDomain = parts.slice(i).join(\".\");\n cookieSpecs.push({\n name: \"%\",\n domain: subDomain,\n });\n }\n\n return cookieSpecs;\n}\n\n/**\n * Generate cookie specifications from a URL by creating specs for both the exact domain\n * and its parent domains. This allows for proper cookie matching across domain levels.\n * @param url - The URL to generate cookie specs from (e.g., 'https://example.com' or just 'example.com')\n * @returns An array of cookie specifications for the URL and its parent domains\n * @remarks\n * - If the URL is provided without a protocol, it will first try to parse with 'https://' prefix\n * - If parsing fails, it will treat the input as a plain domain name\n * - The function handles invalid URLs gracefully by treating them as domain names\n * - The '%' wildcard is used for the name to match all cookies for the domain\n * @example\n * ```typescript\n * // Basic URL with protocol\n * cookieSpecsFromUrl('https://example.com')\n * // Returns: [{ name: '%', domain: 'example.com' }]\n *\n * // URL with subdomain\n * cookieSpecsFromUrl('https://api.example.com')\n * // Returns: [\n * // { name: '%', domain: 'api.example.com' },\n * // { name: '%', domain: 'example.com' }\n * // ]\n *\n * // Domain without protocol (automatically handled)\n * cookieSpecsFromUrl('example.com')\n * // Returns: [{ name: '%', domain: 'example.com' }]\n * ```\n */\nexport function cookieSpecsFromUrl(url: string): CookieSpec[] {\n // For URLs without protocol, try adding https://\n if (!url.includes(\"://\")) {\n try {\n return cookieSpecsFromUrl(`https://${url}`);\n } catch {\n // If adding protocol fails, treat as domain name\n return [\n {\n name: \"%\",\n domain: url,\n },\n ];\n }\n }\n\n try {\n const urlObj = new URL(url);\n return processDomainsIntoCookieSpecs(urlObj.hostname);\n } catch (_error) {\n /**\n * Fallback handling for any parsing errors\n * This ensures the function remains robust even with invalid input\n * Returns a single spec treating the entire input as a domain name\n */\n return [\n {\n name: \"%\",\n domain: url,\n },\n ];\n }\n}\n","import minimist from \"minimist\";\n\n/**\n * Interface representing parsed command line arguments.\n * @property values - Record of option values parsed from command line\n * @property positionals - Array of positional arguments\n * @example\n * ```typescript\n * const args: ParsedArgs = {\n * values: {\n * browser: 'chrome',\n * profile: 'default',\n * verbose: true\n * },\n * positionals: ['script.js', 'input.txt']\n * }\n * ```\n */\ninterface ParsedArgs {\n /** Record of option values parsed from command line */\n values: Record<string, string | boolean | string[]>;\n /** Array of positional arguments */\n positionals: string[];\n}\n\n/**\n * Parses command line arguments into a structured format.\n * @internal\n * @param argv - Array of command line arguments to parse\n * @returns Parsed command line arguments object\n * @example\n * ```typescript\n * // Basic usage\n * const args = parseArgv(['--browser', 'chrome', '--verbose', 'script.js']);\n * // Returns: { values: { browser: 'chrome', verbose: true }, positionals: ['script.js'] }\n *\n * // Using short options\n * const args = parseArgv(['-b', 'firefox', '-v', 'script.js']);\n * // Returns: { values: { browser: 'firefox', verbose: true }, positionals: ['script.js'] }\n *\n * // Error handling\n * const args = parseArgv(['--invalid']); // Will throw error for unknown option\n * ```\n */\nexport function parseArgv(argv: string[]): ParsedArgs {\n const parsed = minimist(argv, {\n string: [\"browser\", \"profile\", \"url\", \"domain\", \"name\", \"output\", \"store\"],\n boolean: [\n \"help\",\n \"version\",\n \"verbose\",\n \"dump\",\n \"dump-grouped\",\n \"render\",\n \"render-grouped\",\n ],\n alias: {\n b: \"browser\",\n p: \"profile\",\n u: \"url\",\n d: \"domain\",\n n: \"name\",\n h: \"help\",\n v: \"version\",\n D: \"dump-grouped\",\n r: \"render\",\n R: \"render-grouped\",\n },\n });\n\n const { _, ...values } = parsed;\n return { values, positionals: _ };\n}\n","import { type ConsolaInstance, createConsola } from \"consola\";\n\nimport { env } from \"../config\";\n\n/**\n * Standard log levels and their usage:\n * - debug: Detailed information for debugging\n * - info: General operational information\n * - success: Successful operations\n * - warn: Warning conditions\n * - error: Error conditions that might still allow the app to continue\n * - fatal: Critical errors that prevent the app from continuing\n */\nconst consola = createConsola({\n fancy: true,\n formatOptions: {\n showLogLevel: false,\n colors: true,\n date: false,\n compact: true,\n columns:\n typeof process.stdout.columns === \"number\" ? process.stdout.columns : 80,\n },\n level: env.LOG_LEVEL === \"debug\" ? 5 : 2,\n});\n\n/**\n * Indicates whether debug logging is enabled\n * @example\n * if (isDebug) {\n * logger.debug(\"Detailed debugging information\");\n * }\n */\nexport const isDebug = env.LOG_LEVEL === \"debug\";\n\n/**\n * Configured logger instance with standardized formatting and colored output.\n * Used for consistent logging throughout the application.\n * @example\n * // Basic usage\n * logger.info('Operation started');\n * logger.success('Task completed');\n * logger.error('Failed to process', error);\n *\n * // Tagged logging for module context\n * const moduleLogger = logger.withTag('ModuleName');\n * moduleLogger.info('Module specific log');\n *\n * // Structured logging\n * logger.info('User action', {\n * userId: '123',\n * action: 'login',\n * timestamp: new Date()\n * });\n *\n * // Error logging with full context\n * logger.error('Operation failed', {\n * error: error,\n * context: 'operation name',\n * input: data\n * });\n */\nconst logger: ConsolaInstance = consola;\n\n/**\n *\n */\nexport default logger;\n","import { homedir } from \"os\";\n\nimport { config } from \"dotenv\";\nimport { z } from \"zod\";\n\n// Load environment variables from .env file\nconfig();\n\nconst EnvironmentSchema = z.object({\n LOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n HOME: z\n .string()\n .optional()\n .transform((val) => val ?? process.env.USERPROFILE ?? \"\")\n .pipe(z.string().min(1)),\n});\n\n/**\n * Validated environment variables with type safety and fallbacks\n * @example\n * // Using the environment variables\n * if (env.LOG_LEVEL === \"debug\") {\n * console.log(\"Debug mode enabled\");\n * }\n *\n * // Accessing home directory\n * const cookiePath = join(env.HOME, \"Library/Cookies\");\n */\nexport const env = EnvironmentSchema.parse({\n LOG_LEVEL: process.env.LOG_LEVEL,\n HOME: homedir(),\n});\n","import { type ConsolaInstance } from \"consola\";\n\nimport logger from \"./logger\";\n\n/**\n * Helper functions for common logging patterns.\n * @module\n * @example\n * ```typescript\n * import { logOperationResult, logError } from './logHelpers';\n *\n * try {\n * const result = await someOperation();\n * logOperationResult('Operation', true, { data: result });\n * } catch (error) {\n * logError('Operation failed', error);\n * }\n * ```\n */\n\ninterface OperationContext {\n [key: string]: unknown;\n}\n\n/**\n * Log the result of an operation with consistent formatting\n * @param operation - The name of the operation\n * @param success - Whether the operation was successful\n * @param context - Additional context to log\n */\nexport function logOperationResult(\n operation: string,\n success: boolean,\n context?: OperationContext,\n): void {\n if (success) {\n logger.success(`${operation} succeeded`, context);\n } else {\n logger.error(`${operation} failed`, context);\n }\n}\n\n/**\n * Log an error with consistent formatting\n * @param message - The error message\n * @param error - The error object\n * @param context - Additional context to log\n */\nexport function logError(\n message: string,\n error: unknown,\n context?: OperationContext,\n): void {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logger.error(message, { ...context, error: errorMessage });\n}\n\n/**\n * Log a warning with consistent formatting\n * @param component - The component generating the warning\n * @param message - The warning message\n * @param context - Additional context to log\n */\nexport function logWarn(\n component: string,\n message: string,\n context?: OperationContext,\n): void {\n logger.warn(`[${component}] ${message}`, context);\n}\n\n/**\n * Create a logger instance with a component tag\n * @param component - The component name to tag logs with\n * @returns A logger instance that prefixes all messages with the component tag\n * @example\n * ```typescript\n * const dbLogger = createTaggedLogger('Database');\n * dbLogger.info('Connection established');\n * ```\n */\nexport function createTaggedLogger(component: string): ConsolaInstance {\n return logger.withTag(component);\n}\n\n// Re-export the base logger for direct usage\n/**\n * Re-export of the base logger for direct usage.\n */\nexport { default as logger } from \"./logger\";\n","import type {\n CookieSpec,\n ExportedCookie,\n CookieQueryOptions,\n} from \"../../types/schemas\";\n\nimport type { CookieQueryStrategy } from \"./CookieStrategyFactory\";\n\n/**\n * Service for querying cookies using a strategy\n */\nexport class CookieQueryService {\n /**\n * Creates a new CookieQueryService instance\n * @param strategy - The strategy to use for querying cookies\n */\n public constructor(private readonly strategy: CookieQueryStrategy) {}\n\n /**\n * Queries cookies from the strategy with options\n * @param spec - The cookie specification to query for\n * @param options - Query options including limit, removeExpired, and store path\n * @returns Array of exported cookies\n */\n public async queryCookies(\n spec: CookieSpec,\n options?: CookieQueryOptions,\n ): Promise<ExportedCookie[]> {\n return this.strategy.queryCookies(spec.name, spec.domain, options?.store);\n }\n}\n","import { existsSync } from \"fs\";\nimport { join } from \"path\";\n\nimport glob from \"fast-glob\";\n\nimport {\n logError,\n logOperationResult,\n createTaggedLogger,\n} from \"@utils/logHelpers\";\n\nimport type { CookieRow } from \"../../types/schemas\";\n\nimport { chromeApplicationSupport } from \"./chrome/ChromeApplicationSupport\";\nimport { querySqliteThenTransform } from \"./QuerySqliteThenTransform\";\n\nconst logger = createTaggedLogger(\"getEncryptedChromeCookie\");\n\ninterface ChromeCookieRow {\n encrypted_value: Buffer;\n name: string;\n host_key: string;\n expires_utc: number;\n}\n\ninterface GetEncryptedCookieOptions {\n name: string;\n domain: string;\n file?: string;\n}\n\ninterface SqlQuery {\n sql: string;\n params: string[];\n}\n\n/**\n * Validates if a path is a valid, existing file\n * @param path - Path to validate\n * @returns true if path is valid and file exists, false otherwise\n */\nfunction isValidFilePath(path: unknown): path is string {\n if (typeof path !== \"string\") {\n return false;\n }\n\n const trimmedPath = path.trim();\n if (trimmedPath.length === 0) {\n return false;\n }\n\n return existsSync(trimmedPath);\n}\n\n/**\n * Get paths to Chrome cookie files\n * @returns A promise that resolves to an array of file paths\n */\nasync function getCookieFiles(): Promise<string[]> {\n const patterns = [\n join(chromeApplicationSupport, \"Default/Cookies\"),\n join(chromeApplicationSupport, \"Profile */Cookies\"),\n join(chromeApplicationSupport, \"Profile Default/Cookies\"),\n ];\n\n const files: string[] = [];\n for (const pattern of patterns) {\n const matches = await glob(pattern);\n files.push(...matches);\n }\n\n logger.debug(\"ChromeCookies\", \"Found cookie files\", {\n count: files.length,\n files,\n });\n return files;\n}\n\n/**\n * Builds the SQL query for retrieving cookies\n * @param name - Cookie name to search for\n * @param domain - Domain to filter by\n * @returns SQL query and parameters\n */\nfunction buildSqlQuery(name: string, domain: string): SqlQuery {\n const isWildcard = name === \"%\";\n const sql = isWildcard\n ? `SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE host_key LIKE ?`\n : `SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE name = ? AND host_key LIKE ?`;\n const params = isWildcard ? [`%${domain}%`] : [name, `%${domain}%`];\n\n return { sql, params };\n}\n\n/**\n * Processes a single cookie file to extract matching cookies\n * @param cookieFile - Path to the cookie file\n * @param name - Cookie name to search for\n * @param domain - Domain to filter by\n * @returns Array of matching cookies\n */\nasync function processCookieFile(\n cookieFile: string,\n name: string,\n domain: string,\n): Promise<CookieRow[]> {\n try {\n const { sql, params } = buildSqlQuery(name, domain);\n logger.debug(\"ChromeCookies\", \"Executing query\", { sql, params });\n\n const rows = await querySqliteThenTransform<ChromeCookieRow, CookieRow>({\n file: cookieFile,\n sql,\n params,\n rowTransform: (row: ChromeCookieRow): CookieRow => ({\n name: row.name,\n domain: row.host_key,\n value: row.encrypted_value,\n expiry: row.expires_utc,\n }),\n });\n\n logOperationResult(\"QueryCookies\", true, {\n file: cookieFile,\n count: rows.length,\n });\n return rows;\n } catch (error) {\n logError(\"Failed to read cookie file\", error, { file: cookieFile });\n return [];\n }\n}\n\n/**\n * Retrieve encrypted cookies from Chrome's cookie store\n * @param options - Options for querying Chrome cookies\n * @param options.name - The name of the cookie to retrieve\n * @param options.domain - The domain to retrieve cookies from\n * @param options.file - Optional specific cookie file to query\n * @returns Promise resolving to array of encrypted cookies\n */\nexport async function getEncryptedChromeCookie({\n name,\n domain,\n file,\n}: GetEncryptedCookieOptions): Promise<CookieRow[]> {\n const cookieFiles =\n typeof file === \"string\" && file.length > 0\n ? [file]\n : await getCookieFiles();\n\n if (cookieFiles.length === 0) {\n logger.debug(\"ChromeCookies\", \"No cookie files found\");\n return [];\n }\n\n const results: CookieRow[] = [];\n for (const cookieFile of cookieFiles) {\n if (!isValidFilePath(cookieFile)) {\n logger.debug(\"ChromeCookies\", \"Cookie file missing or invalid\", {\n file: cookieFile,\n });\n continue;\n }\n\n const cookies = await processCookieFile(cookieFile, name, domain);\n results.push(...cookies);\n }\n\n logger.debug(\"ChromeCookies\", \"Query complete\", {\n totalCookies: results.length,\n });\n return results;\n}\n","import { homedir } from \"os\";\nimport { join } from \"path\";\n\n/**\n * The path to Chrome's application support directory on macOS\n * This constant is used to locate Chrome's profile and cookie storage directories\n * @throws {Error} If unable to determine user's home directory\n */\nexport const chromeApplicationSupport = (() => {\n const home = homedir();\n if (!home) {\n throw new Error(\"Unable to determine user home directory\");\n }\n return join(home, \"Library\", \"Application Support\", \"Google\", \"Chrome\");\n})();\n","// External imports\nimport BetterSqlite3, { Database } from \"better-sqlite3\";\n\n// Internal imports\nimport { logError } from \"@utils/logHelpers\";\n\ninterface QuerySqliteThenTransformOptions<TRow, TResult> {\n file: string;\n sql: string;\n params?: unknown[];\n rowFilter?: (row: TRow) => boolean;\n rowTransform?: (row: TRow) => TResult;\n}\n\nfunction openDatabase(file: string): Database {\n try {\n return new BetterSqlite3(file, { readonly: true, fileMustExist: true });\n } catch (error) {\n logError(\"Database open failed\", error, { file });\n throw error;\n }\n}\n\nfunction closeDatabase(db: Database): Promise<void> {\n try {\n db.close();\n return Promise.resolve();\n } catch (error) {\n logError(\"Database close failed\", error);\n return Promise.reject(\n error instanceof Error\n ? error\n : new Error(\"Failed to close database: Unknown error\"),\n );\n }\n}\n\n/**\n * Executes a SQL query on a SQLite database file and transforms the results\n * @param root0 - The options object containing query parameters\n * @param root0.file - The path to the SQLite database file\n * @param root0.sql - The SQL query to execute\n * @param root0.params - Optional parameters for the SQL query\n * @param root0.rowFilter - Optional function to filter rows from the result set\n * @param root0.rowTransform - Optional function to transform each row before returning\n * @returns A promise that resolves to an array of transformed results\n */\nexport async function querySqliteThenTransform<TRow, TResult>({\n file,\n sql,\n params,\n rowFilter,\n rowTransform,\n}: QuerySqliteThenTransformOptions<TRow, TResult>): Promise<TResult[]> {\n let db: Database | undefined;\n\n try {\n db = openDatabase(file);\n const stmt = db.prepare(sql);\n const rows = stmt.all(params) as TRow[];\n\n const filteredRows = rowFilter ? rows.filter(rowFilter) : rows;\n const transformedRows = rowTransform\n ? filteredRows.map(rowTransform)\n : (filteredRows as unknown as TResult[]);\n\n return transformedRows;\n } catch (error) {\n logError(\"Database query failed\", error, { file, sql });\n throw error;\n } finally {\n if (db) {\n await closeDatabase(db);\n }\n }\n}\n","// External imports\nimport { readFileSync } from \"fs\";\nimport { join } from \"path\";\n\nimport fg from \"fast-glob\";\n\n// Internal imports\nimport { createTaggedLogger } from \"../../utils/logHelpers\";\n\nimport { chromeApplicationSupport } from \"./chrome/ChromeApplicationSupport\";\n\nconst logger = createTaggedLogger(\"listChromeProfiles\");\n\n/**\n * Lists all Chrome profile paths that contain cookie files\n * @internal\n * @returns An array of absolute paths to Chrome cookie files\n * @throws {Error} If Chrome's application support directory cannot be accessed\n * @example\n * ```typescript\n * // Get all Chrome cookie file paths\n * const cookiePaths = listChromeProfilePaths();\n * // Returns: [\n * // '/Users/name/Library/Application Support/Chrome/Profile 1/Cookies',\n * // '/Users/name/Library/Application Support/Chrome/Profile 2/Cookies'\n * // ]\n *\n * // Handle errors\n * try {\n * const paths = listChromeProfilePaths();\n * } catch (error) {\n * logger.error('Failed to access Chrome profiles', { error });\n * }\n * ```\n */\nexport function listChromeProfilePaths(): string[] {\n const files: string[] = fg.sync(`./**/Cookies`, {\n cwd: chromeApplicationSupport,\n absolute: true,\n });\n\n logger.debug(\"Found cookie files:\", files);\n return files;\n}\n\n/**\n * Chrome Local State file structure\n * @internal\n */\ninterface ChromeLocalState {\n profile: {\n info_cache: Record<string, ChromeProfileInfo>;\n };\n}\n\n/**\n * Chrome profile information structure\n * @property {string} name - The name of the profile\n * @property {number} active_time - Unix timestamp of last profile activity\n * @property {string} account_id - Unique identifier for the Chrome profile\n * @property {Record<string, unknown>} accountcapabilities - Account feature flags\n * @property {string} email - User's email address\n * @property {string} full_name - User's full name\n * @property {boolean} is_using_default_avatar - Whether using default profile picture\n * @property {boolean} is_using_default_name - Whether using default profile name\n * @property {string} last_downloaded_gaia_picture_url_with_size - Profile picture URL\n * @property {string} local_auth_credentials - Authentication credentials\n * @property {string} shortcut_name - Profile shortcut name\n * @property {string} user_name - Username associated with profile\n */\ninterface ChromeProfileInfo {\n /** The name of the profile */\n name: string;\n /** Unix timestamp of last profile activity */\n active_time: number;\n /** Unique identifier for the Chrome profile */\n account_id: string;\n /** Account feature flags */\n accountcapabilities: Record<string, unknown>;\n /** User's email address */\n email: string;\n /** User's full name */\n full_name: string;\n /** Whether using default profile picture */\n is_using_default_avatar: boolean;\n /** Whether using default profile name */\n is_using_default_name: boolean;\n /** Profile picture URL */\n last_downloaded_gaia_picture_url_with_size: string;\n /** Authentication credentials */\n local_auth_credentials: string;\n /** Profile shortcut name */\n shortcut_name: string;\n /** Username associated with profile */\n user_name: string;\n}\n\n/**\n * Lists all Chrome profiles and their associated information\n * @internal\n * @returns An array of Chrome profile information objects. Returns empty array if profiles cannot be read\n * @throws {Error} If Chrome's application support directory cannot be accessed\n * @example\n * ```typescript\n * // Get all Chrome profiles\n * const profiles = listChromeProfiles();\n * // Returns: [\n * // {\n * // name: \"Default\",\n * // email: \"user@example.com\",\n * // full_name: \"John Doe\",\n * // ...\n * // },\n * // ...\n * // ]\n *\n * // Handle empty or error case\n * const profiles = listChromeProfiles();\n * if (profiles.length === 0) {\n * logger.warn('No Chrome profiles found');\n * }\n * ```\n */\nexport function listChromeProfiles(): ChromeProfileInfo[] {\n try {\n const localStatePath = join(chromeApplicationSupport, \"Local State\");\n const localState = JSON.parse(\n readFileSync(localStatePath, \"utf8\"),\n ) as ChromeLocalState;\n return Object.values(localState.profile.info_cache);\n } catch (error) {\n logger.debug(\"Failed to access Chrome profiles\", { error });\n return [];\n }\n}\n","// External imports\nimport { createDecipheriv, pbkdf2 } from \"crypto\";\n\nimport { memoize } from \"lodash-es\";\n\n/**\n * Removes the v10 prefix from the encrypted value if present\n * @param value - The encrypted value\n * @returns The value without the v10 prefix\n */\nconst removeV10Prefix = memoize(\n (value: Buffer): Buffer => {\n if (\n value.length >= 3 &&\n value[0] === 0x76 && // 'v'\n value[1] === 0x31 && // '1'\n value[2] === 0x30\n ) {\n // '0'\n return value.slice(3);\n }\n return value;\n },\n (value: Buffer) => value.toString(\"hex\"),\n);\n\n/**\n * Removes PKCS7 padding from the decrypted value\n * @param decrypted - The decrypted buffer\n * @returns The buffer without padding\n */\nconst removePadding = memoize(\n (decrypted: Buffer): Buffer => {\n const padding = decrypted[decrypted.length - 1];\n if (padding && padding <= 16) {\n return decrypted.slice(0, -padding);\n }\n return decrypted;\n },\n (decrypted: Buffer) => decrypted.toString(\"hex\"),\n);\n\n/**\n * Extracts the actual value from the decoded string by removing Chrome's prefixes\n * @param decodedString - The decoded string to clean up\n * @returns The cleaned up value\n */\nfunction extractValue(decodedString: string): string {\n const cleanupPatterns = [\n /.*?0t(.+)$/, // Pattern ending in \"0t\" followed by value\n /.*?1e`(.+)$/, // Pattern ending in \"1e`\" followed by value\n /.*?[`'](.+)$/, // Any backtick or quote followed by value\n /[^\\x20-\\x7E]*([\\x20-\\x7E].+)$/, // Non-printable chars followed by printable chars\n ];\n\n for (const pattern of cleanupPatterns) {\n const match = decodedString.match(pattern);\n const value = match?.[1] ?? \"\";\n if (value.length > 0) {\n return value;\n }\n }\n return decodedString;\n}\n\n/**\n * Decrypts Chrome's encrypted cookie values\n * @param encryptedValue - The encrypted cookie value as a Buffer\n * @param password - The Chrome encryption password\n * @returns A promise that resolves to the decrypted cookie value\n * @throws {Error} If decryption fails\n * @example\n */\nexport async function decrypt(\n encryptedValue: Buffer,\n password: string,\n): Promise<string> {\n if (typeof password !== \"string\") {\n throw new Error(\"password must be a string\");\n }\n if (!Buffer.isBuffer(encryptedValue)) {\n throw new Error(\"encryptedData must be a Buffer\");\n }\n\n return new Promise((resolve, reject) => {\n pbkdf2(password, \"saltysalt\", 1003, 16, \"sha1\", (error, key) => {\n try {\n if (error) {\n reject(new Error(\"Failed to derive key: \" + error.message));\n return;\n }\n\n const value = removeV10Prefix(encryptedValue);\n if (value.length % 16 !== 0) {\n reject(new Error(\"Encrypted data length is not a multiple of 16\"));\n return;\n }\n\n // Chrome's encryption parameters\n const iv = Buffer.alloc(16, \" \"); // 16 spaces\n const decipher = createDecipheriv(\"aes-128-cbc\", key, iv);\n decipher.setAutoPadding(false);\n\n // Decrypt the value\n let decrypted = decipher.update(value);\n try {\n decipher.final();\n } catch (e) {\n reject(\n new Error(\"Failed to finalize decryption: \" + (e as Error).message),\n );\n return;\n }\n\n decrypted = removePadding(decrypted);\n const decodedString = decrypted.toString(\"utf8\");\n resolve(extractValue(decodedString));\n } catch (e) {\n reject(new Error(\"Decryption failed: \" + (e as Error).message));\n }\n });\n });\n}\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import { platform } from \"os\";\n\nimport { getChromePassword as getMacOSPassword } from \"./macos/getChromePassword\";\n\n/**\n * Gets the Chrome Safe Storage password for the current platform.\n * This password is used to decrypt cookies stored in Chrome's cookie database.\n * Currently only supports macOS, where the password is stored in the system keychain.\n * @returns A promise that resolves to the Chrome Safe Storage password\n * @throws {Error} If the password cannot be retrieved or the platform is not supported\n */\nexport async function getChromePassword(): Promise<string> {\n switch (platform()) {\n case \"darwin\": {\n return getMacOSPassword();\n }\n default:\n throw new Error(`Platform ${platform()} is not supported`);\n }\n}\n","// External imports\nimport { exec, ExecOptions } from \"child_process\";\nimport { promisify } from \"util\";\n\n// Internal imports\nimport { logError } from \"./logHelpers\";\n\nconst execPromise = promisify(exec);\n\n/**\n * Custom error class for command execution failures.\n * @property {string} command - The command that failed to execute\n * @property {Error} [originalError] - The underlying error that caused the failure\n * @throws CommandExecutionError Always throws with appropriate error context\n * @example\n * ```typescript\n * throw new CommandExecutionError(\n * 'Command timed out',\n * 'git status',\n * originalError\n * );\n * ```\n */\nclass CommandExecutionError extends Error {\n public constructor(\n message: string,\n public readonly command: string,\n public readonly originalError?: Error,\n ) {\n super(message);\n this.name = \"CommandExecutionError\";\n }\n}\n\n/**\n * Executes a shell command and returns its output.\n * @param command - The command to execute\n * @param options - Optional execution options\n * @returns Promise resolving to command output\n * @throws CommandExecutionError if execution fails\n * @example\n * ```typescript\n * try {\n * const { stdout } = await execSimple('git status');\n * logger.info('Git status:', stdout);\n * } catch (error) {\n * if (error instanceof CommandExecutionError) {\n * logger.error('Git command failed:', error.message);\n * }\n * }\n * ```\n */\nexport async function execSimple(\n command: string,\n options?: ExecOptions,\n): Promise<{ stdout: string; stderr: string }> {\n try {\n const result = await execPromise(command, {\n ...options,\n encoding: \"utf8\",\n });\n return {\n stdout: result.stdout.toString(),\n stderr: result.stderr.toString(),\n };\n } catch (error) {\n logError(\"Command execution failed\", error, { command });\n throw new CommandExecutionError(\n error instanceof Error ? error.message : String(error),\n command,\n error instanceof Error ? error : undefined,\n );\n }\n}\n","import { execSimple } from \"../../../../utils/execSimple\";\n\n/**\n * Retrieves the Chrome Safe Storage password from the macOS keychain\n * @returns A promise that resolves to the Chrome Safe Storage password\n * @throws {Error} If the password cannot be retrieved from the keychain\n */\nexport async function getChromePassword(): Promise<string> {\n const command = 'security find-generic-password -w -s \"Chrome Safe Storage\"';\n const result = await execSimple(command);\n return result.stdout.trim();\n}\n","import { createTaggedLogger, logError } from \"@utils/logHelpers\";\n\nimport {\n BrowserName,\n CookieQueryStrategy,\n CookieRow,\n ExportedCookie,\n} from \"../../../types/schemas\";\nimport { getEncryptedChromeCookie } from \"../getEncryptedChromeCookie\";\nimport { listChromeProfilePaths } from \"../listChromeProfiles\";\n\nimport { decrypt } from \"./decrypt\";\nimport { getChromePassword } from \"./getChromePassword\";\n\ninterface DecryptionContext {\n file: string;\n password: string;\n}\n\nfunction getExpiryDate(expiry: number | undefined | null): Date | \"Infinity\" {\n if (typeof expiry !== \"number\" || expiry <= 0) {\n return \"Infinity\";\n }\n return new Date(expiry);\n}\n\nfunction createExportedCookie(\n domain: string,\n name: string,\n value: string,\n expiry: number | undefined | null,\n file: string,\n decrypted: boolean,\n): ExportedCookie {\n return {\n domain,\n name,\n value,\n expiry: getExpiryDate(expiry),\n meta: {\n file,\n browser: \"Chrome\",\n decrypted,\n },\n };\n}\n\n/**\n * Strategy for querying cookies from Chrome browser\n * @example\n * ```typescript\n * const strategy = new ChromeCookieQueryStrategy();\n * const cookies = await strategy.queryCookies('session', 'example.com');\n * ```\n */\nexport class ChromeCookieQueryStrategy implements CookieQueryStrategy {\n private readonly logger = createTaggedLogger(\"ChromeCookieQueryStrategy\");\n\n /**\n * The browser name for this strategy\n */\n public readonly browserName: BrowserName = \"Chrome\";\n\n /**\n * Queries cookies from Chrome's cookie store\n * @param name - The name pattern to match cookies against\n * @param domain - The domain pattern to match cookies against\n * @param store - Optional path to a specific cookie store file\n * @returns A promise that resolves to an array of exported cookies\n * @example\n * ```typescript\n * const strategy = new ChromeCookieQueryStrategy();\n * const cookies = await strategy.queryCookies('session', 'example.com');\n * console.log(cookies);\n * ```\n */\n public async queryCookies(\n name: string,\n domain: string,\n store?: string,\n ): Promise<ExportedCookie[]> {\n try {\n this.logger.info(\"Querying cookies\", { name, domain, store });\n\n if (process.platform !== \"darwin\") {\n this.logger.warn(\"Platform not supported\", {\n platform: process.platform,\n });\n return [];\n }\n\n const cookieFiles = store ?? listChromeProfilePaths();\n const files = Array.isArray(cookieFiles) ? cookieFiles : [cookieFiles];\n if (files.length === 0) {\n this.logger.warn(\"No Chrome cookie files found\");\n return [];\n }\n\n const password = await getChromePassword();\n const results = await Promise.all(\n files.map((file) => this.processFile(file, name, domain, password)),\n );\n\n return results.flat();\n } catch (error) {\n if (error instanceof Error) {\n logError(\"Failed to query cookies\", error, { name, domain });\n } else {\n logError(\"Failed to query cookies\", new Error(String(error)), {\n name,\n domain,\n });\n }\n return [];\n }\n }\n\n private async processFile(\n file: string,\n name: string,\n domain: string,\n password: string,\n ): Promise<ExportedCookie[]> {\n try {\n const encryptedCookies = await getEncryptedChromeCookie({\n name,\n domain,\n file,\n });\n\n const context: DecryptionContext = { file, password };\n const results = await Promise.allSettled(\n encryptedCookies.map((cookie) => this.processCookie(cookie, context)),\n );\n\n return results\n .map((result) => (result.status === \"fulfilled\" ? result.value : null))\n .filter((cookie): cookie is ExportedCookie => cookie !== null);\n } catch (error) {\n if (error instanceof Error) {\n this.logger.error(\"Failed to process cookie file\", { error, file });\n } else {\n this.logger.error(\"Failed to process cookie file\", {\n error: String(error),\n file,\n });\n }\n return [];\n }\n }\n\n private async processCookie(\n cookie: CookieRow,\n context: DecryptionContext,\n ): Promise<ExportedCookie> {\n try {\n const value = Buffer.isBuffer(cookie.value)\n ? cookie.value\n : Buffer.from(String(cookie.value));\n\n const decryptedValue = await decrypt(value, context.password);\n return createExportedCookie(\n cookie.domain,\n cookie.name,\n decryptedValue,\n cookie.expiry,\n context.file,\n true,\n );\n } catch (error) {\n if (error instanceof Error) {\n this.logger.warn(\"Failed to decrypt cookie\", { error });\n } else {\n this.logger.warn(\"Failed to decrypt cookie\", { error: String(error) });\n }\n return createExportedCookie(\n cookie.domain,\n cookie.name,\n cookie.value.toString(\"utf-8\"),\n cookie.expiry,\n context.file,\n false,\n );\n }\n }\n}\n","/**\n * Asynchronously maps over an array and flattens the result.\n * Similar to Array.prototype.flatMap but for async operations.\n * @param array - The input array to map over\n * @param callback - The async mapping function to apply to each element\n * @param defaultValue - The default value to return if the array is empty\n * @returns A flattened array of results\n * @example\n * // Basic usage with number arrays\n * const numbers = [1, 2, 3];\n * const result = await flatMapAsync(\n * numbers,\n * async (num) => [num, num * 2]\n * );\n * console.log(result); // [1, 2, 2, 4, 3, 6]\n * @example\n * // Error handling with default value\n * const data = ['valid', 'invalid'];\n * const result = await flatMapAsync(\n * data,\n * async (item) => {\n * if (item === 'invalid') throw new Error();\n * return [item.toUpperCase()];\n * },\n * ['DEFAULT']\n * );\n * console.log(result); // ['VALID', 'DEFAULT']\n */\nexport async function flatMapAsync<T, U>(\n array: T[],\n callback: (item: T) => Promise<U[]>,\n defaultValue: U[] = [],\n): Promise<U[]> {\n if (array.length === 0) {\n return defaultValue;\n }\n\n const results = await Promise.all(\n array.map(async (item) => {\n try {\n return await callback(item);\n } catch (_error) {\n return defaultValue;\n }\n }),\n );\n return results.flat();\n}\n","import { flatMapAsync } from \"@utils/flatMapAsync\";\nimport { createTaggedLogger } from \"@utils/logHelpers\";\n\nimport type {\n BrowserName,\n CookieQueryStrategy,\n ExportedCookie,\n} from \"../../types/schemas\";\n\n/**\n * A composite strategy that combines multiple cookie query strategies.\n * This class implements the CookieQueryStrategy interface and allows querying cookies\n * from multiple browser-specific strategies simultaneously.\n * @example\n * ```typescript\n * const strategy = new CompositeCookieQueryStrategy([\n * new ChromeCookieQueryStrategy(),\n * new FirefoxCookieQueryStrategy(),\n * new SafariCookieQueryStrategy()\n * ]);\n * const cookies = await strategy.queryCookies('sessionId', 'example.com');\n * ```\n */\nexport class CompositeCookieQueryStrategy implements CookieQueryStrategy {\n private readonly logger = createTaggedLogger(\"CompositeCookieQueryStrategy\");\n\n /**\n * The browser name identifier for this strategy\n * @remarks Always returns 'internal' as this is a composite strategy\n */\n public readonly browserName: BrowserName = \"internal\";\n\n /**\n * Creates a new instance of CompositeCookieQueryStrategy\n * @param strategies - Array of browser-specific strategies to use for querying cookies\n * @remarks\n * - Each strategy in the array should implement the CookieQueryStrategy interface\n * - The order of strategies determines the order of cookie querying\n * - Failed strategies will be gracefully handled and skipped\n * @example\n * ```typescript\n * const strategy = new CompositeCookieQueryStrategy([\n * new ChromeCookieQueryStrategy(),\n * new FirefoxCookieQueryStrategy()\n * ]);\n * ```\n */\n public constructor(private strategies: CookieQueryStrategy[]) {}\n\n /**\n * Handles strategy-specific errors and logs them appropriately\n * @internal\n * @param error - The error that occurred during strategy execution\n * @param strategy - The strategy that failed\n */\n private handleStrategyError(\n error: unknown,\n strategy: CookieQueryStrategy,\n ): void {\n if (error instanceof Error) {\n this.logger.error(\"Strategy failed\", { error, strategy });\n } else {\n this.logger.error(\"Strategy failed with unknown error\", {\n error: String(error),\n strategy,\n });\n }\n }\n\n /**\n * Queries cookies using all available strategies in parallel\n * @param name - The name pattern to match cookies against\n * @param domain - The domain pattern to match cookies against\n * @param store - The store pattern to match cookies against\n * @returns Promise resolving to combined array of cookies from all strategies\n * @remarks\n * - Failures in individual strategies are logged but don't affect other strategies\n * - Results are combined from all successful strategy queries\n * - Empty arrays are returned for failed strategy queries\n * @example\n * ```typescript\n * const strategy = new CompositeCookieQueryStrategy([\n * new ChromeCookieQueryStrategy(),\n * new FirefoxCookieQueryStrategy()\n * ]);\n * const cookies = await strategy.queryCookies('sessionId', 'example.com');\n * console.log(cookies); // Combined results from all browsers\n * ```\n */\n public async queryCookies(\n name: string,\n domain: string,\n store?: string,\n ): Promise<ExportedCookie[]> {\n try {\n this.logger.info(\"Querying cookies from all strategies\", {\n name,\n domain,\n store,\n strategyCount: this.strategies.length,\n });\n\n /**\n * Use flatMapAsync to process strategies in sequence while collecting results\n * This approach provides better error isolation than Promise.all\n * Each strategy failure is handled independently\n */\n return await flatMapAsync(\n this.strategies,\n async (strategy) => {\n try {\n return await strategy.queryCookies(name, domain, store);\n } catch (error) {\n this.handleStrategyError(error, strategy);\n return [];\n }\n },\n [],\n );\n } catch (error) {\n /**\n * Handle top-level errors that may occur during strategy processing\n * This ensures the function always returns an array, even in catastrophic failure\n */\n if (error instanceof Error) {\n this.logger.error(\"Failed to query cookies\", { error });\n } else {\n this.logger.error(\"Failed to query cookies with unknown error\", {\n error: String(error),\n });\n }\n return [];\n }\n }\n}\n","import { homedir } from \"os\";\nimport { join } from \"path\";\n\nimport fg from \"fast-glob\";\n\nimport { createTaggedLogger, logWarn } from \"@utils/logHelpers\";\n\nconst logger = createTaggedLogger(\"FirefoxCookieQueryStrategy\");\n\nimport {\n BrowserName,\n CookieQueryStrategy,\n ExportedCookie,\n} from \"../../../types/schemas\";\nimport { querySqliteThenTransform } from \"../QuerySqliteThenTransform\";\n\ninterface FirefoxCookieRow {\n name: string;\n value: string;\n domain: string;\n expiry: number;\n}\n\n/**\n * Find all Firefox cookie database files\n * @returns An array of file paths to Firefox cookie databases\n */\nfunction findFirefoxCookieFiles(): string[] {\n const home = homedir();\n if (!home) {\n logWarn(\"FirefoxCookieQuery\", \"Failed to get home directory\");\n return [];\n }\n\n const patterns = [\n join(home, \"Library/Application Support/Firefox/Profiles/*/cookies.sqlite\"),\n join(home, \".mozilla/firefox/*/cookies.sqlite\"),\n ];\n\n const files: string[] = [];\n for (const pattern of patterns) {\n const matches = fg.sync(pattern);\n files.push(...matches);\n }\n\n logger.debug(\"Found Firefox cookie files\", { files });\n return files;\n}\n\n/**\n * Strategy for querying cookies from Firefox browser\n * @example\n */\nexport class FirefoxCookieQueryStrategy implements CookieQueryStrategy {\n /**\n *\n */\n public readonly browserName: BrowserName = \"Firefox\";\n\n /**\n * Queries cookies from Firefox's cookie store\n * @param name - The name pattern to match cookies against\n * @param domain - The domain pattern to match cookies against\n * @param store - Optional path to a specific cookie store file\n * @returns A promise that resolves to an array of exported cookies\n */\n public async queryCookies(\n name: string,\n domain: string,\n store?: string,\n ): Promise<ExportedCookie[]> {\n const files = store ?? findFirefoxCookieFiles();\n const fileList = Array.isArray(files) ? files : [files];\n const results: ExportedCookie[] = [];\n\n for (const file of fileList) {\n try {\n const cookies = await querySqliteThenTransform<\n FirefoxCookieRow,\n ExportedCookie\n >({\n file,\n sql: \"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?\",\n params: [name, `%${domain}%`],\n rowTransform: (row) => ({\n name: row.name,\n value: row.value,\n domain: row.domain,\n expiry: row.expiry > 0 ? new Date(row.expiry * 1000) : \"Infinity\",\n meta: {\n file,\n browser: \"Firefox\",\n decrypted: false,\n },\n }),\n });\n\n results.push(...cookies);\n } catch (error) {\n if (error instanceof Error) {\n logWarn(\n \"FirefoxCookieQuery\",\n `Error reading Firefox cookie file ${file}`,\n { error: error.message },\n );\n } else {\n logWarn(\n \"FirefoxCookieQuery\",\n `Error reading Firefox cookie file ${file}`,\n );\n }\n }\n }\n\n return results;\n }\n}\n","import { homedir } from \"os\";\nimport { join } from \"path\";\n\nimport { logError } from \"@utils/logHelpers\";\n\nimport type {\n BrowserName,\n CookieQueryStrategy,\n ExportedCookie,\n} from \"../../../types/schemas\";\n\nimport { decodeBinaryCookies } from \"./decodeBinaryCookies\";\n\n/**\n * Strategy for querying cookies from Safari browser\n */\nexport class SafariCookieQueryStrategy implements CookieQueryStrategy {\n /**\n * The browser name for this strategy\n */\n public readonly browserName: BrowserName = \"Safari\";\n\n /**\n * Gets the path to Safari's cookie database\n * @param home - The user's home directory\n * @returns Path to the cookie database\n */\n private getCookieDbPath(home: string): string {\n return join(\n home,\n \"Library\",\n \"Containers\",\n \"com.apple.Safari\",\n \"Data\",\n \"Library\",\n \"Cookies\",\n \"Cookies.binarycookies\",\n );\n }\n\n /**\n * Formats the domain by removing leading dot if present\n * @param domain - Domain to format\n * @returns Formatted domain\n */\n private formatDomain(domain: string): string {\n return domain.startsWith(\".\") ? domain.slice(1) : domain;\n }\n\n /**\n * Formats the expiry date\n * @param expiry - Expiry timestamp\n * @returns Formatted expiry date\n */\n private formatExpiry(expiry: number): Date | \"Infinity\" {\n if (expiry <= 0) {\n return \"Infinity\";\n }\n return new Date(expiry * 1000);\n }\n\n /**\n * Checks if a flag bit is set\n * @param flags - The flags value\n * @param bit - The bit to check\n * @returns True if the bit is set, false otherwise\n */\n private isFlagSet(flags: number | undefined | null, bit: number): boolean {\n if (typeof flags !== \"number\" || isNaN(flags) || flags <= 0) {\n return false;\n }\n return (flags & bit) === bit;\n }\n\n /**\n * Formats the creation timestamp\n * @param creation - Creation timestamp\n * @returns Formatted creation timestamp or undefined\n */\n private formatCreation(\n creation: number | undefined | null,\n ): number | undefined {\n if (typeof creation !== \"number\" || isNaN(creation) || creation <= 0) {\n return undefined;\n }\n return creation * 1000;\n }\n\n /**\n * Decodes cookies from Safari's binary cookie file\n * @param cookieDbPath - Path to the cookie database\n * @param name - Name of the cookie to find\n * @param domain - Domain to filter cookies by\n * @returns Array of exported cookies\n */\n private decodeCookies(\n cookieDbPath: string,\n name: string,\n domain: string,\n ): ExportedCookie[] {\n try {\n const cookies = decodeBinaryCookies(cookieDbPath);\n return cookies\n .filter(\n (cookie) =>\n (name === \"%\" || cookie.name === name) &&\n (domain === \"%\" ||\n this.formatDomain(cookie.domain).includes(domain)),\n )\n .map((cookie) => ({\n domain: this.formatDomain(cookie.domain),\n name: cookie.name,\n value: Buffer.isBuffer(cookie.value)\n ? cookie.value.toString()\n : String(cookie.value),\n expiry: this.formatExpiry(cookie.expiry),\n meta: {\n file: cookieDbPath,\n browser: \"Safari\" as const,\n decrypted: false,\n secure: this.isFlagSet(cookie.flags, 0x1),\n httpOnly: this.isFlagSet(cookie.flags, 0x4),\n path: cookie.path,\n version: cookie.version,\n comment: cookie.comment,\n commentURL: cookie.commentURL,\n port: cookie.port,\n creation: this.formatCreation(cookie.creation),\n },\n }));\n } catch (error) {\n if (error instanceof Error) {\n logError(\n \"SafariCookieQueryStrategy\",\n `Error decoding ${cookieDbPath}`,\n { error, name, domain },\n );\n } else {\n logError(\n \"SafariCookieQueryStrategy\",\n `Error decoding ${cookieDbPath}`,\n { error: \"Unknown error\", name, domain },\n );\n }\n return [];\n }\n }\n\n /**\n * Query Safari's cookie storage for cookies matching the given criteria\n * @param name - Name of the cookie to find\n * @param domain - Domain to filter cookies by\n * @param store - Optional store path\n * @returns Array of matching cookies, or empty array if none found\n */\n public async queryCookies(\n name: string,\n domain: string,\n store?: string,\n ): Promise<ExportedCookie[]> {\n const home = homedir();\n if (typeof home !== \"string\" || home.length === 0) {\n logError(\"SafariCookieQueryStrategy\", \"Failed to get home directory\");\n return Promise.resolve([]);\n }\n\n const cookieDbPath = store ?? this.getCookieDbPath(home);\n return Promise.resolve(\n this.decodeCookies(cookieDbPath, name || \"%\", domain || \"%\"),\n );\n }\n}\n","import { Buffer } from \"buffer\";\nimport { readFileSync } from \"fs\";\nimport { homedir } from \"os\";\nimport { join } from \"path\";\n\nimport { BinaryCookieRow } from \"../../../types/schemas\";\nimport { logWarn, createTaggedLogger } from \"../../../utils/logHelpers\";\n\nimport { BinaryCodablePage } from \"./BinaryCodablePage\";\nimport { BinaryCodableContainer } from \"./interfaces/BinaryCodableContainer\";\n\nconst logger = createTaggedLogger(\"BinaryCodableCookies\");\n\n/**\n * Represents a binary cookies file structure used by Safari\n */\nexport class BinaryCodableCookies {\n /**\n *\n */\n public pages: BinaryCodablePage[];\n /**\n *\n */\n public metadata: Record<string, unknown>;\n private static readonly MAGIC = Buffer.from(\"cook\", \"utf8\");\n private static readonly FOOTER = BigInt(\"0x071720050000004b\");\n private static readonly DEFAULT_COOKIE_PATH = join(\n homedir(),\n \"Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies\",\n );\n\n /**\n * Creates a new BinaryCookies instance from a buffer\n * @param buffer - The raw binary cookie file data\n */\n public constructor(buffer: Buffer) {\n const container: BinaryCodableContainer = { offset: 0, buffer };\n this.pages = [];\n this.metadata = {};\n this.decode(container);\n }\n\n /**\n * Creates a BinaryCookies instance from a file path\n * @param path - Path to the Safari Cookies.binarycookies file\n * @returns A new BinaryCookies instance\n */\n public static fromFile(path: string): BinaryCodableCookies {\n const buffer = readFileSync(path);\n return new BinaryCodableCookies(buffer);\n }\n\n /**\n * Creates a BinaryCookies instance from the default Safari cookies location\n * @returns A new BinaryCookies instance\n */\n public static fromDefaultPath(): BinaryCodableCookies {\n return BinaryCodableCookies.fromFile(\n BinaryCodableCookies.DEFAULT_COOKIE_PATH,\n );\n }\n\n /**\n * Converts the binary cookie data into a validated array of cookie rows\n * @returns Array of validated cookie objects\n */\n public toCookieRows(): BinaryCookieRow[] {\n const cookies: BinaryCookieRow[] = [];\n\n for (const page of this.pages) {\n try {\n const pageCookies = page.toCookieRows();\n if (Array.isArray(pageCookies)) {\n cookies.push(...pageCookies);\n }\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n logWarn(\"BinaryCookies\", \"Error converting page cookies\", {\n error: errorMessage,\n });\n }\n }\n\n return cookies;\n }\n\n private decode(container: BinaryCodableContainer): void {\n try {\n // Check magic value\n const magic = container.buffer.subarray(\n container.offset,\n container.offset + 4,\n );\n container.offset += 4;\n logger.debug(\"Magic bytes:\", magic.toString());\n if (!magic.equals(BinaryCodableCookies.MAGIC)) {\n throw new Error(\"Missing magic value\");\n }\n\n // Read page count\n const pageCount = container.buffer.readUInt32BE(container.offset);\n logger.debug(\"Page count:\", pageCount);\n container.offset += 4;\n\n // Read page sizes\n const pageSizes: number[] = [];\n for (let i = 0; i < pageCount; i++) {\n const pageSize = container.buffer.readUInt32BE(container.offset);\n pageSizes.push(pageSize);\n logger.debug(`Page ${i} size:`, pageSize);\n container.offset += 4;\n }\n\n // Calculate page offsets\n let currentOffset = container.offset;\n logger.debug(\"Starting page data at offset:\", currentOffset);\n for (const pageSize of pageSizes) {\n try {\n logger.debug(\n \"Reading page at offset:\",\n currentOffset,\n \"with size:\",\n pageSize,\n );\n const pageBuffer = container.buffer.subarray(\n currentOffset,\n currentOffset + pageSize,\n );\n const page = new BinaryCodablePage(pageBuffer);\n this.pages.push(page);\n currentOffset += pageSize;\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n logger.warn(\"Error decoding page:\", { error: errorMessage });\n currentOffset += pageSize; // Skip the problematic page\n }\n }\n container.offset = currentOffset;\n\n // Read checksum\n const checksum = container.buffer.readUInt32BE(container.offset);\n logger.debug(\"Checksum:\", checksum.toString(16));\n container.offset += 4;\n\n // Read footer\n const footer = container.buffer.readBigUInt64BE(container.offset);\n logger.debug(\"Footer:\", footer.toString(16));\n container.offset += 8;\n if (footer !== BinaryCodableCookies.FOOTER) {\n logWarn(\"BinaryCookies\", \"Invalid cookie file format: wrong footer\");\n }\n\n // Read metadata plist\n const _plistData = container.buffer.subarray(container.offset);\n // Note: You'll need to implement or use a plist parser library here\n this.metadata = {}; // Placeholder for plist data\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n logWarn(\"BinaryCookies\", \"Error decoding binary cookies file\", {\n error: errorMessage,\n });\n throw error;\n }\n }\n}\n","import { Buffer } from \"buffer\";\n\nimport { BinaryCookieRow, BinaryCookieRowSchema } from \"../../../types/schemas\";\nimport { createTaggedLogger } from \"../../../utils/logHelpers\";\n\nimport { BinaryCodableContainer } from \"./interfaces/BinaryCodableContainer\";\nimport { BinaryCodableFlags } from \"./interfaces/BinaryCodableFlags\";\nimport { BinaryCodableOffsets } from \"./interfaces/BinaryCodableOffsets\";\n\nconst logger = createTaggedLogger(\"BinaryCodableCookie\");\n\n/**\n * Represents a single cookie within a page\n */\nexport class BinaryCodableCookie {\n /**\n *\n */\n public version = 0;\n /**\n *\n */\n public url = \"\";\n /**\n *\n */\n public port?: number;\n /**\n *\n */\n public name = \"\";\n /**\n *\n */\n public path = \"\";\n /**\n *\n */\n public value = \"\";\n /**\n *\n */\n public comment?: string;\n /**\n *\n */\n public commentURL?: string;\n /**\n *\n */\n public flags: BinaryCodableFlags = {\n isSecure: false,\n isHTTPOnly: false,\n unknown1: false,\n unknown2: false,\n };\n /**\n *\n */\n public expiration = 0;\n /**\n *\n */\n public creation = 0;\n\n /**\n * Creates a new Cookie instance from a buffer\n * @param buffer - The raw binary cookie data\n */\n public constructor(buffer: Buffer) {\n const container: BinaryCodableContainer = { offset: 0, buffer };\n this.decode(container);\n }\n\n private decodeUrlValue(value: string): string {\n let processed = value;\n let lastProcessed;\n do {\n lastProcessed = processed;\n try {\n processed = decodeURIComponent(processed);\n } catch {\n return lastProcessed;\n }\n } while (processed !== lastProcessed && processed.includes(\"%\"));\n return processed;\n }\n\n private decodeJwtPayload(token: string): string | null {\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n return null;\n }\n\n try {\n const payload = Buffer.from(parts[1], \"base64\").toString(\"utf8\");\n const parsed = JSON.parse(payload) as Record<string, unknown>;\n return JSON.stringify(parsed);\n } catch {\n return null;\n }\n }\n\n private parseJsonValue(value: string): string | null {\n try {\n const parsed = JSON.parse(value) as Record<string, unknown>;\n return JSON.stringify(parsed);\n } catch {\n return null;\n }\n }\n\n private processValue(value: string): string {\n // First, try URL decoding\n const decoded = this.decodeUrlValue(value);\n\n // Then, try JWT decoding if it looks like a JWT token\n if (decoded.match(/^ey[A-Za-z0-9_-]+\\.ey[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$/)) {\n const jwtPayload = this.decodeJwtPayload(decoded);\n if (typeof jwtPayload === \"string\" && jwtPayload.length > 0) {\n return jwtPayload;\n }\n }\n\n // Finally, try JSON parsing if it looks like JSON\n if (decoded.startsWith(\"{\") || decoded.startsWith(\"[\")) {\n const jsonValue = this.parseJsonValue(decoded);\n if (typeof jsonValue === \"string\" && jsonValue.length > 0) {\n return jsonValue;\n }\n }\n\n return decoded;\n }\n\n /**\n * Converts the cookie to a validated cookie row\n * @returns Validated cookie row object or null if validation fails\n */\n public toCookieRow(): BinaryCookieRow | null {\n try {\n // Convert flags to number\n const flagsValue = this.convertFlags();\n\n // Extract domain from URL\n const domain =\n this.url.replace(/^https?:\\/\\//, \"\").replace(/\\/.*$/, \"\") || \"uk\";\n\n // Convert timestamps from Mac epoch (seconds since 2001-01-01) to Unix epoch (seconds since 1970-01-01)\n const macToUnixOffset = 978307200; // Seconds between 1970-01-01 and 2001-01-01\n const expiryUnix =\n this.expiration > 0\n ? this.expiration + macToUnixOffset\n : this.expiration;\n const creationUnix =\n this.creation > 0 ? this.creation + macToUnixOffset : this.creation;\n\n // Create cookie row with converted timestamps\n const cookieRow = BinaryCookieRowSchema.parse({\n name: this.name.replace(/^: /, \"\"), // Remove leading ': ' if present\n value: this.processValue(this.value) || \"\", // Process and ensure value is never undefined\n domain,\n path: this.path || \"/\",\n expiry: expiryUnix,\n creation: creationUnix,\n flags: flagsValue,\n version: this.version,\n port: this.port,\n comment: this.comment,\n commentURL: this.commentURL,\n });\n\n return cookieRow;\n } catch (_error) {\n return null;\n }\n }\n\n private readNullTerminatedString(\n container: BinaryCodableContainer,\n offset: number,\n ): string {\n let end = offset;\n while (end < container.buffer.length && container.buffer[end] !== 0) {\n end++;\n }\n const value = container.buffer.toString(\"utf8\", offset, end);\n return value || \"\";\n }\n\n private readHeader(container: BinaryCodableContainer): {\n size: number;\n hasPort: number;\n offsets: BinaryCodableOffsets;\n } {\n // Cookie size (4 bytes)\n const size = container.buffer.readUInt32LE(container.offset);\n logger.debug(\"Cookie size:\", size);\n container.offset += 4;\n\n // Version (4 bytes)\n const version = container.buffer.readUInt32LE(container.offset);\n logger.debug(\"Cookie version:\", version);\n container.offset += 4;\n\n // Cookie flags (4 bytes)\n const flagsValue = container.buffer.readUInt32LE(container.offset);\n logger.debug(\"Cookie flags:\", flagsValue.toString(2).padStart(8, \"0\"));\n container.offset += 4;\n this.flags = {\n isSecure: (flagsValue & 1) !== 0,\n isHTTPOnly: (flagsValue & 4) !== 0,\n unknown1: (flagsValue & 8) !== 0,\n unknown2: (flagsValue & 16) !== 0,\n };\n\n // Has port (4 bytes)\n const hasPort = container.buffer.readUInt32LE(container.offset);\n logger.debug(\"Has port:\", hasPort);\n container.offset += 4;\n\n // String offsets (24 bytes total)\n const offsets = {\n urlOffset: container.buffer.readUInt32LE(container.offset),\n nameOffset: container.buffer.readUInt32LE(container.offset + 4),\n pathOffset: container.buffer.readUInt32LE(container.offset + 8),\n valueOffset: container.buffer.readUInt32LE(container.offset + 12),\n commentOffset: container.buffer.readUInt32LE(container.offset + 16),\n commentURLOffset: container.buffer.readUInt32LE(container.offset + 20),\n };\n logger.debug(\"String offsets:\", offsets);\n\n return { size, hasPort, offsets };\n }\n\n private readTimestamps(container: BinaryCodableContainer): void {\n // Read expiration time (8 bytes, little-endian double)\n const expirationBuffer = Buffer.alloc(8);\n for (let i = 0; i < 8; i++) {\n expirationBuffer[i] = container.buffer[container.offset + i];\n }\n const expiration = expirationBuffer.readDoubleLE(0);\n container.offset += 8;\n\n // Read creation time (8 bytes, little-endian double)\n const creationBuffer = Buffer.alloc(8);\n for (let i = 0; i < 8; i++) {\n creationBuffer[i] = container.buffer[container.offset + i];\n }\n const creation = creationBuffer.readDoubleLE(0);\n container.offset += 8;\n\n // Store raw timestamps (seconds since 2001-01-01)\n // For expiration time, 0 means \"session cookie\" (expires when browser closes)\n // For creation time, 0 means \"no creation time recorded\"\n this.expiration = expiration;\n this.creation = creation;\n }\n\n private readStrings(\n container: BinaryCodableContainer,\n size: number,\n offsets: BinaryCodableOffsets,\n ): void {\n // All offsets are relative to the start of the cookie\n const cookieStart = 0; // Offsets are relative to the cookie buffer start\n logger.debug(\"Reading strings from cookie buffer of size:\", size);\n\n // Read strings in order of their offsets\n const offsetEntries = [\n { field: \"url\", offset: offsets.urlOffset },\n { field: \"name\", offset: offsets.nameOffset },\n { field: \"path\", offset: offsets.pathOffset },\n { field: \"value\", offset: offsets.valueOffset },\n { field: \"comment\", offset: offsets.commentOffset },\n ]\n .filter((entry) => entry.offset > 0)\n .sort((a, b) => a.offset - b.offset);\n\n logger.debug(\n \"Reading strings in order:\",\n offsetEntries.map((e) => e.field),\n );\n\n // Calculate string lengths based on offset differences\n for (let i = 0; i < offsetEntries.length; i++) {\n const { field, offset } = offsetEntries[i];\n const nextOffset =\n i < offsetEntries.length - 1 ? offsetEntries[i + 1].offset : size;\n const length = nextOffset - offset;\n\n // Read string up to null terminator\n let end = cookieStart + offset;\n while (\n end < cookieStart + offset + length &&\n container.buffer[end] !== 0\n ) {\n end++;\n }\n const value = container.buffer.toString(\n \"utf8\",\n cookieStart + offset,\n end,\n );\n logger.debug(`Read ${field}:`, value);\n\n switch (field) {\n case \"url\":\n this.url = value;\n break;\n case \"name\":\n this.name = value;\n break;\n case \"path\":\n this.path = value;\n break;\n case \"value\":\n this.value = value;\n break;\n case \"comment\":\n this.comment = value;\n break;\n }\n }\n }\n\n private decode(container: BinaryCodableContainer): void {\n const { size, hasPort, offsets } = this.readHeader(container);\n\n // Skip past all offsets (24 bytes)\n const baseOffset = container.offset;\n container.offset = baseOffset + 24;\n\n this.readTimestamps(container);\n\n if (hasPort > 0) {\n this.port = container.buffer.readUInt16LE(container.offset);\n container.offset += 2;\n }\n\n // Reset offset for string reading\n container.offset = baseOffset;\n this.readStrings(container, size, offsets);\n }\n\n private convertFlags(): number {\n return (\n (this.flags.isSecure ? 0x1 : 0) |\n (this.flags.isHTTPOnly ? 0x4 : 0) |\n (this.flags.unknown1 ? 0x8 : 0) |\n (this.flags.unknown2 ? 0x10 : 0)\n );\n }\n}\n","import destr from \"destr\";\nimport { z } from \"zod\";\n\n/**\n * Zod schema for cookie domain validation.\n * Enforces standard cookie domain rules.\n * @example\n * ```typescript\n * // Valid domains\n * CookieDomainSchema.parse(\"example.com\"); // OK\n * CookieDomainSchema.parse(\".example.com\"); // OK - leading dot is valid\n * CookieDomainSchema.parse(\"sub.example.com\"); // OK\n *\n * // Invalid domains\n * CookieDomainSchema.parse(\"\"); // Error: Domain cannot be empty\n * CookieDomainSchema.parse(\"invalid domain\"); // Error: Invalid domain format\n * ```\n */\nexport const CookieDomainSchema = z\n .string()\n .trim()\n .min(1, \"Domain cannot be empty\")\n .refine(\n (domain) =>\n /^\\.?[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(\n domain,\n ),\n \"Invalid domain format\",\n );\n\n/**\n * Zod schema for cookie name validation.\n * Enforces standard cookie name rules according to RFC 6265.\n * @example\n * ```typescript\n * // Valid names\n * CookieNameSchema.parse(\"session\"); // OK\n * CookieNameSchema.parse(\"auth_token\"); // OK\n * CookieNameSchema.parse(\"user-preference\"); // OK\n *\n * // Invalid names\n * CookieNameSchema.parse(\"\"); // Error: Cookie name cannot be empty\n * CookieNameSchema.parse(\"session;\"); // Error: Invalid cookie name format\n * CookieNameSchema.parse(\"my cookie\"); // Error: Invalid cookie name format\n * ```\n */\nexport const CookieNameSchema = z\n .string()\n .trim()\n .min(1, \"Cookie name cannot be empty\")\n .refine(\n (name) => name === \"%\" || /^[!#$%&'()*+\\-.:0-9A-Z \\^_`a-z|~]+$/.test(name),\n \"Invalid cookie name format - must contain only valid characters (letters, numbers, and certain symbols) or be '%' for wildcard\",\n );\n\n/**\n * Zod schema for cookie path validation.\n * Enforces standard cookie path rules according to RFC 6265.\n * @example\n * ```typescript\n * // Valid paths\n * CookiePathSchema.parse(\"/\"); // OK\n * CookiePathSchema.parse(\"/api\"); // OK\n * CookiePathSchema.parse(\"/path/to/page\"); // OK\n *\n * // Invalid paths\n * CookiePathSchema.parse(\"\"); // Error: Path cannot be empty\n * CookiePathSchema.parse(\"invalid\"); // Error: Path must start with /\n * CookiePathSchema.parse(\"/path?query\"); // Error: Invalid path format\n * ```\n */\nexport const CookiePathSchema = z\n .string()\n .trim()\n .min(1, \"Path cannot be empty\")\n .refine((path) => path.startsWith(\"/\"), \"Path must start with /\")\n .refine(\n (path) => /^\\/[!#$%&'()*+,\\-./:=@\\w~]*$/.test(path),\n \"Invalid path format - must contain only valid URL path characters\",\n )\n .default(\"/\");\n\n/**\n * Zod schema for cookie value.\n * Attempts to parse JSON values using destr for better readability.\n */\nexport const CookieValueSchema = z\n .string()\n .trim()\n .transform((value) => destr(value))\n .pipe(z.any());\n\n/**\n * Zod schema for Safari binary cookie row.\n * Validates and enforces the structure of cookie data read from Safari's Cookies.binarycookies file.\n * @example\n * ```typescript\n * const cookieData = {\n * name: \"session\",\n * value: \"abc123\",\n * domain: \"example.com\",\n * path: \"/\",\n * expiry: 1735689600,\n * creation: 1672531200,\n * flags: 0x5, // Secure + HTTPOnly\n * };\n * const validCookie = BinaryCookieRowSchema.parse(cookieData);\n * ```\n */\nexport const BinaryCookieRowSchema = z.object({\n name: CookieNameSchema,\n value: CookieValueSchema,\n domain: CookieDomainSchema,\n path: CookiePathSchema,\n expiry: z.number().int(),\n creation: z.number().int(),\n flags: z.number().optional(),\n version: z.number().int().optional(),\n port: z.number().int().optional(),\n comment: z.string().optional(),\n commentURL: z.string().optional(),\n});\n\n/**\n * Type representing a decoded Safari binary cookie.\n * This type is inferred from the BinaryCookieRowSchema and includes all cookie properties.\n * @property name - The name of the cookie (non-empty string)\n * @property value - The value stored in the cookie\n * @property domain - The domain the cookie belongs to (non-empty string)\n * @property path - The path where the cookie is valid (defaults to \"/\")\n * @property expiry - Unix timestamp when the cookie expires\n * @property creation - Unix timestamp when the cookie was created\n * @property flags - Optional bit flags (e.g., Secure, HTTPOnly)\n * @property version - Optional cookie version number\n * @property port - Optional port number restriction\n * @property comment - Optional cookie comment\n * @property commentURL - Optional URL for the cookie's comment\n */\nexport type BinaryCookieRow = z.infer<typeof BinaryCookieRowSchema>;\n\n/**\n * Schema for cookie specification parameters\n * Defines the required fields for identifying a cookie\n * @example\n * ```typescript\n * // Validate a cookie specification\n * const spec = {\n * name: 'session',\n * domain: 'example.com'\n * };\n * const result = CookieSpecSchema.safeParse(spec);\n * if (result.success) {\n * logger.info('Valid cookie spec:', result.data);\n * } else {\n * logger.error('Invalid cookie spec:', result.error);\n * }\n *\n * // Invalid spec (empty name)\n * const invalidSpec = {\n * name: '',\n * domain: 'example.com'\n * };\n * // Throws: \"Cookie name cannot be empty\"\n * CookieSpecSchema.parse(invalidSpec);\n * ```\n */\nexport const CookieSpecSchema = z\n .object({\n name: CookieNameSchema,\n domain: CookieDomainSchema,\n })\n .strict();\n\n/**\n * Type definition for cookie specification\n * Used for specifying which cookie to query\n * @example\n * ```typescript\n * // Basic cookie spec\n * const spec: CookieSpec = {\n * name: 'auth',\n * domain: 'api.example.com'\n * };\n *\n * // Use in function parameters\n * function queryCookie(spec: CookieSpec): Promise<ExportedCookie[]> {\n * return getCookie(spec);\n * }\n *\n * // Array of specs\n * const specs: CookieSpec[] = [\n * { name: 'session', domain: 'app.example.com' },\n * { name: 'theme', domain: 'example.com' }\n * ];\n * ```\n */\nexport type CookieSpec = z.infer<typeof CookieSpecSchema>;\n\n/**\n * Schema for metadata about a cookie\n */\nexport const CookieMetaSchema = z\n .object({\n file: z.string().trim().min(1, \"File path cannot be empty\").optional(),\n browser: z.string().trim().optional(),\n decrypted: z.boolean().optional(),\n secure: z.boolean().optional(),\n httpOnly: z.boolean().optional(),\n path: CookiePathSchema.optional(),\n })\n .catchall(z.unknown())\n .strict();\n\n/**\n * Type definition for cookie metadata\n */\nexport type CookieMeta = z.infer<typeof CookieMetaSchema>;\n\n/**\n * Schema for exported cookie data\n * Represents a cookie with all its properties and metadata\n * @example\n * ```typescript\n * // Validate an exported cookie\n * const cookie = {\n * domain: 'example.com',\n * name: 'session',\n * value: 'abc123',\n * expiry: new Date('2024-12-31'),\n * meta: {\n * file: '/path/to/cookies.db'\n * }\n * };\n * const result = ExportedCookieSchema.safeParse(cookie);\n * if (result.success) {\n * logger.info('Valid cookie:', result.data);\n * } else {\n * logger.error('Invalid cookie:', result.error);\n * }\n *\n * // Cookie with infinite expiry\n * const infiniteCookie = {\n * ...cookie,\n * expiry: \"Infinity\"\n * };\n * ExportedCookieSchema.parse(infiniteCookie); // OK\n * ```\n */\nexport const ExportedCookieSchema = z\n .object({\n domain: CookieDomainSchema,\n name: CookieNameSchema,\n value: CookieValueSchema,\n expiry: z\n .union([\n z.literal(\"Infinity\"),\n z.date(),\n z.number().int().positive(\"Expiry must be a positive number\"),\n ])\n .optional(),\n meta: CookieMetaSchema.optional(),\n })\n .strict();\n\n/**\n * Type definition for exported cookie data\n * Represents the structure of a cookie after it has been retrieved\n * @example\n * ```typescript\n * // Basic exported cookie\n * const cookie: ExportedCookie = {\n * domain: 'example.com',\n * name: 'session',\n * value: 'abc123',\n * expiry: new Date('2024-12-31'),\n * meta: {\n * file: '/path/to/cookies.db'\n * }\n * };\n *\n * // Process exported cookies\n * function processCookies(cookies: ExportedCookie[]): string[] {\n * return cookies.map(cookie => `${cookie.name}=${cookie.value}`);\n * }\n *\n * // Filter expired cookies\n * function filterExpired(cookies: ExportedCookie[]): ExportedCookie[] {\n * const now = new Date();\n * return cookies.filter(cookie =>\n * cookie.expiry === \"Infinity\" ||\n * (cookie.expiry instanceof Date && cookie.expiry > now)\n * );\n * }\n * ```\n */\nexport type ExportedCookie = z.infer<typeof ExportedCookieSchema>;\n\n/**\n * Schema for raw cookie data from browser stores\n */\nexport const CookieRowSchema = z\n .object({\n expiry: z.number().int().optional(),\n domain: CookieDomainSchema,\n name: CookieNameSchema,\n value: z.union([z.string(), z.instanceof(Buffer)]),\n })\n .strict();\n\n/**\n * Type definition for raw cookie data\n */\nexport type CookieRow = z.infer<typeof CookieRowSchema>;\n\n/**\n * Schema for cookie render options\n */\nexport const RenderOptionsSchema = z\n .object({\n format: z.enum([\"merged\", \"grouped\"]).optional(),\n separator: z.string().optional(),\n showFilePaths: z.boolean().optional(),\n })\n .strict();\n\n/**\n * Type definition for render options\n */\nexport type RenderOptions = z.infer<typeof RenderOptionsSchema>;\n\n/**\n * Schema for browser names\n */\nexport const BrowserNameSchema = z.enum([\n \"Chrome\",\n \"Firefox\",\n \"Safari\",\n \"internal\",\n \"unknown\",\n]);\n\n/**\n * Type definition for browser names\n */\nexport type BrowserName = z.infer<typeof BrowserNameSchema>;\n\n/**\n * Schema for cookie query strategy\n */\nexport const CookieQueryStrategySchema = z\n .object({\n browserName: BrowserNameSchema,\n queryCookies: z\n .function()\n .args(z.string(), z.string(), z.string().optional())\n .returns(z.promise(z.array(ExportedCookieSchema))),\n })\n .strict();\n\n/**\n * Type definition for cookie query strategy\n */\nexport type CookieQueryStrategy = z.infer<typeof CookieQueryStrategySchema>;\n\n/**\n * Type representing either a single cookie specification or an array of specifications.\n * Useful when you need to query multiple cookies in a single operation.\n * @example\n * ```typescript\n * // Single cookie spec\n * const single: MultiCookieSpec = {\n * domain: \"example.com\",\n * name: \"sessionId\"\n * };\n *\n * // Multiple cookie specs\n * const multiple: MultiCookieSpec = [\n * { domain: \"example.com\", name: \"sessionId\" },\n * { domain: \"api.example.com\", name: \"authToken\" }\n * ];\n * ```\n */\nexport type MultiCookieSpec = CookieSpec | CookieSpec[];\n\n/**\n *\n */\nexport interface CookieQueryOptions<\n T extends CookieQueryStrategy = CookieQueryStrategy,\n> {\n strategy: T;\n limit?: number;\n removeExpired?: boolean;\n store?: string;\n}\n","import { Buffer } from \"buffer\";\n\nimport { BinaryCookieRow } from \"../../../types/schemas\";\nimport { logWarn } from \"../../../utils/logHelpers\";\nimport { createTaggedLogger } from \"../../../utils/logHelpers\";\n\nimport { BinaryCodableCookie } from \"./BinaryCodableCookie\";\nimport { BinaryCodableContainer } from \"./interfaces/BinaryCodableContainer\";\n\nconst logger = createTaggedLogger(\"BinaryCodablePage\");\n\n/**\n * Represents a page of cookies within the binary cookies file\n */\nexport class BinaryCodablePage {\n /**\n *\n */\n public cookies: BinaryCodableCookie[];\n private static readonly HEADER = 0x00000100;\n private static readonly FOOTER = 0x00000000;\n\n /**\n * Creates a new Page instance from a buffer\n * @param buffer - The raw binary page data\n */\n public constructor(buffer: Buffer) {\n this.cookies = [];\n const container: BinaryCodableContainer = { offset: 0, buffer };\n this.decode(container);\n }\n\n /**\n * Converts the page's cookies into validated cookie rows\n * @returns Array of validated cookie objects\n */\n public toCookieRows(): BinaryCookieRow[] {\n const cookies: BinaryCookieRow[] = [];\n\n for (const cookie of this.cookies) {\n try {\n const cookieRow = cookie.toCookieRow();\n if (cookieRow !== null) {\n cookies.push(cookieRow);\n }\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n logWarn(\"BinaryCookies\", \"Error converting cookie\", {\n error: errorMessage,\n });\n }\n }\n\n return cookies;\n }\n\n private decode(container: BinaryCodableContainer): void {\n // Read page tag (4 bytes)\n const header = container.buffer.readUInt32BE(container.offset);\n logger.debug(\"Page header:\", header.toString(16));\n container.offset += 4;\n if (header !== BinaryCodablePage.HEADER) {\n throw new Error(\"Invalid page header\");\n }\n\n // Read number of cookies (4 bytes)\n const cookieCount = container.buffer.readUInt32LE(container.offset);\n logger.debug(\"Cookie count:\", cookieCount);\n container.offset += 4;\n\n // Store the page start offset for calculating absolute cookie positions\n const pageStart = container.offset - 8;\n logger.debug(\"Page start offset:\", pageStart);\n\n // Read cookie offsets (4 bytes each)\n const cookieOffsets: number[] = [];\n for (let i = 0; i < cookieCount; i++) {\n const cookieOffset = container.buffer.readUInt32LE(container.offset);\n cookieOffsets.push(cookieOffset);\n logger.debug(`Cookie ${i} offset:`, cookieOffset);\n container.offset += 4;\n }\n\n // Read page end marker (4 bytes)\n const footer = container.buffer.readUInt32BE(container.offset);\n logger.debug(\"Page footer:\", footer.toString(16));\n container.offset += 4;\n if (footer !== BinaryCodablePage.FOOTER) {\n throw new Error(\"Invalid page footer\");\n }\n\n // Read cookies at their offsets\n for (let i = 0; i < cookieCount; i++) {\n try {\n const cookieOffset = cookieOffsets[i];\n logger.debug(`Reading cookie ${i} at offset:`, cookieOffset);\n\n // Read cookie size from the cookie header\n const cookieSize = container.buffer.readUInt32LE(cookieOffset);\n logger.debug(`Cookie ${i} size:`, cookieSize);\n if (cookieSize < 48) {\n // Minimum cookie size is 48 bytes (header)\n logger.warn(`Invalid cookie size ${cookieSize} at index ${i}`);\n continue;\n }\n\n // Ensure we don't read past the buffer\n if (cookieOffset + cookieSize > container.buffer.length) {\n logger.warn(\n `Cookie size ${cookieSize} at index ${i} would exceed buffer length ${container.buffer.length}`,\n );\n continue;\n }\n\n const cookieBuffer = container.buffer.subarray(\n cookieOffset,\n cookieOffset + cookieSize,\n );\n const cookie = new BinaryCodableCookie(cookieBuffer);\n this.cookies.push(cookie);\n } catch (error) {\n logger.warn(\"Invalid cookie data\", {\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n }\n}\n","import type { BinaryCookieRow } from \"../../../types/schemas\";\n\nimport { BinaryCodableCookies } from \"./BinaryCodableCookies\";\n\n/**\n * Decodes a Safari binary cookie file into an array of cookie objects.\n * @param cookieDbPath - Path to the Safari Cookies.binarycookies file\n * @returns Array of decoded cookie objects\n * @throws {Error} If the file cannot be read or has invalid format\n */\nexport function decodeBinaryCookies(cookieDbPath: string): BinaryCookieRow[] {\n const cookies = BinaryCodableCookies.fromFile(cookieDbPath);\n return cookies.toCookieRows();\n}\n\n/**\n * Retrieves cookies from Safari's binary cookie store.\n * @returns Array of decoded Safari cookies\n */\nexport function getSafariCookies(): BinaryCookieRow[] {\n const cookies = BinaryCodableCookies.fromDefaultPath();\n return cookies.toCookieRows();\n}\n","import { ChromeCookieQueryStrategy } from \"@core/browsers/chrome/ChromeCookieQueryStrategy\";\nimport { CompositeCookieQueryStrategy } from \"@core/browsers/CompositeCookieQueryStrategy\";\nimport { FirefoxCookieQueryStrategy } from \"@core/browsers/firefox/FirefoxCookieQueryStrategy\";\nimport { SafariCookieQueryStrategy } from \"@core/browsers/safari/SafariCookieQueryStrategy\";\n\n/**\n * Represents a strategy for querying cookies from a browser\n */\nexport type CookieQueryStrategy =\n | CompositeCookieQueryStrategy\n | ChromeCookieQueryStrategy\n | FirefoxCookieQueryStrategy\n | SafariCookieQueryStrategy;\n\n/**\n * Factory for creating browser-specific cookie query strategies\n */\nexport const CookieStrategyFactory = {\n strategies: new Map<string, new () => CookieQueryStrategy>([\n [\"safari\", SafariCookieQueryStrategy],\n [\"firefox\", FirefoxCookieQueryStrategy],\n [\"chrome\", ChromeCookieQueryStrategy],\n ]),\n\n /**\n * Creates a strategy for the specified browser\n * @param browser - The browser to create a strategy for\n * @returns A cookie query strategy for the specified browser\n */\n createStrategy(browser?: string): CookieQueryStrategy {\n if (typeof browser !== \"string\") {\n return new CompositeCookieQueryStrategy([\n new SafariCookieQueryStrategy(),\n new FirefoxCookieQueryStrategy(),\n new ChromeCookieQueryStrategy(),\n ]);\n }\n\n const Strategy = this.strategies.get(browser.toLowerCase());\n if (Strategy !== undefined) {\n return new Strategy();\n }\n\n return new CompositeCookieQueryStrategy([\n new SafariCookieQueryStrategy(),\n new FirefoxCookieQueryStrategy(),\n new ChromeCookieQueryStrategy(),\n ]);\n },\n};\n","import type { CookieSpec, ExportedCookie } from \"../types/schemas\";\nimport { logger } from \"../utils/logHelpers\";\n\nimport { CookieQueryService } from \"./services/CookieQueryService\";\nimport {\n CookieStrategyFactory,\n type CookieQueryStrategy,\n} from \"./services/CookieStrategyFactory\";\n\n/**\n * Format a cookie's metadata field if it exists and is of the correct type\n * @param meta - The metadata object\n * @param field - The field name to format\n * @param type - The expected type of the field\n * @returns Formatted string or null\n */\nfunction formatMetaField(\n meta: Record<string, unknown> | undefined,\n field: string,\n type: string,\n): string | null {\n if (!meta || !(field in meta)) {\n return null;\n }\n\n const value = meta[field];\n if (typeof value !== type) {\n return null;\n }\n\n const fieldDisplay = field.charAt(0).toUpperCase() + field.slice(1);\n const displayValue = type === \"number\" ? (value as number) : String(value);\n return ` ${fieldDisplay}: ${displayValue}`;\n}\n\n/**\n * Format cookie dates\n * @param cookie - The cookie to format dates for\n * @returns Array of formatted date strings\n */\nfunction formatDates(cookie: ExportedCookie): string[] {\n const lines: string[] = [];\n\n const creation = cookie.meta?.creation;\n if (typeof creation === \"number\") {\n const creationDate = new Date(creation * 1000);\n lines.push(` Creation: ${creationDate.toISOString()}`);\n }\n\n if (\n cookie.expiry !== \"Infinity\" &&\n (typeof cookie.expiry === \"number\" || cookie.expiry instanceof Date)\n ) {\n const expiryDate = new Date(cookie.expiry);\n lines.push(` Expiry: ${expiryDate.toISOString()}`);\n }\n\n return lines;\n}\n\n/**\n * Format a cookie for display\n * @param cookie - The cookie to format\n * @returns Array of formatted lines\n */\nfunction formatCookie(cookie: ExportedCookie): string[] {\n const lines: string[] = [\n \"Cookie details:\",\n ` Name: ${cookie.name}`,\n ` Domain: ${cookie.domain}`,\n ` Value: ${cookie.value}`,\n ];\n\n const metaFields = [\"path\", \"flags\", \"version\"] as const;\n for (const field of metaFields) {\n const formatted = formatMetaField(\n cookie.meta,\n field,\n field === \"path\" ? \"string\" : \"number\",\n );\n if (formatted !== null) {\n lines.push(formatted);\n }\n }\n\n lines.push(...formatDates(cookie));\n lines.push(\"\");\n return lines;\n}\n\ninterface QueryOptions {\n /** Maximum number of cookies to return */\n limit?: number;\n /** Whether to remove expired cookies */\n removeExpired: boolean;\n /** Optional path to a specific binarycookies store file */\n store?: string;\n /** Strategy for querying cookies */\n strategy: CookieQueryStrategy;\n}\n\n/**\n * Internal function to query cookies and apply limit\n * @param queryService - The query service to use\n * @param specs - Cookie specifications to query\n * @param options - Query options including limit, expiry handling, store path, and strategy\n * @returns Array of cookies\n */\nasync function queryAndLimitCookies(\n queryService: CookieQueryService,\n specs: CookieSpec[],\n options: QueryOptions,\n): Promise<ExportedCookie[]> {\n let results: ExportedCookie[] = [];\n\n for (const spec of specs) {\n const cookies = await queryService.queryCookies(spec, options);\n results = [...results, ...cookies];\n\n if (\n typeof options.limit === \"number\" &&\n options.limit > 0 &&\n results.length >= options.limit\n ) {\n results = results.slice(0, options.limit);\n break;\n }\n }\n\n return results;\n}\n\n/**\n * Query cookies from the browser using the specified strategy\n * @param args - Command line arguments including browser and output format options\n * @param cookieSpec - Cookie specification(s) to query for\n * @param limit - Maximum number of cookies to return\n * @param removeExpired - Whether to remove expired cookies\n * @param store - Optional path to a specific binarycookies store file\n */\nexport async function cliQueryCookies(\n args: Record<string, unknown>,\n cookieSpec: CookieSpec | CookieSpec[],\n limit?: number,\n removeExpired = false,\n store?: string,\n): Promise<void> {\n try {\n const browser = typeof args.browser === \"string\" ? args.browser : undefined;\n const strategy = CookieStrategyFactory.createStrategy(browser);\n const queryService = new CookieQueryService(strategy);\n const specs = Array.isArray(cookieSpec) ? cookieSpec : [cookieSpec];\n\n const results = await queryAndLimitCookies(queryService, specs, {\n limit,\n removeExpired,\n store,\n strategy,\n });\n\n if (results.length === 0) {\n logger.error(\"No results\");\n return;\n }\n\n if (args[\"--json\"] === true) {\n logger.log(JSON.stringify(results, null, 2));\n } else {\n results.forEach((cookie: ExportedCookie) => {\n const lines = formatCookie(cookie);\n lines.forEach((line) => logger.log(line));\n });\n }\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error(\"An unknown error occurred\");\n }\n }\n}\n\nfunction formatResults(results: ExportedCookie[]): void {\n if (results.length === 0) {\n logger.warn(\"No cookies found matching the specified criteria\");\n return;\n }\n\n logger.log(JSON.stringify(results, null, 2));\n}\n\nfunction formatResultsVerbose(results: ExportedCookie[]): void {\n if (results.length === 0) {\n logger.warn(\"No cookies found matching the specified criteria\");\n return;\n }\n\n const lines: string[] = [];\n results.forEach((cookie) => {\n lines.push(\"\\n-------------------\");\n lines.push(`Name: ${cookie.name}`);\n lines.push(`Domain: ${cookie.domain}`);\n lines.push(`Value: ${cookie.value}`);\n\n const path = cookie.meta?.path;\n if (typeof path === \"string\" && path.length > 0) {\n lines.push(`Path: ${path}`);\n }\n\n const dateLines = formatDates(cookie);\n lines.push(...dateLines);\n\n if (cookie.meta) {\n const metaLines = [\n formatMetaField(cookie.meta, \"file\", \"string\"),\n formatMetaField(cookie.meta, \"browser\", \"string\"),\n formatMetaField(cookie.meta, \"profile\", \"string\"),\n formatMetaField(cookie.meta, \"decrypted\", \"boolean\"),\n ].filter((line): line is string => line !== null);\n\n if (metaLines.length > 0) {\n lines.push(\"Metadata:\");\n lines.push(...metaLines);\n }\n }\n });\n\n lines.forEach((line) => logger.log(line));\n}\n\n/**\n * Query cookies based on the provided specification\n * @param spec - The cookie specification to query\n * @param service - The cookie query service to use\n * @param verbose - Whether to output verbose information\n * @returns Promise that resolves when the query is complete\n */\nexport async function queryCookies(\n spec: CookieSpec,\n service: CookieQueryService,\n verbose = false,\n): Promise<void> {\n const results = await service.queryCookies(spec);\n if (verbose) {\n formatResultsVerbose(results);\n } else {\n formatResults(results);\n }\n}\n","#!/usr/bin/env node\n\n// Local imports - core\nimport { cookieSpecsFromUrl } from \"@core/cookies/cookieSpecsFromUrl\";\nimport { parseArgv } from \"@utils/argv\";\nimport logger from \"@utils/logger\";\n\nimport type { CookieSpec } from \"../types/schemas\";\n\nimport { cliQueryCookies } from \"./cliQueryCookies\";\n\nfunction showHelp(): void {\n logger.log(`Usage: get-cookie [name] [domain] [options]`);\n logger.log(`Options:`);\n logger.log(` -h, --help: Show this help message`);\n logger.log(` -v, --verbose: Enable verbose output`);\n logger.log(` -d, --dump: Dump all results`);\n logger.log(` -D, --dump-grouped: Dump all results, grouped by profile`);\n logger.log(` -r, --render: Render all results`);\n logger.log(` -u, --url: URL to extract cookie specs from`);\n logger.log(` -n, --name: Cookie name pattern`);\n logger.log(` -d, --domain: Cookie domain pattern`);\n logger.log(` --store: Path to a specific binarycookies store file`);\n logger.log(` --output: Output format (e.g., json)`);\n}\n\nfunction createCookieSpec(name: string, domain: string): CookieSpec {\n return {\n name: name || \"%\",\n domain: domain || \"%\",\n };\n}\n\nfunction getCookieSpecs(\n values: Record<string, string | boolean | string[]>,\n positionals: string[],\n): CookieSpec[] {\n const url = values.url as string | undefined;\n\n if (typeof url === \"string\") {\n const specs = cookieSpecsFromUrl(url);\n if (!Array.isArray(specs)) {\n logger.error(\"Invalid cookie specs from URL\");\n return [];\n }\n return specs;\n }\n\n const name = (values.name as string) || positionals[0] || \"%\";\n const domain = (values.domain as string) || positionals[1] || \"%\";\n return [createCookieSpec(name, domain)];\n}\n\nasync function handleCookieQuery(\n values: Record<string, string | boolean | string[]>,\n positionals: string[],\n): Promise<void> {\n const cookieSpecs = getCookieSpecs(values, positionals);\n\n if (values.verbose === true) {\n logger.log(\"cookieSpecs\", cookieSpecs);\n }\n\n try {\n await cliQueryCookies(\n values,\n cookieSpecs,\n undefined,\n values.removeExpired === true,\n values.store as string | undefined,\n );\n } catch (error) {\n if (error instanceof Error) {\n logger.error(\"Error querying cookies:\", error.message);\n } else {\n logger.error(\"An unknown error occurred while querying cookies\");\n }\n }\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n const { values, positionals } = parseArgv(args);\n\n if (values.help === true) {\n showHelp();\n return;\n }\n\n await handleCookieQuery(values, positionals);\n}\n\nmain().catch((error) => {\n if (error instanceof Error) {\n logger.error(\"Fatal error:\", error.message);\n } else {\n logger.error(\"An unknown fatal error occurred\");\n }\n process.exit(1);\n});\n"],"mappings":";ueAQA,SAASA,GAA8BC,EAA8B,CACnE,IAAMC,EAAQD,EAAO,MAAM,GAAG,EACxBE,EAA4B,CAAC,EAMnCA,EAAY,KAAK,CACf,KAAM,IACN,OAAQF,CACV,CAAC,EAOD,QAASG,EAAI,EAAGA,EAAIF,EAAM,OAAS,EAAGE,IAAK,CACzC,IAAMC,EAAYH,EAAM,MAAME,CAAC,EAAE,KAAK,GAAG,EACzCD,EAAY,KAAK,CACf,KAAM,IACN,OAAQE,CACV,CAAC,CACH,CAEA,OAAOF,CACT,CA8BO,SAASG,GAAmBC,EAA2B,CAE5D,GAAI,CAACA,EAAI,SAAS,KAAK,EACrB,GAAI,CACF,OAAOD,GAAmB,WAAWC,CAAG,EAAE,CAC5C,MAAQ,CAEN,MAAO,CACL,CACE,KAAM,IACN,OAAQA,CACV,CACF,CACF,CAGF,GAAI,CACF,IAAMC,EAAS,IAAI,IAAID,CAAG,EAC1B,OAAOP,GAA8BQ,EAAO,QAAQ,CACtD,MAAiB,CAMf,MAAO,CACL,CACE,KAAM,IACN,OAAQD,CACV,CACF,CACF,CACF,CCjGA,IAAAE,GAAqB,yBA4Cd,SAASC,GAAUC,EAA4B,CACpD,IAAMC,KAAS,GAAAC,SAASF,EAAM,CAC5B,OAAQ,CAAC,UAAW,UAAW,MAAO,SAAU,OAAQ,SAAU,OAAO,EACzE,QAAS,CACP,OACA,UACA,UACA,OACA,eACA,SACA,gBAC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E,MAAO,CACL,KAAMD,GAAQ,IACd,OAAQC,GAAU,GACpB,CACF,CAEA,SAASC,GACPC,EACAC,EACc,CACd,IAAMC,EAAMF,EAAO,IAEnB,GAAI,OAAOE,GAAQ,SAAU,CAC3B,IAAMC,EAAQC,GAAmBF,CAAG,EACpC,OAAK,MAAM,QAAQC,CAAK,EAIjBA,GAHLR,EAAO,MAAM,+BAA+B,EACrC,CAAC,EAGZ,CAEA,IAAME,EAAQG,EAAO,MAAmBC,EAAY,CAAC,GAAK,IACpDH,EAAUE,EAAO,QAAqBC,EAAY,CAAC,GAAK,IAC9D,MAAO,CAACL,GAAiBC,EAAMC,CAAM,CAAC,CACxC,CAEA,eAAeO,GACbL,EACAC,EACe,CACf,IAAMK,EAAcP,GAAeC,EAAQC,CAAW,EAElDD,EAAO,UAAY,IACrBL,EAAO,IAAI,cAAeW,CAAW,EAGvC,GAAI,CACF,MAAMC,GACJP,EACAM,EACA,OACAN,EAAO,gBAAkB,GACzBA,EAAO,KACT,CACF,OAASQ,EAAO,CACVA,aAAiB,MACnBb,EAAO,MAAM,0BAA2Ba,EAAM,OAAO,EAErDb,EAAO,MAAM,kDAAkD,CAEnE,CACF,CAEA,eAAec,IAAsB,CACnC,IAAMC,EAAO,QAAQ,KAAK,MAAM,CAAC,EAC3B,CAAE,OAAAV,EAAQ,YAAAC,CAAY,EAAIU,GAAUD,CAAI,EAE9C,GAAIV,EAAO,OAAS,GAAM,CACxBN,GAAS,EACT,MACF,CAEA,MAAMW,GAAkBL,EAAQC,CAAW,CAC7C,CAEAQ,GAAK,EAAE,MAAOD,GAAU,CAClBA,aAAiB,MACnBb,EAAO,MAAM,eAAgBa,EAAM,OAAO,EAE1Cb,EAAO,MAAM,iCAAiC,EAEhD,QAAQ,KAAK,CAAC,CAChB,CAAC","names":["processDomainsIntoCookieSpecs","domain","parts","cookieSpecs","i","subDomain","cookieSpecsFromUrl","url","urlObj","import_minimist","parseArgv","argv","parsed","minimist","_","values","import_consola","import_os","import_dotenv","import_zod","EnvironmentSchema","val","env","consola","env","isDebug","logger","logger_default","logOperationResult","operation","success","context","logger_default","logError","message","error","errorMessage","logWarn","component","createTaggedLogger","CookieQueryService","strategy","spec","options","import_fs","import_path","import_fast_glob","import_os","import_path","chromeApplicationSupport","home","import_better_sqlite3","openDatabase","file","BetterSqlite3","error","logError","closeDatabase","db","querySqliteThenTransform","sql","params","rowFilter","rowTransform","rows","filteredRows","logger","createTaggedLogger","isValidFilePath","path","trimmedPath","getCookieFiles","patterns","chromeApplicationSupport","files","pattern","matches","glob","buildSqlQuery","name","domain","isWildcard","sql","params","processCookieFile","cookieFile","rows","querySqliteThenTransform","row","logOperationResult","error","logError","getEncryptedChromeCookie","file","cookieFiles","results","cookies","import_fast_glob","logger","createTaggedLogger","listChromeProfilePaths","files","fg","chromeApplicationSupport","import_crypto","freeGlobal","freeGlobal_default","freeSelf","root","freeGlobal_default","root_default","Symbol","root_default","Symbol_default","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","Symbol_default","getRawTag","value","isOwn","tag","unmasked","result","getRawTag_default","objectProto","nativeObjectToString","objectToString","value","objectToString_default","nullTag","undefinedTag","symToStringTag","Symbol_default","baseGetTag","value","getRawTag_default","objectToString_default","baseGetTag_default","isObject","value","type","isObject_default","asyncTag","funcTag","genTag","proxyTag","isFunction","value","isObject_default","tag","baseGetTag_default","isFunction_default","coreJsData","root_default","coreJsData_default","maskSrcKey","uid","coreJsData_default","isMasked","func","isMasked_default","funcProto","funcToString","toSource","func","toSource_default","reRegExpChar","reIsHostCtor","funcProto","objectProto","funcToString","hasOwnProperty","reIsNative","baseIsNative","value","isObject_default","isMasked_default","pattern","isFunction_default","toSource_default","baseIsNative_default","getValue","object","key","getValue_default","getNative","object","key","value","getValue_default","baseIsNative_default","getNative_default","eq","value","other","eq_default","nativeCreate","getNative_default","nativeCreate_default","hashClear","nativeCreate_default","hashClear_default","hashDelete","key","result","hashDelete_default","HASH_UNDEFINED","objectProto","hasOwnProperty","hashGet","key","data","nativeCreate_default","result","hashGet_default","objectProto","hasOwnProperty","hashHas","key","data","nativeCreate_default","hashHas_default","HASH_UNDEFINED","hashSet","key","value","data","nativeCreate_default","hashSet_default","Hash","entries","index","length","entry","hashClear_default","hashDelete_default","hashGet_default","hashHas_default","hashSet_default","Hash_default","listCacheClear","listCacheClear_default","assocIndexOf","array","key","length","eq_default","assocIndexOf_default","arrayProto","splice","listCacheDelete","key","data","index","assocIndexOf_default","lastIndex","listCacheDelete_default","listCacheGet","key","data","index","assocIndexOf_default","listCacheGet_default","listCacheHas","key","assocIndexOf_default","listCacheHas_default","listCacheSet","key","value","data","index","assocIndexOf_default","listCacheSet_default","ListCache","entries","index","length","entry","listCacheClear_default","listCacheDelete_default","listCacheGet_default","listCacheHas_default","listCacheSet_default","ListCache_default","Map","getNative_default","root_default","Map_default","mapCacheClear","Hash_default","Map_default","ListCache_default","mapCacheClear_default","isKeyable","value","type","isKeyable_default","getMapData","map","key","data","isKeyable_default","getMapData_default","mapCacheDelete","key","result","getMapData_default","mapCacheDelete_default","mapCacheGet","key","getMapData_default","mapCacheGet_default","mapCacheHas","key","getMapData_default","mapCacheHas_default","mapCacheSet","key","value","data","getMapData_default","size","mapCacheSet_default","MapCache","entries","index","length","entry","mapCacheClear_default","mapCacheDelete_default","mapCacheGet_default","mapCacheHas_default","mapCacheSet_default","MapCache_default","FUNC_ERROR_TEXT","memoize","func","resolver","memoized","args","key","cache","result","MapCache_default","memoize_default","removeV10Prefix","memoize_default","value","removePadding","decrypted","padding","extractValue","decodedString","cleanupPatterns","pattern","decrypt","encryptedValue","password","resolve","reject","error","key","iv","decipher","e","import_os","import_child_process","import_util","execPromise","CommandExecutionError","message","command","originalError","execSimple","options","result","error","logError","getChromePassword","execSimple","getChromePassword","getExpiryDate","expiry","createExportedCookie","domain","name","value","file","decrypted","ChromeCookieQueryStrategy","createTaggedLogger","store","cookieFiles","listChromeProfilePaths","files","password","getChromePassword","error","logError","encryptedCookies","getEncryptedChromeCookie","context","cookie","result","decryptedValue","decrypt","flatMapAsync","array","callback","defaultValue","item","CompositeCookieQueryStrategy","strategies","createTaggedLogger","error","strategy","name","domain","store","flatMapAsync","import_os","import_path","import_fast_glob","logger","createTaggedLogger","findFirefoxCookieFiles","home","logWarn","patterns","files","pattern","matches","fg","FirefoxCookieQueryStrategy","name","domain","store","fileList","results","file","cookies","querySqliteThenTransform","row","error","import_os","import_path","import_buffer","import_fs","import_os","import_path","import_buffer","import_destr","import_zod","CookieDomainSchema","domain","CookieNameSchema","name","CookiePathSchema","path","CookieValueSchema","value","destr","BinaryCookieRowSchema","CookieSpecSchema","CookieMetaSchema","ExportedCookieSchema","CookieRowSchema","RenderOptionsSchema","BrowserNameSchema","CookieQueryStrategySchema","logger","createTaggedLogger","BinaryCodableCookie","buffer","container","value","processed","lastProcessed","token","parts","payload","parsed","decoded","jwtPayload","jsonValue","flagsValue","domain","macToUnixOffset","expiryUnix","creationUnix","BinaryCookieRowSchema","offset","end","size","version","hasPort","offsets","expirationBuffer","expiration","creationBuffer","creation","offsetEntries","entry","a","b","e","field","length","baseOffset","logger","createTaggedLogger","_BinaryCodablePage","buffer","container","cookies","cookie","cookieRow","error","errorMessage","logWarn","header","cookieCount","pageStart","cookieOffsets","i","cookieOffset","footer","cookieSize","cookieBuffer","BinaryCodableCookie","BinaryCodablePage","logger","createTaggedLogger","_BinaryCodableCookies","buffer","container","path","cookies","page","pageCookies","error","errorMessage","logWarn","magic","pageCount","pageSizes","i","pageSize","currentOffset","pageBuffer","BinaryCodablePage","checksum","footer","_plistData","BinaryCodableCookies","decodeBinaryCookies","cookieDbPath","BinaryCodableCookies","SafariCookieQueryStrategy","home","domain","expiry","flags","bit","creation","cookieDbPath","name","decodeBinaryCookies","cookie","error","logError","store","CookieStrategyFactory","SafariCookieQueryStrategy","FirefoxCookieQueryStrategy","ChromeCookieQueryStrategy","browser","CompositeCookieQueryStrategy","Strategy","formatMetaField","meta","field","type","value","fieldDisplay","displayValue","formatDates","cookie","lines","creation","creationDate","expiryDate","formatCookie","metaFields","formatted","queryAndLimitCookies","queryService","specs","options","results","spec","cookies","cliQueryCookies","args","cookieSpec","limit","removeExpired","store","browser","strategy","CookieStrategyFactory","CookieQueryService","logger_default","line","error","showHelp","logger_default","createCookieSpec","name","domain","getCookieSpecs","values","positionals","url","specs","cookieSpecsFromUrl","handleCookieQuery","cookieSpecs","cliQueryCookies","error","main","args","parseArgv"]}
|