{"version":3,"file":"Vidyard-DYODSHJM.mjs","sources":["../node_modules/react-player/lib/players/Vidyard.js"],"sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __export = (target, all) => {\n  for (var name in all)\n    __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n  if (from && typeof from === \"object\" || typeof from === \"function\") {\n    for (let key of __getOwnPropNames(from))\n      if (!__hasOwnProp.call(to, key) && key !== except)\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n  }\n  return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n  // If the importer is in node compatibility mode or this is not an ESM\n  // file that has been converted to a CommonJS file using a Babel-\n  // compatible transform (i.e. \"__esModule\" has not been set), then set\n  // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n  isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n  mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar __publicField = (obj, key, value) => {\n  __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n  return value;\n};\nvar Vidyard_exports = {};\n__export(Vidyard_exports, {\n  default: () => Vidyard\n});\nmodule.exports = __toCommonJS(Vidyard_exports);\nvar import_react = __toESM(require(\"react\"));\nvar import_utils = require(\"../utils\");\nvar import_patterns = require(\"../patterns\");\nconst SDK_URL = \"https://play.vidyard.com/embed/v4.js\";\nconst SDK_GLOBAL = \"VidyardV4\";\nconst SDK_GLOBAL_READY = \"onVidyardAPI\";\nclass Vidyard extends import_react.Component {\n  constructor() {\n    super(...arguments);\n    __publicField(this, \"callPlayer\", import_utils.callPlayer);\n    __publicField(this, \"mute\", () => {\n      this.setVolume(0);\n    });\n    __publicField(this, \"unmute\", () => {\n      if (this.props.volume !== null) {\n        this.setVolume(this.props.volume);\n      }\n    });\n    __publicField(this, \"ref\", (container) => {\n      this.container = container;\n    });\n  }\n  componentDidMount() {\n    this.props.onMount && this.props.onMount(this);\n  }\n  load(url) {\n    const { playing, config, onError, onDuration } = this.props;\n    const id = url && url.match(import_patterns.MATCH_URL_VIDYARD)[1];\n    if (this.player) {\n      this.stop();\n    }\n    (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then((Vidyard2) => {\n      if (!this.container)\n        return;\n      Vidyard2.api.addReadyListener((data, player) => {\n        if (this.player) {\n          return;\n        }\n        this.player = player;\n        this.player.on(\"ready\", this.props.onReady);\n        this.player.on(\"play\", this.props.onPlay);\n        this.player.on(\"pause\", this.props.onPause);\n        this.player.on(\"seek\", this.props.onSeek);\n        this.player.on(\"playerComplete\", this.props.onEnded);\n      }, id);\n      Vidyard2.api.renderPlayer({\n        uuid: id,\n        container: this.container,\n        autoplay: playing ? 1 : 0,\n        ...config.options\n      });\n      Vidyard2.api.getPlayerMetadata(id).then((meta) => {\n        this.duration = meta.length_in_seconds;\n        onDuration(meta.length_in_seconds);\n      });\n    }, onError);\n  }\n  play() {\n    this.callPlayer(\"play\");\n  }\n  pause() {\n    this.callPlayer(\"pause\");\n  }\n  stop() {\n    window.VidyardV4.api.destroyPlayer(this.player);\n  }\n  seekTo(amount, keepPlaying = true) {\n    this.callPlayer(\"seek\", amount);\n    if (!keepPlaying) {\n      this.pause();\n    }\n  }\n  setVolume(fraction) {\n    this.callPlayer(\"setVolume\", fraction);\n  }\n  setPlaybackRate(rate) {\n    this.callPlayer(\"setPlaybackSpeed\", rate);\n  }\n  getDuration() {\n    return this.duration;\n  }\n  getCurrentTime() {\n    return this.callPlayer(\"currentTime\");\n  }\n  getSecondsLoaded() {\n    return null;\n  }\n  render() {\n    const { display } = this.props;\n    const style = {\n      width: \"100%\",\n      height: \"100%\",\n      display\n    };\n    return /* @__PURE__ */ import_react.default.createElement(\"div\", { style }, /* @__PURE__ */ import_react.default.createElement(\"div\", { ref: this.ref }));\n  }\n}\n__publicField(Vidyard, \"displayName\", \"Vidyard\");\n__publicField(Vidyard, \"canPlay\", import_patterns.canPlay.vidyard);\n"],"names":["__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__defNormalProp","obj","key","value","__export","target","all","name","__copyProps","to","from","except","desc","__toESM","mod","isNodeMode","__toCommonJS","__publicField","Vidyard_exports","Vidyard","Vidyard_1","import_react","require$$0","import_utils","require$$1","import_patterns","require$$2","SDK_URL","SDK_GLOBAL","SDK_GLOBAL_READY","container","url","playing","config","onError","onDuration","id","Vidyard2","data","player","meta","amount","keepPlaying","fraction","rate","display","style"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAIA,IAAW,OAAO,QAClBC,IAAY,OAAO,gBACnBC,IAAmB,OAAO,0BAC1BC,IAAoB,OAAO,qBAC3BC,IAAe,OAAO,gBACtBC,IAAe,OAAO,UAAU,gBAChCC,IAAkB,CAACC,GAAKC,GAAKC,MAAUD,KAAOD,IAAMN,EAAUM,GAAKC,GAAK,EAAE,YAAY,IAAM,cAAc,IAAM,UAAU,IAAM,OAAAC,EAAK,CAAE,IAAIF,EAAIC,CAAG,IAAIC,GACtJC,IAAW,CAACC,GAAQC,MAAQ;AAC9B,aAASC,KAAQD;AACf,MAAAX,EAAUU,GAAQE,GAAM,EAAE,KAAKD,EAAIC,CAAI,GAAG,YAAY,IAAM;AAAA,EAChE,GACIC,IAAc,CAACC,GAAIC,GAAMC,GAAQC,MAAS;AAC5C,QAAIF,KAAQ,OAAOA,KAAS,YAAY,OAAOA,KAAS;AACtD,eAASR,KA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