{"version":3,"names":["prestoTimestampCss","PrestoTimestampStyle0","PrestoTimestamp","handleClick","e","preventDefault","player","document","body","querySelector","goToAndPlay","this","timeToSeconds","time","pieces","split","seconds","length","parseInt","render","h","key","href","class","onClick"],"sources":["src/components/core/features/presto-timestamp/presto-timestamp.scss?tag=presto-timestamp","src/components/core/features/presto-timestamp/presto-timestamp.tsx"],"sourcesContent":[":host {\n  display: inline;\n}\n","import { Component, h, Prop } from '@stencil/core';\n\n@Component({\n  tag: 'presto-timestamp',\n  styleUrl: 'presto-timestamp.scss',\n  shadow: false,\n})\nexport class PrestoTimestamp {\n  @Prop() time: string;\n\n  handleClick(e) {\n    e.preventDefault();\n    const player = document.body.querySelector('presto-player');\n    if (!player) return;\n    player.goToAndPlay(this.timeToSeconds(this.time));\n  }\n\n  /**\n   * Formats Timestamp to seconds.\n   * I.E. 12:34 to number of seconds.\n   */\n  timeToSeconds(time) {\n    let pieces = time.split(':');\n    let seconds;\n    if (pieces.length > 1) {\n      seconds = parseInt(pieces[0]) * 60;\n    }\n    return parseInt(pieces[1]) + parseInt(seconds);\n  }\n\n  render() {\n    return (\n      <a href=\"#\" class=\"presto-timestamp\" onClick={e => this.handleClick(e)}>\n        <slot>{this.time}</slot>\n      </a>\n    );\n  }\n}\n"],"mappings":"2CAAA,MAAMA,EAAqB,wBAC3B,MAAAC,EAAeD,E,MCMFE,EAAe,M,6CAG1B,WAAAC,CAAYC,GACVA,EAAEC,iBACF,MAAMC,EAASC,SAASC,KAAKC,cAAc,iBAC3C,IAAKH,EAAQ,OACbA,EAAOI,YAAYC,KAAKC,cAAcD,KAAKE,M,CAO7C,aAAAD,CAAcC,GACZ,IAAIC,EAASD,EAAKE,MAAM,KACxB,IAAIC,EACJ,GAAIF,EAAOG,OAAS,EAAG,CACrBD,EAAUE,SAASJ,EAAO,IAAM,E,CAElC,OAAOI,SAASJ,EAAO,IAAMI,SAASF,E,CAGxC,MAAAG,GACE,OACEC,EAAA,KAAAC,IAAA,2CAAGC,KAAK,IAAIC,MAAM,mBAAmBC,QAASpB,GAAKO,KAAKR,YAAYC,IAClEgB,EAAA,QAAAC,IAAA,4CAAOV,KAAKE,M"}