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AI,SAAAiD,GAC3B,IAAMC,EAAQC,KAAKC,MAAMH,EAAYR,QAAQY,YAM7C,OAJKH,EAAMI,QACTJ,EAAMI,MAAQL,EAAYM,WAGrBL,CACT,GACF,M,yFAAC,CAnCF,CAE4BM,EAAAA,IAAU/B,EAC9BgC,QAAU,CAAC,Q,wECNpBC,IAAAA,QAEA,IAAMC,EAAcC,EAAAA,GAAYC,QAC1BC,EAAUC,EAAAA,MACVC,EAAgBD,EAAAA,MAEtBJ,EAAYM,MAAKC,EAAAA,EAAAA,IAAuBJ,IACxCH,EAAYM,MAAKC,EAAAA,EAAAA,IAAuBF,IAExC7B,SAASgC,iBAAiB,oBAAoB,WACxCC,OAAOC,SACTD,OAAOC,QAAQC,QAAQ,YAE3B,G","sources":["webpack://paint_pad/./app/assets/controllers/shared/ sync nonrecursive \\.(js%7Cts)x","webpack://paint_pad/./app/assets/controllers/shared/slideshow_controller.js","webpack://paint_pad/./app/assets/entrypoints/application.js"],"sourcesContent":["var map = {\n\t\"./slideshow_controller.js\": 2262,\n\t\"controllers/shared/slideshow_controller.js\": 2262\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 6064;","import PhotoSwipe from \"photoswipe\"\nimport PhotoSwipeUI from \"photoswipe/dist/photoswipe-ui-default\"\nimport { Controller } from \"stimulus\"\n\nimport \"photoswipe/dist/photoswipe.css\"\nimport \"photoswipe/dist/default-skin/default-skin.css\"\n\nconst DEFAULT_OPTIONS = {\n index: 0,\n history: false,\n closeOnScroll: false\n}\n\nconst indexForSlideId = (slideId, slides) => {\n if (slideId === null || slideId === undefined) return\n\n return slides.findIndex(slide => slide.id == slideId)\n}\n\nexport default class extends Controller {\n static targets = [\"slide\"]\n\n get slideshowElement() {\n this._slideshowElement =\n this._slideshowElement || document.getElementById(\"slideshow\")\n return this._slideshowElement\n }\n\n showSlide(event) {\n event.preventDefault()\n\n const slideId = event.currentTarget.dataset.slideId\n const slides = this.collectSlides()\n\n const slideshow = new PhotoSwipe(this.slideshowElement, PhotoSwipeUI, slides, {\n ...DEFAULT_OPTIONS,\n index: indexForSlideId(slideId, slides) || 0\n })\n\n slideshow.init()\n }\n\n collectSlides() {\n return this.slideTargets.map(slideTarget => {\n const props = JSON.parse(slideTarget.dataset.slideProps)\n\n if (!props.title) {\n props.title = slideTarget.innerHTML\n }\n\n return props\n })\n }\n}\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//\n// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate\n// layout file, like app/views/layouts/application.html.erb\n\nimport Turbolinks from \"turbolinks\"\nimport { Application } from \"stimulus\"\nimport { definitionsFromContext } from \"stimulus/webpack-helpers\"\n\nimport \"../styles/index.scss\"\n\nTurbolinks.start()\n\nconst application = Application.start()\nconst context = require.context(\"./../controllers/application\", false, /\\.(js|ts)x?$/)\nconst sharedContext = require.context(\"./../controllers/shared\", false, /\\.(js|ts)x?$/)\n\napplication.load(definitionsFromContext(context))\napplication.load(definitionsFromContext(sharedContext))\n\ndocument.addEventListener(\"turbolinks:visit\", function () {\n if (window.posthog) {\n window.posthog.capture(\"$pageview\")\n }\n})\n"],"names":["map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","DEFAULT_OPTIONS","index","history","closeOnScroll","indexForSlideId","slideId","slides","undefined","findIndex","slide","_default","_Controller","_classCallCheck","_callSuper","arguments","_inherits","key","get","this","_slideshowElement","document","getElementById","value","event","preventDefault","currentTarget","dataset","collectSlides","PhotoSwipe","slideshowElement","PhotoSwipeUI","_objectSpread","init","slideTargets","slideTarget","props","JSON","parse","slideProps","title","innerHTML","Controller","targets","Turbolinks","application","Application","start","context","require","sharedContext","load","definitionsFromContext","addEventListener","window","posthog","capture"],"sourceRoot":""}