import type * as d from '../declarations' ; import type { SourceMap as RollupSourceMap } from 'rollup' ; param rollupSourceMap returns export const rollupToStencilSourceMap = ( rollupSourceMap ) : d . SourceMap => { if ( ! rollupSourceMap ) { return null ; } return { file : rollupSourceMap . file , mappings : rollupSourceMap . mappings , names : rollupSourceMap . names , sources : rollupSourceMap . sources , sourcesContent : rollupSourceMap . sourcesContent , version : rollupSourceMap . version , } ; } ; /**
 * A JavaScript formatted string used to link generated code back to the original. This string follows the guidelines
 * found in the [Linking generated code to source maps](https://sourcemaps.info/spec.html#h.lmz475t4mvbx) section of
 * the Sourcemaps V3 specification proposal.
 */ const JS_SOURCE_MAPPING_URL_LINKER = '//# sourceMappingURL=' ; param filename returns const encodeToRfc3986 = ( filename ) : string => { const encodedUri = encodeURIComponent ( filename ) ; return encodedUri . replace ( /[!'()*]/g , ( matchedCharacter ) => { return '%' + matchedCharacter . charCodeAt ( 0 ) . toString ( 16 ) ; } ) ; } ; param url returns a linker string, of the format  JS_SOURCE_MAPPING_URL_LINKER =<url>
  export const getSourceMappingUrlLinker = ( url ) : string => { return `${ JS_SOURCE_MAPPING_URL_LINKER }${ encodeToRfc3986 ( url ) }` ; } ; param sourceMapContents returns a linker string, of the format  JS_SOURCE_MAPPING_URL_LINKER <dataUriPrefixAndMime><sourceMapContents>
  export const getInlineSourceMappingUrlLinker = ( sourceMapContents ) : string => { const mapBase64 = Buffer . from ( sourceMapContents , 'utf8' ) . toString ( 'base64' ) ; return `${ JS_SOURCE_MAPPING_URL_LINKER }data:application/json;charset=utf-8;base64,${ mapBase64 }` ; } ; param url returns a linker string, of the format  JS_SOURCE_MAPPING_URL_LINKER =<url>.map, prepended with a newline
  export const getSourceMappingUrlForEndOfFile = ( url ) : string => { return `\n${ getSourceMappingUrlLinker ( url ) }.map` ; } ;