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qBAAqB,QAAQ,IAC7Df,cAqDFY,EAAM5C,SAAS4B,cAAc,QAC7BoB,UAAY,sCAAwC5C,EAAM,WACvDwC,EAAIK,WAAW,KApDtB,IAAIC,EAAiBjB,EAAWM,EAAKY,SACjCC,EAAgBnB,EAAW9B,GAE3B+C,EAAeP,SAClBS,EAAgBA,EAAgB,IAAMF,GAGvC,IAAK,IAAIG,EAAI,EAAGC,EAAIZ,EAAWC,OAAQU,EAAIC,EAAGD,IAG7C,IAFA,IACIE,EAASlD,EADGqC,EAAWW,GACMD,GACxBI,EAAI,EAAGC,EAAKF,EAAOZ,OAAQa,EAAIC,EAAID,IAC3C3C,EAAK0C,EAAOC,GAlBa,CAqB5B,C","sources":["webpack://app/./app/javascript/packs/blog.js","webpack://app/./node_modules/fitvids/index.js"],"sourcesContent":["import fitvids from 'fitvids';\n\n$(document).on('turbo:load', () => {\n // ensure videos fit full width of page\n fitvids('#main');\n});\n","\n'use strict'\n\nvar selectors = [\n\t'iframe[src*=\"player.vimeo.com\"]',\n\t'iframe[src*=\"youtube.com\"]',\n\t'iframe[src*=\"youtube-nocookie.com\"]',\n\t'iframe[src*=\"kickstarter.com\"][src*=\"video.html\"]',\n\t'object'\n]\n\nvar css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}'\n\nmodule.exports = function (selector, opts) {\n\topts = opts || {}\n\tselector = selector || 'body'\n\n\tif (isObject(selector)) {\n\t\topts = selector\n\t\tselector = 'body'\n\t}\n\n\tvar containers = queryAll(selector)\n\tif (containers.length < 1) return\n\n\tif (!document.getElementById('fit-vids-style')) {\n\t\tvar head = document.head || document.getElementsByTagName('head')[0]\n\t\thead.appendChild(styles())\n\t}\n\n\tvar customSelector = toSelector(opts.players)\n\tvar videoSelector = toSelector(selectors)\n\n\tif (customSelector.length) {\n\t\tvideoSelector = videoSelector + ',' + customSelector\n\t}\n\n\tfor (var i = 0, l = containers.length; i < l; i++) {\n\t\tvar container = containers[i]\n\t\tvar videos = queryAll(container, videoSelector)\n\t\tfor (var j = 0, ll = videos.length; j < ll; j++) {\n\t\t\twrap(videos[j])\n\t\t}\n\t}\n}\n\nfunction queryAll (el, selector) {\n\tif (typeof el === 'string') {\n\t\tselector = el\n\t\tel = document\n\t}\n\treturn Array.prototype.slice.call(el.querySelectorAll(selector))\n}\n\nfunction wrap (el) {\n\tif (/fluid-width-video-wrapper/.test(el.parentNode.className)) return\n\n\tvar widthAttr = parseInt(el.getAttribute('width'), 10)\n\tvar heightAttr = parseInt(el.getAttribute('height'), 10)\n\n\tvar width = !isNaN(widthAttr) ? widthAttr : el.clientWidth\n\tvar height = !isNaN(heightAttr) ? heightAttr : el.clientHeight\n\tvar aspect = height / width\n\n\tel.removeAttribute('width')\n\tel.removeAttribute('height')\n\n\tvar wrapper = document.createElement('div')\n\tel.parentNode.insertBefore(wrapper, el)\n\twrapper.className = 'fluid-width-video-wrapper'\n\twrapper.style.paddingTop = (aspect * 100) + '%'\n\twrapper.appendChild(el)\n}\n\nfunction toSelector (input) {\n\tif (typeof input === 'undefined') return ''\n\treturn Array.isArray(input) ? input.join() : input\n}\n\nfunction styles () {\n\tvar div = document.createElement('div')\n\tdiv.innerHTML = '

x

'\n\treturn div.childNodes[1]\n}\n\nfunction isObject (input) {\n\treturn Object.prototype.toString.call(input) === '[object Object]'\n}\n"],"names":["$","document","on","fitvids","selectors","css","queryAll","el","selector","Array","prototype","slice","call","querySelectorAll","wrap","test","parentNode","className","widthAttr","parseInt","getAttribute","heightAttr","width","isNaN","clientWidth","aspect","clientHeight","removeAttribute","wrapper","createElement","insertBefore","style","paddingTop","appendChild","toSelector","input","isArray","join","module","exports","opts","Object","toString","containers","length","div","getElementById","head","getElementsByTagName","innerHTML","childNodes","customSelector","players","videoSelector","i","l","videos","j","ll"],"sourceRoot":""}