{"version":3,"file":"application-Dv697HeS.js","sources":["../../../app/frontend/utils/setupServiceWorker.ts","../../../app/frontend/utils/metaContent.ts","../../../app/frontend/utils/setupHoneybadger.ts","../../../app/frontend/utils/setupPlausible.ts","../../../app/frontend/controllers/app_flash_controller.ts","../../../app/frontend/controllers/clicks_controller.ts","../../../app/frontend/controllers/online_status_controller.ts","../../../app/frontend/controllers/timeago_controller.ts","../../../app/frontend/utils/setupStimulus.ts","../../../app/frontend/utils/setupViewTransitions.ts"],"sourcesContent":["import { register } from 'register-service-worker';\n\nregister('/sw.js', {\n registrationOptions: { scope: './' },\n ready(_registration) {\n console.log('Service worker is active.');\n },\n registered(_registration) {\n console.log('Service worker has been registered.');\n },\n cached(_registration) {\n console.log('Content has been cached for offline use.');\n },\n updatefound(_registration) {\n console.log('New content is downloading.');\n },\n updated(_registration) {\n console.log('New content is available; please refresh.');\n },\n offline() {\n console.log(\n 'No internet connection found. App is running in offline mode.',\n );\n },\n error(error) {\n console.error('Error during service worker registration:', error);\n },\n});\n","export function metaContent(name: string): string | undefined {\n const element = document.head.querySelector(\n `meta[name=\"${name}\"]`,\n ) as HTMLMetaElement;\n\n if (element) return element.content;\n}\n","import Honeybadger from '@honeybadger-io/js';\nimport { metaContent } from './metaContent';\n\nconst honeybadgerApiKey = metaContent('honeybadger-api-key');\nif (honeybadgerApiKey) {\n const gitCommitVersion = metaContent('git-commit-version');\n\n Honeybadger.configure({\n apiKey: honeybadgerApiKey,\n environment: 'production',\n revision: gitCommitVersion,\n });\n}\n","import Plausible from 'plausible-tracker';\nimport { metaContent } from './metaContent';\n\nconst plausibleUrl = metaContent('plausible-url');\nif (plausibleUrl) {\n const plausible = Plausible({\n domain: metaContent('app-host') || window.location.host,\n apiHost: plausibleUrl,\n });\n\n plausible.enableAutoOutboundTracking();\n\n document.addEventListener('turbo:load', () => plausible.trackPageview());\n}\n","import { Controller } from '@hotwired/stimulus';\n\n// @ts-ignore\nimport { enter, leave } from 'el-transition';\n\nexport default class extends Controller {\n connect() {\n enter(this.element).then(() => {\n setTimeout(() => {\n this.remove();\n }, 2000);\n });\n }\n\n remove() {\n leave(this.element).then(() => {\n this.element.remove();\n });\n }\n}\n","import { Controller } from '@hotwired/stimulus';\n\n// @ts-ignore\nimport { enter, leave } from 'el-transition';\n\nimport { StreamElement } from '@hotwired/turbo';\n\nexport default class extends Controller {\n static targets = ['counter', 'list'];\n\n declare readonly hasCounterTarget: boolean;\n declare readonly counterTarget: HTMLElement;\n\n declare readonly hasListTarget: boolean;\n declare readonly listTarget: HTMLElement;\n\n static values = {\n count: Number,\n };\n\n declare countValue: number;\n declare readonly hasCountValue: boolean;\n\n currentCount = 0;\n\n connect() {\n this.currentCount = this.countValue;\n this.renderCount();\n }\n\n receive(event: Event) {\n if ((event.target as StreamElement).target === 'list') {\n this.updateList();\n this.increaseCounter();\n }\n }\n\n increaseCounter() {\n if (this.hasCounterTarget)\n leave(this.counterTarget).then(() => {\n this.currentCount++;\n this.renderCount();\n\n enter(this.counterTarget);\n });\n }\n\n updateList() {\n // Scroll down list\n enter(this.listTarget).then(() => {\n // Fade in new element\n enter(this.listTarget.firstElementChild);\n });\n\n if (this.currentCount > 5)\n // Fade out and remove last element\n leave(this.listTarget.lastElementChild).then(() =>\n this.listTarget.lastElementChild?.remove(),\n );\n }\n\n renderCount() {\n if (this.hasCounterTarget)\n this.counterTarget.textContent = this.currentCount.toLocaleString();\n }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nexport default class extends Controller {\n static readonly targets = ['indicator'];\n\n declare readonly hasIndicatorTarget: boolean;\n declare readonly indicatorTarget: HTMLElement;\n\n declare boundSetOnline: () => void;\n declare boundSetOffline: () => void;\n\n connect() {\n this.boundSetOnline = this.setOnline.bind(this);\n window.addEventListener('online', this.boundSetOnline);\n\n this.boundSetOffline = this.setOffline.bind(this);\n window.addEventListener('offline', this.boundSetOffline);\n }\n\n disconnect() {\n window.removeEventListener('online', this.boundSetOnline);\n window.removeEventListener('offline', this.boundSetOffline);\n }\n\n setOnline() {\n if (this.hasIndicatorTarget) {\n this.indicatorTarget.textContent = '';\n this.indicatorTarget.classList.add('hidden');\n }\n }\n\n setOffline() {\n if (this.hasIndicatorTarget) {\n this.indicatorTarget.textContent = 'You are offline';\n this.indicatorTarget.classList.remove('hidden');\n }\n }\n}\n","import { Controller } from '@hotwired/stimulus';\nimport * as timeago from 'timeago.js';\n\nexport default class extends Controller {\n connect() {\n timeago.render(this.element);\n }\n\n disconnect() {\n timeago.cancel();\n }\n}\n","import { Application } from '@hotwired/stimulus';\nimport { registerControllers } from 'stimulus-vite-helpers';\n\n// Start Stimulus application\nconst application = Application.start();\n\n// Load and register controllers\nregisterControllers(\n application,\n import.meta.glob('../controllers/*_controller.{ts,js}', { eager: true }),\n);\n","// View Transitions API is currently available in Chrome only\n// https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility\nif (document.startViewTransition)\n addEventListener('turbo:before-render', (event) => {\n const turboEvent = event as CustomEvent;\n const originalRender = turboEvent.detail.render;\n\n turboEvent.detail.render = (\n currentElement: HTMLElement,\n newElement: HTMLElement,\n ) =>\n document.startViewTransition?.(() =>\n originalRender(currentElement, newElement),\n );\n });\n"],"names":["register","_registration","error","metaContent","name","element","honeybadgerApiKey","gitCommitVersion","Honeybadger","plausibleUrl","plausible","Plausible","app_flash_controller","Controller","enter","leave","clicks_controller","__publicField","event","_a","online_status_controller","timeago_controller","timeago.render","timeago.cancel","application","Application","registerControllers","__vite_glob_0_0","__vite_glob_0_1","__vite_glob_0_2","__vite_glob_0_3","turboEvent","originalRender","currentElement","newElement"],"mappings":"4QAEAA,EAAS,SAAU,CACjB,oBAAqB,CAAE,MAAO,IAAK,EACnC,MAAMC,EAAe,CACnB,QAAQ,IAAI,2BAA2B,CACzC,EACA,WAAWA,EAAe,CACxB,QAAQ,IAAI,qCAAqC,CACnD,EACA,OAAOA,EAAe,CACpB,QAAQ,IAAI,0CAA0C,CACxD,EACA,YAAYA,EAAe,CACzB,QAAQ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