{"version":3,"sources":["jsdelivr-header.js","/npm/simple-audio@1.0.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACHA,IAHA,IAAI,cAAgB,SAAS,qBAAqB,SAC9C,OAAS,CAAC,EAEL,EAAI,EAAG,EAAI,cAAc,OAAQ,IACtC,OAAO,cAAc,GAAG,WAAa,cAAc,GAYvD,SAAS,mCAEL,IAAI,EAAQ,SAAS,cAAc,SAEnC,OADA,EAAM,OACC,EAAM,MACjB,CAEA,SAAS,8BACL,IAAK,IAAI,EAAI,EAAG,EAAI,cAAc,OAAQ,IACtC,cAAc,GAAG,OAGrB,OAAO,oBAAoB,UAAW,6BACtC,OAAO,oBAAoB,YAAa,6BACxC,OAAO,oBAAoB,aAAc,4BAC7C,CAEA,SAAS,UAAU,GACf,IAAK,IAAI,KAAO,OACd,OAAO,GAAK,QAGd,OAAO,GAAO,OACd,OAAO,GAAO,MAClB,CA9BI,qCACA,OAAO,iBAAiB,UAAW,6BACnC,OAAO,iBAAiB,YAAa,6BACrC,OAAO,iBAAiB,aAAc,8BA6B1C,OAAO,QAAU,CACb,UAAW","file":"/npm/simple-audio@1.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/simple-audio@1.0.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var audioElements = document.getElementsByTagName('audio'),\n    sounds = {};\n\nfor (var i = 0; i < audioElements.length; i++) {\n    sounds[audioElements[i].className] = audioElements[i];\n}\n\n// Solves chrome for andriod issue 178297 Require user gesture\n// https://code.google.com/p/chromium/issues/detail?id=178297\n// Fix based on code from http://blog.foolip.org/2014/02/10/media-playback-restrictions-in-blink/\nif (mediaPlaybackRequiresUserGesture()) {\n    window.addEventListener('keydown', removeBehaviorsRestrictions);\n    window.addEventListener('mousedown', removeBehaviorsRestrictions);\n    window.addEventListener('touchstart', removeBehaviorsRestrictions);\n}\n\nfunction mediaPlaybackRequiresUserGesture() {\n    // test if play() is ignored when not called from an input event handler\n    var video = document.createElement('video');\n    video.play();\n    return video.paused;\n}\n\nfunction removeBehaviorsRestrictions() {\n    for (var i = 0; i < audioElements.length; i++) {\n        audioElements[i].load();\n    }\n\n    window.removeEventListener('keydown', removeBehaviorsRestrictions);\n    window.removeEventListener('mousedown', removeBehaviorsRestrictions);\n    window.removeEventListener('touchstart', removeBehaviorsRestrictions);\n}\n\nfunction playSound(sound) {\n    for (var key in sounds) {\n      sounds[key].pause();\n    }\n\n    sounds[sound].load();\n    sounds[sound].play();\n}\n\nmodule.exports = {\n    playSound: playSound\n};\n"]}