{ "version": 3, "sources": ["../javascripts/platform_embedded.js"], "sourcesContent": ["class PlatformEmbedded {\n constructor () {\n this._messageReceived = this._messageReceived.bind(this)\n this._updatePageHeight = this._updatePageHeight.bind(this)\n this._begin = this._begin.bind(this)\n this.lastContentHeight = 0\n\n this._bindEvents()\n }\n\n _bindEvents () {\n window.onmessage = this._messageReceived\n\n if (document.readyState === 'complete') {\n this._begin()\n } else {\n document.addEventListener('DOMContentLoaded', this._begin, false)\n }\n }\n\n _messageReceived (e) {\n if (typeof e.data !== 'string') { return }\n\n if (e.data.indexOf('buyapowa:scroll:') !== -1) {\n this.shareDialogTopOffset = parseInt(e.data.substring(16))\n }\n }\n\n _updatePageHeight () {\n const contentHeight = document.querySelector('#bp_platform_div').offsetHeight - 10\n\n if (this.lastContentHeight !== contentHeight) {\n window.parent.postMessage(`buyapowa:height:${contentHeight}`, '*')\n this.lastContentHeight = contentHeight\n }\n\n setTimeout(this._updatePageHeight, 300)\n }\n\n _begin () {\n window.parent.postMessage('buyapowa:loaded', '*')\n this._updatePageHeight()\n }\n}\n\nnew PlatformEmbedded() // eslint-disable-line no-new\n"], "mappings": "MAAA,IAAMA,EAAN,KAAuB,CACrB,aAAe,CACb,KAAK,iBAAmB,KAAK,iBAAiB,KAAK,IAAI,EACvD,KAAK,kBAAoB,KAAK,kBAAkB,KAAK,IAAI,EACzD,KAAK,OAAS,KAAK,OAAO,KAAK,IAAI,EACnC,KAAK,kBAAoB,EAEzB,KAAK,YAAY,CACnB,CAEA,aAAe,CACb,OAAO,UAAY,KAAK,iBAEpB,SAAS,aAAe,WAC1B,KAAK,OAAO,EAEZ,SAAS,iBAAiB,mBAAoB,KAAK,OAAQ,EAAK,CAEpE,CAEA,iBAAkB,EAAG,CACf,OAAO,EAAE,MAAS,UAElB,EAAE,KAAK,QAAQ,kBAAkB,IAAM,KACzC,KAAK,qBAAuB,SAAS,EAAE,KAAK,UAAU,EAAE,CAAC,EAE7D,CAEA,mBAAqB,CACnB,IAAMC,EAAgB,SAAS,cAAc,kBAAkB,EAAE,aAAe,GAE5E,KAAK,oBAAsBA,IAC7B,OAAO,OAAO,YAAY,mBAAmBA,CAAa,GAAI,GAAG,EACjE,KAAK,kBAAoBA,GAG3B,WAAW,KAAK,kBAAmB,GAAG,CACxC,CAEA,QAAU,CACR,OAAO,OAAO,YAAY,kBAAmB,GAAG,EAChD,KAAK,kBAAkB,CACzB,CACF,EAEA,IAAID", "names": ["PlatformEmbedded", "contentHeight"] }