{"version":3,"file":"js/application-753b64a87315b132079f.js","sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/channels sync _channel\\.js$","webpack:///./app/javascript/channels/index.js","webpack:///./app/javascript/packs/application.js","webpack:///./app/javascript/src/alert.js","webpack:///./app/javascript/src/analytics.js","webpack:///./app/javascript/src/carousel.js","webpack:///./app/javascript/src/jigsaw-puzzle-hints.js","webpack:///./app/javascript/src/mailing-list.js","webpack:///./app/javascript/src/main.js","webpack:///./app/javascript/src/nav.js","webpack:///./app/javascript/src/product-bullets.js","webpack:///./app/javascript/src/reviews.js","webpack:///./app/javascript/src/shopify-add-to-cart-button.js","webpack:///./app/javascript/src/techno-dystopia-hints.js","webpack:///./app/javascript/src/utils.js","webpack:///./node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js","webpack:///./node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","webpack:///./node_modules/js-cookie/dist/js.cookie.js","webpack:///./node_modules/turbolinks/dist/turbolinks.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/javascript/packs/application.js\");\n","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = \"./app/javascript/channels sync recursive _channel\\\\.js$\";","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context('.', true, /_channel\\.js$/)\nchannels.keys().forEach(channels)\n","// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n\nimport Rails from \"@rails/ujs\"\nimport Turbolinks from \"turbolinks\"\nimport * as ActiveStorage from \"@rails/activestorage\"\nimport \"channels\"\nimport \"src/main\"\n\nRails.start()\n// Turbolinks.start() // i hate turbolinks\nActiveStorage.start()\n","import Cookies from 'js-cookie'\n\nexport let Alert = {\n DOM: {\n alert: () => $('#evermade-alert'),\n msg: () => Alert.DOM.alert().find(\"p\"),\n closeBtn: () => Alert.DOM.alert().find(\"button\")\n },\n\n collapse: null,\n COOKIE_NAME: \"evermade-alert-message-dismissed\",\n\n handle: () => {\n if(Alert.message() != \"\" && !Alert.alreadyDismissedThisMessage()) {\n setTimeout(() => {\n Alert.DOM.closeBtn().on(\"click touchstart\", Alert.dismissed)\n Alert.collapse = new bootstrap.Collapse(Alert.DOM.alert(), {toggle: false})\n Alert.collapse.show()\n }, 1000)\n }\n },\n\n message: () => {\n return Alert.DOM.msg().html().trim()\n },\n\n dismissed: () => {\n Alert.collapse.hide()\n Cookies.set(Alert.COOKIE_NAME, Alert.message(), { expires: 7 })\n },\n\n alreadyDismissedThisMessage: () => {\n return Cookies.get(Alert.COOKIE_NAME) == Alert.message()\n }\n}\n","import Cookies from 'js-cookie'\n\nexport let Analytics = {\n DOM: {\n gdprNotice: () => $(\"#gdpr-notice\"),\n gdprNoticeOKButton: () => Analytics.DOM.gdprNotice().find(\"button.ok\"),\n consentPreferencesText: () => $(\"#consent-preferences\"),\n consentPreferencesControls: () => $(\".consent-preferences-controls\"),\n statisticsConsentToggle: () => $(\"#statistics-consent-toggle\"),\n marketingConsentToggle: () => $(\"#marketing-consent-toggle\"),\n contactFormAlert: () => $(\"section.contact-form#contact p.contact-alert\")\n },\n\n Consent: {\n GRANTED: \"granted\",\n DENIED: \"denied\"\n },\n\n HAS_MADE_CONSENT_CHOICE_COOKIE: \"evermade-consent-choice-made\",\n ADS_CONSENT_CHOICE_COOKIE: \"evermade-ads-consent\",\n ANALYTICS_CONSENT_CHOICE_COOKIE: \"evermade-analytics-consent\",\n\n handle: () => {\n Analytics.handleGDPR()\n\n if(Analytics.DOM.contactFormAlert().hasClass(\"notice\")) {\n Analytics.contactFormSubmitted()\n }\n\n Analytics.pageViewed()\n },\n\n handleGDPR: () => {\n // Analytics.resetConsentCookies()\n\n if(Analytics.isSubjectToGDPR()) {\n Analytics.DOM.consentPreferencesText().show()\n Analytics.DOM.consentPreferencesControls().show()\n Analytics.DOM.marketingConsentToggle().change(Analytics.marketingConsentToggleChanged)\n Analytics.DOM.statisticsConsentToggle().change(Analytics.statisticsConsentToggleChanged)\n\n if(!Analytics.hasMadeConsentChoice()) {\n Analytics.showGDPRNotice()\n Analytics.DOM.gdprNoticeOKButton().on(\"click touchstart\", Analytics.madeConsentChoice)\n } else {\n // assumes that permissions are granted by default\n // if changed to denied by default, this needs to be updated\n if(Analytics.hasDeniedAds()) {\n Analytics.denyAdsConsent()\n Analytics.DOM.marketingConsentToggle().prop('checked', false)\n }\n if(Analytics.hasDeniedAnalytics()) {\n Analytics.denyAnalyticsConsent()\n Analytics.DOM.statisticsConsentToggle().prop('checked', false)\n }\n }\n }\n },\n\n showGDPRNotice: () => {\n Analytics.DOM.gdprNotice().collapse(\"show\")\n },\n\n resetConsentCookies: () => {\n Cookies.remove(Analytics.HAS_MADE_CONSENT_CHOICE_COOKIE)\n Cookies.remove(Analytics.ADS_CONSENT_CHOICE_COOKIE)\n Cookies.remove(Analytics.ANALYTICS_CONSENT_CHOICE_COOKIE)\n },\n\n hasMadeConsentChoice: () => {\n return Cookies.get(Analytics.HAS_MADE_CONSENT_CHOICE_COOKIE) == \"true\"\n },\n\n madeConsentChoice: () => {\n Cookies.set(Analytics.HAS_MADE_CONSENT_CHOICE_COOKIE, \"true\", { expires: 365 })\n Analytics.DOM.gdprNotice().collapse(\"hide\")\n },\n\n // if no choice has been explicity set, assumed to be granted\n hasDeniedAds: () => {\n return Cookies.get(Analytics.ADS_CONSENT_CHOICE_COOKIE) == Analytics.Consent.DENIED\n },\n\n // if no choice has been explicity set, assumed to be granted\n hasDeniedAnalytics: () => {\n return Cookies.get(Analytics.ANALYTICS_CONSENT_CHOICE_COOKIE) == Analytics.Consent.DENIED\n },\n\n isSubjectToGDPR: () => {\n var tz = Intl.DateTimeFormat().resolvedOptions().timeZone;\n switch (tz) {\n case 'Europe/Vienna':\n return true;\n case 'Europe/Brussels':\n return true;\n case 'Europe/Sofia':\n return true;\n case 'Europe/Zagreb':\n return true;\n case 'Asia/Famagusta':\n return true;\n case 'Asia/Nicosia':\n return true;\n case 'Europe/Prague':\n return true;\n case 'Europe/Copenhagen':\n return true;\n case 'Europe/Tallinn':\n return true;\n case 'Europe/Helsinki':\n return true;\n case 'Europe/Paris':\n return true;\n case 'Europe/Berlin':\n return true;\n case 'Europe/Busingen':\n return true;\n case 'Europe/Athens':\n return true;\n case 'Europe/Budapest':\n return true;\n case 'Europe/Dublin':\n return true;\n case 'Europe/Rome':\n return true;\n case 'Europe/Riga':\n return true;\n case 'Europe/Vilnius':\n return true;\n case 'Europe/Luxembourg':\n return true;\n case 'Europe/Malta':\n return true;\n case 'Europe/Amsterdam':\n return true;\n case 'Europe/Warsaw':\n return true;\n case 'Atlantic/Azores':\n return true;\n case 'Atlantic/Madeira':\n return true;\n case 'Europe/Lisbon':\n return true;\n case 'Europe/Bucharest':\n return true;\n case 'Europe/Bratislava':\n return true;\n case 'Europe/Ljubljana':\n return true;\n case 'Africa/Ceuta':\n return true;\n case 'Atlantic/Canary':\n return true;\n case 'Europe/Madrid':\n return true;\n case 'Europe/Stockholm':\n return true;\n default:\n return false;\n }\n },\n\n updateConsent: (permission, value) => {\n var opts = {}\n opts[permission] = value\n gtag('consent', 'update', opts);\n Analytics.madeConsentChoice()\n },\n\n updateAdsConsent: (value) => {\n Analytics.updateConsent(\"ad_storage\", value)\n Cookies.set(Analytics.ADS_CONSENT_CHOICE_COOKIE, value, { expires: 365 })\n },\n\n marketingConsentToggleChanged: () => {\n var isChecked = Analytics.DOM.marketingConsentToggle().is(\":checked\")\n if(isChecked)\n Analytics.grantAdsConsent()\n else\n Analytics.denyAdsConsent()\n },\n\n grantAdsConsent: () => {\n Analytics.updateAdsConsent(Analytics.Consent.GRANTED)\n },\n\n denyAdsConsent: () => {\n Analytics.updateAdsConsent(Analytics.Consent.DENIED)\n },\n\n statisticsConsentToggleChanged: () => {\n var isChecked = Analytics.DOM.statisticsConsentToggle().is(\":checked\")\n if(isChecked)\n Analytics.grantAnalyticsConsent()\n else\n Analytics.denyAnalyticsConsent()\n },\n\n updateAnalyticsConsent: (value) => {\n Analytics.updateConsent(\"analytics_storage\", value)\n Cookies.set(Analytics.ANALYTICS_CONSENT_CHOICE_COOKIE, value, { expires: 365 })\n },\n\n grantAnalyticsConsent: () => {\n Analytics.updateAnalyticsConsent(Analytics.Consent.GRANTED)\n },\n\n denyAnalyticsConsent: () => {\n Analytics.updateAnalyticsConsent(Analytics.Consent.DENIED)\n },\n\n pageViewed: () => {\n var pinterestPageVisitParams = {}\n if(window.product) {\n pinterestPageVisitParams.line_items = [{\n product_id: window.product.sku\n }]\n }\n pintrk('track', 'pagevisit', pinterestPageVisitParams);\n },\n\n contactFormSubmitted: () => {\n // var callback = function () {\n // if (typeof(url) != 'undefined') {\n // window.location = url;\n // }\n // };\n\n gtag('event', 'conversion', {\n 'send_to': 'AW-10905880235/pcksCOCCwr8DEKuNqtAo',\n 'value': 1 // for google ads conv tracking purposes\n // 'event_callback': callback\n });\n\n gtag('event', 'Contact Form Submitted');\n return false;\n },\n\n subscribedToNewsletter: (email) => {\n // var callback = function () {\n // if (typeof(url) != 'undefined') {\n // window.location = url;\n // }\n // };\n gtag('event', 'conversion', {\n 'send_to': 'AW-10905880235/ffz4COLGwb8DEKuNqtAo',\n 'value': 1 // for google ads conv tracking\n // 'event_callback': callback\n });\n gtag('event', 'Subscribed to Newsletter');\n\n pintrk('track', 'lead', {\n lead_type: 'Newsletter'\n });\n\n Analytics.emtrk(\"Subscribe\", {user_email: email})\n\n return false;\n },\n\n addToCartButtonClicked: (e) => {\n // var callback = function () {\n // if (typeof(url) != 'undefined') {\n // window.location = url;\n // }\n // };\n\n gtag('event', 'conversion', {\n 'send_to': 'AW-10905880235/7DuZCM-NwL8DEKuNqtAo',\n 'value': e.selectedVariant.price.amount/10, // google ads conv value not 100% of price since its not that valuable\n 'currency': 'USD' // ,\n // 'event_callback': callback\n });\n\n gtag('event', 'Product Added to Cart', {\n 'event_category' : e.selectedVariant.sku,\n 'value' : e.selectedVariant.price.amount\n });\n\n var productCategory = \"Games\"\n if(e.selectedVariant.sku.match(\"SZB-3\")) {\n productCategory = \"Puzzle Books\"\n } else if(e.selectedVariant.sku.match(\"SZB-5\")) {\n productCategory = \"Jigsaw Puzzles\"\n } else if(e.selectedVariant.sku.match(\"SZB-6\")) {\n productCategory = \"Kids Books\"\n }\n\n pintrk('track', 'addtocart', {\n value: e.selectedVariant.price.amount,\n currency: 'USD',\n line_items: [{\n product_id: e.selectedVariant.sku,\n product_price: e.selectedVariant.price.amount,\n product_category: productCategory\n }]\n });\n\n Analytics.emtrk(\"AddToCart\", {product: {id: e.selectedVariant.sku, price: e.selectedVariant.price.amount}})\n\n\n return false;\n },\n\n checkoutOpened: (e) => {\n var total = 0\n $.each(e.lineItemCache, (i, lineItem) => {\n total += lineItem.quantity * lineItem.variant.price\n })\n total = parseFloat(total).toFixed(2)\n\n // var callback = function () {\n // if (typeof(url) != 'undefined') {\n // window.location = url;\n // }\n // };\n gtag('event', 'conversion', {\n 'send_to': 'AW-10905880235/FQvBCI3jjb8DEKuNqtAo',\n 'value': total/10, // not full value for google ads conv purposes\n 'currency': 'USD' // ,\n // 'event_callback': callback\n });\n gtag('event', 'Checkout Opened', {\n 'value' : total\n });\n\n var emproducts = $.map(e.lineItemCache, (lineItem, i) => {\n return {\n id: lineItem.variant.sku,\n quantity: lineItem.quantity,\n price: lineItem.variant.price\n }\n })\n\n Analytics.emtrk(\"InitiateCheckout\", {products: emproducts, total: total})\n\n return false;\n },\n\n emtrk: (event_name, data) => {\n data.event_name = event_name\n data.event_source_url = window.location.href\n $.post(\"/emtrk\", data)\n }\n}\n","import { Utils } from \"./utils.js\";\n\nexport let Carousel = {\n DOM: {\n carousels: () => $('.carousel'),\n multislideCarousels: () => $(\".carousel.multislide\"),\n resizeCarousels: () => $(\".carousel.resize-heights\"),\n resizeMultislideCarousels: () => $(\".carousel.multislide.resize-heights\"),\n carouselInner: (carousel) => $(carousel).find(\".carousel-inner\"),\n carouselItems: (carousel) => $(carousel).find(\".carousel-item\"),\n activeCarouselItem: (carousel) => Carousel.DOM.carouselItems(carousel).filter(\".active\"),\n templateCarouselItem: (carousel) => $(carousel).find(\".template-carousel-item\"),\n carouselItemInners: (carousel) => Carousel.DOM.carouselItems(carousel).find(\".carousel-item-inner\"),\n carouselPrevButton: (carousel) => $(carousel).find(\"button.carousel-control-prev\").first(),\n carouselNextButton: (carousel) => $(carousel).find(\"button.carousel-control-next\").first(),\n nonWrappingCarousels: () => $(\".carousel[data-bs-wrap='false']\"),\n productImagesCarousel: () => $(\"#product-images-carousel\")\n },\n\n init: () => {\n $.each(Carousel.DOM.multislideCarousels(), (i, carousel) => {\n Carousel.makeMultislide(carousel)\n })\n\n $(window).on(Utils.VIEWPORT_RESIZE_EVENT, Carousel.remakeMultislides)\n\n $.each(Carousel.DOM.nonWrappingCarousels(), (i, carousel) => {\n Carousel.DOM.carouselPrevButton(carousel).hide()\n })\n Carousel.DOM.nonWrappingCarousels().on('slid.bs.carousel',Carousel.handleNonWrappingCarouselButtons)\n\n $(window).resize(Carousel.handleProductImagesCarouselHeight)\n Carousel.handleProductImagesCarouselHeight()\n },\n\n makeMultislide: (carousel) => {\n var templateCarouselItem = Carousel.DOM.carouselItems(carousel).first()\n var inners = templateCarouselItem.children()\n $.each(inners, (i, inner) => {\n var newCarouselItem = $(\"
\")\n newCarouselItem.addClass(\"carousel-item\")\n if(i == 0) newCarouselItem.addClass(\"active\")\n newCarouselItem.append($(inner).clone())\n Carousel.DOM.carouselInner(carousel).append(newCarouselItem)\n })\n\n templateCarouselItem.removeClass(\"carousel-item\")\n templateCarouselItem.addClass(\"template-carousel-item\")\n templateCarouselItem.hide()\n\n let items = Carousel.DOM.carouselItems(carousel)\n var vs = Utils.viewportSize()\n var minPerSlide = parseInt($(carousel).attr(\"data-em-num-slides-\" + vs)) || items.length\n\n $.each(items, (i, item) => {\n let next = $(item).next()\n for (var i=1; i {\n $.each(Carousel.DOM.resizeMultislideCarousels(), (i, carousel) => {\n Carousel.DOM.carouselItems(carousel).remove()\n var templateCarouselItem = Carousel.DOM.templateCarouselItem(carousel)\n templateCarouselItem.removeClass(\"template-carousel-item\")\n templateCarouselItem.addClass(\"carousel-item\")\n templateCarouselItem.show()\n Carousel.makeMultislide(carousel)\n })\n },\n\n handleNonWrappingCarouselButtons: (event) => {\n var carousel = $(event.target)\n var numSlides = Carousel.DOM.carouselItems(carousel).length\n var currentSlide = event.to\n\n if(currentSlide == 0) {\n Carousel.DOM.carouselPrevButton(carousel).hide()\n Carousel.DOM.carouselNextButton(carousel).show()\n } else if(currentSlide == numSlides - 1) {\n Carousel.DOM.carouselPrevButton(carousel).show()\n Carousel.DOM.carouselNextButton(carousel).hide()\n } else {\n Carousel.DOM.carouselPrevButton(carousel).show()\n Carousel.DOM.carouselNextButton(carousel).show()\n }\n },\n\n handleProductImagesCarouselHeight: () => {\n var carousel = Carousel.DOM.productImagesCarousel()\n\n // reset\n var productImages = carousel.find(\".product-image\")\n productImages.css(\"height\", productImages.first().css(\"max-height\"))\n var activePI = Carousel.DOM.activeCarouselItem(carousel).find(\".product-image\")\n\n var heightHelperImages = carousel.find(\".mobile-height-size-helper img\")\n var maxHeight = parseInt(activePI.height())\n var maxWidth = parseInt(activePI.width())\n var bestHeight = 0\n $.each(heightHelperImages, (i, img) => {\n var h = $(img).height()\n var w = $(img).width()\n var possibleHeight = maxWidth * h / w\n if(possibleHeight > bestHeight) {\n bestHeight = possibleHeight\n }\n })\n if(bestHeight > maxHeight) {\n bestHeight = maxHeight\n }\n productImages.css(\"height\", bestHeight)\n }\n}\n","import Cookies from 'js-cookie'\nimport { TechnoDystopiaHints } from \"./techno-dystopia-hints.js\";\nimport { Nav } from \"./nav.js\";\n\nexport let JigsawPuzzleHints = {\n DOM: {\n section: () => $(\"section.jigsaw-puzzle-hints\"),\n zipImageRow: () => JigsawPuzzleHints.DOM.section().find(\".zip-image\"),\n slides: () => JigsawPuzzleHints.DOM.section().find(\".slide\"),\n slide: (id) => JigsawPuzzleHints.DOM.section().find(\".slide#\" + id),\n introSlide: () => JigsawPuzzleHints.DOM.slide(\"intro\"),\n checkAnswerSlide: () => JigsawPuzzleHints.DOM.slide(\"answer\"),\n answerTextBox: () => JigsawPuzzleHints.DOM.checkAnswerSlide().find(\"input\"),\n incorrectGenericSlide: () => JigsawPuzzleHints.DOM.slide(\"incorrect-generic\"),\n responseSlide: (forAnswer) => JigsawPuzzleHints.DOM.section().find(\".slide.response[data-em-for='\" + forAnswer + \"']\"),\n slideNavButtons: () => JigsawPuzzleHints.DOM.slides().find(\"button[data-em-to]\"),\n checkAnswerButton: () => JigsawPuzzleHints.DOM.checkAnswerSlide().find(\"#check-answer-button\"),\n hints: () => JigsawPuzzleHints.DOM.slide(\"hints\").find(\".hint\"),\n hint: (num) => JigsawPuzzleHints.DOM.slide(\"hints\").find(\".hint[data-em-hint-name=\" + num + \"]\"),\n resetHintsButton: () => JigsawPuzzleHints.DOM.slide(\"hints\").find(\"#reset-hints\"),\n zoomingSolutionImageWrappers: () => JigsawPuzzleHints.DOM.section().find(\".slide.solution .solution-image-wrapper.zoom\"),\n },\n\n handle: () => {\n JigsawPuzzleHints.DOM.slides().hide()\n JigsawPuzzleHints.DOM.slide(\"intro\").show()\n JigsawPuzzleHints.DOM.slideNavButtons().on(\"click touchstart\", JigsawPuzzleHints.slideNavButtonClicked)\n JigsawPuzzleHints.DOM.checkAnswerButton().on(\"click touchstart\", JigsawPuzzleHints.checkAnswer)\n JigsawPuzzleHints.DOM.answerTextBox().on(\"keypress\", JigsawPuzzleHints.answerTextBoxKeyPressed)\n JigsawPuzzleHints.setUpHints()\n JigsawPuzzleHints.DOM.zoomingSolutionImageWrappers().mousemove(JigsawPuzzleHints.solutionImageHovered)\n JigsawPuzzleHints.DOM.zoomingSolutionImageWrappers().mouseout(JigsawPuzzleHints.solutionImageUnhovered)\n\n // handle specific products\n TechnoDystopiaHints.handle()\n },\n\n setUpHints: () => {\n $.each(JigsawPuzzleHints.hintsVisited(), (i, hNum) => {\n if(hNum != '')\n JigsawPuzzleHints.DOM.hint(hNum).removeClass(\"concealed\")\n })\n\n JigsawPuzzleHints.DOM.hints().on(\"click touchstart\", JigsawPuzzleHints.hintClicked)\n\n JigsawPuzzleHints.DOM.resetHintsButton().on(\"click touchstart\", JigsawPuzzleHints.resetHintsVisited)\n },\n\n hintClicked: (e) => {\n var hint = $(e.target)\n while(!hint.hasClass(\"hint\")) hint = hint.parent()\n var isConcealed = hint.hasClass(\"concealed\")\n var isLocked = hint.prev(\".concealed\").length > 0\n\n if(isConcealed && !isLocked) {\n hint.removeClass(\"concealed\")\n JigsawPuzzleHints.setHintVisited(hint)\n var nextHint = hint.next()\n }\n },\n\n hintsVisitedCookieName: () => {\n var productSlug = JigsawPuzzleHints.DOM.section().attr(\"data-em-product\")\n return productSlug + \"-hints-visited\"\n },\n\n setHintVisited: (hint) => {\n var cName = JigsawPuzzleHints.hintsVisitedCookieName()\n var hintName = $(hint).attr(\"data-em-hint-name\")\n var visited = JigsawPuzzleHints.hintsVisited()\n visited.push(hintName)\n Cookies.set(cName, visited.join(\",\"), { expires: 365 })\n },\n\n resetHintsVisited: () => {\n var cName = JigsawPuzzleHints.hintsVisitedCookieName()\n Cookies.set(cName, \"\", { expires: 365 })\n JigsawPuzzleHints.DOM.hints().addClass(\"concealed\")\n Nav.scrollTo(JigsawPuzzleHints.DOM.section())\n },\n\n hintsVisited: () => {\n var cName = JigsawPuzzleHints.hintsVisitedCookieName()\n return (Cookies.get(cName) || \"\").split(\",\")\n },\n\n slideNavButtonClicked: (e) => {\n var toSlideId = $(e.target).attr(\"data-em-to\")\n var toSlide = JigsawPuzzleHints.DOM.slide(toSlideId)\n JigsawPuzzleHints.navToSlide(toSlide)\n },\n\n navToSlide: (toSlide) => {\n JigsawPuzzleHints.DOM.slides().hide()\n toSlide.show()\n\n if(toSlide.hasClass(\"solution\")) {\n JigsawPuzzleHints.DOM.zipImageRow().hide()\n JigsawPuzzleHints.DOM.section().addClass(\"top-align\")\n Nav.scrollTo(JigsawPuzzleHints.DOM.section())\n }\n },\n\n answerTextBoxKeyPressed: (e) => {\n if(e.which == 13)\n JigsawPuzzleHints.checkAnswer()\n },\n\n checkAnswer: () => {\n var answer = JigsawPuzzleHints.DOM.answerTextBox().val().trim().toLowerCase()\n answer = answer.replace(/[^a-z ]/g,\"\")\n answer = answer.replace(/[ ]+/g,\" \")\n var responseSlide = JigsawPuzzleHints.DOM.responseSlide(answer)\n if(responseSlide.length == 0) {\n JigsawPuzzleHints.navToSlide(JigsawPuzzleHints.DOM.incorrectGenericSlide())\n } else {\n JigsawPuzzleHints.navToSlide(responseSlide)\n }\n },\n\n solutionImageHovered: (e) => {\n var solutionImageWrapper = $(e.target)\n if(!solutionImageWrapper.hasClass(\"solution-image-wrapper\"))\n solutionImageWrapper = solutionImageWrapper.parent()\n var zoomingImage = solutionImageWrapper.find(\"img\").last()\n\n var bWidth = 10 // border width set in css\n\n var iWidth = solutionImageWrapper.width() - 2 * bWidth\n var iHeight = solutionImageWrapper.height() - 2 * bWidth\n var iX = e.pageX - solutionImageWrapper.offset().left - bWidth;\n var iY = e.pageY - solutionImageWrapper.offset().top - bWidth;\n iX = Math.min(Math.max(iX, 0), iWidth)\n iY = Math.min(Math.max(iY, 0), iHeight)\n\n var zoom = 3 // 2 corresponds to the 200% zoom set in css\n var zX = zoom * iX\n var zY = zoom * iY\n var cX = iWidth / 2\n var cY = iHeight / 2\n var zShiftX = cX - zX\n var zShiftY = cY - zY\n zShiftX = Math.min(Math.max(zShiftX, -1 * (zoom - 1) * iWidth), 0)\n zShiftY = Math.min(Math.max(zShiftY, -1 * (zoom - 1) * iHeight), 0)\n\n zoomingImage.css({top: zShiftY, left: zShiftX, opacity: 1})\n },\n\n solutionImageUnhovered: (e) => {\n var solutionImageWrapper = $(e.target)\n if(!solutionImageWrapper.hasClass(\".solution-image-wrapper\"))\n solutionImageWrapper = solutionImageWrapper.parent()\n var zoomingImage = solutionImageWrapper.find(\"img\").last()\n zoomingImage.css({opacity: 0.01})\n }\n}\n","import { Analytics } from \"./analytics.js\";\n\nexport let MailingList = {\n DOM: {\n submitBtn: () => $(\"#mc_embed_signup input[type=submit]\"),\n inlineError: () => $(\"#mc_embed_signup div.mce_inline_error\"),\n errorResponse: () => $(\"#mce-error-response\"),\n successResponse: () => $(\"#mce-success-response\"),\n emailInput: () => $(\"input#mce-EMAIL\"),\n },\n\n handle: () => {\n MailingList.DOM.submitBtn().click((e) => {\n MailingList.DOM.inlineError().hide()\n MailingList.DOM.errorResponse().hide()\n MailingList.DOM.successResponse().hide()\n var email = MailingList.DOM.emailInput().val()\n\n setTimeout(function() {\n var res = MailingList.DOM.successResponse().html().trim()\n if(res == \"Thank you for subscribing!\") {\n Analytics.subscribedToNewsletter(email)\n }\n }, 3000)\n\n return true;\n })\n }\n}\n","import { Nav } from \"./nav.js\";\nimport { Alert } from \"./alert.js\";\nimport { Carousel } from \"./carousel.js\";\nimport { ShopifyAddToCartButton } from \"./shopify-add-to-cart-button.js\";\nimport { MailingList } from \"./mailing-list.js\";\nimport { ProductBullets } from \"./product-bullets.js\";\nimport { JigsawPuzzleHints } from \"./jigsaw-puzzle-hints.js\";\nimport { Analytics } from \"./analytics.js\";\nimport { Reviews } from \"./reviews.js\";\n\nlet App = {\n DOM: {\n window: () => $(window),\n entireBody: () => $('html,body'),\n body: () => $('body'),\n fillHeightSection: () => $(\".fill-height\"),\n collapseElements: () => $(\".collapse\"),\n firstSection: () => $('body section:first-child')\n },\n\n handleFillHeight: () => {\n if(App.DOM.fillHeightSection().length > 0) {\n App.fillHeight()\n $(window).resize(App.fillHeight)\n $(document).on(\"turbolinks:render\", App.fillHeight)\n $(App.DOM.collapseElements()).on(\"shown.bs.collapse\", App.fillHeight)\n onElementHeightChange(document.body, App.fillHeight)\n }\n },\n\n fillHeight: () => {\n App.DOM.fillHeightSection().css(\"min-height\",0)\n\n var windowHeight = App.DOM.window().outerHeight()\n var bodyHeight = App.DOM.body().outerHeight()\n var diff = windowHeight - bodyHeight\n if(diff > 0) {\n App.DOM.fillHeightSection().css(\"min-height\", App.DOM.fillHeightSection().outerHeight() + diff)\n }\n },\n\n handlePageBounceColor: () => {\n App.navColor = Nav.DOM.nav().css(\"background-color\")\n if(Nav.DOM.nav().length == 0) {\n App.navColor = App.DOM.firstSection().css(\"background-color\")\n }\n App.footerColor = Nav.DOM.footer().css(\"background-color\")\n if(Nav.DOM.footer().length == 0) {\n App.navColor = App.DOM.firstSection().css(\"background-color\")\n }\n App.currentBodyColor = App.footerColor\n $(window).scroll(App.checkPageBounceColor)\n App.checkPageBounceColor()\n },\n\n checkPageBounceColor: () => {\n var top = Nav.windowScrollTop()\n if(top <= 300 && App.currentBodyColor != App.navColor) {\n App.DOM.body().css(\"background-color\", App.navColor)\n App.currentBodyColor = App.navColor\n } else if(top > 300 && App.currentBodyColor != App.footerColor) {\n App.DOM.body().css(\"background-color\", App.footerColor)\n App.currentBodyColor = App.footerColor\n }\n }\n}\n\nlet onElementHeightChange = (elm, callback) => {\n\tvar lastHeight = elm.clientHeight, newHeight;\n var lastScrollY = window.pageYOffset, newScrollY;\n\t(function run(){\n\t\tnewHeight = elm.clientHeight;\n\t\tif( lastHeight != newHeight )\n\t\t\tcallback();\n\t\tlastHeight = newHeight;\n if (elm.onElementHeightChangeTimer)\n clearTimeout(elm.onElementHeightChangeTimer);\n\t\telm.onElementHeightChangeTimer = setTimeout(run, 200);\n\t})();\n}\n\n$(document).ready(() => {\n Nav.setUpNavbar();\n Nav.handleSmoothScrollLinks();\n // Nav.tmpDisableAnimateNavBar();\n App.handleFillHeight();\n App.handlePageBounceColor();\n Carousel.init()\n ShopifyAddToCartButton.init()\n Alert.handle()\n MailingList.handle()\n ProductBullets.handle()\n JigsawPuzzleHints.handle()\n Analytics.handle()\n Reviews.handle()\n});\n","export let Nav = {\n DOM: {\n window: () => $(window),\n entireBody: () => $('html,body'),\n body: () => $('body'),\n nav: () => $(\"nav\"),\n footer: () => $(\"footer\"),\n navbar: () => $(\".navbar\"),\n navbarContainer: () => $(\".navbar .container-fluid\"),\n navbarCollapse: () => $(\".navbar-collapse\"),\n navbarToggler: () => $(\"button.navbar-toggler\"),\n navbarLinks: () => $(\"a.nav-link\"),\n anyNonNavElement: () => $(\"body *\").not(\".navbar\").not(\".navbar *\"),\n smoothScrollLinks: () => $(\"a.smooth-scroll\")\n },\n\n SCROLL_TO_OFFSET: 50,\n NAV_SCROLL_SPEED : 250,\n\n windowScrollTop: () => {\n return window.pageYOffset || document.documentElement.scrollTop\n },\n\n scrollTo: (el, onComplete) => {\n if(typeof(onComplete) === \"undefined\") {\n onComplete = () => {}\n }\n var elTop = el.offset().top\n var offset = Nav.SCROLL_TO_OFFSET\n var navOffset = Nav.DOM.navbar().hasClass(\"fixed-top\") ? parseInt(Nav.DOM.navbar().css(\"top\")) : (-1 * Nav.DOM.navbar().outerHeight())\n offset += (Nav.DOM.navbar().outerHeight() + navOffset)\n // Nav.tmpDisableAnimateNavBar()\n Nav.DOM.entireBody().animate({ scrollTop: elTop - offset }, 'slow', () => {\n $(el).focus()\n onComplete()\n });\n },\n\n lastScrollTop: 0,\n\n setUpNavbar: () => {\n Nav.lastScrollTop = Nav.windowScrollTop()\n // Nav.DOM.window().scroll(Nav.animateNavbar)\n\n if(Nav.DOM.navbarToggler().is(\":visible\")) {\n Nav.DOM.navbarLinks().attr(\"tabindex\", \"-1\")\n }\n\n Nav.DOM.anyNonNavElement().focus(() => {\n Nav.DOM.navbarCollapse().collapse(\"hide\")\n })\n\n Nav.DOM.navbarCollapse().on(\"show.bs.collapse\", () => {\n Nav.DOM.navbarToggler().focus()\n Nav.DOM.navbarToggler().attr(\"aria-label\",\"close mobile menu\")\n })\n\n Nav.DOM.navbarCollapse().on(\"shown.bs.collapse\", () => {\n Nav.DOM.navbarLinks().removeAttr(\"tabindex\")\n })\n\n Nav.DOM.navbarCollapse().on(\"hide.bs.collapse\", () => {\n Nav.DOM.navbarLinks().attr(\"tabindex\", \"-1\")\n Nav.DOM.navbarToggler().attr(\"aria-label\",\"open mobile menu\")\n })\n },\n\n scrollDir: null,\n\n // animateNavbar: () => {\n // if(Nav.disableNavAnimation) return;\n //\n // var st = Nav.windowScrollTop();\n // var navbarHeight = Nav.DOM.navbar().outerHeight();\n //\n // if(st > navbarHeight) {\n // if(!Nav.DOM.navbar().hasClass(\"fixed-top\")) {\n // Nav.DOM.navbar().css(\"top\", -1 * navbarHeight)\n // Nav.DOM.navbar().addClass(\"fixed-top\")\n // Nav.DOM.body().css(\"padding-top\",navbarHeight)\n // }\n //\n // if (st > Nav.lastScrollTop && Nav.scrollDir != \"down\") {\n // Nav.DOM.navbar().stop(true, false)\n // Nav.DOM.navbar().animate({top: -1 * navbarHeight}, Nav.NAV_SCROLL_SPEED)\n // Nav.scrollDir = \"down\"\n // } else if (st < Nav.lastScrollTop && Nav.scrollDir != \"up\") {\n // Nav.DOM.navbar().stop(true, false)\n // Nav.DOM.navbar().animate({top: 0}, Nav.NAV_SCROLL_SPEED)\n // Nav.scrollDir = \"up\"\n // }\n //\n // if(Nav.DOM.navbarCollapse().hasClass(\"show\")) {\n // setTimeout(function() { Nav.DOM.navbarToggler().click() }, Nav.NAV_SCROLL_SPEED)\n // }\n // } else if(st <= 0) {\n // Nav.DOM.navbar().removeClass(\"fixed-top\")\n // Nav.DOM.body().css(\"padding-top\",0)\n // }\n //\n // Nav.lastScrollTop = st;\n // },\n\n // disableNavAnimation: false,\n // disableNavAnimationTimeout: null,\n // tmpDisableAnimateNavBar: () => {\n // Nav.disableNavAnimation = true;\n // if(Nav.disableNavAnimationTimeout != null) {\n // clearTimeout(Nav.disableNavAnimationTimeout);\n // Nav.disableNavAnimationTimeout = null;\n // }\n // Nav.disableNavAnimationTimeout = setTimeout(() => {\n // Nav.disableNavAnimation = false\n // }, 1000)\n // },\n\n handleSmoothScrollLinks: () => {\n Nav.DOM.smoothScrollLinks().on(\"click touchstart\", (event) => {\n var scrollToId = $(event.target).attr(\"href\")\n if(scrollToId[0] == \"#\") {\n var scrollToEl = $(scrollToId)\n if(scrollToEl.length != 0)\n Nav.scrollTo(scrollToEl)\n return false; \n }\n })\n // if(window.location.hash != \"\") {\n // var scrollToEl = $(window.location.hash)\n // Nav.scrollTo(scrollToEl)\n // }\n }\n}\n","import { Utils } from \"./utils.js\";\n\nexport let ProductBullets = {\n DOM: {\n section: () => $(\"section.product-bullets\"),\n titles: () => ProductBullets.DOM.section().find(\".title\")\n },\n\n handle: () => {\n if(ProductBullets.DOM.section().length == 0) return\n $(window).resize(ProductBullets.doTitleResize)\n ProductBullets.doTitleResize()\n },\n\n doTitleResize: () => {\n var titles = ProductBullets.DOM.titles()\n titles.css({width: \"100%\"});\n\n var groupingsOf = 1;\n if(Utils.viewportIsSM() || Utils.viewportIsMD())\n groupingsOf = 2\n else\n groupingsOf = 3\n\n var numGroupings = Math.ceil(titles.length / groupingsOf)\n for(var group = 0; group < numGroupings; group++) {\n var titlesInGrouping = titles.slice(group * groupingsOf, group * groupingsOf + groupingsOf)\n if(titlesInGrouping <= 1) continue;\n var maxHeight = Math.max(...$.map(titlesInGrouping, (title) => $(title).outerHeight()))\n $.each(titlesInGrouping, (i, title) => {\n for(var w = 10; w <= 100; w += 10) {\n $(title).css({width: w + \"%\"})\n if($(title).outerHeight() <= maxHeight) break;\n }\n })\n }\n }\n}\n","export let Reviews = {\n DOM: {\n ratingsModals: () => $(\".ratings-modal\"),\n ratingsModal: (el) => $(el).parents(\".ratings-modal\"),\n writeReviewButtons: () => Reviews.DOM.ratingsModals().find(\".ratings-overview button.write-review\"),\n writeReviewButton: (el) => Reviews.DOM.ratingsModal(el).find(\".ratings-overview button.write-review\"),\n ratingsOverview: (el) => $(el).parents(\".modal\").find(\".ratings-overview\"),\n starPctWrappers: () => Reviews.DOM.ratingsModals().find(\".ratings-overview .star-pct-wrapper\"),\n reviewForm: (el) => Reviews.DOM.ratingsModal(el).find(\".review-form\"),\n reviewForms: () => Reviews.DOM.ratingsModals().find(\".review-form\"),\n submitReviewButtons: () => Reviews.DOM.reviewForms().find(\"button.submit\"),\n cancelReviewButtons: () => Reviews.DOM.reviewForms().find(\"button.cancel\"),\n reviewStars: () => Reviews.DOM.reviewForms().find(\".rate-stars img\"),\n submitReviewSpinner: (el) => Reviews.DOM.reviewForm(el).find(\".submit-loader\"),\n ratingErrorMessage: (el) => Reviews.DOM.ratingsModal(el).find(\".rating-error-collapse\"),\n ratingSuccessMessage: (el) => Reviews.DOM.ratingsModal(el).find(\".rating-success-collapse\"),\n reviewTemplate: (el) => Reviews.DOM.ratingsModal(el).find(\".review-template\"),\n noReviewsNoticeTemplate: (el) => Reviews.DOM.ratingsModal(el).find(\".no-reviews-notice-template\"),\n reviewList: (el) => Reviews.DOM.ratingsModal(el).find(\".review-list\"),\n loadMoreButtons: () => Reviews.DOM.ratingsModals().find(\".load-more-button button\"),\n loadMoreButton: (el) => Reviews.DOM.ratingsModal(el).find(\".load-more-button button\"),\n loadMoreLoader: (el) => Reviews.DOM.ratingsModal(el).find(\".load-more-loader\"),\n filterCollapse: (el) => Reviews.DOM.ratingsModal(el).find(\".filters-collapse.collapse\"),\n filterOptions: () => Reviews.DOM.ratingsModals().find(\".filters input\"),\n ratingFilter: (el, rating) => Reviews.DOM.ratingsModal(el).find(\".filters #filter-rating-\" + rating),\n sortFilter: (el, sort) => Reviews.DOM.ratingsModal(el).find(\".filters #filter-order-\" + sort),\n checkedRatingFilter: (el) => Reviews.DOM.ratingsModal(el).find(\".filters input[name='filters[rating]']:checked\"),\n checkedSortFilter: (el) => Reviews.DOM.ratingsModal(el).find(\".filters input[name='filters[order]']:checked\")\n\n },\n\n handle: () => {\n Reviews.DOM.reviewForms().hide()\n Reviews.DOM.writeReviewButtons().on(\"click touchstart\", Reviews.writeReviewButtonClicked)\n Reviews.DOM.submitReviewButtons().on(\"click touchstart\", Reviews.submitReviewButtonClicked)\n Reviews.DOM.cancelReviewButtons().on(\"click touchstart\", Reviews.cancelReviewButtonClicked)\n Reviews.DOM.reviewStars().on(\"click touchstart\", Reviews.reviewStarHovered)\n Reviews.DOM.ratingsModals().on(\"hidden.bs.modal\", Reviews.ratingsModalClosed)\n Reviews.DOM.loadMoreButtons().on(\"click touchstart\", Reviews.loadMoreButtonClicked)\n Reviews.DOM.ratingsModals().on(\"show.bs.modal\", Reviews.ratingsModalShown)\n Reviews.DOM.filterOptions().change(Reviews.filterOptionSelected)\n Reviews.enableStarPctWrapperClicks()\n Reviews.checkLinkedToWriteReview()\n },\n\n checkLinkedToWriteReview: () => {\n if(window.location.hash == \"#review\") {\n if(Reviews.DOM.ratingsModals().length > 0) {\n Reviews.DOM.ratingsModals().modal(\"show\")\n setTimeout(() => {\n Reviews.DOM.writeReviewButtons().click()\n }, 2000)\n }\n }\n },\n\n enableStarPctWrapperClicks: () => {\n Reviews.DOM.starPctWrappers().on(\"click touchstart\", Reviews.starPctWrapperClicked)\n },\n\n disableStarPctWrapperClicks: () => {\n Reviews.DOM.starPctWrappers().off(\"click touchstart\")\n },\n\n writeReviewButtonClicked: (e) => {\n Reviews.DOM.ratingsOverview(e.target).hide()\n Reviews.DOM.reviewForm(e.target).show()\n },\n\n reviewStarHovered: (e) => {\n var star = $(e.target)\n var numStar = star.attr(\"data-em-rating\")\n star.parent().attr(\"data-em-rating\", numStar)\n },\n\n submitReviewButtonClicked: (e) => {\n var spinner = Reviews.DOM.submitReviewSpinner(e.target)\n spinner.show()\n\n var buttons = $(e.target).parent()\n buttons.hide()\n\n var form = Reviews.DOM.reviewForm(e.target)\n form.find(\"input, textarea, button\").prop( \"disabled\", true );\n\n var productId = form.find(\"input[name='productId']\").val()\n var rating = form.find(\".rate-stars\").attr(\"data-em-rating\")\n var name = form.find(\"input[name='name']\").val()\n var email = form.find(\"input[name='email']\").val()\n var title = form.find(\"input[name='title']\").val()\n var content = form.find(\"textarea[name='content']\").val()\n\n setTimeout(() => {\n Reviews.createReview(productId, rating, name, email, title, content, (success, msg) => {\n spinner.hide()\n form.find(\"input, textarea, button\").prop( \"disabled\", false);\n if(!success) {\n var errorMessageBanner = Reviews.DOM.ratingErrorMessage(e.target)\n errorMessageBanner.find(\"p\").html(msg)\n errorMessageBanner.collapse(\"show\")\n buttons.show()\n } else {\n var successMessageBanner = Reviews.DOM.ratingSuccessMessage(e.target)\n successMessageBanner.collapse(\"show\")\n Reviews.cancelReviewButtonClicked(e)\n Reviews.DOM.writeReviewButton(e.target).hide()\n }\n })\n }, 500)\n },\n\n ratingsModalClosed: (e) => {\n var target = $(e.target).find(\".modal-body\")\n Reviews.cancelReviewButtonClicked({target: target})\n Reviews.resetReviewList({target: target})\n Reviews.DOM.ratingFilter(target, \"all\").prop(\"checked\",true)\n Reviews.DOM.sortFilter(target, \"newest-to-oldest\").prop(\"checked\",true)\n Reviews.DOM.filterCollapse(target).collapse(\"hide\")\n },\n\n ratingsModalShown: (e) => {\n var target = $(e.target).find(\".modal-body\")\n Reviews.loadMoreButtonClicked({target: Reviews.DOM.loadMoreButton(target)})\n },\n\n cancelReviewButtonClicked: (e) => {\n Reviews.DOM.reviewForm(e.target).hide()\n Reviews.DOM.ratingsOverview(e.target).show()\n Reviews.DOM.ratingSuccessMessage(e.target).removeClass(\"show\")\n Reviews.DOM.ratingErrorMessage(e.target).removeClass(\"show\")\n },\n\n starPctWrapperClicked: (e) => {\n var pctWrapper = $(e.target)\n if(!pctWrapper.is(\"[data-em-rating]\")) {\n pctWrapper = pctWrapper.parents(\".star-pct-wrapper\")\n }\n var rating = pctWrapper.attr(\"data-em-rating\")\n Reviews.DOM.ratingFilter(e.target, rating).prop(\"checked\",true)\n Reviews.filterOptionSelected(e)\n pctWrapper.blur()\n },\n\n filterOptionSelected: (e) => {\n Reviews.resetReviewList(e)\n Reviews.loadMoreButtonClicked({target: Reviews.DOM.loadMoreButton(e.target)})\n },\n\n resetReviewList: (e) => {\n Reviews.DOM.reviewList(e.target).html(\"\")\n Reviews.DOM.loadMoreButton(e.target).attr(\"data-em-next-page\", 1)\n },\n\n loadMoreButtonClicked: (e) => {\n var button = $(e.target)\n button.parent().hide()\n\n var loader = Reviews.DOM.loadMoreLoader(e.target)\n loader.show()\n\n Reviews.DOM.filterOptions().attr(\"disabled\",\"disabled\")\n Reviews.disableStarPctWrapperClicks()\n\n var nextPage = button.attr(\"data-em-next-page\")\n var productId = button.attr(\"data-em-product-id\")\n var ratingFilter = Reviews.DOM.checkedRatingFilter(e.target).val()\n var sortOrder = Reviews.DOM.checkedSortFilter(e.target).val()\n\n setTimeout(() => {\n Reviews.fetchReviews(productId, ratingFilter, sortOrder, nextPage, (success, reviews, nextPage) => {\n loader.hide()\n Reviews.DOM.filterOptions().removeAttr(\"disabled\")\n Reviews.enableStarPctWrapperClicks()\n\n if(!success) {\n Reviews.DOM.reviewList(button).append(Reviews.DOM.noReviewsNoticeTemplate(button).html())\n } else {\n if(reviews.length > 0) {\n $.each(reviews, (i, review) => {\n var templateReview = $(Reviews.DOM.reviewTemplate(button).html())\n templateReview.find(\".reviewer-name\").html(review.name)\n templateReview.find(\".review-date\").html(review.formatted_date)\n templateReview.find(\".reviewer-stars\").attr(\"data-em-rating\", review.rating)\n templateReview.find(\".review-title\").html(review.title)\n templateReview.find(\".review-body\").html(review.content)\n if(!review.is_verified) {\n templateReview.find(\".verified-buyer\").remove()\n }\n Reviews.DOM.reviewList(button).append(templateReview)\n })\n if(nextPage) {\n button.attr(\"data-em-next-page\",nextPage)\n button.parent().show()\n }\n } else {\n Reviews.DOM.reviewList(button).append(Reviews.DOM.noReviewsNoticeTemplate(button).html())\n }\n }\n })\n }, 500)\n },\n\n fetchReviews: (productId, rating, order, page, callback) => {\n var url = \"/api/products/\" + productId + \"/reviews.json\"\n\n var sendData = {\n filters: {\n rating: rating,\n order: order\n },\n page: page\n }\n\n $.ajax({\n type: \"GET\",\n url: url,\n data: sendData,\n success: function(data, textStatus, jqXHR) {\n callback(true, data.reviews, data.next_page)\n },\n error: function(jqXHR, textStatus, errorThrown) {\n callback(false)\n }\n })\n },\n\n createReview: (productId, rating, name, email, title, content, callback) => {\n var url = \"/api/products/\" + productId + \"/reviews.json\"\n\n var sendData = {\n review: {\n rating: rating,\n name: name,\n email: email,\n title: title,\n content: content\n }\n }\n\n $.ajax({\n type: \"POST\",\n url: url,\n data: sendData,\n success: function(data, textStatus, jqXHR) {\n callback(true, {})\n },\n error: function(jqXHR, textStatus, errorThrown) {\n callback(false, jqXHR.responseJSON.error)\n }\n })\n }\n}\n","import { Analytics } from \"./analytics.js\";\n\nexport let ShopifyAddToCartButton = {\n DOM: {\n addToCartButtons: () => $(\".shopify-add-to-cart-button\")\n },\n\n init: () => {\n $.each(ShopifyAddToCartButton.DOM.addToCartButtons(), (i, addToCartButton) => {\n ShopifyAddToCartButton.initButton(\n $(addToCartButton)[0],\n $(addToCartButton).attr(\"data-em-product-id\"),\n $(addToCartButton).attr(\"data-em-theme\"),\n $(addToCartButton).attr(\"data-em-alignment\"),\n $(addToCartButton).attr(\"data-em-is-preorder\") == \"true\"\n )\n })\n },\n\n initButton: (node, shopifyProductId, theme, alignment, isPreorder) => {\n (function () {\n var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';\n if (window.ShopifyBuy) {\n if (window.ShopifyBuy.UI) {\n ShopifyBuyInit();\n } else {\n loadScript();\n }\n } else {\n loadScript();\n }\n function loadScript() {\n var script = document.createElement('script');\n script.async = true;\n script.src = scriptURL;\n (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);\n script.onload = ShopifyBuyInit;\n }\n function ShopifyBuyInit() {\n var client = ShopifyBuy.buildClient({\n domain: 'byevermade.myshopify.com',\n storefrontAccessToken: 'ab15be67f60c45add2af0c58fc25d54c',\n });\n ShopifyBuy.UI.onReady(client).then(function (ui) {\n ui.createComponent('product', {\n id: shopifyProductId,\n node: node,\n moneyFormat: '%24%7B%7Bamount%7D%7D',\n options: {\n \"product\": {\n \"iframe\": true,\n \"events\": {\n \"addVariantToCart\": Analytics.addToCartButtonClicked,\n afterRender: function(comp) {\n var button = $(comp.view.wrapper).find(\"button\")\n if(isPreorder) {\n button.html(\"PREORDER* - $\" + comp.selectedVariant.price.amount)\n } else if(comp.selectedVariant.available) {\n button.html(\"ADD TO CART - $\" + comp.selectedVariant.price.amount)\n } else {\n button.html(\"TEMPORARILY SOLD OUT\")\n }\n }\n },\n \"styles\": {\n \"product\": {\n \"display\": alignment == \"left\" ? \"inline-block\" : \"block\",\n \"width\": alignment == \"left\" ? \"auto\" : \"100%\",\n \"@media (min-width: 601px)\": {\n \"margin-left\": \"20px\",\n \"margin-bottom\": \"50px\"\n }\n },\n \"title\": {\n \"font-family\": \"Lora, serif\",\n \"color\": \"#002c50\"\n },\n \"button\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"font-weight\": \"600\",\n \"letter-spacing\": \"0.05em\",\n \"text-transform\": \"uppercase\",\n \"font-size\": \"14px\",\n \"padding-top\": \"10px\",\n \"padding-bottom\": \"10px\",\n \"color\": \"#333132\",\n \"display\": alignment == \"left\" ? \"inline-block\" : \"block\",\n \":hover\": {\n \"color\": \"#333132\",\n \"background-color\": \"#e6e6e6\"\n },\n \"background-color\": \"#ffffff\",\n \":focus\": {\n \"background-color\": \"#ffffff\",\n \"outline\": \"2px dotted !important\",\n \"outline-offset\": \"-3px !important\",\n \"outline-color\": \"333132 !important\"\n },\n \"border-radius\": \"40px\",\n \"padding-left\": \"35px\",\n \"padding-right\": \"35px\",\n \"margin-top\": \"-20px !important\",\n },\n \"quantityInput\": {\n \"font-size\": \"14px\",\n \"padding-top\": \"15px\",\n \"padding-bottom\": \"15px\"\n },\n \"price\": {\n \"font-family\": \"Droid Sans, sans-serif\",\n \"font-weight\": \"bold\",\n \"color\": \"#aec1d5\"\n },\n \"compareAt\": {\n \"font-family\": \"Droid Sans, sans-serif\",\n \"font-weight\": \"bold\",\n \"color\": \"#aec1d5\"\n },\n \"unitPrice\": {\n \"font-family\": \"Droid Sans, sans-serif\",\n \"font-weight\": \"bold\",\n \"color\": \"#aec1d5\"\n }\n },\n \"contents\": {\n \"img\": false,\n \"title\": false,\n \"price\": false\n },\n \"googleFonts\": [\n \"Lora\",\n \"Droid Sans\"\n ]\n },\n \"productSet\": {\n \"styles\": {\n \"products\": {\n \"@media (min-width: 601px)\": {\n \"margin-left\": \"-20px\"\n }\n }\n }\n },\n \"modalProduct\": {\n \"contents\": {\n \"img\": false,\n \"imgWithCarousel\": true,\n \"button\": false,\n \"buttonWithQuantity\": true\n },\n \"styles\": {\n \"product\": {\n \"@media (min-width: 601px)\": {\n \"max-width\": \"100%\",\n \"margin-left\": \"0px\",\n \"margin-bottom\": \"0px\"\n }\n },\n \"button\": {\n \"font-weight\": \"bold\",\n \"font-size\": \"14px\",\n \"padding-top\": \"15px\",\n \"padding-bottom\": \"15px\",\n \"color\": \"#333132\",\n \":hover\": {\n \"color\": \"#333132\",\n \"background-color\": \"#e6e6e6\"\n },\n \"background-color\": \"#ffffff\",\n \":focus\": {\n \"background-color\": \"#e6e6e6\"\n },\n \"border-radius\": \"40px\",\n \"padding-left\": \"100px\",\n \"padding-right\": \"100px\"\n },\n \"quantityInput\": {\n \"font-size\": \"14px\",\n \"padding-top\": \"15px\",\n \"padding-bottom\": \"15px\"\n },\n \"title\": {\n \"font-family\": \"Helvetica Neue, sans-serif\",\n \"font-weight\": \"bold\",\n \"font-size\": \"26px\",\n \"color\": \"#4c4c4c\"\n },\n \"price\": {\n \"font-family\": \"Helvetica Neue, sans-serif\",\n \"font-weight\": \"normal\",\n \"font-size\": \"18px\",\n \"color\": \"#4c4c4c\"\n },\n \"compareAt\": {\n \"font-family\": \"Helvetica Neue, sans-serif\",\n \"font-weight\": \"normal\",\n \"font-size\": \"15.299999999999999px\",\n \"color\": \"#4c4c4c\"\n },\n \"unitPrice\": {\n \"font-family\": \"Helvetica Neue, sans-serif\",\n \"font-weight\": \"normal\",\n \"font-size\": \"15.299999999999999px\",\n \"color\": \"#4c4c4c\"\n }\n },\n \"text\": {\n \"button\": \"Add to cart\"\n }\n },\n \"option\": {},\n \"cart\": {\n \"events\": {\n \"openCheckout\": Analytics.checkoutOpened\n },\n \"styles\": {\n \"button\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"text-transform\": \"uppercase\",\n \"letter-spacing\": \"0.05em\",\n \"font-weight\": \"bold\",\n \"font-size\": \"18px\",\n \"padding-top\": \"15px\",\n \"padding-bottom\": \"15px\",\n \"color\": \"white\",\n \":hover\": {\n \"color\": \"white\",\n \"background-color\": \"#F15625\"\n },\n \"background-color\": \"#F15625\",\n \":focus\": {\n \"background-color\": \"#F15625\"\n },\n \"border-radius\": \"40px\"\n },\n \"cart\": {\n \"background-color\": \"white\",\n },\n \"title\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"header\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"lineItems\": {\n \"font-size\": \"30px\",\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"subtotalText\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"subtotal\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"notice\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"currency\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"close\": {\n \"color\": \"#333132\",\n \"outline\": \"none\",\n \":hover\": {\n \"color\": \"#333132\"\n }\n },\n \"empty\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\",\n \"font-size\": \"21px\"\n },\n \"noteDescription\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"discountText\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"discountIcon\": {\n \"fill\": \"#333132\"\n },\n \"discountAmount\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n }\n },\n \"text\": {\n \"total\": \"Subtotal\",\n \"empty\": \"Nothing here yet! Keep browsing for your favorite games!\",\n \"button\": \"Checkout →\"\n },\n \"popup\": false\n },\n \"toggle\": {\n \"styles\": {\n \"toggle\": {\n \"font-weight\": \"bold\",\n \"background-color\": \"white\",\n \"ouline-color\": \"white !important\",\n \":hover\": {\n \"background-color\": \"#e6e6e6\"\n },\n \":focus\": {\n \"background-color\": \"#e6e6e6\"\n }\n },\n \"count\": {\n \"font-size\": \"16px\",\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\",\n \":hover\": {\n \"color\": \"#333132\"\n }\n },\n \"iconPath\": {\n \"fill\": \"#333132\"\n }\n }\n },\n \"lineItem\": {\n \"styles\": {\n \"variantTitle\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"title\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"price\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"fullPrice\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"discount\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"discountIcon\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"fill\": \"#333132\"\n },\n \"quantity\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\"\n },\n \"quantityIncrement\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\",\n \"border-color\": \"#333132\"\n },\n \"quantityDecrement\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\",\n \"border-color\": \"#333132\"\n },\n \"quantityInput\": {\n \"font-family\": '\"Poppins\", sans-serif',\n \"color\": \"#333132\",\n \"border-color\": \"#333132\"\n }\n }\n }\n },\n });\n });\n }\n })();\n }\n}\n","export let TechnoDystopiaHints = {\n DOM: {\n colorBoxes: () => $(\"#hints .hint .boxes .color-box\"),\n colorBoxForColor: (color) => $(\"#hints .hint .boxes .color-box[data-em-color='\" + color + \"']\"),\n allColorBoxHints: (color) => $(\"#hints .hint .box-hints\"),\n colorBoxHintsForColor: (color) => $(\"#hints .hint .box-hints.\" + color)\n },\n\n handle: () => {\n TechnoDystopiaHints.DOM.colorBoxes().on(\"click touchstart\", TechnoDystopiaHints.colorBoxClicked)\n TechnoDystopiaHints.colorBoxClicked({target: TechnoDystopiaHints.DOM.colorBoxForColor(\"red\")})\n },\n\n colorBoxClicked: (e) => {\n var colorBox = $(e.target)\n if(!colorBox.hasClass(\"color-box\"))\n colorBox = colorBox.parent()\n\n var color = colorBox.attr(\"data-em-color\")\n\n TechnoDystopiaHints.DOM.colorBoxes().removeClass(\"selected\")\n colorBox.addClass(\"selected\")\n\n TechnoDystopiaHints.DOM.allColorBoxHints().hide()\n TechnoDystopiaHints.DOM.colorBoxHintsForColor(color).show()\n }\n}\n","export let Utils = {\n ViewportSizes: {\n XS: \"xs\",\n SM: \"sm\",\n MD: \"md\",\n LG: \"lg\",\n XL: \"xl\"\n },\n\n VIEWPORT_RESIZE_EVENT: \"viewportResize\",\n\n viewportSize: () => {\n // https://stackoverflow.com/a/8876069\n const width = Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n )\n if (width <= 576) return Utils.ViewportSizes.XS\n if (width <= 768) return Utils.ViewportSizes.SM\n if (width <= 992) return Utils.ViewportSizes.MD\n if (width <= 1200) return Utils.ViewportSizes.LG\n return Utils.ViewportSizes.XL\n },\n\n viewportIsXS: () => { return Utils.viewportSize() == Utils.ViewportSizes.XS },\n viewportIsSM: () => { return Utils.viewportSize() == Utils.ViewportSizes.SM },\n viewportIsMD: () => { return Utils.viewportSize() == Utils.ViewportSizes.MD },\n viewportIsLG: () => { return Utils.viewportSize() == Utils.ViewportSizes.LG },\n viewportIsXL: () => { return Utils.viewportSize() == Utils.ViewportSizes.XL },\n\n setupViewportResizeEvents: () => {\n Utils.currentViewport = Utils.viewportSize()\n $(window).resize(() => {\n var newViewport = Utils.viewportSize()\n if(newViewport != Utils.currentViewport) {\n Utils.currentViewport = newViewport\n $(window).trigger(Utils.VIEWPORT_RESIZE_EVENT, Utils.currentViewport)\n }\n })\n }\n}\n\n$(document).ready(() => {\n Utils.setupViewportResizeEvents()\n})\n","(function (global, factory) {\n typeof exports === \"object\" && typeof module !== \"undefined\" ? factory(exports) : typeof define === \"function\" && define.amd ? define([\"exports\"], factory) : factory(global.ActiveStorage = {});\n})(this, function (exports) {\n \"use strict\";\n\n function createCommonjsModule(fn, module) {\n return module = {\n exports: {}\n }, fn(module, module.exports), module.exports;\n }\n var sparkMd5 = createCommonjsModule(function (module, exports) {\n (function (factory) {\n {\n module.exports = factory();\n }\n })(function (undefined) {\n var hex_chr = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\n function md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n function md5blk(s) {\n var md5blks = [],\n i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n function md5blk_array(a) {\n var md5blks = [],\n i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n function md51(s) {\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function md51_array(a) {\n var n = a.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);\n length = a.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function rhex(n) {\n var s = \"\",\n j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];\n }\n return s;\n }\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join(\"\");\n }\n if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n (function () {\n function clamp(val, length) {\n val = val | 0 || 0;\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n return Math.min(val, length);\n }\n ArrayBuffer.prototype.slice = function (from, to) {\n var length = this.byteLength,\n begin = clamp(from, length),\n end = length,\n num,\n target,\n targetArray,\n sourceArray;\n if (to !== undefined) {\n end = clamp(to, length);\n }\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n return target;\n };\n })();\n }\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n return str;\n }\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length,\n buff = new ArrayBuffer(length),\n arr = new Uint8Array(buff),\n i;\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n return returnUInt8Array ? arr : buff;\n }\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n return returnUInt8Array ? result : result.buffer;\n }\n function hexToBinaryString(hex) {\n var bytes = [],\n length = hex.length,\n x;\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n return String.fromCharCode.apply(String, bytes);\n }\n function SparkMD5() {\n this.reset();\n }\n SparkMD5.prototype.append = function (str) {\n this.appendBinary(toUtf8(str));\n return this;\n };\n SparkMD5.prototype.appendBinary = function (contents) {\n this._buff += contents;\n this._length += contents.length;\n var length = this._buff.length,\n i;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n this._buff = this._buff.substring(i - 64);\n return this;\n };\n SparkMD5.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n i,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.prototype.reset = function () {\n this._buff = \"\";\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n return this;\n };\n SparkMD5.prototype.getState = function () {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash\n };\n };\n SparkMD5.prototype.setState = function (state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n return this;\n };\n SparkMD5.prototype.destroy = function () {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n SparkMD5.prototype._finish = function (tail, length) {\n var i = length,\n tmp,\n lo,\n hi;\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n SparkMD5.hash = function (str, raw) {\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n SparkMD5.hashBinary = function (content, raw) {\n var hash = md51(content),\n ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n SparkMD5.ArrayBuffer = function () {\n this.reset();\n };\n SparkMD5.ArrayBuffer.prototype.append = function (arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),\n length = buff.length,\n i;\n this._length += arr.byteLength;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n i,\n ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.ArrayBuffer.prototype.reset = function () {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.getState = function () {\n var state = SparkMD5.prototype.getState.call(this);\n state.buff = arrayBuffer2Utf8Str(state.buff);\n return state;\n };\n SparkMD5.ArrayBuffer.prototype.setState = function (state) {\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n return SparkMD5.prototype.setState.call(this, state);\n };\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n SparkMD5.ArrayBuffer.hash = function (arr, raw) {\n var hash = md51_array(new Uint8Array(arr)),\n ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n return SparkMD5;\n });\n });\n var classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n var createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n var fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\n var FileChecksum = function () {\n createClass(FileChecksum, null, [{\n key: \"create\",\n value: function create(file, callback) {\n var instance = new FileChecksum(file);\n instance.create(callback);\n }\n }]);\n function FileChecksum(file) {\n classCallCheck(this, FileChecksum);\n this.file = file;\n this.chunkSize = 2097152;\n this.chunkCount = Math.ceil(this.file.size / this.chunkSize);\n this.chunkIndex = 0;\n }\n createClass(FileChecksum, [{\n key: \"create\",\n value: function create(callback) {\n var _this = this;\n this.callback = callback;\n this.md5Buffer = new sparkMd5.ArrayBuffer();\n this.fileReader = new FileReader();\n this.fileReader.addEventListener(\"load\", function (event) {\n return _this.fileReaderDidLoad(event);\n });\n this.fileReader.addEventListener(\"error\", function (event) {\n return _this.fileReaderDidError(event);\n });\n this.readNextChunk();\n }\n }, {\n key: \"fileReaderDidLoad\",\n value: function fileReaderDidLoad(event) {\n this.md5Buffer.append(event.target.result);\n if (!this.readNextChunk()) {\n var binaryDigest = this.md5Buffer.end(true);\n var base64digest = btoa(binaryDigest);\n this.callback(null, base64digest);\n }\n }\n }, {\n key: \"fileReaderDidError\",\n value: function fileReaderDidError(event) {\n this.callback(\"Error reading \" + this.file.name);\n }\n }, {\n key: \"readNextChunk\",\n value: function readNextChunk() {\n if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {\n var start = this.chunkIndex * this.chunkSize;\n var end = Math.min(start + this.chunkSize, this.file.size);\n var bytes = fileSlice.call(this.file, start, end);\n this.fileReader.readAsArrayBuffer(bytes);\n this.chunkIndex++;\n return true;\n } else {\n return false;\n }\n }\n }]);\n return FileChecksum;\n }();\n function getMetaValue(name) {\n var element = findElement(document.head, 'meta[name=\"' + name + '\"]');\n if (element) {\n return element.getAttribute(\"content\");\n }\n }\n function findElements(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n var elements = root.querySelectorAll(selector);\n return toArray$1(elements);\n }\n function findElement(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n return root.querySelector(selector);\n }\n function dispatchEvent(element, type) {\n var eventInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var disabled = element.disabled;\n var bubbles = eventInit.bubbles,\n cancelable = eventInit.cancelable,\n detail = eventInit.detail;\n var event = document.createEvent(\"Event\");\n event.initEvent(type, bubbles || true, cancelable || true);\n event.detail = detail || {};\n try {\n element.disabled = false;\n element.dispatchEvent(event);\n } finally {\n element.disabled = disabled;\n }\n return event;\n }\n function toArray$1(value) {\n if (Array.isArray(value)) {\n return value;\n } else if (Array.from) {\n return Array.from(value);\n } else {\n return [].slice.call(value);\n }\n }\n var BlobRecord = function () {\n function BlobRecord(file, checksum, url) {\n var _this = this;\n classCallCheck(this, BlobRecord);\n this.file = file;\n this.attributes = {\n filename: file.name,\n content_type: file.type || \"application/octet-stream\",\n byte_size: file.size,\n checksum: checksum\n };\n this.xhr = new XMLHttpRequest();\n this.xhr.open(\"POST\", url, true);\n this.xhr.responseType = \"json\";\n this.xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n this.xhr.setRequestHeader(\"Accept\", \"application/json\");\n this.xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n var csrfToken = getMetaValue(\"csrf-token\");\n if (csrfToken != undefined) {\n this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\n }\n this.xhr.addEventListener(\"load\", function (event) {\n return _this.requestDidLoad(event);\n });\n this.xhr.addEventListener(\"error\", function (event) {\n return _this.requestDidError(event);\n });\n }\n createClass(BlobRecord, [{\n key: \"create\",\n value: function create(callback) {\n this.callback = callback;\n this.xhr.send(JSON.stringify({\n blob: this.attributes\n }));\n }\n }, {\n key: \"requestDidLoad\",\n value: function requestDidLoad(event) {\n if (this.status >= 200 && this.status < 300) {\n var response = this.response;\n var direct_upload = response.direct_upload;\n delete response.direct_upload;\n this.attributes = response;\n this.directUploadData = direct_upload;\n this.callback(null, this.toJSON());\n } else {\n this.requestDidError(event);\n }\n }\n }, {\n key: \"requestDidError\",\n value: function requestDidError(event) {\n this.callback('Error creating Blob for \"' + this.file.name + '\". Status: ' + this.status);\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n var result = {};\n for (var key in this.attributes) {\n result[key] = this.attributes[key];\n }\n return result;\n }\n }, {\n key: \"status\",\n get: function get$$1() {\n return this.xhr.status;\n }\n }, {\n key: \"response\",\n get: function get$$1() {\n var _xhr = this.xhr,\n responseType = _xhr.responseType,\n response = _xhr.response;\n if (responseType == \"json\") {\n return response;\n } else {\n return JSON.parse(response);\n }\n }\n }]);\n return BlobRecord;\n }();\n var BlobUpload = function () {\n function BlobUpload(blob) {\n var _this = this;\n classCallCheck(this, BlobUpload);\n this.blob = blob;\n this.file = blob.file;\n var _blob$directUploadDat = blob.directUploadData,\n url = _blob$directUploadDat.url,\n headers = _blob$directUploadDat.headers;\n this.xhr = new XMLHttpRequest();\n this.xhr.open(\"PUT\", url, true);\n this.xhr.responseType = \"text\";\n for (var key in headers) {\n this.xhr.setRequestHeader(key, headers[key]);\n }\n this.xhr.addEventListener(\"load\", function (event) {\n return _this.requestDidLoad(event);\n });\n this.xhr.addEventListener(\"error\", function (event) {\n return _this.requestDidError(event);\n });\n }\n createClass(BlobUpload, [{\n key: \"create\",\n value: function create(callback) {\n this.callback = callback;\n this.xhr.send(this.file.slice());\n }\n }, {\n key: \"requestDidLoad\",\n value: function requestDidLoad(event) {\n var _xhr = this.xhr,\n status = _xhr.status,\n response = _xhr.response;\n if (status >= 200 && status < 300) {\n this.callback(null, response);\n } else {\n this.requestDidError(event);\n }\n }\n }, {\n key: \"requestDidError\",\n value: function requestDidError(event) {\n this.callback('Error storing \"' + this.file.name + '\". Status: ' + this.xhr.status);\n }\n }]);\n return BlobUpload;\n }();\n var id = 0;\n var DirectUpload = function () {\n function DirectUpload(file, url, delegate) {\n classCallCheck(this, DirectUpload);\n this.id = ++id;\n this.file = file;\n this.url = url;\n this.delegate = delegate;\n }\n createClass(DirectUpload, [{\n key: \"create\",\n value: function create(callback) {\n var _this = this;\n FileChecksum.create(this.file, function (error, checksum) {\n if (error) {\n callback(error);\n return;\n }\n var blob = new BlobRecord(_this.file, checksum, _this.url);\n notify(_this.delegate, \"directUploadWillCreateBlobWithXHR\", blob.xhr);\n blob.create(function (error) {\n if (error) {\n callback(error);\n } else {\n var upload = new BlobUpload(blob);\n notify(_this.delegate, \"directUploadWillStoreFileWithXHR\", upload.xhr);\n upload.create(function (error) {\n if (error) {\n callback(error);\n } else {\n callback(null, blob.toJSON());\n }\n });\n }\n });\n });\n }\n }]);\n return DirectUpload;\n }();\n function notify(object, methodName) {\n if (object && typeof object[methodName] == \"function\") {\n for (var _len = arguments.length, messages = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n messages[_key - 2] = arguments[_key];\n }\n return object[methodName].apply(object, messages);\n }\n }\n var DirectUploadController = function () {\n function DirectUploadController(input, file) {\n classCallCheck(this, DirectUploadController);\n this.input = input;\n this.file = file;\n this.directUpload = new DirectUpload(this.file, this.url, this);\n this.dispatch(\"initialize\");\n }\n createClass(DirectUploadController, [{\n key: \"start\",\n value: function start(callback) {\n var _this = this;\n var hiddenInput = document.createElement(\"input\");\n hiddenInput.type = \"hidden\";\n hiddenInput.name = this.input.name;\n this.input.insertAdjacentElement(\"beforebegin\", hiddenInput);\n this.dispatch(\"start\");\n this.directUpload.create(function (error, attributes) {\n if (error) {\n hiddenInput.parentNode.removeChild(hiddenInput);\n _this.dispatchError(error);\n } else {\n hiddenInput.value = attributes.signed_id;\n }\n _this.dispatch(\"end\");\n callback(error);\n });\n }\n }, {\n key: \"uploadRequestDidProgress\",\n value: function uploadRequestDidProgress(event) {\n var progress = event.loaded / event.total * 100;\n if (progress) {\n this.dispatch(\"progress\", {\n progress: progress\n });\n }\n }\n }, {\n key: \"dispatch\",\n value: function dispatch(name) {\n var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n detail.file = this.file;\n detail.id = this.directUpload.id;\n return dispatchEvent(this.input, \"direct-upload:\" + name, {\n detail: detail\n });\n }\n }, {\n key: \"dispatchError\",\n value: function dispatchError(error) {\n var event = this.dispatch(\"error\", {\n error: error\n });\n if (!event.defaultPrevented) {\n alert(error);\n }\n }\n }, {\n key: \"directUploadWillCreateBlobWithXHR\",\n value: function directUploadWillCreateBlobWithXHR(xhr) {\n this.dispatch(\"before-blob-request\", {\n xhr: xhr\n });\n }\n }, {\n key: \"directUploadWillStoreFileWithXHR\",\n value: function directUploadWillStoreFileWithXHR(xhr) {\n var _this2 = this;\n this.dispatch(\"before-storage-request\", {\n xhr: xhr\n });\n xhr.upload.addEventListener(\"progress\", function (event) {\n return _this2.uploadRequestDidProgress(event);\n });\n }\n }, {\n key: \"url\",\n get: function get$$1() {\n return this.input.getAttribute(\"data-direct-upload-url\");\n }\n }]);\n return DirectUploadController;\n }();\n var inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\n var DirectUploadsController = function () {\n function DirectUploadsController(form) {\n classCallCheck(this, DirectUploadsController);\n this.form = form;\n this.inputs = findElements(form, inputSelector).filter(function (input) {\n return input.files.length;\n });\n }\n createClass(DirectUploadsController, [{\n key: \"start\",\n value: function start(callback) {\n var _this = this;\n var controllers = this.createDirectUploadControllers();\n var startNextController = function startNextController() {\n var controller = controllers.shift();\n if (controller) {\n controller.start(function (error) {\n if (error) {\n callback(error);\n _this.dispatch(\"end\");\n } else {\n startNextController();\n }\n });\n } else {\n callback();\n _this.dispatch(\"end\");\n }\n };\n this.dispatch(\"start\");\n startNextController();\n }\n }, {\n key: \"createDirectUploadControllers\",\n value: function createDirectUploadControllers() {\n var controllers = [];\n this.inputs.forEach(function (input) {\n toArray$1(input.files).forEach(function (file) {\n var controller = new DirectUploadController(input, file);\n controllers.push(controller);\n });\n });\n return controllers;\n }\n }, {\n key: \"dispatch\",\n value: function dispatch(name) {\n var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return dispatchEvent(this.form, \"direct-uploads:\" + name, {\n detail: detail\n });\n }\n }]);\n return DirectUploadsController;\n }();\n var processingAttribute = \"data-direct-uploads-processing\";\n var submitButtonsByForm = new WeakMap();\n var started = false;\n function start() {\n if (!started) {\n started = true;\n document.addEventListener(\"click\", didClick, true);\n document.addEventListener(\"submit\", didSubmitForm);\n document.addEventListener(\"ajax:before\", didSubmitRemoteElement);\n }\n }\n function didClick(event) {\n var target = event.target;\n if ((target.tagName == \"INPUT\" || target.tagName == \"BUTTON\") && target.type == \"submit\" && target.form) {\n submitButtonsByForm.set(target.form, target);\n }\n }\n function didSubmitForm(event) {\n handleFormSubmissionEvent(event);\n }\n function didSubmitRemoteElement(event) {\n if (event.target.tagName == \"FORM\") {\n handleFormSubmissionEvent(event);\n }\n }\n function handleFormSubmissionEvent(event) {\n var form = event.target;\n if (form.hasAttribute(processingAttribute)) {\n event.preventDefault();\n return;\n }\n var controller = new DirectUploadsController(form);\n var inputs = controller.inputs;\n if (inputs.length) {\n event.preventDefault();\n form.setAttribute(processingAttribute, \"\");\n inputs.forEach(disable);\n controller.start(function (error) {\n form.removeAttribute(processingAttribute);\n if (error) {\n inputs.forEach(enable);\n } else {\n submitForm(form);\n }\n });\n }\n }\n function submitForm(form) {\n var button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n if (button) {\n var _button = button,\n disabled = _button.disabled;\n button.disabled = false;\n button.focus();\n button.click();\n button.disabled = disabled;\n } else {\n button = document.createElement(\"input\");\n button.type = \"submit\";\n button.style.display = \"none\";\n form.appendChild(button);\n button.click();\n form.removeChild(button);\n }\n submitButtonsByForm.delete(form);\n }\n function disable(input) {\n input.disabled = true;\n }\n function enable(input) {\n input.disabled = false;\n }\n function autostart() {\n if (window.ActiveStorage) {\n start();\n }\n }\n setTimeout(autostart, 1);\n exports.start = start;\n exports.DirectUpload = DirectUpload;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n});","/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/assets/javascripts\nReleased under the MIT license\n */;\n(function () {\n var context = this;\n (function () {\n (function () {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form:not([data-turbo=true])',\n formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n }).call(this);\n }).call(context);\n var Rails = context.Rails;\n (function () {\n (function () {\n var nonce;\n nonce = null;\n Rails.loadCSPNonce = function () {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n Rails.cspNonce = function () {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n }).call(this);\n (function () {\n var expando, m;\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n Rails.matches = function (element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n expando = '_ujsData';\n Rails.getData = function (element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n Rails.setData = function (element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n return element[expando][key] = value;\n };\n Rails.$ = function (selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n }).call(this);\n (function () {\n var $, csrfParam, csrfToken;\n $ = Rails.$;\n csrfToken = Rails.csrfToken = function () {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n csrfParam = Rails.csrfParam = function () {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n Rails.CSRFProtection = function (xhr) {\n var token;\n token = csrfToken();\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n Rails.refreshCSRFTokens = function () {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n if (token != null && param != null) {\n return $('form input[name=\"' + param + '\"]').forEach(function (input) {\n return input.value = token;\n });\n }\n };\n }).call(this);\n (function () {\n var CustomEvent, fire, matches, preventDefault;\n matches = Rails.matches;\n CustomEvent = window.CustomEvent;\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function (event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n CustomEvent.prototype.preventDefault = function () {\n var result;\n result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function () {\n return true;\n }\n });\n }\n return result;\n };\n }\n fire = Rails.fire = function (obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n Rails.stopEverything = function (e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n Rails.delegate = function (element, selector, eventType, handler) {\n return element.addEventListener(eventType, function (e) {\n var target;\n target = e.target;\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n }).call(this);\n (function () {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n Rails.ajax = function (options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function () {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n if (options.beforeSend != null && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n prepareOptions = function (options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n return options;\n };\n createXHR = function (options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n };\n processResponse = function (response, type) {\n var parser, script;\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n return response;\n };\n Rails.href = function (element) {\n return element.href;\n };\n Rails.isCrossDomain = function (url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n try {\n urlAnchor.href = url;\n return !((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host || originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host);\n } catch (error) {\n e = error;\n return true;\n }\n };\n }).call(this);\n (function () {\n var matches, toArray;\n matches = Rails.matches;\n toArray = function (e) {\n return Array.prototype.slice.call(e);\n };\n Rails.serializeElement = function (element, additionalParam) {\n var inputs, params;\n inputs = [element];\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n params = [];\n inputs.forEach(function (input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, 'fieldset[disabled] *')) {\n return;\n }\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function (option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map(function (param) {\n if (param.name != null) {\n return encodeURIComponent(param.name) + \"=\" + encodeURIComponent(param.value);\n } else {\n return param;\n }\n }).join('&');\n };\n Rails.formElements = function (form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function (el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n }).call(this);\n (function () {\n var allowAction, fire, stopEverything;\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n Rails.handleConfirm = function (e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n Rails.confirm = function (message, element) {\n return confirm(message);\n };\n allowAction = function (element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n if (!message) {\n return true;\n }\n answer = false;\n if (fire(element, 'confirm')) {\n try {\n answer = Rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, 'confirm:complete', [answer]);\n }\n return answer && callback;\n };\n }).call(this);\n (function () {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything;\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n Rails.handleDisabledElement = function (e) {\n var element;\n element = this;\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n Rails.enableElement = function (e) {\n var element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n Rails.disableElement = function (e) {\n var element;\n element = e instanceof Event ? e.target : e;\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n disableLinkElement = function (element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n enableLinkElement = function (element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n disableFormElements = function (form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n disableFormElement = function (element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n enableFormElements = function (form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n enableFormElement = function (element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, 'ujs:enable-with', null);\n }\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n isXhrRedirect = function (event) {\n var ref, xhr;\n xhr = (ref = event.detail) != null ? ref[0] : void 0;\n return (xhr != null ? xhr.getResponseHeader(\"X-Xhr-Redirect\") : void 0) != null;\n };\n }).call(this);\n (function () {\n var stopEverything;\n stopEverything = Rails.stopEverything;\n Rails.handleMethod = function (e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n if (!method) {\n return;\n }\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"\";\n if (csrfParam != null && csrfToken != null && !Rails.isCrossDomain(href)) {\n formContent += \"\";\n }\n formContent += '';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n }).call(this);\n (function () {\n var ajax,\n fire,\n getData,\n isCrossDomain,\n isRemote,\n matches,\n serializeElement,\n setData,\n stopEverything,\n slice = [].slice;\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n isRemote = function (element) {\n var value;\n value = element.getAttribute('data-remote');\n return value != null && value !== 'false';\n };\n Rails.handleRemote = function (e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function (xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function () {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function () {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function () {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: withCredentials != null && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n Rails.formSubmitButtonClick = function (e) {\n var button, form;\n button = this;\n form = button.form;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n Rails.preventInsignificantClick = function (e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = e.button != null && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n }).call(this);\n (function () {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n if (typeof jQuery !== \"undefined\" && jQuery !== null && jQuery.ajax != null) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n Rails.start = function () {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n window.addEventListener('pageshow', function () {\n $(Rails.formEnableSelector).forEach(function (el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function (el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function (e) {\n return setTimeout(function () {\n return disableElement(e);\n }, 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n }).call(this);\n }).call(this);\n if (typeof module === \"object\" && module.exports) {\n module.exports = Rails;\n } else if (typeof define === \"function\" && define.amd) {\n define(Rails);\n }\n}).call(this);","/*! js-cookie v3.0.5 | MIT */\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, function () {\n var current = global.Cookies;\n var exports = global.Cookies = factory();\n exports.noConflict = function () {\n global.Cookies = current;\n return exports;\n };\n }());\n})(this, function () {\n 'use strict';\n\n /* eslint-disable no-var */\n function assign(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target;\n }\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n var defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent);\n },\n write: function (value) {\n return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);\n }\n };\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n\n function init(converter, defaultAttributes) {\n function set(name, value, attributes) {\n if (typeof document === 'undefined') {\n return;\n }\n attributes = assign({}, defaultAttributes, attributes);\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue;\n }\n stringifiedAttributes += '; ' + attributeName;\n if (attributes[attributeName] === true) {\n continue;\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n return document.cookie = name + '=' + converter.write(value, name) + stringifiedAttributes;\n }\n function get(name) {\n if (typeof document === 'undefined' || arguments.length && !name) {\n return;\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n if (name === found) {\n break;\n }\n } catch (e) {}\n }\n return name ? jar[name] : jar;\n }\n return Object.create({\n set,\n get,\n remove: function (name, attributes) {\n set(name, '', assign({}, attributes, {\n expires: -1\n }));\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes));\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes);\n }\n }, {\n attributes: {\n value: Object.freeze(defaultAttributes)\n },\n converter: {\n value: Object.freeze(converter)\n }\n });\n }\n var api = init(defaultConverter, {\n path: '/'\n });\n /* eslint-enable no-var */\n\n return api;\n});","/*\nTurbolinks 5.2.0\nCopyright © 2018 Basecamp, LLC\n */\n(function () {\n var t = this;\n (function () {\n (function () {\n this.Turbolinks = {\n supported: function () {\n return null != window.history.pushState && null != window.requestAnimationFrame && null != window.addEventListener;\n }(),\n visit: function (t, r) {\n return e.controller.visit(t, r);\n },\n clearCache: function () {\n return e.controller.clearCache();\n },\n setProgressBarDelay: function (t) {\n return e.controller.setProgressBarDelay(t);\n }\n };\n }).call(this);\n }).call(t);\n var e = t.Turbolinks;\n (function () {\n (function () {\n var t,\n r,\n n,\n o = [].slice;\n e.copyObject = function (t) {\n var e, r, n;\n r = {};\n for (e in t) n = t[e], r[e] = n;\n return r;\n }, e.closest = function (e, r) {\n return t.call(e, r);\n }, t = function () {\n var t, e;\n return t = document.documentElement, null != (e = t.closest) ? e : function (t) {\n var e;\n for (e = this; e;) {\n if (e.nodeType === Node.ELEMENT_NODE && r.call(e, t)) return e;\n e = e.parentNode;\n }\n };\n }(), e.defer = function (t) {\n return setTimeout(t, 1);\n }, e.throttle = function (t) {\n var e;\n return e = null, function () {\n var r;\n return r = 1 <= arguments.length ? o.call(arguments, 0) : [], null != e ? e : e = requestAnimationFrame(function (n) {\n return function () {\n return e = null, t.apply(n, r);\n };\n }(this));\n };\n }, e.dispatch = function (t, e) {\n var r, o, i, s, a, u;\n return a = null != e ? e : {}, u = a.target, r = a.cancelable, o = a.data, i = document.createEvent(\"Events\"), i.initEvent(t, !0, r === !0), i.data = null != o ? o : {}, i.cancelable && !n && (s = i.preventDefault, i.preventDefault = function () {\n return this.defaultPrevented || Object.defineProperty(this, \"defaultPrevented\", {\n get: function () {\n return !0;\n }\n }), s.call(this);\n }), (null != u ? u : document).dispatchEvent(i), i;\n }, n = function () {\n var t;\n return t = document.createEvent(\"Events\"), t.initEvent(\"test\", !0, !0), t.preventDefault(), t.defaultPrevented;\n }(), e.match = function (t, e) {\n return r.call(t, e);\n }, r = function () {\n var t, e, r, n;\n return t = document.documentElement, null != (e = null != (r = null != (n = t.matchesSelector) ? n : t.webkitMatchesSelector) ? r : t.msMatchesSelector) ? e : t.mozMatchesSelector;\n }(), e.uuid = function () {\n var t, e, r;\n for (r = \"\", t = e = 1; 36 >= e; t = ++e) r += 9 === t || 14 === t || 19 === t || 24 === t ? \"-\" : 15 === t ? \"4\" : 20 === t ? (Math.floor(4 * Math.random()) + 8).toString(16) : Math.floor(15 * Math.random()).toString(16);\n return r;\n };\n }).call(this), function () {\n e.Location = function () {\n function t(t) {\n var e, r;\n null == t && (t = \"\"), r = document.createElement(\"a\"), r.href = t.toString(), this.absoluteURL = r.href, e = r.hash.length, 2 > e ? this.requestURL = this.absoluteURL : (this.requestURL = this.absoluteURL.slice(0, -e), this.anchor = r.hash.slice(1));\n }\n var e, r, n, o;\n return t.wrap = function (t) {\n return t instanceof this ? t : new this(t);\n }, t.prototype.getOrigin = function () {\n return this.absoluteURL.split(\"/\", 3).join(\"/\");\n }, t.prototype.getPath = function () {\n var t, e;\n return null != (t = null != (e = this.requestURL.match(/\\/\\/[^\\/]*(\\/[^?;]*)/)) ? e[1] : void 0) ? t : \"/\";\n }, t.prototype.getPathComponents = function () {\n return this.getPath().split(\"/\").slice(1);\n }, t.prototype.getLastPathComponent = function () {\n return this.getPathComponents().slice(-1)[0];\n }, t.prototype.getExtension = function () {\n var t, e;\n return null != (t = null != (e = this.getLastPathComponent().match(/\\.[^.]*$/)) ? e[0] : void 0) ? t : \"\";\n }, t.prototype.isHTML = function () {\n return this.getExtension().match(/^(?:|\\.(?:htm|html|xhtml))$/);\n }, t.prototype.isPrefixedBy = function (t) {\n var e;\n return e = r(t), this.isEqualTo(t) || o(this.absoluteURL, e);\n }, t.prototype.isEqualTo = function (t) {\n return this.absoluteURL === (null != t ? t.absoluteURL : void 0);\n }, t.prototype.toCacheKey = function () {\n return this.requestURL;\n }, t.prototype.toJSON = function () {\n return this.absoluteURL;\n }, t.prototype.toString = function () {\n return this.absoluteURL;\n }, t.prototype.valueOf = function () {\n return this.absoluteURL;\n }, r = function (t) {\n return e(t.getOrigin() + t.getPath());\n }, e = function (t) {\n return n(t, \"/\") ? t : t + \"/\";\n }, o = function (t, e) {\n return t.slice(0, e.length) === e;\n }, n = function (t, e) {\n return t.slice(-e.length) === e;\n }, t;\n }();\n }.call(this), function () {\n var t = function (t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n e.HttpRequest = function () {\n function r(r, n, o) {\n this.delegate = r, this.requestCanceled = t(this.requestCanceled, this), this.requestTimedOut = t(this.requestTimedOut, this), this.requestFailed = t(this.requestFailed, this), this.requestLoaded = t(this.requestLoaded, this), this.requestProgressed = t(this.requestProgressed, this), this.url = e.Location.wrap(n).requestURL, this.referrer = e.Location.wrap(o).absoluteURL, this.createXHR();\n }\n return r.NETWORK_FAILURE = 0, r.TIMEOUT_FAILURE = -1, r.timeout = 60, r.prototype.send = function () {\n var t;\n return this.xhr && !this.sent ? (this.notifyApplicationBeforeRequestStart(), this.setProgress(0), this.xhr.send(), this.sent = !0, \"function\" == typeof (t = this.delegate).requestStarted ? t.requestStarted() : void 0) : void 0;\n }, r.prototype.cancel = function () {\n return this.xhr && this.sent ? this.xhr.abort() : void 0;\n }, r.prototype.requestProgressed = function (t) {\n return t.lengthComputable ? this.setProgress(t.loaded / t.total) : void 0;\n }, r.prototype.requestLoaded = function () {\n return this.endRequest(function (t) {\n return function () {\n var e;\n return 200 <= (e = t.xhr.status) && 300 > e ? t.delegate.requestCompletedWithResponse(t.xhr.responseText, t.xhr.getResponseHeader(\"Turbolinks-Location\")) : (t.failed = !0, t.delegate.requestFailedWithStatusCode(t.xhr.status, t.xhr.responseText));\n };\n }(this));\n }, r.prototype.requestFailed = function () {\n return this.endRequest(function (t) {\n return function () {\n return t.failed = !0, t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE);\n };\n }(this));\n }, r.prototype.requestTimedOut = function () {\n return this.endRequest(function (t) {\n return function () {\n return t.failed = !0, t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE);\n };\n }(this));\n }, r.prototype.requestCanceled = function () {\n return this.endRequest();\n }, r.prototype.notifyApplicationBeforeRequestStart = function () {\n return e.dispatch(\"turbolinks:request-start\", {\n data: {\n url: this.url,\n xhr: this.xhr\n }\n });\n }, r.prototype.notifyApplicationAfterRequestEnd = function () {\n return e.dispatch(\"turbolinks:request-end\", {\n data: {\n url: this.url,\n xhr: this.xhr\n }\n });\n }, r.prototype.createXHR = function () {\n return this.xhr = new XMLHttpRequest(), this.xhr.open(\"GET\", this.url, !0), this.xhr.timeout = 1e3 * this.constructor.timeout, this.xhr.setRequestHeader(\"Accept\", \"text/html, application/xhtml+xml\"), this.xhr.setRequestHeader(\"Turbolinks-Referrer\", this.referrer), this.xhr.onprogress = this.requestProgressed, this.xhr.onload = this.requestLoaded, this.xhr.onerror = this.requestFailed, this.xhr.ontimeout = this.requestTimedOut, this.xhr.onabort = this.requestCanceled;\n }, r.prototype.endRequest = function (t) {\n return this.xhr ? (this.notifyApplicationAfterRequestEnd(), null != t && t.call(this), this.destroy()) : void 0;\n }, r.prototype.setProgress = function (t) {\n var e;\n return this.progress = t, \"function\" == typeof (e = this.delegate).requestProgressed ? e.requestProgressed(this.progress) : void 0;\n }, r.prototype.destroy = function () {\n var t;\n return this.setProgress(1), \"function\" == typeof (t = this.delegate).requestFinished && t.requestFinished(), this.delegate = null, this.xhr = null;\n }, r;\n }();\n }.call(this), function () {\n var t = function (t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n e.ProgressBar = function () {\n function e() {\n this.trickle = t(this.trickle, this), this.stylesheetElement = this.createStylesheetElement(), this.progressElement = this.createProgressElement();\n }\n var r;\n return r = 300, e.defaultCSS = \".turbolinks-progress-bar {\\n position: fixed;\\n display: block;\\n top: 0;\\n left: 0;\\n height: 3px;\\n background: #0076ff;\\n z-index: 9999;\\n transition: width \" + r + \"ms ease-out, opacity \" + r / 2 + \"ms \" + r / 2 + \"ms ease-in;\\n transform: translate3d(0, 0, 0);\\n}\", e.prototype.show = function () {\n return this.visible ? void 0 : (this.visible = !0, this.installStylesheetElement(), this.installProgressElement(), this.startTrickling());\n }, e.prototype.hide = function () {\n return this.visible && !this.hiding ? (this.hiding = !0, this.fadeProgressElement(function (t) {\n return function () {\n return t.uninstallProgressElement(), t.stopTrickling(), t.visible = !1, t.hiding = !1;\n };\n }(this))) : void 0;\n }, e.prototype.setValue = function (t) {\n return this.value = t, this.refresh();\n }, e.prototype.installStylesheetElement = function () {\n return document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n }, e.prototype.installProgressElement = function () {\n return this.progressElement.style.width = 0, this.progressElement.style.opacity = 1, document.documentElement.insertBefore(this.progressElement, document.body), this.refresh();\n }, e.prototype.fadeProgressElement = function (t) {\n return this.progressElement.style.opacity = 0, setTimeout(t, 1.5 * r);\n }, e.prototype.uninstallProgressElement = function () {\n return this.progressElement.parentNode ? document.documentElement.removeChild(this.progressElement) : void 0;\n }, e.prototype.startTrickling = function () {\n return null != this.trickleInterval ? this.trickleInterval : this.trickleInterval = setInterval(this.trickle, r);\n }, e.prototype.stopTrickling = function () {\n return clearInterval(this.trickleInterval), this.trickleInterval = null;\n }, e.prototype.trickle = function () {\n return this.setValue(this.value + Math.random() / 100);\n }, e.prototype.refresh = function () {\n return requestAnimationFrame(function (t) {\n return function () {\n return t.progressElement.style.width = 10 + 90 * t.value + \"%\";\n };\n }(this));\n }, e.prototype.createStylesheetElement = function () {\n var t;\n return t = document.createElement(\"style\"), t.type = \"text/css\", t.textContent = this.constructor.defaultCSS, t;\n }, e.prototype.createProgressElement = function () {\n var t;\n return t = document.createElement(\"div\"), t.className = \"turbolinks-progress-bar\", t;\n }, e;\n }();\n }.call(this), function () {\n var t = function (t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n e.BrowserAdapter = function () {\n function r(r) {\n this.controller = r, this.showProgressBar = t(this.showProgressBar, this), this.progressBar = new e.ProgressBar();\n }\n var n, o, i;\n return i = e.HttpRequest, n = i.NETWORK_FAILURE, o = i.TIMEOUT_FAILURE, r.prototype.visitProposedToLocationWithAction = function (t, e) {\n return this.controller.startVisitToLocationWithAction(t, e);\n }, r.prototype.visitStarted = function (t) {\n return t.issueRequest(), t.changeHistory(), t.loadCachedSnapshot();\n }, r.prototype.visitRequestStarted = function (t) {\n return this.progressBar.setValue(0), t.hasCachedSnapshot() || \"restore\" !== t.action ? this.showProgressBarAfterDelay() : this.showProgressBar();\n }, r.prototype.visitRequestProgressed = function (t) {\n return this.progressBar.setValue(t.progress);\n }, r.prototype.visitRequestCompleted = function (t) {\n return t.loadResponse();\n }, r.prototype.visitRequestFailedWithStatusCode = function (t, e) {\n switch (e) {\n case n:\n case o:\n return this.reload();\n default:\n return t.loadResponse();\n }\n }, r.prototype.visitRequestFinished = function (t) {\n return this.hideProgressBar();\n }, r.prototype.visitCompleted = function (t) {\n return t.followRedirect();\n }, r.prototype.pageInvalidated = function () {\n return this.reload();\n }, r.prototype.showProgressBarAfterDelay = function () {\n return this.progressBarTimeout = setTimeout(this.showProgressBar, this.controller.progressBarDelay);\n }, r.prototype.showProgressBar = function () {\n return this.progressBar.show();\n }, r.prototype.hideProgressBar = function () {\n return this.progressBar.hide(), clearTimeout(this.progressBarTimeout);\n }, r.prototype.reload = function () {\n return window.location.reload();\n }, r;\n }();\n }.call(this), function () {\n var t = function (t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n e.History = function () {\n function r(e) {\n this.delegate = e, this.onPageLoad = t(this.onPageLoad, this), this.onPopState = t(this.onPopState, this);\n }\n return r.prototype.start = function () {\n return this.started ? void 0 : (addEventListener(\"popstate\", this.onPopState, !1), addEventListener(\"load\", this.onPageLoad, !1), this.started = !0);\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"popstate\", this.onPopState, !1), removeEventListener(\"load\", this.onPageLoad, !1), this.started = !1) : void 0;\n }, r.prototype.push = function (t, r) {\n return t = e.Location.wrap(t), this.update(\"push\", t, r);\n }, r.prototype.replace = function (t, r) {\n return t = e.Location.wrap(t), this.update(\"replace\", t, r);\n }, r.prototype.onPopState = function (t) {\n var r, n, o, i;\n return this.shouldHandlePopState() && (i = null != (n = t.state) ? n.turbolinks : void 0) ? (r = e.Location.wrap(window.location), o = i.restorationIdentifier, this.delegate.historyPoppedToLocationWithRestorationIdentifier(r, o)) : void 0;\n }, r.prototype.onPageLoad = function (t) {\n return e.defer(function (t) {\n return function () {\n return t.pageLoaded = !0;\n };\n }(this));\n }, r.prototype.shouldHandlePopState = function () {\n return this.pageIsLoaded();\n }, r.prototype.pageIsLoaded = function () {\n return this.pageLoaded || \"complete\" === document.readyState;\n }, r.prototype.update = function (t, e, r) {\n var n;\n return n = {\n turbolinks: {\n restorationIdentifier: r\n }\n }, history[t + \"State\"](n, null, e);\n }, r;\n }();\n }.call(this), function () {\n e.HeadDetails = function () {\n function t(t) {\n var e, r, n, s, a, u;\n for (this.elements = {}, n = 0, a = t.length; a > n; n++) u = t[n], u.nodeType === Node.ELEMENT_NODE && (s = u.outerHTML, r = null != (e = this.elements)[s] ? e[s] : e[s] = {\n type: i(u),\n tracked: o(u),\n elements: []\n }, r.elements.push(u));\n }\n var e, r, n, o, i;\n return t.fromHeadElement = function (t) {\n var e;\n return new this(null != (e = null != t ? t.childNodes : void 0) ? e : []);\n }, t.prototype.hasElementWithKey = function (t) {\n return t in this.elements;\n }, t.prototype.getTrackedElementSignature = function () {\n var t, e;\n return function () {\n var r, n;\n r = this.elements, n = [];\n for (t in r) e = r[t].tracked, e && n.push(t);\n return n;\n }.call(this).join(\"\");\n }, t.prototype.getScriptElementsNotInDetails = function (t) {\n return this.getElementsMatchingTypeNotInDetails(\"script\", t);\n }, t.prototype.getStylesheetElementsNotInDetails = function (t) {\n return this.getElementsMatchingTypeNotInDetails(\"stylesheet\", t);\n }, t.prototype.getElementsMatchingTypeNotInDetails = function (t, e) {\n var r, n, o, i, s, a;\n o = this.elements, s = [];\n for (n in o) i = o[n], a = i.type, r = i.elements, a !== t || e.hasElementWithKey(n) || s.push(r[0]);\n return s;\n }, t.prototype.getProvisionalElements = function () {\n var t, e, r, n, o, i, s;\n r = [], n = this.elements;\n for (e in n) o = n[e], s = o.type, i = o.tracked, t = o.elements, null != s || i ? t.length > 1 && r.push.apply(r, t.slice(1)) : r.push.apply(r, t);\n return r;\n }, t.prototype.getMetaValue = function (t) {\n var e;\n return null != (e = this.findMetaElementByName(t)) ? e.getAttribute(\"content\") : void 0;\n }, t.prototype.findMetaElementByName = function (t) {\n var r, n, o, i;\n r = void 0, i = this.elements;\n for (o in i) n = i[o].elements, e(n[0], t) && (r = n[0]);\n return r;\n }, i = function (t) {\n return r(t) ? \"script\" : n(t) ? \"stylesheet\" : void 0;\n }, o = function (t) {\n return \"reload\" === t.getAttribute(\"data-turbolinks-track\");\n }, r = function (t) {\n var e;\n return e = t.tagName.toLowerCase(), \"script\" === e;\n }, n = function (t) {\n var e;\n return e = t.tagName.toLowerCase(), \"style\" === e || \"link\" === e && \"stylesheet\" === t.getAttribute(\"rel\");\n }, e = function (t, e) {\n var r;\n return r = t.tagName.toLowerCase(), \"meta\" === r && t.getAttribute(\"name\") === e;\n }, t;\n }();\n }.call(this), function () {\n e.Snapshot = function () {\n function t(t, e) {\n this.headDetails = t, this.bodyElement = e;\n }\n return t.wrap = function (t) {\n return t instanceof this ? t : \"string\" == typeof t ? this.fromHTMLString(t) : this.fromHTMLElement(t);\n }, t.fromHTMLString = function (t) {\n var e;\n return e = document.createElement(\"html\"), e.innerHTML = t, this.fromHTMLElement(e);\n }, t.fromHTMLElement = function (t) {\n var r, n, o, i;\n return o = t.querySelector(\"head\"), r = null != (i = t.querySelector(\"body\")) ? i : document.createElement(\"body\"), n = e.HeadDetails.fromHeadElement(o), new this(n, r);\n }, t.prototype.clone = function () {\n return new this.constructor(this.headDetails, this.bodyElement.cloneNode(!0));\n }, t.prototype.getRootLocation = function () {\n var t, r;\n return r = null != (t = this.getSetting(\"root\")) ? t : \"/\", new e.Location(r);\n }, t.prototype.getCacheControlValue = function () {\n return this.getSetting(\"cache-control\");\n }, t.prototype.getElementForAnchor = function (t) {\n try {\n return this.bodyElement.querySelector(\"[id='\" + t + \"'], a[name='\" + t + \"']\");\n } catch (e) {}\n }, t.prototype.getPermanentElements = function () {\n return this.bodyElement.querySelectorAll(\"[id][data-turbolinks-permanent]\");\n }, t.prototype.getPermanentElementById = function (t) {\n return this.bodyElement.querySelector(\"#\" + t + \"[data-turbolinks-permanent]\");\n }, t.prototype.getPermanentElementsPresentInSnapshot = function (t) {\n var e, r, n, o, i;\n for (o = this.getPermanentElements(), i = [], r = 0, n = o.length; n > r; r++) e = o[r], t.getPermanentElementById(e.id) && i.push(e);\n return i;\n }, t.prototype.findFirstAutofocusableElement = function () {\n return this.bodyElement.querySelector(\"[autofocus]\");\n }, t.prototype.hasAnchor = function (t) {\n return null != this.getElementForAnchor(t);\n }, t.prototype.isPreviewable = function () {\n return \"no-preview\" !== this.getCacheControlValue();\n }, t.prototype.isCacheable = function () {\n return \"no-cache\" !== this.getCacheControlValue();\n }, t.prototype.isVisitable = function () {\n return \"reload\" !== this.getSetting(\"visit-control\");\n }, t.prototype.getSetting = function (t) {\n return this.headDetails.getMetaValue(\"turbolinks-\" + t);\n }, t;\n }();\n }.call(this), function () {\n var t = [].slice;\n e.Renderer = function () {\n function e() {}\n var r;\n return e.render = function () {\n var e, r, n, o;\n return n = arguments[0], r = arguments[1], e = 3 <= arguments.length ? t.call(arguments, 2) : [], o = function (t, e, r) {\n r.prototype = t.prototype;\n var n = new r(),\n o = t.apply(n, e);\n return Object(o) === o ? o : n;\n }(this, e, function () {}), o.delegate = n, o.render(r), o;\n }, e.prototype.renderView = function (t) {\n return this.delegate.viewWillRender(this.newBody), t(), this.delegate.viewRendered(this.newBody);\n }, e.prototype.invalidateView = function () {\n return this.delegate.viewInvalidated();\n }, e.prototype.createScriptElement = function (t) {\n var e;\n return \"false\" === t.getAttribute(\"data-turbolinks-eval\") ? t : (e = document.createElement(\"script\"), e.textContent = t.textContent, e.async = !1, r(e, t), e);\n }, r = function (t, e) {\n var r, n, o, i, s, a, u;\n for (i = e.attributes, a = [], r = 0, n = i.length; n > r; r++) s = i[r], o = s.name, u = s.value, a.push(t.setAttribute(o, u));\n return a;\n }, e;\n }();\n }.call(this), function () {\n var t,\n r,\n n = function (t, e) {\n function r() {\n this.constructor = t;\n }\n for (var n in e) o.call(e, n) && (t[n] = e[n]);\n return r.prototype = e.prototype, t.prototype = new r(), t.__super__ = e.prototype, t;\n },\n o = {}.hasOwnProperty;\n e.SnapshotRenderer = function (e) {\n function o(t, e, r) {\n this.currentSnapshot = t, this.newSnapshot = e, this.isPreview = r, this.currentHeadDetails = this.currentSnapshot.headDetails, this.newHeadDetails = this.newSnapshot.headDetails, this.currentBody = this.currentSnapshot.bodyElement, this.newBody = this.newSnapshot.bodyElement;\n }\n return n(o, e), o.prototype.render = function (t) {\n return this.shouldRender() ? (this.mergeHead(), this.renderView(function (e) {\n return function () {\n return e.replaceBody(), e.isPreview || e.focusFirstAutofocusableElement(), t();\n };\n }(this))) : this.invalidateView();\n }, o.prototype.mergeHead = function () {\n return this.copyNewHeadStylesheetElements(), this.copyNewHeadScriptElements(), this.removeCurrentHeadProvisionalElements(), this.copyNewHeadProvisionalElements();\n }, o.prototype.replaceBody = function () {\n var t;\n return t = this.relocateCurrentBodyPermanentElements(), this.activateNewBodyScriptElements(), this.assignNewBody(), this.replacePlaceholderElementsWithClonedPermanentElements(t);\n }, o.prototype.shouldRender = function () {\n return this.newSnapshot.isVisitable() && this.trackedElementsAreIdentical();\n }, o.prototype.trackedElementsAreIdentical = function () {\n return this.currentHeadDetails.getTrackedElementSignature() === this.newHeadDetails.getTrackedElementSignature();\n }, o.prototype.copyNewHeadStylesheetElements = function () {\n var t, e, r, n, o;\n for (n = this.getNewHeadStylesheetElements(), o = [], e = 0, r = n.length; r > e; e++) t = n[e], o.push(document.head.appendChild(t));\n return o;\n }, o.prototype.copyNewHeadScriptElements = function () {\n var t, e, r, n, o;\n for (n = this.getNewHeadScriptElements(), o = [], e = 0, r = n.length; r > e; e++) t = n[e], o.push(document.head.appendChild(this.createScriptElement(t)));\n return o;\n }, o.prototype.removeCurrentHeadProvisionalElements = function () {\n var t, e, r, n, o;\n for (n = this.getCurrentHeadProvisionalElements(), o = [], e = 0, r = n.length; r > e; e++) t = n[e], o.push(document.head.removeChild(t));\n return o;\n }, o.prototype.copyNewHeadProvisionalElements = function () {\n var t, e, r, n, o;\n for (n = this.getNewHeadProvisionalElements(), o = [], e = 0, r = n.length; r > e; e++) t = n[e], o.push(document.head.appendChild(t));\n return o;\n }, o.prototype.relocateCurrentBodyPermanentElements = function () {\n var e, n, o, i, s, a, u;\n for (a = this.getCurrentBodyPermanentElements(), u = [], e = 0, n = a.length; n > e; e++) i = a[e], s = t(i), o = this.newSnapshot.getPermanentElementById(i.id), r(i, s.element), r(o, i), u.push(s);\n return u;\n }, o.prototype.replacePlaceholderElementsWithClonedPermanentElements = function (t) {\n var e, n, o, i, s, a, u;\n for (u = [], o = 0, i = t.length; i > o; o++) a = t[o], n = a.element, s = a.permanentElement, e = s.cloneNode(!0), u.push(r(n, e));\n return u;\n }, o.prototype.activateNewBodyScriptElements = function () {\n var t, e, n, o, i, s;\n for (i = this.getNewBodyScriptElements(), s = [], e = 0, o = i.length; o > e; e++) n = i[e], t = this.createScriptElement(n), s.push(r(n, t));\n return s;\n }, o.prototype.assignNewBody = function () {\n return document.body = this.newBody;\n }, o.prototype.focusFirstAutofocusableElement = function () {\n var t;\n return null != (t = this.newSnapshot.findFirstAutofocusableElement()) ? t.focus() : void 0;\n }, o.prototype.getNewHeadStylesheetElements = function () {\n return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails);\n }, o.prototype.getNewHeadScriptElements = function () {\n return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails);\n }, o.prototype.getCurrentHeadProvisionalElements = function () {\n return this.currentHeadDetails.getProvisionalElements();\n }, o.prototype.getNewHeadProvisionalElements = function () {\n return this.newHeadDetails.getProvisionalElements();\n }, o.prototype.getCurrentBodyPermanentElements = function () {\n return this.currentSnapshot.getPermanentElementsPresentInSnapshot(this.newSnapshot);\n }, o.prototype.getNewBodyScriptElements = function () {\n return this.newBody.querySelectorAll(\"script\");\n }, o;\n }(e.Renderer), t = function (t) {\n var e;\n return e = document.createElement(\"meta\"), e.setAttribute(\"name\", \"turbolinks-permanent-placeholder\"), e.setAttribute(\"content\", t.id), {\n element: e,\n permanentElement: t\n };\n }, r = function (t, e) {\n var r;\n return (r = t.parentNode) ? r.replaceChild(e, t) : void 0;\n };\n }.call(this), function () {\n var t = function (t, e) {\n function n() {\n this.constructor = t;\n }\n for (var o in e) r.call(e, o) && (t[o] = e[o]);\n return n.prototype = e.prototype, t.prototype = new n(), t.__super__ = e.prototype, t;\n },\n r = {}.hasOwnProperty;\n e.ErrorRenderer = function (e) {\n function r(t) {\n var e;\n e = document.createElement(\"html\"), e.innerHTML = t, this.newHead = e.querySelector(\"head\"), this.newBody = e.querySelector(\"body\");\n }\n return t(r, e), r.prototype.render = function (t) {\n return this.renderView(function (e) {\n return function () {\n return e.replaceHeadAndBody(), e.activateBodyScriptElements(), t();\n };\n }(this));\n }, r.prototype.replaceHeadAndBody = function () {\n var t, e;\n return e = document.head, t = document.body, e.parentNode.replaceChild(this.newHead, e), t.parentNode.replaceChild(this.newBody, t);\n }, r.prototype.activateBodyScriptElements = function () {\n var t, e, r, n, o, i;\n for (n = this.getScriptElements(), i = [], e = 0, r = n.length; r > e; e++) o = n[e], t = this.createScriptElement(o), i.push(o.parentNode.replaceChild(t, o));\n return i;\n }, r.prototype.getScriptElements = function () {\n return document.documentElement.querySelectorAll(\"script\");\n }, r;\n }(e.Renderer);\n }.call(this), function () {\n e.View = function () {\n function t(t) {\n this.delegate = t, this.htmlElement = document.documentElement;\n }\n return t.prototype.getRootLocation = function () {\n return this.getSnapshot().getRootLocation();\n }, t.prototype.getElementForAnchor = function (t) {\n return this.getSnapshot().getElementForAnchor(t);\n }, t.prototype.getSnapshot = function () {\n return e.Snapshot.fromHTMLElement(this.htmlElement);\n }, t.prototype.render = function (t, e) {\n var r, n, o;\n return o = t.snapshot, r = t.error, n = t.isPreview, this.markAsPreview(n), null != o ? this.renderSnapshot(o, n, e) : this.renderError(r, e);\n }, t.prototype.markAsPreview = function (t) {\n return t ? this.htmlElement.setAttribute(\"data-turbolinks-preview\", \"\") : this.htmlElement.removeAttribute(\"data-turbolinks-preview\");\n }, t.prototype.renderSnapshot = function (t, r, n) {\n return e.SnapshotRenderer.render(this.delegate, n, this.getSnapshot(), e.Snapshot.wrap(t), r);\n }, t.prototype.renderError = function (t, r) {\n return e.ErrorRenderer.render(this.delegate, r, t);\n }, t;\n }();\n }.call(this), function () {\n var t = function (t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n e.ScrollManager = function () {\n function r(r) {\n this.delegate = r, this.onScroll = t(this.onScroll, this), this.onScroll = e.throttle(this.onScroll);\n }\n return r.prototype.start = function () {\n return this.started ? void 0 : (addEventListener(\"scroll\", this.onScroll, !1), this.onScroll(), this.started = !0);\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"scroll\", this.onScroll, !1), this.started = !1) : void 0;\n }, r.prototype.scrollToElement = function (t) {\n return t.scrollIntoView();\n }, r.prototype.scrollToPosition = function (t) {\n var e, r;\n return e = t.x, r = t.y, window.scrollTo(e, r);\n }, r.prototype.onScroll = function (t) {\n return this.updatePosition({\n x: window.pageXOffset,\n y: window.pageYOffset\n });\n }, r.prototype.updatePosition = function (t) {\n var e;\n return this.position = t, null != (e = this.delegate) ? e.scrollPositionChanged(this.position) : void 0;\n }, r;\n }();\n }.call(this), function () {\n e.SnapshotCache = function () {\n function t(t) {\n this.size = t, this.keys = [], this.snapshots = {};\n }\n var r;\n return t.prototype.has = function (t) {\n var e;\n return e = r(t), e in this.snapshots;\n }, t.prototype.get = function (t) {\n var e;\n if (this.has(t)) return e = this.read(t), this.touch(t), e;\n }, t.prototype.put = function (t, e) {\n return this.write(t, e), this.touch(t), e;\n }, t.prototype.read = function (t) {\n var e;\n return e = r(t), this.snapshots[e];\n }, t.prototype.write = function (t, e) {\n var n;\n return n = r(t), this.snapshots[n] = e;\n }, t.prototype.touch = function (t) {\n var e, n;\n return n = r(t), e = this.keys.indexOf(n), e > -1 && this.keys.splice(e, 1), this.keys.unshift(n), this.trim();\n }, t.prototype.trim = function () {\n var t, e, r, n, o;\n for (n = this.keys.splice(this.size), o = [], t = 0, r = n.length; r > t; t++) e = n[t], o.push(delete this.snapshots[e]);\n return o;\n }, r = function (t) {\n return e.Location.wrap(t).toCacheKey();\n }, t;\n }();\n }.call(this), function () {\n var t = function (t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n e.Visit = function () {\n function r(r, n, o) {\n this.controller = r, this.action = o, this.performScroll = t(this.performScroll, this), this.identifier = e.uuid(), this.location = e.Location.wrap(n), this.adapter = this.controller.adapter, this.state = \"initialized\", this.timingMetrics = {};\n }\n var n;\n return r.prototype.start = function () {\n return \"initialized\" === this.state ? (this.recordTimingMetric(\"visitStart\"), this.state = \"started\", this.adapter.visitStarted(this)) : void 0;\n }, r.prototype.cancel = function () {\n var t;\n return \"started\" === this.state ? (null != (t = this.request) && t.cancel(), this.cancelRender(), this.state = \"canceled\") : void 0;\n }, r.prototype.complete = function () {\n var t;\n return \"started\" === this.state ? (this.recordTimingMetric(\"visitEnd\"), this.state = \"completed\", \"function\" == typeof (t = this.adapter).visitCompleted && t.visitCompleted(this), this.controller.visitCompleted(this)) : void 0;\n }, r.prototype.fail = function () {\n var t;\n return \"started\" === this.state ? (this.state = \"failed\", \"function\" == typeof (t = this.adapter).visitFailed ? t.visitFailed(this) : void 0) : void 0;\n }, r.prototype.changeHistory = function () {\n var t, e;\n return this.historyChanged ? void 0 : (t = this.location.isEqualTo(this.referrer) ? \"replace\" : this.action, e = n(t), this.controller[e](this.location, this.restorationIdentifier), this.historyChanged = !0);\n }, r.prototype.issueRequest = function () {\n return this.shouldIssueRequest() && null == this.request ? (this.progress = 0, this.request = new e.HttpRequest(this, this.location, this.referrer), this.request.send()) : void 0;\n }, r.prototype.getCachedSnapshot = function () {\n var t;\n return !(t = this.controller.getCachedSnapshotForLocation(this.location)) || null != this.location.anchor && !t.hasAnchor(this.location.anchor) || \"restore\" !== this.action && !t.isPreviewable() ? void 0 : t;\n }, r.prototype.hasCachedSnapshot = function () {\n return null != this.getCachedSnapshot();\n }, r.prototype.loadCachedSnapshot = function () {\n var t, e;\n return (e = this.getCachedSnapshot()) ? (t = this.shouldIssueRequest(), this.render(function () {\n var r;\n return this.cacheSnapshot(), this.controller.render({\n snapshot: e,\n isPreview: t\n }, this.performScroll), \"function\" == typeof (r = this.adapter).visitRendered && r.visitRendered(this), t ? void 0 : this.complete();\n })) : void 0;\n }, r.prototype.loadResponse = function () {\n return null != this.response ? this.render(function () {\n var t, e;\n return this.cacheSnapshot(), this.request.failed ? (this.controller.render({\n error: this.response\n }, this.performScroll), \"function\" == typeof (t = this.adapter).visitRendered && t.visitRendered(this), this.fail()) : (this.controller.render({\n snapshot: this.response\n }, this.performScroll), \"function\" == typeof (e = this.adapter).visitRendered && e.visitRendered(this), this.complete());\n }) : void 0;\n }, r.prototype.followRedirect = function () {\n return this.redirectedToLocation && !this.followedRedirect ? (this.location = this.redirectedToLocation, this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation, this.restorationIdentifier), this.followedRedirect = !0) : void 0;\n }, r.prototype.requestStarted = function () {\n var t;\n return this.recordTimingMetric(\"requestStart\"), \"function\" == typeof (t = this.adapter).visitRequestStarted ? t.visitRequestStarted(this) : void 0;\n }, r.prototype.requestProgressed = function (t) {\n var e;\n return this.progress = t, \"function\" == typeof (e = this.adapter).visitRequestProgressed ? e.visitRequestProgressed(this) : void 0;\n }, r.prototype.requestCompletedWithResponse = function (t, r) {\n return this.response = t, null != r && (this.redirectedToLocation = e.Location.wrap(r)), this.adapter.visitRequestCompleted(this);\n }, r.prototype.requestFailedWithStatusCode = function (t, e) {\n return this.response = e, this.adapter.visitRequestFailedWithStatusCode(this, t);\n }, r.prototype.requestFinished = function () {\n var t;\n return this.recordTimingMetric(\"requestEnd\"), \"function\" == typeof (t = this.adapter).visitRequestFinished ? t.visitRequestFinished(this) : void 0;\n }, r.prototype.performScroll = function () {\n return this.scrolled ? void 0 : (\"restore\" === this.action ? this.scrollToRestoredPosition() || this.scrollToTop() : this.scrollToAnchor() || this.scrollToTop(), this.scrolled = !0);\n }, r.prototype.scrollToRestoredPosition = function () {\n var t, e;\n return t = null != (e = this.restorationData) ? e.scrollPosition : void 0, null != t ? (this.controller.scrollToPosition(t), !0) : void 0;\n }, r.prototype.scrollToAnchor = function () {\n return null != this.location.anchor ? (this.controller.scrollToAnchor(this.location.anchor), !0) : void 0;\n }, r.prototype.scrollToTop = function () {\n return this.controller.scrollToPosition({\n x: 0,\n y: 0\n });\n }, r.prototype.recordTimingMetric = function (t) {\n var e;\n return null != (e = this.timingMetrics)[t] ? e[t] : e[t] = new Date().getTime();\n }, r.prototype.getTimingMetrics = function () {\n return e.copyObject(this.timingMetrics);\n }, n = function (t) {\n switch (t) {\n case \"replace\":\n return \"replaceHistoryWithLocationAndRestorationIdentifier\";\n case \"advance\":\n case \"restore\":\n return \"pushHistoryWithLocationAndRestorationIdentifier\";\n }\n }, r.prototype.shouldIssueRequest = function () {\n return \"restore\" === this.action ? !this.hasCachedSnapshot() : !0;\n }, r.prototype.cacheSnapshot = function () {\n return this.snapshotCached ? void 0 : (this.controller.cacheSnapshot(), this.snapshotCached = !0);\n }, r.prototype.render = function (t) {\n return this.cancelRender(), this.frame = requestAnimationFrame(function (e) {\n return function () {\n return e.frame = null, t.call(e);\n };\n }(this));\n }, r.prototype.cancelRender = function () {\n return this.frame ? cancelAnimationFrame(this.frame) : void 0;\n }, r;\n }();\n }.call(this), function () {\n var t = function (t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n e.Controller = function () {\n function r() {\n this.clickBubbled = t(this.clickBubbled, this), this.clickCaptured = t(this.clickCaptured, this), this.pageLoaded = t(this.pageLoaded, this), this.history = new e.History(this), this.view = new e.View(this), this.scrollManager = new e.ScrollManager(this), this.restorationData = {}, this.clearCache(), this.setProgressBarDelay(500);\n }\n return r.prototype.start = function () {\n return e.supported && !this.started ? (addEventListener(\"click\", this.clickCaptured, !0), addEventListener(\"DOMContentLoaded\", this.pageLoaded, !1), this.scrollManager.start(), this.startHistory(), this.started = !0, this.enabled = !0) : void 0;\n }, r.prototype.disable = function () {\n return this.enabled = !1;\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"click\", this.clickCaptured, !0), removeEventListener(\"DOMContentLoaded\", this.pageLoaded, !1), this.scrollManager.stop(), this.stopHistory(), this.started = !1) : void 0;\n }, r.prototype.clearCache = function () {\n return this.cache = new e.SnapshotCache(10);\n }, r.prototype.visit = function (t, r) {\n var n, o;\n return null == r && (r = {}), t = e.Location.wrap(t), this.applicationAllowsVisitingLocation(t) ? this.locationIsVisitable(t) ? (n = null != (o = r.action) ? o : \"advance\", this.adapter.visitProposedToLocationWithAction(t, n)) : window.location = t : void 0;\n }, r.prototype.startVisitToLocationWithAction = function (t, r, n) {\n var o;\n return e.supported ? (o = this.getRestorationDataForIdentifier(n), this.startVisit(t, r, {\n restorationData: o\n })) : window.location = t;\n }, r.prototype.setProgressBarDelay = function (t) {\n return this.progressBarDelay = t;\n }, r.prototype.startHistory = function () {\n return this.location = e.Location.wrap(window.location), this.restorationIdentifier = e.uuid(), this.history.start(), this.history.replace(this.location, this.restorationIdentifier);\n }, r.prototype.stopHistory = function () {\n return this.history.stop();\n }, r.prototype.pushHistoryWithLocationAndRestorationIdentifier = function (t, r) {\n return this.restorationIdentifier = r, this.location = e.Location.wrap(t), this.history.push(this.location, this.restorationIdentifier);\n }, r.prototype.replaceHistoryWithLocationAndRestorationIdentifier = function (t, r) {\n return this.restorationIdentifier = r, this.location = e.Location.wrap(t), this.history.replace(this.location, this.restorationIdentifier);\n }, r.prototype.historyPoppedToLocationWithRestorationIdentifier = function (t, r) {\n var n;\n return this.restorationIdentifier = r, this.enabled ? (n = this.getRestorationDataForIdentifier(this.restorationIdentifier), this.startVisit(t, \"restore\", {\n restorationIdentifier: this.restorationIdentifier,\n restorationData: n,\n historyChanged: !0\n }), this.location = e.Location.wrap(t)) : this.adapter.pageInvalidated();\n }, r.prototype.getCachedSnapshotForLocation = function (t) {\n var e;\n return null != (e = this.cache.get(t)) ? e.clone() : void 0;\n }, r.prototype.shouldCacheSnapshot = function () {\n return this.view.getSnapshot().isCacheable();\n }, r.prototype.cacheSnapshot = function () {\n var t, r;\n return this.shouldCacheSnapshot() ? (this.notifyApplicationBeforeCachingSnapshot(), r = this.view.getSnapshot(), t = this.lastRenderedLocation, e.defer(function (e) {\n return function () {\n return e.cache.put(t, r.clone());\n };\n }(this))) : void 0;\n }, r.prototype.scrollToAnchor = function (t) {\n var e;\n return (e = this.view.getElementForAnchor(t)) ? this.scrollToElement(e) : this.scrollToPosition({\n x: 0,\n y: 0\n });\n }, r.prototype.scrollToElement = function (t) {\n return this.scrollManager.scrollToElement(t);\n }, r.prototype.scrollToPosition = function (t) {\n return this.scrollManager.scrollToPosition(t);\n }, r.prototype.scrollPositionChanged = function (t) {\n var e;\n return e = this.getCurrentRestorationData(), e.scrollPosition = t;\n }, r.prototype.render = function (t, e) {\n return this.view.render(t, e);\n }, r.prototype.viewInvalidated = function () {\n return this.adapter.pageInvalidated();\n }, r.prototype.viewWillRender = function (t) {\n return this.notifyApplicationBeforeRender(t);\n }, r.prototype.viewRendered = function () {\n return this.lastRenderedLocation = this.currentVisit.location, this.notifyApplicationAfterRender();\n }, r.prototype.pageLoaded = function () {\n return this.lastRenderedLocation = this.location, this.notifyApplicationAfterPageLoad();\n }, r.prototype.clickCaptured = function () {\n return removeEventListener(\"click\", this.clickBubbled, !1), addEventListener(\"click\", this.clickBubbled, !1);\n }, r.prototype.clickBubbled = function (t) {\n var e, r, n;\n return this.enabled && this.clickEventIsSignificant(t) && (r = this.getVisitableLinkForNode(t.target)) && (n = this.getVisitableLocationForLink(r)) && this.applicationAllowsFollowingLinkToLocation(r, n) ? (t.preventDefault(), e = this.getActionForLink(r), this.visit(n, {\n action: e\n })) : void 0;\n }, r.prototype.applicationAllowsFollowingLinkToLocation = function (t, e) {\n var r;\n return r = this.notifyApplicationAfterClickingLinkToLocation(t, e), !r.defaultPrevented;\n }, r.prototype.applicationAllowsVisitingLocation = function (t) {\n var e;\n return e = this.notifyApplicationBeforeVisitingLocation(t), !e.defaultPrevented;\n }, r.prototype.notifyApplicationAfterClickingLinkToLocation = function (t, r) {\n return e.dispatch(\"turbolinks:click\", {\n target: t,\n data: {\n url: r.absoluteURL\n },\n cancelable: !0\n });\n }, r.prototype.notifyApplicationBeforeVisitingLocation = function (t) {\n return e.dispatch(\"turbolinks:before-visit\", {\n data: {\n url: t.absoluteURL\n },\n cancelable: !0\n });\n }, r.prototype.notifyApplicationAfterVisitingLocation = function (t) {\n return e.dispatch(\"turbolinks:visit\", {\n data: {\n url: t.absoluteURL\n }\n });\n }, r.prototype.notifyApplicationBeforeCachingSnapshot = function () {\n return e.dispatch(\"turbolinks:before-cache\");\n }, r.prototype.notifyApplicationBeforeRender = function (t) {\n return e.dispatch(\"turbolinks:before-render\", {\n data: {\n newBody: t\n }\n });\n }, r.prototype.notifyApplicationAfterRender = function () {\n return e.dispatch(\"turbolinks:render\");\n }, r.prototype.notifyApplicationAfterPageLoad = function (t) {\n return null == t && (t = {}), e.dispatch(\"turbolinks:load\", {\n data: {\n url: this.location.absoluteURL,\n timing: t\n }\n });\n }, r.prototype.startVisit = function (t, e, r) {\n var n;\n return null != (n = this.currentVisit) && n.cancel(), this.currentVisit = this.createVisit(t, e, r), this.currentVisit.start(), this.notifyApplicationAfterVisitingLocation(t);\n }, r.prototype.createVisit = function (t, r, n) {\n var o, i, s, a, u;\n return i = null != n ? n : {}, a = i.restorationIdentifier, s = i.restorationData, o = i.historyChanged, u = new e.Visit(this, t, r), u.restorationIdentifier = null != a ? a : e.uuid(), u.restorationData = e.copyObject(s), u.historyChanged = o, u.referrer = this.location, u;\n }, r.prototype.visitCompleted = function (t) {\n return this.notifyApplicationAfterPageLoad(t.getTimingMetrics());\n }, r.prototype.clickEventIsSignificant = function (t) {\n return !(t.defaultPrevented || t.target.isContentEditable || t.which > 1 || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey);\n }, r.prototype.getVisitableLinkForNode = function (t) {\n return this.nodeIsVisitable(t) ? e.closest(t, \"a[href]:not([target]):not([download])\") : void 0;\n }, r.prototype.getVisitableLocationForLink = function (t) {\n var r;\n return r = new e.Location(t.getAttribute(\"href\")), this.locationIsVisitable(r) ? r : void 0;\n }, r.prototype.getActionForLink = function (t) {\n var e;\n return null != (e = t.getAttribute(\"data-turbolinks-action\")) ? e : \"advance\";\n }, r.prototype.nodeIsVisitable = function (t) {\n var r;\n return (r = e.closest(t, \"[data-turbolinks]\")) ? \"false\" !== r.getAttribute(\"data-turbolinks\") : !0;\n }, r.prototype.locationIsVisitable = function (t) {\n return t.isPrefixedBy(this.view.getRootLocation()) && t.isHTML();\n }, r.prototype.getCurrentRestorationData = function () {\n return this.getRestorationDataForIdentifier(this.restorationIdentifier);\n }, r.prototype.getRestorationDataForIdentifier = function (t) {\n var e;\n return null != (e = this.restorationData)[t] ? e[t] : e[t] = {};\n }, r;\n }();\n }.call(this), function () {\n !function () {\n var t, e;\n if ((t = e = document.currentScript) && !e.hasAttribute(\"data-turbolinks-suppress-warning\")) for (; t = t.parentNode;) if (t === document.body) return console.warn(\"You are loading Turbolinks from a