UNPKG

imgix-url-builder

Version:

JavaScript/TypeScript Imgix URL builders for browsers and Node.js

1 lines 24.8 kB
{"version":3,"file":"SecureClient.cjs","sources":["../../../src/node/SecureClient.ts"],"sourcesContent":["import type { BuildPixelDensitySrcSetParams } from \"../buildPixelDensitySrcSet\";\nimport type { BuildWidthSrcSetParams } from \"../buildWidthSrcSet\";\nimport type { ImgixURLParams } from \"../types.generated\";\nimport { buildPixelDensitySrcSet } from \"../buildPixelDensitySrcSet\";\nimport { buildSignedPixelDensitySrcSet } from \"./buildSignedPixelDensitySrcSet\";\nimport { buildSignedURL } from \"./buildSignedURL\";\nimport { buildSignedWidthSrcSet } from \"./buildSignedWidthSrcSet\";\nimport { buildURL } from \"../buildURL\";\nimport { buildWidthSrcSet } from \"../buildWidthSrcSet\";\nimport { signURL } from \"./signURL\";\n\n/**\n * Options to instantiate a new secure client.\n */\nexport type SecureClientOptions = {\n\t/**\n\t * The base URL used to construct image URLs from a path. The base URL must\n\t * include the protocol, domain, and optionally a path.\n\t *\n\t * @example `https://example.imgix.net`\n\t *\n\t * @example `https://example.imgix.net/folder`\n\t */\n\tbaseURL: string;\n\n\t/**\n\t * The secret secure URL token for the configured Imgix domain.\n\t *\n\t * @see How to get a token: https://docs.imgix.com/setup/securing-images\n\t */\n\tsecureURLToken: string;\n};\n\n/**\n * An Imgix Rendering API client with automatic URL signing. A client is paired\n * to a single Imgix domain and secure URL token.\n *\n * **Important**: This client should only be used in a trusted environment and\n * never in a browser. The `secureURLToken` parameter is a secret and should not\n * be exposed to the public.\n */\nexport class SecureClient {\n\t/**\n\t * The base URL used to construct image URLs from a path. The base URL must\n\t * include the protocol, domain, and optionally a path.\n\t */\n\tbaseURL: string;\n\n\t/**\n\t * The secret secure URL token for the configured Imgix domain.\n\t */\n\tsecureURLToken: string;\n\n\t/**\n\t * Creates a new `SecureClient` instance for an Imgix domain.\n\t *\n\t * @param options - Options to instantiate a new client.\n\t *\n\t * @returns A `SecureClient` instance for the given Imgix domain.\n\t */\n\tconstructor(options: SecureClientOptions) {\n\t\tthis.baseURL = options.baseURL;\n\t\tthis.secureURLToken = options.secureURLToken;\n\t}\n\n\t/**\n\t * Builds a Web Proxy URL that proxies a non-Imgix URL to Imgix. The client's\n\t * Imgix domain must be configured as a Web Proxy source. All Web Proxy URLs\n\t * will be signed automatically.\n\t *\n\t * **Important**: The given URL must not be URI encoded. If it is, decode it\n\t * before passing it to `buildWebProxyURL()`.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const url = client.buildWebProxyURL(\"https://www.this.com/pic.jpg\", {\n\t * \twidth: 400,\n\t * });\n\t * // => https://example.imgix.net/https%3A%2F%2Fwww.this.com%2Fpic.jpg?width=400&s=def3e221c3f4c4debda091b8e49420ea\n\t * ```\n\t *\n\t * @param url - Full absolute URL to the source image to proxy.\n\t * @param params - An object of Imgix URL API parameters.\n\t *\n\t * @returns An Imgix url proxying `url` to the client's Imgix domain.\n\t */\n\tbuildWebProxyURL(url: string, params: ImgixURLParams = {}): string {\n\t\treturn this.buildSignedURLForPath(encodeURIComponent(url), params);\n\t}\n\n\t/**\n\t * Builds a URL to an Imgix image with Imgix URL API parameters for the\n\t * client's base URL.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const url = client.buildURLForPath(\"/image.png\", { width: 400 });\n\t * // => https://example.imgix.net/image.png?width=400&s=def3e221c3f4c4debda091b8e49420ea\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net/folder\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const url = client.buildURLForPath(\"./image.png\", { width: 400 });\n\t * // => https://example.imgix.net/folder/image.png?width=400&s=f12c7c39333410c10c2930b57116a943\n\t * ```\n\t *\n\t * @param path - Path to the image relative to the client's base URL.\n\t * @param params - An object of Imgix URL API parameters.\n\t *\n\t * @returns The full absolute URL to the image with the given Imgix URL API\n\t * parameters applied.\n\t */\n\tbuildSignedURLForPath(path: string, params: ImgixURLParams = {}): string {\n\t\treturn this.signURL(this.buildURLForPath(path, params));\n\t}\n\n\t/**\n\t * Builds a URL to an Imgix image with Imgix URL API parameters for the\n\t * client's base URL.\n\t *\n\t * Note: The returned URL is not signed. See `buildSignedURL` if a signature\n\t * is required.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const url = client.buildURLForPath(\"/image.png\", { width: 400 });\n\t * // => https://example.imgix.net/image.png?width=400\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net/folder\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const url = client.buildURLForPath(\"./image.png\", { width: 400 });\n\t * // => https://example.imgix.net/folder/image.png?width=400\n\t * ```\n\t *\n\t * @param path - Path to the image relative to the client's base URL.\n\t * @param params - An object of Imgix URL API parameters.\n\t *\n\t * @returns The full absolute URL to the image with the given Imgix URL API\n\t * parameters applied.\n\t */\n\tbuildURLForPath(path: string, params: ImgixURLParams = {}): string {\n\t\treturn buildURL(`${new URL(path, this.baseURL)}`, params);\n\t}\n\n\t/**\n\t * Builds a URL to an Imgix image with Imgix URL API parameters. The URL is\n\t * signed by appending a signature to the URL parameters. This locks the URL\n\t * and its parameters to the signature to prevent URL tampering.\n\t *\n\t * The given URL must be a full absolute URL containing the protocol and\n\t * domain.\n\t *\n\t * URL parameters already applied to the image will be retained. To remove\n\t * existing parameters, set the parameter to `undefined` in the `params`\n\t * argument.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const url = client.buildSignedURL(\n\t * \t\"https://example.imgix.net/image.png\",\n\t * \t{ width: 400 },\n\t * );\n\t * // => https://example.imgix.net/image.png?width=400&s=def3e221c3f4c4debda091b8e49420ea\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const url = client.buildSignedURL(\n\t * \t\"https://example.imgix.net/image.png?width=400\",\n\t * \t{ height: 300 },\n\t * );\n\t * // => https://example.imgix.net/image.png?width=400&height=300&s=f12c7c39333410c10c2930b57116a943\n\t * ```\n\t *\n\t * @param url - Full absolute URL to the Imgix image.\n\t * @param params - An object of Imgix URL API parameters.\n\t *\n\t * @returns `url` with the given Imgix URL API parameters applied.\n\t *\n\t * @see Imgix URL API reference: https://docs.imgix.com/apis/rendering\n\t * @see Details on securing Imgix images: https://docs.imgix.com/setup/securing-images\n\t */\n\tbuildSignedURL(url: string, params: ImgixURLParams = {}): string {\n\t\treturn buildSignedURL(url, this.secureURLToken, params);\n\t}\n\n\t/**\n\t * Signs an Imgix image URL by appending a signature to the URL parameters.\n\t * This locks the URL and its parameters to the signature to prevent URL\n\t * tampering.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const url = client.signURL(\n\t * \t\"https://example.imgix.net/image.png?width=400\",\n\t * );\n\t * // => https://example.imgix.net/image.png?width=400&s=def3e221c3f4c4debda091b8e49420ea\n\t * ```\n\t *\n\t * @param url - Full absolute URL to the Imgix image to sign.\n\t *\n\t * @returns `url` with a signature appended via an `s` URL parameter.\n\t *\n\t * @see Details on securing Imgix images: https://docs.imgix.com/setup/securing-images\n\t */\n\tsignURL(url: string): string {\n\t\treturn signURL(url, this.secureURLToken);\n\t}\n\n\t/**\n\t * Builds an `<img>` `srcset` attribute value for a given set of widths. It\n\t * can also optinally apply Imgix URL API parameters to the URLs. The URLs are\n\t * signed by appending a signature to their URL parameters. This locks the\n\t * URLs and their parameters to the signature to prevent URL tampering.\n\t *\n\t * The `width` URL parameter will be applied for each `srcset` entry. If a\n\t * `width` or `w` parameter is provided to the `params` parameter, it will be\n\t * ignored.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const srcset = client.buildSignedWidthSrcSet(\n\t * \t\"https://example.imgix.net/image.png\",\n\t * \t{ widths: [400, 800, 1600] },\n\t * );\n\t * // => https://example.imgix.net/image.png?width=400&s=def3e221c3f4c4debda091b8e49420ea 400w,\n\t * // https://example.imgix.net/image.png?width=800&s=f12c7c39333410c10c2930b57116a943 800w,\n\t * // https://example.imgix.net/image.png?width=1600&s=3a975b5087ab7ad2ab91fe66072fd628 1600w\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const srcset = client.buildSignedWidthSrcSet(\n\t * \t\"https://example.imgix.net/image.png\",\n\t * \t{\n\t * \t\twidths: [400, 800, 1600],\n\t * \t\tsat: -100,\n\t * \t},\n\t * );\n\t * // => https://example.imgix.net/image.png?width=400&sat=-100&s=def3e221c3f4c4debda091b8e49420ea 400w,\n\t * // https://example.imgix.net/image.png?width=800&sat=-100&s=f12c7c39333410c10c2930b57116a943 800w,\n\t * // https://example.imgix.net/image.png?width=1600&sat=-100&s=3a975b5087ab7ad2ab91fe66072fd628 1600w\n\t * ```\n\t *\n\t * @param url - Full absolute URL to the Imgix image.\n\t * @param params - An object of Imgix URL API parameters. The `widths`\n\t * parameter defines the resulting `srcset` widths.\n\t *\n\t * @returns A `srcset` attribute value for `url` with the given Imgix URL API\n\t * parameters applied.\n\t */\n\tbuildSignedWidthSrcSet(url: string, params: BuildWidthSrcSetParams): string {\n\t\treturn buildSignedWidthSrcSet(url, this.secureURLToken, params);\n\t}\n\n\t/**\n\t * Builds an `<img>` `srcset` attribute value for a given set of widths for\n\t * the client's base URL. It can also optinally apply Imgix URL API parameters\n\t * to the URLs.\n\t *\n\t * The `width` URL parameter will be applied for each `srcset` entry. If a\n\t * `width` or `w` parameter is provided to the `params` parameter, it will be\n\t * ignored.\n\t *\n\t * Note: The returned URLs are not signed. See `buildSignedWidthSrcSet` if\n\t * signatures are required.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const srcset = client.buildWidthSrcSetForPath(\"/image.png\", {\n\t * \twidths: [400, 800, 1600],\n\t * });\n\t * // => https://example.imgix.net/image.png?width=400 400w,\n\t * // https://example.imgix.net/image.png?width=800 800w,\n\t * // https://example.imgix.net/image.png?width=1600 1600w\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const srcset = client.buildWidthSrcSetForPath(\"/image.png\", {\n\t * \twidths: [400, 800, 1600],\n\t * \tsat: -100,\n\t * });\n\t * // => https://example.imgix.net/image.png?width=400&sat=-100 400w,\n\t * // https://example.imgix.net/image.png?width=800&sat=-100 800w,\n\t * // https://example.imgix.net/image.png?width=1600&sat=-100 1600w\n\t * ```\n\t *\n\t * @param path - Path to the image relative to the client's base URL.\n\t * @param params - An object of Imgix URL API parameters. The `widths`\n\t * parameter defines the resulting `srcset` widths.\n\t *\n\t * @returns A `srcset` attribute value for `url` with the given Imgix URL API\n\t * parameters applied.\n\t */\n\tbuildWidthSrcSetForPath(\n\t\tpath: string,\n\t\tparams: BuildWidthSrcSetParams,\n\t): string {\n\t\treturn buildWidthSrcSet(`${new URL(path, this.baseURL)}`, params);\n\t}\n\n\t/**\n\t * Builds an `<img>` `srcset` attribute value for a given set of widths for\n\t * the client's base URL. It can also optinally apply Imgix URL API parameters\n\t * to the URLs. The URLs are signed by appending a signature to their URL\n\t * parameters. This locks the URLs and their parameters to the signature to\n\t * prevent URL tampering.\n\t *\n\t * The `width` URL parameter will be applied for each `srcset` entry. If a\n\t * `width` or `w` parameter is provided to the `params` parameter, it will be\n\t * ignored.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const srcset = client.buildSignedWidthSrcSetForPath(\"/image.png\", {\n\t * \twidths: [400, 800, 1600],\n\t * });\n\t * // => https://example.imgix.net/image.png?width=400&s=def3e221c3f4c4debda091b8e49420ea 400w,\n\t * // https://example.imgix.net/image.png?width=800&s=f12c7c39333410c10c2930b57116a943 800w,\n\t * // https://example.imgix.net/image.png?width=1600&s=3a975b5087ab7ad2ab91fe66072fd628 1600w\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const srcset = client.buildSignedWidthSrcSetForPath(\"/image.png\", {\n\t * \twidths: [400, 800, 1600],\n\t * \tsat: -100,\n\t * });\n\t * // => https://example.imgix.net/image.png?width=400&sat=-100&s=def3e221c3f4c4debda091b8e49420ea 400w,\n\t * // https://example.imgix.net/image.png?width=800&sat=-100&s=f12c7c39333410c10c2930b57116a943 800w,\n\t * // https://example.imgix.net/image.png?width=1600&sat=-100&s=3a975b5087ab7ad2ab91fe66072fd628 1600w\n\t * ```\n\t *\n\t * @param path - Path to the image relative to the client's base URL.\n\t * @param params - An object of Imgix URL API parameters. The `widths`\n\t * parameter defines the resulting `srcset` widths.\n\t *\n\t * @returns A `srcset` attribute value for `url` with the given Imgix URL API\n\t * parameters applied.\n\t */\n\tbuildSignedWidthSrcSetForPath(\n\t\tpath: string,\n\t\tparams: BuildWidthSrcSetParams,\n\t): string {\n\t\treturn this.buildSignedWidthSrcSet(\n\t\t\t`${new URL(path, this.baseURL)}`,\n\t\t\tparams,\n\t\t);\n\t}\n\n\t/**\n\t * Builds an `<img>` `srcset` attribute value for a given set of pixel\n\t * densities. It can also optinally apply Imgix URL API parameters to the\n\t * URLs. The URLs are signed by appending a signature to their URL parameters.\n\t * This locks the URLs and their parameters to the signature to prevent URL\n\t * tampering.\n\t *\n\t * The `dpr` URL parameter will be applied for each `srcset` entry. If a `dpr`\n\t * parameter is provided to the `params` parameter, it will be ignored.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const srcset = client.buildSignedPixelDensitySrcSet(\n\t * \t\"https://example.imgix.net/image.png\",\n\t * \t{ pixelDensities: [1, 2, 3] },\n\t * );\n\t * // => https://example.imgix.net/image.png?dpr=1&s=def3e221c3f4c4debda091b8e49420ea 1x,\n\t * // https://example.imgix.net/image.png?dpr=2&s=f12c7c39333410c10c2930b57116a943 2x,\n\t * // https://example.imgix.net/image.png?dpr=3&s=3a975b5087ab7ad2ab91fe66072fd628 3x\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const srcset = client.buildSignedPixelDensitySrcSet(\n\t * \t\"https://example.imgix.net/image.png\",\n\t * \t{\n\t * \t\tpixelDensities: [1, 2, 3],\n\t * \t\tsat: -100,\n\t * \t},\n\t * );\n\t * // => https://example.imgix.net/image.png?dpr=1&sat=-100&s=def3e221c3f4c4debda091b8e49420ea 1x,\n\t * // https://example.imgix.net/image.png?dpr=2&sat=-100&s=f12c7c39333410c10c2930b57116a943 2x,\n\t * // https://example.imgix.net/image.png?dpr=3&sat=-100&s=3a975b5087ab7ad2ab91fe66072fd628 3x\n\t * ```\n\t *\n\t * @param url - Full absolute URL to the Imgix image.\n\t * @param params - An object of Imgix URL API parameters. The `pixelDensities`\n\t * parameter defines the resulting `srcset` widths.\n\t *\n\t * @returns A `srcset` attribute value for `url` with the given Imgix URL API\n\t * parameters applied.\n\t */\n\tbuildSignedPixelDensitySrcSet(\n\t\turl: string,\n\t\tparams: BuildPixelDensitySrcSetParams,\n\t): string {\n\t\treturn buildSignedPixelDensitySrcSet(url, this.secureURLToken, params);\n\t}\n\n\t/**\n\t * Builds an `<img>` `srcset` attribute value for a given set of pixel\n\t * densities for the client's base URL. It can also optinally apply Imgix URL\n\t * API parameters to the URLs.\n\t *\n\t * The `dpr` URL parameter will be applied for each `srcset` entry. If a `dpr`\n\t * parameter is provided to the `params` parameter, it will be ignored.\n\t *\n\t * Note: The returned URLs are not signed. See `buildSignedPixelDensitySrcSet`\n\t * if signatures are required.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const srcset = client.buildPixelDensitySrcSetForPath(\"/image.png\", {\n\t * \tpixelDensities: [1, 2, 3],\n\t * });\n\t * // => https://example.imgix.net/image.png?dpr=1 1x,\n\t * // https://example.imgix.net/image.png?dpr=2 2x,\n\t * // https://example.imgix.net/image.png?dpr=3 3x\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const srcset = client.buildPixelDensitySrcSetForPath(\"/image.png\", {\n\t * \tpixelDensities: [1, 2, 3],\n\t * \tsat: -100,\n\t * });\n\t * // => https://example.imgix.net/image.png?dpr=1&sat=-100 1x,\n\t * // https://example.imgix.net/image.png?dpr=2&sat=-100 2x,\n\t * // https://example.imgix.net/image.png?dpr=3&sat=-100 3x\n\t * ```\n\t *\n\t * @param path - Path to the image relative to the client's base URL.\n\t * @param params - An object of Imgix URL API parameters. The `pixelDensities`\n\t * parameter defines the resulting `srcset` widths.\n\t *\n\t * @returns A `srcset` attribute value for `url` with the given Imgix URL API\n\t * parameters applied.\n\t */\n\tbuildPixelDensitySrcSetForPath(\n\t\tpath: string,\n\t\tparams: BuildPixelDensitySrcSetParams,\n\t): string {\n\t\treturn buildPixelDensitySrcSet(`${new URL(path, this.baseURL)}`, params);\n\t}\n\n\t/**\n\t * Builds an `<img>` `srcset` attribute value for a given set of pixel\n\t * densities for the client's base URL. It can also optinally apply Imgix URL\n\t * API parameters to the URLs. The URLs are signed by appending a signature to\n\t * their URL parameters. This locks the URLs and their parameters to the\n\t * signature to prevent URL tampering.\n\t *\n\t * The `dpr` URL parameter will be applied for each `srcset` entry. If a `dpr`\n\t * parameter is provided to the `params` parameter, it will be ignored.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const srcset = client.buildSignedPixelDensitySrcSetForPath(\n\t * \t\"/image.png\",\n\t * \t{ pixelDensities: [1, 2, 3] },\n\t * );\n\t * // => https://example.imgix.net/image.png?dpr=1&s=def3e221c3f4c4debda091b8e49420ea 1x,\n\t * // https://example.imgix.net/image.png?dpr=2&s=f12c7c39333410c10c2930b57116a943 2x,\n\t * // https://example.imgix.net/image.png?dpr=3&s=3a975b5087ab7ad2ab91fe66072fd628 3x\n\t * ```\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const client = new SecureClient({\n\t * \tbaseURL: \"https://example.imgix.net\",\n\t * \tsecureURLToken: \"example-token\",\n\t * });\n\t * const srcset = client.buildSignedPixelDensitySrcSetForPath(\n\t * \t\"/image.png\",\n\t * \t{\n\t * \t\tpixelDensities: [1, 2, 3],\n\t * \t\tsat: -100,\n\t * \t},\n\t * );\n\t * // => https://example.imgix.net/image.png?dpr=1&sat=-100&s=def3e221c3f4c4debda091b8e49420ea 1x,\n\t * // https://example.imgix.net/image.png?dpr=2&sat=-100&s=f12c7c39333410c10c2930b57116a943 2x,\n\t * // https://example.imgix.net/image.png?dpr=3&sat=-100&s=3a975b5087ab7ad2ab91fe66072fd628 3x\n\t * ```\n\t *\n\t * @param path - Path to the image relative to the client's base URL.\n\t * @param params - An object of Imgix URL API parameters. The `pixelDensities`\n\t * parameter defines the resulting `srcset` widths.\n\t *\n\t * @returns A `srcset` attribute value for `url` with the given Imgix URL API\n\t * parameters applied.\n\t */\n\tbuildSignedPixelDensitySrcSetForPath(\n\t\tpath: string,\n\t\tparams: BuildPixelDensitySrcSetParams,\n\t): string {\n\t\treturn buildSignedPixelDensitySrcSet(\n\t\t\t`${new URL(path, this.baseURL)}`,\n\t\t\tthis.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