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CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;YACzC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;YACxB,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;YAClC,wDAAwD;YACxD,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YACnG,UAAU,CAAC,KAAK,GAAG,UAAS,GAAG,IAAW;gBACzC,UAAU,CAAC,OAAO,CAAC,CAAC;gBACpB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACvC,CAAC,CAAC;QACH,CAAC;QACD,MAAM,CAAC,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,kBAAkB,IAA0D;IACjF,UAAU,GAAG,IAAI,CAAC;AACnB,CAAC","sourcesContent":["import has from './has';\n\n/**\n * The default message to warn when no other is provided\n */\nconst DEFAULT_DEPRECATED_MESSAGE = 'This function will be removed in future versions.';\n\n/**\n * When set, globalWarn will be used instead of `console.warn`\n */\nlet globalWarn: ((message?: any, ...optionalParams: any[]) => void) | undefined;\n\nexport interface DeprecatedOptions {\n\t/**\n\t * The message to use when warning\n\t */\n\tmessage?: string;\n\n\t/**\n\t * The name of the method or function to use\n\t */\n\tname?: string;\n\n\t/**\n\t * An alternative function to log the warning to\n\t */\n\twarn?: (...args: any[]) => void;\n\n\t/**\n\t * Reference an URL for more information when warning\n\t */\n\turl?: string;\n}\n\n/**\n * A function that will console warn that a function has been deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecated({ message, name, warn, url }: DeprecatedOptions = {}): void {\n\t/* istanbul ignore else: testing with debug off is difficult */\n\tif (has('debug')) {\n\t\tmessage = message || DEFAULT_DEPRECATED_MESSAGE;\n\t\tlet warning = `DEPRECATED: ${name ? name + ': ' : ''}${message}`;\n\t\tif (url) {\n\t\t\twarning += `\\n\\n    See ${url} for more details.\\n\\n`;\n\t\t}\n\t\tif (warn) {\n\t\t\twarn(warning);\n\t\t} else if (globalWarn) {\n\t\t\tglobalWarn(warning);\n\t\t} else {\n\t\t\tconsole.warn(warning);\n\t\t}\n\t}\n}\n\n/**\n * A function that generates before advice that can be used to warn when an API has been deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecatedAdvice(options?: DeprecatedOptions): (...args: any[]) => any[] {\n\treturn function(...args: any[]): any[] {\n\t\tdeprecated(options);\n\t\treturn args;\n\t};\n}\n\n/**\n * A method decorator that will console warn when a method if invoked that is deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecatedDecorator(options?: DeprecatedOptions): MethodDecorator {\n\treturn function(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) {\n\t\tif (has('debug')) {\n\t\t\tconst { value: originalFn } = descriptor;\n\t\t\toptions = options || {};\n\t\t\tpropertyKey = String(propertyKey);\n\t\t\t/* IE 10/11 don't have the name property on functions */\n\t\t\toptions.name = target.constructor.name ? `${target.constructor.name}#${propertyKey}` : propertyKey;\n\t\t\tdescriptor.value = function(...args: any[]) {\n\t\t\t\tdeprecated(options);\n\t\t\t\treturn originalFn.apply(target, args);\n\t\t\t};\n\t\t}\n\t\treturn descriptor;\n\t};\n}\n\n/**\n * A function that will set the warn function that will be used instead of `console.warn` when\n * logging warning messages\n *\n * @param warn The function (or `undefined`) to use instead of `console.warn`\n */\nexport function setWarn(warn?: ((message?: any, ...optionalParams: any[]) => void)): void {\n\tglobalWarn = warn;\n}\n"]}