{"version":3,"file":"ng-doc-app-providers-playground-demo.mjs","sources":["../../../../libs/app/providers/playground-demo/provide-playground-demo.ts","../../../../libs/app/providers/playground-demo/ng-doc-app-providers-playground-demo.ts"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\nimport { Constructor } from '@ng-doc/core/types';\n\nconst tokenStore: Map<string, InjectionToken<unknown>> = new Map<string, InjectionToken<unknown>>();\n\n/**\n *\n * @param type\n * @param control\n * @param options\n * @param playgroundId\n * @param selector\n * @param component\n */\nexport function providePlaygroundDemo(\n  playgroundId: string,\n  component: Constructor<unknown>,\n): Provider {\n  const token: InjectionToken<unknown> =\n    tokenStore.get(playgroundId) ??\n    new InjectionToken<unknown>(`NG_DOC_PLAYGROUND_DEMO_${playgroundId}`);\n\n  tokenStore.set(playgroundId, token);\n\n  return {\n    provide: token,\n    useValue: component,\n    multi: true,\n  };\n}\n\n/**\n * Returns the token for the given playground id.\n * @param playgroundId\n */\nexport function getPlaygroundDemoToken<T>(playgroundId: string): InjectionToken<T[]> | undefined {\n  return tokenStore.get(playgroundId) as InjectionToken<T[]> | undefined;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAGA,MAAM,UAAU,GAAyC,IAAI,GAAG,EAAmC;AAEnG;;;;;;;;AAQG;AACG,SAAU,qBAAqB,CACnC,YAAoB,EACpB,SAA+B,EAAA;AAE/B,IAAA,MAAM,KAAK,GACT,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;AAC5B,QAAA,IAAI,cAAc,CAAU,CAAA,uBAAA,EAA0B,YAAY,CAAA,CAAE,CAAC;AAEvE,IAAA,UAAU,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC;IAEnC,OAAO;AACL,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,KAAK,EAAE,IAAI;KACZ;AACH;AAEA;;;AAGG;AACG,SAAU,sBAAsB,CAAI,YAAoB,EAAA;AAC5D,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,YAAY,CAAoC;AACxE;;ACrCA;;AAEG;;;;"}