{"version":3,"file":"geo-location.feature-bobtbb9e.js","sources":["packages/sports/web/app/src/geo-location/geo-location-asset.service.ts","packages/sports/web/app/src/geo-location/geo-location.feature.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Injectable, inject } from '@angular/core';\n\nimport { ConnectionConfig, GeolocationConfig } from '@frontend/sports/common/client-config-data-access';\nimport { OnFeatureInit } from '@frontend/vanilla/core';\n\nimport { RunAfterLcpService } from '../perf-cdk/run-after-lcp.service';\n\n@Injectable({ providedIn: 'root' })\nexport class GeoLocationAssetService implements OnFeatureInit {\n private readonly geoConfig = inject(GeolocationConfig);\n private readonly connectionConfig = inject(ConnectionConfig);\n private readonly afterLcpService = inject(RunAfterLcpService);\n private readonly _doc = inject(DOCUMENT);\n\n onFeatureInit(): void | Promise {\n if (this.geoConfig.isGeolocationEnabled && this.geoConfig.bootstrapAssetPaths?.length > 0) {\n this.afterLcpService.runAfterLcp(() => {\n if (this.geoConfig.geoPollingUrlPath) {\n const pollingUrl = this.geoConfig.geoPollingUrlPath\n .replace(`{channel}`, this.geoConfig.coordinatorSettings.channelId)\n .replace(`{env}`, this.geoConfig.coordinatorSettings.environment)\n .replace(`{plcIdentifier}`, this.geoConfig.coordinatorSettings.plcIdentifier)\n .replace('{accessId}', this.connectionConfig.publicAccessId ?? this.connectionConfig.pushAccessId);\n this.geoConfig.bootstrapAssetPaths.forEach((asset) => {\n const script = this._doc.createElement('script');\n script.type = 'text/javascript';\n script.src = `${asset.replace('{geoPollingUrlPath}', pollingUrl)}`;\n // we cannot defer jquery, as gcoobee depends on it\n const async = asset.indexOf('jquery') === -1;\n script.async = async;\n script.defer = async;\n this._doc.head.appendChild(script);\n });\n }\n });\n }\n }\n}\n","import { runOnFeatureInit } from '@frontend/vanilla/core';\n\nimport { GeoLocationAssetService } from './geo-location-asset.service';\n\nexport function provide() {\n return [runOnFeatureInit(GeoLocationAssetService)];\n}\n"],"names":["GeoLocationAssetService","constructor","geoConfig","inject","GeolocationConfig","connectionConfig","ConnectionConfig","afterLcpService","RunAfterLcpService","_doc","DOCUMENT","onFeatureInit","_a","isGeolocationEnabled","bootstrapAssetPaths","length","runAfterLcp","geoPollingUrlPath","pollingUrl","replace","coordinatorSettings","channelId","environment","plcIdentifier","publicAccessId","pushAccessId","forEach","asset","script","createElement","type","src","async","indexOf","defer","head","appendChild","a","factory","ɵfac","providedIn","_GeoLocationAssetService","provide","runOnFeatureInit"],"mappings":"4HASA,IAAaA,GAAuB,IAAA,CAA9B,IAAOA,CAAAA,CAAP,MAAOA,CAAuB,CADpCC,WAAA,EAAA,CAEqB,KAAAC,SAAYC,CAAAA,GAAAA,CAAOC,EAAiB,CACpC,CAAA,IAAA,CAAAC,iBAAmBF,GAAOG,CAAAA,EAAgB,CAC1C,CAAA,IAAA,CAAAC,gBAAkBJ,GAAOK,CAAAA,GAAkB,CAC3C,CAAA,IAAA,CAAAC,KAAON,GAAOO,CAAAA,EAAQ,EAEvCC,CAAAA,aAAAA,EAAa,CAfjB,IAAAC,CAAAA,CAgBY,KAAKV,SAAUW,CAAAA,oBAAAA,EAAAA,CAAAA,CAAwBD,EAAA,IAAKV,CAAAA,SAAAA,CAAUY,mBAAf,GAAA,IAAA,CAAA,KAAA,CAAA,CAAAF,EAAoCG,MAAS,EAAA,CAAA,EACpF,IAAKR,CAAAA,eAAAA,CAAgBS,YAAY,IAAK,CAClC,GAAI,IAAA,CAAKd,UAAUe,iBAAmB,CAAA,CAClC,IAAMC,CAAa,CAAA,IAAA,CAAKhB,UAAUe,iBAC7BE,CAAAA,OAAAA,CAAQ,WAAa,CAAA,IAAA,CAAKjB,UAAUkB,mBAAoBC,CAAAA,SAAS,CACjEF,CAAAA,OAAAA,CAAQ,QAAS,IAAKjB,CAAAA,SAAAA,CAAUkB,mBAAoBE,CAAAA,WAAW,EAC/DH,OAAQ,CAAA,iBAAA,CAAmB,KAAKjB,SAAUkB,CAAAA,mBAAAA,CAAoBG,aAAa,CAC3EJ,CAAAA,OAAAA,CAAQ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