{"version":3,"file":"normalize-asset-url.mjs","names":[],"sources":["../../src/utils/normalize-asset-url.ts"],"sourcesContent":["/**\n * Normalizes an S3 asset URL to a Storyblok CDN URL.\n *\n * The MAPI returns asset filenames pointing to the raw S3 origin\n * (e.g. `https://s3.amazonaws.com/a.storyblok.com/f/...`) instead of the\n * CloudFront CDN (e.g. `https://a.storyblok.com/f/...`). The S3 URL does not\n * support the Storyblok Image Service (`/m/...`), which breaks image\n * optimization in frontends.\n *\n * Works for all regions because the regional CDN domain\n * (`a.storyblok.com`, `a-us.storyblok.com`, `a-ap.storyblok.com`,\n * `a-ca.storyblok.com`, `a.storyblokchina.cn`) is embedded as the S3 bucket\n * name in the path.\n */\nexport const normalizeAssetUrl = (url: string): string =>\n  url.replace(/^https?:\\/\\/s3\\.amazonaws\\.com\\//, 'https://');\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,qBAAqB,QAChC,IAAI,QAAQ,oCAAoC,WAAW"}