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OAAM,WAW/B,OAVIF,EAAiBC,SAAS,QAC5BD,EAAiBG,YAAY,OAC7BH,EAAiBI,SAAS,MAE1BP,MAEAG,EAAiBG,YAAY,MAC7BH,EAAiBI,SAAS,SAGrB,CACT,GACF,C,8CCCA,IA1BmB,WACjBtC,IAAE,yBAAyBuC,GAAG,UAAU,WACtC,IAGIC,EAHEC,EAAYC,KAAKC,MAKrBH,EADe,gBAHAtD,OAAO0D,SAASC,SAIjB,8BAAqCJ,EAErCvD,OAAO0D,SAASC,SAAW,eAAiBJ,EAG5DvD,OAAO4D,MAAMC,MAAMP,EACrB,IAEAxC,IAAE,sBAAsBuC,GAAG,SAAS,WAClC,IAAMI,EAAQ3C,IAAE0C,MAAMM,MAAMC,cAE5BjD,IAAE,oCAAoCkD,QAAO,WAC3C,IAAMC,EAAiBnD,IAAE0C,MAAMU,KAAK,iBAAiBH,cAErDjD,IAAE0C,MAAMW,OAAOF,EAAeG,SAASX,GACzC,GACF,GACF,C","sources":["webpack:///./app/javascript/packs/application.js","webpack:///./app/javascript/packs/lib/onboarding.js","webpack:///./app/javascript/packs/lib/references.js"],"sourcesContent":["import $ from 'jquery';\nimport autosize from 'autosize';\nimport 'select2';\nimport 'select2/dist/css/select2.min.css';\nimport Rails from '@rails/ujs';\nimport '@popperjs/core';\nimport { Alert } from 'bootstrap';\nimport '@oddcamp/cocoon-vanilla-js';\nimport _ from 'lodash/fp';\nimport '@hotwired/turbo-rails';\nimport 'vanilla-cookieconsent/dist/cookieconsent.css';\nimport * as CookieConsent from 'vanilla-cookieconsent';\n\nimport './css/site.scss';\nimport onboarding from './lib/onboarding';\nimport references from './lib/references';\n\nif (!window._rails_loaded) Rails.start();\n\nconst fadeOutFlash = () => {\n const alertNode = document.querySelector('.alert-dismissible');\n if (_.isNil(alertNode)) return;\n\n const alert = new Alert(alertNode);\n alert.close();\n};\n\ndocument.addEventListener('turbo:load', () => {\n autosize(document.querySelector('textarea'));\n onboarding();\n references();\n\n if ($('.select2').length === 0) {\n $('#reference_list_names').select2({ tags: true });\n $('#list_names').select2({ tags: true });\n }\n\n window.setTimeout(fadeOutFlash, 2000);\n\n CookieConsent.run({\n categories: {\n necessary: {\n enabled: true,\n readOnly: true\n },\n analytics: {\n enabled: true,\n readOnly: false,\n autoClear: {\n reloadPage: true\n }\n },\n },\n guiOptions: {\n consentModal: {\n layout: 'box',\n position: 'bottom left',\n }\n },\n language: {\n default: 'en',\n translations: {\n en: {\n consentModal: {\n title: 'We use cookies',\n description: 'We use cookies to improve your experience and analyze traffic. Manage your preferences or accept all.',\n acceptAllBtn: 'Accept all',\n acceptNecessaryBtn: 'Reject all',\n showPreferencesBtn: 'Manage Individual preferences'\n },\n preferencesModal: {\n title: 'Manage cookie preferences',\n acceptAllBtn: 'Accept all',\n acceptNecessaryBtn: 'Reject all',\n savePreferencesBtn: 'Accept current selection',\n closeIconLabel: 'Close modal',\n sections: [\n {\n title: 'Somebody said ... cookies?',\n description: 'By using cookies, we ensure that our website functions properly and provide insights into how you use it to improve our services.'\n },\n {\n title: 'Strictly Necessary cookies',\n description: 'These cookies are essential for the proper functioning of the website and cannot be disabled.',\n linkedCategory: 'necessary'\n },\n {\n title: 'Performance and Analytics',\n description: 'These cookies collect information about how you use our website. All of the data is anonymized and cannot be used to identify you.',\n linkedCategory: 'analytics'\n },\n {\n title: 'More information',\n description: 'For any queries in relation to my policy on cookies and your choices, please contact us'\n }\n ]\n }\n }\n }\n }\n });\n});\n","import $ from 'jquery';\n\nconst onboarding = () => {\n const setPageHeight = () => {\n const $fullPage = $('.full-page');\n $fullPage.height($fullPage.height() + $onboardingSteps.height());\n };\n\n const $onboardingSteps = $('#onboarding_steps');\n\n if ($onboardingSteps.hasClass('on')) {\n setPageHeight();\n }\n\n $('#onboarding_container').click(function(){\n if ($onboardingSteps.hasClass('off')) {\n $onboardingSteps.removeClass('off');\n $onboardingSteps.addClass('on');\n\n setPageHeight();\n } else {\n $onboardingSteps.removeClass('on');\n $onboardingSteps.addClass('off');\n }\n\n return false;\n });\n};\n\nexport default onboarding;\n","import $ from 'jquery';\n\nconst references = () => {\n $('#reference_entry_type').on('change', function () {\n const entryType = this.value;\n const pathname = window.location.pathname;\n\n let newLocation;\n if (pathname === '/references') {\n newLocation = '/references/new' + '?entry_type=' + entryType;\n } else {\n newLocation = window.location.pathname + '?entry_type=' + entryType;\n }\n\n window.Turbo.visit(newLocation);\n });\n\n $('#references-search').on('keyup', function () {\n const value = $(this).val().toLowerCase();\n\n $('#references-table .reference-row').filter(function () {\n const referenceValue = $(this).data('searchable-by').toLowerCase();\n\n $(this).toggle(referenceValue.includes(value));\n });\n });\n};\n\nexport default references;\n"],"names":["window","_rails_loaded","Rails","fadeOutFlash","alertNode","document","querySelector","_","Alert","close","addEventListener","autosize","onboarding","references","$","length","select2","tags","setTimeout","CookieConsent","categories","necessary","enabled","readOnly","analytics","autoClear","reloadPage","guiOptions","consentModal","layout","position","language","default","translations","en","title","description","acceptAllBtn","acceptNecessaryBtn","showPreferencesBtn","preferencesModal","savePreferencesBtn","closeIconLabel","sections","linkedCategory","setPageHeight","$fullPage","height","$onboardingSteps","hasClass","click","removeClass","addClass","on","newLocation","entryType","this","value","location","pathname","Turbo","visit","val","toLowerCase","filter","referenceValue","data","toggle","includes"],"sourceRoot":""}