/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
dist
/
components
/
esm
/
Upload File
HOME
{"version":3,"file":"presto-timestamp.entry.js","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"],"names":[],"mappings":";;AAAA,MAAM,kBAAkB,GAAG,uBAAuB;;MCOrC,eAAe,GAAA,MAAA;;;;AAG1B,IAAA,WAAW,CAAC,CAAC,EAAA;QACX,CAAC,CAAC,cAAc,EAAE;QAClB,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;AAC3D,QAAA,IAAI,CAAC,MAAM;YAAE;AACb,QAAA,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;AAGnD;;;AAGG;AACH,IAAA,aAAa,CAAC,IAAI,EAAA;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AAC5B,QAAA,IAAI,OAAO;AACX,QAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACrB,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;;AAEpC,QAAA,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC;;IAGhD,MAAM,GAAA;QACJ,QACE,0DAAG,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,kBAAkB,EAAC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAA,EACpE,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAO,IAAI,CAAC,IAAI,CAAQ,CACtB;;;;;;;"}